@the-seeker/changes-react-native 0.0.0-stage → 0.1.0
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 +119 -2
- package/dist/core/cache.d.ts +14 -0
- package/dist/core/cache.js +34 -0
- package/dist/core/client.d.ts +161 -0
- package/dist/core/client.js +97 -0
- package/dist/core/decide.d.ts +16 -0
- package/dist/core/decide.js +57 -0
- package/dist/core/rating.d.ts +7 -0
- package/dist/core/rating.js +18 -0
- package/dist/core/storage.d.ts +20 -0
- package/dist/core/storage.js +73 -0
- package/dist/core/types.d.ts +332 -0
- package/dist/core/types.js +126 -0
- package/dist/core/versions.d.ts +2 -0
- package/dist/core/versions.js +20 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +44 -0
- package/dist/native/Blocks.d.ts +7 -0
- package/dist/native/Blocks.js +45 -0
- package/dist/native/ChangelogButton.d.ts +6 -0
- package/dist/native/ChangelogButton.js +16 -0
- package/dist/native/ChangelogScreen.d.ts +6 -0
- package/dist/native/ChangelogScreen.js +52 -0
- package/dist/native/CommentComposer.d.ts +11 -0
- package/dist/native/CommentComposer.js +40 -0
- package/dist/native/CommentItem.d.ts +15 -0
- package/dist/native/CommentItem.js +35 -0
- package/dist/native/CommentsThread.d.ts +9 -0
- package/dist/native/CommentsThread.js +24 -0
- package/dist/native/Provider.d.ts +11 -0
- package/dist/native/Provider.js +68 -0
- package/dist/native/ReleaseView.d.ts +11 -0
- package/dist/native/ReleaseView.js +37 -0
- package/dist/native/WhatsNewSheet.d.ts +6 -0
- package/dist/native/WhatsNewSheet.js +52 -0
- package/dist/native/community.d.ts +18 -0
- package/dist/native/community.js +39 -0
- package/dist/native/context.d.ts +123 -0
- package/dist/native/context.js +26 -0
- package/dist/native/default-texts.d.ts +89 -0
- package/dist/native/default-texts.js +92 -0
- package/dist/native/format.d.ts +5 -0
- package/dist/native/format.js +34 -0
- package/dist/native/messages.d.ts +44 -0
- package/dist/native/messages.js +83 -0
- package/dist/native/primitives.d.ts +39 -0
- package/dist/native/primitives.js +78 -0
- package/dist/native/rating-plan.d.ts +31 -0
- package/dist/native/rating-plan.js +101 -0
- package/dist/native/resolve.d.ts +21 -0
- package/dist/native/resolve.js +73 -0
- package/dist/native/session.d.ts +48 -0
- package/dist/native/session.js +83 -0
- package/dist/native/styles-community.d.ts +1447 -0
- package/dist/native/styles-community.js +117 -0
- package/dist/native/styles-scale.d.ts +66 -0
- package/dist/native/styles-scale.js +22 -0
- package/dist/native/styles.d.ts +2584 -0
- package/dist/native/styles.js +161 -0
- package/dist/native/tokens.d.ts +51 -0
- package/dist/native/tokens.js +90 -0
- package/dist/native/use-actions.d.ts +55 -0
- package/dist/native/use-actions.js +59 -0
- package/dist/native/use-comments.d.ts +40 -0
- package/dist/native/use-comments.js +83 -0
- package/dist/native/use-controller.d.ts +101 -0
- package/dist/native/use-controller.js +144 -0
- package/dist/native/use-session.d.ts +268 -0
- package/dist/native/use-session.js +86 -0
- package/package.json +49 -3
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const platformSchema: z.ZodEnum<{
|
|
3
|
+
web: "web";
|
|
4
|
+
ios: "ios";
|
|
5
|
+
android: "android";
|
|
6
|
+
}>;
|
|
7
|
+
export type Platform = z.infer<typeof platformSchema>;
|
|
8
|
+
export declare const inlineSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
9
|
+
t: z.ZodEnum<{
|
|
10
|
+
text: "text";
|
|
11
|
+
strong: "strong";
|
|
12
|
+
code: "code";
|
|
13
|
+
}>;
|
|
14
|
+
v: z.ZodString;
|
|
15
|
+
}, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
|
|
16
|
+
t: z.ZodLiteral<"link">;
|
|
17
|
+
v: z.ZodString;
|
|
18
|
+
href: z.ZodString;
|
|
19
|
+
}, z.core.$strip>>]>;
|
|
20
|
+
export declare const blockSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
21
|
+
t: z.ZodEnum<{
|
|
22
|
+
p: "p";
|
|
23
|
+
h: "h";
|
|
24
|
+
}>;
|
|
25
|
+
c: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
26
|
+
t: z.ZodEnum<{
|
|
27
|
+
text: "text";
|
|
28
|
+
strong: "strong";
|
|
29
|
+
code: "code";
|
|
30
|
+
}>;
|
|
31
|
+
v: z.ZodString;
|
|
32
|
+
}, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
|
|
33
|
+
t: z.ZodLiteral<"link">;
|
|
34
|
+
v: z.ZodString;
|
|
35
|
+
href: z.ZodString;
|
|
36
|
+
}, z.core.$strip>>]>>>;
|
|
37
|
+
}, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
|
|
38
|
+
t: z.ZodLiteral<"ul">;
|
|
39
|
+
items: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
40
|
+
t: z.ZodEnum<{
|
|
41
|
+
text: "text";
|
|
42
|
+
strong: "strong";
|
|
43
|
+
code: "code";
|
|
44
|
+
}>;
|
|
45
|
+
v: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
|
|
47
|
+
t: z.ZodLiteral<"link">;
|
|
48
|
+
v: z.ZodString;
|
|
49
|
+
href: z.ZodString;
|
|
50
|
+
}, z.core.$strip>>]>>>>>;
|
|
51
|
+
}, z.core.$strip>>]>;
|
|
52
|
+
export type Inline = z.infer<typeof inlineSchema>;
|
|
53
|
+
export type Block = z.infer<typeof blockSchema>;
|
|
54
|
+
export declare const voteSchema: z.ZodReadonly<z.ZodObject<{
|
|
55
|
+
upvotes: z.ZodNumber;
|
|
56
|
+
downvotes: z.ZodNumber;
|
|
57
|
+
myVote: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>, z.ZodLiteral<0>]>;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
export declare const releaseSchema: z.ZodReadonly<z.ZodObject<{
|
|
60
|
+
commentCount: z.ZodNumber;
|
|
61
|
+
upvotes: z.ZodNumber;
|
|
62
|
+
downvotes: z.ZodNumber;
|
|
63
|
+
myVote: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>, z.ZodLiteral<0>]>;
|
|
64
|
+
id: z.ZodString;
|
|
65
|
+
version: z.ZodNullable<z.ZodString>;
|
|
66
|
+
ref: z.ZodString;
|
|
67
|
+
title: z.ZodString;
|
|
68
|
+
body: z.ZodString;
|
|
69
|
+
blocks: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
70
|
+
t: z.ZodEnum<{
|
|
71
|
+
p: "p";
|
|
72
|
+
h: "h";
|
|
73
|
+
}>;
|
|
74
|
+
c: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
75
|
+
t: z.ZodEnum<{
|
|
76
|
+
text: "text";
|
|
77
|
+
strong: "strong";
|
|
78
|
+
code: "code";
|
|
79
|
+
}>;
|
|
80
|
+
v: z.ZodString;
|
|
81
|
+
}, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
|
|
82
|
+
t: z.ZodLiteral<"link">;
|
|
83
|
+
v: z.ZodString;
|
|
84
|
+
href: z.ZodString;
|
|
85
|
+
}, z.core.$strip>>]>>>;
|
|
86
|
+
}, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
|
|
87
|
+
t: z.ZodLiteral<"ul">;
|
|
88
|
+
items: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
89
|
+
t: z.ZodEnum<{
|
|
90
|
+
text: "text";
|
|
91
|
+
strong: "strong";
|
|
92
|
+
code: "code";
|
|
93
|
+
}>;
|
|
94
|
+
v: z.ZodString;
|
|
95
|
+
}, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
|
|
96
|
+
t: z.ZodLiteral<"link">;
|
|
97
|
+
v: z.ZodString;
|
|
98
|
+
href: z.ZodString;
|
|
99
|
+
}, z.core.$strip>>]>>>>>;
|
|
100
|
+
}, z.core.$strip>>]>>>;
|
|
101
|
+
tags: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
102
|
+
new: "new";
|
|
103
|
+
improved: "improved";
|
|
104
|
+
fixed: "fixed";
|
|
105
|
+
security: "security";
|
|
106
|
+
deprecated: "deprecated";
|
|
107
|
+
}>>>;
|
|
108
|
+
platforms: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
109
|
+
web: "web";
|
|
110
|
+
ios: "ios";
|
|
111
|
+
android: "android";
|
|
112
|
+
}>>>;
|
|
113
|
+
source: z.ZodEnum<{
|
|
114
|
+
manual: "manual";
|
|
115
|
+
app_store: "app_store";
|
|
116
|
+
}>;
|
|
117
|
+
publishedAt: z.ZodString;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
export declare const releasesSchema: z.ZodReadonly<z.ZodObject<{
|
|
120
|
+
items: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
121
|
+
commentCount: z.ZodNumber;
|
|
122
|
+
upvotes: z.ZodNumber;
|
|
123
|
+
downvotes: z.ZodNumber;
|
|
124
|
+
myVote: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>, z.ZodLiteral<0>]>;
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
version: z.ZodNullable<z.ZodString>;
|
|
127
|
+
ref: z.ZodString;
|
|
128
|
+
title: z.ZodString;
|
|
129
|
+
body: z.ZodString;
|
|
130
|
+
blocks: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
131
|
+
t: z.ZodEnum<{
|
|
132
|
+
p: "p";
|
|
133
|
+
h: "h";
|
|
134
|
+
}>;
|
|
135
|
+
c: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
136
|
+
t: z.ZodEnum<{
|
|
137
|
+
text: "text";
|
|
138
|
+
strong: "strong";
|
|
139
|
+
code: "code";
|
|
140
|
+
}>;
|
|
141
|
+
v: z.ZodString;
|
|
142
|
+
}, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
|
|
143
|
+
t: z.ZodLiteral<"link">;
|
|
144
|
+
v: z.ZodString;
|
|
145
|
+
href: z.ZodString;
|
|
146
|
+
}, z.core.$strip>>]>>>;
|
|
147
|
+
}, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
|
|
148
|
+
t: z.ZodLiteral<"ul">;
|
|
149
|
+
items: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
150
|
+
t: z.ZodEnum<{
|
|
151
|
+
text: "text";
|
|
152
|
+
strong: "strong";
|
|
153
|
+
code: "code";
|
|
154
|
+
}>;
|
|
155
|
+
v: z.ZodString;
|
|
156
|
+
}, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
|
|
157
|
+
t: z.ZodLiteral<"link">;
|
|
158
|
+
v: z.ZodString;
|
|
159
|
+
href: z.ZodString;
|
|
160
|
+
}, z.core.$strip>>]>>>>>;
|
|
161
|
+
}, z.core.$strip>>]>>>;
|
|
162
|
+
tags: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
163
|
+
new: "new";
|
|
164
|
+
improved: "improved";
|
|
165
|
+
fixed: "fixed";
|
|
166
|
+
security: "security";
|
|
167
|
+
deprecated: "deprecated";
|
|
168
|
+
}>>>;
|
|
169
|
+
platforms: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
170
|
+
web: "web";
|
|
171
|
+
ios: "ios";
|
|
172
|
+
android: "android";
|
|
173
|
+
}>>>;
|
|
174
|
+
source: z.ZodEnum<{
|
|
175
|
+
manual: "manual";
|
|
176
|
+
app_store: "app_store";
|
|
177
|
+
}>;
|
|
178
|
+
publishedAt: z.ZodString;
|
|
179
|
+
}, z.core.$strip>>>>;
|
|
180
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
181
|
+
}, z.core.$strip>>;
|
|
182
|
+
export type Release = z.infer<typeof releaseSchema>;
|
|
183
|
+
export type Releases = z.infer<typeof releasesSchema>;
|
|
184
|
+
export declare const configSchema: z.ZodReadonly<z.ZodObject<{
|
|
185
|
+
enabled: z.ZodBoolean;
|
|
186
|
+
defaultLocale: z.ZodEnum<{
|
|
187
|
+
ko: "ko";
|
|
188
|
+
en: "en";
|
|
189
|
+
}>;
|
|
190
|
+
app: z.ZodReadonly<z.ZodObject<{
|
|
191
|
+
name: z.ZodString;
|
|
192
|
+
subtitle: z.ZodNullable<z.ZodString>;
|
|
193
|
+
description: z.ZodNullable<z.ZodString>;
|
|
194
|
+
iconUrl: z.ZodNullable<z.ZodString>;
|
|
195
|
+
websiteUrl: z.ZodNullable<z.ZodString>;
|
|
196
|
+
accentColor: z.ZodString;
|
|
197
|
+
contactEmail: z.ZodNullable<z.ZodString>;
|
|
198
|
+
appStoreUrl: z.ZodNullable<z.ZodString>;
|
|
199
|
+
playStoreUrl: z.ZodNullable<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>>;
|
|
201
|
+
page: z.ZodReadonly<z.ZodObject<{
|
|
202
|
+
enabled: z.ZodBoolean;
|
|
203
|
+
url: z.ZodString;
|
|
204
|
+
}, z.core.$strip>>;
|
|
205
|
+
community: z.ZodReadonly<z.ZodObject<{
|
|
206
|
+
votesEnabled: z.ZodBoolean;
|
|
207
|
+
commentsEnabled: z.ZodBoolean;
|
|
208
|
+
requireGuidelinesAck: z.ZodBoolean;
|
|
209
|
+
allowAuthorNames: z.ZodBoolean;
|
|
210
|
+
}, z.core.$strip>>;
|
|
211
|
+
rating: z.ZodReadonly<z.ZodObject<{
|
|
212
|
+
mode: z.ZodEnum<{
|
|
213
|
+
off: "off";
|
|
214
|
+
always: "always";
|
|
215
|
+
after_upvote: "after_upvote";
|
|
216
|
+
}>;
|
|
217
|
+
iosAppStoreId: z.ZodNullable<z.ZodString>;
|
|
218
|
+
androidPackage: z.ZodNullable<z.ZodString>;
|
|
219
|
+
reviewUrl: z.ZodNullable<z.ZodString>;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
texts: z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>>;
|
|
222
|
+
}, z.core.$strip>>;
|
|
223
|
+
export type Config = z.infer<typeof configSchema>;
|
|
224
|
+
export declare const commentSchema: z.ZodReadonly<z.ZodObject<{
|
|
225
|
+
upvotes: z.ZodNumber;
|
|
226
|
+
downvotes: z.ZodNumber;
|
|
227
|
+
myVote: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>, z.ZodLiteral<0>]>;
|
|
228
|
+
id: z.ZodString;
|
|
229
|
+
authorName: z.ZodString;
|
|
230
|
+
isDeveloper: z.ZodBoolean;
|
|
231
|
+
body: z.ZodString;
|
|
232
|
+
createdAt: z.ZodString;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
export declare const threadSchema: z.ZodReadonly<z.ZodObject<{
|
|
235
|
+
upvotes: z.ZodNumber;
|
|
236
|
+
downvotes: z.ZodNumber;
|
|
237
|
+
myVote: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>, z.ZodLiteral<0>]>;
|
|
238
|
+
id: z.ZodString;
|
|
239
|
+
authorName: z.ZodString;
|
|
240
|
+
isDeveloper: z.ZodBoolean;
|
|
241
|
+
body: z.ZodString;
|
|
242
|
+
createdAt: z.ZodString;
|
|
243
|
+
replies: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
244
|
+
upvotes: z.ZodNumber;
|
|
245
|
+
downvotes: z.ZodNumber;
|
|
246
|
+
myVote: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>, z.ZodLiteral<0>]>;
|
|
247
|
+
id: z.ZodString;
|
|
248
|
+
authorName: z.ZodString;
|
|
249
|
+
isDeveloper: z.ZodBoolean;
|
|
250
|
+
body: z.ZodString;
|
|
251
|
+
createdAt: z.ZodString;
|
|
252
|
+
}, z.core.$strip>>>>;
|
|
253
|
+
}, z.core.$strip>>;
|
|
254
|
+
export declare const commentsSchema: z.ZodReadonly<z.ZodObject<{
|
|
255
|
+
items: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
256
|
+
upvotes: z.ZodNumber;
|
|
257
|
+
downvotes: z.ZodNumber;
|
|
258
|
+
myVote: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>, z.ZodLiteral<0>]>;
|
|
259
|
+
id: z.ZodString;
|
|
260
|
+
authorName: z.ZodString;
|
|
261
|
+
isDeveloper: z.ZodBoolean;
|
|
262
|
+
body: z.ZodString;
|
|
263
|
+
createdAt: z.ZodString;
|
|
264
|
+
replies: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
265
|
+
upvotes: z.ZodNumber;
|
|
266
|
+
downvotes: z.ZodNumber;
|
|
267
|
+
myVote: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<-1>, z.ZodLiteral<0>]>;
|
|
268
|
+
id: z.ZodString;
|
|
269
|
+
authorName: z.ZodString;
|
|
270
|
+
isDeveloper: z.ZodBoolean;
|
|
271
|
+
body: z.ZodString;
|
|
272
|
+
createdAt: z.ZodString;
|
|
273
|
+
}, z.core.$strip>>>>;
|
|
274
|
+
}, z.core.$strip>>>>;
|
|
275
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
276
|
+
total: z.ZodNumber;
|
|
277
|
+
}, z.core.$strip>>;
|
|
278
|
+
export type Comment = z.infer<typeof threadSchema>;
|
|
279
|
+
export type CommentReply = z.infer<typeof commentSchema>;
|
|
280
|
+
export declare const errorCodeSchema: z.ZodEnum<{
|
|
281
|
+
BAD_REQUEST: "BAD_REQUEST";
|
|
282
|
+
VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
283
|
+
PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
|
|
284
|
+
RATE_LIMITED: "RATE_LIMITED";
|
|
285
|
+
ORIGIN_NOT_ALLOWED: "ORIGIN_NOT_ALLOWED";
|
|
286
|
+
APP_NOT_ALLOWED: "APP_NOT_ALLOWED";
|
|
287
|
+
CHANGES_NOT_FOUND: "CHANGES_NOT_FOUND";
|
|
288
|
+
RELEASE_NOT_FOUND: "RELEASE_NOT_FOUND";
|
|
289
|
+
COMMENT_NOT_FOUND: "COMMENT_NOT_FOUND";
|
|
290
|
+
PROPERTY_NOT_FOUND: "PROPERTY_NOT_FOUND";
|
|
291
|
+
VOTES_DISABLED: "VOTES_DISABLED";
|
|
292
|
+
COMMENTS_DISABLED: "COMMENTS_DISABLED";
|
|
293
|
+
BANNED: "BANNED";
|
|
294
|
+
GUIDELINES_REQUIRED: "GUIDELINES_REQUIRED";
|
|
295
|
+
NETWORK_ERROR: "NETWORK_ERROR";
|
|
296
|
+
HTTP_ERROR: "HTTP_ERROR";
|
|
297
|
+
INVALID_RESPONSE: "INVALID_RESPONSE";
|
|
298
|
+
}>;
|
|
299
|
+
export type ErrorCode = z.infer<typeof errorCodeSchema>;
|
|
300
|
+
export type Failure = Readonly<{
|
|
301
|
+
ok: false;
|
|
302
|
+
code: ErrorCode;
|
|
303
|
+
}>;
|
|
304
|
+
export type Result<T> = Readonly<{
|
|
305
|
+
ok: true;
|
|
306
|
+
body: T;
|
|
307
|
+
}> | Failure;
|
|
308
|
+
export type Voter = Readonly<{
|
|
309
|
+
installId: string;
|
|
310
|
+
userId?: string;
|
|
311
|
+
name?: string;
|
|
312
|
+
}>;
|
|
313
|
+
export type User = Readonly<{
|
|
314
|
+
userId?: string;
|
|
315
|
+
name?: string;
|
|
316
|
+
}>;
|
|
317
|
+
export type ClientInfo = Readonly<{
|
|
318
|
+
platform: Platform;
|
|
319
|
+
osVersion?: string;
|
|
320
|
+
appVersion?: string;
|
|
321
|
+
deviceModel?: string;
|
|
322
|
+
deviceType?: string;
|
|
323
|
+
}>;
|
|
324
|
+
export declare const stateSchema: z.ZodReadonly<z.ZodObject<{
|
|
325
|
+
v: z.ZodLiteral<1>;
|
|
326
|
+
lastVersion: z.ZodNullable<z.ZodString>;
|
|
327
|
+
baselineReleaseId: z.ZodNullable<z.ZodString>;
|
|
328
|
+
presentedIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
329
|
+
firstSeenAt: z.ZodString;
|
|
330
|
+
listOpenedAt: z.ZodNullable<z.ZodString>;
|
|
331
|
+
}, z.core.$strip>>;
|
|
332
|
+
export type ChangesState = z.infer<typeof stateSchema>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stateSchema = exports.errorCodeSchema = exports.commentsSchema = exports.threadSchema = exports.commentSchema = exports.configSchema = exports.releasesSchema = exports.releaseSchema = exports.voteSchema = exports.blockSchema = exports.inlineSchema = exports.platformSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.platformSchema = zod_1.z.enum(["web", "ios", "android"]);
|
|
6
|
+
exports.inlineSchema = zod_1.z.union([
|
|
7
|
+
zod_1.z.object({ t: zod_1.z.enum(["text", "strong", "code"]), v: zod_1.z.string() }).readonly(),
|
|
8
|
+
zod_1.z.object({ t: zod_1.z.literal("link"), v: zod_1.z.string(), href: zod_1.z.string().url().startsWith("https://") }).readonly(),
|
|
9
|
+
]);
|
|
10
|
+
exports.blockSchema = zod_1.z.union([
|
|
11
|
+
zod_1.z.object({ t: zod_1.z.enum(["p", "h"]), c: zod_1.z.array(exports.inlineSchema).readonly() }).readonly(),
|
|
12
|
+
zod_1.z.object({ t: zod_1.z.literal("ul"), items: zod_1.z.array(zod_1.z.array(exports.inlineSchema).readonly()).readonly() }).readonly(),
|
|
13
|
+
]);
|
|
14
|
+
exports.voteSchema = zod_1.z
|
|
15
|
+
.object({
|
|
16
|
+
upvotes: zod_1.z.number().int().nonnegative(),
|
|
17
|
+
downvotes: zod_1.z.number().int().nonnegative(),
|
|
18
|
+
myVote: zod_1.z.union([zod_1.z.literal(1), zod_1.z.literal(-1), zod_1.z.literal(0)]),
|
|
19
|
+
})
|
|
20
|
+
.readonly();
|
|
21
|
+
exports.releaseSchema = zod_1.z
|
|
22
|
+
.object({
|
|
23
|
+
id: zod_1.z.string(),
|
|
24
|
+
version: zod_1.z.string().nullable(),
|
|
25
|
+
ref: zod_1.z.string(),
|
|
26
|
+
title: zod_1.z.string(),
|
|
27
|
+
body: zod_1.z.string(),
|
|
28
|
+
blocks: zod_1.z.array(exports.blockSchema).max(200).readonly(),
|
|
29
|
+
tags: zod_1.z.array(zod_1.z.enum(["new", "improved", "fixed", "security", "deprecated"])).readonly(),
|
|
30
|
+
platforms: zod_1.z.array(exports.platformSchema).readonly(),
|
|
31
|
+
source: zod_1.z.enum(["manual", "app_store"]),
|
|
32
|
+
publishedAt: zod_1.z.string().datetime(),
|
|
33
|
+
...exports.voteSchema.unwrap().shape,
|
|
34
|
+
commentCount: zod_1.z.number().int().nonnegative(),
|
|
35
|
+
})
|
|
36
|
+
.readonly();
|
|
37
|
+
exports.releasesSchema = zod_1.z
|
|
38
|
+
.object({ items: zod_1.z.array(exports.releaseSchema).readonly(), nextCursor: zod_1.z.string().nullable() })
|
|
39
|
+
.readonly();
|
|
40
|
+
exports.configSchema = zod_1.z
|
|
41
|
+
.object({
|
|
42
|
+
enabled: zod_1.z.boolean(),
|
|
43
|
+
defaultLocale: zod_1.z.enum(["ko", "en"]),
|
|
44
|
+
app: zod_1.z
|
|
45
|
+
.object({
|
|
46
|
+
name: zod_1.z.string(),
|
|
47
|
+
subtitle: zod_1.z.string().nullable(),
|
|
48
|
+
description: zod_1.z.string().nullable(),
|
|
49
|
+
iconUrl: zod_1.z.string().nullable(),
|
|
50
|
+
websiteUrl: zod_1.z.string().nullable(),
|
|
51
|
+
accentColor: zod_1.z.string(),
|
|
52
|
+
contactEmail: zod_1.z.string().nullable(),
|
|
53
|
+
appStoreUrl: zod_1.z.string().nullable(),
|
|
54
|
+
playStoreUrl: zod_1.z.string().nullable(),
|
|
55
|
+
})
|
|
56
|
+
.readonly(),
|
|
57
|
+
page: zod_1.z.object({ enabled: zod_1.z.boolean(), url: zod_1.z.string() }).readonly(),
|
|
58
|
+
community: zod_1.z
|
|
59
|
+
.object({
|
|
60
|
+
votesEnabled: zod_1.z.boolean(),
|
|
61
|
+
commentsEnabled: zod_1.z.boolean(),
|
|
62
|
+
requireGuidelinesAck: zod_1.z.boolean(),
|
|
63
|
+
allowAuthorNames: zod_1.z.boolean(),
|
|
64
|
+
})
|
|
65
|
+
.readonly(),
|
|
66
|
+
rating: zod_1.z
|
|
67
|
+
.object({
|
|
68
|
+
mode: zod_1.z.enum(["off", "always", "after_upvote"]),
|
|
69
|
+
iosAppStoreId: zod_1.z.string().nullable(),
|
|
70
|
+
androidPackage: zod_1.z.string().nullable(),
|
|
71
|
+
reviewUrl: zod_1.z.string().nullable(),
|
|
72
|
+
})
|
|
73
|
+
.readonly(),
|
|
74
|
+
texts: zod_1.z.record(zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.string()).readonly()).readonly(),
|
|
75
|
+
})
|
|
76
|
+
.readonly();
|
|
77
|
+
exports.commentSchema = zod_1.z
|
|
78
|
+
.object({
|
|
79
|
+
id: zod_1.z.string(),
|
|
80
|
+
authorName: zod_1.z.string(),
|
|
81
|
+
isDeveloper: zod_1.z.boolean(),
|
|
82
|
+
body: zod_1.z.string(),
|
|
83
|
+
createdAt: zod_1.z.string().datetime(),
|
|
84
|
+
...exports.voteSchema.unwrap().shape,
|
|
85
|
+
})
|
|
86
|
+
.readonly();
|
|
87
|
+
exports.threadSchema = exports.commentSchema
|
|
88
|
+
.unwrap()
|
|
89
|
+
.extend({ replies: zod_1.z.array(exports.commentSchema).max(50).readonly() })
|
|
90
|
+
.readonly();
|
|
91
|
+
exports.commentsSchema = zod_1.z
|
|
92
|
+
.object({
|
|
93
|
+
items: zod_1.z.array(exports.threadSchema).readonly(),
|
|
94
|
+
nextCursor: zod_1.z.string().nullable(),
|
|
95
|
+
total: zod_1.z.number().int().nonnegative(),
|
|
96
|
+
})
|
|
97
|
+
.readonly();
|
|
98
|
+
exports.errorCodeSchema = zod_1.z.enum([
|
|
99
|
+
"BAD_REQUEST",
|
|
100
|
+
"VALIDATION_ERROR",
|
|
101
|
+
"PAYLOAD_TOO_LARGE",
|
|
102
|
+
"RATE_LIMITED",
|
|
103
|
+
"ORIGIN_NOT_ALLOWED",
|
|
104
|
+
"APP_NOT_ALLOWED",
|
|
105
|
+
"CHANGES_NOT_FOUND",
|
|
106
|
+
"RELEASE_NOT_FOUND",
|
|
107
|
+
"COMMENT_NOT_FOUND",
|
|
108
|
+
"PROPERTY_NOT_FOUND",
|
|
109
|
+
"VOTES_DISABLED",
|
|
110
|
+
"COMMENTS_DISABLED",
|
|
111
|
+
"BANNED",
|
|
112
|
+
"GUIDELINES_REQUIRED",
|
|
113
|
+
"NETWORK_ERROR",
|
|
114
|
+
"HTTP_ERROR",
|
|
115
|
+
"INVALID_RESPONSE",
|
|
116
|
+
]);
|
|
117
|
+
exports.stateSchema = zod_1.z
|
|
118
|
+
.object({
|
|
119
|
+
v: zod_1.z.literal(1),
|
|
120
|
+
lastVersion: zod_1.z.string().nullable(),
|
|
121
|
+
baselineReleaseId: zod_1.z.string().nullable(),
|
|
122
|
+
presentedIds: zod_1.z.array(zod_1.z.string()).max(50).readonly(),
|
|
123
|
+
firstSeenAt: zod_1.z.string().datetime(),
|
|
124
|
+
listOpenedAt: zod_1.z.string().datetime().nullable(),
|
|
125
|
+
})
|
|
126
|
+
.readonly();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.versionKey = versionKey;
|
|
4
|
+
exports.compareVersions = compareVersions;
|
|
5
|
+
function versionKey(version) {
|
|
6
|
+
const lead = /^\d+(?:\.\d+)*/.exec(version)?.[0];
|
|
7
|
+
if (!lead)
|
|
8
|
+
return null;
|
|
9
|
+
const parts = lead.split(".").slice(0, 4);
|
|
10
|
+
if (parts.some((part) => Number(part) > 999999))
|
|
11
|
+
return null;
|
|
12
|
+
return Array.from({ length: 4 }, (_, index) => String(Number(parts[index] ?? 0)).padStart(6, "0")).join("");
|
|
13
|
+
}
|
|
14
|
+
function compareVersions(a, b) {
|
|
15
|
+
const aKey = versionKey(a);
|
|
16
|
+
const bKey = versionKey(b);
|
|
17
|
+
const left = aKey !== null && bKey !== null ? aKey : a;
|
|
18
|
+
const right = aKey !== null && bKey !== null ? bKey : b;
|
|
19
|
+
return left === right ? 0 : left < right ? -1 : 1;
|
|
20
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from "./core/types";
|
|
2
|
+
export * from "./core/client";
|
|
3
|
+
export * from "./core/storage";
|
|
4
|
+
export * from "./core/decide";
|
|
5
|
+
export * from "./core/cache";
|
|
6
|
+
export * from "./core/versions";
|
|
7
|
+
export * from "./core/rating";
|
|
8
|
+
export { ChangesProvider } from "./native/Provider";
|
|
9
|
+
export type { ChangesProviderProps } from "./native/Provider";
|
|
10
|
+
export { ChangesContextError, useChanges } from "./native/context";
|
|
11
|
+
export type { ChangesApi, ChangesComments, ChangesStatus, CommentsPage, ReleaseFeedbackInput, VoteValue, } from "./native/context";
|
|
12
|
+
export { WhatsNewSheet } from "./native/WhatsNewSheet";
|
|
13
|
+
export { ChangelogScreen } from "./native/ChangelogScreen";
|
|
14
|
+
export type { ChangelogScreenProps } from "./native/ChangelogScreen";
|
|
15
|
+
export { ChangelogButton } from "./native/ChangelogButton";
|
|
16
|
+
export type { ChangelogButtonProps } from "./native/ChangelogButton";
|
|
17
|
+
export { CommentsThread } from "./native/CommentsThread";
|
|
18
|
+
export { Blocks } from "./native/Blocks";
|
|
19
|
+
export { planRatingOpen, ratingLabelKey, runRatingPlan, shouldShowRating } from "./native/rating-plan";
|
|
20
|
+
export type { RatingStep, StoreReviewAdapter } from "./native/rating-plan";
|
|
21
|
+
export type { ChangesLocale, ChangesStorageAdapter, LocaleMode } from "./native/resolve";
|
|
22
|
+
export type { VoteCounts } from "./native/session";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.shouldShowRating = exports.runRatingPlan = exports.ratingLabelKey = exports.planRatingOpen = exports.Blocks = exports.CommentsThread = exports.ChangelogButton = exports.ChangelogScreen = exports.WhatsNewSheet = exports.useChanges = exports.ChangesContextError = exports.ChangesProvider = void 0;
|
|
18
|
+
__exportStar(require("./core/types"), exports);
|
|
19
|
+
__exportStar(require("./core/client"), exports);
|
|
20
|
+
__exportStar(require("./core/storage"), exports);
|
|
21
|
+
__exportStar(require("./core/decide"), exports);
|
|
22
|
+
__exportStar(require("./core/cache"), exports);
|
|
23
|
+
__exportStar(require("./core/versions"), exports);
|
|
24
|
+
__exportStar(require("./core/rating"), exports);
|
|
25
|
+
var Provider_1 = require("./native/Provider");
|
|
26
|
+
Object.defineProperty(exports, "ChangesProvider", { enumerable: true, get: function () { return Provider_1.ChangesProvider; } });
|
|
27
|
+
var context_1 = require("./native/context");
|
|
28
|
+
Object.defineProperty(exports, "ChangesContextError", { enumerable: true, get: function () { return context_1.ChangesContextError; } });
|
|
29
|
+
Object.defineProperty(exports, "useChanges", { enumerable: true, get: function () { return context_1.useChanges; } });
|
|
30
|
+
var WhatsNewSheet_1 = require("./native/WhatsNewSheet");
|
|
31
|
+
Object.defineProperty(exports, "WhatsNewSheet", { enumerable: true, get: function () { return WhatsNewSheet_1.WhatsNewSheet; } });
|
|
32
|
+
var ChangelogScreen_1 = require("./native/ChangelogScreen");
|
|
33
|
+
Object.defineProperty(exports, "ChangelogScreen", { enumerable: true, get: function () { return ChangelogScreen_1.ChangelogScreen; } });
|
|
34
|
+
var ChangelogButton_1 = require("./native/ChangelogButton");
|
|
35
|
+
Object.defineProperty(exports, "ChangelogButton", { enumerable: true, get: function () { return ChangelogButton_1.ChangelogButton; } });
|
|
36
|
+
var CommentsThread_1 = require("./native/CommentsThread");
|
|
37
|
+
Object.defineProperty(exports, "CommentsThread", { enumerable: true, get: function () { return CommentsThread_1.CommentsThread; } });
|
|
38
|
+
var Blocks_1 = require("./native/Blocks");
|
|
39
|
+
Object.defineProperty(exports, "Blocks", { enumerable: true, get: function () { return Blocks_1.Blocks; } });
|
|
40
|
+
var rating_plan_1 = require("./native/rating-plan");
|
|
41
|
+
Object.defineProperty(exports, "planRatingOpen", { enumerable: true, get: function () { return rating_plan_1.planRatingOpen; } });
|
|
42
|
+
Object.defineProperty(exports, "ratingLabelKey", { enumerable: true, get: function () { return rating_plan_1.ratingLabelKey; } });
|
|
43
|
+
Object.defineProperty(exports, "runRatingPlan", { enumerable: true, get: function () { return rating_plan_1.runRatingPlan; } });
|
|
44
|
+
Object.defineProperty(exports, "shouldShowRating", { enumerable: true, get: function () { return rating_plan_1.shouldShowRating; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Block } from "../core/types";
|
|
2
|
+
import type { ChangesStyles } from "./styles";
|
|
3
|
+
/** The server-parsed markdown-lite AST rendered with `Text` only; no markup is ever interpreted. */
|
|
4
|
+
export declare function Blocks({ blocks, styles }: Readonly<{
|
|
5
|
+
blocks: readonly Block[];
|
|
6
|
+
styles: ChangesStyles;
|
|
7
|
+
}>): import("react").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Blocks = Blocks;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const styles_scale_1 = require("./styles-scale");
|
|
7
|
+
function Inlines({ inlines, styles }) {
|
|
8
|
+
return inlines.map((inline, index) => {
|
|
9
|
+
const key = `${index}-${inline.t}`;
|
|
10
|
+
switch (inline.t) {
|
|
11
|
+
case "text":
|
|
12
|
+
return inline.v;
|
|
13
|
+
case "strong":
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.strong, children: inline.v }, key));
|
|
15
|
+
case "code":
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.code, children: inline.v }, key));
|
|
17
|
+
case "link":
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { accessibilityRole: "link", style: styles.link, onPress: () => {
|
|
19
|
+
void react_native_1.Linking.openURL(inline.href).catch(() => undefined);
|
|
20
|
+
}, children: inline.v }, key));
|
|
21
|
+
default: {
|
|
22
|
+
const exhaustive = inline;
|
|
23
|
+
return exhaustive;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/** The server-parsed markdown-lite AST rendered with `Text` only; no markup is ever interpreted. */
|
|
29
|
+
function Blocks({ blocks, styles }) {
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.blocks, children: blocks.map((block, index) => {
|
|
31
|
+
const key = `${index}-${block.t}`;
|
|
32
|
+
switch (block.t) {
|
|
33
|
+
case "p":
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.paragraph, ...styles_scale_1.KOREAN_WRAP, children: (0, jsx_runtime_1.jsx)(Inlines, { inlines: block.c, styles: styles }) }, key));
|
|
35
|
+
case "h":
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.heading, accessibilityRole: "header", ...styles_scale_1.KOREAN_WRAP, children: (0, jsx_runtime_1.jsx)(Inlines, { inlines: block.c, styles: styles }) }, key));
|
|
37
|
+
case "ul":
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.list, accessibilityRole: "list", children: block.items.map((item, itemIndex) => ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.listItem, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.bullet, importantForAccessibility: "no", accessibilityElementsHidden: true, children: "\u2022" }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.listText, ...styles_scale_1.KOREAN_WRAP, children: (0, jsx_runtime_1.jsx)(Inlines, { inlines: item, styles: styles }) })] }, itemIndex))) }, key));
|
|
39
|
+
default: {
|
|
40
|
+
const exhaustive = block;
|
|
41
|
+
return exhaustive;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}) }));
|
|
45
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type ChangelogButtonProps = Readonly<{
|
|
2
|
+
label?: string;
|
|
3
|
+
testID?: string;
|
|
4
|
+
}>;
|
|
5
|
+
/** Opens the built-in changelog; the badge counts releases published since it was last opened. */
|
|
6
|
+
export declare function ChangelogButton({ label, testID }: ChangelogButtonProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChangelogButton = ChangelogButton;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const context_1 = require("./context");
|
|
7
|
+
/** Opens the built-in changelog; the badge counts releases published since it was last opened. */
|
|
8
|
+
function ChangelogButton({ label, testID = "theseeker-changes-button" }) {
|
|
9
|
+
const ui = (0, context_1.useChangesUi)();
|
|
10
|
+
if (ui === null)
|
|
11
|
+
return null;
|
|
12
|
+
const { api, styles, copy } = ui;
|
|
13
|
+
const text = label ?? api.t("whatsNew");
|
|
14
|
+
const count = api.unseenCount;
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.Pressable, { testID: testID, accessibilityRole: "button", accessibilityLabel: count > 0 ? `${text}, ${copy.unread(count)}` : text, onPress: api.openChangelog, style: ({ pressed }) => [styles.launcher, pressed && styles.launcherPressed], children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.buttonLabel, numberOfLines: 1, children: text }), count > 0 ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.countBadge, testID: `${testID}-badge`, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.countLabel, children: count > 99 ? "99+" : String(count) }) })) : null] }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type ChangelogScreenProps = Readonly<{
|
|
2
|
+
/** Renders a top bar with a close button (the built-in modal passes it; host navigators usually do not). */
|
|
3
|
+
onClose?: () => void;
|
|
4
|
+
}>;
|
|
5
|
+
/** The full changelog: release cards with votes and comments; a release opens its thread. */
|
|
6
|
+
export declare function ChangelogScreen({ onClose }: ChangelogScreenProps): import("react").JSX.Element;
|