@the-seeker/changes-react 0.1.0 → 0.1.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.
@@ -17,6 +17,8 @@ export type ChangesClientOptions = Readonly<{
17
17
  baseUrl?: string;
18
18
  platform: Platform;
19
19
  appVersion?: string;
20
+ /** BCP-47 tag (`ja`, `zh-Hant`) choosing the release title/body translation; omitted means the base text. */
21
+ locale?: string;
20
22
  appId?: string;
21
23
  appHeader?: string;
22
24
  user?: User;
@@ -80,7 +82,7 @@ export declare function createChangesClient(options: ChangesClientOptions): {
80
82
  }>;
81
83
  page: Readonly<{
82
84
  enabled: boolean;
83
- url: string;
85
+ url: string | null;
84
86
  }>;
85
87
  community: Readonly<{
86
88
  votesEnabled: boolean;
@@ -72,6 +72,7 @@ function createChangesClient(options) {
72
72
  const result = await request(url("releases", {
73
73
  platform,
74
74
  appVersion: options.appVersion,
75
+ locale: options.locale,
75
76
  userId: user?.userId,
76
77
  cursor: input.cursor,
77
78
  limit: input.limit,
@@ -200,7 +200,7 @@ export declare const configSchema: z.ZodReadonly<z.ZodObject<{
200
200
  }, z.core.$strip>>;
201
201
  page: z.ZodReadonly<z.ZodObject<{
202
202
  enabled: z.ZodBoolean;
203
- url: z.ZodString;
203
+ url: z.ZodNullable<z.ZodString>;
204
204
  }, z.core.$strip>>;
205
205
  community: z.ZodReadonly<z.ZodObject<{
206
206
  votesEnabled: z.ZodBoolean;
@@ -54,7 +54,7 @@ exports.configSchema = zod_1.z
54
54
  playStoreUrl: zod_1.z.string().nullable(),
55
55
  })
56
56
  .readonly(),
57
- page: zod_1.z.object({ enabled: zod_1.z.boolean(), url: zod_1.z.string() }).readonly(),
57
+ page: zod_1.z.object({ enabled: zod_1.z.boolean(), url: zod_1.z.string().nullable() }).readonly(),
58
58
  community: zod_1.z
59
59
  .object({
60
60
  votesEnabled: zod_1.z.boolean(),
@@ -14,6 +14,7 @@ function ChangelogDialog() {
14
14
  const titleId = (0, react_1.useId)();
15
15
  if (!changelogOpen)
16
16
  return null;
17
- const pageUrl = config?.page.enabled && config.page.url.startsWith("https://") ? config.page.url : null;
17
+ const url = config?.page.enabled ? config.page.url : null;
18
+ const pageUrl = url !== null && url.startsWith("https://") ? url : null;
18
19
  return ((0, jsx_runtime_1.jsx)(DialogShell_1.DialogShell, { labelledBy: titleId, size: "wide", onClose: closeChangelog, header: (0, jsx_runtime_1.jsxs)("div", { style: styles_1.layout.stack4, children: [(0, jsx_runtime_1.jsx)("h2", { id: titleId, style: styles_1.text.cardTitle, children: texts.title }), (0, jsx_runtime_1.jsx)("p", { style: styles_1.text.meta, children: config?.app.name ?? texts.subtitle })] }), footer: pageUrl ? ((0, jsx_runtime_1.jsxs)("a", { href: pageUrl, target: "_blank", rel: "noopener noreferrer", "data-tsc-btn": "secondary", style: { width: "100%" }, children: [texts.viewAll, (0, jsx_runtime_1.jsx)(icons_1.ArrowUpRight, { size: 16 })] })) : undefined, children: (0, jsx_runtime_1.jsx)("div", { style: { paddingTop: 12 }, children: (0, jsx_runtime_1.jsx)(ChangelogList_1.ChangelogList, {}) }) }));
19
20
  }
package/dist/web/links.js CHANGED
@@ -39,7 +39,10 @@ function offersRating(config, release) {
39
39
  }
40
40
  }
41
41
  function permalink(config, release) {
42
- if (config === null || !config.page.enabled || !config.page.url.startsWith("https://"))
42
+ if (config === null)
43
43
  return null;
44
- return `${config.page.url.replace(/\/+$/, "")}/${encodeURIComponent(release.ref)}`;
44
+ const url = config.page.enabled ? config.page.url : null;
45
+ if (url === null || !url.startsWith("https://"))
46
+ return null;
47
+ return `${url.replace(/\/+$/, "")}/${encodeURIComponent(release.ref)}`;
45
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-seeker/changes-react",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -12,6 +12,12 @@
12
12
  },
13
13
  "sideEffects": false,
14
14
  "license": "MIT",
15
+ "scripts": {
16
+ "build": "tsc -p tsconfig.build.json",
17
+ "typecheck": "tsc --noEmit",
18
+ "test": "vitest run",
19
+ "prepublishOnly": "pnpm run typecheck && pnpm test && pnpm run build"
20
+ },
15
21
  "peerDependencies": {
16
22
  "react": ">=18",
17
23
  "react-dom": ">=18"
@@ -28,9 +34,5 @@
28
34
  "react-dom": "19.2.3",
29
35
  "jsdom": "^29"
30
36
  },
31
- "scripts": {
32
- "build": "tsc -p tsconfig.build.json",
33
- "typecheck": "tsc --noEmit",
34
- "test": "vitest run"
35
- }
36
- }
37
+ "packageManager": "pnpm@12.1.0"
38
+ }