@pexip-engage-public/plugin-state
Advanced tools
Comparing version 1.1.0 to 1.1.1
# @pexip-engage-public/plugin-state | ||
## 1.1.1 | ||
### Patch Changes | ||
- b2935eab8: SKED-10989: Correctly fallback language if we can find a partial match | ||
## 1.1.0 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@pexip-engage-public/plugin-state", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"homepage": "https://github.com/skedify/frontend-mono/tree/develop/apps/plugin-remix/packages/plugin-state#readme", | ||
@@ -38,5 +38,6 @@ "bugs": { | ||
"devDependencies": { | ||
"@total-typescript/ts-reset": "^0.4.2", | ||
"tsup": "^6.7.0", | ||
"@pexip-engage/tsconfig": "0.0.9", | ||
"eslint-config-pexip-engage": "0.0.22" | ||
"eslint-config-pexip-engage": "0.0.27" | ||
}, | ||
@@ -43,0 +44,0 @@ "volta": { |
@@ -20,1 +20,16 @@ export const TOKEN = { | ||
].join(""); | ||
export const SUPPORTED_LNGS = [ | ||
"da", | ||
"de", | ||
"en", | ||
"en-GB", | ||
"en-US", | ||
"fr", | ||
"nb", | ||
"nl", | ||
"es", | ||
"el", | ||
] as const; | ||
export type SupportedLngs = (typeof SUPPORTED_LNGS)[number]; | ||
export const FALLBACK_LNG: SupportedLngs = "en"; |
@@ -0,2 +1,4 @@ | ||
export type { SupportedLngs } from "./constants"; | ||
export * from "./constants"; | ||
export * from "./PluginState.schema"; | ||
export { getSupportedLng, isSupportedLng } from "./utils"; |
import { z } from "zod"; | ||
import { DEFAULT_FLOW } from "./constants"; | ||
import { validateGeoCoordinates, valueToArray } from "./utils"; | ||
import { getSupportedLng, validateGeoCoordinates, valueToArray } from "./utils"; | ||
@@ -289,3 +289,3 @@ export const MeetingTypeSchema = z.enum(["video", "phone", "on_location", "office"]); | ||
*/ | ||
language: StringSchema, | ||
language: StringSchema.transform((value) => getSupportedLng(value)), | ||
meetingTypes: ArraySchema, | ||
@@ -292,0 +292,0 @@ application: z |
@@ -0,3 +1,18 @@ | ||
import { SUPPORTED_LNGS, SupportedLngs } from "./constants"; | ||
const SPACE_OR_COMMA = /[\s,]+/; | ||
export function isSupportedLng(value?: string): value is SupportedLngs { | ||
return Boolean(value && SUPPORTED_LNGS.includes(value)); | ||
} | ||
export function getSupportedLng(value?: string) { | ||
if (isSupportedLng(value)) return value; | ||
const locale = value?.split("-")[0]; | ||
if (isSupportedLng(locale)) return locale; | ||
return undefined; | ||
} | ||
export function valueToArray( | ||
@@ -4,0 +19,0 @@ input?: string | string[] | null, |
@@ -12,2 +12,5 @@ export declare const TOKEN: { | ||
export declare const DEFAULT_FLOW: string; | ||
export declare const SUPPORTED_LNGS: readonly ["da", "de", "en", "en-GB", "en-US", "fr", "nb", "nl", "es", "el"]; | ||
export type SupportedLngs = (typeof SUPPORTED_LNGS)[number]; | ||
export declare const FALLBACK_LNG: SupportedLngs; | ||
//# sourceMappingURL=constants.d.ts.map |
@@ -0,3 +1,5 @@ | ||
export type { SupportedLngs } from "./constants"; | ||
export * from "./constants"; | ||
export * from "./PluginState.schema"; | ||
export { getSupportedLng, isSupportedLng } from "./utils"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -609,3 +609,3 @@ import { z } from "zod"; | ||
*/ | ||
language: z.ZodOptional<z.ZodString>; | ||
language: z.ZodEffects<z.ZodOptional<z.ZodString>, "da" | "de" | "en" | "en-GB" | "en-US" | "fr" | "nb" | "nl" | "es" | "el" | undefined, string | undefined>; | ||
meetingTypes: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>, string[], string | string[] | null | undefined>; | ||
@@ -739,3 +739,3 @@ application: z.ZodDefault<z.ZodObject<{ | ||
questions?: Record<string, string | string[]> | undefined; | ||
language?: string | undefined; | ||
language?: "da" | "de" | "en" | "en-GB" | "en-US" | "fr" | "nb" | "nl" | "es" | "el" | undefined; | ||
initialSearchAddress?: string | undefined; | ||
@@ -930,3 +930,3 @@ }, { | ||
questions?: Record<string, string | string[]> | undefined; | ||
language?: string | undefined; | ||
language?: "da" | "de" | "en" | "en-GB" | "en-US" | "fr" | "nb" | "nl" | "es" | "el" | undefined; | ||
initialSearchAddress?: string | undefined; | ||
@@ -933,0 +933,0 @@ }; |
@@ -0,3 +1,6 @@ | ||
import { SupportedLngs } from "./constants"; | ||
export declare function isSupportedLng(value?: string): value is SupportedLngs; | ||
export declare function getSupportedLng(value?: string): "da" | "de" | "en" | "en-GB" | "en-US" | "fr" | "nb" | "nl" | "es" | "el" | undefined; | ||
export declare function valueToArray(input?: string | string[] | null, separator?: string | RegExp): string[] | undefined; | ||
export declare function validateGeoCoordinates(coordinates: string): boolean; | ||
//# sourceMappingURL=utils.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
105180
17
1893
4