@damian-buho/support-ukraine 1.4.1 → 1.4.2
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/README.md +3 -2
- package/dist/i18n.d.ts +3 -1
- package/dist/locales/index.d.ts +12 -4
- package/dist/types.d.ts +48 -16
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -8,10 +8,11 @@ SPDX-License-Identifier: MIT
|
|
|
8
8
|
|
|
9
9
|
[](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
|
|
10
10
|

|
|
11
|
+

|
|
11
12
|

|
|
12
13
|

|
|
13
|
-
[](CONTRIBUTING.md)
|
|
14
|
-

|
|
14
|
+
[](CONTRIBUTING.md)
|
|
15
|
+

|
|
15
16
|
|
|
16
17
|
[](https://github.com/damian-buho/support-ukraine/actions/workflows/pipeline.yaml)
|
|
17
18
|
[](https://github.com/damian-buho/support-ukraine/actions/workflows/github-code-scanning/codeql)
|
package/dist/i18n.d.ts
CHANGED
|
@@ -23,7 +23,9 @@ export declare function loadLocale(lang: string): Promise<LocaleMessages>;
|
|
|
23
23
|
* the English default from the base data.
|
|
24
24
|
*/
|
|
25
25
|
export declare function mergeCharities(base: readonly Charity[], locale: LocaleMessages): Charity[];
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
Returns true if the locale uses right-to-left script.
|
|
28
|
+
*/
|
|
27
29
|
export declare function isRTL(lang: string): boolean;
|
|
28
30
|
/**
|
|
29
31
|
* Build a translated banner text line for a charity.
|
package/dist/locales/index.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type { LocaleMessages } from '../types.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
Map of BCP 47 base language → dynamic import loader.
|
|
4
|
+
*/
|
|
3
5
|
export declare const localeLoaders: Record<string, () => Promise<{
|
|
4
6
|
default: LocaleMessages;
|
|
5
7
|
}>>;
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
All supported locale codes.
|
|
10
|
+
*/
|
|
7
11
|
export type SupportedLocale = keyof typeof localeLoaders;
|
|
8
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
List of RTL locale codes.
|
|
14
|
+
*/
|
|
9
15
|
export declare const RTL_LOCALES: readonly ["ar"];
|
|
10
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
Resolve a raw BCP 47 tag to a supported locale code, or 'en'.
|
|
18
|
+
*/
|
|
11
19
|
export declare function resolveLocale(tag: string): SupportedLocale;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
Category tag for a charity.
|
|
3
|
+
*/
|
|
2
4
|
export declare const VALID_TAGS: readonly ["military", "humanitarian", "animals"];
|
|
3
5
|
export type CharityTag = (typeof VALID_TAGS)[number];
|
|
4
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
A charity foundation that can appear in the banner.
|
|
8
|
+
*/
|
|
5
9
|
export interface Charity {
|
|
6
10
|
id: string;
|
|
7
11
|
name: string;
|
|
@@ -16,37 +20,65 @@ export declare const charitySchema: {
|
|
|
16
20
|
export declare const charitiesSchema: {
|
|
17
21
|
parse(value: unknown): Charity[];
|
|
18
22
|
};
|
|
19
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
Translated UI strings and charity taglines for a single locale.
|
|
25
|
+
*/
|
|
20
26
|
export interface LocaleMessages {
|
|
21
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
Banner prefix, e.g. "Support Ukraine".
|
|
29
|
+
*/
|
|
22
30
|
supportUkraine: string;
|
|
23
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
"More…" link text.
|
|
33
|
+
*/
|
|
24
34
|
more: string;
|
|
25
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
Card donate button text, e.g. "Donate".
|
|
37
|
+
*/
|
|
26
38
|
donate: string;
|
|
27
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
Translated taglines keyed by charity id. Missing keys fall back to EN.
|
|
41
|
+
*/
|
|
28
42
|
charities: Record<string, {
|
|
29
43
|
tagline: string;
|
|
30
44
|
}>;
|
|
31
45
|
}
|
|
32
46
|
export interface SupportUkraineBlockOptions {
|
|
33
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
Target mount element. If omitted the banner is prepended to document.body.
|
|
49
|
+
*/
|
|
34
50
|
element?: HTMLElement;
|
|
35
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
Positioning mode: 'shift' pushes content down, 'overlap' floats on top, 'replace' swaps a same-class placeholder.
|
|
53
|
+
*/
|
|
36
54
|
mode?: 'shift' | 'overlap' | 'replace';
|
|
37
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
Font size (default '0.875rem').
|
|
57
|
+
*/
|
|
38
58
|
fontSize?: string;
|
|
39
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
Category tags to filter by. If omitted all charities are shown.
|
|
61
|
+
*/
|
|
40
62
|
tags?: CharityTag[];
|
|
41
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
Avoid repeating charities across page loads using localStorage.
|
|
65
|
+
*/
|
|
42
66
|
dontRepeat?: boolean;
|
|
43
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
Log a message to the dev console.
|
|
69
|
+
*/
|
|
44
70
|
isInConsole?: boolean;
|
|
45
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
Show a refresh button that loads the next random charity.
|
|
73
|
+
*/
|
|
46
74
|
showRefreshButton?: boolean;
|
|
47
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
Auto-refresh interval in milliseconds. 0 = off (default). Set e.g. 15000 for 15 seconds.
|
|
77
|
+
*/
|
|
48
78
|
autoRefreshInterval?: number;
|
|
49
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
Show a fade animation when the charity changes (respects prefers-reduced-motion).
|
|
81
|
+
*/
|
|
50
82
|
showRefreshAnimation?: boolean;
|
|
51
83
|
/**
|
|
52
84
|
* Override the auto-detected locale (BCP 47 language tag).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@damian-buho/support-ukraine",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Browser library that adds a Ukraine-support charity banner to any website.",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"homepage": "https://github.com/damian-buho/support-ukraine#readme",
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@eslint/js": "10.0.1",
|
|
62
|
-
"@size-limit/preset-small-lib": "13.0.
|
|
62
|
+
"@size-limit/preset-small-lib": "13.0.3",
|
|
63
63
|
"@types/eslint": "9.6.1",
|
|
64
64
|
"@types/node": "26.1.2",
|
|
65
65
|
"esbuild": "0.28.1",
|
|
@@ -69,14 +69,14 @@
|
|
|
69
69
|
"eslint-plugin-n": "18.2.2",
|
|
70
70
|
"eslint-plugin-promise": "7.3.0",
|
|
71
71
|
"eslint-plugin-tsdoc": "0.5.2",
|
|
72
|
-
"eslint-plugin-unicorn": "
|
|
73
|
-
"globals": "17.
|
|
72
|
+
"eslint-plugin-unicorn": "73.0.0",
|
|
73
|
+
"globals": "17.9.0",
|
|
74
74
|
"prettier": "3.9.6",
|
|
75
75
|
"sass": "1.102.0",
|
|
76
|
-
"size-limit": "13.0.
|
|
76
|
+
"size-limit": "13.0.3",
|
|
77
77
|
"tsup": "8.5.1",
|
|
78
78
|
"typescript": "6.0.3",
|
|
79
|
-
"typescript-eslint": "8.
|
|
79
|
+
"typescript-eslint": "8.66.0",
|
|
80
80
|
"yaml": "2.9.0"
|
|
81
81
|
},
|
|
82
82
|
"prettier": {
|