@deksden-com/cpa-kit-react 0.1.3 → 0.1.5
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/CHANGELOG.md +18 -0
- package/dist/index.js +4 -2
- package/package.json +4 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# @deksden-com/cpa-kit-react
|
|
2
|
+
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Show a loading state while credential capabilities and lists are being fetched rather than falsely reporting unavailable or empty data.
|
|
8
|
+
- @deksden-com/cpa-kit@0.1.5
|
|
9
|
+
|
|
10
|
+
## 0.1.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- ede8760: Include generated package changelogs in npm distributions. Release versions and the exact core peer dependency are maintained together through Changesets.
|
|
15
|
+
- Skip irrelevant archive entries without decompressing them, allow larger uploads, and show clear import progress and limit errors.
|
|
16
|
+
- Updated dependencies [ede8760]
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @deksden-com/cpa-kit@0.1.4
|
package/dist/index.js
CHANGED
|
@@ -283,7 +283,9 @@ export function CpaConsole(props) {
|
|
|
283
283
|
text,
|
|
284
284
|
revision: status?.revision ?? null,
|
|
285
285
|
});
|
|
286
|
-
const renderOperation = () => operation ? (_jsxs("section", { className: "cpa-card cpa-operation", "aria-label": l.progress, "aria-live": "polite", children: [_jsxs("div", { className: "cpa-row", children: [_jsx("h3", { children: l[operation.state] }), _jsx("span", { className: "cpa-badge", children: operation.kind })] }), _jsxs("p", { className: "cpa-muted", children: [l.phase, ": ", readable(operation.phase), " \u00B7", " ", _jsx("span", { className: "cpa-mono", children: operation.id })] }), operation.progress.total !== null ? (_jsxs(_Fragment, { children: [_jsx("progress", { value: operation.progress.completed, max: operation.progress.total || 1 }), _jsxs("span", { children: [operation.progress.completed, " / ", operation.progress.total] })] })) : null, operation.error ? (_jsxs("p", { role: "alert", children: [operation.error.code
|
|
286
|
+
const renderOperation = () => operation ? (_jsxs("section", { className: "cpa-card cpa-operation", "aria-label": l.progress, "aria-live": "polite", children: [_jsxs("div", { className: "cpa-row", children: [_jsx("h3", { children: l[operation.state] }), _jsx("span", { className: "cpa-badge", children: operation.kind })] }), _jsxs("p", { className: "cpa-muted", children: [l.phase, ": ", readable(operation.phase), " \u00B7", " ", _jsx("span", { className: "cpa-mono", children: operation.id })] }), operation.progress.total !== null ? (_jsxs(_Fragment, { children: [_jsx("progress", { value: operation.progress.completed, max: operation.progress.total || 1 }), _jsxs("span", { children: [operation.progress.completed, " / ", operation.progress.total] })] })) : null, operation.error ? (_jsxs("p", { role: "alert", children: [operation.error.code === "UPLOAD_LIMIT" && operation.kind === "import.stage"
|
|
287
|
+
? (props.locale === "en" ? "The archive exceeded a safety limit. Remove logs, databases and temporary files, then retry." : "Архив превысил ограничение безопасности. Удалите журналы, базы и временные файлы, затем повторите загрузку.")
|
|
288
|
+
: `${operation.error.code}: ${operation.error.message}`, operation.error.retryAt ? ` · ${operation.error.retryAt}` : ""] })) : null, operation.state === "partially_applied" ? _jsx("p", { children: l.partial }) : null, operation.state === "recovery_required" ? (_jsxs("p", { children: [l.recovery, " \u00B7 ", operation.recoveryDisposition] })) : null, active(operation) && !operation.cancelRequested ? (_jsx(Button, { disabled: !can("operation.cancel"), reason: !can("operation.cancel") ? reason("operation.cancel") : undefined, onClick: () => void command("operation.cancel", { operationId: operation.id }), children: l.cancel })) : null, operation.cancelRequested && active(operation) ? (_jsxs("p", { children: [l.cancel, "\u2026"] })) : null] })) : operationId ? (_jsxs("p", { role: "status", children: [l.loading, " \u00B7 ", _jsx("span", { className: "cpa-mono", children: operationId })] })) : null;
|
|
287
289
|
return (_jsxs("div", { className: `cpa-kit ${props.className ?? ""}`, "data-theme": props.theme, children: [_jsxs("nav", { className: "cpa-crumbs", "aria-label": props.locale === "en" ? "Breadcrumb" : "Хлебные крошки", children: [props.onBack ? (_jsxs(Button, { onClick: props.onBack, children: ["\u2190 ", l.back] })) : null, _jsx(Button, { onClick: () => navigate("overview"), children: "CPA" }), panel !== "overview" ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u203A" }), _jsx("span", { "aria-current": "page", children: l[panel] })] })) : null] }), _jsxs("header", { className: "cpa-head", children: [_jsx("h2", { children: l[panel] }), _jsx(Button, { disabled: loading || pending, onClick: () => void load(), children: loading ? l.loading : l.refresh })] }), _jsx("nav", { className: "cpa-nav", "aria-label": props.locale === "en" ? "CPA sections" : "Разделы CPA", children: panels.map((p) => (_jsx("button", { className: "cpa-button", "aria-current": panel === p ? "page" : undefined, onClick: () => navigate(p), children: l[p] }, p))) }), error ? (_jsxs("div", { role: "alert", className: "cpa-notice", children: [error === "NOT_AUTHORIZED" ? l.unauthorized : l.inputError, " ", _jsx("span", { className: "cpa-mono", children: error }), _jsx(Button, { onClick: () => {
|
|
288
290
|
setError(null);
|
|
289
291
|
void load();
|
|
@@ -325,7 +327,7 @@ export function CpaConsole(props) {
|
|
|
325
327
|
? "offline"
|
|
326
328
|
: "unknown",
|
|
327
329
|
],
|
|
328
|
-
].map(([title, value]) => (_jsxs("section", { className: "cpa-card", children: [_jsx("h3", { children: title }), _jsx("p", { children: readable(value) })] }, title))) }), _jsxs("section", { className: "cpa-card", children: [_jsx("h3", { children: l.version }), _jsx("p", { className: "cpa-mono", children: status?.runtime.version ?? "—" }), _jsxs("p", { className: "cpa-muted", children: [readable(status?.runtime.mode ?? "—"), " \u00B7", " ", status?.management.protocol ?? "—"] }), _jsxs(Button, { onClick: () => navigate("versions"), children: [l.versions, " \u2192"] })] }), status?.busyOperationId ? (_jsxs(Button, { onClick: () => track(status.busyOperationId), children: [l.progress, " \u2192"] })) : null] })) : null, panel === "credentials" ? (_jsxs(_Fragment, { children: [_jsxs("section", { className: "cpa-card", children: [_jsx("h3", { children: l.import }), _jsx("p", { className: "cpa-muted", children: l.uploadHint }), _jsxs("div", { className: "cpa-form", children: [_jsxs("label", { className: "cpa-field", children: [l.choose, _jsx("input", { "aria-label": l.choose, type: "file", multiple: true, accept: ".zip,.json,application/zip,application/json", disabled: !can("import.stage"), onChange: (e) => setFiles(Array.from(e.currentTarget.files ?? [])) })] }), _jsxs("details", { children: [_jsx("summary", { children: l.directory }), _jsx("input", { "aria-label": l.directory, type: "file", multiple: true, webkitdirectory: "", disabled: !can("import.stage"), onChange: (e) => setFiles(Array.from(e.currentTarget.files ?? [])) })] }), _jsx(Button, { disabled: !can("import.stage") || !files.length, reason: !can("import.stage") ? reason("import.stage") : undefined, onClick: () => void upload(), children: pending ? l.loading : l.preview })] })] }), candidate ? (_jsxs("section", { className: "cpa-card", children: [_jsx("h3", { children: l.preview }), _jsxs("label", { className: "cpa-field", children: [l.import, _jsxs("select", { value: mode, disabled: !can("import.apply"), "aria-describedby": allowedModes.includes("replace")
|
|
330
|
+
].map(([title, value]) => (_jsxs("section", { className: "cpa-card", children: [_jsx("h3", { children: title }), _jsx("p", { children: readable(value) })] }, title))) }), _jsxs("section", { className: "cpa-card", children: [_jsx("h3", { children: l.version }), _jsx("p", { className: "cpa-mono", children: status?.runtime.version ?? "—" }), _jsxs("p", { className: "cpa-muted", children: [readable(status?.runtime.mode ?? "—"), " \u00B7", " ", status?.management.protocol ?? "—"] }), _jsxs(Button, { onClick: () => navigate("versions"), children: [l.versions, " \u2192"] })] }), status?.busyOperationId ? (_jsxs(Button, { onClick: () => track(status.busyOperationId), children: [l.progress, " \u2192"] })) : null] })) : null, panel === "credentials" ? (_jsxs(_Fragment, { children: [_jsxs("section", { className: "cpa-card", children: [_jsx("h3", { children: l.import }), _jsx("p", { className: "cpa-muted", children: l.uploadHint }), _jsxs("div", { className: "cpa-form", children: [_jsxs("label", { className: "cpa-field", children: [l.choose, _jsx("input", { "aria-label": l.choose, type: "file", multiple: true, accept: ".zip,.json,application/zip,application/json", disabled: !can("import.stage"), onChange: (e) => setFiles(Array.from(e.currentTarget.files ?? [])) })] }), _jsxs("details", { children: [_jsx("summary", { children: l.directory }), _jsx("input", { "aria-label": l.directory, type: "file", multiple: true, webkitdirectory: "", disabled: !can("import.stage"), onChange: (e) => setFiles(Array.from(e.currentTarget.files ?? [])) })] }), pending ? _jsx("p", { role: "status", "aria-live": "polite", children: props.locale === "en" ? "Uploading files and preparing verification…" : "Загружаем файлы и подготавливаем проверку…" }) : null, _jsx(Button, { disabled: !can("import.stage") || !files.length, reason: !can("import.stage") ? reason("import.stage") : undefined, onClick: () => void upload(), children: pending ? l.loading : l.preview })] })] }), candidate ? (_jsxs("section", { className: "cpa-card", children: [_jsx("h3", { children: l.preview }), _jsxs("label", { className: "cpa-field", children: [l.import, _jsxs("select", { value: mode, disabled: !can("import.apply"), "aria-describedby": allowedModes.includes("replace")
|
|
329
331
|
? undefined
|
|
330
332
|
: `${fieldId}-mode-policy`, onChange: (e) => {
|
|
331
333
|
const next = e.target.value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deksden-com/cpa-kit-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
15
|
"README.md",
|
|
16
|
+
"CHANGELOG.md",
|
|
16
17
|
"NOTICE"
|
|
17
18
|
],
|
|
18
19
|
"exports": {
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"peerDependencies": {
|
|
26
27
|
"react": ">=19.2.0 <20",
|
|
27
28
|
"react-dom": ">=19.2.0 <20",
|
|
28
|
-
"@deksden-com/cpa-kit": "0.1.
|
|
29
|
+
"@deksden-com/cpa-kit": "0.1.5"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@types/react": "^19.2.0",
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"vitest": "^4.0.15",
|
|
37
38
|
"@testing-library/react": "^16.3.0",
|
|
38
39
|
"jsdom": "^26.1.0",
|
|
39
|
-
"@deksden-com/cpa-kit": "0.1.
|
|
40
|
+
"@deksden-com/cpa-kit": "0.1.5"
|
|
40
41
|
},
|
|
41
42
|
"publishConfig": {
|
|
42
43
|
"registry": "https://registry.npmjs.org/",
|