@xwiki/cristal-electron-settings-main 0.22.0 → 0.23.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 +12 -0
- package/dist/defaultSettings.json.d.ts +4 -4
- package/dist/index.es.js +7 -7
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +8 -8
- package/src/defaultSettings.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @xwiki/cristal-electron-settings-main
|
|
2
2
|
|
|
3
|
+
## 0.23.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Cristal 0.23 Release
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @xwiki/cristal-configuration-api@0.23.0
|
|
13
|
+
- @xwiki/cristal-settings-api@0.23.0
|
|
14
|
+
|
|
3
15
|
## 0.22.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -6,7 +6,7 @@ declare const _default: {
|
|
|
6
6
|
"serverRendering": false,
|
|
7
7
|
"offline": false,
|
|
8
8
|
"designSystem": "vuetify",
|
|
9
|
-
"editor": "
|
|
9
|
+
"editor": "blocknote"
|
|
10
10
|
},
|
|
11
11
|
"FileSystemSL": {
|
|
12
12
|
"name": "FileSystemSL",
|
|
@@ -14,7 +14,7 @@ declare const _default: {
|
|
|
14
14
|
"serverRendering": false,
|
|
15
15
|
"offline": false,
|
|
16
16
|
"designSystem": "shoelace",
|
|
17
|
-
"editor": "
|
|
17
|
+
"editor": "blocknote"
|
|
18
18
|
},
|
|
19
19
|
"XWiki": {
|
|
20
20
|
"name": "XWiki",
|
|
@@ -25,7 +25,7 @@ declare const _default: {
|
|
|
25
25
|
"baseRestURL": "/rest/cristal/page?media=json",
|
|
26
26
|
"homePage": "Main.WebHome",
|
|
27
27
|
"designSystem": "vuetify",
|
|
28
|
-
"editor": "
|
|
28
|
+
"editor": "blocknote",
|
|
29
29
|
"realtimeURL": "https://cristal.demo.xwiki.com:8093/collaboration"
|
|
30
30
|
},
|
|
31
31
|
"XWikiSL": {
|
|
@@ -37,7 +37,7 @@ declare const _default: {
|
|
|
37
37
|
"baseRestURL": "/rest/cristal/page?media=json",
|
|
38
38
|
"homePage": "Main.WebHome",
|
|
39
39
|
"designSystem": "shoelace",
|
|
40
|
-
"editor": "
|
|
40
|
+
"editor": "blocknote",
|
|
41
41
|
"realtimeURL": "https://cristal.demo.xwiki.com:8093/collaboration"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "electron-store";
|
|
2
2
|
import { ipcMain as t } from "electron";
|
|
3
|
-
const r = { FileSystem: { name: "FileSystem", configType: "FileSystem", serverRendering: !1, offline: !1, designSystem: "vuetify", editor: "
|
|
3
|
+
const r = { FileSystem: { name: "FileSystem", configType: "FileSystem", serverRendering: !1, offline: !1, designSystem: "vuetify", editor: "blocknote" }, FileSystemSL: { name: "FileSystemSL", configType: "FileSystem", serverRendering: !1, offline: !1, designSystem: "shoelace", editor: "blocknote" }, XWiki: { name: "XWiki", configType: "XWiki", serverRendering: !1, offline: !1, baseURL: "https://cristal-backend.demo.xwiki.com/xwiki", baseRestURL: "/rest/cristal/page?media=json", homePage: "Main.WebHome", designSystem: "vuetify", editor: "blocknote", realtimeURL: "https://cristal.demo.xwiki.com:8093/collaboration" }, XWikiSL: { name: "XWikiSL", configType: "XWiki", serverRendering: !1, offline: !1, baseURL: "https://cristal-backend.demo.xwiki.com/xwiki", baseRestURL: "/rest/cristal/page?media=json", homePage: "Main.WebHome", designSystem: "shoelace", editor: "blocknote", realtimeURL: "https://cristal.demo.xwiki.com:8093/collaboration" } }, c = {
|
|
4
4
|
configuration: r
|
|
5
5
|
}, l = "configuration", n = "_raw", f = {
|
|
6
6
|
_raw: {
|
|
@@ -9,7 +9,7 @@ const r = { FileSystem: { name: "FileSystem", configType: "FileSystem", serverRe
|
|
|
9
9
|
configuration: {
|
|
10
10
|
type: "object"
|
|
11
11
|
}
|
|
12
|
-
}, i = new
|
|
12
|
+
}, i = new a({
|
|
13
13
|
name: "settings",
|
|
14
14
|
// Here, we want to keep in the store the raw string representation of the
|
|
15
15
|
// file, since it should be parsed and serialized by the SettingsManager
|
|
@@ -25,7 +25,7 @@ function s(e) {
|
|
|
25
25
|
function g() {
|
|
26
26
|
return i.size < 2 && s(JSON.stringify(c, null, 2)), i.get(n);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function k() {
|
|
29
29
|
return i.get(l);
|
|
30
30
|
}
|
|
31
31
|
function m(e) {
|
|
@@ -38,14 +38,14 @@ function u() {
|
|
|
38
38
|
t.handle(
|
|
39
39
|
"settings:save",
|
|
40
40
|
async (e, {
|
|
41
|
-
settings:
|
|
41
|
+
settings: o
|
|
42
42
|
}) => {
|
|
43
|
-
m(
|
|
43
|
+
m(o);
|
|
44
44
|
}
|
|
45
45
|
), t.handle("settings:load", async () => d());
|
|
46
46
|
}
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
k as getConfigurations,
|
|
49
49
|
u as load
|
|
50
50
|
};
|
|
51
51
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("electron-store"),require("electron")):typeof define=="function"&&define.amd?define(["exports","electron-store","electron"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["cristal_settings-main"]={},e.Store,e.electron))})(this,(function(e,t,s){"use strict";const r={configuration:{FileSystem:{name:"FileSystem",configType:"FileSystem",serverRendering:!1,offline:!1,designSystem:"vuetify",editor:"
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("electron-store"),require("electron")):typeof define=="function"&&define.amd?define(["exports","electron-store","electron"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["cristal_settings-main"]={},e.Store,e.electron))})(this,(function(e,t,s){"use strict";const r={configuration:{FileSystem:{name:"FileSystem",configType:"FileSystem",serverRendering:!1,offline:!1,designSystem:"vuetify",editor:"blocknote"},FileSystemSL:{name:"FileSystemSL",configType:"FileSystem",serverRendering:!1,offline:!1,designSystem:"shoelace",editor:"blocknote"},XWiki:{name:"XWiki",configType:"XWiki",serverRendering:!1,offline:!1,baseURL:"https://cristal-backend.demo.xwiki.com/xwiki",baseRestURL:"/rest/cristal/page?media=json",homePage:"Main.WebHome",designSystem:"vuetify",editor:"blocknote",realtimeURL:"https://cristal.demo.xwiki.com:8093/collaboration"},XWikiSL:{name:"XWikiSL",configType:"XWiki",serverRendering:!1,offline:!1,baseURL:"https://cristal-backend.demo.xwiki.com/xwiki",baseRestURL:"/rest/cristal/page?media=json",homePage:"Main.WebHome",designSystem:"shoelace",editor:"blocknote",realtimeURL:"https://cristal.demo.xwiki.com:8093/collaboration"}}},c="configuration",o="_raw",l={_raw:{type:"string"},configuration:{type:"object"}},n=new t({name:"settings",serialize:i=>i._raw,deserialize:i=>({_raw:i,...JSON.parse(i)}),schema:l});function a(i){n.set(o,i)}function f(){return n.size<2&&a(JSON.stringify(r,null,2)),n.get(o)}function g(){return n.get(c)}function d(i){a(i)}function m(){return f()}function u(){s.ipcMain.handle("settings:save",async(i,{settings:y})=>{d(y)}),s.ipcMain.handle("settings:load",async()=>m())}e.getConfigurations=g,e.load=u,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/storage.ts","../src/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 defaultSettings from \"./defaultSettings.json\";\nimport Store from \"electron-store\";\nimport type { Configurations } from \"@xwiki/cristal-configuration-api\";\n\nconst configurationKey = \"configuration\";\nconst settingsKey = \"_raw\";\n\nconst schema = {\n _raw: {\n type: \"string\",\n },\n configuration: {\n type: \"object\",\n },\n};\n\ntype StoreType = {\n _raw: string;\n configuration: object;\n};\n\nconst storeInstance: Store<StoreType> = new Store<StoreType>({\n name: \"settings\",\n // Here, we want to keep in the store the raw string representation of the\n // file, since it should be parsed and serialized by the SettingsManager\n // service. We still include the deserialized object in case we want to check\n // some settings values on Electron's main process.\n serialize: (value: Record<string, unknown>) => value._raw as string,\n deserialize: (value: string) => ({ _raw: value, ...JSON.parse(value) }),\n schema,\n});\n\nfunction setSettings(value: string): void {\n storeInstance.set(settingsKey, value);\n}\n\nfunction getSettings(): string {\n if (storeInstance.size < 2) {\n setSettings(JSON.stringify(defaultSettings, null, 2));\n }\n return storeInstance.get(settingsKey);\n}\n\nfunction deleteSettings(): void {\n storeInstance.delete(settingsKey);\n}\n\n/**\n * @since 0.18\n * @beta\n */\nfunction getConfigurations(): Configurations {\n return storeInstance.get(configurationKey) as Configurations;\n}\n\nexport { deleteSettings, getConfigurations, getSettings, setSettings };\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 { getConfigurations, getSettings, setSettings } from \"./storage\";\nimport { ipcMain } from \"electron\";\n\nfunction saveSettings(settings: string): void {\n setSettings(settings);\n}\n\nfunction loadSettings(): string {\n return getSettings();\n}\n\n/**\n * @since 0.18\n * @beta\n */\nfunction load(): void {\n ipcMain.handle(\n \"settings:save\",\n async (\n _event,\n {\n settings,\n }: {\n settings: string;\n },\n ): Promise<void> => {\n saveSettings(settings);\n },\n );\n\n ipcMain.handle(\"settings:load\", async (): Promise<string> => {\n return loadSettings();\n });\n}\n\nexport { getConfigurations, load };\n"],"names":["configurationKey","settingsKey","schema","storeInstance","Store","value","setSettings","getSettings","defaultSettings","getConfigurations","saveSettings","settings","loadSettings","load","ipcMain","_event"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/storage.ts","../src/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 defaultSettings from \"./defaultSettings.json\";\nimport Store from \"electron-store\";\nimport type { Configurations } from \"@xwiki/cristal-configuration-api\";\n\nconst configurationKey = \"configuration\";\nconst settingsKey = \"_raw\";\n\nconst schema = {\n _raw: {\n type: \"string\",\n },\n configuration: {\n type: \"object\",\n },\n};\n\ntype StoreType = {\n _raw: string;\n configuration: object;\n};\n\nconst storeInstance: Store<StoreType> = new Store<StoreType>({\n name: \"settings\",\n // Here, we want to keep in the store the raw string representation of the\n // file, since it should be parsed and serialized by the SettingsManager\n // service. We still include the deserialized object in case we want to check\n // some settings values on Electron's main process.\n serialize: (value: Record<string, unknown>) => value._raw as string,\n deserialize: (value: string) => ({ _raw: value, ...JSON.parse(value) }),\n schema,\n});\n\nfunction setSettings(value: string): void {\n storeInstance.set(settingsKey, value);\n}\n\nfunction getSettings(): string {\n if (storeInstance.size < 2) {\n setSettings(JSON.stringify(defaultSettings, null, 2));\n }\n return storeInstance.get(settingsKey);\n}\n\nfunction deleteSettings(): void {\n storeInstance.delete(settingsKey);\n}\n\n/**\n * @since 0.18\n * @beta\n */\nfunction getConfigurations(): Configurations {\n return storeInstance.get(configurationKey) as Configurations;\n}\n\nexport { deleteSettings, getConfigurations, getSettings, setSettings };\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 { getConfigurations, getSettings, setSettings } from \"./storage\";\nimport { ipcMain } from \"electron\";\n\nfunction saveSettings(settings: string): void {\n setSettings(settings);\n}\n\nfunction loadSettings(): string {\n return getSettings();\n}\n\n/**\n * @since 0.18\n * @beta\n */\nfunction load(): void {\n ipcMain.handle(\n \"settings:save\",\n async (\n _event,\n {\n settings,\n }: {\n settings: string;\n },\n ): Promise<void> => {\n saveSettings(settings);\n },\n );\n\n ipcMain.handle(\"settings:load\", async (): Promise<string> => {\n return loadSettings();\n });\n}\n\nexport { getConfigurations, load };\n"],"names":["configurationKey","settingsKey","schema","storeInstance","Store","value","setSettings","getSettings","defaultSettings","getConfigurations","saveSettings","settings","loadSettings","load","ipcMain","_event"],"mappings":"0sCAwBMA,EAAmB,gBACnBC,EAAc,OAEdC,EAAS,CACb,KAAM,CACJ,KAAM,QAAA,EAER,cAAe,CACb,KAAM,QAAA,CAEV,EAOMC,EAAkC,IAAIC,EAAiB,CAC3D,KAAM,WAKN,UAAYC,GAAmCA,EAAM,KACrD,YAAcA,IAAmB,CAAE,KAAMA,EAAO,GAAG,KAAK,MAAMA,CAAK,IACnE,OAAAH,CACF,CAAC,EAED,SAASI,EAAYD,EAAqB,CACxCF,EAAc,IAAIF,EAAaI,CAAK,CACtC,CAEA,SAASE,GAAsB,CAC7B,OAAIJ,EAAc,KAAO,GACvBG,EAAY,KAAK,UAAUE,EAAiB,KAAM,CAAC,CAAC,EAE/CL,EAAc,IAAIF,CAAW,CACtC,CAUA,SAASQ,GAAoC,CAC3C,OAAON,EAAc,IAAIH,CAAgB,CAC3C,CClDA,SAASU,EAAaC,EAAwB,CAC5CL,EAAYK,CAAQ,CACtB,CAEA,SAASC,GAAuB,CAC9B,OAAOL,EAAA,CACT,CAMA,SAASM,GAAa,CACpBC,EAAAA,QAAQ,OACN,gBACA,MACEC,EACA,CACE,SAAAJ,CAAA,IAIgB,CAClBD,EAAaC,CAAQ,CACvB,CAAA,EAGFG,UAAQ,OAAO,gBAAiB,SACvBF,EAAA,CACR,CACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xwiki/cristal-electron-settings-main",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"license": "LGPL 2.1",
|
|
5
5
|
"author": "XWiki Org Community <contact@xwiki.org>",
|
|
6
6
|
"homepage": "https://cristal.xwiki.org/",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"main": "./dist/index.es.js",
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"electron-store": "
|
|
32
|
-
"@xwiki/cristal-configuration-api": "0.
|
|
33
|
-
"@xwiki/cristal-settings-api": "0.
|
|
31
|
+
"electron-store": "11.0.0",
|
|
32
|
+
"@xwiki/cristal-configuration-api": "0.23.0",
|
|
33
|
+
"@xwiki/cristal-settings-api": "0.23.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"electron": "
|
|
36
|
+
"electron": "38.2.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"typescript": "5.9.
|
|
40
|
-
"vite": "7.1.
|
|
41
|
-
"@xwiki/cristal-dev-config": "0.
|
|
39
|
+
"typescript": "5.9.3",
|
|
40
|
+
"vite": "7.1.9",
|
|
41
|
+
"@xwiki/cristal-dev-config": "0.23.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"api-extractor:local": "api-extractor run --local",
|
package/src/defaultSettings.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"serverRendering": false,
|
|
7
7
|
"offline": false,
|
|
8
8
|
"designSystem": "vuetify",
|
|
9
|
-
"editor": "
|
|
9
|
+
"editor": "blocknote"
|
|
10
10
|
},
|
|
11
11
|
"FileSystemSL": {
|
|
12
12
|
"name": "FileSystemSL",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"serverRendering": false,
|
|
15
15
|
"offline": false,
|
|
16
16
|
"designSystem": "shoelace",
|
|
17
|
-
"editor": "
|
|
17
|
+
"editor": "blocknote"
|
|
18
18
|
},
|
|
19
19
|
"XWiki": {
|
|
20
20
|
"name": "XWiki",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"baseRestURL": "/rest/cristal/page?media=json",
|
|
26
26
|
"homePage": "Main.WebHome",
|
|
27
27
|
"designSystem": "vuetify",
|
|
28
|
-
"editor": "
|
|
28
|
+
"editor": "blocknote",
|
|
29
29
|
"realtimeURL": "https://cristal.demo.xwiki.com:8093/collaboration"
|
|
30
30
|
},
|
|
31
31
|
"XWikiSL": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"baseRestURL": "/rest/cristal/page?media=json",
|
|
38
38
|
"homePage": "Main.WebHome",
|
|
39
39
|
"designSystem": "shoelace",
|
|
40
|
-
"editor": "
|
|
40
|
+
"editor": "blocknote",
|
|
41
41
|
"realtimeURL": "https://cristal.demo.xwiki.com:8093/collaboration"
|
|
42
42
|
}
|
|
43
43
|
}
|