@iyulab/chat-components 0.6.0 → 0.7.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/CHANGELOG.md +40 -0
- package/README.md +15 -39
- package/dist/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.138.0/helpers/esm}/decorate.js +2 -2
- package/dist/_virtual/{_@oxc-project_runtime@0.130.0/helpers → _@oxc-project_runtime@0.138.0/helpers/esm}/decorateMetadata.js +2 -2
- package/dist/_virtual/_glob-assets_raw/alert-triangle-fill.svg.4cfc4305.js +4 -0
- package/dist/_virtual/_glob-assets_raw/arrows-sort.svg.dda43a85.js +4 -0
- package/dist/_virtual/_glob-assets_raw/code.svg.c69bc144.js +4 -0
- package/dist/_virtual/_glob-assets_raw/download.svg.bce82177.js +4 -0
- package/dist/_virtual/_glob-assets_raw/element-prompt.md.7047ffcc.js +4 -0
- package/dist/_virtual/_glob-assets_raw/external-link.svg.a9f7f02d.js +4 -0
- package/dist/_virtual/_glob-assets_raw/file-code.svg.0e706f93.js +4 -0
- package/dist/_virtual/_glob-assets_raw/file-music.svg.b9970203.js +4 -0
- package/dist/_virtual/_glob-assets_raw/file-spreadsheet.svg.8c03bdfa.js +4 -0
- package/dist/_virtual/_glob-assets_raw/file-text.svg.85bdd923.js +4 -0
- package/dist/_virtual/_glob-assets_raw/file-type-pdf.svg.bc12db6d.js +4 -0
- package/dist/_virtual/_glob-assets_raw/file-zip.svg.76dde660.js +4 -0
- package/dist/_virtual/_glob-assets_raw/file.svg.28f5d6f1.js +4 -0
- package/dist/_virtual/_glob-assets_raw/photo.svg.cc273cc1.js +4 -0
- package/dist/_virtual/_glob-assets_raw/player-stop-fill.svg.5378b752.js +4 -0
- package/dist/_virtual/_glob-assets_raw/send.svg.02326253.js +4 -0
- package/dist/_virtual/_glob-assets_raw/sort-ascending-letters.svg.14a3df67.js +4 -0
- package/dist/_virtual/_glob-assets_raw/sort-descending-letters.svg.3e03647c.js +4 -0
- package/dist/_virtual/_glob-assets_raw/video.svg.c183f03c.js +4 -0
- package/dist/_virtual/_glob-assets_raw/world.svg.cd9903c8.js +4 -0
- package/dist/components/UDataElement.d.ts +44 -0
- package/dist/components/UDataElement.js +76 -0
- package/dist/components/blocks/UCodeBlock.d.ts +0 -4
- package/dist/components/blocks/UCodeBlock.js +6 -12
- package/dist/components/{views/UView.d.ts → blocks/UElementBlock.d.ts} +18 -8
- package/dist/components/{views/UView.js → blocks/UElementBlock.js} +31 -21
- package/dist/components/{views/UView.styles.js → blocks/UElementBlock.styles.js} +1 -1
- package/dist/components/blocks/UFileBlock.d.ts +15 -5
- package/dist/components/blocks/UFileBlock.js +81 -68
- package/dist/components/blocks/UFileBlock.styles.js +86 -29
- package/dist/components/blocks/UMarkedBlock.d.ts +3 -1
- package/dist/components/blocks/UMarkedBlock.js +23 -18
- package/dist/components/blocks/URefBlock.js +2 -2
- package/dist/components/blocks/UTableBlock.d.ts +2 -2
- package/dist/components/blocks/UTableBlock.js +9 -8
- package/dist/components/blocks/UTableBlock.styles.js +1 -1
- package/dist/components/blocks/UTextBlock.d.ts +2 -0
- package/dist/components/blocks/UTextBlock.js +4 -5
- package/dist/components/message/UMessage.js +2 -2
- package/dist/components/prompt/UPrompt.d.ts +0 -5
- package/dist/components/prompt/UPrompt.js +18 -27
- package/dist/components/prompt/UPrompt.styles.js +9 -10
- package/dist/components/references/URefCard.d.ts +2 -2
- package/dist/components/references/URefCard.js +8 -7
- package/dist/components/references/URefCardGroup.js +2 -2
- package/dist/components/references/URefTag.js +5 -4
- package/dist/{components/views/UChartView.d.ts → components-extra/UChartBlock.d.ts} +4 -4
- package/dist/{components/views/UChartView.js → components-extra/UChartBlock.js} +22 -34
- package/dist/components-extra/UChartBlock.schema.d.ts +3 -0
- package/dist/components-extra/UChartBlock.schema.js +34 -0
- package/dist/{components/views/UChartView.styles.js → components-extra/UChartBlock.styles.js} +1 -1
- package/dist/{components/views/UImagesView.d.ts → components-extra/UImagesBlock.d.ts} +4 -4
- package/dist/{components/views/UImagesView.js → components-extra/UImagesBlock.js} +15 -15
- package/dist/components-extra/UImagesBlock.schema.d.ts +3 -0
- package/dist/components-extra/UImagesBlock.schema.js +31 -0
- package/dist/{components/views/UImagesView.styles.js → components-extra/UImagesBlock.styles.js} +5 -5
- package/dist/{components/views/UMapView.d.ts → components-extra/UMapBlock.d.ts} +4 -4
- package/dist/{components/views/UMapView.js → components-extra/UMapBlock.js} +18 -18
- package/dist/components-extra/UMapBlock.schema.d.ts +3 -0
- package/dist/components-extra/UMapBlock.schema.js +33 -0
- package/dist/{components/views/UMapView.styles.js → components-extra/UMapBlock.styles.js} +1 -1
- package/dist/{components/views/UVideoView.d.ts → components-extra/UVideoBlock.d.ts} +4 -4
- package/dist/{components/views/UVideoView.js → components-extra/UVideoBlock.js} +10 -10
- package/dist/components-extra/UVideoBlock.schema.d.ts +3 -0
- package/dist/components-extra/UVideoBlock.schema.js +28 -0
- package/dist/{components/views/UVideoView.styles.js → components-extra/UVideoBlock.styles.js} +1 -1
- package/dist/events/SendEvent.d.ts +0 -5
- package/dist/events/StopEvent.d.ts +0 -5
- package/dist/extra.d.ts +6 -0
- package/dist/extra.js +14 -0
- package/dist/index.d.ts +5 -17
- package/dist/index.js +6 -16
- package/dist/react/UCodeBlock.js +2 -2
- package/dist/react/UElementBlock.d.ts +9 -0
- package/dist/react/UElementBlock.js +10 -0
- package/dist/react/UFileBlock.js +2 -2
- package/dist/react/UImagesBlock.d.ts +9 -0
- package/dist/react/UImagesBlock.js +10 -0
- package/dist/react/UMapBlock.d.ts +9 -0
- package/dist/react/UMapBlock.js +10 -0
- package/dist/react/UMarkedBlock.js +2 -2
- package/dist/react/UMessage.js +2 -2
- package/dist/react/UPrompt.js +2 -2
- package/dist/react/URefBlock.js +2 -2
- package/dist/react/URefCard.js +2 -2
- package/dist/react/URefCardGroup.js +2 -2
- package/dist/react/URefTag.js +2 -2
- package/dist/react/UTableBlock.js +2 -2
- package/dist/react/UTextBlock.d.ts +1 -0
- package/dist/react/UTextBlock.js +5 -3
- package/dist/react/UVideoBlock.d.ts +9 -0
- package/dist/react/UVideoBlock.js +10 -0
- package/dist/react/index.d.ts +4 -11
- package/dist/react/index.js +4 -11
- package/dist/types/BlockItem.d.ts +1 -24
- package/dist/types/{JsonSchema.d.ts → Schema.d.ts} +13 -0
- package/dist/utilities/HtmlBuilder.d.ts +28 -0
- package/dist/utilities/HtmlBuilder.js +41 -0
- package/dist/utilities/PromptBuilder.d.ts +21 -0
- package/dist/utilities/PromptBuilder.js +60 -0
- package/dist/utilities/icons.d.ts +1 -0
- package/dist/utilities/icons.js +52 -0
- package/dist/utilities/sanitizers.d.ts +35 -0
- package/dist/utilities/sanitizers.js +75 -0
- package/package.json +13 -18
- package/skills/iyulab-chat-components/SKILL.md +18 -33
- package/skills/iyulab-chat-components/references/components/{chart-view.md → chart-block.md} +16 -12
- package/skills/iyulab-chat-components/references/components/code-block.md +1 -5
- package/skills/iyulab-chat-components/references/components/element-block.md +57 -0
- package/skills/iyulab-chat-components/references/components/file-block.md +22 -25
- package/skills/iyulab-chat-components/references/components/{images-view.md → images-block.md} +10 -10
- package/skills/iyulab-chat-components/references/components/{map-view.md → map-block.md} +9 -9
- package/skills/iyulab-chat-components/references/components/marked-block.md +5 -4
- package/skills/iyulab-chat-components/references/components/message.md +1 -2
- package/skills/iyulab-chat-components/references/components/prompt.md +12 -21
- package/skills/iyulab-chat-components/references/components/{video-view.md → video-block.md} +10 -10
- package/skills/iyulab-chat-components/references/extra-system.md +95 -0
- package/skills/iyulab-chat-components/references/types.md +17 -31
- package/skills/iyulab-chat-components/references/usage.md +13 -81
- package/skills/iyulab-chat-components/references/utilities/html-builder.md +35 -0
- package/skills/iyulab-chat-components/references/utilities/prompt-builder.md +73 -0
- package/dist/_virtual/_glob-assets_raw/intent-prompt.md.1907474e.js +0 -4
- package/dist/_virtual/_glob-assets_raw/view-prompt.md.e0dbcffe.js +0 -4
- package/dist/chart.d.ts +0 -1
- package/dist/chart.js +0 -2
- package/dist/components/blocks/UJsonBlock.d.ts +0 -49
- package/dist/components/blocks/UJsonBlock.js +0 -130
- package/dist/components/blocks/UJsonBlock.styles.js +0 -115
- package/dist/components/blocks/UThinkBlock.d.ts +0 -35
- package/dist/components/blocks/UThinkBlock.js +0 -87
- package/dist/components/blocks/UThinkBlock.styles.js +0 -74
- package/dist/components/blocks/UToolBlock.d.ts +0 -24
- package/dist/components/blocks/UToolBlock.js +0 -70
- package/dist/components/blocks/UToolBlock.styles.js +0 -66
- package/dist/components/buttons/UAttachButton.d.ts +0 -26
- package/dist/components/buttons/UAttachButton.js +0 -63
- package/dist/components/buttons/UAttachButton.styles.js +0 -14
- package/dist/components/buttons/UCopyButton.d.ts +0 -24
- package/dist/components/buttons/UCopyButton.js +0 -59
- package/dist/components/buttons/UCopyButton.styles.js +0 -18
- package/dist/components/buttons/UVoteButton.d.ts +0 -19
- package/dist/components/buttons/UVoteButton.js +0 -64
- package/dist/components/buttons/UVoteButton.styles.d.ts +0 -1
- package/dist/components/buttons/UVoteButton.styles.js +0 -19
- package/dist/components/intents/UQuestionIntent.d.ts +0 -22
- package/dist/components/intents/UQuestionIntent.js +0 -41
- package/dist/components/intents/UQuestionIntent.styles.d.ts +0 -1
- package/dist/components/intents/UQuestionIntent.styles.js +0 -43
- package/dist/components/views/UChartView.styles.d.ts +0 -1
- package/dist/components/views/UImagesView.styles.d.ts +0 -1
- package/dist/components/views/UMapView.styles.d.ts +0 -1
- package/dist/components/views/UVideoView.styles.d.ts +0 -1
- package/dist/components/views/UView.styles.d.ts +0 -1
- package/dist/events/AttachEvent.d.ts +0 -9
- package/dist/events/ChoiceEvent.d.ts +0 -9
- package/dist/react/UAttachButton.d.ts +0 -11
- package/dist/react/UAttachButton.js +0 -12
- package/dist/react/UCopyButton.d.ts +0 -9
- package/dist/react/UCopyButton.js +0 -10
- package/dist/react/UImagesView.d.ts +0 -9
- package/dist/react/UImagesView.js +0 -10
- package/dist/react/UJsonBlock.d.ts +0 -9
- package/dist/react/UJsonBlock.js +0 -10
- package/dist/react/UMapView.d.ts +0 -9
- package/dist/react/UMapView.js +0 -10
- package/dist/react/UQuestionIntent.d.ts +0 -11
- package/dist/react/UQuestionIntent.js +0 -12
- package/dist/react/UThinkBlock.d.ts +0 -9
- package/dist/react/UThinkBlock.js +0 -10
- package/dist/react/UToolBlock.d.ts +0 -9
- package/dist/react/UToolBlock.js +0 -10
- package/dist/react/UVideoView.d.ts +0 -9
- package/dist/react/UVideoView.js +0 -10
- package/dist/react/UView.d.ts +0 -9
- package/dist/react/UView.js +0 -10
- package/dist/react/UVoteButton.d.ts +0 -9
- package/dist/react/UVoteButton.js +0 -10
- package/dist/types/Intents.d.ts +0 -26
- package/dist/types/Intents.js +0 -30
- package/dist/types/JsonNode.d.ts +0 -20
- package/dist/types/Views.d.ts +0 -34
- package/dist/types/Views.js +0 -148
- package/dist/utilities/IntentPromptBuilder.d.ts +0 -40
- package/dist/utilities/IntentPromptBuilder.js +0 -95
- package/dist/utilities/ViewPromptBuilder.d.ts +0 -28
- package/dist/utilities/ViewPromptBuilder.js +0 -78
- package/dist/utilities/dom-agent/DOMAgent.d.ts +0 -74
- package/dist/utilities/dom-agent/DOMController.d.ts +0 -78
- package/dist/utilities/dom-agent/DOMPromptBuilder.d.ts +0 -54
- package/dist/utilities/dom-agent/DOMScanner.d.ts +0 -83
- package/dist/utilities/dom-agent/index.d.ts +0 -9
- package/dist/utilities/dom-agent/types.d.ts +0 -209
- package/skills/iyulab-chat-components/references/components/attach-button.md +0 -69
- package/skills/iyulab-chat-components/references/components/copy-button.md +0 -46
- package/skills/iyulab-chat-components/references/components/json-block.md +0 -41
- package/skills/iyulab-chat-components/references/components/question-intent.md +0 -75
- package/skills/iyulab-chat-components/references/components/think-block.md +0 -48
- package/skills/iyulab-chat-components/references/components/tool-block.md +0 -57
- package/skills/iyulab-chat-components/references/components/view.md +0 -51
- package/skills/iyulab-chat-components/references/components/vote-button.md +0 -60
- package/skills/iyulab-chat-components/references/utilities/intent-prompt-builder.md +0 -123
- package/skills/iyulab-chat-components/references/utilities/view-prompt-builder.md +0 -112
- /package/dist/components/{buttons/UCopyButton.styles.d.ts → blocks/UElementBlock.styles.d.ts} +0 -0
- /package/dist/{components/blocks/UJsonBlock.styles.d.ts → components-extra/UChartBlock.styles.d.ts} +0 -0
- /package/dist/{components/blocks/UThinkBlock.styles.d.ts → components-extra/UImagesBlock.styles.d.ts} +0 -0
- /package/dist/{components/blocks/UToolBlock.styles.d.ts → components-extra/UMapBlock.styles.d.ts} +0 -0
- /package/dist/{components/buttons/UAttachButton.styles.d.ts → components-extra/UVideoBlock.styles.d.ts} +0 -0
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
# IntentPromptBuilder
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { IntentPromptBuilder, PresetIntent } from '@iyulab/chat-components';
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
Singleton utility that registers intents, generates LLM system prompt instructions, and parses `intent-json` blocks from LLM responses.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Overview
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { IntentPromptBuilder, PresetIntent } from '@iyulab/chat-components';
|
|
15
|
-
|
|
16
|
-
const builder = IntentPromptBuilder.instance;
|
|
17
|
-
|
|
18
|
-
// 1. Register preset intents
|
|
19
|
-
builder.use(PresetIntent.Questions);
|
|
20
|
-
|
|
21
|
-
// 2. Register custom intents
|
|
22
|
-
builder.add({
|
|
23
|
-
type: 'rating',
|
|
24
|
-
description: 'Prompt the user to rate something on a scale',
|
|
25
|
-
properties: {
|
|
26
|
-
label: { type: 'string', description: 'What to rate' },
|
|
27
|
-
max: { type: 'number', description: 'Maximum score (default: 5)' }
|
|
28
|
-
},
|
|
29
|
-
required: ['label']
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// 3. Inject into LLM system prompt
|
|
33
|
-
const instruction = builder.build();
|
|
34
|
-
|
|
35
|
-
// 4. Parse LLM response
|
|
36
|
-
const [cleanText, intents] = builder.parse(llmResponse);
|
|
37
|
-
// cleanText → markdown with intent-json blocks removed
|
|
38
|
-
// intents → parsed IntentSchema[]
|
|
39
|
-
|
|
40
|
-
// 5. Render components
|
|
41
|
-
for (const intent of intents) {
|
|
42
|
-
if (intent.type === 'question') {
|
|
43
|
-
const el = document.createElement('u-question-intent');
|
|
44
|
-
el.question = intent.properties?.question as string;
|
|
45
|
-
el.choices = intent.properties?.choices as string[] ?? [];
|
|
46
|
-
container.appendChild(el);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
markedBlock.value = cleanText;
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## API
|
|
56
|
-
|
|
57
|
-
### `IntentPromptBuilder.instance`
|
|
58
|
-
|
|
59
|
-
Returns the singleton. Created on first access.
|
|
60
|
-
|
|
61
|
-
### `.use(flags: PresetIntent): this`
|
|
62
|
-
|
|
63
|
-
Registers preset intents by bit flag.
|
|
64
|
-
|
|
65
|
-
```ts
|
|
66
|
-
builder.use(PresetIntent.Questions);
|
|
67
|
-
builder.use(PresetIntent.All);
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### `.add(definition: IntentDefinition): this`
|
|
71
|
-
|
|
72
|
-
Registers a custom intent. Throws if the same `type` is already registered.
|
|
73
|
-
|
|
74
|
-
```ts
|
|
75
|
-
interface IntentDefinition {
|
|
76
|
-
type: string;
|
|
77
|
-
description: string;
|
|
78
|
-
properties?: Record<string, JsonSchema>;
|
|
79
|
-
required?: string[];
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### `.build(): string`
|
|
84
|
-
|
|
85
|
-
Returns LLM system prompt instructions for all registered intents. Returns an empty string if no intents are registered.
|
|
86
|
-
|
|
87
|
-
### `.parse(value: string): [string, IntentSchema[]]`
|
|
88
|
-
|
|
89
|
-
Extracts `intent-json` blocks from an LLM response string.
|
|
90
|
-
|
|
91
|
-
- Index `[0]` — clean markdown text with intent-json blocks removed
|
|
92
|
-
- Index `[1]` — array of parsed `IntentSchema` objects
|
|
93
|
-
|
|
94
|
-
```ts
|
|
95
|
-
interface IntentSchema {
|
|
96
|
-
type: string;
|
|
97
|
-
properties?: Record<string, unknown>;
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## PresetIntent Flags
|
|
104
|
-
|
|
105
|
-
```ts
|
|
106
|
-
enum PresetIntent {
|
|
107
|
-
Questions = 1 << 0,
|
|
108
|
-
All = Questions
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Questions Intent Schema
|
|
113
|
-
|
|
114
|
-
```json
|
|
115
|
-
{
|
|
116
|
-
"type": "question",
|
|
117
|
-
"properties": {
|
|
118
|
-
"question": { "type": "string" },
|
|
119
|
-
"choices": { "type": "array", "items": { "type": "string" }, "minItems": 1, "maxItems": 5 }
|
|
120
|
-
},
|
|
121
|
-
"required": ["choices"]
|
|
122
|
-
}
|
|
123
|
-
```
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# ViewPromptBuilder
|
|
2
|
-
|
|
3
|
-
```ts
|
|
4
|
-
import { ViewPromptBuilder, PresetView } from '@iyulab/chat-components';
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
Singleton utility that registers views and generates LLM system prompt instructions. No manual parsing is needed — `u-marked-block` automatically renders `view-json` code blocks via `u-view`.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Overview
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { ViewPromptBuilder, PresetView } from '@iyulab/chat-components';
|
|
15
|
-
|
|
16
|
-
const builder = ViewPromptBuilder.instance;
|
|
17
|
-
|
|
18
|
-
// 1. Register preset views
|
|
19
|
-
builder.use(PresetView.All);
|
|
20
|
-
// Or selectively
|
|
21
|
-
builder.use(PresetView.Images | PresetView.Chart);
|
|
22
|
-
|
|
23
|
-
// 2. Register a custom view
|
|
24
|
-
builder.add({
|
|
25
|
-
element: MyCustomView, // CustomElementConstructor
|
|
26
|
-
tag: 'my-custom-view',
|
|
27
|
-
description: 'Display a custom visualization',
|
|
28
|
-
properties: {
|
|
29
|
-
data: { type: 'array', description: 'Data array' }
|
|
30
|
-
},
|
|
31
|
-
required: ['data']
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// 3. Inject into LLM system prompt
|
|
35
|
-
const instruction = builder.build();
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
When the LLM outputs a `view-json` block, `u-marked-block` renders it automatically:
|
|
39
|
-
|
|
40
|
-
````
|
|
41
|
-
```view-json
|
|
42
|
-
{
|
|
43
|
-
"tag": "u-chart-view",
|
|
44
|
-
"properties": {
|
|
45
|
-
"type": "pie",
|
|
46
|
-
"data": {
|
|
47
|
-
"labels": ["A", "B", "C"],
|
|
48
|
-
"datasets": [{ "data": [30, 50, 20] }]
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
````
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## API
|
|
58
|
-
|
|
59
|
-
### `ViewPromptBuilder.instance`
|
|
60
|
-
|
|
61
|
-
Returns the singleton. Created on first access.
|
|
62
|
-
|
|
63
|
-
### `.use(flags: PresetView): this`
|
|
64
|
-
|
|
65
|
-
Registers preset views by bit flag.
|
|
66
|
-
|
|
67
|
-
```ts
|
|
68
|
-
builder.use(PresetView.Images);
|
|
69
|
-
builder.use(PresetView.All);
|
|
70
|
-
builder.use(PresetView.Images | PresetView.Chart);
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### `.add(definition: ViewDefinition): this`
|
|
74
|
-
|
|
75
|
-
Registers a custom view and its custom element. Throws if the same `tag` is already registered or if the tag is already defined with a different class.
|
|
76
|
-
|
|
77
|
-
```ts
|
|
78
|
-
interface ViewDefinition {
|
|
79
|
-
element: CustomElementConstructor;
|
|
80
|
-
tag: string;
|
|
81
|
-
description: string;
|
|
82
|
-
properties?: Record<string, JsonSchema>;
|
|
83
|
-
required?: string[];
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### `.build(): string`
|
|
88
|
-
|
|
89
|
-
Returns LLM system prompt instructions for all registered views. Returns an empty string if no views are registered.
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## PresetView Flags
|
|
94
|
-
|
|
95
|
-
```ts
|
|
96
|
-
enum PresetView {
|
|
97
|
-
Images = 1 << 0, // u-images-view
|
|
98
|
-
Video = 1 << 1, // u-video-view
|
|
99
|
-
Map = 1 << 3, // u-map-view
|
|
100
|
-
Chart = 1 << 4, // u-chart-view
|
|
101
|
-
All = Images | Video | Map | Chart
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### Preset View Schema Summary
|
|
106
|
-
|
|
107
|
-
| Tag | Key Properties |
|
|
108
|
-
|-----|----------------|
|
|
109
|
-
| `u-images-view` | `items: [{ src, alt?, caption? }]` |
|
|
110
|
-
| `u-video-view` | `src`, `poster?`, `ratio?` |
|
|
111
|
-
| `u-map-view` | `lat`, `lng`, `zoom?`, `label?`, `description?` |
|
|
112
|
-
| `u-chart-view` | `type`, `data`, `options?` |
|
/package/dist/components/{buttons/UCopyButton.styles.d.ts → blocks/UElementBlock.styles.d.ts}
RENAMED
|
File without changes
|
/package/dist/{components/blocks/UJsonBlock.styles.d.ts → components-extra/UChartBlock.styles.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/{components/blocks/UToolBlock.styles.d.ts → components-extra/UMapBlock.styles.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|