@knime/product-features 6.1.2 → 6.3.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @knime/product-features
2
2
 
3
+ ## 6.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - de5f947: - `KdsPromptInput`:
8
+ - add the `menu` prop, which shows a "+" button with a menu in the bottom left corner of the input, and the `menuItemClick` event.
9
+ - add the `contextChips` prop, which shows a `KdsChip` per piece of context (e.g. an attached file or a selected node) above the prompt text, and the `contextChipRemove` and `contextChipLabelClick` events.
10
+ - require `@knime/kds-components` 13.1.0 or newer, for `KdsChip`.
11
+
12
+ ## 6.2.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 96e525c: `embedding`: Add a new package that establishes the contract for embedding the workflow editor in a shadow root. This package also owns the declaration of features that are injected into the embedded application over the embedding boundary. For more information, refer to the README of the `embedding` package
17
+
18
+ `rfcErrors`: `toToast` keeps the error data in `meta.rfcError` (`RFC_ERROR_TOAST_META_KEY`), so the toast can be rebuilt where its component cannot be rendered.
19
+
3
20
  ## 6.1.2
4
21
 
5
22
  ### Patch Changes
package/README.md CHANGED
@@ -23,18 +23,19 @@ Peer dependencies: `@knime/kds-components`, `@knime/kds-styles`, `@vueuse/core`,
23
23
  This package has **no root export** — import from one of the subpath entry
24
24
  points, so consumers only pull in the feature area they use:
25
25
 
26
- | Entry point | Source | Contents |
27
- | -------------------------------------------- | -------------------------- | --------------------------------------------------------------------------- |
28
- | `@knime/product-features/ai` | `src/ai` | AI assistant building blocks (`KdsPromptInput`) |
29
- | `@knime/product-features/analytics` | `src/analytics` | Typed analytics event builders ([README](src/analytics/README.md)) |
30
- | `@knime/product-features/auth-utils` | `src/authUtils` | KNIME Hub auth refresher and auth state ([README](src/authUtils/README.md)) |
31
- | `@knime/product-features/data-transfer` | `src/dataTransfer` | File upload/download progress panels and composables |
32
- | `@knime/product-features/data-transfer/core` | `src/dataTransfer/core.ts` | Framework-agnostic upload managers and upload client |
33
- | `@knime/product-features/embedding-sdk` | `src/embeddingSDK` | Host/guest messaging for embedding an application in an iframe |
34
- | `@knime/product-features/nodes` | `src/nodes` | Node description tabs and node preview |
35
- | `@knime/product-features/rfc-errors` | `src/rfcErrors` | RFC 9457 problem-details error handling and error toasts |
36
- | `@knime/product-features/toasts` | `src/toasts` | Toast notifications |
37
- | `@knime/product-features/versions` | `src/versions` | Version history and create-version form |
26
+ | Entry point | Source | Contents |
27
+ | -------------------------------------------- | -------------------------- | -------------------------------------------------------------------------------------- |
28
+ | `@knime/product-features/ai` | `src/ai` | AI assistant building blocks (`KdsPromptInput`) |
29
+ | `@knime/product-features/analytics` | `src/analytics` | Typed analytics event builders ([README](src/analytics/README.md)) |
30
+ | `@knime/product-features/auth-utils` | `src/authUtils` | KNIME Hub auth refresher and auth state ([README](src/authUtils/README.md)) |
31
+ | `@knime/product-features/data-transfer` | `src/dataTransfer` | File upload/download progress panels and composables |
32
+ | `@knime/product-features/data-transfer/core` | `src/dataTransfer/core.ts` | Framework-agnostic upload managers and upload client |
33
+ | `@knime/product-features/embedding` | `src/embedding` | Contract for embedding the editor in a shadow root ([README](src/embedding/README.md)) |
34
+ | `@knime/product-features/embedding-sdk` | `src/embeddingSDK` | Host/guest messaging for embedding an application in an iframe |
35
+ | `@knime/product-features/nodes` | `src/nodes` | Node description tabs and node preview |
36
+ | `@knime/product-features/rfc-errors` | `src/rfcErrors` | RFC 9457 problem-details error handling and error toasts |
37
+ | `@knime/product-features/toasts` | `src/toasts` | Toast notifications |
38
+ | `@knime/product-features/versions` | `src/versions` | Version history and create-version form |
38
39
 
39
40
  ```ts
40
41
  // ✅ import from a subpath
package/dist/ai.css CHANGED
@@ -194,17 +194,17 @@
194
194
  var(--kds-spacing-container-1x);
195
195
  }
196
196
 
197
- .prompt-input[data-v-b1453ba4] {
197
+ .prompt-input[data-v-7fd4fcfa] {
198
198
  display: flex;
199
199
  flex-direction: column;
200
200
  width: 100%;
201
201
  }
202
202
  .input-container {
203
- &[data-v-b1453ba4] {
203
+ &[data-v-7fd4fcfa] {
204
204
  position: relative;
205
205
  display: flex;
206
- gap: var(--kds-spacing-container-0-5x);
207
- align-items: flex-end;
206
+ flex-direction: column;
207
+ gap: var(--kds-spacing-container-0-25x);
208
208
  padding: calc(
209
209
  var(--kds-spacing-container-0-37x) - var(--kds-core-border-width-xs)
210
210
  );
@@ -214,33 +214,30 @@
214
214
  border: var(--kds-border-action-input);
215
215
  border-radius: var(--kds-border-radius-container-0-37x);
216
216
  }
217
- &[data-v-b1453ba4]:has(textarea:focus:not(:disabled)) {
217
+ &[data-v-7fd4fcfa]:has(textarea:focus:not(:disabled)) {
218
218
  outline: var(--kds-border-action-focused);
219
219
  outline-offset: var(--kds-spacing-offset-focus);
220
220
  }
221
- &[data-v-b1453ba4]:has(textarea:hover:not(:disabled, :focus)) {
221
+ &[data-v-7fd4fcfa]:has(textarea:hover:not(:disabled, :focus)) {
222
222
  background: var(--kds-color-background-input-hover);
223
223
  }
224
- &.disabled[data-v-b1453ba4] {
224
+ &.disabled[data-v-7fd4fcfa] {
225
225
  cursor: default;
226
226
  border: var(--kds-border-action-disabled);
227
227
  }
228
228
  }
229
- .text-input-wrapper[data-v-b1453ba4] {
229
+ .context-chips[data-v-7fd4fcfa] {
230
230
  display: flex;
231
- flex: 1 0 0;
232
- align-items: center;
233
- min-width: 0;
234
-
235
- /*
236
- * Match the Send/Stop button height so a single-line textarea sits
237
- * vertically centered against the button.
238
- */
239
- min-height: var(--kds-dimension-component-height-1-75x);
240
- padding-left: var(--kds-spacing-container-0-37x);
231
+ flex-wrap: wrap;
232
+ gap: var(--kds-spacing-container-0-25x);
233
+ }
234
+ .text-input-wrapper[data-v-7fd4fcfa] {
235
+ display: flex;
236
+ min-height: var(--kds-dimension-component-height-2-5x);
237
+ padding: var(--kds-spacing-container-0-12x);
241
238
  }
242
239
  .text-input {
243
- &[data-v-b1453ba4] {
240
+ &[data-v-7fd4fcfa] {
244
241
  width: 100%;
245
242
  min-width: 0;
246
243
 
@@ -257,32 +254,35 @@
257
254
  background: transparent;
258
255
  border: none;
259
256
  }
260
- &[data-v-b1453ba4]::placeholder {
257
+ &[data-v-7fd4fcfa]::placeholder {
261
258
  color: var(--kds-color-text-and-icon-subtle);
262
259
  }
263
260
  &:disabled {
264
- &[data-v-b1453ba4] {
261
+ &[data-v-7fd4fcfa] {
265
262
  color: var(--kds-color-text-and-icon-disabled);
266
263
  cursor: default;
267
264
  }
268
- &[data-v-b1453ba4]::placeholder {
265
+ &[data-v-7fd4fcfa]::placeholder {
269
266
  color: var(--kds-color-text-and-icon-disabled);
270
267
  }
271
268
  }
272
- &[data-v-b1453ba4]::-webkit-scrollbar {
269
+ &[data-v-7fd4fcfa]::-webkit-scrollbar {
273
270
  display: none;
274
271
  }
275
272
  }
276
- .action[data-v-b1453ba4] {
273
+ .bottom-row[data-v-7fd4fcfa] {
277
274
  display: flex;
278
- flex-shrink: 0;
279
- align-items: flex-end;
275
+ align-items: center;
276
+ }
277
+ .action[data-v-7fd4fcfa] {
278
+ display: flex;
279
+ margin-left: auto;
280
280
  }
281
- .progress-bar[data-v-b1453ba4] {
281
+ .progress-bar[data-v-7fd4fcfa] {
282
282
  position: absolute;
283
283
  inset: -1px 0 auto;
284
284
  }
285
- .subtext[data-v-b1453ba4] {
285
+ .subtext[data-v-7fd4fcfa] {
286
286
  display: flex;
287
287
  flex-wrap: wrap;
288
288
  gap: var(--kds-spacing-container-0-25x) var(--kds-spacing-container-0-5x);
@@ -292,12 +292,12 @@
292
292
  font: var(--kds-font-base-subtext-small);
293
293
  color: var(--kds-color-text-and-icon-neutral);
294
294
  }
295
- .subtext-left[data-v-b1453ba4] {
295
+ .subtext-left[data-v-7fd4fcfa] {
296
296
  /* Take all remaining inline space so the right block is pushed to the end. */
297
297
  flex: 1 1 0;
298
298
  min-width: 0;
299
299
  }
300
- .subtext-right[data-v-b1453ba4] {
300
+ .subtext-right[data-v-7fd4fcfa] {
301
301
  /*
302
302
  * On row 1 (alongside .subtext-left) the right block stays at its
303
303
  * intrinsic width — line-breaking in flex layout is decided from
package/dist/ai.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BOaGB7Aw.js";
2
- import { KeepAlive, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, normalizeClass, onMounted, openBlock, reactive, ref, renderSlot, toDisplayString, unref, useModel, useSlots, useTemplateRef, vModelText, watch, withCtx, withDirectives, withModifiers } from "vue";
3
- import { KdsButton, KdsCheckbox, KdsCheckboxGroup, KdsIcon, KdsLink, KdsProgressBar, KdsRadioButtonGroup, KdsTextInput } from "@knime/kds-components";
2
+ import { Fragment, KeepAlive, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, onMounted, openBlock, reactive, ref, renderList, renderSlot, toDisplayString, unref, useModel, useSlots, useTemplateRef, vModelText, watch, withCtx, withDirectives, withModifiers } from "vue";
3
+ import { KdsButton, KdsCheckbox, KdsCheckboxGroup, KdsChip, KdsIcon, KdsLink, KdsMenuButton, KdsProgressBar, KdsRadioButtonGroup, KdsTextInput } from "@knime/kds-components";
4
4
  import './ai.css';//#endregion
5
5
  //#region src/ai/KdsPromptInput/AttachableSurface.vue
6
6
  var AttachableSurface_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -505,26 +505,31 @@ var _hoisted_2 = {
505
505
  key: 0,
506
506
  class: "progress-bar"
507
507
  };
508
- var _hoisted_3 = { class: "text-input-wrapper" };
509
- var _hoisted_4 = [
508
+ var _hoisted_3 = {
509
+ key: 1,
510
+ class: "context-chips"
511
+ };
512
+ var _hoisted_4 = { class: "text-input-wrapper" };
513
+ var _hoisted_5 = [
510
514
  "placeholder",
511
515
  "disabled",
512
516
  "aria-label"
513
517
  ];
514
- var _hoisted_5 = { class: "action" };
515
- var _hoisted_6 = {
518
+ var _hoisted_6 = { class: "bottom-row" };
519
+ var _hoisted_7 = { class: "action" };
520
+ var _hoisted_8 = {
516
521
  key: 2,
517
522
  class: "subtext"
518
523
  };
519
- var _hoisted_7 = {
524
+ var _hoisted_9 = {
520
525
  key: 0,
521
526
  class: "subtext-left"
522
527
  };
523
- var _hoisted_8 = {
528
+ var _hoisted_10 = {
524
529
  key: 1,
525
530
  class: "subtext-right"
526
531
  };
527
- var _hoisted_9 = { key: 0 };
532
+ var _hoisted_11 = { key: 0 };
528
533
  //#endregion
529
534
  //#region src/ai/KdsPromptInput/KdsPromptInput.vue
530
535
  var KdsPromptInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -544,7 +549,9 @@ var KdsPromptInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
544
549
  rightSubtext: { default: () => void 0 },
545
550
  link: { default: () => void 0 },
546
551
  permissions: { default: () => [] },
547
- questions: { default: () => [] }
552
+ questions: { default: () => [] },
553
+ menu: { default: () => void 0 },
554
+ contextChips: { default: () => [] }
548
555
  }, {
549
556
  "modelValue": { default: "" },
550
557
  "modelModifiers": {}
@@ -554,7 +561,10 @@ var KdsPromptInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
554
561
  "stop",
555
562
  "statusButtonClick",
556
563
  "statusSecondaryButtonClick",
557
- "respond"
564
+ "respond",
565
+ "menuItemClick",
566
+ "contextChipRemove",
567
+ "contextChipLabelClick"
558
568
  ], ["update:modelValue"]),
559
569
  setup(__props, { expose: __expose, emit: __emit }) {
560
570
  const emit = __emit;
@@ -591,10 +601,21 @@ var KdsPromptInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
591
601
  }, null, 8, ["permissions", "questions"])) : createCommentVNode("", true),
592
602
  createElementVNode("div", {
593
603
  class: normalizeClass(["input-container", { disabled: isDisabled.value }]),
594
- onClick: _cache[5] || (_cache[5] = ($event) => textareaRef.value?.focus())
604
+ onClick: _cache[7] || (_cache[7] = ($event) => textareaRef.value?.focus())
595
605
  }, [
596
606
  __props.loading ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(unref(KdsProgressBar), { indeterminate: "" })])) : createCommentVNode("", true),
597
- createElementVNode("div", _hoisted_3, [withDirectives(createElementVNode("textarea", {
607
+ __props.contextChips.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.contextChips, ({ id, ...chipProps }) => {
608
+ return openBlock(), createBlock(unref(KdsChip), mergeProps({ key: id }, { ref_for: true }, chipProps, {
609
+ disabled: isDisabled.value || chipProps.disabled,
610
+ onRemove: ($event) => emit("contextChipRemove", id),
611
+ onLabelClick: ($event) => emit("contextChipLabelClick", id)
612
+ }), null, 16, [
613
+ "disabled",
614
+ "onRemove",
615
+ "onLabelClick"
616
+ ]);
617
+ }), 128))])) : createCommentVNode("", true),
618
+ createElementVNode("div", _hoisted_4, [withDirectives(createElementVNode("textarea", {
598
619
  ref_key: "textareaRef",
599
620
  ref: textareaRef,
600
621
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => modelValue.value = $event),
@@ -604,25 +625,41 @@ var KdsPromptInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
604
625
  disabled: isDisabled.value,
605
626
  "aria-label": __props.ariaLabel,
606
627
  onKeydown
607
- }, null, 40, _hoisted_4), [[vModelText, modelValue.value]])]),
608
- createElementVNode("div", _hoisted_5, [__props.loading ? (openBlock(), createBlock(unref(KdsButton), {
628
+ }, null, 40, _hoisted_5), [[vModelText, modelValue.value]])]),
629
+ createElementVNode("div", _hoisted_6, [__props.menu ? (openBlock(), createElementBlock("div", {
630
+ key: 0,
631
+ class: "menu",
632
+ onClick: _cache[5] || (_cache[5] = withModifiers(() => {}, ["stop"]))
633
+ }, [createVNode(unref(KdsMenuButton), {
634
+ variant: "transparent",
635
+ size: "small",
636
+ "leading-icon": "plus",
637
+ ariaLabel: __props.menu.ariaLabel ?? "Add",
638
+ items: __props.menu.items,
639
+ disabled: isDisabled.value,
640
+ onItemClick: _cache[4] || (_cache[4] = ($event) => emit("menuItemClick", $event))
641
+ }, null, 8, [
642
+ "ariaLabel",
643
+ "items",
644
+ "disabled"
645
+ ])])) : createCommentVNode("", true), createElementVNode("div", _hoisted_7, [__props.loading ? (openBlock(), createBlock(unref(KdsButton), {
609
646
  key: 0,
610
647
  variant: "outlined",
611
648
  "leading-icon": "stop",
612
- size: "medium",
649
+ size: "small",
613
650
  ariaLabel: "Stop",
614
- onClick: _cache[4] || (_cache[4] = withModifiers(($event) => emit("stop"), ["stop"]))
651
+ onClick: _cache[6] || (_cache[6] = withModifiers(($event) => emit("stop"), ["stop"]))
615
652
  })) : (openBlock(), createBlock(unref(KdsButton), {
616
653
  key: 1,
617
654
  variant: "filled",
618
655
  "leading-icon": "send",
619
- size: "medium",
656
+ size: "small",
620
657
  ariaLabel: "Send",
621
658
  disabled: !canSubmit.value,
622
659
  onClick: withModifiers(onSubmit, ["stop"])
623
- }, null, 8, ["disabled"]))])
660
+ }, null, 8, ["disabled"]))])])
624
661
  ], 2),
625
- slots["left-subtext"] || __props.rightSubtext || __props.link ? (openBlock(), createElementBlock("div", _hoisted_6, [slots["left-subtext"] ? (openBlock(), createElementBlock("div", _hoisted_7, [renderSlot(_ctx.$slots, "left-subtext", {}, void 0, true)])) : createCommentVNode("", true), __props.rightSubtext || __props.link ? (openBlock(), createElementBlock("div", _hoisted_8, [__props.rightSubtext ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(__props.rightSubtext), 1)) : createCommentVNode("", true), __props.link ? (openBlock(), createBlock(unref(KdsLink), {
662
+ slots["left-subtext"] || __props.rightSubtext || __props.link ? (openBlock(), createElementBlock("div", _hoisted_8, [slots["left-subtext"] ? (openBlock(), createElementBlock("div", _hoisted_9, [renderSlot(_ctx.$slots, "left-subtext", {}, void 0, true)])) : createCommentVNode("", true), __props.rightSubtext || __props.link ? (openBlock(), createElementBlock("div", _hoisted_10, [__props.rightSubtext ? (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString(__props.rightSubtext), 1)) : createCommentVNode("", true), __props.link ? (openBlock(), createBlock(unref(KdsLink), {
626
663
  key: 1,
627
664
  label: __props.link.label,
628
665
  to: __props.link.to,
@@ -631,7 +668,7 @@ var KdsPromptInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
631
668
  ]);
632
669
  };
633
670
  }
634
- }), [["__scopeId", "data-v-b1453ba4"]]);
671
+ }), [["__scopeId", "data-v-7fd4fcfa"]]);
635
672
  //#endregion
636
673
  //#region src/ai/KdsPromptInput/enums.ts
637
674
  var kdsPromptInputStatusType = {