@nan0web/ui 1.9.0 → 1.11.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 +97 -12
- package/package.json +54 -25
- package/src/App/Command/DepsCommand.js +3 -4
- package/src/Frame/Props.js +12 -18
- package/src/InterfaceTemplate/InterfaceTemplate.js +9 -7
- package/src/Model/index.js +86 -2
- package/src/StdIn.js +2 -6
- package/src/cli.js +1 -0
- package/src/core/Form/Form.js +8 -7
- package/src/core/Form/Message.js +1 -1
- package/src/core/GeneratorRunner.js +77 -7
- package/src/core/InputAdapter.js +3 -1
- package/src/core/Intent.js +214 -16
- package/src/core/IntentErrorModel.js +6 -1
- package/src/core/Message/Message.js +4 -7
- package/src/core/Message/OutputMessage.js +4 -9
- package/src/core/Stream.js +16 -5
- package/src/core/StreamEntry.js +20 -28
- package/src/core/index.js +2 -1
- package/src/domain/Content.js +196 -0
- package/src/domain/Document.js +17 -0
- package/src/domain/FooterModel.js +37 -19
- package/src/domain/HeaderModel.js +47 -21
- package/src/domain/HeroModel.js +24 -22
- package/src/domain/LayoutModel.js +43 -0
- package/src/domain/ModelAsApp.js +46 -0
- package/src/domain/SandboxModel.js +19 -16
- package/src/domain/app/GalleryCommand.js +53 -0
- package/src/domain/app/GalleryRenderIntent.js +77 -0
- package/src/domain/app/SnapshotAuditor.js +401 -0
- package/src/domain/app/SnapshotRunner.js +264 -0
- package/src/domain/app/UIApp.js +78 -0
- package/src/domain/components/BreadcrumbModel.js +10 -6
- package/src/domain/components/FeatureGridModel.js +62 -0
- package/src/domain/components/MarkdownModel.js +24 -0
- package/src/domain/components/ShellModel.js +243 -0
- package/src/domain/components/TableModel.js +10 -6
- package/src/domain/components/ToastModel.js +10 -6
- package/src/domain/components/index.js +3 -1
- package/src/domain/index.js +14 -4
- package/src/index.js +21 -2
- package/src/inspect.js +2 -0
- package/src/test/ScenarioAdapter.js +59 -0
- package/src/test/ScenarioTest.js +51 -0
- package/src/test/ScenarioTest.story.js +56 -0
- package/src/testing/CrashReporter.js +56 -0
- package/src/testing/GalleryGenerator.js +29 -0
- package/src/testing/LogicInspector.js +55 -0
- package/src/testing/SnapshotRunner.js +22 -0
- package/src/testing/SpecAdapter.js +115 -0
- package/src/testing/SpecRunner.js +121 -0
- package/src/testing/VisualAdapter.js +46 -0
- package/src/testing/index.js +7 -0
- package/src/testing/verifySnapshot.js +17 -0
- package/types/App/Command/DepsCommand.d.ts +0 -2
- package/types/Model/index.d.ts +56 -4
- package/types/StdIn.d.ts +3 -3
- package/types/cli.d.ts +1 -0
- package/types/core/Form/Form.d.ts +2 -2
- package/types/core/GeneratorRunner.d.ts +18 -1
- package/types/core/InputAdapter.d.ts +2 -1
- package/types/core/Intent.d.ts +232 -26
- package/types/core/IntentErrorModel.d.ts +4 -0
- package/types/core/Message/Message.d.ts +2 -2
- package/types/core/Message/OutputMessage.d.ts +0 -2
- package/types/core/index.d.ts +2 -1
- package/types/domain/Content.d.ts +340 -0
- package/types/domain/Document.d.ts +21 -0
- package/types/domain/FooterModel.d.ts +22 -12
- package/types/domain/HeaderModel.d.ts +36 -13
- package/types/domain/HeroModel.d.ts +19 -17
- package/types/domain/LayoutModel.d.ts +34 -0
- package/types/domain/ModelAsApp.d.ts +23 -0
- package/types/domain/SandboxModel.d.ts +10 -0
- package/types/domain/app/GalleryCommand.d.ts +55 -0
- package/types/domain/app/GalleryRenderIntent.d.ts +31 -0
- package/types/domain/app/SnapshotAuditor.d.ts +99 -0
- package/types/domain/app/SnapshotRunner.d.ts +45 -0
- package/types/domain/app/UIApp.d.ts +60 -0
- package/types/domain/components/BreadcrumbModel.d.ts +6 -8
- package/types/domain/components/FeatureGridModel.d.ts +50 -0
- package/types/domain/components/MarkdownModel.d.ts +19 -0
- package/types/domain/components/ShellModel.d.ts +56 -0
- package/types/domain/components/TableModel.d.ts +4 -0
- package/types/domain/components/ToastModel.d.ts +4 -0
- package/types/domain/components/index.d.ts +3 -0
- package/types/domain/index.d.ts +10 -4
- package/types/index.d.ts +19 -1
- package/types/inspect.d.ts +2 -0
- package/types/test/ScenarioAdapter.d.ts +43 -0
- package/types/test/ScenarioTest.d.ts +24 -0
- package/types/test/ScenarioTest.story.d.ts +1 -0
- package/types/testing/CrashReporter.d.ts +13 -0
- package/types/testing/GalleryGenerator.d.ts +1 -0
- package/types/testing/LogicInspector.d.ts +22 -0
- package/types/testing/SnapshotRunner.d.ts +7 -0
- package/types/testing/SpecAdapter.d.ts +57 -0
- package/types/testing/SpecRunner.d.ts +41 -0
- package/types/testing/VisualAdapter.d.ts +9 -0
- package/types/testing/index.d.ts +7 -0
- package/types/testing/verifySnapshot.d.ts +14 -0
- package/src/README.md.js +0 -436
- package/types/App/Command/Options.d.ts +0 -43
- package/types/App/Command/index.d.ts +0 -8
- package/types/App/User/Command/Options.d.ts +0 -34
- package/types/core/Message/InputMessage.d.ts +0 -71
- package/types/domain/components/HeroModel.d.ts +0 -24
- package/types/domain/components/ShowcaseAppModel.d.ts +0 -32
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/** @typedef {Partial<Message> | null} InputMessageValue */
|
|
2
|
-
/**
|
|
3
|
-
* Represents a message input with value, options, and metadata.
|
|
4
|
-
*/
|
|
5
|
-
export default class InputMessage {
|
|
6
|
-
static ESCAPE: string
|
|
7
|
-
/**
|
|
8
|
-
* Creates an InputMessage instance from the given value.
|
|
9
|
-
* @param {InputMessage|object|string} value - The value to create from
|
|
10
|
-
* @returns {InputMessage} An InputMessage instance
|
|
11
|
-
*/
|
|
12
|
-
static from(value: InputMessage | object | string): InputMessage
|
|
13
|
-
/**
|
|
14
|
-
* Creates a new InputMessage instance.
|
|
15
|
-
* @param {object} props - Input message properties
|
|
16
|
-
* @param {InputMessageValue} [props.value=null] - Input value
|
|
17
|
-
* @param {string[]|string} [props.options=[]] - Available options
|
|
18
|
-
* @param {boolean} [props.waiting=false] - Waiting state flag
|
|
19
|
-
* @param {boolean} [props.escaped=false] - Sets value to escape when true
|
|
20
|
-
*/
|
|
21
|
-
constructor(props?: {
|
|
22
|
-
value?: InputMessageValue | undefined
|
|
23
|
-
options?: string | string[] | undefined
|
|
24
|
-
waiting?: boolean | undefined
|
|
25
|
-
escaped?: boolean | undefined
|
|
26
|
-
})
|
|
27
|
-
/** @type {Message} Input value */
|
|
28
|
-
value: Message
|
|
29
|
-
/** @type {string[]} Available options for this input */
|
|
30
|
-
options: string[]
|
|
31
|
-
/** @type {boolean} Whether this input is waiting for response */
|
|
32
|
-
waiting: boolean
|
|
33
|
-
/**
|
|
34
|
-
* Checks if the input value is empty.
|
|
35
|
-
* @returns {boolean} True if value is empty or null, false otherwise
|
|
36
|
-
*/
|
|
37
|
-
get empty(): boolean
|
|
38
|
-
/**
|
|
39
|
-
* Gets the timestamp when input was created.
|
|
40
|
-
* @returns {number} Creation timestamp
|
|
41
|
-
*/
|
|
42
|
-
get time(): number
|
|
43
|
-
/**
|
|
44
|
-
* Returns the escape value.
|
|
45
|
-
* @returns {string}
|
|
46
|
-
*/
|
|
47
|
-
get ESCAPE(): string
|
|
48
|
-
/**
|
|
49
|
-
* Checks if the input is an escape sequence.
|
|
50
|
-
* @returns {boolean} True if input value is escape sequence, false otherwise
|
|
51
|
-
*/
|
|
52
|
-
get escaped(): boolean
|
|
53
|
-
/**
|
|
54
|
-
* Validates if the input has a non-empty value.
|
|
55
|
-
* @returns {boolean} True if input is valid, false otherwise
|
|
56
|
-
*/
|
|
57
|
-
get isValid(): boolean
|
|
58
|
-
/**
|
|
59
|
-
* Converts the input to a plain object representation.
|
|
60
|
-
* @returns {object} Object with all properties including timestamp
|
|
61
|
-
*/
|
|
62
|
-
toObject(): object
|
|
63
|
-
/**
|
|
64
|
-
* Converts the input to a string representation including timestamp.
|
|
65
|
-
* @returns {string} String representation with timestamp and value
|
|
66
|
-
*/
|
|
67
|
-
toString(): string
|
|
68
|
-
#private
|
|
69
|
-
}
|
|
70
|
-
export type InputMessageValue = Partial<Message> | null
|
|
71
|
-
import { Message } from '@nan0web/co'
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HeroModel — OLMUI Model-as-Schema
|
|
3
|
-
* Main landing page banner with a big heading, description, and primary CTA.
|
|
4
|
-
*/
|
|
5
|
-
export class HeroModel extends Model {
|
|
6
|
-
static $id: string;
|
|
7
|
-
static title: {
|
|
8
|
-
help: string;
|
|
9
|
-
placeholder: string;
|
|
10
|
-
default: string;
|
|
11
|
-
required: boolean;
|
|
12
|
-
};
|
|
13
|
-
static description: {
|
|
14
|
-
help: string;
|
|
15
|
-
placeholder: string;
|
|
16
|
-
default: string;
|
|
17
|
-
};
|
|
18
|
-
static actions: {
|
|
19
|
-
help: string;
|
|
20
|
-
type: string;
|
|
21
|
-
default: never[];
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
import { Model } from '@nan0web/core';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ShowcaseAppModel — OLMUI Model-as-Schema
|
|
3
|
-
* A container model representing the entire UI library showcase.
|
|
4
|
-
* @property {string} title - App title
|
|
5
|
-
* @property {any[]} sections - Collection of UI sections
|
|
6
|
-
*/
|
|
7
|
-
export class ShowcaseAppModel extends Model {
|
|
8
|
-
static $id: string;
|
|
9
|
-
static title: {
|
|
10
|
-
help: string;
|
|
11
|
-
default: string;
|
|
12
|
-
};
|
|
13
|
-
static sections: {
|
|
14
|
-
help: string;
|
|
15
|
-
type: string;
|
|
16
|
-
default: never[];
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* OLMUI Generator — drives the showcase rendering.
|
|
20
|
-
*/
|
|
21
|
-
run(): AsyncGenerator<{
|
|
22
|
-
type: string;
|
|
23
|
-
message: any;
|
|
24
|
-
component: string;
|
|
25
|
-
}, {
|
|
26
|
-
type: string;
|
|
27
|
-
data: {
|
|
28
|
-
success: boolean;
|
|
29
|
-
};
|
|
30
|
-
}, unknown>;
|
|
31
|
-
}
|
|
32
|
-
import { Model } from '@nan0web/core';
|