@protobase/schema 0.23.4 → 0.23.5
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/internal.d.ts +2 -1
- package/dist/internal.js +2 -1
- package/dist/locale.d.ts +11 -0
- package/dist/locale.js +13 -0
- package/package.json +1 -1
package/dist/internal.d.ts
CHANGED
|
@@ -20,4 +20,5 @@ import { applyAssistantEvent, emptyAssistantState } from "./assistant/apply-even
|
|
|
20
20
|
import { readEventStream } from "./assistant/event-stream.js";
|
|
21
21
|
import { layoutItems } from "./layout-items.js";
|
|
22
22
|
import { viewOfList } from "./named-list.js";
|
|
23
|
-
|
|
23
|
+
import { Locale, isLocale, locales, pickLocale } from "./locale.js";
|
|
24
|
+
export { type AddressCheck, type Locale, type PluginHost, type PluginRequirement, type PropShapes, type RefShape, type SearchTerm, actionInputErrors, addressErrors, addressPlaceholders, appHrefError, applyAssistantEvent, boardErrors, bottomBarFor, calendarErrors, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, decodeKey, defaultRecentLimit, displayFields, emptyAssistantState, encodeKey, fieldRefsIn, fillAddress, hrefField, hrefPlaceholders, inRange, isFieldRef, isGroupChart, isLocale, layoutItems, leavesApp, linkActionError, locales, markFieldRefs, matchedSearchField, matchesSearch, navRecentErrors, parseSize, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, readEventStream, redactSecrets, renderPrompt, searchTerms, shapes, shownInputs, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
|
package/dist/internal.js
CHANGED
|
@@ -20,4 +20,5 @@ import { redactSecrets } from "./redact-secrets.js";
|
|
|
20
20
|
import { addressErrors } from "./address-errors.js";
|
|
21
21
|
import { applyAssistantEvent, emptyAssistantState } from "./assistant/apply-event.js";
|
|
22
22
|
import { readEventStream } from "./assistant/event-stream.js";
|
|
23
|
-
|
|
23
|
+
import { isLocale, locales, pickLocale } from "./locale.js";
|
|
24
|
+
export { actionInputErrors, addressErrors, addressPlaceholders, appHrefError, applyAssistantEvent, boardErrors, bottomBarFor, calendarErrors, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, decodeKey, defaultRecentLimit, displayFields, emptyAssistantState, encodeKey, fieldRefsIn, fillAddress, hrefField, hrefPlaceholders, inRange, isFieldRef, isGroupChart, isLocale, layoutItems, leavesApp, linkActionError, locales, markFieldRefs, matchedSearchField, matchesSearch, navRecentErrors, parseSize, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, readEventStream, redactSecrets, renderPrompt, searchTerms, shapes, shownInputs, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
|
package/dist/locale.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/locale.d.ts
|
|
2
|
+
/** The languages Protobase's built-in screens come in. */
|
|
3
|
+
export declare const locales: readonly ["en", "nl"];
|
|
4
|
+
export type Locale = (typeof locales)[number];
|
|
5
|
+
export declare const isLocale: (value: unknown) => value is Locale;
|
|
6
|
+
/**
|
|
7
|
+
* The first of `preferred`, language tags such as the browser's `nl-BE` or `en`, whose language the screens come in;
|
|
8
|
+
* English when none is.
|
|
9
|
+
*/
|
|
10
|
+
export declare const pickLocale: (preferred: readonly string[]) => Locale;
|
|
11
|
+
//#endregion
|
package/dist/locale.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/locale.ts
|
|
2
|
+
/** The languages Protobase's built-in screens come in. */
|
|
3
|
+
const locales = ["en", "nl"];
|
|
4
|
+
const isLocale = (value) => locales.includes(value);
|
|
5
|
+
/**
|
|
6
|
+
* The first of `preferred`, language tags such as the browser's `nl-BE` or `en`, whose language the screens come in;
|
|
7
|
+
* English when none is.
|
|
8
|
+
*/
|
|
9
|
+
const pickLocale = (preferred) => {
|
|
10
|
+
return preferred.map((tag) => tag.split("-")[0].toLowerCase()).find(isLocale) ?? "en";
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { isLocale, locales, pickLocale };
|