@vaadin/field-highlighter 25.3.0-alpha12 → 25.3.0-alpha14
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/package.json +24 -24
- package/src/vaadin-ai-field-marker.d.ts +21 -0
- package/src/vaadin-ai-field-marker.js +24 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/field-highlighter",
|
|
3
|
-
"version": "25.3.0-
|
|
3
|
+
"version": "25.3.0-alpha14",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,33 +32,33 @@
|
|
|
32
32
|
"field"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vaadin/a11y-base": "25.3.0-
|
|
36
|
-
"@vaadin/component-base": "25.3.0-
|
|
37
|
-
"@vaadin/overlay": "25.3.0-
|
|
38
|
-
"@vaadin/popover": "25.3.0-
|
|
39
|
-
"@vaadin/tooltip": "25.3.0-
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "25.3.0-
|
|
35
|
+
"@vaadin/a11y-base": "25.3.0-alpha14",
|
|
36
|
+
"@vaadin/component-base": "25.3.0-alpha14",
|
|
37
|
+
"@vaadin/overlay": "25.3.0-alpha14",
|
|
38
|
+
"@vaadin/popover": "25.3.0-alpha14",
|
|
39
|
+
"@vaadin/tooltip": "25.3.0-alpha14",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "25.3.0-alpha14",
|
|
41
41
|
"lit": "^3.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@vaadin/aura": "25.3.0-
|
|
45
|
-
"@vaadin/chai-plugins": "25.3.0-
|
|
46
|
-
"@vaadin/checkbox": "25.3.0-
|
|
47
|
-
"@vaadin/checkbox-group": "25.3.0-
|
|
48
|
-
"@vaadin/custom-field": "25.3.0-
|
|
49
|
-
"@vaadin/date-picker": "25.3.0-
|
|
50
|
-
"@vaadin/date-time-picker": "25.3.0-
|
|
51
|
-
"@vaadin/item": "25.3.0-
|
|
52
|
-
"@vaadin/list-box": "25.3.0-
|
|
53
|
-
"@vaadin/radio-group": "25.3.0-
|
|
54
|
-
"@vaadin/select": "25.3.0-
|
|
55
|
-
"@vaadin/test-runner-commands": "25.3.0-
|
|
44
|
+
"@vaadin/aura": "25.3.0-alpha14",
|
|
45
|
+
"@vaadin/chai-plugins": "25.3.0-alpha14",
|
|
46
|
+
"@vaadin/checkbox": "25.3.0-alpha14",
|
|
47
|
+
"@vaadin/checkbox-group": "25.3.0-alpha14",
|
|
48
|
+
"@vaadin/custom-field": "25.3.0-alpha14",
|
|
49
|
+
"@vaadin/date-picker": "25.3.0-alpha14",
|
|
50
|
+
"@vaadin/date-time-picker": "25.3.0-alpha14",
|
|
51
|
+
"@vaadin/item": "25.3.0-alpha14",
|
|
52
|
+
"@vaadin/list-box": "25.3.0-alpha14",
|
|
53
|
+
"@vaadin/radio-group": "25.3.0-alpha14",
|
|
54
|
+
"@vaadin/select": "25.3.0-alpha14",
|
|
55
|
+
"@vaadin/test-runner-commands": "25.3.0-alpha14",
|
|
56
56
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
57
|
-
"@vaadin/text-area": "25.3.0-
|
|
58
|
-
"@vaadin/text-field": "25.3.0-
|
|
59
|
-
"@vaadin/time-picker": "25.3.0-
|
|
60
|
-
"@vaadin/vaadin-lumo-styles": "25.3.0-
|
|
57
|
+
"@vaadin/text-area": "25.3.0-alpha14",
|
|
58
|
+
"@vaadin/text-field": "25.3.0-alpha14",
|
|
59
|
+
"@vaadin/time-picker": "25.3.0-alpha14",
|
|
60
|
+
"@vaadin/vaadin-lumo-styles": "25.3.0-alpha14",
|
|
61
61
|
"sinon": "^22.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "10a01ae7a1e278af50eda7255dbb68dafc0e4caf"
|
|
64
64
|
}
|
|
@@ -62,6 +62,10 @@ export type AiFieldRevertEvent = CustomEvent<{ value: unknown }>;
|
|
|
62
62
|
* in progress, set the `working` property to show an "AI is working" shimmer
|
|
63
63
|
* on the field along with a client-side read-only guard.
|
|
64
64
|
*
|
|
65
|
+
* The popover can show custom content — such as a summary of what the AI
|
|
66
|
+
* based the value on — below the explanation, given as a DOM node through
|
|
67
|
+
* the `content` property.
|
|
68
|
+
*
|
|
65
69
|
* Set the `confidence` property to show the confidence level of the filled
|
|
66
70
|
* value (`low`, `medium` or `high`) as an indicator in the field's helper
|
|
67
71
|
* text section, ahead of a helper the field itself may have. While the
|
|
@@ -122,6 +126,23 @@ declare class AiFieldMarker extends I18nMixin<typeof HTMLElement, AiFieldMarkerI
|
|
|
122
126
|
*/
|
|
123
127
|
i18n: AiFieldMarkerI18n;
|
|
124
128
|
|
|
129
|
+
/**
|
|
130
|
+
* A DOM node to show in the popover, between the message and the revert
|
|
131
|
+
* control — for example a summary of what the AI based the value on.
|
|
132
|
+
*
|
|
133
|
+
* The node is rendered as given, and moved into the marker's own light DOM.
|
|
134
|
+
* The host owns it: setting the property to another node or to `null`
|
|
135
|
+
* removes the previous node from the popover.
|
|
136
|
+
*
|
|
137
|
+
* ```js
|
|
138
|
+
* const source = document.createElement('a');
|
|
139
|
+
* source.href = '/documents/invoice.pdf';
|
|
140
|
+
* source.textContent = 'invoice.pdf';
|
|
141
|
+
* marker.content = source;
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
content: Node | null | undefined;
|
|
145
|
+
|
|
125
146
|
/**
|
|
126
147
|
* Whether an AI is currently working on the field. While `true`, the field
|
|
127
148
|
* shows an "AI is working" shimmer and is made read-only on the client so
|
|
@@ -222,6 +222,10 @@ class DelayedFieldValue {
|
|
|
222
222
|
* annotates is about to be replaced; setting `working` back to `false`
|
|
223
223
|
* brings it back, so a cancelled or failed fill leaves the mark intact.
|
|
224
224
|
*
|
|
225
|
+
* The popover can show custom content — such as a summary of what the AI
|
|
226
|
+
* based the value on — below the explanation, given as a DOM node through
|
|
227
|
+
* the `content` property.
|
|
228
|
+
*
|
|
225
229
|
* The pieces that construct the marker — the badge, its tooltip and the
|
|
226
230
|
* popover with the explanation and the revert control — are rendered
|
|
227
231
|
* directly into the marker's light DOM, so that document-level themes
|
|
@@ -273,6 +277,25 @@ class AiFieldMarker extends SlotStylesMixin(I18nMixin(DirMixin(PolylitMixin(LitE
|
|
|
273
277
|
|
|
274
278
|
static get properties() {
|
|
275
279
|
return {
|
|
280
|
+
/**
|
|
281
|
+
* A DOM node to show in the popover, between the message and the revert
|
|
282
|
+
* control — for example a summary of what the AI based the value on.
|
|
283
|
+
*
|
|
284
|
+
* The node is rendered as given, and moved into the marker's own light
|
|
285
|
+
* DOM. The host owns it: setting the property to another node or to
|
|
286
|
+
* `null` removes the previous node from the popover.
|
|
287
|
+
*
|
|
288
|
+
* ```js
|
|
289
|
+
* const source = document.createElement('a');
|
|
290
|
+
* source.href = '/documents/invoice.pdf';
|
|
291
|
+
* source.textContent = 'invoice.pdf';
|
|
292
|
+
* marker.content = source;
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
content: {
|
|
296
|
+
type: Object,
|
|
297
|
+
},
|
|
298
|
+
|
|
276
299
|
/**
|
|
277
300
|
* Whether an AI is currently working on the field. While `true`, the
|
|
278
301
|
* field shows an "AI is working" shimmer and is made read-only on the
|
|
@@ -590,6 +613,7 @@ class AiFieldMarker extends SlotStylesMixin(I18nMixin(DirMixin(PolylitMixin(LitE
|
|
|
590
613
|
<vaadin-tooltip for="${this.#badgeId}" text="${badgeTooltip}"></vaadin-tooltip>
|
|
591
614
|
<vaadin-popover for="${this.#badgeId}" aria-label="${badgeLabel}" autofocus theme="arrow" position="end-top">
|
|
592
615
|
<p class="message">${message}</p>
|
|
616
|
+
${this.content ?? nothing}
|
|
593
617
|
<div class="actions">
|
|
594
618
|
<button type="button" tabindex="0" @click="${this.#onRevert}">${revert}</button>
|
|
595
619
|
</div>
|