@the-seeker/feedback-react-native 0.0.0-stage → 0.2.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 +266 -2
- package/dist/core/author-token.d.ts +16 -0
- package/dist/core/author-token.js +96 -0
- package/dist/core/client.d.ts +55 -0
- package/dist/core/client.js +98 -0
- package/dist/core/config.d.ts +59 -0
- package/dist/core/config.js +112 -0
- package/dist/core/posts-schema.d.ts +306 -0
- package/dist/core/posts-schema.js +131 -0
- package/dist/core/posts.d.ts +67 -0
- package/dist/core/posts.js +113 -0
- package/dist/core/request.d.ts +53 -0
- package/dist/core/request.js +88 -0
- package/dist/core/survey.d.ts +12 -0
- package/dist/core/survey.js +26 -0
- package/dist/core/texts.d.ts +196 -0
- package/dist/core/texts.js +232 -0
- package/dist/core/theme.d.ts +6 -0
- package/dist/core/theme.js +55 -0
- package/dist/core/transport.d.ts +9 -0
- package/dist/core/transport.js +37 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +34 -0
- package/dist/ui/Attachments.d.ts +9 -0
- package/dist/ui/Attachments.js +27 -0
- package/dist/ui/FeedbackForm.d.ts +8 -0
- package/dist/ui/FeedbackForm.js +92 -0
- package/dist/ui/FeedbackPostScreen.d.ts +8 -0
- package/dist/ui/FeedbackPostScreen.js +74 -0
- package/dist/ui/FeedbackSheet.d.ts +2 -0
- package/dist/ui/FeedbackSheet.js +14 -0
- package/dist/ui/FollowUpSheet.d.ts +17 -0
- package/dist/ui/FollowUpSheet.js +50 -0
- package/dist/ui/Inline.d.ts +6 -0
- package/dist/ui/Inline.js +16 -0
- package/dist/ui/Launcher.d.ts +1 -0
- package/dist/ui/Launcher.js +16 -0
- package/dist/ui/MyFeedbackModal.d.ts +10 -0
- package/dist/ui/MyFeedbackModal.js +45 -0
- package/dist/ui/MyFeedbackScreen.d.ts +9 -0
- package/dist/ui/MyFeedbackScreen.js +88 -0
- package/dist/ui/PostThread.d.ts +17 -0
- package/dist/ui/PostThread.js +57 -0
- package/dist/ui/Provider.d.ts +24 -0
- package/dist/ui/Provider.js +186 -0
- package/dist/ui/SurveyPrompt.d.ts +2 -0
- package/dist/ui/SurveyPrompt.js +52 -0
- package/dist/ui/context.d.ts +122 -0
- package/dist/ui/context.js +28 -0
- package/dist/ui/device.d.ts +10 -0
- package/dist/ui/device.js +22 -0
- package/dist/ui/forms.d.ts +32 -0
- package/dist/ui/forms.js +62 -0
- package/dist/ui/motion.d.ts +1 -0
- package/dist/ui/motion.js +23 -0
- package/dist/ui/post-format.d.ts +19 -0
- package/dist/ui/post-format.js +79 -0
- package/dist/ui/post-pieces.d.ts +24 -0
- package/dist/ui/post-pieces.js +60 -0
- package/dist/ui/post-styles.d.ts +317 -0
- package/dist/ui/post-styles.js +103 -0
- package/dist/ui/post-view-model.d.ts +52 -0
- package/dist/ui/post-view-model.js +181 -0
- package/dist/ui/primitives.d.ts +33 -0
- package/dist/ui/primitives.js +55 -0
- package/dist/ui/prop-state.d.ts +9 -0
- package/dist/ui/prop-state.js +27 -0
- package/dist/ui/storage.d.ts +15 -0
- package/dist/ui/storage.js +35 -0
- package/dist/ui/styles.d.ts +774 -0
- package/dist/ui/styles.js +185 -0
- package/dist/ui/surfaces.d.ts +13 -0
- package/dist/ui/surfaces.js +41 -0
- package/dist/ui/tokens.d.ts +16 -0
- package/dist/ui/tokens.js +62 -0
- package/dist/ui/useMyPosts.d.ts +35 -0
- package/dist/ui/useMyPosts.js +124 -0
- package/dist/ui/useSurvey.d.ts +12 -0
- package/dist/ui/useSurvey.js +52 -0
- package/package.json +32 -3
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_FOLLOW_UP = exports.AUTHOR_HEADER = void 0;
|
|
4
|
+
exports.createPostsClient = createPostsClient;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const client_1 = require("./client");
|
|
7
|
+
const posts_schema_1 = require("./posts-schema");
|
|
8
|
+
const request_1 = require("./request");
|
|
9
|
+
const transport_1 = require("./transport");
|
|
10
|
+
const ERROR_CODES = [
|
|
11
|
+
"SITE_NOT_FOUND",
|
|
12
|
+
"VALIDATION_ERROR",
|
|
13
|
+
"ELIGIBILITY",
|
|
14
|
+
"ONE_WAY",
|
|
15
|
+
"CLOSED",
|
|
16
|
+
"NOT_FOUND",
|
|
17
|
+
"RATE_LIMITED",
|
|
18
|
+
"APP_NOT_ALLOWED",
|
|
19
|
+
"IMAGES_DISABLED",
|
|
20
|
+
"TOO_MANY_IMAGES",
|
|
21
|
+
"IMAGE_TOO_LARGE",
|
|
22
|
+
"INVALID_IMAGE",
|
|
23
|
+
];
|
|
24
|
+
exports.AUTHOR_HEADER = "X-Devstage-Author";
|
|
25
|
+
exports.MAX_FOLLOW_UP = 2000;
|
|
26
|
+
const fail = (code) => ({ ok: false, code });
|
|
27
|
+
function errorCode(body, status, notFound) {
|
|
28
|
+
const parsed = posts_schema_1.errorSchema.safeParse(body);
|
|
29
|
+
const known = parsed.success ? ERROR_CODES.find((code) => code === parsed.data.error) : undefined;
|
|
30
|
+
if (known !== undefined)
|
|
31
|
+
return known;
|
|
32
|
+
if (status === 400)
|
|
33
|
+
return "VALIDATION_ERROR";
|
|
34
|
+
if (status === 404)
|
|
35
|
+
return notFound;
|
|
36
|
+
if (status === 429)
|
|
37
|
+
return "RATE_LIMITED";
|
|
38
|
+
return "REQUEST_FAILED";
|
|
39
|
+
}
|
|
40
|
+
async function call(send, expected, schema, notFound = "NOT_FOUND") {
|
|
41
|
+
let response;
|
|
42
|
+
try {
|
|
43
|
+
response = await send();
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (error instanceof Error)
|
|
47
|
+
return fail("NETWORK_ERROR");
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
const body = await (0, transport_1.readJson)(response);
|
|
51
|
+
if (response.status !== expected)
|
|
52
|
+
return fail(errorCode(body, response.status, notFound));
|
|
53
|
+
const parsed = schema.safeParse(body);
|
|
54
|
+
return parsed.success ? { ok: true, value: parsed.data } : fail("INVALID_RESPONSE");
|
|
55
|
+
}
|
|
56
|
+
const siteResponse = zod_1.z.object({ site: posts_schema_1.siteSchema }).transform((body) => body.site);
|
|
57
|
+
const createdResponse = zod_1.z.object({ post: posts_schema_1.createdSchema }).transform((body) => body.post);
|
|
58
|
+
const detailResponse = zod_1.z.object({ post: posts_schema_1.detailSchema }).transform((body) => body.post);
|
|
59
|
+
const entryResponse = zod_1.z.object({ entry: posts_schema_1.entrySchema }).transform((body) => body.entry);
|
|
60
|
+
function createPostsClient(options) {
|
|
61
|
+
const { publicKey, appId, authorToken, baseUrl = client_1.DEFAULT_BASE_URL, fetch: fetchImpl = fetch, FormDataImpl = FormData, XMLHttpRequestImpl = globalThis.XMLHttpRequest, } = options;
|
|
62
|
+
const root = `${baseUrl.replace(/\/+$/, "")}/api/feedback/app`;
|
|
63
|
+
const owner = { ...(0, request_1.appHeaders)(appId), [exports.AUTHOR_HEADER]: authorToken };
|
|
64
|
+
const json = { ...owner, "Content-Type": "application/json" };
|
|
65
|
+
const url = (path, cursor) => `${root}${path}?key=${encodeURIComponent(publicKey)}${cursor === undefined ? "" : `&cursor=${encodeURIComponent(cursor)}`}`;
|
|
66
|
+
const get = (path, headers = owner, cursor) => () => fetchImpl(url(path, cursor), { method: "GET", headers });
|
|
67
|
+
const postNumber = (number) => Number.isSafeInteger(number) && number > 0;
|
|
68
|
+
function sendPost(input, images) {
|
|
69
|
+
const target = url("/posts");
|
|
70
|
+
const payload = JSON.stringify(input);
|
|
71
|
+
if (images.length === 0)
|
|
72
|
+
return fetchImpl(target, { method: "POST", headers: json, body: payload });
|
|
73
|
+
const form = new FormDataImpl();
|
|
74
|
+
form.append("payload", payload);
|
|
75
|
+
for (const image of images)
|
|
76
|
+
form.append("images", { uri: image.uri, type: image.mimeType, name: image.fileName });
|
|
77
|
+
if (XMLHttpRequestImpl === undefined)
|
|
78
|
+
return fetchImpl(target, { method: "POST", headers: owner, body: form });
|
|
79
|
+
return (0, transport_1.xhrPost)(XMLHttpRequestImpl, target, owner, form);
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
getSite: () => call(get("/site", (0, request_1.appHeaders)(appId)), 200, siteResponse, "SITE_NOT_FOUND"),
|
|
83
|
+
async createPost(input, images = []) {
|
|
84
|
+
if (!input.content.trim())
|
|
85
|
+
return fail("VALIDATION_ERROR");
|
|
86
|
+
const verdict = (0, request_1.validateImages)(images);
|
|
87
|
+
if (verdict !== "ok")
|
|
88
|
+
return fail(verdict);
|
|
89
|
+
return call(() => sendPost(input, images), 201, createdResponse);
|
|
90
|
+
},
|
|
91
|
+
listMyPosts: (cursor) => call(get("/posts", owner, cursor), 200, posts_schema_1.listSchema),
|
|
92
|
+
async getPost(number) {
|
|
93
|
+
if (!postNumber(number))
|
|
94
|
+
return fail("NOT_FOUND");
|
|
95
|
+
return call(get(`/posts/${number}`), 200, detailResponse);
|
|
96
|
+
},
|
|
97
|
+
async addFollowUp(number, body) {
|
|
98
|
+
const trimmed = body.trim();
|
|
99
|
+
if (!trimmed || trimmed.length > exports.MAX_FOLLOW_UP)
|
|
100
|
+
return fail("VALIDATION_ERROR");
|
|
101
|
+
if (!postNumber(number))
|
|
102
|
+
return fail("NOT_FOUND");
|
|
103
|
+
const target = url(`/posts/${number}/followups`);
|
|
104
|
+
const send = () => fetchImpl(target, { method: "POST", headers: json, body: JSON.stringify({ body: trimmed }) });
|
|
105
|
+
return call(send, 201, entryResponse);
|
|
106
|
+
},
|
|
107
|
+
getUnread: () => call(get("/unread"), 200, posts_schema_1.unreadSchema),
|
|
108
|
+
imageSource: (number, imageId) => ({
|
|
109
|
+
uri: url(`/posts/${number}/images/${encodeURIComponent(imageId)}`),
|
|
110
|
+
headers: owner,
|
|
111
|
+
}),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ContactMode } from "./config";
|
|
2
|
+
import type { ResolvedTexts } from "./texts";
|
|
3
|
+
export type ClientMetadata = Readonly<{
|
|
4
|
+
platform: "ios" | "android";
|
|
5
|
+
osVersion?: string;
|
|
6
|
+
appVersion?: string;
|
|
7
|
+
deviceModel?: string;
|
|
8
|
+
deviceType?: "phone" | "tablet";
|
|
9
|
+
}>;
|
|
10
|
+
export type ImageAsset = Readonly<{
|
|
11
|
+
uri: string;
|
|
12
|
+
mimeType: string;
|
|
13
|
+
fileName: string;
|
|
14
|
+
fileSize?: number;
|
|
15
|
+
}>;
|
|
16
|
+
export type FeedbackErrorCode = "APP_NOT_ALLOWED" | "ORIGIN_NOT_ALLOWED" | "RATE_LIMITED" | "VALIDATION_ERROR" | "IMAGES_DISABLED" | "TOO_MANY_IMAGES" | "IMAGE_TOO_LARGE" | "INVALID_IMAGE" | "WIDGET_NOT_FOUND" | "NETWORK_ERROR" | "ELIGIBILITY";
|
|
17
|
+
export type FeedbackPayload = Readonly<{
|
|
18
|
+
key: string;
|
|
19
|
+
content: string;
|
|
20
|
+
pageUrl: string;
|
|
21
|
+
contactEmail?: string;
|
|
22
|
+
contact?: string;
|
|
23
|
+
uid?: string;
|
|
24
|
+
client?: ClientMetadata;
|
|
25
|
+
}> & ({
|
|
26
|
+
readonly kind: "feedback";
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: "nps" | "csat";
|
|
29
|
+
readonly score: number;
|
|
30
|
+
readonly surveyId: string;
|
|
31
|
+
});
|
|
32
|
+
export type FeedbackInput = Readonly<{
|
|
33
|
+
key: string;
|
|
34
|
+
appId: string;
|
|
35
|
+
screen: string;
|
|
36
|
+
message: string;
|
|
37
|
+
contact?: string | null;
|
|
38
|
+
contactMode?: ContactMode;
|
|
39
|
+
uid?: string | number | null;
|
|
40
|
+
client?: ClientMetadata;
|
|
41
|
+
}>;
|
|
42
|
+
export type SurveyInput = FeedbackInput & Readonly<{
|
|
43
|
+
kind: "nps" | "csat";
|
|
44
|
+
score: number;
|
|
45
|
+
surveyId: string;
|
|
46
|
+
}>;
|
|
47
|
+
export declare function configUrl(baseUrl: string, key: string): string;
|
|
48
|
+
export declare function appHeaders(appId: string): Readonly<Record<string, string>>;
|
|
49
|
+
export declare function screenPageUrl(appId: string, screen: string): string;
|
|
50
|
+
export declare function buildFeedbackPayload(input: FeedbackInput): FeedbackPayload;
|
|
51
|
+
export declare function buildSurveyPayload(input: SurveyInput): FeedbackPayload;
|
|
52
|
+
export declare function validateImages(assets: readonly ImageAsset[]): "ok" | "TOO_MANY_IMAGES" | "IMAGE_TOO_LARGE" | "INVALID_IMAGE";
|
|
53
|
+
export declare function errorMessageKey(code: FeedbackErrorCode): keyof ResolvedTexts;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configUrl = configUrl;
|
|
4
|
+
exports.appHeaders = appHeaders;
|
|
5
|
+
exports.screenPageUrl = screenPageUrl;
|
|
6
|
+
exports.buildFeedbackPayload = buildFeedbackPayload;
|
|
7
|
+
exports.buildSurveyPayload = buildSurveyPayload;
|
|
8
|
+
exports.validateImages = validateImages;
|
|
9
|
+
exports.errorMessageKey = errorMessageKey;
|
|
10
|
+
function configUrl(baseUrl, key) {
|
|
11
|
+
return `${baseUrl.replace(/\/+$/, "")}/api/feedback/widget/config?key=${encodeURIComponent(key)}`;
|
|
12
|
+
}
|
|
13
|
+
function appHeaders(appId) {
|
|
14
|
+
return { "X-TheSeeker-App": appId };
|
|
15
|
+
}
|
|
16
|
+
function screenPageUrl(appId, screen) {
|
|
17
|
+
return `app://${appId}/${screen.replace(/^\/+/, "")}`.slice(0, 2000);
|
|
18
|
+
}
|
|
19
|
+
function buildFeedbackPayload(input) {
|
|
20
|
+
const contact = input.contact?.trim();
|
|
21
|
+
const uid = typeof input.uid === "number" && Number.isFinite(input.uid) ? String(input.uid) : input.uid;
|
|
22
|
+
return {
|
|
23
|
+
key: input.key,
|
|
24
|
+
kind: "feedback",
|
|
25
|
+
content: input.message.trim(),
|
|
26
|
+
pageUrl: screenPageUrl(input.appId, input.screen),
|
|
27
|
+
...contactFields(input.contactMode ?? "email", contact),
|
|
28
|
+
...(typeof uid === "string" && uid.trim() !== "" && uid.length <= 128 ? { uid } : {}),
|
|
29
|
+
...(input.client === undefined ? {} : { client: input.client }),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function contactFields(mode, contact) {
|
|
33
|
+
if (!contact)
|
|
34
|
+
return {};
|
|
35
|
+
switch (mode) {
|
|
36
|
+
case "email":
|
|
37
|
+
return { contactEmail: contact };
|
|
38
|
+
case "text":
|
|
39
|
+
return { contact };
|
|
40
|
+
case "hidden":
|
|
41
|
+
return {};
|
|
42
|
+
default:
|
|
43
|
+
return assertNever(mode);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function buildSurveyPayload(input) {
|
|
47
|
+
return { ...buildFeedbackPayload(input), kind: input.kind, score: input.score, surveyId: input.surveyId };
|
|
48
|
+
}
|
|
49
|
+
function validateImages(assets) {
|
|
50
|
+
if (assets.length > 4)
|
|
51
|
+
return "TOO_MANY_IMAGES";
|
|
52
|
+
for (const asset of assets) {
|
|
53
|
+
if (!["image/png", "image/jpeg", "image/gif", "image/webp"].includes(asset.mimeType))
|
|
54
|
+
return "INVALID_IMAGE";
|
|
55
|
+
if (asset.fileSize !== undefined && (!Number.isFinite(asset.fileSize) || asset.fileSize < 0))
|
|
56
|
+
return "INVALID_IMAGE";
|
|
57
|
+
if (asset.fileSize !== undefined && asset.fileSize > 2097152)
|
|
58
|
+
return "IMAGE_TOO_LARGE";
|
|
59
|
+
}
|
|
60
|
+
return "ok";
|
|
61
|
+
}
|
|
62
|
+
function errorMessageKey(code) {
|
|
63
|
+
switch (code) {
|
|
64
|
+
case "RATE_LIMITED":
|
|
65
|
+
return "rateLimited";
|
|
66
|
+
case "IMAGES_DISABLED":
|
|
67
|
+
return "imagesOff";
|
|
68
|
+
case "TOO_MANY_IMAGES":
|
|
69
|
+
return "tooMany";
|
|
70
|
+
case "IMAGE_TOO_LARGE":
|
|
71
|
+
return "imageTooLarge";
|
|
72
|
+
case "INVALID_IMAGE":
|
|
73
|
+
return "invalidImage";
|
|
74
|
+
case "ELIGIBILITY":
|
|
75
|
+
return "notEligible";
|
|
76
|
+
case "APP_NOT_ALLOWED":
|
|
77
|
+
case "ORIGIN_NOT_ALLOWED":
|
|
78
|
+
case "VALIDATION_ERROR":
|
|
79
|
+
case "WIDGET_NOT_FOUND":
|
|
80
|
+
case "NETWORK_ERROR":
|
|
81
|
+
return "failed";
|
|
82
|
+
default:
|
|
83
|
+
return assertNever(code);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function assertNever(value) {
|
|
87
|
+
throw new TypeError(`Unexpected feedback variant: ${value}`);
|
|
88
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Survey } from "./config";
|
|
2
|
+
export declare const DAY_MS = 86400000;
|
|
3
|
+
export declare function pathMatches(pattern: string | null, path: string): boolean;
|
|
4
|
+
export declare function surveyStorageKey(id: string): string;
|
|
5
|
+
export type SurveyEligibility = Readonly<{
|
|
6
|
+
survey: Survey;
|
|
7
|
+
screen: string;
|
|
8
|
+
lastShown: string | null;
|
|
9
|
+
now: number;
|
|
10
|
+
random: number;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function isSurveyEligible({ survey, screen, lastShown, now, random }: SurveyEligibility): boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DAY_MS = void 0;
|
|
4
|
+
exports.pathMatches = pathMatches;
|
|
5
|
+
exports.surveyStorageKey = surveyStorageKey;
|
|
6
|
+
exports.isSurveyEligible = isSurveyEligible;
|
|
7
|
+
exports.DAY_MS = 86400000;
|
|
8
|
+
function pathMatches(pattern, path) {
|
|
9
|
+
if (pattern === null)
|
|
10
|
+
return true;
|
|
11
|
+
const source = pattern
|
|
12
|
+
.split("*")
|
|
13
|
+
.map((part) => part.replace(/[.+?^${}()|[\]\\]/g, "\\$&"))
|
|
14
|
+
.join(".*");
|
|
15
|
+
return new RegExp(`^${source}$`).test(path);
|
|
16
|
+
}
|
|
17
|
+
function surveyStorageKey(id) {
|
|
18
|
+
return `tsfb:survey:${id}`;
|
|
19
|
+
}
|
|
20
|
+
function isSurveyEligible({ survey, screen, lastShown, now, random }) {
|
|
21
|
+
if (!pathMatches(survey.pathPattern, screen))
|
|
22
|
+
return false;
|
|
23
|
+
if (lastShown !== null && now - Number(lastShown) < survey.cooldownDays * exports.DAY_MS)
|
|
24
|
+
return false;
|
|
25
|
+
return random * 100 < survey.sampleRate;
|
|
26
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type { WidgetConfig } from "./config";
|
|
2
|
+
export declare const DEFAULT_TEXTS: {
|
|
3
|
+
readonly ko: {
|
|
4
|
+
readonly launcher: "피드백";
|
|
5
|
+
readonly title: "피드백 보내기";
|
|
6
|
+
readonly intro: "불편한 점이나 아이디어를 알려 주세요.";
|
|
7
|
+
readonly content: "내용";
|
|
8
|
+
readonly email: "이메일 (선택)";
|
|
9
|
+
readonly attachImage: "이미지 첨부";
|
|
10
|
+
readonly imageHint: "PNG·JPEG·WebP·GIF, 최대 4장, 장당 2MB";
|
|
11
|
+
readonly image: "첨부 이미지";
|
|
12
|
+
readonly dropHere: "여기에 이미지를 놓으세요";
|
|
13
|
+
readonly preparing: "이미지를 준비하는 중…";
|
|
14
|
+
readonly attached: "이미지를 첨부했습니다";
|
|
15
|
+
readonly tooMany: "이미지는 최대 4장까지 첨부할 수 있습니다";
|
|
16
|
+
readonly badType: "PNG, JPEG, WebP, GIF 이미지만 첨부할 수 있습니다";
|
|
17
|
+
readonly imageTooLarge: "이미지가 너무 큽니다 (장당 최대 2MB)";
|
|
18
|
+
readonly decodeFailed: "이미지를 불러오지 못했습니다";
|
|
19
|
+
readonly invalidImage: "이미지 파일을 확인해 주세요";
|
|
20
|
+
readonly imagesOff: "이미지 첨부가 꺼져 있습니다";
|
|
21
|
+
readonly inlineMissing: "인라인 위젯을 넣을 요소를 찾지 못했습니다";
|
|
22
|
+
readonly remove: "삭제";
|
|
23
|
+
readonly send: "보내기";
|
|
24
|
+
readonly close: "닫기";
|
|
25
|
+
readonly sending: "보내는 중…";
|
|
26
|
+
readonly thanks: "보내 주셔서 감사합니다";
|
|
27
|
+
readonly surveyThanks: "응답해 주셔서 감사합니다";
|
|
28
|
+
readonly rateLimited: "잠시 후 다시 시도해 주세요";
|
|
29
|
+
readonly tooLarge: "첨부가 너무 큽니다";
|
|
30
|
+
readonly failed: "전송에 실패했습니다";
|
|
31
|
+
readonly empty: "내용을 입력해 주세요";
|
|
32
|
+
readonly badEmail: "이메일 주소 형식을 확인해 주세요";
|
|
33
|
+
readonly npsScale: "0점부터 10점까지 선택";
|
|
34
|
+
readonly csatScale: "1점부터 5점까지 선택";
|
|
35
|
+
readonly npsLow: "추천하지 않음";
|
|
36
|
+
readonly npsHigh: "적극 추천";
|
|
37
|
+
readonly csatLow: "매우 불만족";
|
|
38
|
+
readonly csatHigh: "매우 만족";
|
|
39
|
+
readonly contact: "연락처 (선택)";
|
|
40
|
+
readonly contactPlaceholder: "텔레그램 아이디 또는 이메일";
|
|
41
|
+
readonly emailPlaceholder: "name@example.com";
|
|
42
|
+
readonly cancel: "취소";
|
|
43
|
+
readonly score: "{n}점";
|
|
44
|
+
readonly myFeedback: "내 피드백";
|
|
45
|
+
readonly teamAnswer: "운영팀 답변";
|
|
46
|
+
readonly followUp: "추가 의견";
|
|
47
|
+
readonly addFollowUp: "추가 의견 남기기";
|
|
48
|
+
readonly followUpHint: "이 글 아래 추가 의견으로 달립니다.";
|
|
49
|
+
readonly followUpPublicHint: "공개 보드 글이라 다른 사용자도 볼 수 있습니다.";
|
|
50
|
+
readonly followUpSubmit: "등록";
|
|
51
|
+
readonly followUpSent: "추가 의견을 등록했습니다";
|
|
52
|
+
readonly followUpClosed: "닫힌 글에는 추가 의견을 남길 수 없습니다";
|
|
53
|
+
readonly followUpOneWay: "이 앱은 추가 의견을 받지 않습니다";
|
|
54
|
+
readonly autoReply: "자동 안내";
|
|
55
|
+
readonly awaitingAnswer: "답변 대기";
|
|
56
|
+
readonly answered: "답변 완료";
|
|
57
|
+
readonly unreadCount: "새 답변 {n}개";
|
|
58
|
+
readonly answerPosted: "피드백에 답변이 등록되었습니다";
|
|
59
|
+
readonly receivedStatus: "접수됨 · 현재 상태";
|
|
60
|
+
readonly received: "접수됨";
|
|
61
|
+
readonly checking: "운영팀이 확인하고 있습니다";
|
|
62
|
+
readonly notYet: "아직";
|
|
63
|
+
readonly oneWayNote: "이 앱은 피드백을 받기만 합니다. 답변은 달리지 않고, 처리 상태를 여기에서 확인할 수 있습니다.";
|
|
64
|
+
readonly statusNew: "새 피드백";
|
|
65
|
+
readonly statusInProgress: "처리 중";
|
|
66
|
+
readonly statusResolved: "해결됨";
|
|
67
|
+
readonly statusClosed: "닫힘";
|
|
68
|
+
readonly boardReview: "검토 중";
|
|
69
|
+
readonly boardPlanned: "예정";
|
|
70
|
+
readonly boardInProgress: "진행 중";
|
|
71
|
+
readonly boardDone: "완료";
|
|
72
|
+
readonly statusChangedTo: "{status}{ro} 변경";
|
|
73
|
+
readonly statusChanged: "상태 변경";
|
|
74
|
+
readonly roadmapLinked: "로드맵에 추가됨";
|
|
75
|
+
readonly releaseLinked: "업데이트에 반영됨";
|
|
76
|
+
readonly publicBoard: "공개 보드";
|
|
77
|
+
readonly anonymousPosted: "익명으로 남김";
|
|
78
|
+
readonly writtenOn: "{date} 작성";
|
|
79
|
+
readonly untitled: "피드백 #{n}";
|
|
80
|
+
readonly emptyMine: "보낸 피드백이 없습니다";
|
|
81
|
+
readonly emptyMineHint: "피드백을 보내면 운영팀 답변과 처리 상태를 여기에서 확인할 수 있습니다.";
|
|
82
|
+
readonly writeFeedback: "피드백 쓰기";
|
|
83
|
+
readonly noAnswerYet: "아직 답변이 없습니다. 답변이 등록되면 이 글 아래에 표시됩니다.";
|
|
84
|
+
readonly loadFailed: "불러오지 못했습니다. 연결을 확인하고 다시 시도해 주세요.";
|
|
85
|
+
readonly retry: "다시 시도";
|
|
86
|
+
readonly postMissing: "이 글을 찾을 수 없습니다";
|
|
87
|
+
readonly loadMore: "더 보기";
|
|
88
|
+
readonly loading: "불러오는 중…";
|
|
89
|
+
readonly notEligible: "이메일을 남기거나 로그인한 뒤 다시 보내 주세요";
|
|
90
|
+
};
|
|
91
|
+
readonly en: {
|
|
92
|
+
readonly launcher: "Feedback";
|
|
93
|
+
readonly title: "Send feedback";
|
|
94
|
+
readonly intro: "Tell us what's not working or share an idea.";
|
|
95
|
+
readonly content: "Message";
|
|
96
|
+
readonly email: "Email (optional)";
|
|
97
|
+
readonly attachImage: "Attach image";
|
|
98
|
+
readonly imageHint: "PNG, JPEG, WebP or GIF, up to 4 images, 2 MB each";
|
|
99
|
+
readonly image: "Attached image";
|
|
100
|
+
readonly dropHere: "Drop images here";
|
|
101
|
+
readonly preparing: "Preparing image…";
|
|
102
|
+
readonly attached: "Image attached";
|
|
103
|
+
readonly tooMany: "You can attach up to 4 images";
|
|
104
|
+
readonly badType: "Only PNG, JPEG, WebP and GIF images can be attached";
|
|
105
|
+
readonly imageTooLarge: "Image is too large (2 MB max each)";
|
|
106
|
+
readonly decodeFailed: "Couldn't load the image";
|
|
107
|
+
readonly invalidImage: "Check the image file";
|
|
108
|
+
readonly imagesOff: "Image attachments are turned off";
|
|
109
|
+
readonly inlineMissing: "Couldn't find the element for the inline widget";
|
|
110
|
+
readonly remove: "Remove";
|
|
111
|
+
readonly send: "Send";
|
|
112
|
+
readonly close: "Close";
|
|
113
|
+
readonly sending: "Sending…";
|
|
114
|
+
readonly thanks: "Thanks for your feedback";
|
|
115
|
+
readonly surveyThanks: "Thanks for your response";
|
|
116
|
+
readonly rateLimited: "Please try again in a moment";
|
|
117
|
+
readonly tooLarge: "Attachments are too large";
|
|
118
|
+
readonly failed: "Couldn't send your feedback";
|
|
119
|
+
readonly empty: "Enter a message";
|
|
120
|
+
readonly badEmail: "Check the email address format";
|
|
121
|
+
readonly npsScale: "Choose a score from 0 to 10";
|
|
122
|
+
readonly csatScale: "Choose a score from 1 to 5";
|
|
123
|
+
readonly npsLow: "Not likely";
|
|
124
|
+
readonly npsHigh: "Very likely";
|
|
125
|
+
readonly csatLow: "Very dissatisfied";
|
|
126
|
+
readonly csatHigh: "Very satisfied";
|
|
127
|
+
readonly contact: "Contact (optional)";
|
|
128
|
+
readonly contactPlaceholder: "Telegram handle or email";
|
|
129
|
+
readonly emailPlaceholder: "name@example.com";
|
|
130
|
+
readonly cancel: "Cancel";
|
|
131
|
+
readonly score: "Score {n}";
|
|
132
|
+
readonly myFeedback: "My feedback";
|
|
133
|
+
readonly teamAnswer: "Team answer";
|
|
134
|
+
readonly followUp: "Follow-up";
|
|
135
|
+
readonly addFollowUp: "Add a follow-up";
|
|
136
|
+
readonly followUpHint: "It's added below your post as a follow-up.";
|
|
137
|
+
readonly followUpPublicHint: "This post is on the public board, so others can see it.";
|
|
138
|
+
readonly followUpSubmit: "Post";
|
|
139
|
+
readonly followUpSent: "Follow-up posted";
|
|
140
|
+
readonly followUpClosed: "This post is closed to follow-ups";
|
|
141
|
+
readonly followUpOneWay: "This app doesn't take follow-ups";
|
|
142
|
+
readonly autoReply: "Automatic reply";
|
|
143
|
+
readonly awaitingAnswer: "Awaiting answer";
|
|
144
|
+
readonly answered: "Answered";
|
|
145
|
+
readonly unreadCount: "New answers: {n}";
|
|
146
|
+
readonly answerPosted: "Your feedback has an answer";
|
|
147
|
+
readonly receivedStatus: "Received · Current status";
|
|
148
|
+
readonly received: "Received";
|
|
149
|
+
readonly checking: "The team is looking into it";
|
|
150
|
+
readonly notYet: "Not yet";
|
|
151
|
+
readonly oneWayNote: "This app only receives feedback. There are no answers, but you can follow the status here.";
|
|
152
|
+
readonly statusNew: "New";
|
|
153
|
+
readonly statusInProgress: "In progress";
|
|
154
|
+
readonly statusResolved: "Resolved";
|
|
155
|
+
readonly statusClosed: "Closed";
|
|
156
|
+
readonly boardReview: "Under review";
|
|
157
|
+
readonly boardPlanned: "Planned";
|
|
158
|
+
readonly boardInProgress: "In progress";
|
|
159
|
+
readonly boardDone: "Done";
|
|
160
|
+
readonly statusChangedTo: "Changed to {status}";
|
|
161
|
+
readonly statusChanged: "Status changed";
|
|
162
|
+
readonly roadmapLinked: "Added to the roadmap";
|
|
163
|
+
readonly releaseLinked: "Shipped in an update";
|
|
164
|
+
readonly publicBoard: "Public board";
|
|
165
|
+
readonly anonymousPosted: "Posted anonymously";
|
|
166
|
+
readonly writtenOn: "Posted {date}";
|
|
167
|
+
readonly untitled: "Feedback #{n}";
|
|
168
|
+
readonly emptyMine: "No feedback yet";
|
|
169
|
+
readonly emptyMineHint: "Send feedback to follow team answers and its status here.";
|
|
170
|
+
readonly writeFeedback: "Write feedback";
|
|
171
|
+
readonly noAnswerYet: "No answer yet. Answers appear below your post.";
|
|
172
|
+
readonly loadFailed: "Unable to load. Check your connection and try again.";
|
|
173
|
+
readonly retry: "Try again";
|
|
174
|
+
readonly postMissing: "This post isn't available";
|
|
175
|
+
readonly loadMore: "Load more";
|
|
176
|
+
readonly loading: "Loading…";
|
|
177
|
+
readonly notEligible: "Add your email or sign in, then send again";
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
export type Locale = "ko" | "en";
|
|
181
|
+
export type LocaleMode = Locale | "auto";
|
|
182
|
+
export type FormTexts = Readonly<{
|
|
183
|
+
title: string;
|
|
184
|
+
description: string;
|
|
185
|
+
contentLabel: string;
|
|
186
|
+
contentPlaceholder: string;
|
|
187
|
+
contactLabel: string;
|
|
188
|
+
contactPlaceholder: string;
|
|
189
|
+
submitLabel: string;
|
|
190
|
+
cancelLabel: string;
|
|
191
|
+
thanks: string;
|
|
192
|
+
}>;
|
|
193
|
+
export type ResolvedTexts = Readonly<Record<keyof typeof DEFAULT_TEXTS.ko, string>> & FormTexts;
|
|
194
|
+
export declare function parseTexts(raw: unknown, contactMode: unknown, locale: Locale): FormTexts;
|
|
195
|
+
export declare function resolveLocale(locale: LocaleMode, deviceLocale?: string | null): Locale;
|
|
196
|
+
export declare function resolveTexts(config: WidgetConfig, locale: Locale): ResolvedTexts;
|