@vaadin/field-highlighter 25.3.0-alpha12 → 25.3.0-alpha13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/field-highlighter",
3
- "version": "25.3.0-alpha12",
3
+ "version": "25.3.0-alpha13",
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-alpha12",
36
- "@vaadin/component-base": "25.3.0-alpha12",
37
- "@vaadin/overlay": "25.3.0-alpha12",
38
- "@vaadin/popover": "25.3.0-alpha12",
39
- "@vaadin/tooltip": "25.3.0-alpha12",
40
- "@vaadin/vaadin-themable-mixin": "25.3.0-alpha12",
35
+ "@vaadin/a11y-base": "25.3.0-alpha13",
36
+ "@vaadin/component-base": "25.3.0-alpha13",
37
+ "@vaadin/overlay": "25.3.0-alpha13",
38
+ "@vaadin/popover": "25.3.0-alpha13",
39
+ "@vaadin/tooltip": "25.3.0-alpha13",
40
+ "@vaadin/vaadin-themable-mixin": "25.3.0-alpha13",
41
41
  "lit": "^3.0.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@vaadin/aura": "25.3.0-alpha12",
45
- "@vaadin/chai-plugins": "25.3.0-alpha12",
46
- "@vaadin/checkbox": "25.3.0-alpha12",
47
- "@vaadin/checkbox-group": "25.3.0-alpha12",
48
- "@vaadin/custom-field": "25.3.0-alpha12",
49
- "@vaadin/date-picker": "25.3.0-alpha12",
50
- "@vaadin/date-time-picker": "25.3.0-alpha12",
51
- "@vaadin/item": "25.3.0-alpha12",
52
- "@vaadin/list-box": "25.3.0-alpha12",
53
- "@vaadin/radio-group": "25.3.0-alpha12",
54
- "@vaadin/select": "25.3.0-alpha12",
55
- "@vaadin/test-runner-commands": "25.3.0-alpha12",
44
+ "@vaadin/aura": "25.3.0-alpha13",
45
+ "@vaadin/chai-plugins": "25.3.0-alpha13",
46
+ "@vaadin/checkbox": "25.3.0-alpha13",
47
+ "@vaadin/checkbox-group": "25.3.0-alpha13",
48
+ "@vaadin/custom-field": "25.3.0-alpha13",
49
+ "@vaadin/date-picker": "25.3.0-alpha13",
50
+ "@vaadin/date-time-picker": "25.3.0-alpha13",
51
+ "@vaadin/item": "25.3.0-alpha13",
52
+ "@vaadin/list-box": "25.3.0-alpha13",
53
+ "@vaadin/radio-group": "25.3.0-alpha13",
54
+ "@vaadin/select": "25.3.0-alpha13",
55
+ "@vaadin/test-runner-commands": "25.3.0-alpha13",
56
56
  "@vaadin/testing-helpers": "^2.0.0",
57
- "@vaadin/text-area": "25.3.0-alpha12",
58
- "@vaadin/text-field": "25.3.0-alpha12",
59
- "@vaadin/time-picker": "25.3.0-alpha12",
60
- "@vaadin/vaadin-lumo-styles": "25.3.0-alpha12",
57
+ "@vaadin/text-area": "25.3.0-alpha13",
58
+ "@vaadin/text-field": "25.3.0-alpha13",
59
+ "@vaadin/time-picker": "25.3.0-alpha13",
60
+ "@vaadin/vaadin-lumo-styles": "25.3.0-alpha13",
61
61
  "sinon": "^22.0.0"
62
62
  },
63
- "gitHead": "0f0337783efe38332f5dc6a8968f207d2982de4b"
63
+ "gitHead": "e23e44d29e6bc1e47245d5e2cc0e4b022ec61818"
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>