@meith/settings 0.29.1 → 0.30.1
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 +3 -3
- package/src/branding.ts +14 -0
- package/src/definitions.ts +28 -0
- package/src/index.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meith/settings",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"zod": "^4.4.3",
|
|
23
|
-
"@meith/core": "0.
|
|
24
|
-
"@meith/i18n": "0.
|
|
23
|
+
"@meith/core": "0.30.1",
|
|
24
|
+
"@meith/i18n": "0.30.1"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/src/branding.ts
CHANGED
|
@@ -4,6 +4,8 @@ export const LOGO_SCHEMES: readonly LogoScheme[] = ['light', 'dark']
|
|
|
4
4
|
|
|
5
5
|
const LOGO_KEY = /^board\/logo-(light|dark)-[a-f0-9-]{36}\.(png|jpg|webp|svg)$/
|
|
6
6
|
|
|
7
|
+
const FAVICON_KEY = /^board\/favicon-[a-f0-9-]{36}\.(png|jpg|webp|svg)$/
|
|
8
|
+
|
|
7
9
|
export function isLogoScheme(value: unknown): value is LogoScheme {
|
|
8
10
|
return value === 'light' || value === 'dark'
|
|
9
11
|
}
|
|
@@ -12,10 +14,22 @@ export function isLogoKey(value: string): boolean {
|
|
|
12
14
|
return LOGO_KEY.test(value)
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
export function isFaviconKey(value: string): boolean {
|
|
18
|
+
return FAVICON_KEY.test(value)
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
export function logoFormat(key: string): string | null {
|
|
16
22
|
return LOGO_KEY.exec(key)?.[2] ?? null
|
|
17
23
|
}
|
|
18
24
|
|
|
25
|
+
export function faviconFormat(key: string): string | null {
|
|
26
|
+
return FAVICON_KEY.exec(key)?.[1] ?? null
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function faviconPath(key: string): string {
|
|
30
|
+
return `/brand/favicon?v=${key.slice(-16, -4)}`
|
|
31
|
+
}
|
|
32
|
+
|
|
19
33
|
export function logoPath(scheme: LogoScheme, key: string): string {
|
|
20
34
|
return `/logo/${scheme}?v=${key.slice(-16, -4)}`
|
|
21
35
|
}
|
package/src/definitions.ts
CHANGED
|
@@ -90,6 +90,21 @@ export const SETTING_DEFINITIONS = [
|
|
|
90
90
|
invalidates: ['settings', 'layout'],
|
|
91
91
|
ui: { multiline: true },
|
|
92
92
|
}),
|
|
93
|
+
define({
|
|
94
|
+
key: 'board.install_banner',
|
|
95
|
+
group: 'board',
|
|
96
|
+
label: 'Offer to install the board',
|
|
97
|
+
description:
|
|
98
|
+
'Pins a dismissable bar to the bottom of small screens inviting the reader ' +
|
|
99
|
+
'to add this board to their home screen, with an Install button that opens ' +
|
|
100
|
+
'the browser prompt where one exists and brief directions where none does. ' +
|
|
101
|
+
'It never shows inside the installed app, and dismissing it keeps it away ' +
|
|
102
|
+
'on that device for a year. Off by default: turn it on while you want ' +
|
|
103
|
+
'installs encouraged, and off again once the point is made.',
|
|
104
|
+
schema: z.boolean(),
|
|
105
|
+
default: false,
|
|
106
|
+
invalidates: ['settings', 'layout'],
|
|
107
|
+
}),
|
|
93
108
|
define({
|
|
94
109
|
key: 'board.offline',
|
|
95
110
|
group: 'board',
|
|
@@ -302,6 +317,19 @@ export const SETTING_DEFINITIONS = [
|
|
|
302
317
|
invalidates: ['settings', 'layout'],
|
|
303
318
|
ui: { managed: true },
|
|
304
319
|
}),
|
|
320
|
+
define({
|
|
321
|
+
key: 'board.favicon',
|
|
322
|
+
group: 'board',
|
|
323
|
+
label: 'Favicon',
|
|
324
|
+
description:
|
|
325
|
+
'The icon browser tabs, bookmarks and an installed shortcut show for this board. ' +
|
|
326
|
+
'Uploaded, not typed. Left empty, an icon is generated from the board name and its ' +
|
|
327
|
+
'theme colours.',
|
|
328
|
+
schema: z.string().max(300),
|
|
329
|
+
default: '',
|
|
330
|
+
invalidates: ['settings', 'layout'],
|
|
331
|
+
ui: { managed: true },
|
|
332
|
+
}),
|
|
305
333
|
define({
|
|
306
334
|
key: 'board.logo_alt',
|
|
307
335
|
group: 'board',
|