@douglasneuroinformatics/libui 4.5.0 → 4.5.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/README.md +0 -2
- package/dist/components.d.ts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/i18n.d.ts +2 -2
- package/dist/{types-CxoDu4Em.d.ts → types-CwW4nA_v.d.ts} +7 -5
- package/package.json +1 -1
- package/src/i18n/types.ts +7 -8
package/README.md
CHANGED
|
@@ -43,7 +43,5 @@ We welcome contributions! If you're interested in improving the library or addin
|
|
|
43
43
|
|
|
44
44
|
## License
|
|
45
45
|
|
|
46
|
-
Copyright (C) 2024 Douglas Neuroinformatics Platform
|
|
47
|
-
|
|
48
46
|
This program is free software: you can redistribute it and/or modify
|
|
49
47
|
it under the terms of the Apache License 2.0.
|
package/dist/components.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import { ZodTypeLike, ZodErrorLike } from '@douglasneuroinformatics/libjs';
|
|
|
25
25
|
import { FormDataType, FormContent, PartialNullableFormDataType } from '@douglasneuroinformatics/libui-form-types';
|
|
26
26
|
import * as _radix_ui_react_hover_card from '@radix-ui/react-hover-card';
|
|
27
27
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
28
|
-
import { L as Language } from './types-
|
|
28
|
+
import { L as Language } from './types-CwW4nA_v.js';
|
|
29
29
|
import * as _radix_ui_react_menubar from '@radix-ui/react-menubar';
|
|
30
30
|
import { MenubarMenuProps } from '@radix-ui/react-menubar';
|
|
31
31
|
import * as _radix_ui_react_popover from '@radix-ui/react-popover';
|
package/dist/hooks.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { D as DEFAULT_THEME, a as SYS_DARK_MEDIA_QUERY, S as StorageName, b as T
|
|
|
3
3
|
import { Promisable } from 'type-fest';
|
|
4
4
|
import { RefObject, useEffect, Dispatch, SetStateAction } from 'react';
|
|
5
5
|
import * as zustand from 'zustand';
|
|
6
|
-
import { T as TranslatorType, a as TranslationKey, b as TranslationNamespace, c as TranslationKeyForNamespace } from './types-
|
|
6
|
+
import { T as TranslatorType, a as TranslationKey, b as TranslationNamespace, c as TranslationKeyForNamespace } from './types-CwW4nA_v.js';
|
|
7
7
|
|
|
8
8
|
declare function useChart(): {
|
|
9
9
|
config: ChartConfig;
|
package/dist/i18n.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SetOptional } from 'type-fest';
|
|
2
|
-
import { T as TranslatorType, a as TranslationKey, L as Language, d as Translations, e as TranslateOptions } from './types-
|
|
3
|
-
export { E as ExtractTranslationKey, f as LanguageOptions, g as TranslateFormatArgs, h as TranslateFunction, c as TranslationKeyForNamespace, b as TranslationNamespace, U as UserConfig } from './types-
|
|
2
|
+
import { T as TranslatorType, a as TranslationKey, L as Language, d as Translations, e as TranslateOptions } from './types-CwW4nA_v.js';
|
|
3
|
+
export { E as ExtractTranslationKey, f as LanguageOptions, g as TranslateFormatArgs, h as TranslateFunction, c as TranslationKeyForNamespace, b as TranslationNamespace, U as UserConfig } from './types-CwW4nA_v.js';
|
|
4
4
|
|
|
5
5
|
type TranslatorEventMap = {
|
|
6
6
|
languageChange: (...args: [language: Language]) => void;
|
|
@@ -194,14 +194,16 @@ var libuiTranslations = {
|
|
|
194
194
|
no: no
|
|
195
195
|
};
|
|
196
196
|
|
|
197
|
+
interface TranslationsLike {
|
|
198
|
+
[key: string]: TranslationsLike | {
|
|
199
|
+
[L in Language]?: string;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
197
202
|
declare namespace UserConfig {
|
|
198
203
|
interface LanguageOptions {
|
|
199
204
|
[key: string]: boolean;
|
|
200
205
|
}
|
|
201
|
-
interface Translations {
|
|
202
|
-
[key: string]: Translations | {
|
|
203
|
-
[L in Language]?: string;
|
|
204
|
-
};
|
|
206
|
+
interface Translations extends TranslationsLike {
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
209
|
type LanguageOptions = UserConfig.LanguageOptions & {
|
|
@@ -223,7 +225,7 @@ type ExtractTranslationKey<T extends {
|
|
|
223
225
|
} ? Key : `${Key}.${ExtractTranslationKey<T[Key]>}` : `${Key}` : never;
|
|
224
226
|
type TranslationNamespace = Extract<keyof Translations, string>;
|
|
225
227
|
type TranslationKey = ExtractTranslationKey<Translations>;
|
|
226
|
-
type TranslationKeyForNamespace<TNamespace extends TranslationNamespace> = TranslationKey extends `${TNamespace}.${infer TKey}` ? TKey : never;
|
|
228
|
+
type TranslationKeyForNamespace<TNamespace extends TranslationNamespace> = Extract<TranslationKey, `${TNamespace}.${string}`> extends `${TNamespace}.${infer TKey}` ? TKey : never;
|
|
227
229
|
type TranslateFormatArgs = Exclude<Primitive, symbol>[] | {
|
|
228
230
|
[L in Language]?: Exclude<Primitive, symbol>[];
|
|
229
231
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douglasneuroinformatics/libui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.5.
|
|
4
|
+
"version": "4.5.1",
|
|
5
5
|
"packageManager": "pnpm@10.7.1",
|
|
6
6
|
"description": "Generic UI components for DNP projects, built using React and Tailwind CSS",
|
|
7
7
|
"author": "Joshua Unrau",
|
package/src/i18n/types.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-empty-object-type */
|
|
1
2
|
/* eslint-disable @typescript-eslint/consistent-type-definitions */
|
|
2
3
|
/* eslint-disable @typescript-eslint/no-namespace */
|
|
3
4
|
|
|
@@ -5,17 +6,15 @@ import type { OmitIndexSignature, Primitive, Simplify } from 'type-fest';
|
|
|
5
6
|
|
|
6
7
|
import type libuiTranslations from './translations/libui.json';
|
|
7
8
|
|
|
9
|
+
interface TranslationsLike {
|
|
10
|
+
[key: string]: TranslationsLike | { [L in Language]?: string };
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
export declare namespace UserConfig {
|
|
9
14
|
interface LanguageOptions {
|
|
10
15
|
[key: string]: boolean;
|
|
11
16
|
}
|
|
12
|
-
interface Translations {
|
|
13
|
-
[key: string]:
|
|
14
|
-
| Translations
|
|
15
|
-
| {
|
|
16
|
-
[L in Language]?: string;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
17
|
+
interface Translations extends TranslationsLike {}
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
export type LanguageOptions = UserConfig.LanguageOptions & {
|
|
@@ -44,7 +43,7 @@ export type TranslationNamespace = Extract<keyof Translations, string>;
|
|
|
44
43
|
export type TranslationKey = ExtractTranslationKey<Translations>;
|
|
45
44
|
|
|
46
45
|
export type TranslationKeyForNamespace<TNamespace extends TranslationNamespace> =
|
|
47
|
-
TranslationKey extends `${TNamespace}.${infer TKey}` ? TKey : never;
|
|
46
|
+
Extract<TranslationKey, `${TNamespace}.${string}`> extends `${TNamespace}.${infer TKey}` ? TKey : never;
|
|
48
47
|
|
|
49
48
|
export type TranslateFormatArgs =
|
|
50
49
|
| Exclude<Primitive, symbol>[]
|