@abpjs/ui 0.2.0-next.36 → 0.2.0-next.37
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 +13 -0
- package/dist/index.js +1 -1
- package/dist/storage.d.ts +102 -0
- package/dist/storage.js +291 -0
- package/dist/storage.js.map +1 -0
- package/package.json +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0-next.37
|
|
4
|
+
|
|
5
|
+
A prerelease under npm's `next` tag.
|
|
6
|
+
|
|
7
|
+
- The `storage` area (`@abpjs/ui/storage`), AbpCluster.Storage's screen on AbpCluster.Storage.HttpApi 0.6.0 or later:
|
|
8
|
+
where the site keeps its files (the provider and its place, never a key) and what's kept there, a test of each store
|
|
9
|
+
with its time and the storage's own reason when it fails, and, while a previous storage is being left, the copy from
|
|
10
|
+
it, read again every second while it runs, with its counts and first problems. Starting the copy is the one sensitive
|
|
11
|
+
action: a host's step-up answers its 403 through the host's request. `storagePages({ section, href, ... })` gives the
|
|
12
|
+
settings page (one component per address), `StorageScreen` the page itself; the right is `storage.site.admin`, the
|
|
13
|
+
slot `storage.page.actions`, and a host names its stores with the words `storeNames.<store>` or `storeName`. Words in
|
|
14
|
+
English and Arabic, counts with plurals; the store list joins in the reader's language.
|
|
15
|
+
|
|
3
16
|
## 0.2.0-next.36
|
|
4
17
|
|
|
5
18
|
A prerelease under npm's `next` tag.
|
package/dist/index.js
CHANGED
|
@@ -1603,7 +1603,7 @@ function useTokenVar() {
|
|
|
1603
1603
|
}
|
|
1604
1604
|
|
|
1605
1605
|
// src/version.ts
|
|
1606
|
-
var ABP_UI_VERSION = true ? "0.2.0-next.
|
|
1606
|
+
var ABP_UI_VERSION = true ? "0.2.0-next.37" : "0.0.0-dev";
|
|
1607
1607
|
|
|
1608
1608
|
// src/provider/time-zone.tsx
|
|
1609
1609
|
import { createContext, useContext } from "react";
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { SettingsPage, AbpHost } from '@abpjs/ui';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
|
|
4
|
+
interface StoragePageOptions {
|
|
5
|
+
section: string;
|
|
6
|
+
href: string;
|
|
7
|
+
weight?: number;
|
|
8
|
+
title?: string;
|
|
9
|
+
about?: string;
|
|
10
|
+
visible?: SettingsPage['visible'];
|
|
11
|
+
host?: Pick<AbpHost, 'can'>;
|
|
12
|
+
/** After a change the server has taken (a copy started, a copy that ended): the host reads what it shows again. */
|
|
13
|
+
onChanged?: () => void | Promise<void>;
|
|
14
|
+
/** A store's name for people, when the host doesn't give `storeNames.<store>` as words; the store's key by default. */
|
|
15
|
+
storeName?: (store: string) => string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The area's settings page for a host to file under its sections: `storage.admin` at `href`, drawn by the host's
|
|
19
|
+
* catch-all route. Who sees it is the host's `storage.site.admin` when `host` is given. The title is the area's English
|
|
20
|
+
* word unless given; the server checks every call.
|
|
21
|
+
*/
|
|
22
|
+
declare function storagePages(options: StoragePageOptions): SettingsPage[];
|
|
23
|
+
|
|
24
|
+
interface StorageScreenProps {
|
|
25
|
+
/** Told after a change the server has taken: a copy started, and a copy that finished or stopped. */
|
|
26
|
+
onChanged?: () => void | Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* A store's name for people. By default the area's text `storeNames.<store>` (a host gives those through
|
|
29
|
+
* `AbpHost.texts.storage`), else the store's own key.
|
|
30
|
+
*/
|
|
31
|
+
storeName?: (store: string) => string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The site's storage (AbpCluster.Storage): where its files are kept (the provider and its place, never a key), what's
|
|
35
|
+
* kept there, a test of each store, and, while a previous storage is being left, the copy from it with its progress.
|
|
36
|
+
* Storage is set in the server's configuration, so nothing here changes where files go. Starting the copy is the one
|
|
37
|
+
* sensitive action: a host's step-up answers its 403 through the host's request. The host's own links go in the
|
|
38
|
+
* `storage.page.actions` slot.
|
|
39
|
+
*/
|
|
40
|
+
declare function StorageScreen({ onChanged, storeName }: StorageScreenProps): react.JSX.Element;
|
|
41
|
+
|
|
42
|
+
/** The area's words, in English and Arabic; a host overrides any key through `AbpHost.texts.storage`. */
|
|
43
|
+
declare const useStorageTexts: () => (key: string, values?: Record<string, string | number>) => string;
|
|
44
|
+
|
|
45
|
+
interface components {
|
|
46
|
+
schemas: {
|
|
47
|
+
StorageCopyDto: {
|
|
48
|
+
/** Format: int32 */
|
|
49
|
+
copied: number | string;
|
|
50
|
+
/** Format: int32 */
|
|
51
|
+
failed: number | string;
|
|
52
|
+
/** Format: date-time */
|
|
53
|
+
finishedAt: null | string;
|
|
54
|
+
/** Format: int32 */
|
|
55
|
+
missing: number | string;
|
|
56
|
+
problems: components["schemas"]["StorageCopyProblemDto"][];
|
|
57
|
+
/** Format: int32 */
|
|
58
|
+
skipped: number | string;
|
|
59
|
+
/** Format: date-time */
|
|
60
|
+
startedAt: null | string;
|
|
61
|
+
state: string;
|
|
62
|
+
/** Format: int32 */
|
|
63
|
+
total: number | string;
|
|
64
|
+
};
|
|
65
|
+
StorageCopyProblemDto: {
|
|
66
|
+
name: string;
|
|
67
|
+
problem: string;
|
|
68
|
+
store: string;
|
|
69
|
+
};
|
|
70
|
+
StorageDto: {
|
|
71
|
+
current: components["schemas"]["StorageLocationDto"];
|
|
72
|
+
previous: null | components["schemas"]["StorageLocationDto"];
|
|
73
|
+
stores: string[];
|
|
74
|
+
};
|
|
75
|
+
StorageLocationDto: {
|
|
76
|
+
location: string;
|
|
77
|
+
provider: string;
|
|
78
|
+
};
|
|
79
|
+
StorageTestDto: {
|
|
80
|
+
error: null | string;
|
|
81
|
+
/** Format: int32 */
|
|
82
|
+
milliseconds: number | string;
|
|
83
|
+
ok: boolean;
|
|
84
|
+
store: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
responses: never;
|
|
88
|
+
parameters: never;
|
|
89
|
+
requestBodies: never;
|
|
90
|
+
headers: never;
|
|
91
|
+
pathItems: never;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
type Schemas = components['schemas'];
|
|
95
|
+
/** AbpCluster.Storage.HttpApi's types, as its OpenAPI document gives them (`api.d.ts`). */
|
|
96
|
+
type StorageInfo = Schemas['StorageDto'];
|
|
97
|
+
type StorageLocation = Schemas['StorageLocationDto'];
|
|
98
|
+
type StorageTest = Schemas['StorageTestDto'];
|
|
99
|
+
type StorageCopy = Schemas['StorageCopyDto'];
|
|
100
|
+
type StorageCopyProblem = Schemas['StorageCopyProblemDto'];
|
|
101
|
+
|
|
102
|
+
export { type StorageCopy, type StorageCopyProblem, type StorageInfo, type StorageLocation, type StoragePageOptions, StorageScreen, type StorageScreenProps, type StorageTest, storagePages, useStorageTexts };
|
package/dist/storage.js
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/areas/storage/StorageScreen.tsx
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
5
|
+
import { HStack, Stack, Text } from "@chakra-ui/react";
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
DataTable,
|
|
9
|
+
EMPTY_VALUE,
|
|
10
|
+
HostSlot,
|
|
11
|
+
InlineAlert,
|
|
12
|
+
PageHeader,
|
|
13
|
+
Panel,
|
|
14
|
+
PropertyList,
|
|
15
|
+
StatusPill,
|
|
16
|
+
useApiAction,
|
|
17
|
+
useAbpLocale,
|
|
18
|
+
useApiQuery,
|
|
19
|
+
useAreaRequest,
|
|
20
|
+
useFormatters
|
|
21
|
+
} from "@abpjs/ui";
|
|
22
|
+
|
|
23
|
+
// src/areas/storage/texts.ts
|
|
24
|
+
import { createAreaTexts } from "@abpjs/ui";
|
|
25
|
+
|
|
26
|
+
// src/areas/storage/texts/ar.json
|
|
27
|
+
var ar_default = {
|
|
28
|
+
title: "\u0627\u0644\u062A\u062E\u0632\u064A\u0646",
|
|
29
|
+
description: "\u062D\u064A\u062B \u064A\u062D\u0641\u0638 {product} \u0645\u0644\u0641\u0627\u062A\u0647. \u064A\u064F\u0636\u0628\u0637 \u0641\u064A \u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u062E\u0627\u062F\u0645\u060C \u0644\u0627 \u0645\u0646 \u0647\u0646\u0627.",
|
|
30
|
+
whereTitle: "\u0623\u064A\u0646 \u062A\u064F\u062D\u0641\u0638 \u0627\u0644\u0645\u0644\u0641\u0627\u062A",
|
|
31
|
+
whereHint: "\u0646\u0638\u0627\u0645 \u0645\u0644\u0641\u0627\u062A \u0627\u0644\u062E\u0627\u062F\u0645\u060C \u0623\u0648 \u062D\u0627\u0648\u064A\u0629 S3 (\u0645\u0646 AWS \u0623\u0648 \u062E\u0627\u062F\u0645 \u064A\u062A\u062D\u062F\u062B S3 \u0645\u062B\u0644 MinIO)\u060C \u0623\u0648 Azure Blob. \u0644\u0627 \u064A\u064F\u0648\u0635\u0644 \u0625\u0644\u0649 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0625\u0644\u0627 \u0639\u0628\u0631 {product}\u060C \u0627\u0644\u0630\u064A \u064A\u062A\u062D\u0642\u0642 \u0645\u0645\u0646 \u064A\u062D\u0642 \u0644\u0647 \u0642\u0631\u0627\u0621\u062A\u0647\u0627.",
|
|
32
|
+
provider: "\u0627\u0644\u0646\u0648\u0639",
|
|
33
|
+
location: "\u0627\u0644\u0645\u0643\u0627\u0646",
|
|
34
|
+
stores: "\u0645\u0627 \u064A\u064F\u062D\u0641\u0638 \u0647\u0646\u0627\u0643",
|
|
35
|
+
"providers.FileSystem": "\u0646\u0638\u0627\u0645 \u0645\u0644\u0641\u0627\u062A \u0627\u0644\u062E\u0627\u062F\u0645",
|
|
36
|
+
"providers.S3": "\u062D\u0627\u0648\u064A\u0629 S3",
|
|
37
|
+
"providers.Azure": "Azure Blob",
|
|
38
|
+
previousTitle: "\u062A\u064F\u0646\u0642\u0644 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0627\u0644\u0622\u0646",
|
|
39
|
+
previousBody: "\u0627\u0644\u0645\u0644\u0641 \u0627\u0644\u0630\u064A \u0644\u0645 \u064A\u064F\u0646\u0642\u0644 \u0628\u0639\u062F \u064A\u064F\u0642\u0631\u0623 \u0645\u0646 \u0645\u0643\u0627\u0646\u0647 \u0627\u0644\u0633\u0627\u0628\u0642: {provider}\u060C {location}.",
|
|
40
|
+
test: "\u0627\u062E\u062A\u0628\u0627\u0631",
|
|
41
|
+
testTitle: "\u0627\u0644\u0627\u062E\u062A\u0628\u0627\u0631",
|
|
42
|
+
store: "\u0627\u0644\u0645\u062E\u0632\u0646",
|
|
43
|
+
result: "\u0627\u0644\u0646\u062A\u064A\u062C\u0629",
|
|
44
|
+
works: "\u064A\u0639\u0645\u0644",
|
|
45
|
+
fails: "\u0644\u0627 \u064A\u0639\u0645\u0644",
|
|
46
|
+
time: "\u0627\u0644\u0648\u0642\u062A",
|
|
47
|
+
ms: "{ms} \u0645\u0644\u0651\u064A \u062B\u0627\u0646\u064A\u0629",
|
|
48
|
+
copyTitle: "\u0627\u0644\u0646\u0633\u062E \u0645\u0646 \u0627\u0644\u062A\u062E\u0632\u064A\u0646 \u0627\u0644\u0633\u0627\u0628\u0642",
|
|
49
|
+
copyHint: "\u064A\u0646\u0633\u062E \u0643\u0644 \u0645\u0644\u0641 \u0645\u0627 \u0632\u0627\u0644 \u0641\u064A \u0627\u0644\u062A\u062E\u0632\u064A\u0646 \u0627\u0644\u0633\u0627\u0628\u0642 \u0625\u0644\u0649 \u0627\u0644\u062A\u062E\u0632\u064A\u0646 \u0627\u0644\u062D\u0627\u0644\u064A\u060C \u0648\u064A\u062A\u062D\u0642\u0642 \u0645\u0646 \u0643\u0644 \u0645\u0644\u0641 \u0645\u0642\u0627\u0628\u0644 \u0627\u0644\u0628\u0635\u0645\u0629 \u0627\u0644\u0645\u062D\u0641\u0648\u0638\u0629 \u0644\u0647. \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0627\u0644\u0645\u0648\u062C\u0648\u062F\u0629 \u0623\u0635\u0644\u064B\u0627 \u062A\u064F\u062A\u0631\u0643 \u0643\u0645\u0627 \u0647\u064A\u060C \u0644\u0630\u0627 \u064A\u0645\u0643\u0646 \u062A\u0634\u063A\u064A\u0644\u0647 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649. \u0639\u0646\u062F\u0645\u0627 \u0644\u0627 \u064A\u062A\u0628\u0642\u0649 \u0634\u064A\u0621\u060C \u0623\u0632\u0644 Storage:Previous \u0645\u0646 \u0627\u0644\u0625\u0639\u062F\u0627\u062F\u0627\u062A.",
|
|
50
|
+
copyStart: "\u0646\u0633\u062E",
|
|
51
|
+
"copyStates.idle": "\u0644\u0645 \u064A\u064F\u0634\u063A\u064E\u0651\u0644",
|
|
52
|
+
"copyStates.running": "\u062C\u0627\u0631\u064D \u0627\u0644\u0646\u0633\u062E",
|
|
53
|
+
"copyStates.done": "\u062A\u0645",
|
|
54
|
+
"copyStates.failed": "\u062A\u0648\u0642\u0641",
|
|
55
|
+
copyCounts: "{total, plural, zero {\u0644\u0627 \u0645\u0644\u0641\u0627\u062A} one {\u0645\u0644\u0641 \u0648\u0627\u062D\u062F} two {\u0645\u0644\u0641\u0627\u0646} few {# \u0645\u0644\u0641\u0627\u062A} many {# \u0645\u0644\u0641\u064B\u0627} other {# \u0645\u0644\u0641}}: \u0646\u064F\u0633\u062E {copied}\u060C \u0645\u0648\u062C\u0648\u062F \u0623\u0635\u0644\u064B\u0627 {skipped}\u060C \u063A\u064A\u0631 \u0645\u0648\u062C\u0648\u062F \u0641\u064A \u0623\u064A \u0645\u0646\u0647\u0645\u0627 {missing}\u060C \u062A\u0639\u0630\u0651\u0631 \u0646\u0633\u062E\u0647 {failed}",
|
|
56
|
+
copyProblems: "\u0645\u0644\u0641\u0627\u062A \u062A\u0639\u0630\u0651\u0631 \u0646\u0633\u062E\u0647\u0627",
|
|
57
|
+
copyFile: "\u0627\u0644\u0645\u0644\u0641",
|
|
58
|
+
copyProblem: "\u0627\u0644\u0633\u0628\u0628"
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// src/areas/storage/texts/en.json
|
|
62
|
+
var en_default = {
|
|
63
|
+
title: "Storage",
|
|
64
|
+
description: "Where {product} keeps its files. It's set in the server's configuration, not here.",
|
|
65
|
+
whereTitle: "Where files are kept",
|
|
66
|
+
whereHint: "The file system, an S3 bucket (AWS or a server that speaks S3, such as MinIO), or Azure Blob. Files are only ever reached through {product}, which checks who may read them.",
|
|
67
|
+
provider: "Kind",
|
|
68
|
+
location: "Where",
|
|
69
|
+
stores: "What's kept there",
|
|
70
|
+
"providers.FileSystem": "The server's file system",
|
|
71
|
+
"providers.S3": "S3 bucket",
|
|
72
|
+
"providers.Azure": "Azure Blob",
|
|
73
|
+
previousTitle: "Files are being moved",
|
|
74
|
+
previousBody: "A file not moved yet is read from where they were before: {provider}, {location}.",
|
|
75
|
+
test: "Test",
|
|
76
|
+
testTitle: "Test",
|
|
77
|
+
store: "Store",
|
|
78
|
+
result: "Result",
|
|
79
|
+
works: "Works",
|
|
80
|
+
fails: "Fails",
|
|
81
|
+
time: "Time",
|
|
82
|
+
ms: "{ms} ms",
|
|
83
|
+
copyTitle: "Copy from the previous storage",
|
|
84
|
+
copyHint: "Copies every file still in the previous storage to the one in use, each checked against the hash kept for it. Files already there are left as they are, so it can be run again. When nothing's left, remove Storage:Previous from the configuration.",
|
|
85
|
+
copyStart: "Copy",
|
|
86
|
+
"copyStates.idle": "Not run",
|
|
87
|
+
"copyStates.running": "Copying",
|
|
88
|
+
"copyStates.done": "Done",
|
|
89
|
+
"copyStates.failed": "Stopped",
|
|
90
|
+
copyCounts: "{total, plural, one {# file} other {# files}}: {copied} copied, {skipped} already there, {missing} in neither, {failed} couldn't be copied",
|
|
91
|
+
copyProblems: "Files that couldn't be copied",
|
|
92
|
+
copyFile: "File",
|
|
93
|
+
copyProblem: "Why"
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// src/areas/storage/texts.ts
|
|
97
|
+
var useStorageTexts = createAreaTexts("storage", { en: en_default, ar: ar_default });
|
|
98
|
+
|
|
99
|
+
// src/areas/storage/StorageScreen.tsx
|
|
100
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
101
|
+
var COPY_POLL_MS = 1e3;
|
|
102
|
+
function StorageScreen({ onChanged, storeName }) {
|
|
103
|
+
const t = useStorageTexts();
|
|
104
|
+
const request = useAreaRequest("storage");
|
|
105
|
+
const storage = useApiQuery("storage", "");
|
|
106
|
+
const action = useApiAction();
|
|
107
|
+
const { number } = useFormatters();
|
|
108
|
+
const { locale } = useAbpLocale();
|
|
109
|
+
const [tests, setTests] = useState(null);
|
|
110
|
+
const nameOf = useCallback(
|
|
111
|
+
(store) => {
|
|
112
|
+
const key = `storeNames.${store}`;
|
|
113
|
+
const text = t(key);
|
|
114
|
+
return text !== key ? text : storeName?.(store) ?? store;
|
|
115
|
+
},
|
|
116
|
+
[t, storeName]
|
|
117
|
+
);
|
|
118
|
+
const provider = (p) => {
|
|
119
|
+
const key = `providers.${p}`;
|
|
120
|
+
const text = t(key);
|
|
121
|
+
return text !== key ? text : p;
|
|
122
|
+
};
|
|
123
|
+
async function test() {
|
|
124
|
+
const result = await action.run(() => request("/test", { method: "POST" }));
|
|
125
|
+
if (result) setTests(result);
|
|
126
|
+
}
|
|
127
|
+
const data = storage.data;
|
|
128
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: "section", children: [
|
|
129
|
+
/* @__PURE__ */ jsx(PageHeader, { title: t("title"), description: t("description"), actions: /* @__PURE__ */ jsx(HostSlot, { name: "storage.page.actions" }) }),
|
|
130
|
+
/* @__PURE__ */ jsx(InlineAlert, { tone: "danger", children: storage.error ?? action.error }),
|
|
131
|
+
(data || storage.loading) && /* @__PURE__ */ jsx(
|
|
132
|
+
Panel,
|
|
133
|
+
{
|
|
134
|
+
title: t("whereTitle"),
|
|
135
|
+
description: t("whereHint"),
|
|
136
|
+
"data-testid": "storage-where",
|
|
137
|
+
loading: storage.loading && !data,
|
|
138
|
+
actions: /* @__PURE__ */ jsx(Button, { size: "sm", onClick: () => void test(), loading: action.busy, disabled: !data, children: t("test") }),
|
|
139
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: "4", children: [
|
|
140
|
+
/* @__PURE__ */ jsx(
|
|
141
|
+
PropertyList,
|
|
142
|
+
{
|
|
143
|
+
loading: storage.loading && !data,
|
|
144
|
+
items: [
|
|
145
|
+
{ label: t("provider"), value: data ? provider(data.current.provider) : null },
|
|
146
|
+
{
|
|
147
|
+
label: t("location"),
|
|
148
|
+
value: data ? /* @__PURE__ */ jsx(Text, { as: "span", fontFamily: "mono", dir: "ltr", children: data.current.location }) : null
|
|
149
|
+
},
|
|
150
|
+
{ label: t("stores"), value: data ? new Intl.ListFormat(locale, { type: "conjunction" }).format(data.stores.map(nameOf)) : null }
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
data?.previous && /* @__PURE__ */ jsx(InlineAlert, { tone: "info", title: t("previousTitle"), children: t("previousBody", { provider: provider(data.previous.provider), location: data.previous.location }) })
|
|
155
|
+
] })
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
data?.previous && /* @__PURE__ */ jsx(CopyPanel, { onChanged }),
|
|
159
|
+
tests && /* @__PURE__ */ jsx(Panel, { title: t("testTitle"), flush: true, "data-testid": "storage-test", children: /* @__PURE__ */ jsx(
|
|
160
|
+
DataTable,
|
|
161
|
+
{
|
|
162
|
+
"aria-label": t("testTitle"),
|
|
163
|
+
rows: tests,
|
|
164
|
+
getRowId: (r) => r.store,
|
|
165
|
+
columns: [
|
|
166
|
+
{ id: "store", header: t("store"), cell: (r) => nameOf(r.store) },
|
|
167
|
+
{
|
|
168
|
+
id: "result",
|
|
169
|
+
header: t("result"),
|
|
170
|
+
cell: (r) => /* @__PURE__ */ jsxs(HStack, { gap: "2", children: [
|
|
171
|
+
/* @__PURE__ */ jsx(StatusPill, { tone: r.ok ? "success" : "danger", children: r.ok ? t("works") : t("fails") }),
|
|
172
|
+
r.error && /* @__PURE__ */ jsx(Text, { textStyle: "sm", color: "fg.muted", children: r.error })
|
|
173
|
+
] })
|
|
174
|
+
},
|
|
175
|
+
{ id: "time", header: t("time"), numeric: true, cell: (r) => t("ms", { ms: number(Number(r.milliseconds)) }) }
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
) })
|
|
179
|
+
] });
|
|
180
|
+
}
|
|
181
|
+
function CopyPanel({ onChanged }) {
|
|
182
|
+
const t = useStorageTexts();
|
|
183
|
+
const request = useAreaRequest("storage");
|
|
184
|
+
const copy = useApiQuery("storage", "/copy");
|
|
185
|
+
const action = useApiAction();
|
|
186
|
+
const { number } = useFormatters();
|
|
187
|
+
const running = copy.data?.state === "running";
|
|
188
|
+
const { reload } = copy;
|
|
189
|
+
useEffect(() => {
|
|
190
|
+
if (!running) return;
|
|
191
|
+
const timer = setInterval(() => void reload(), COPY_POLL_MS);
|
|
192
|
+
return () => clearInterval(timer);
|
|
193
|
+
}, [running, reload]);
|
|
194
|
+
const last = useRef(void 0);
|
|
195
|
+
const state = copy.data?.state;
|
|
196
|
+
useEffect(() => {
|
|
197
|
+
if (last.current === "running" && state && state !== "running") void onChanged?.();
|
|
198
|
+
last.current = state;
|
|
199
|
+
}, [state, onChanged]);
|
|
200
|
+
async function start() {
|
|
201
|
+
const started = await action.run(() => request("/copy", { method: "POST" }));
|
|
202
|
+
if (started) {
|
|
203
|
+
copy.setData(started);
|
|
204
|
+
await onChanged?.();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const c = copy.data;
|
|
208
|
+
const n = (value) => number(Number(value));
|
|
209
|
+
return /* @__PURE__ */ jsx(
|
|
210
|
+
Panel,
|
|
211
|
+
{
|
|
212
|
+
title: t("copyTitle"),
|
|
213
|
+
description: t("copyHint"),
|
|
214
|
+
"data-testid": "storage-copy",
|
|
215
|
+
loading: copy.loading && !c && !copy.error,
|
|
216
|
+
actions: /* @__PURE__ */ jsx(Button, { size: "sm", onClick: () => void start(), loading: action.busy || running, disabled: running || !c, children: t("copyStart") }),
|
|
217
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: "3", children: [
|
|
218
|
+
/* @__PURE__ */ jsx(InlineAlert, { tone: "danger", children: copy.error ?? action.error }),
|
|
219
|
+
c && c.state !== "idle" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
220
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "2", flexWrap: "wrap", children: [
|
|
221
|
+
/* @__PURE__ */ jsx(
|
|
222
|
+
StatusPill,
|
|
223
|
+
{
|
|
224
|
+
tone: c.state === "done" ? Number(c.failed) > 0 || Number(c.missing) > 0 ? "warning" : "success" : c.state === "failed" ? "danger" : "info",
|
|
225
|
+
children: t(`copyStates.${c.state}`)
|
|
226
|
+
}
|
|
227
|
+
),
|
|
228
|
+
/* @__PURE__ */ jsx(Text, { textStyle: "sm", children: t("copyCounts", { total: Number(c.total), copied: n(c.copied), skipped: n(c.skipped), missing: n(c.missing), failed: n(c.failed) }) })
|
|
229
|
+
] }),
|
|
230
|
+
c.problems.length > 0 && /* @__PURE__ */ jsx(
|
|
231
|
+
DataTable,
|
|
232
|
+
{
|
|
233
|
+
"aria-label": t("copyProblems"),
|
|
234
|
+
rows: c.problems,
|
|
235
|
+
getRowId: (p) => `${p.store}/${p.name}`,
|
|
236
|
+
columns: [
|
|
237
|
+
{
|
|
238
|
+
id: "file",
|
|
239
|
+
header: t("copyFile"),
|
|
240
|
+
cell: (p) => /* @__PURE__ */ jsx(Text, { fontFamily: "mono", textStyle: "sm", dir: "ltr", children: p.store ? `${p.store}/${p.name}` : EMPTY_VALUE })
|
|
241
|
+
},
|
|
242
|
+
{ id: "problem", header: t("copyProblem"), cell: (p) => /* @__PURE__ */ jsx(Text, { textStyle: "sm", children: p.problem }) }
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
)
|
|
246
|
+
] })
|
|
247
|
+
] })
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// src/areas/storage/pages.tsx
|
|
253
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
254
|
+
var pages = /* @__PURE__ */ new Map();
|
|
255
|
+
function pageFor(href, options) {
|
|
256
|
+
const kept = pages.get(href);
|
|
257
|
+
if (kept) {
|
|
258
|
+
kept.options = options;
|
|
259
|
+
return kept.component;
|
|
260
|
+
}
|
|
261
|
+
const entry = { options, component: (() => null) };
|
|
262
|
+
const onChanged = () => entry.options.onChanged?.();
|
|
263
|
+
const storeName = (store) => entry.options.storeName?.(store) ?? store;
|
|
264
|
+
entry.component = function StoragePage() {
|
|
265
|
+
return /* @__PURE__ */ jsx2(StorageScreen, { onChanged, storeName });
|
|
266
|
+
};
|
|
267
|
+
pages.set(href, entry);
|
|
268
|
+
return entry.component;
|
|
269
|
+
}
|
|
270
|
+
function storagePages(options) {
|
|
271
|
+
const href = options.href.replace(/\/$/, "");
|
|
272
|
+
return [
|
|
273
|
+
{
|
|
274
|
+
id: "storage.admin",
|
|
275
|
+
section: options.section,
|
|
276
|
+
weight: options.weight ?? 100,
|
|
277
|
+
title: options.title ?? en_default.title,
|
|
278
|
+
href,
|
|
279
|
+
about: options.about,
|
|
280
|
+
plugin: "storage",
|
|
281
|
+
visible: options.visible ?? (options.host?.can ? () => options.host.can("storage.site.admin") : void 0),
|
|
282
|
+
component: pageFor(href, options)
|
|
283
|
+
}
|
|
284
|
+
];
|
|
285
|
+
}
|
|
286
|
+
export {
|
|
287
|
+
StorageScreen,
|
|
288
|
+
storagePages,
|
|
289
|
+
useStorageTexts
|
|
290
|
+
};
|
|
291
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/areas/storage/StorageScreen.tsx","../src/areas/storage/texts.ts","../src/areas/storage/texts/ar.json","../src/areas/storage/texts/en.json","../src/areas/storage/pages.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { HStack, Stack, Text } from '@chakra-ui/react';\nimport {\n Button,\n DataTable,\n EMPTY_VALUE,\n HostSlot,\n InlineAlert,\n PageHeader,\n Panel,\n PropertyList,\n StatusPill,\n useApiAction,\n useAbpLocale,\n useApiQuery,\n useAreaRequest,\n useFormatters,\n} from '@abpjs/ui';\nimport { useStorageTexts } from './texts';\nimport type { StorageCopy, StorageInfo, StorageTest } from './types';\n\nexport interface StorageScreenProps {\n /** Told after a change the server has taken: a copy started, and a copy that finished or stopped. */\n onChanged?: () => void | Promise<void>;\n /**\n * A store's name for people. By default the area's text `storeNames.<store>` (a host gives those through\n * `AbpHost.texts.storage`), else the store's own key.\n */\n storeName?: (store: string) => string;\n}\n\n/** How often a running copy is read again. */\nconst COPY_POLL_MS = 1000;\n\n/**\n * The site's storage (AbpCluster.Storage): where its files are kept (the provider and its place, never a key), what's\n * kept there, a test of each store, and, while a previous storage is being left, the copy from it with its progress.\n * Storage is set in the server's configuration, so nothing here changes where files go. Starting the copy is the one\n * sensitive action: a host's step-up answers its 403 through the host's request. The host's own links go in the\n * `storage.page.actions` slot.\n */\nexport function StorageScreen({ onChanged, storeName }: StorageScreenProps) {\n const t = useStorageTexts();\n const request = useAreaRequest('storage');\n // The package's root route: the base path itself, with no slash after it.\n const storage = useApiQuery<StorageInfo>('storage', '');\n const action = useApiAction();\n const { number } = useFormatters();\n const { locale } = useAbpLocale();\n const [tests, setTests] = useState<StorageTest[] | null>(null);\n\n const nameOf = useCallback(\n (store: string) => {\n const key = `storeNames.${store}`;\n const text = t(key);\n return text !== key ? text : (storeName?.(store) ?? store);\n },\n [t, storeName],\n );\n const provider = (p: string) => {\n const key = `providers.${p}`;\n const text = t(key);\n return text !== key ? text : p;\n };\n\n async function test() {\n const result = await action.run(() => request<StorageTest[]>('/test', { method: 'POST' }));\n if (result) setTests(result);\n }\n\n const data = storage.data;\n return (\n <Stack gap=\"section\">\n <PageHeader title={t('title')} description={t('description')} actions={<HostSlot name=\"storage.page.actions\" />} />\n <InlineAlert tone=\"danger\">{storage.error ?? action.error}</InlineAlert>\n {(data || storage.loading) && (\n <Panel\n title={t('whereTitle')}\n description={t('whereHint')}\n data-testid=\"storage-where\"\n loading={storage.loading && !data}\n actions={\n <Button size=\"sm\" onClick={() => void test()} loading={action.busy} disabled={!data}>\n {t('test')}\n </Button>\n }\n >\n <Stack gap=\"4\">\n <PropertyList\n loading={storage.loading && !data}\n items={[\n { label: t('provider'), value: data ? provider(data.current.provider) : null },\n {\n label: t('location'),\n value: data ? (\n <Text as=\"span\" fontFamily=\"mono\" dir=\"ltr\">\n {data.current.location}\n </Text>\n ) : null,\n },\n { label: t('stores'), value: data ? new Intl.ListFormat(locale, { type: 'conjunction' }).format(data.stores.map(nameOf)) : null },\n ]}\n />\n {data?.previous && (\n <InlineAlert tone=\"info\" title={t('previousTitle')}>\n {t('previousBody', { provider: provider(data.previous.provider), location: data.previous.location })}\n </InlineAlert>\n )}\n </Stack>\n </Panel>\n )}\n {data?.previous && <CopyPanel onChanged={onChanged} />}\n {tests && (\n <Panel title={t('testTitle')} flush data-testid=\"storage-test\">\n <DataTable\n aria-label={t('testTitle')}\n rows={tests}\n getRowId={(r) => r.store}\n columns={[\n { id: 'store', header: t('store'), cell: (r) => nameOf(r.store) },\n {\n id: 'result',\n header: t('result'),\n cell: (r) => (\n <HStack gap=\"2\">\n <StatusPill tone={r.ok ? 'success' : 'danger'}>{r.ok ? t('works') : t('fails')}</StatusPill>\n {r.error && (\n <Text textStyle=\"sm\" color=\"fg.muted\">\n {r.error}\n </Text>\n )}\n </HStack>\n ),\n },\n { id: 'time', header: t('time'), numeric: true, cell: (r) => t('ms', { ms: number(Number(r.milliseconds)) }) },\n ]}\n />\n </Panel>\n )}\n </Stack>\n );\n}\n\n/**\n * The copy from the previous storage: started by a site admin (the host's step-up, when it asks for one), read again\n * every second while it runs, then its counts and the first problems.\n */\nfunction CopyPanel({ onChanged }: { onChanged?: () => void | Promise<void> }) {\n const t = useStorageTexts();\n const request = useAreaRequest('storage');\n const copy = useApiQuery<StorageCopy>('storage', '/copy');\n const action = useApiAction();\n const { number } = useFormatters();\n const running = copy.data?.state === 'running';\n\n const { reload } = copy;\n useEffect(() => {\n if (!running) return;\n const timer = setInterval(() => void reload(), COPY_POLL_MS);\n return () => clearInterval(timer);\n }, [running, reload]);\n\n // A copy that was running and has now finished or stopped is a change the host may want to hear of.\n const last = useRef<string | undefined>(undefined);\n const state = copy.data?.state;\n useEffect(() => {\n if (last.current === 'running' && state && state !== 'running') void onChanged?.();\n last.current = state;\n }, [state, onChanged]);\n\n async function start() {\n const started = await action.run(() => request<StorageCopy>('/copy', { method: 'POST' }));\n if (started) {\n copy.setData(started);\n await onChanged?.();\n }\n }\n\n const c = copy.data;\n const n = (value: number | string) => number(Number(value));\n return (\n <Panel\n title={t('copyTitle')}\n description={t('copyHint')}\n data-testid=\"storage-copy\"\n loading={copy.loading && !c && !copy.error}\n actions={\n <Button size=\"sm\" onClick={() => void start()} loading={action.busy || running} disabled={running || !c}>\n {t('copyStart')}\n </Button>\n }\n >\n <Stack gap=\"3\">\n <InlineAlert tone=\"danger\">{copy.error ?? action.error}</InlineAlert>\n {c && c.state !== 'idle' && (\n <>\n <HStack gap=\"2\" flexWrap=\"wrap\">\n <StatusPill\n tone={c.state === 'done' ? (Number(c.failed) > 0 || Number(c.missing) > 0 ? 'warning' : 'success') : c.state === 'failed' ? 'danger' : 'info'}\n >\n {t(`copyStates.${c.state}`)}\n </StatusPill>\n <Text textStyle=\"sm\">\n {t('copyCounts', { total: Number(c.total), copied: n(c.copied), skipped: n(c.skipped), missing: n(c.missing), failed: n(c.failed) })}\n </Text>\n </HStack>\n {c.problems.length > 0 && (\n <DataTable\n aria-label={t('copyProblems')}\n rows={c.problems}\n getRowId={(p) => `${p.store}/${p.name}`}\n columns={[\n {\n id: 'file',\n header: t('copyFile'),\n cell: (p) => (\n <Text fontFamily=\"mono\" textStyle=\"sm\" dir=\"ltr\">\n {p.store ? `${p.store}/${p.name}` : EMPTY_VALUE}\n </Text>\n ),\n },\n { id: 'problem', header: t('copyProblem'), cell: (p) => <Text textStyle=\"sm\">{p.problem}</Text> },\n ]}\n />\n )}\n </>\n )}\n </Stack>\n </Panel>\n );\n}\n","import { createAreaTexts } from '@abpjs/ui';\nimport ar from './texts/ar.json';\nimport en from './texts/en.json';\n\n/** The area's words, in English and Arabic; a host overrides any key through `AbpHost.texts.storage`. */\nexport const useStorageTexts = createAreaTexts('storage', { en, ar });\n","{\n \"title\": \"التخزين\",\n \"description\": \"حيث يحفظ {product} ملفاته. يُضبط في إعدادات الخادم، لا من هنا.\",\n \"whereTitle\": \"أين تُحفظ الملفات\",\n \"whereHint\": \"نظام ملفات الخادم، أو حاوية S3 (من AWS أو خادم يتحدث S3 مثل MinIO)، أو Azure Blob. لا يُوصل إلى الملفات إلا عبر {product}، الذي يتحقق ممن يحق له قراءتها.\",\n \"provider\": \"النوع\",\n \"location\": \"المكان\",\n \"stores\": \"ما يُحفظ هناك\",\n \"providers.FileSystem\": \"نظام ملفات الخادم\",\n \"providers.S3\": \"حاوية S3\",\n \"providers.Azure\": \"Azure Blob\",\n \"previousTitle\": \"تُنقل الملفات الآن\",\n \"previousBody\": \"الملف الذي لم يُنقل بعد يُقرأ من مكانه السابق: {provider}، {location}.\",\n \"test\": \"اختبار\",\n \"testTitle\": \"الاختبار\",\n \"store\": \"المخزن\",\n \"result\": \"النتيجة\",\n \"works\": \"يعمل\",\n \"fails\": \"لا يعمل\",\n \"time\": \"الوقت\",\n \"ms\": \"{ms} ملّي ثانية\",\n \"copyTitle\": \"النسخ من التخزين السابق\",\n \"copyHint\": \"ينسخ كل ملف ما زال في التخزين السابق إلى التخزين الحالي، ويتحقق من كل ملف مقابل البصمة المحفوظة له. الملفات الموجودة أصلًا تُترك كما هي، لذا يمكن تشغيله مرة أخرى. عندما لا يتبقى شيء، أزل Storage:Previous من الإعدادات.\",\n \"copyStart\": \"نسخ\",\n \"copyStates.idle\": \"لم يُشغَّل\",\n \"copyStates.running\": \"جارٍ النسخ\",\n \"copyStates.done\": \"تم\",\n \"copyStates.failed\": \"توقف\",\n \"copyCounts\": \"{total, plural, zero {لا ملفات} one {ملف واحد} two {ملفان} few {# ملفات} many {# ملفًا} other {# ملف}}: نُسخ {copied}، موجود أصلًا {skipped}، غير موجود في أي منهما {missing}، تعذّر نسخه {failed}\",\n \"copyProblems\": \"ملفات تعذّر نسخها\",\n \"copyFile\": \"الملف\",\n \"copyProblem\": \"السبب\"\n}\n","{\n \"title\": \"Storage\",\n \"description\": \"Where {product} keeps its files. It's set in the server's configuration, not here.\",\n \"whereTitle\": \"Where files are kept\",\n \"whereHint\": \"The file system, an S3 bucket (AWS or a server that speaks S3, such as MinIO), or Azure Blob. Files are only ever reached through {product}, which checks who may read them.\",\n \"provider\": \"Kind\",\n \"location\": \"Where\",\n \"stores\": \"What's kept there\",\n \"providers.FileSystem\": \"The server's file system\",\n \"providers.S3\": \"S3 bucket\",\n \"providers.Azure\": \"Azure Blob\",\n \"previousTitle\": \"Files are being moved\",\n \"previousBody\": \"A file not moved yet is read from where they were before: {provider}, {location}.\",\n \"test\": \"Test\",\n \"testTitle\": \"Test\",\n \"store\": \"Store\",\n \"result\": \"Result\",\n \"works\": \"Works\",\n \"fails\": \"Fails\",\n \"time\": \"Time\",\n \"ms\": \"{ms} ms\",\n \"copyTitle\": \"Copy from the previous storage\",\n \"copyHint\": \"Copies every file still in the previous storage to the one in use, each checked against the hash kept for it. Files already there are left as they are, so it can be run again. When nothing's left, remove Storage:Previous from the configuration.\",\n \"copyStart\": \"Copy\",\n \"copyStates.idle\": \"Not run\",\n \"copyStates.running\": \"Copying\",\n \"copyStates.done\": \"Done\",\n \"copyStates.failed\": \"Stopped\",\n \"copyCounts\": \"{total, plural, one {# file} other {# files}}: {copied} copied, {skipped} already there, {missing} in neither, {failed} couldn't be copied\",\n \"copyProblems\": \"Files that couldn't be copied\",\n \"copyFile\": \"File\",\n \"copyProblem\": \"Why\"\n}\n","import type { ComponentType } from 'react';\nimport type { AbpHost, SettingsPage } from '@abpjs/ui';\nimport { StorageScreen } from './StorageScreen';\nimport en from './texts/en.json';\n\nexport interface StoragePageOptions {\n section: string;\n href: string;\n weight?: number;\n title?: string;\n about?: string;\n visible?: SettingsPage['visible'];\n host?: Pick<AbpHost, 'can'>;\n /** After a change the server has taken (a copy started, a copy that ended): the host reads what it shows again. */\n onChanged?: () => void | Promise<void>;\n /** A store's name for people, when the host doesn't give `storeNames.<store>` as words; the store's key by default. */\n storeName?: (store: string) => string;\n}\n\n/**\n * One page component per address, kept across calls: a host's `onChanged` refreshes its pages, which builds its settings\n * again, and a new component there would start the screen afresh, a running copy's progress and a test's results gone.\n * It reads the latest call's options. The map is the module's, shared by every host in the process; a host whose\n * options differ by request uses `StorageScreen` in a page of its own instead.\n */\nconst pages = new Map<string, { options: StoragePageOptions; component: ComponentType<{ path: string[] }> }>();\n\nfunction pageFor(href: string, options: StoragePageOptions): ComponentType<{ path: string[] }> {\n const kept = pages.get(href);\n if (kept) {\n kept.options = options;\n return kept.component;\n }\n const entry = { options, component: (() => null) as ComponentType<{ path: string[] }> };\n const onChanged = () => entry.options.onChanged?.();\n const storeName = (store: string) => entry.options.storeName?.(store) ?? store;\n entry.component = function StoragePage() {\n return <StorageScreen onChanged={onChanged} storeName={storeName} />;\n };\n pages.set(href, entry);\n return entry.component;\n}\n\n/**\n * The area's settings page for a host to file under its sections: `storage.admin` at `href`, drawn by the host's\n * catch-all route. Who sees it is the host's `storage.site.admin` when `host` is given. The title is the area's English\n * word unless given; the server checks every call.\n */\nexport function storagePages(options: StoragePageOptions): SettingsPage[] {\n const href = options.href.replace(/\\/$/, '');\n return [\n {\n id: 'storage.admin',\n section: options.section,\n weight: options.weight ?? 100,\n title: options.title ?? en.title,\n href,\n about: options.about,\n plugin: 'storage',\n visible: options.visible ?? (options.host?.can ? () => options.host!.can!('storage.site.admin') : undefined),\n component: pageFor(href, options),\n },\n ];\n}\n"],"mappings":";;;AAAA,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AACzD,SAAS,QAAQ,OAAO,YAAY;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACjBP,SAAS,uBAAuB;;;ACAhC;AAAA,EACE,OAAS;AAAA,EACT,aAAe;AAAA,EACf,YAAc;AAAA,EACd,WAAa;AAAA,EACb,UAAY;AAAA,EACZ,UAAY;AAAA,EACZ,QAAU;AAAA,EACV,wBAAwB;AAAA,EACxB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,eAAiB;AAAA,EACjB,cAAgB;AAAA,EAChB,MAAQ;AAAA,EACR,WAAa;AAAA,EACb,OAAS;AAAA,EACT,QAAU;AAAA,EACV,OAAS;AAAA,EACT,OAAS;AAAA,EACT,MAAQ;AAAA,EACR,IAAM;AAAA,EACN,WAAa;AAAA,EACb,UAAY;AAAA,EACZ,WAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,YAAc;AAAA,EACd,cAAgB;AAAA,EAChB,UAAY;AAAA,EACZ,aAAe;AACjB;;;AChCA;AAAA,EACE,OAAS;AAAA,EACT,aAAe;AAAA,EACf,YAAc;AAAA,EACd,WAAa;AAAA,EACb,UAAY;AAAA,EACZ,UAAY;AAAA,EACZ,QAAU;AAAA,EACV,wBAAwB;AAAA,EACxB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,eAAiB;AAAA,EACjB,cAAgB;AAAA,EAChB,MAAQ;AAAA,EACR,WAAa;AAAA,EACb,OAAS;AAAA,EACT,QAAU;AAAA,EACV,OAAS;AAAA,EACT,OAAS;AAA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,MAAM,KAAK;AACrB,SAAO,MAAM;AACf;AAOO,SAAS,aAAa,SAA6C;AACxE,QAAM,OAAO,QAAQ,KAAK,QAAQ,OAAO,EAAE;AAC3C,SAAO;AAAA,IACL;AAAA,MACE,IAAI;AAAA,MACJ,SAAS,QAAQ;AAAA,MACjB,QAAQ,QAAQ,UAAU;AAAA,MAC1B,OAAO,QAAQ,SAAS,WAAG;AAAA,MAC3B;AAAA,MACA,OAAO,QAAQ;AAAA,MACf,QAAQ;AAAA,MACR,SAAS,QAAQ,YAAY,QAAQ,MAAM,MAAM,MAAM,QAAQ,KAAM,IAAK,oBAAoB,IAAI;AAAA,MAClG,WAAW,QAAQ,MAAM,OAAO;AAAA,IAClC;AAAA,EACF;AACF;","names":["jsx"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abpjs/ui",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.37",
|
|
4
4
|
"description": "The design system for ABP applications on Chakra UI v3 and React 19: tokens, recipes, the app shell, tables, lists, boards, forms and a settings frame. Names no product: the host gives its prefix, colours and words.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -54,6 +54,11 @@
|
|
|
54
54
|
"import": "./dist/languages.js",
|
|
55
55
|
"default": "./dist/languages.js"
|
|
56
56
|
},
|
|
57
|
+
"./storage": {
|
|
58
|
+
"types": "./dist/storage.d.ts",
|
|
59
|
+
"import": "./dist/storage.js",
|
|
60
|
+
"default": "./dist/storage.js"
|
|
61
|
+
},
|
|
57
62
|
"./package.json": "./package.json"
|
|
58
63
|
},
|
|
59
64
|
"files": [
|