@webx-ui/module-admin 0.5.0 → 0.6.0
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/AdminShell.d.ts +9 -3
- package/dist/BackButton.d.ts +25 -0
- package/dist/HelpButton.d.ts +31 -0
- package/dist/RenameButton.d.ts +163 -0
- package/dist/admin.d.ts +9 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +702 -488
- package/dist/index.js.map +1 -1
- package/dist/markdown.d.ts +14 -0
- package/dist/style.css +1 -1
- package/package.json +4 -4
package/dist/AdminShell.d.ts
CHANGED
|
@@ -3,9 +3,15 @@ declare function __VLS_template(): {
|
|
|
3
3
|
slots: {
|
|
4
4
|
brand?(_: {}): any;
|
|
5
5
|
brand?(_: {}): any;
|
|
6
|
-
user?(_: {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
user?(_: {
|
|
7
|
+
expanded: boolean;
|
|
8
|
+
}): any;
|
|
9
|
+
user?(_: {
|
|
10
|
+
expanded: boolean;
|
|
11
|
+
}): any;
|
|
12
|
+
user?(_: {
|
|
13
|
+
expanded: boolean;
|
|
14
|
+
}): any;
|
|
9
15
|
nav?(_: {
|
|
10
16
|
collapsed: boolean;
|
|
11
17
|
}): any;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ActionSize } from '@webx-ui/core';
|
|
2
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
3
|
+
/**
|
|
4
|
+
* The way out of an editor, said plainly.
|
|
5
|
+
*
|
|
6
|
+
* A trail of breadcrumbs is where the reader *is*; it is not a way out, and on a phone it is
|
|
7
|
+
* four words in the smallest type on the screen. Every screen that opens one record — a page,
|
|
8
|
+
* a block, a rule — ends up needing the same control, so it is one control rather than each
|
|
9
|
+
* editor's own arrow.
|
|
10
|
+
*
|
|
11
|
+
* An arrow and nothing else: the label is the tooltip, because the name of the section it
|
|
12
|
+
* returns to is already written next to it in the trail, and twice is noise.
|
|
13
|
+
*/
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
/** Where it leads — the section's list, normally. */
|
|
16
|
+
to: RouteLocationRaw;
|
|
17
|
+
/** What the tooltip says. Defaults to the panel's own word for it. */
|
|
18
|
+
label?: string;
|
|
19
|
+
size?: ActionSize;
|
|
20
|
+
};
|
|
21
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
22
|
+
size: ActionSize;
|
|
23
|
+
label: string;
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ActionSize } from '@webx-ui/core';
|
|
2
|
+
/**
|
|
3
|
+
* A `?` beside something that needs explaining, and the page of explanation behind it.
|
|
4
|
+
*
|
|
5
|
+
* The text is Markdown and comes from wherever the caller keeps it — normally a `help` group
|
|
6
|
+
* in a module's `lang` files, which means it is translated in the same place as everything
|
|
7
|
+
* else and is already on the client with the rest of the dictionary. No request, no second
|
|
8
|
+
* store, and a language nobody has translated falls back to the site's own the way every
|
|
9
|
+
* other line does.
|
|
10
|
+
*
|
|
11
|
+
* Keeping it as Markdown rather than as a screen of components is what lets the same words
|
|
12
|
+
* serve an agent: a module can hand the identical text to MCP as `text/markdown`, and then
|
|
13
|
+
* there is one explanation of a thing rather than two that drift.
|
|
14
|
+
*/
|
|
15
|
+
type __VLS_Props = {
|
|
16
|
+
/** The page, in Markdown. */
|
|
17
|
+
body: string;
|
|
18
|
+
/** Heading of the dialog. Defaults to the panel's own word for it. */
|
|
19
|
+
title?: string;
|
|
20
|
+
/** Tooltip of the button. Defaults to the heading. */
|
|
21
|
+
label?: string;
|
|
22
|
+
size?: ActionSize;
|
|
23
|
+
width?: number | string;
|
|
24
|
+
};
|
|
25
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
26
|
+
title: string;
|
|
27
|
+
size: ActionSize;
|
|
28
|
+
label: string;
|
|
29
|
+
width: number | string;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import { ActionSize } from '@webx-ui/core';
|
|
3
|
+
/**
|
|
4
|
+
* Renaming, made an act rather than a side effect.
|
|
5
|
+
*
|
|
6
|
+
* A heading that is quietly an `<input>` reads as a heading: nothing says it can be typed in,
|
|
7
|
+
* and the reader finds out by accident — or never. Worse, it is bound straight to the record,
|
|
8
|
+
* so a stray keystroke on what looks like a title is a rename nobody asked for.
|
|
9
|
+
*
|
|
10
|
+
* So the name is text, with a pencil beside it. The pencil opens a small form: one field, one
|
|
11
|
+
* button, and nothing changes until that button is pressed. Escape and a click outside leave
|
|
12
|
+
* the name as it was.
|
|
13
|
+
*/
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
/** What is being renamed. Only written back when the form is submitted. */
|
|
16
|
+
name?: string;
|
|
17
|
+
/** Heading of the form, and the pencil's tooltip. Defaults to the panel's own word. */
|
|
18
|
+
label?: string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
size?: ActionSize;
|
|
22
|
+
};
|
|
23
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
rename: (name: string) => any;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
26
|
+
onRename?: ((name: string) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
size: ActionSize;
|
|
29
|
+
label: string;
|
|
30
|
+
placeholder: string;
|
|
31
|
+
name: string;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
34
|
+
field: ({
|
|
35
|
+
$: import('vue').ComponentInternalInstance;
|
|
36
|
+
$data: {};
|
|
37
|
+
$props: {
|
|
38
|
+
readonly modelValue?: import('@webx-ui/core').InputModelValue;
|
|
39
|
+
readonly id?: string | undefined;
|
|
40
|
+
readonly type?: import('@webx-ui/core').InputNativeType | undefined;
|
|
41
|
+
readonly size?: import('@webx-ui/core').InputSize | undefined;
|
|
42
|
+
readonly status?: import('@webx-ui/core').InputStatus | undefined;
|
|
43
|
+
readonly placeholder?: string | undefined;
|
|
44
|
+
readonly disabled?: boolean | undefined;
|
|
45
|
+
readonly readonly?: boolean | undefined;
|
|
46
|
+
readonly clearable?: boolean | undefined;
|
|
47
|
+
readonly maxlength?: number | undefined;
|
|
48
|
+
readonly showCount?: boolean | undefined;
|
|
49
|
+
readonly autocomplete?: string | undefined;
|
|
50
|
+
readonly ariaLabel?: string | undefined;
|
|
51
|
+
readonly localized?: boolean | undefined;
|
|
52
|
+
readonly onChange?: ((value: string) => any) | undefined | undefined;
|
|
53
|
+
readonly "onUpdate:modelValue"?: ((value: import('@webx-ui/core').InputModelValue) => any) | undefined | undefined;
|
|
54
|
+
readonly onInput?: ((value: string) => any) | undefined | undefined;
|
|
55
|
+
readonly onClear?: (() => any) | undefined | undefined;
|
|
56
|
+
readonly onBlur?: ((event: FocusEvent) => any) | undefined | undefined;
|
|
57
|
+
readonly onFocus?: ((event: FocusEvent) => any) | undefined | undefined;
|
|
58
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
59
|
+
$attrs: import('vue').Attrs;
|
|
60
|
+
$refs: {
|
|
61
|
+
[x: string]: unknown;
|
|
62
|
+
} & {
|
|
63
|
+
inputRef: HTMLInputElement;
|
|
64
|
+
};
|
|
65
|
+
$slots: Readonly<{
|
|
66
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
69
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
70
|
+
$host: Element | null;
|
|
71
|
+
$emit: ((event: "input", value: string) => void) & ((event: "clear") => void) & ((event: "blur", event: FocusEvent) => void) & ((event: "change", value: string) => void) & ((event: "focus", event: FocusEvent) => void) & ((event: "update:modelValue", value: import('@webx-ui/core').InputModelValue) => void);
|
|
72
|
+
$el: any;
|
|
73
|
+
$options: import('vue').ComponentOptionsBase<Readonly<{
|
|
74
|
+
modelValue?: import('@webx-ui/core').InputModelValue;
|
|
75
|
+
} & import('@webx-ui/core').InputProps> & Readonly<{
|
|
76
|
+
onChange?: ((value: string) => any) | undefined;
|
|
77
|
+
"onUpdate:modelValue"?: ((value: import('@webx-ui/core').InputModelValue) => any) | undefined;
|
|
78
|
+
onInput?: ((value: string) => any) | undefined;
|
|
79
|
+
onClear?: (() => any) | undefined;
|
|
80
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
81
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
82
|
+
}>, {
|
|
83
|
+
focus: () => void | undefined;
|
|
84
|
+
blur: () => void | undefined;
|
|
85
|
+
select: () => void | undefined;
|
|
86
|
+
input: import('vue').Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
87
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
88
|
+
change: (value: string) => any;
|
|
89
|
+
"update:modelValue": (value: import('@webx-ui/core').InputModelValue) => any;
|
|
90
|
+
input: (value: string) => any;
|
|
91
|
+
clear: () => any;
|
|
92
|
+
blur: (event: FocusEvent) => any;
|
|
93
|
+
focus: (event: FocusEvent) => any;
|
|
94
|
+
}, string, {
|
|
95
|
+
size: import('@webx-ui/core').InputSize;
|
|
96
|
+
disabled: boolean;
|
|
97
|
+
type: import('@webx-ui/core').InputNativeType;
|
|
98
|
+
placeholder: string;
|
|
99
|
+
ariaLabel: string;
|
|
100
|
+
clearable: boolean;
|
|
101
|
+
status: import('@webx-ui/core').InputStatus;
|
|
102
|
+
id: string;
|
|
103
|
+
readonly: boolean;
|
|
104
|
+
autocomplete: string;
|
|
105
|
+
maxlength: number;
|
|
106
|
+
showCount: boolean;
|
|
107
|
+
localized: boolean;
|
|
108
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
109
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
110
|
+
created?: (() => void) | (() => void)[];
|
|
111
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
112
|
+
mounted?: (() => void) | (() => void)[];
|
|
113
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
114
|
+
updated?: (() => void) | (() => void)[];
|
|
115
|
+
activated?: (() => void) | (() => void)[];
|
|
116
|
+
deactivated?: (() => void) | (() => void)[];
|
|
117
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
118
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
119
|
+
destroyed?: (() => void) | (() => void)[];
|
|
120
|
+
unmounted?: (() => void) | (() => void)[];
|
|
121
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
122
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
123
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
124
|
+
};
|
|
125
|
+
$forceUpdate: () => void;
|
|
126
|
+
$nextTick: typeof nextTick;
|
|
127
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
128
|
+
} & Readonly<{
|
|
129
|
+
size: import('@webx-ui/core').InputSize;
|
|
130
|
+
disabled: boolean;
|
|
131
|
+
type: import('@webx-ui/core').InputNativeType;
|
|
132
|
+
placeholder: string;
|
|
133
|
+
ariaLabel: string;
|
|
134
|
+
clearable: boolean;
|
|
135
|
+
status: import('@webx-ui/core').InputStatus;
|
|
136
|
+
id: string;
|
|
137
|
+
readonly: boolean;
|
|
138
|
+
autocomplete: string;
|
|
139
|
+
maxlength: number;
|
|
140
|
+
showCount: boolean;
|
|
141
|
+
localized: boolean;
|
|
142
|
+
}> & Omit<Readonly<{
|
|
143
|
+
modelValue?: import('@webx-ui/core').InputModelValue;
|
|
144
|
+
} & import('@webx-ui/core').InputProps> & Readonly<{
|
|
145
|
+
onChange?: ((value: string) => any) | undefined;
|
|
146
|
+
"onUpdate:modelValue"?: ((value: import('@webx-ui/core').InputModelValue) => any) | undefined;
|
|
147
|
+
onInput?: ((value: string) => any) | undefined;
|
|
148
|
+
onClear?: (() => any) | undefined;
|
|
149
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
150
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
151
|
+
}>, "type" | "size" | "ariaLabel" | "input" | "select" | "placeholder" | "id" | "status" | "localized" | "blur" | "focus" | "disabled" | "readonly" | "clearable" | "maxlength" | "showCount" | "autocomplete"> & {
|
|
152
|
+
focus: () => void | undefined;
|
|
153
|
+
blur: () => void | undefined;
|
|
154
|
+
select: () => void | undefined;
|
|
155
|
+
input: HTMLInputElement | null;
|
|
156
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
157
|
+
$slots: {
|
|
158
|
+
prefix?(_: {}): any;
|
|
159
|
+
suffix?(_: {}): any;
|
|
160
|
+
};
|
|
161
|
+
}) | null;
|
|
162
|
+
}, any>;
|
|
163
|
+
export default _default;
|
package/dist/admin.d.ts
CHANGED
|
@@ -26,6 +26,15 @@ export interface AdminContext {
|
|
|
26
26
|
readonly types: TypeRegistry;
|
|
27
27
|
/** Ask the server what the panel is and who is signed in again. */
|
|
28
28
|
reload(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Fetch the manifest again and adopt it, without the panel going through `loading` — so the
|
|
31
|
+
* chrome changes under whoever is looking at it instead of being replaced by a spinner.
|
|
32
|
+
*
|
|
33
|
+
* For a screen that has just saved something the manifest reports: the branding, the name of
|
|
34
|
+
* the site, what a section is called. A failure is swallowed, because what it would cost is
|
|
35
|
+
* a working panel in exchange for a stale logo.
|
|
36
|
+
*/
|
|
37
|
+
refreshManifest(): Promise<void>;
|
|
29
38
|
/**
|
|
30
39
|
* Draw the panel in another language: fetches that dictionary and remembers the choice for
|
|
31
40
|
* the next visit. Storing it against the administrator is an auth module's business — this
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { createAdmin, type Admin, type AdminPlugin, type CreateAdminOptions } fr
|
|
|
2
2
|
export { createAdminContext, provideAdmin, useAdmin, adminKey, type AdminContext, type AdminState, } from './admin';
|
|
3
3
|
export { createI18n, provideI18n, useI18n, useTranslate, i18nKey, type Dictionary, type I18n, type I18nState, type LocaleDescriptor, type Messages, type Translate, } from './i18n';
|
|
4
4
|
export { adminMessages } from './messages';
|
|
5
|
+
export { renderMarkdown } from './markdown';
|
|
5
6
|
export { createDates, useDates, type DateLike, type Dates } from './dates';
|
|
6
7
|
export { errorText, useErrorText } from './errors';
|
|
7
8
|
export { createHttp, readCookie, HttpError, type Http, type HttpOptions, type RequestOptions, } from './http';
|
|
@@ -12,4 +13,7 @@ export { default as AdminNav } from './AdminNav';
|
|
|
12
13
|
export { default as WxScreen } from './Screen';
|
|
13
14
|
export { default as WxListScreen } from './ListScreen';
|
|
14
15
|
export { default as WxRowMenu } from './RowMenu';
|
|
16
|
+
export { default as WxBackButton } from './BackButton';
|
|
17
|
+
export { default as WxRenameButton } from './RenameButton';
|
|
18
|
+
export { default as WxHelpButton } from './HelpButton';
|
|
15
19
|
export { default as WxDate } from './DateText';
|