@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.
Files changed (108) hide show
  1. package/README.md +97 -12
  2. package/package.json +54 -25
  3. package/src/App/Command/DepsCommand.js +3 -4
  4. package/src/Frame/Props.js +12 -18
  5. package/src/InterfaceTemplate/InterfaceTemplate.js +9 -7
  6. package/src/Model/index.js +86 -2
  7. package/src/StdIn.js +2 -6
  8. package/src/cli.js +1 -0
  9. package/src/core/Form/Form.js +8 -7
  10. package/src/core/Form/Message.js +1 -1
  11. package/src/core/GeneratorRunner.js +77 -7
  12. package/src/core/InputAdapter.js +3 -1
  13. package/src/core/Intent.js +214 -16
  14. package/src/core/IntentErrorModel.js +6 -1
  15. package/src/core/Message/Message.js +4 -7
  16. package/src/core/Message/OutputMessage.js +4 -9
  17. package/src/core/Stream.js +16 -5
  18. package/src/core/StreamEntry.js +20 -28
  19. package/src/core/index.js +2 -1
  20. package/src/domain/Content.js +196 -0
  21. package/src/domain/Document.js +17 -0
  22. package/src/domain/FooterModel.js +37 -19
  23. package/src/domain/HeaderModel.js +47 -21
  24. package/src/domain/HeroModel.js +24 -22
  25. package/src/domain/LayoutModel.js +43 -0
  26. package/src/domain/ModelAsApp.js +46 -0
  27. package/src/domain/SandboxModel.js +19 -16
  28. package/src/domain/app/GalleryCommand.js +53 -0
  29. package/src/domain/app/GalleryRenderIntent.js +77 -0
  30. package/src/domain/app/SnapshotAuditor.js +401 -0
  31. package/src/domain/app/SnapshotRunner.js +264 -0
  32. package/src/domain/app/UIApp.js +78 -0
  33. package/src/domain/components/BreadcrumbModel.js +10 -6
  34. package/src/domain/components/FeatureGridModel.js +62 -0
  35. package/src/domain/components/MarkdownModel.js +24 -0
  36. package/src/domain/components/ShellModel.js +243 -0
  37. package/src/domain/components/TableModel.js +10 -6
  38. package/src/domain/components/ToastModel.js +10 -6
  39. package/src/domain/components/index.js +3 -1
  40. package/src/domain/index.js +14 -4
  41. package/src/index.js +21 -2
  42. package/src/inspect.js +2 -0
  43. package/src/test/ScenarioAdapter.js +59 -0
  44. package/src/test/ScenarioTest.js +51 -0
  45. package/src/test/ScenarioTest.story.js +56 -0
  46. package/src/testing/CrashReporter.js +56 -0
  47. package/src/testing/GalleryGenerator.js +29 -0
  48. package/src/testing/LogicInspector.js +55 -0
  49. package/src/testing/SnapshotRunner.js +22 -0
  50. package/src/testing/SpecAdapter.js +115 -0
  51. package/src/testing/SpecRunner.js +121 -0
  52. package/src/testing/VisualAdapter.js +46 -0
  53. package/src/testing/index.js +7 -0
  54. package/src/testing/verifySnapshot.js +17 -0
  55. package/types/App/Command/DepsCommand.d.ts +0 -2
  56. package/types/Model/index.d.ts +56 -4
  57. package/types/StdIn.d.ts +3 -3
  58. package/types/cli.d.ts +1 -0
  59. package/types/core/Form/Form.d.ts +2 -2
  60. package/types/core/GeneratorRunner.d.ts +18 -1
  61. package/types/core/InputAdapter.d.ts +2 -1
  62. package/types/core/Intent.d.ts +232 -26
  63. package/types/core/IntentErrorModel.d.ts +4 -0
  64. package/types/core/Message/Message.d.ts +2 -2
  65. package/types/core/Message/OutputMessage.d.ts +0 -2
  66. package/types/core/index.d.ts +2 -1
  67. package/types/domain/Content.d.ts +340 -0
  68. package/types/domain/Document.d.ts +21 -0
  69. package/types/domain/FooterModel.d.ts +22 -12
  70. package/types/domain/HeaderModel.d.ts +36 -13
  71. package/types/domain/HeroModel.d.ts +19 -17
  72. package/types/domain/LayoutModel.d.ts +34 -0
  73. package/types/domain/ModelAsApp.d.ts +23 -0
  74. package/types/domain/SandboxModel.d.ts +10 -0
  75. package/types/domain/app/GalleryCommand.d.ts +55 -0
  76. package/types/domain/app/GalleryRenderIntent.d.ts +31 -0
  77. package/types/domain/app/SnapshotAuditor.d.ts +99 -0
  78. package/types/domain/app/SnapshotRunner.d.ts +45 -0
  79. package/types/domain/app/UIApp.d.ts +60 -0
  80. package/types/domain/components/BreadcrumbModel.d.ts +6 -8
  81. package/types/domain/components/FeatureGridModel.d.ts +50 -0
  82. package/types/domain/components/MarkdownModel.d.ts +19 -0
  83. package/types/domain/components/ShellModel.d.ts +56 -0
  84. package/types/domain/components/TableModel.d.ts +4 -0
  85. package/types/domain/components/ToastModel.d.ts +4 -0
  86. package/types/domain/components/index.d.ts +3 -0
  87. package/types/domain/index.d.ts +10 -4
  88. package/types/index.d.ts +19 -1
  89. package/types/inspect.d.ts +2 -0
  90. package/types/test/ScenarioAdapter.d.ts +43 -0
  91. package/types/test/ScenarioTest.d.ts +24 -0
  92. package/types/test/ScenarioTest.story.d.ts +1 -0
  93. package/types/testing/CrashReporter.d.ts +13 -0
  94. package/types/testing/GalleryGenerator.d.ts +1 -0
  95. package/types/testing/LogicInspector.d.ts +22 -0
  96. package/types/testing/SnapshotRunner.d.ts +7 -0
  97. package/types/testing/SpecAdapter.d.ts +57 -0
  98. package/types/testing/SpecRunner.d.ts +41 -0
  99. package/types/testing/VisualAdapter.d.ts +9 -0
  100. package/types/testing/index.d.ts +7 -0
  101. package/types/testing/verifySnapshot.d.ts +14 -0
  102. package/src/README.md.js +0 -436
  103. package/types/App/Command/Options.d.ts +0 -43
  104. package/types/App/Command/index.d.ts +0 -8
  105. package/types/App/User/Command/Options.d.ts +0 -34
  106. package/types/core/Message/InputMessage.d.ts +0 -71
  107. package/types/domain/components/HeroModel.d.ts +0 -24
  108. 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';