@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.
- package/dist/core/client.d.ts +3 -1
- package/dist/core/client.js +1 -0
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.js +1 -1
- package/dist/web/ChangelogDialog.js +2 -1
- package/dist/web/links.js +5 -2
- package/package.json +9 -7
package/dist/core/client.d.ts
CHANGED
|
@@ -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;
|
package/dist/core/client.js
CHANGED
package/dist/core/types.d.ts
CHANGED
|
@@ -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;
|
package/dist/core/types.js
CHANGED
|
@@ -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
|
|
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
|
|
42
|
+
if (config === null)
|
|
43
43
|
return null;
|
|
44
|
-
|
|
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.
|
|
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
|
-
"
|
|
32
|
-
|
|
33
|
-
"typecheck": "tsc --noEmit",
|
|
34
|
-
"test": "vitest run"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
+
"packageManager": "pnpm@12.1.0"
|
|
38
|
+
}
|