@webx-ui/module-settings 0.5.5 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { defineAsyncComponent as n } from "vue";
|
|
2
|
-
function
|
|
2
|
+
function o(t = {}) {
|
|
3
3
|
const e = t.path ?? "/settings";
|
|
4
4
|
return {
|
|
5
5
|
id: "settings",
|
|
6
6
|
path: e,
|
|
7
|
-
routes: [
|
|
7
|
+
routes: [
|
|
8
|
+
{
|
|
9
|
+
path: e,
|
|
10
|
+
name: "webx.settings",
|
|
11
|
+
meta: { help: "settings.index" },
|
|
12
|
+
component: () => import("./SettingsPage-f0sdkWPe.js")
|
|
13
|
+
}
|
|
14
|
+
]
|
|
8
15
|
};
|
|
9
16
|
}
|
|
10
|
-
function
|
|
17
|
+
function g(t) {
|
|
11
18
|
const e = `${t.apiPath}/settings`;
|
|
12
19
|
return {
|
|
13
20
|
async load() {
|
|
@@ -18,7 +25,7 @@ function c(t) {
|
|
|
18
25
|
}
|
|
19
26
|
};
|
|
20
27
|
}
|
|
21
|
-
const
|
|
28
|
+
const c = {
|
|
22
29
|
module: {
|
|
23
30
|
title: "Settings"
|
|
24
31
|
},
|
|
@@ -27,11 +34,11 @@ const g = {
|
|
|
27
34
|
saved: "Settings saved.",
|
|
28
35
|
failed: "Some values were not accepted. Check the highlighted fields."
|
|
29
36
|
}
|
|
30
|
-
},
|
|
37
|
+
}, p = n(() => import("./SettingsPage-f0sdkWPe.js"));
|
|
31
38
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
p as WxSettingsPage,
|
|
40
|
+
g as createSettingsApi,
|
|
41
|
+
o as settings,
|
|
42
|
+
c as settingsMessages
|
|
36
43
|
};
|
|
37
44
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/module.ts","../src/api.ts","../src/messages.ts","../src/index.ts"],"sourcesContent":["import type { AdminModule } from '@webx-ui/module-admin'\n\nexport interface SettingsOptions {\n /** Where the section lives inside the panel. */\n path?: string\n}\n\n/**\n * The settings, as a section of the panel.\n *\n * The id matches the module the server reports, which is what makes the entry appear in the\n * navigation: a section shows up when both halves are installed.\n */\nexport function settings(options: SettingsOptions = {}): AdminModule {\n const path = options.path ?? '/settings'\n\n return {\n id: 'settings',\n path,\n routes: [{
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/module.ts","../src/api.ts","../src/messages.ts","../src/index.ts"],"sourcesContent":["import type { AdminModule } from '@webx-ui/module-admin'\n\nexport interface SettingsOptions {\n /** Where the section lives inside the panel. */\n path?: string\n}\n\n/**\n * The settings, as a section of the panel.\n *\n * The id matches the module the server reports, which is what makes the entry appear in the\n * navigation: a section shows up when both halves are installed.\n */\nexport function settings(options: SettingsOptions = {}): AdminModule {\n const path = options.path ?? '/settings'\n\n return {\n id: 'settings',\n path,\n routes: [\n {\n path,\n name: 'webx.settings',\n meta: { help: 'settings.index' },\n component: () => import('./SettingsPage.vue'),\n },\n ],\n }\n}\n","import type { AdminContext } from '@webx-ui/module-admin'\nimport type { SettingsValues } from './types'\n\nexport interface SettingsApi {\n /** Every value the screen describes, as stored. */\n load(): Promise<SettingsValues>\n /** Sends the values back; answers with what the server kept. A 422 lands as `HttpError`. */\n save(values: SettingsValues): Promise<SettingsValues>\n}\n\n/** `GET` and `PUT` on `/settings`, under the panel's API path. */\nexport function createSettingsApi(admin: AdminContext): SettingsApi {\n const base = `${admin.apiPath}/settings`\n\n return {\n async load() {\n const body = await admin.http.get<{ data: { values: SettingsValues } }>(base)\n\n return body.data.values\n },\n async save(values) {\n const body = await admin.http.put<{ data: { values: SettingsValues } }>(base, { values })\n\n return body.data.values\n },\n }\n}\n","import type { Messages } from '@webx-ui/module-admin'\n\n/**\n * What this package says, in English — the same keys `webx-ui/module-settings` ships as\n * `lang/en/*.php`, so a key never reaches the screen when a translation is missing.\n */\nexport const settingsMessages: Record<string, Messages> = {\n module: {\n title: 'Settings',\n },\n page: {\n save: 'Save',\n saved: 'Settings saved.',\n failed: 'Some values were not accepted. Check the highlighted fields.',\n },\n}\n","import { defineAsyncComponent } from 'vue'\nexport { settings, type SettingsOptions } from './module'\nexport { createSettingsApi, type SettingsApi } from './api'\nexport { settingsMessages } from './messages'\nexport const WxSettingsPage = defineAsyncComponent(() => import('./SettingsPage.vue'))\nexport type { SettingsValues } from './types'\n"],"names":["settings","options","path","createSettingsApi","admin","base","values","settingsMessages","WxSettingsPage","defineAsyncComponent"],"mappings":";AAaO,SAASA,EAASC,IAA2B,IAAiB;AACnE,QAAMC,IAAOD,EAAQ,QAAQ;AAE7B,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,MAAAC;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,QACE,MAAAA;AAAA,QACA,MAAM;AAAA,QACN,MAAM,EAAE,MAAM,iBAAA;AAAA,QACd,WAAW,MAAM,OAAO,4BAAoB;AAAA,MAAA;AAAA,IAC9C;AAAA,EACF;AAEJ;ACjBO,SAASC,EAAkBC,GAAkC;AAClE,QAAMC,IAAO,GAAGD,EAAM,OAAO;AAE7B,SAAO;AAAA,IACL,MAAM,OAAO;AAGX,cAFa,MAAMA,EAAM,KAAK,IAA0CC,CAAI,GAEhE,KAAK;AAAA,IACnB;AAAA,IACA,MAAM,KAAKC,GAAQ;AAGjB,cAFa,MAAMF,EAAM,KAAK,IAA0CC,GAAM,EAAE,QAAAC,GAAQ,GAE5E,KAAK;AAAA,IACnB;AAAA,EAAA;AAEJ;ACpBO,MAAMC,IAA6C;AAAA,EACxD,QAAQ;AAAA,IACN,OAAO;AAAA,EAAA;AAAA,EAET,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,EAAA;AAEZ,GCXaC,IAAiBC,EAAqB,MAAM,OAAO,4BAAoB,CAAC;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webx-ui/module-settings",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Site settings for the WebX UI admin panel: the section that draws the settings screen and saves it.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"vue-router": "^4.5.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@webx-ui/core": "^0.
|
|
46
|
-
"@webx-ui/module-admin": "^0.
|
|
47
|
-
"@webx-ui/schema": "^0.11.
|
|
45
|
+
"@webx-ui/core": "^0.48.0",
|
|
46
|
+
"@webx-ui/module-admin": "^0.37.0",
|
|
47
|
+
"@webx-ui/schema": "^0.11.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "^24.10.1",
|