@encatch/schema 1.3.0-beta.7 โ 1.3.0-beta.9
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/esm/index.js +181 -0
- package/dist/esm/index.js.map +3 -3
- package/dist/types/helpers/csat-emoji-helper.d.ts +52 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/schemas/api/fetch-feedback-schema.d.ts +2 -0
- package/dist/types/schemas/fields/app-props-schema.d.ts +1 -0
- package/dist/types/schemas/fields/field-schema.d.ts +2 -0
- package/dist/types/schemas/fields/form-properties-schema.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Canonical CSAT default emojis when `overrideEmoji` is unset (index 0 = point 1). */
|
|
2
|
+
export declare const CSAT_DEFAULT_EMOJIS_BY_SCALE: Record<number, readonly string[]>;
|
|
3
|
+
/** Emoji picker categories for CSAT custom overrides. */
|
|
4
|
+
export declare const CSAT_EMOJI_CATEGORIES: readonly [{
|
|
5
|
+
readonly id: "unhappy";
|
|
6
|
+
readonly label: "Unhappy";
|
|
7
|
+
readonly emojis: readonly ["๐ก", "๐ ", "๐ค", "๐", "๐", "๐", "๐ข", "๐ญ", "๐ฐ", "๐จ"];
|
|
8
|
+
}, {
|
|
9
|
+
readonly id: "neutral";
|
|
10
|
+
readonly label: "Neutral";
|
|
11
|
+
readonly emojis: readonly ["๐", "๐", "๐", "๐ถ", "๐ฅฒ"];
|
|
12
|
+
}, {
|
|
13
|
+
readonly id: "happy";
|
|
14
|
+
readonly label: "Happy";
|
|
15
|
+
readonly emojis: readonly ["๐", "๐", "๐", "๐", "๐", "๐คฉ", "๐", "๐ฅฐ", "๐"];
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "gestures";
|
|
18
|
+
readonly label: "Gestures";
|
|
19
|
+
readonly emojis: readonly ["๐", "๐", "๐", "๐", "๐ค", "โ๏ธ"];
|
|
20
|
+
}, {
|
|
21
|
+
readonly id: "hearts";
|
|
22
|
+
readonly label: "Hearts";
|
|
23
|
+
readonly emojis: readonly ["โค๏ธ", "๐งก", "๐", "๐", "๐", "๐", "๐"];
|
|
24
|
+
}, {
|
|
25
|
+
readonly id: "symbols";
|
|
26
|
+
readonly label: "Symbols";
|
|
27
|
+
readonly emojis: readonly ["โญ", "๐", "๐ฏ", "โ
", "โ", "โ ๏ธ"];
|
|
28
|
+
}, {
|
|
29
|
+
readonly id: "celebration";
|
|
30
|
+
readonly label: "Celebration";
|
|
31
|
+
readonly emojis: readonly ["๐", "๐ฅณ", "๐", "๐", "๐ฅ"];
|
|
32
|
+
}];
|
|
33
|
+
/** Flat allowed palette derived from categories (used for validation). */
|
|
34
|
+
export declare const CSAT_EMOJI_PALETTE: readonly string[];
|
|
35
|
+
export type CsatEmojiCategory = (typeof CSAT_EMOJI_CATEGORIES)[number];
|
|
36
|
+
export type CsatEmojiPaletteItem = (typeof CSAT_EMOJI_PALETTE)[number];
|
|
37
|
+
export declare function isCsatEmojiPaletteItem(value: string): value is CsatEmojiPaletteItem;
|
|
38
|
+
/** Default override values when custom emojis are enabled โ every emoji must exist in CSAT_EMOJI_PALETTE. */
|
|
39
|
+
export declare function getDefaultOverrideEmojiForScale(scale: number): string[];
|
|
40
|
+
export declare function parseOverrideEmoji(overrideEmoji: string | undefined | null): string[] | null;
|
|
41
|
+
export declare function serializeOverrideEmoji(emojis: readonly string[]): string;
|
|
42
|
+
export declare function validateOverrideEmojiForScale(overrideEmoji: string | undefined | null, scale: number): {
|
|
43
|
+
valid: boolean;
|
|
44
|
+
emojis: string[] | null;
|
|
45
|
+
error?: string;
|
|
46
|
+
};
|
|
47
|
+
/** Returns emojis for each scale point (index 0 = point 1). Falls back to defaults when unset. */
|
|
48
|
+
export declare function resolveCsatEmojis(scale: number, overrideEmoji?: string | null): string[];
|
|
49
|
+
/** Emoji for a 1-based CSAT point value. */
|
|
50
|
+
export declare function getCsatEmojiForPoint(point: number, scale: number, overrideEmoji?: string | null): string;
|
|
51
|
+
/** Trim custom emojis when scale shrinks; pad with defaults when scale grows (caller may require re-pick). */
|
|
52
|
+
export declare function trimOverrideEmojiForScale(overrideEmoji: string | undefined | null, newScale: number): string | undefined;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,5 +15,6 @@ export { feedbackConfigurationItemSchema, fetchFormConfigSchema, fetchConfigurat
|
|
|
15
15
|
export { RefineTextParams, RefineTextResponse, RefineTextData, refineTextDataSchema, refineTextParamsSchema, refineTextResponseSchema, } from "./schemas/api/refine-text-schema";
|
|
16
16
|
export { objectToCamel, objectToSnake, toSnake, toCamel, toPascal, objectToPascal, } from "./helpers/case-convert-helper";
|
|
17
17
|
export type { ObjectToCamel, ObjectToSnake, ToSnake, ToCamel, ToPascal, ObjectToPascal, } from "./helpers/case-convert-helper";
|
|
18
|
+
export { CSAT_DEFAULT_EMOJIS_BY_SCALE, CSAT_EMOJI_CATEGORIES, CSAT_EMOJI_PALETTE, getCsatEmojiForPoint, getDefaultOverrideEmojiForScale, isCsatEmojiPaletteItem, parseOverrideEmoji, resolveCsatEmojis, serializeOverrideEmoji, trimOverrideEmojiForScale, validateOverrideEmojiForScale, type CsatEmojiCategory, type CsatEmojiPaletteItem, } from "./helpers/csat-emoji-helper";
|
|
18
19
|
export { currentModeSchema, appPropsSchema, CurrentModes, type CurrentMode, type AppProps, } from "./schemas/fields/app-props-schema";
|
|
19
20
|
export { z } from "zod";
|
|
@@ -1687,6 +1687,7 @@ export declare const questionnaireFieldsResponseSchema: z.ZodObject<{
|
|
|
1687
1687
|
positiveColor: z.ZodOptional<z.ZodString>;
|
|
1688
1688
|
showLabels: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1689
1689
|
scaleLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1690
|
+
overrideEmoji: z.ZodOptional<z.ZodString>;
|
|
1690
1691
|
}, z.core.$strip>, z.ZodObject<{
|
|
1691
1692
|
id: z.ZodString;
|
|
1692
1693
|
slug: z.ZodOptional<z.ZodString>;
|
|
@@ -4318,6 +4319,7 @@ export declare const fetchFeedbackDetailsResponseSchema: z.ZodObject<{
|
|
|
4318
4319
|
positiveColor: z.ZodOptional<z.ZodString>;
|
|
4319
4320
|
showLabels: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
4320
4321
|
scaleLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
4322
|
+
overrideEmoji: z.ZodOptional<z.ZodString>;
|
|
4321
4323
|
}, z.core.$strip>, z.ZodObject<{
|
|
4322
4324
|
id: z.ZodString;
|
|
4323
4325
|
slug: z.ZodOptional<z.ZodString>;
|
|
@@ -1530,6 +1530,7 @@ export declare const appPropsSchema: z.ZodObject<{
|
|
|
1530
1530
|
positiveColor: z.ZodOptional<z.ZodString>;
|
|
1531
1531
|
showLabels: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1532
1532
|
scaleLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1533
|
+
overrideEmoji: z.ZodOptional<z.ZodString>;
|
|
1533
1534
|
}, z.core.$strip>, z.ZodObject<{
|
|
1534
1535
|
id: z.ZodString;
|
|
1535
1536
|
slug: z.ZodOptional<z.ZodString>;
|
|
@@ -2035,6 +2035,7 @@ export declare const csatQuestionSchema: z.ZodObject<{
|
|
|
2035
2035
|
positiveColor: z.ZodOptional<z.ZodString>;
|
|
2036
2036
|
showLabels: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
2037
2037
|
scaleLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2038
|
+
overrideEmoji: z.ZodOptional<z.ZodString>;
|
|
2038
2039
|
}, z.core.$strip>;
|
|
2039
2040
|
export declare const opinionScaleQuestionSchema: z.ZodObject<{
|
|
2040
2041
|
id: z.ZodString;
|
|
@@ -4709,6 +4710,7 @@ export declare const combinedQuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
4709
4710
|
positiveColor: z.ZodOptional<z.ZodString>;
|
|
4710
4711
|
showLabels: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
4711
4712
|
scaleLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
4713
|
+
overrideEmoji: z.ZodOptional<z.ZodString>;
|
|
4712
4714
|
}, z.core.$strip>, z.ZodObject<{
|
|
4713
4715
|
id: z.ZodString;
|
|
4714
4716
|
slug: z.ZodOptional<z.ZodString>;
|
|
@@ -2827,6 +2827,7 @@ export declare const formPropertiesSchema: z.ZodObject<{
|
|
|
2827
2827
|
positiveColor: z.ZodOptional<z.ZodString>;
|
|
2828
2828
|
showLabels: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
2829
2829
|
scaleLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2830
|
+
overrideEmoji: z.ZodOptional<z.ZodString>;
|
|
2830
2831
|
}, z.core.$strip>, z.ZodObject<{
|
|
2831
2832
|
id: z.ZodString;
|
|
2832
2833
|
slug: z.ZodOptional<z.ZodString>;
|
package/package.json
CHANGED