@infinia/plugin-ui 1.0.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/client.d.ts +20 -0
- package/dist/components/FyConfirmDialog.vue.d.ts +27 -0
- package/dist/components/FyDirectoryPicker.vue.d.ts +34 -0
- package/dist/components/FyEmptyState.vue.d.ts +32 -0
- package/dist/components/FyErrorState.vue.d.ts +32 -0
- package/dist/components/FyFilePicker.vue.d.ts +41 -0
- package/dist/components/FyIcon.vue.d.ts +29 -0
- package/dist/components/FyLoadingState.vue.d.ts +23 -0
- package/dist/components/FyNotificationCenter.vue.d.ts +6 -0
- package/dist/components/FyPageHeader.vue.d.ts +21 -0
- package/dist/components/FyPermissionNotice.vue.d.ts +27 -0
- package/dist/components/FyPluginShell.vue.d.ts +52 -0
- package/dist/components/FyStepWizard.vue.d.ts +56 -0
- package/dist/components/FyTaskTable.vue.d.ts +40 -0
- package/dist/components/FyToolbar.vue.d.ts +13 -0
- package/dist/composables/useFengYuNotify.d.ts +17 -0
- package/dist/composables/useFengYuPick.d.ts +48 -0
- package/dist/createFengYuVuetify.d.ts +20 -0
- package/dist/defaults.d.ts +10 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +28390 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/theme.d.ts +14 -0
- package/dist/wizard.d.ts +78 -0
- package/package.json +55 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import { type InjectionKey } from 'vue';
|
|
3
|
+
import type { FengYuClient } from '@infinia/plugin-sdk';
|
|
4
|
+
/**
|
|
5
|
+
* Injection key for the per-app {@link FengYuClient}. Plugins call
|
|
6
|
+
* {@link provideFengYuClient} from their root install and retrieve the client
|
|
7
|
+
* anywhere in the component tree via {@link useFengYuClient}.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FENGYU_CLIENT_KEY: InjectionKey<FengYuClient>;
|
|
10
|
+
/**
|
|
11
|
+
* Provide a {@link FengYuClient} instance to an application so any descendant
|
|
12
|
+
* component can resolve it through {@link useFengYuClient}.
|
|
13
|
+
*/
|
|
14
|
+
export declare function provideFengYuClient(app: App, client: FengYuClient): void;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieve the {@link FengYuClient} provided at app root. Throws if no client
|
|
17
|
+
* was provided — this surfaces wiring mistakes early instead of failing later
|
|
18
|
+
* on the first host round-trip.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useFengYuClient(): FengYuClient;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: boolean;
|
|
3
|
+
title: string;
|
|
4
|
+
message?: string;
|
|
5
|
+
destructive?: boolean;
|
|
6
|
+
/** Text for the confirm button. Defaults to "Delete" when destructive. */
|
|
7
|
+
confirmText?: string;
|
|
8
|
+
/** Text for the cancel button. */
|
|
9
|
+
cancelText?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
+
cancel: () => any;
|
|
13
|
+
"update:modelValue": (value: boolean) => any;
|
|
14
|
+
confirm: () => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onCancel?: (() => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
18
|
+
onConfirm?: (() => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
modelValue: boolean;
|
|
21
|
+
message: string;
|
|
22
|
+
destructive: boolean;
|
|
23
|
+
confirmText: string;
|
|
24
|
+
cancelText: string;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK-backed directory picker. Delegates to {@link FengYuClient.files.inputDirectory}
|
|
3
|
+
* {@link FengYuClient.files.workspaceDirectory}, or
|
|
4
|
+
* {@link FengYuClient.files.outputDirectory} based on the `mode` prop.
|
|
5
|
+
*
|
|
6
|
+
* Behavioral contract mirrors {@link FyFilePicker}: cancellation (`null`) emits
|
|
7
|
+
* `cancel` and no alert; permission denials render {@link FyPermissionNotice}
|
|
8
|
+
* without auto-retry; other errors render {@link FyErrorState} with retry.
|
|
9
|
+
* Concurrent clicks are guarded by `loading`.
|
|
10
|
+
*/
|
|
11
|
+
import type { FileRef } from '@infinia/plugin-sdk';
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
/** v-model: the selected directory, or `null` when nothing is chosen. */
|
|
14
|
+
modelValue?: FileRef | null;
|
|
15
|
+
/** Which host SDK method to call: input vs. output directory picker. */
|
|
16
|
+
mode?: 'input' | 'workspace' | 'output';
|
|
17
|
+
/** Button label. */
|
|
18
|
+
label?: string;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
21
|
+
error: (error: Error) => any;
|
|
22
|
+
cancel: () => any;
|
|
23
|
+
"update:modelValue": (value: FileRef | null) => any;
|
|
24
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
+
onError?: ((error: Error) => any) | undefined;
|
|
26
|
+
onCancel?: (() => any) | undefined;
|
|
27
|
+
"onUpdate:modelValue"?: ((value: FileRef | null) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
label: string;
|
|
30
|
+
modelValue: FileRef | null;
|
|
31
|
+
mode: "input" | "workspace" | "output";
|
|
32
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard empty state: a status region with an icon and text. Provide the
|
|
3
|
+
* `action` slot for a primary call-to-action (e.g. "Create").
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
title?: string;
|
|
7
|
+
message?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Icon to display. Inline SVG path data (a string from `@mdi/js`, e.g.
|
|
10
|
+
* `mdiFolderOpenOutline`) is preferred — the mdi webfont is not reliably
|
|
11
|
+
* bundled into plugin iframes. A legacy `mdi-*` name falls back to
|
|
12
|
+
* `v-icon` and may render as tofu squares.
|
|
13
|
+
*/
|
|
14
|
+
icon?: string;
|
|
15
|
+
};
|
|
16
|
+
declare var __VLS_11: {};
|
|
17
|
+
type __VLS_Slots = {} & {
|
|
18
|
+
action?: (props: typeof __VLS_11) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
21
|
+
icon: string;
|
|
22
|
+
title: string;
|
|
23
|
+
message: string;
|
|
24
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard error state: an alert region with an icon, readable title/message,
|
|
3
|
+
* and a default retry button that emits `retry`. Provide the `action` slot to
|
|
4
|
+
* replace the default button with a custom control.
|
|
5
|
+
*/
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
title?: string;
|
|
8
|
+
message?: string;
|
|
9
|
+
/** MDI icon name; defaults to an alert outline. */
|
|
10
|
+
icon?: string;
|
|
11
|
+
};
|
|
12
|
+
declare var __VLS_9: {};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
action?: (props: typeof __VLS_9) => any;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
17
|
+
retry: () => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
|
+
onRetry?: (() => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
icon: string;
|
|
22
|
+
title: string;
|
|
23
|
+
message: string;
|
|
24
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK-backed file picker. Wraps {@link FengYuClient.files.open} so a plugin can
|
|
3
|
+
* request a host file through a single button.
|
|
4
|
+
*
|
|
5
|
+
* Behavioral contract:
|
|
6
|
+
* - Emits `update:modelValue` (the `FileRef`, or `null`) for v-model.
|
|
7
|
+
* - Cancellation — the host resolving `null` — emits `cancel` and renders NO
|
|
8
|
+
* alert region; cancellation is a normal empty result, never an error.
|
|
9
|
+
* - Rejections whose message indicates a permission denial render
|
|
10
|
+
* {@link FyPermissionNotice} and do NOT auto-retry.
|
|
11
|
+
* - All other rejections render {@link FyErrorState}; its retry action re-runs
|
|
12
|
+
* the pick.
|
|
13
|
+
* - A `loading` guard blocks concurrent picks.
|
|
14
|
+
*/
|
|
15
|
+
import type { FileFilter, FileRef } from '@infinia/plugin-sdk';
|
|
16
|
+
type __VLS_Props = {
|
|
17
|
+
/** v-model: the selected file, or `null` when nothing is chosen. */
|
|
18
|
+
modelValue?: FileRef | null;
|
|
19
|
+
/** Extension allowlist forwarded to the host file dialog. */
|
|
20
|
+
extensions?: string[];
|
|
21
|
+
/** Named extension filters forwarded to the host file dialog. */
|
|
22
|
+
filters?: FileFilter[];
|
|
23
|
+
/** Button label. */
|
|
24
|
+
label?: string;
|
|
25
|
+
};
|
|
26
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
|
+
error: (error: Error) => any;
|
|
28
|
+
cancel: () => any;
|
|
29
|
+
"update:modelValue": (value: FileRef | null) => any;
|
|
30
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
|
+
onError?: ((error: Error) => any) | undefined;
|
|
32
|
+
onCancel?: (() => any) | undefined;
|
|
33
|
+
"onUpdate:modelValue"?: ((value: FileRef | null) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
label: string;
|
|
36
|
+
modelValue: FileRef | null;
|
|
37
|
+
filters: FileFilter[];
|
|
38
|
+
extensions: string[];
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline-Svg icon renderer for FengYu plugin UIs.
|
|
3
|
+
*
|
|
4
|
+
* Plugin UIs run in a sandboxed iframe whose `connect-src` is `none`, and the
|
|
5
|
+
* Material Design Icons webfont cannot be reliably inlined by the production
|
|
6
|
+
* build (the `@mdi/font` stylesheet declares two `src:` blocks; only the legacy
|
|
7
|
+
* `.eot` survives, which modern browsers ignore — so `mdi-*` font glyphs render
|
|
8
|
+
* as tofu squares). The robust, network-free path is to ship icons as inline
|
|
9
|
+
* SVG `<path>` data, sourced from `@mdi/js` (a tree-shakeable bundle of path
|
|
10
|
+
* constants). `FyIcon` renders that data; no font, no fetch, no CSP surface.
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { mdiHammerWrench } from '@mdi/js'
|
|
15
|
+
* <FyIcon :path="mdiHammerWrench" />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
type __VLS_Props = {
|
|
19
|
+
/** SVG path `d` data, e.g. `mdiHammerWrench` from `@mdi/js`. Empty renders nothing. */
|
|
20
|
+
path?: string;
|
|
21
|
+
/** Icon edge length in px. */
|
|
22
|
+
size?: number;
|
|
23
|
+
};
|
|
24
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
25
|
+
path: string;
|
|
26
|
+
size: number;
|
|
27
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard loading state: a status region with an indeterminate spinner and
|
|
3
|
+
* optional label. Provide the `action` slot for a primary control (e.g.
|
|
4
|
+
* "Cancel").
|
|
5
|
+
*/
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
label?: string;
|
|
8
|
+
};
|
|
9
|
+
declare var __VLS_6: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
action?: (props: typeof __VLS_6) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
14
|
+
label: string;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {
|
|
2
|
+
notify: (message: string) => Promise<void>;
|
|
3
|
+
localMessages: import("vue").Ref<string[], string[]>;
|
|
4
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page header: a title, optional description, and an `actions` slot for
|
|
3
|
+
* toolbar buttons aligned to the trailing edge.
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
};
|
|
9
|
+
declare var __VLS_1: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
actions?: (props: typeof __VLS_1) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard permission-denied notice: an alert region explaining that the user
|
|
3
|
+
* lacks access, with an optional `action` slot (e.g. "Request access").
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
title?: string;
|
|
7
|
+
message?: string;
|
|
8
|
+
/** MDI icon name; defaults to a lock outline. */
|
|
9
|
+
icon?: string;
|
|
10
|
+
};
|
|
11
|
+
declare var __VLS_9: {};
|
|
12
|
+
type __VLS_Slots = {} & {
|
|
13
|
+
action?: (props: typeof __VLS_9) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
16
|
+
icon: string;
|
|
17
|
+
title: string;
|
|
18
|
+
message: string;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single navigation entry rendered by {@link FyPluginShell}.
|
|
3
|
+
*
|
|
4
|
+
* - `value` identifies the active item and is emitted via `update:modelValue`.
|
|
5
|
+
* - `icon` is either inline SVG path data (preferred — a string from
|
|
6
|
+
* `@mdi/js` beginning with `M`, rendered via {@link FyIcon}) or a legacy
|
|
7
|
+
* `mdi-*` webfont name (rendered via `v-icon`; note the webfont is not
|
|
8
|
+
* reliably bundled and may show tofu squares, so prefer path data).
|
|
9
|
+
* - `disabled` items do not emit on click.
|
|
10
|
+
*/
|
|
11
|
+
export interface FyNavItem {
|
|
12
|
+
value: string;
|
|
13
|
+
title: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
type __VLS_Props = {
|
|
18
|
+
/**
|
|
19
|
+
* Shell title shown in the mobile (temporary) app bar. The desktop drawer
|
|
20
|
+
* shows nav item titles by default (icon + label); the user can collapse it
|
|
21
|
+
* to an icon-only rail via the toggle at the drawer top.
|
|
22
|
+
*/
|
|
23
|
+
title?: string;
|
|
24
|
+
/** Navigation items to render. */
|
|
25
|
+
items?: FyNavItem[];
|
|
26
|
+
/** Active item value (v-model). */
|
|
27
|
+
modelValue?: string;
|
|
28
|
+
/** Viewport width (px) below which the drawer becomes temporary. */
|
|
29
|
+
railBreakpoint?: number;
|
|
30
|
+
};
|
|
31
|
+
declare var __VLS_85: {};
|
|
32
|
+
type __VLS_Slots = {} & {
|
|
33
|
+
default?: (props: typeof __VLS_85) => any;
|
|
34
|
+
};
|
|
35
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
36
|
+
"update:modelValue": (value: string) => any;
|
|
37
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
38
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
title: string;
|
|
41
|
+
items: FyNavItem[];
|
|
42
|
+
modelValue: string;
|
|
43
|
+
railBreakpoint: number;
|
|
44
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
45
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
46
|
+
declare const _default: typeof __VLS_export;
|
|
47
|
+
export default _default;
|
|
48
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
49
|
+
new (): {
|
|
50
|
+
$slots: S;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { FyWizardSnapshot, FyWizardActionsSlotProps, FyWizardErrorSlotProps, FyWizardLabelsInput, FyWizardStep, FyWizardStepLabelSlotProps, FyWizardStepState, FyWizardSlotActions, FyWizardValidationResult } from '../wizard';
|
|
2
|
+
export interface Props<T = unknown> {
|
|
3
|
+
steps: FyWizardStep[];
|
|
4
|
+
modelValue?: string;
|
|
5
|
+
states?: Record<string, FyWizardStepState>;
|
|
6
|
+
context?: T;
|
|
7
|
+
completed?: boolean;
|
|
8
|
+
snapshot?: FyWizardSnapshot;
|
|
9
|
+
validateStep?: (step: string, context: T, signal: AbortSignal) => boolean | FyWizardValidationResult | Promise<boolean | FyWizardValidationResult>;
|
|
10
|
+
resolveNext?: (step: string, context: T) => string | null;
|
|
11
|
+
invalidateAfter?: (changedStep: string, context: T) => string[];
|
|
12
|
+
/** @deprecated Use validateStep instead. */
|
|
13
|
+
canContinue?: (from: string, to: string) => boolean | Promise<boolean>;
|
|
14
|
+
backText?: string;
|
|
15
|
+
nextText?: string;
|
|
16
|
+
finishText?: string;
|
|
17
|
+
retryText?: string;
|
|
18
|
+
optionalText?: string;
|
|
19
|
+
labels?: FyWizardLabelsInput;
|
|
20
|
+
}
|
|
21
|
+
declare const __VLS_export: <TContext = unknown>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
22
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<Props<TContext> & {
|
|
23
|
+
onComplete?: ((snapshot?: FyWizardSnapshot | undefined) => any) | undefined;
|
|
24
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
25
|
+
onTransition?: ((from: string, to: string) => any) | undefined;
|
|
26
|
+
"onUpdate:states"?: ((states: Record<string, FyWizardStepState>) => any) | undefined;
|
|
27
|
+
"onUpdate:completed"?: ((completed: boolean) => any) | undefined;
|
|
28
|
+
"onValidation-error"?: ((step: string, message?: string | undefined) => any) | undefined;
|
|
29
|
+
"onRestore-error"?: ((message: string) => any) | undefined;
|
|
30
|
+
onSnapshot?: ((snapshot: FyWizardSnapshot) => any) | undefined;
|
|
31
|
+
onBlocked?: ((reason?: unknown) => any) | undefined;
|
|
32
|
+
}> & (typeof globalThis extends {
|
|
33
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
34
|
+
} ? P : {});
|
|
35
|
+
expose: (exposed: {}) => void;
|
|
36
|
+
attrs: any;
|
|
37
|
+
slots: {
|
|
38
|
+
[name: string]: ((props: any) => unknown) | undefined;
|
|
39
|
+
'step-label'(props: FyWizardStepLabelSlotProps<TContext>): unknown;
|
|
40
|
+
error(props: FyWizardErrorSlotProps<TContext>): unknown;
|
|
41
|
+
actions(props: FyWizardActionsSlotProps<TContext>): unknown;
|
|
42
|
+
complete(props: {
|
|
43
|
+
actions: FyWizardSlotActions;
|
|
44
|
+
}): unknown;
|
|
45
|
+
};
|
|
46
|
+
emit: ((evt: "complete", snapshot?: FyWizardSnapshot | undefined) => void) & ((evt: "update:modelValue", value: string) => void) & ((evt: "transition", from: string, to: string) => void) & ((evt: "update:states", states: Record<string, FyWizardStepState>) => void) & ((evt: "update:completed", completed: boolean) => void) & ((evt: "validation-error", step: string, message?: string | undefined) => void) & ((evt: "restore-error", message: string) => void) & ((evt: "snapshot", snapshot: FyWizardSnapshot) => void) & ((evt: "blocked", reason?: unknown) => void);
|
|
47
|
+
}>) => import("vue").VNode & {
|
|
48
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
49
|
+
};
|
|
50
|
+
declare const _default: typeof __VLS_export;
|
|
51
|
+
export default _default;
|
|
52
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
53
|
+
[K in keyof T]: T[K];
|
|
54
|
+
} : {
|
|
55
|
+
[K in keyof T as K]: T[K];
|
|
56
|
+
}) & {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface FyTaskRow {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
status: 'queued' | 'running' | 'success' | 'error' | 'cancelled';
|
|
5
|
+
detail?: string;
|
|
6
|
+
}
|
|
7
|
+
export type FyTaskStatus = FyTaskRow['status'];
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
tasks: FyTaskRow[];
|
|
10
|
+
page?: number;
|
|
11
|
+
itemsPerPage?: number;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
error?: string;
|
|
14
|
+
headers?: {
|
|
15
|
+
title: string;
|
|
16
|
+
key: string;
|
|
17
|
+
sortable?: boolean;
|
|
18
|
+
align?: 'start' | 'center' | 'end';
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
22
|
+
"update:page": (value: number) => any;
|
|
23
|
+
"update:itemsPerPage": (value: number) => any;
|
|
24
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
+
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
26
|
+
"onUpdate:itemsPerPage"?: ((value: number) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
error: string;
|
|
29
|
+
loading: boolean;
|
|
30
|
+
page: number;
|
|
31
|
+
itemsPerPage: number;
|
|
32
|
+
headers: {
|
|
33
|
+
title: string;
|
|
34
|
+
key: string;
|
|
35
|
+
sortable?: boolean;
|
|
36
|
+
align?: "start" | "center" | "end";
|
|
37
|
+
}[];
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const _default: typeof __VLS_export;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { FengYuClient } from '@infinia/plugin-sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Deliver a notification to the host, falling back to a local queue when the
|
|
5
|
+
* host rejects (returns `false`) or throws. Cancellation/thrown errors are not
|
|
6
|
+
* propagated: the message is kept locally so the plugin UI can still surface it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function sendFengYuNotification(client: FengYuClient, message: string, local: Ref<string[]>): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Notification helper bound to a {@link FengYuClient}. `notify` forwards to the
|
|
11
|
+
* host and mirrors any rejected/thrown message into `localMessages`, which a
|
|
12
|
+
* {@link FyNotificationCenter} renders as a fallback snackbar queue.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useFengYuNotify(client: FengYuClient): {
|
|
15
|
+
notify: (message: string) => Promise<void>;
|
|
16
|
+
localMessages: Ref<string[]>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { FileRef } from '@infinia/plugin-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Event emit signature shared by the SDK-backed pickers. Mirrors the
|
|
4
|
+
* `defineEmits` of {@link FyFilePicker} / {@link FyDirectoryPicker}:
|
|
5
|
+
* `update:modelValue` (the `FileRef`, or `null`), `cancel`, and `error`.
|
|
6
|
+
*/
|
|
7
|
+
export interface FengYuPickEmit {
|
|
8
|
+
(event: 'update:modelValue', value: FileRef | null): void;
|
|
9
|
+
(event: 'cancel'): void;
|
|
10
|
+
(event: 'error', error: Error): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Options for {@link useFengYuPick}. The composable owns the pick lifecycle
|
|
14
|
+
* (loading, error/permission routing, emit contract) and delegates the actual
|
|
15
|
+
* SDK invocation to `request`, so each picker parameterizes only the call.
|
|
16
|
+
*/
|
|
17
|
+
export interface UseFengYuPickOptions {
|
|
18
|
+
/** Invokes the SDK call and resolves the `FileRef`, or `null` when cancelled. */
|
|
19
|
+
request: () => Promise<FileRef | null>;
|
|
20
|
+
/** Emit function for v-model + lifecycle events. */
|
|
21
|
+
emit: FengYuPickEmit;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A rejection whose message reads as a permission/access denial. Centralized
|
|
25
|
+
* here so {@link FyFilePicker} and {@link FyDirectoryPicker} share one heuristic.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isPermissionError(error: unknown): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Shared pick lifecycle for the SDK-backed pickers. Owns `loading`,
|
|
30
|
+
* `errorMessage`, and `permissionDenied`, and implements the behavioral
|
|
31
|
+
* contract both pickers share:
|
|
32
|
+
*
|
|
33
|
+
* - Concurrent clicks are guarded by `loading`.
|
|
34
|
+
* - The previous error/permission state is cleared before a new request.
|
|
35
|
+
* - A `null` result is a normal cancellation: emit `update:modelValue(null)` +
|
|
36
|
+
* `cancel`, render NO alert.
|
|
37
|
+
* - A rejection is wrapped as an `Error`, routed to `permissionDenied` (via
|
|
38
|
+
* {@link isPermissionError}) or `errorMessage`, and emitted via `error`.
|
|
39
|
+
*
|
|
40
|
+
* The component keeps the rendering decision (which notice to show) in its own
|
|
41
|
+
* template; this composable only surfaces the state.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useFengYuPick(options: UseFengYuPickOptions): {
|
|
44
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
45
|
+
errorMessage: import("vue").Ref<string | null, string | null>;
|
|
46
|
+
permissionDenied: import("vue").Ref<boolean, boolean>;
|
|
47
|
+
pick: () => Promise<void>;
|
|
48
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createVuetify } from 'vuetify';
|
|
2
|
+
import type { FengYuClient } from '@infinia/plugin-sdk';
|
|
3
|
+
import 'vuetify/styles';
|
|
4
|
+
import '@mdi/font/css/materialdesignicons.css';
|
|
5
|
+
import './styles/codex.css';
|
|
6
|
+
export type FengYuVuetifyOptions = {
|
|
7
|
+
theme?: string;
|
|
8
|
+
locale?: string;
|
|
9
|
+
};
|
|
10
|
+
/** Map an Environment.theme value (or option) to the registered Vuetify theme name. */
|
|
11
|
+
export declare function themeName(value?: string): string;
|
|
12
|
+
/** Map an Environment.locale (BCP-47-ish) to a registered Vuetify locale id. */
|
|
13
|
+
export declare function localeName(value?: string): string;
|
|
14
|
+
export declare function createFengYuVuetify(options?: FengYuVuetifyOptions): ReturnType<typeof createVuetify>;
|
|
15
|
+
/**
|
|
16
|
+
* Connect a {@link FengYuClient} to a Vuetify instance: apply the current host
|
|
17
|
+
* environment once, then react to `environment` events. Returns the client's
|
|
18
|
+
* unsubscribe function so the caller can dispose the binding on teardown.
|
|
19
|
+
*/
|
|
20
|
+
export declare function bindFengYuEnvironment(vuetify: ReturnType<typeof createFengYuVuetify>, client: FengYuClient): Promise<() => void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DefaultsInstance } from 'vuetify';
|
|
2
|
+
/**
|
|
3
|
+
* FengYu Codex global Vuetify defaults.
|
|
4
|
+
*
|
|
5
|
+
* A compact, low-elevation, softly-rounded baseline that matches the Codex
|
|
6
|
+
* desktop look: comfortable-density inputs/buttons, flat cards, dialogs/menus
|
|
7
|
+
* that float on the smallest elevation needed to read, and `lg`/`xl` rounding.
|
|
8
|
+
* These are layered on top of the md3 blueprint defaults.
|
|
9
|
+
*/
|
|
10
|
+
export declare const fengyuDefaults: DefaultsInstance;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @infinia/plugin-ui — Codex-style Vuetify foundation for FengYu generated plugins.
|
|
3
|
+
*
|
|
4
|
+
* Public surface:
|
|
5
|
+
* - {@link createFengYuVuetify}: build a pre-configured Vuetify instance.
|
|
6
|
+
* - {@link bindFengYuEnvironment}: sync theme/locale from the host SDK.
|
|
7
|
+
* - {@link provideFengYuClient} / {@link useFengYuClient}: per-app client DI.
|
|
8
|
+
* - {@link themeName} / {@link localeName}: environment → Vuetify id helpers.
|
|
9
|
+
* - {@link fengyuCodexLight} / {@link fengyuCodexDark}: theme definitions.
|
|
10
|
+
* - {@link fengyuDefaults}: global Vuetify defaults.
|
|
11
|
+
*/
|
|
12
|
+
export { createFengYuVuetify, bindFengYuEnvironment, themeName, localeName } from './createFengYuVuetify';
|
|
13
|
+
export type { FengYuVuetifyOptions } from './createFengYuVuetify';
|
|
14
|
+
export { fengyuCodexLight, fengyuCodexDark } from './theme';
|
|
15
|
+
export { fengyuDefaults } from './defaults';
|
|
16
|
+
export { provideFengYuClient, useFengYuClient, FENGYU_CLIENT_KEY } from './client';
|
|
17
|
+
export { default as FyPluginShell } from './components/FyPluginShell.vue';
|
|
18
|
+
export type { FyNavItem } from './components/FyPluginShell.vue';
|
|
19
|
+
export { default as FyIcon } from './components/FyIcon.vue';
|
|
20
|
+
export { default as FyPageHeader } from './components/FyPageHeader.vue';
|
|
21
|
+
export { default as FyToolbar } from './components/FyToolbar.vue';
|
|
22
|
+
export { default as FyEmptyState } from './components/FyEmptyState.vue';
|
|
23
|
+
export { default as FyLoadingState } from './components/FyLoadingState.vue';
|
|
24
|
+
export { default as FyErrorState } from './components/FyErrorState.vue';
|
|
25
|
+
export { default as FyPermissionNotice } from './components/FyPermissionNotice.vue';
|
|
26
|
+
export { default as FyFilePicker } from './components/FyFilePicker.vue';
|
|
27
|
+
export { default as FyDirectoryPicker } from './components/FyDirectoryPicker.vue';
|
|
28
|
+
export { default as FyNotificationCenter } from './components/FyNotificationCenter.vue';
|
|
29
|
+
export { default as FyStepWizard } from './components/FyStepWizard.vue';
|
|
30
|
+
export { FY_WIZARD_SNAPSHOT_VERSION, FY_WIZARD_DEFAULT_LABELS, buildWizardSnapshot, createWizardStates, invalidateWizardStates, normalizeWizardSnapshot, } from './wizard';
|
|
31
|
+
export type { FyWizardSnapshot, FyWizardActionsSlotProps, FyWizardErrorSlotProps, FyWizardLabels, FyWizardLabelsInput, FyWizardSnapshotResult, FyWizardSlotActions, FyWizardStep, FyWizardStepLabelSlotProps, FyWizardStepSlotProps, FyWizardStepState, FyWizardStepStatus, FyWizardStatusLabels, FyWizardValidationResult, } from './wizard';
|
|
32
|
+
export { default as FyConfirmDialog } from './components/FyConfirmDialog.vue';
|
|
33
|
+
export { default as FyTaskTable } from './components/FyTaskTable.vue';
|
|
34
|
+
export type { FyTaskRow, FyTaskStatus } from './components/FyTaskTable.vue';
|
|
35
|
+
export { useFengYuNotify, sendFengYuNotification } from './composables/useFengYuNotify';
|
|
36
|
+
export type { FengYuClient, Environment, Theme, FileRef, FileFilter } from '@infinia/plugin-sdk';
|