@kiosko/sdk 0.2.5 → 0.2.6
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/context.js +3 -1
- package/dist/format.d.ts +12 -3
- package/dist/format.js +64 -14
- package/dist/i18n.d.ts +60 -2
- package/dist/i18n.js +145 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/languages.d.ts +36 -0
- package/dist/languages.js +22 -0
- package/dist/list.js +10 -7
- package/dist/location.js +4 -4
- package/dist/plugin.d.ts +23 -2
- package/dist/plugin.js +10 -10
- package/dist/schema.js +3 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/package.json +11 -1
- package/src/context.ts +3 -1
- package/src/format.ts +87 -17
- package/src/i18n.ts +157 -4
- package/src/index.ts +1 -0
- package/src/languages.ts +54 -0
- package/src/list.ts +10 -7
- package/src/location.ts +4 -4
- package/src/plugin.ts +32 -11
- package/src/schema.ts +3 -0
- package/src/testing.ts +2 -2
package/src/schema.ts
CHANGED
|
@@ -152,6 +152,9 @@ export const t = {
|
|
|
152
152
|
export const FILTER_HELP: Localized = {
|
|
153
153
|
en: 'Empty: all. Names or patterns, comma-separated: * matches anything, a leading ! leaves out (web, acme/*, !*-old).',
|
|
154
154
|
es: 'Vacío: todos. Nombres o patrones separados por comas: * vale por cualquier cosa y un ! delante excluye (web, acme/*, !*-old).',
|
|
155
|
+
de: 'Leer: alle. Namen oder Muster, durch Kommas getrennt: * steht für alles, ein ! davor schließt aus (web, acme/*, !*-old).',
|
|
156
|
+
'zh-Hant': '留空:全部。填入名稱或模式,以逗號分隔:* 代表任意字元,開頭加 ! 則排除(web, acme/*, !*-old)。',
|
|
157
|
+
'zh-Hans': '留空:全部。填写名称或模式,用逗号分隔:* 匹配任意内容,开头加 ! 表示排除(web, acme/*, !*-old)。',
|
|
155
158
|
};
|
|
156
159
|
|
|
157
160
|
function clone<T>(v: T): T {
|
package/src/testing.ts
CHANGED
|
@@ -149,13 +149,13 @@ export interface PluginIssue {
|
|
|
149
149
|
/**
|
|
150
150
|
* Paints every widget of a plugin with its demo data at its minimum and
|
|
151
151
|
* preferred sizes and a wide and a tall one, in every theme and in each
|
|
152
|
-
* language given, and lists what went wrong: a `render` that throws, one
|
|
152
|
+
* language given (by default the ones the plugin declares), and lists what went wrong: a `render` that throws, one
|
|
153
153
|
* that paints nothing, paints outside its box, or takes longer than
|
|
154
154
|
* `slowMs` (Kiosko warns at 50 ms). An empty list is a pass.
|
|
155
155
|
*/
|
|
156
156
|
export function checkPlugin(p: PluginDefinition, o: { locales?: string[]; themes?: string[]; slowMs?: number; extraSizes?: { w: number; h: number }[] } = {}): PluginIssue[] {
|
|
157
157
|
const issues: PluginIssue[] = [];
|
|
158
|
-
const locales = o.locales ?? ['en', 'es'];
|
|
158
|
+
const locales = o.locales ?? (p.languages?.length ? p.languages : ['en', 'es']);
|
|
159
159
|
const themes = o.themes ?? THEMES.map((t) => t.id);
|
|
160
160
|
const slow = o.slowMs ?? 50;
|
|
161
161
|
for (const w of p.widgets ?? []) {
|