@nan0web/ui 1.12.2 → 3.1.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/README.md +18 -355
- package/package.json +36 -22
- package/src/Component/index.js +1 -5
- package/src/Model/Element.js +183 -0
- package/src/Model/index.js +2 -2
- package/src/Theme/AppTheme.js +19 -0
- package/src/Theme/CustomTheme.js +32 -0
- package/src/Theme/DarkLightTheme.js +34 -0
- package/src/Theme/Theme.js +25 -0
- package/src/Theme/atoms/Avatar.js +20 -0
- package/src/Theme/atoms/Badge.js +28 -0
- package/src/Theme/atoms/Button.js +88 -0
- package/src/Theme/atoms/Checkbox.js +26 -0
- package/src/Theme/atoms/Input.js +28 -0
- package/src/Theme/atoms/Radio.js +26 -0
- package/src/Theme/atoms/Select.js +16 -0
- package/src/Theme/atoms/TextArea.js +17 -0
- package/src/Theme/atoms/Typography.js +26 -0
- package/src/Theme/atoms/index.js +11 -0
- package/src/Theme/createTheme.js +22 -0
- package/src/Theme/index.js +20 -0
- package/src/Theme/molecules/Card.js +24 -0
- package/src/Theme/molecules/index.js +3 -0
- package/src/Theme/organisms/Modal.js +24 -0
- package/src/Theme/organisms/index.js +3 -0
- package/src/Theme/presets/HighContrastTheme.js +65 -0
- package/src/Theme/presets/NightTheme.js +66 -0
- package/src/Theme/presets/index.js +4 -0
- package/src/Theme/tokens.js +115 -0
- package/src/core/InputAdapter.js +1 -2
- package/src/core/Intent.js +22 -8
- package/src/core/Message/Message.js +3 -0
- package/src/core/OutputAdapter.js +9 -13
- package/src/core/index.js +7 -4
- package/src/core/resolvePositionalArgs.js +51 -0
- package/src/domain/Content.js +5 -5
- package/src/domain/Document.js +1 -1
- package/src/domain/HeroModel.js +1 -1
- package/src/domain/ModelAsApp.js +310 -20
- package/src/domain/ModelAsApp.story.js +117 -0
- package/src/domain/app/GalleryCommand.js +9 -8
- package/src/domain/app/{GalleryRenderIntent.js → GalleryRenderCommand.js} +20 -20
- package/src/domain/app/IntentAuditor.js +53 -0
- package/src/domain/app/JsIntentAuditor.js +145 -0
- package/src/domain/app/PyIntentAuditor.js +144 -0
- package/src/domain/app/SnapshotAuditor.js +82 -86
- package/src/domain/app/SnapshotRunner.js +1 -1
- package/src/domain/app/UIApp.js +12 -21
- package/src/domain/components/ShellModel.js +2 -2
- package/src/index.js +38 -10
- package/src/inspect.js +4 -0
- package/src/testing/SnapshotRunner.js +2 -1
- package/src/utils/format.js +21 -0
- package/src/utils/processI18n.js +27 -0
- package/src/utils/resolveContext.js +79 -0
- package/types/Component/index.d.ts +1 -5
- package/types/Model/Element.d.ts +87 -0
- package/types/Model/index.d.ts +2 -2
- package/types/Theme/AppTheme.d.ts +14 -0
- package/types/Theme/CustomTheme.d.ts +21 -0
- package/types/Theme/DarkLightTheme.d.ts +16 -0
- package/types/Theme/Theme.d.ts +18 -0
- package/types/Theme/atoms/Avatar.d.ts +14 -0
- package/types/Theme/atoms/Badge.d.ts +22 -0
- package/types/Theme/atoms/Button.d.ts +144 -0
- package/types/Theme/atoms/Checkbox.d.ts +20 -0
- package/types/Theme/atoms/Input.d.ts +22 -0
- package/types/Theme/atoms/Radio.d.ts +20 -0
- package/types/Theme/atoms/Select.d.ts +15 -0
- package/types/Theme/atoms/TextArea.d.ts +17 -0
- package/types/Theme/atoms/Typography.d.ts +47 -0
- package/types/Theme/atoms/index.d.ts +10 -0
- package/types/Theme/createTheme.d.ts +7 -0
- package/types/Theme/index.d.ts +10 -0
- package/types/Theme/molecules/Card.d.ts +18 -0
- package/types/Theme/molecules/index.d.ts +2 -0
- package/types/Theme/organisms/Modal.d.ts +18 -0
- package/types/Theme/organisms/index.d.ts +2 -0
- package/types/Theme/presets/HighContrastTheme.d.ts +2 -0
- package/types/Theme/presets/NightTheme.d.ts +2 -0
- package/types/Theme/presets/index.d.ts +3 -0
- package/types/Theme/tokens.d.ts +119 -0
- package/types/core/Intent.d.ts +10 -7
- package/types/core/Message/Message.d.ts +3 -0
- package/types/core/OutputAdapter.d.ts +2 -4
- package/types/core/index.d.ts +5 -2
- package/types/core/resolvePositionalArgs.d.ts +24 -0
- package/types/docs/README.md.d.ts +1 -0
- package/types/domain/Content.d.ts +2 -2
- package/types/domain/Document.d.ts +4 -3
- package/types/domain/FooterModel.d.ts +2 -1
- package/types/domain/HeroModel.d.ts +2 -2
- package/types/domain/ModelAsApp.d.ts +49 -5
- package/types/domain/ModelAsApp.story.d.ts +1 -0
- package/types/domain/app/GalleryCommand.d.ts +6 -37
- package/types/domain/app/GalleryRenderCommand.d.ts +27 -0
- package/types/domain/app/IntentAuditor.d.ts +23 -0
- package/types/domain/app/JsIntentAuditor.d.ts +22 -0
- package/types/domain/app/PyIntentAuditor.d.ts +22 -0
- package/types/domain/app/SnapshotAuditor.d.ts +34 -25
- package/types/domain/app/SnapshotRunner.d.ts +2 -2
- package/types/domain/app/UIApp.d.ts +14 -11
- package/types/domain/components/ShellModel.d.ts +1 -5
- package/types/index.d.ts +10 -10
- package/types/inspect.d.ts +4 -0
- package/types/testing/verifySnapshot.d.ts +1 -1
- package/types/utils/format.d.ts +5 -0
- package/types/utils/processI18n.d.ts +8 -0
- package/types/utils/resolveContext.d.ts +21 -0
- package/src/App/Command/DepsCommand.js +0 -24
- package/src/App/Core/CoreApp.js +0 -125
- package/src/App/Core/UI.js +0 -63
- package/src/App/Core/Widget.js +0 -61
- package/src/App/Core/index.js +0 -11
- package/src/App/Scenario.js +0 -45
- package/src/App/User/Command/Message.js +0 -3
- package/src/App/User/Command/index.js +0 -5
- package/src/App/User/UserApp.js +0 -85
- package/src/App/User/UserUI.js +0 -20
- package/src/App/User/index.js +0 -9
- package/src/App/index.js +0 -14
- package/src/Component/Process/Input.js +0 -63
- package/src/Component/Process/Process.js +0 -24
- package/src/Component/Process/index.js +0 -5
- package/src/Component/Welcome/Input.js +0 -48
- package/src/Component/Welcome/Welcome.js +0 -22
- package/src/Component/Welcome/index.js +0 -5
- package/src/Frame/Frame.js +0 -608
- package/src/Frame/Props.js +0 -96
- package/src/StdIn.js +0 -100
- package/src/StdOut.js +0 -95
- package/src/View/RenderOptions.js +0 -48
- package/src/View/View.js +0 -306
- package/src/core/Message/index.js +0 -6
- package/types/App/Command/DepsCommand.d.ts +0 -14
- package/types/App/Core/CoreApp.d.ts +0 -70
- package/types/App/Core/UI.d.ts +0 -38
- package/types/App/Core/Widget.d.ts +0 -39
- package/types/App/Core/index.d.ts +0 -10
- package/types/App/Scenario.d.ts +0 -26
- package/types/App/User/Command/Message.d.ts +0 -2
- package/types/App/User/Command/index.d.ts +0 -3
- package/types/App/User/UserApp.d.ts +0 -41
- package/types/App/User/UserUI.d.ts +0 -9
- package/types/App/User/index.d.ts +0 -8
- package/types/App/index.d.ts +0 -12
- package/types/Component/Process/Input.d.ts +0 -48
- package/types/Component/Process/Process.d.ts +0 -13
- package/types/Component/Process/index.d.ts +0 -4
- package/types/Component/Welcome/Input.d.ts +0 -34
- package/types/Component/Welcome/Welcome.d.ts +0 -13
- package/types/Component/Welcome/index.d.ts +0 -4
- package/types/Frame/Frame.d.ts +0 -186
- package/types/Frame/Props.d.ts +0 -77
- package/types/StdIn.d.ts +0 -62
- package/types/StdOut.d.ts +0 -52
- package/types/View/RenderOptions.d.ts +0 -29
- package/types/View/View.d.ts +0 -124
- package/types/core/Message/index.d.ts +0 -4
- package/types/domain/app/GalleryRenderIntent.d.ts +0 -31
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export default RenderOptions;
|
|
2
|
-
declare class RenderOptions {
|
|
3
|
-
static DEFAULTS: {
|
|
4
|
-
resizeToView: boolean;
|
|
5
|
-
translateFrame: boolean;
|
|
6
|
-
render: boolean;
|
|
7
|
-
renderMethod: string;
|
|
8
|
-
};
|
|
9
|
-
static from(props?: {}): RenderOptions;
|
|
10
|
-
constructor(props?: {});
|
|
11
|
-
/** @type {boolean} [false] */
|
|
12
|
-
resizeToView: boolean;
|
|
13
|
-
/** @type {boolean} [false] */
|
|
14
|
-
translateFrame: boolean;
|
|
15
|
-
/** @type {boolean} [true] */
|
|
16
|
-
render: boolean;
|
|
17
|
-
/** @type {string} */
|
|
18
|
-
renderMethod: string;
|
|
19
|
-
/** @type {number} */
|
|
20
|
-
width: number;
|
|
21
|
-
/** @type {number} */
|
|
22
|
-
height: number;
|
|
23
|
-
get DEFAULTS(): {
|
|
24
|
-
resizeToView: boolean;
|
|
25
|
-
translateFrame: boolean;
|
|
26
|
-
render: boolean;
|
|
27
|
-
renderMethod: string;
|
|
28
|
-
};
|
|
29
|
-
}
|
package/types/View/View.d.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Object} ComponentFn
|
|
3
|
-
* @property {string} name
|
|
4
|
-
* @property {(input: UiMessage) => Promise<any>} ask
|
|
5
|
-
* @property {Function} bind
|
|
6
|
-
*/
|
|
7
|
-
export default class View {
|
|
8
|
-
/** @type {typeof RenderOptions} */
|
|
9
|
-
static RenderOptions: typeof RenderOptions;
|
|
10
|
-
/** @type {typeof FrameRenderMethod} */
|
|
11
|
-
static RenderMethod: typeof FrameRenderMethod;
|
|
12
|
-
/**
|
|
13
|
-
* @param {Frame} frame
|
|
14
|
-
* @param {RenderOptions} [options]
|
|
15
|
-
* @returns {Frame}
|
|
16
|
-
*/
|
|
17
|
-
static fixFrame(frame: Frame, options?: RenderOptions): Frame;
|
|
18
|
-
/**
|
|
19
|
-
* @param {object} [input]
|
|
20
|
-
* @param {StdIn} [input.stdin]
|
|
21
|
-
* @param {StdOut} [input.stdout]
|
|
22
|
-
* @param {number} [input.startedAt]
|
|
23
|
-
* @param {Frame} [input.frame]
|
|
24
|
-
* @param {Locale} [input.locale]
|
|
25
|
-
* @param {Map<string, string>} [input.vocab]
|
|
26
|
-
* @param {number[]} [input.windowSize]
|
|
27
|
-
* @param {Map<string, ComponentFn>} [input.components]
|
|
28
|
-
* @param {string} [input.renderMethod]
|
|
29
|
-
*/
|
|
30
|
-
constructor(input?: {
|
|
31
|
-
stdin?: StdIn | undefined;
|
|
32
|
-
stdout?: StdOut | undefined;
|
|
33
|
-
startedAt?: number | undefined;
|
|
34
|
-
frame?: Frame | undefined;
|
|
35
|
-
locale?: Locale | undefined;
|
|
36
|
-
vocab?: Map<string, string> | undefined;
|
|
37
|
-
windowSize?: number[] | undefined;
|
|
38
|
-
components?: Map<string, ComponentFn> | undefined;
|
|
39
|
-
renderMethod?: string | undefined;
|
|
40
|
-
});
|
|
41
|
-
/** @type {StdIn} */
|
|
42
|
-
stdin: StdIn;
|
|
43
|
-
/** @type {StdOut} */
|
|
44
|
-
stdout: StdOut;
|
|
45
|
-
/** @type {number} */
|
|
46
|
-
startedAt: number;
|
|
47
|
-
/** @type {Frame} */
|
|
48
|
-
frame: Frame;
|
|
49
|
-
/** @type {Locale} */
|
|
50
|
-
locale: Locale;
|
|
51
|
-
/** @type {Map<string, string>} */
|
|
52
|
-
vocab: Map<string, string>;
|
|
53
|
-
/** @type {number[]} */
|
|
54
|
-
windowSize: number[];
|
|
55
|
-
/** @type {Map<string, ComponentFn>} */
|
|
56
|
-
components: Map<string, ComponentFn>;
|
|
57
|
-
/** @type {string} */
|
|
58
|
-
renderMethod: string;
|
|
59
|
-
get empty(): boolean;
|
|
60
|
-
get RenderMethod(): typeof FrameRenderMethod;
|
|
61
|
-
get RenderOptions(): typeof RenderOptions;
|
|
62
|
-
getWindowSize(): number[];
|
|
63
|
-
/**
|
|
64
|
-
* @param {number} width
|
|
65
|
-
* @param {number} height
|
|
66
|
-
*/
|
|
67
|
-
setWindowSize(width: number, height: number): void;
|
|
68
|
-
startTimer(): void;
|
|
69
|
-
spent(checkpoint?: number): number;
|
|
70
|
-
/**
|
|
71
|
-
* @param {boolean | number | Function | ComponentFn} [shouldRender=0]
|
|
72
|
-
* @param {RenderOptions} [options]
|
|
73
|
-
* @returns {(value: Frame|string|string[], ...args: any) => Frame}
|
|
74
|
-
*/
|
|
75
|
-
render(shouldRender?: boolean | number | Function | ComponentFn, options?: RenderOptions): (value: Frame | string | string[], ...args: any) => Frame;
|
|
76
|
-
clear(shouldRender?: number): Frame;
|
|
77
|
-
progress(shouldRender?: boolean): (value: any) => Frame;
|
|
78
|
-
/** @param {any} value */
|
|
79
|
-
t(value: any): any;
|
|
80
|
-
/** @param {any[]} args */
|
|
81
|
-
debug(...args: any[]): Frame;
|
|
82
|
-
/** @param {any[]} args */
|
|
83
|
-
info(...args: any[]): Frame;
|
|
84
|
-
/** @param {any[]} args */
|
|
85
|
-
warn(...args: any[]): Frame;
|
|
86
|
-
/** @param {any[]} args */
|
|
87
|
-
error(...args: any[]): Frame;
|
|
88
|
-
/**
|
|
89
|
-
* @param {string} name
|
|
90
|
-
* @param {ComponentFn} component
|
|
91
|
-
*/
|
|
92
|
-
register(name: string, component: ComponentFn): void;
|
|
93
|
-
/**
|
|
94
|
-
* @param {string} name
|
|
95
|
-
*/
|
|
96
|
-
unregister(name: string): void;
|
|
97
|
-
/**
|
|
98
|
-
* @param {string} name
|
|
99
|
-
* @returns {boolean}
|
|
100
|
-
*/
|
|
101
|
-
has(name: string): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* @param {string} name
|
|
104
|
-
* @returns {ComponentFn | undefined}
|
|
105
|
-
*/
|
|
106
|
-
get(name: string): ComponentFn | undefined;
|
|
107
|
-
/**
|
|
108
|
-
* @param {UiMessage} input
|
|
109
|
-
* @returns {Promise<UiMessage | null>}
|
|
110
|
-
*/
|
|
111
|
-
ask(input: UiMessage): Promise<UiMessage | null>;
|
|
112
|
-
}
|
|
113
|
-
export type ComponentFn = {
|
|
114
|
-
name: string;
|
|
115
|
-
ask: (input: UiMessage) => Promise<any>;
|
|
116
|
-
bind: Function;
|
|
117
|
-
};
|
|
118
|
-
import StdIn from '../StdIn.js';
|
|
119
|
-
import StdOut from '../StdOut.js';
|
|
120
|
-
import Frame from '../Frame/Frame.js';
|
|
121
|
-
import Locale from '../Locale.js';
|
|
122
|
-
import { FrameRenderMethod } from '../Frame/Frame.js';
|
|
123
|
-
import RenderOptions from './RenderOptions.js';
|
|
124
|
-
import UiMessage from '../core/Message/Message.js';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export class GalleryRenderIntent extends Model {
|
|
2
|
-
static alias: string;
|
|
3
|
-
static UI: {
|
|
4
|
-
rendering: string;
|
|
5
|
-
success: string;
|
|
6
|
-
failed: string;
|
|
7
|
-
};
|
|
8
|
-
static dataDir: {
|
|
9
|
-
type: string;
|
|
10
|
-
default: string;
|
|
11
|
-
help: string;
|
|
12
|
-
};
|
|
13
|
-
static dir: {
|
|
14
|
-
type: string;
|
|
15
|
-
default: string;
|
|
16
|
-
help: string;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
* @param {Partial<GalleryRenderIntent> | Record<string, any>} [data={}]
|
|
21
|
-
|
|
22
|
-
* @param {import('@nan0web/types').ModelOptions} [options={}]
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
constructor(data?: Partial<GalleryRenderIntent> | Record<string, any>, options?: import("@nan0web/types").ModelOptions);
|
|
26
|
-
/** @type {string} */ dataDir: string;
|
|
27
|
-
/** @type {string} */ dir: string;
|
|
28
|
-
run(): AsyncGenerator<import("../../core/Intent.js").ShowIntent, import("../../core/Intent.js").ResultIntent | undefined, unknown>;
|
|
29
|
-
}
|
|
30
|
-
export default GalleryRenderIntent;
|
|
31
|
-
import { Model } from '@nan0web/types';
|