@abpjs/ui 0.2.0-next.4 → 0.2.0-next.40
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 +428 -0
- package/dist/agent.d.ts +800 -0
- package/dist/agent.js +2468 -0
- package/dist/agent.js.map +1 -0
- package/dist/ai.d.ts +1 -1
- package/dist/ai.js +25 -9
- package/dist/ai.js.map +1 -1
- package/dist/guard.d.ts +1686 -0
- package/dist/guard.js +4194 -0
- package/dist/guard.js.map +1 -0
- package/dist/index.d.ts +740 -41
- package/dist/index.js +4060 -1379
- package/dist/index.js.map +1 -1
- package/dist/languages.d.ts +162 -0
- package/dist/languages.js +771 -0
- package/dist/languages.js.map +1 -0
- package/dist/rules.d.ts +23 -1
- package/dist/rules.js +35 -0
- package/dist/rules.js.map +1 -1
- package/dist/storage.d.ts +102 -0
- package/dist/storage.js +315 -0
- package/dist/storage.js.map +1 -0
- package/package.json +24 -1
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { SettingsPage, AbpHost } from '@abpjs/ui';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
|
|
4
|
+
interface LanguagesPageOptions {
|
|
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 every change the server has taken: the host reads its languages and texts again. */
|
|
13
|
+
onChanged?: () => void | Promise<void>;
|
|
14
|
+
/** The catalog of the host's own texts (`app` by default). */
|
|
15
|
+
mainCatalog?: string;
|
|
16
|
+
/** The name for any other catalog; its key by default. */
|
|
17
|
+
catalogName?: (catalog: string) => string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The area's settings page for a host to file under its sections: `languages.admin` at `href`, drawn by the host's
|
|
21
|
+
* catch-all route with the path after it: the languages (`/admin/languages`), then one language's texts
|
|
22
|
+
* (`/admin/languages/{code}`). Who sees it is the host's `languages.site.admin` when `host` is given. `onChanged` runs
|
|
23
|
+
* after every change, so the host reads its languages and texts again; `mainCatalog` and `catalogName` name the catalogs
|
|
24
|
+
* in the editor (`TranslateScreen`). The title is the area's English word unless given; the server checks every call.
|
|
25
|
+
*/
|
|
26
|
+
declare function languagesPages(options: LanguagesPageOptions): SettingsPage[];
|
|
27
|
+
|
|
28
|
+
interface LanguagesScreenProps {
|
|
29
|
+
/** Where a language's translation editor opens. */
|
|
30
|
+
translateHref: (code: string) => string;
|
|
31
|
+
/** Told after every change, once the server has it: the host reads its languages and texts again. */
|
|
32
|
+
onChanged?: () => void | Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The site's languages (AbpLanguages): each with its direction, the language it falls back to and how far it's
|
|
36
|
+
* translated; add one, edit one, turn one off, make one the default, remove one, or open its translation editor. The
|
|
37
|
+
* host's own links go in the `languages.list.actions` slot, beside Add.
|
|
38
|
+
*/
|
|
39
|
+
declare function LanguagesScreen({ translateHref, onChanged }: LanguagesScreenProps): react.JSX.Element;
|
|
40
|
+
|
|
41
|
+
interface TranslateScreenProps {
|
|
42
|
+
/** The language's code, as the address names it. */
|
|
43
|
+
code: string;
|
|
44
|
+
/** The languages' list, for the way back. */
|
|
45
|
+
listHref: string;
|
|
46
|
+
/** Told after every save or import, once the server has it: the host reads its texts again. */
|
|
47
|
+
onChanged?: () => void | Promise<void>;
|
|
48
|
+
/** The catalog of the host's own texts (AbpLanguages' `MainCatalog`), named as `editor.mainCatalog` says: `app` by default. */
|
|
49
|
+
mainCatalog?: string;
|
|
50
|
+
/** The name to show for any other catalog (a plugin's, by its key); its key by default. */
|
|
51
|
+
catalogName?: (catalog: string) => string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* One language's texts (AbpLanguages): every text of every catalog with its English source, what ships in this
|
|
55
|
+
* language, and the site's own wording, filtered by status and catalog and searched. Changes wait in a save bar until
|
|
56
|
+
* saved; saving shows them on every page at once. A catalog can be exported as a translator's file and imported back.
|
|
57
|
+
* The server refuses a translation that drops one of the source's placeholders.
|
|
58
|
+
*/
|
|
59
|
+
declare function TranslateScreen({ code, listHref, onChanged, mainCatalog, catalogName }: TranslateScreenProps): react.JSX.Element;
|
|
60
|
+
|
|
61
|
+
/** The area's words, in English and Arabic; a host overrides any key through `AbpHost.texts.languages`. */
|
|
62
|
+
declare const useLanguagesTexts: () => (key: string, values?: Record<string, string | number>) => string;
|
|
63
|
+
|
|
64
|
+
interface components {
|
|
65
|
+
schemas: {
|
|
66
|
+
ImportTextsInput: {
|
|
67
|
+
catalog: string;
|
|
68
|
+
messages: components["schemas"]["JsonObject"];
|
|
69
|
+
/** @default false */
|
|
70
|
+
overwrite: boolean;
|
|
71
|
+
};
|
|
72
|
+
ImportTextsResult: {
|
|
73
|
+
/** Format: int32 */
|
|
74
|
+
imported: number | string;
|
|
75
|
+
/** Format: int32 */
|
|
76
|
+
kept: number | string;
|
|
77
|
+
refused: string[];
|
|
78
|
+
/** Format: int32 */
|
|
79
|
+
unchanged: number | string;
|
|
80
|
+
unknown: string[];
|
|
81
|
+
};
|
|
82
|
+
JsonObject: Record<string, never>;
|
|
83
|
+
LanguageDto: {
|
|
84
|
+
code: string;
|
|
85
|
+
direction: string;
|
|
86
|
+
enabled: boolean;
|
|
87
|
+
englishName: string;
|
|
88
|
+
fallback: null | string;
|
|
89
|
+
isDefault: boolean;
|
|
90
|
+
nativeName: string;
|
|
91
|
+
/** Format: int32 */
|
|
92
|
+
order: number | string;
|
|
93
|
+
textsVersion: string;
|
|
94
|
+
/** Format: int32 */
|
|
95
|
+
total?: null | number | string;
|
|
96
|
+
/** Format: int32 */
|
|
97
|
+
translated?: null | number | string;
|
|
98
|
+
};
|
|
99
|
+
LanguageInput: {
|
|
100
|
+
code?: null | string;
|
|
101
|
+
direction?: null | string;
|
|
102
|
+
enabled?: null | boolean;
|
|
103
|
+
englishName?: null | string;
|
|
104
|
+
fallback?: null | string;
|
|
105
|
+
isDefault?: null | boolean;
|
|
106
|
+
nativeName?: null | string;
|
|
107
|
+
/** Format: int32 */
|
|
108
|
+
order?: null | number | string;
|
|
109
|
+
};
|
|
110
|
+
LanguagesDto: {
|
|
111
|
+
defaultLanguage: string;
|
|
112
|
+
languages: components["schemas"]["LanguageDto"][];
|
|
113
|
+
};
|
|
114
|
+
SaveTextsInput: {
|
|
115
|
+
texts: components["schemas"]["TextChange"][];
|
|
116
|
+
};
|
|
117
|
+
SaveTextsResult: {
|
|
118
|
+
/** Format: int32 */
|
|
119
|
+
removed: number | string;
|
|
120
|
+
/** Format: int32 */
|
|
121
|
+
saved: number | string;
|
|
122
|
+
};
|
|
123
|
+
TextChange: {
|
|
124
|
+
catalog: string;
|
|
125
|
+
key: string;
|
|
126
|
+
value: null | string;
|
|
127
|
+
};
|
|
128
|
+
TextEntriesDto: {
|
|
129
|
+
entries: components["schemas"]["TextEntryDto"][];
|
|
130
|
+
language: string;
|
|
131
|
+
/** Format: int32 */
|
|
132
|
+
total: number | string;
|
|
133
|
+
/** Format: int32 */
|
|
134
|
+
translated: number | string;
|
|
135
|
+
};
|
|
136
|
+
TextEntryDto: {
|
|
137
|
+
bundled: null | string;
|
|
138
|
+
catalog: string;
|
|
139
|
+
key: string;
|
|
140
|
+
source: string;
|
|
141
|
+
status: string;
|
|
142
|
+
value: null | string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
responses: never;
|
|
146
|
+
parameters: never;
|
|
147
|
+
requestBodies: never;
|
|
148
|
+
headers: never;
|
|
149
|
+
pathItems: never;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
type Schemas = components['schemas'];
|
|
153
|
+
/** AbpLanguages.HttpApi's types, as its OpenAPI document gives them (`api.d.ts`). */
|
|
154
|
+
type LanguageInfo = Schemas['LanguageDto'];
|
|
155
|
+
type LanguagesList = Schemas['LanguagesDto'];
|
|
156
|
+
type LanguageInput = Schemas['LanguageInput'];
|
|
157
|
+
type TextEntry = Schemas['TextEntryDto'];
|
|
158
|
+
type TextEntries = Schemas['TextEntriesDto'];
|
|
159
|
+
type SaveTextsResult = Schemas['SaveTextsResult'];
|
|
160
|
+
type ImportTextsResult = Schemas['ImportTextsResult'];
|
|
161
|
+
|
|
162
|
+
export { type ImportTextsResult, type LanguageInfo, type LanguageInput, type LanguagesList, type LanguagesPageOptions, LanguagesScreen, type LanguagesScreenProps, type SaveTextsResult, type TextEntries, type TextEntry, TranslateScreen, type TranslateScreenProps, languagesPages, useLanguagesTexts };
|