@knime/product-features 1.2.4 → 2.0.1

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,31 @@
1
1
  # @knime/product-features
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7e008e1]
8
+ - Updated dependencies [6fa993e]
9
+ - @knime/utils@2.0.0
10
+ - @knime/kds-components@2.7.0
11
+ - @knime/kds-styles@2.7.0
12
+
13
+ ## 2.0.0
14
+
15
+ ### Major Changes
16
+
17
+ - 45a2a5a: Moved `PortIcon` out of `@knime/product-features` and into `@knime/kds-components` as `KdsPortIcon` (it had no KNIME-specific dependencies, so it belongs with the reusable components/accessories instead).
18
+
19
+ BREAKING CHANGES:
20
+
21
+ - `PortIcon`, `PortIconProps`, and `PortType` are no longer exported from `@knime/product-features`. Import `KdsPortIcon`, `KdsPortIconProps`, and `KdsPortType` from `@knime/kds-components` instead. The `type` and `color` props are unchanged; `filled` was renamed to `optional` (the inverted boolean — pass `optional: !wasFilled`), defaulting to `false`.
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [45a2a5a]
26
+ - @knime/kds-components@2.6.0
27
+ - @knime/kds-styles@2.6.0
28
+
3
29
  ## 1.2.4
4
30
 
5
31
  ### Patch Changes
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @knime/product-features
2
+
3
+ This is part of the [KNIME Design System](../../README.md).
4
+
5
+ This package contains composition patterns that combine KNIME Design System components with shared product logic.
6
+
7
+ It's published as npm package: [@knime/product-features]
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ pnpm add @knime/product-features
13
+ ```
14
+
15
+ ## Using with Vitest, Nuxt, or Vite SSR
16
+
17
+ The published JavaScript imports its CSS as a side effect (e.g.
18
+ `import "./index.css"`), which bundlers handle automatically. When the package
19
+ is instead evaluated by Node's native ESM loader — as **Vitest** and
20
+ **Vite/Nuxt SSR** do by default, since they externalize `node_modules` — Node
21
+ has no `.css` loader and throws `Unknown file extension ".css"`. Configure the
22
+ consuming project once so `@knime/*` packages are processed instead of
23
+ externalized:
24
+
25
+ ```ts
26
+ // Vitest — vitest.config.ts
27
+ export default defineConfig({
28
+ test: { server: { deps: { inline: [/@knime\//] } } },
29
+ });
30
+ ```
31
+
32
+ ```ts
33
+ // Vite SSR — vite.config.ts
34
+ export default defineConfig({ ssr: { noExternal: [/@knime\//] } });
35
+ ```
36
+
37
+ ```ts
38
+ // Nuxt — nuxt.config.ts
39
+ export default defineNuxtConfig({ build: { transpile: [/@knime\//] } });
40
+ ```
41
+
42
+ ## License
43
+
44
+ GPL 3 and Additional Permissions according to Sec. 7 (SEE the file LICENSE)
45
+
46
+ [@knime/product-features]: https://www.npmjs.com/package/@knime/product-features
package/dist/nodes.css CHANGED
@@ -15,57 +15,20 @@
15
15
  }
16
16
  }
17
17
 
18
- [data-type="flowVariable"] {
19
- &[data-v-3150264d] {
20
- fill: transparent;
21
- stroke: var(--kds-color-port-flow-variable);
22
- }
23
- &.filled[data-v-3150264d] {
24
- fill: var(--kds-color-port-flow-variable);
25
- }
26
- }
27
- [data-type="table"] {
28
- &[data-v-3150264d] {
29
- fill: transparent;
30
- stroke: var(--kds-color-port-data);
31
- }
32
- &.filled[data-v-3150264d] {
33
- fill: var(--kds-color-port-data);
34
- }
35
- }
36
- [data-type="other"],
37
- [data-type="generic"] {
38
- &[data-v-3150264d] {
39
- fill: transparent;
40
-
41
- /** dark mode for custom colors generated using oklch */
42
- --base: var(--v45d93a60);
43
- --color: light-dark(
44
- var(--base),
45
- oklch(from var(--base) calc(1 - l * 0.8) c h)
46
- );
47
-
48
- stroke: var(--color);
49
- }
50
- &.filled[data-v-3150264d] {
51
- fill: var(--color);
52
- }
53
- }
54
-
55
- .wrapper[data-v-4920a7fa] {
18
+ .wrapper[data-v-24ca3cba] {
56
19
  display: grid;
57
20
  grid-template-columns: var(--kds-spacing-container-0-5x) 1fr;
58
21
  gap: var(--kds-spacing-container-0-5x);
59
22
  }
60
- .icon[data-v-4920a7fa] {
23
+ .icon[data-v-24ca3cba] {
61
24
  display: flex;
62
25
  align-items: center;
63
26
  }
64
- .name[data-v-4920a7fa],
65
- .description[data-v-4920a7fa] {
27
+ .name[data-v-24ca3cba],
28
+ .description[data-v-24ca3cba] {
66
29
  grid-column: 2;
67
30
  }
68
- .title[data-v-4920a7fa] {
31
+ .title[data-v-24ca3cba] {
69
32
  font: var(--kds-font-base-title-small-strong);
70
33
  }
71
34
 
@@ -174,11 +137,11 @@
174
137
  }
175
138
 
176
139
  .node-preview {
177
- &[data-v-a3b6413d] {
140
+ &[data-v-1ba51279] {
178
141
  display: flex;
179
142
  flex-direction: column;
180
143
  gap: var(--kds-spacing-container-0-25x);
181
- width: calc(var(--v040783bc) * 1px);
144
+ width: calc(var(--v6131ee48) * 1px);
182
145
 
183
146
  /*
184
147
  * `zoom` is used instead of `transform: scale()` so that the shrunk size
@@ -186,13 +149,13 @@
186
149
  * container alongside other elements.
187
150
  */
188
151
  }
189
- &[data-size="small"][data-v-a3b6413d] {
190
- zoom: calc(12 / var(--a08071d8));
152
+ &[data-size="small"][data-v-1ba51279] {
153
+ zoom: calc(12 / var(--v455a0ba0));
191
154
  }
192
- &[data-size="medium"][data-v-a3b6413d] {
155
+ &[data-size="medium"][data-v-1ba51279] {
193
156
  zoom: 0.5;
194
157
  }
195
- & .indicators[data-v-a3b6413d] {
158
+ & .indicators[data-v-1ba51279] {
196
159
  display: flex;
197
160
  gap: var(--kds-spacing-container-0-25x);
198
161
  justify-content: center;
package/dist/nodes.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BOaGB7Aw.js";
2
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, useCssVars, withCtx } from "vue";
3
- import { KdsAccordion, KdsDescription, KdsEmptyState, KdsIcon, KdsTabBar } from "@knime/kds-components";
2
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, useCssVars, withCtx } from "vue";
3
+ import { KdsAccordion, KdsDescription, KdsEmptyState, KdsIcon, KdsPortIcon, KdsTabBar, PORT_SIZE } from "@knime/kds-components";
4
4
  import './nodes.css';//#region src/nodes/NodeDescriptionTabs/OptionsTab.vue?vue&type=script&setup=true&lang.ts
5
- var _hoisted_1$9 = { class: "name" };
6
- var _hoisted_2$5 = {
5
+ var _hoisted_1$7 = { class: "name" };
6
+ var _hoisted_2$4 = {
7
7
  key: 1,
8
8
  class: "single-option-wrapper"
9
9
  };
10
- var _hoisted_3$4 = { class: "name" };
10
+ var _hoisted_3$3 = { class: "name" };
11
11
  //#endregion
12
12
  //#region src/nodes/NodeDescriptionTabs/OptionsTab.vue
13
13
  var OptionsTab_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -44,13 +44,13 @@ var OptionsTab_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
44
44
  return openBlock(), createElementBlock("div", {
45
45
  key: field.name,
46
46
  class: "option-content"
47
- }, [createElementVNode("span", _hoisted_1$9, toDisplayString(field.name) + " " + toDisplayString(field.optional ? "(optional)" : ""), 1), createVNode(unref(KdsDescription), {
47
+ }, [createElementVNode("span", _hoisted_1$7, toDisplayString(field.name) + " " + toDisplayString(field.optional ? "(optional)" : ""), 1), createVNode(unref(KdsDescription), {
48
48
  text: field.description,
49
49
  "render-as-html": __props.renderAsHtml
50
50
  }, null, 8, ["text", "render-as-html"])]);
51
51
  }), 128))])
52
52
  };
53
- })]), 1032, ["modelValue", "items"])) : createCommentVNode("", true), __props.options.length === 1 ? (openBlock(), createElementBlock("div", _hoisted_2$5, [__props.options[0].sectionDescription ? (openBlock(), createBlock(unref(KdsDescription), {
53
+ })]), 1032, ["modelValue", "items"])) : createCommentVNode("", true), __props.options.length === 1 ? (openBlock(), createElementBlock("div", _hoisted_2$4, [__props.options[0].sectionDescription ? (openBlock(), createBlock(unref(KdsDescription), {
54
54
  key: 0,
55
55
  text: __props.options[0].sectionDescription,
56
56
  "render-as-html": __props.renderAsHtml,
@@ -59,7 +59,7 @@ var OptionsTab_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
59
59
  return openBlock(), createElementBlock("div", {
60
60
  key: field.name,
61
61
  class: "option-content"
62
- }, [createElementVNode("span", _hoisted_3$4, toDisplayString(field.name) + " " + toDisplayString(field.optional ? "(optional)" : ""), 1), createVNode(unref(KdsDescription), {
62
+ }, [createElementVNode("span", _hoisted_3$3, toDisplayString(field.name) + " " + toDisplayString(field.optional ? "(optional)" : ""), 1), createVNode(unref(KdsDescription), {
63
63
  text: field.description,
64
64
  "render-as-html": __props.renderAsHtml
65
65
  }, null, 8, ["text", "render-as-html"])]);
@@ -68,127 +68,6 @@ var OptionsTab_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
68
68
  }
69
69
  }), [["__scopeId", "data-v-4fcd17b8"]]);
70
70
  //#endregion
71
- //#region src/nodes/PortIcon/constants.ts
72
- var PORT_STROKE_WIDTH = 1.4;
73
- //#endregion
74
- //#region src/nodes/PortIcon/SVGPortIcon.vue?vue&type=script&setup=true&lang.ts
75
- var _hoisted_1$8 = [
76
- "points",
77
- "data-type",
78
- "stroke-width"
79
- ];
80
- var _hoisted_2$4 = [
81
- "r",
82
- "data-type",
83
- "stroke-width"
84
- ];
85
- var _hoisted_3$3 = [
86
- "width",
87
- "height",
88
- "x",
89
- "y",
90
- "data-type",
91
- "stroke-width"
92
- ];
93
- //#endregion
94
- //#region src/nodes/PortIcon/SVGPortIcon.vue
95
- var SVGPortIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
96
- __name: "SVGPortIcon",
97
- props: {
98
- type: {},
99
- color: {},
100
- filled: {
101
- type: Boolean,
102
- default: true
103
- }
104
- },
105
- setup(__props) {
106
- useCssVars((_ctx) => ({ "v45d93a60": _ctx.color }));
107
- const trianglePath = computed(() => {
108
- let [x1, y1, x2, y3] = [
109
- -8 / 2,
110
- -8 / 2,
111
- 8 / 2,
112
- 8 / 2
113
- ];
114
- const d = Math.sqrt(5) / 2;
115
- const y = d / 2 + 1 / 4;
116
- x1 += PORT_STROKE_WIDTH / 2;
117
- x2 -= PORT_STROKE_WIDTH * d;
118
- y1 += PORT_STROKE_WIDTH * y;
119
- y3 -= PORT_STROKE_WIDTH * y;
120
- return `${x1},${y1} ${x2},0 ${x1},${y3}`;
121
- });
122
- return (_ctx, _cache) => {
123
- return __props.type === "table" ? (openBlock(), createElementBlock("polygon", mergeProps({
124
- key: 0,
125
- points: trianglePath.value,
126
- class: { filled: __props.filled },
127
- "data-type": __props.type,
128
- "stroke-width": unref(PORT_STROKE_WIDTH)
129
- }, _ctx.$attrs), null, 16, _hoisted_1$8)) : __props.type === "flowVariable" ? (openBlock(), createElementBlock("circle", mergeProps({
130
- key: 1,
131
- r: unref(8) / 2 - unref(PORT_STROKE_WIDTH) / 2,
132
- class: { filled: __props.filled },
133
- "data-type": __props.type,
134
- "stroke-width": unref(PORT_STROKE_WIDTH)
135
- }, _ctx.$attrs), null, 16, _hoisted_2$4)) : (openBlock(), createElementBlock("rect", mergeProps({
136
- key: 2,
137
- width: unref(8) - unref(PORT_STROKE_WIDTH),
138
- height: unref(8) - unref(PORT_STROKE_WIDTH),
139
- x: -unref(8) / 2 + unref(PORT_STROKE_WIDTH) / 2,
140
- y: -unref(8) / 2 + unref(PORT_STROKE_WIDTH) / 2,
141
- class: { filled: __props.filled },
142
- "data-type": __props.type,
143
- "stroke-width": unref(PORT_STROKE_WIDTH)
144
- }, _ctx.$attrs), null, 16, _hoisted_3$3));
145
- };
146
- }
147
- }), [["__scopeId", "data-v-3150264d"]]);
148
- //#endregion
149
- //#region src/nodes/PortIcon/PortIcon.vue?vue&type=script&setup=true&lang.ts
150
- var _hoisted_1$7 = [
151
- "viewBox",
152
- "width",
153
- "height"
154
- ];
155
- //#endregion
156
- //#region src/nodes/PortIcon/PortIcon.vue
157
- var PortIcon_default = /* @__PURE__ */ defineComponent({
158
- __name: "PortIcon",
159
- props: {
160
- type: {},
161
- color: {},
162
- filled: {
163
- type: Boolean,
164
- default: true
165
- }
166
- },
167
- setup(__props) {
168
- const viewBox = computed(() => [
169
- -8 / 2,
170
- -8 / 2,
171
- 8,
172
- 8
173
- ].join(" "));
174
- return (_ctx, _cache) => {
175
- return openBlock(), createElementBlock("svg", {
176
- viewBox: viewBox.value,
177
- width: unref(8),
178
- height: unref(8)
179
- }, [createVNode(SVGPortIcon_default, {
180
- filled: __props.filled,
181
- type: __props.type,
182
- color: __props.color
183
- }, null, 8, [
184
- "filled",
185
- "type",
186
- "color"
187
- ])], 8, _hoisted_1$7);
188
- };
189
- }
190
- });
191
- //#endregion
192
71
  //#region src/nodes/NodeDescriptionTabs/PortTemplateInfo.vue?vue&type=script&setup=true&lang.ts
193
72
  var _hoisted_1$6 = { class: "wrapper" };
194
73
  var _hoisted_2$3 = { class: "icon" };
@@ -205,14 +84,14 @@ var PortTemplateInfo_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/
205
84
  setup(__props) {
206
85
  return (_ctx, _cache) => {
207
86
  return openBlock(), createElementBlock("div", _hoisted_1$6, [
208
- createElementVNode("div", _hoisted_2$3, [createVNode(PortIcon_default, {
87
+ createElementVNode("div", _hoisted_2$3, [createVNode(unref(KdsPortIcon), {
209
88
  type: __props.port.type,
210
89
  color: __props.port.color,
211
- filled: !__props.port.optional
90
+ optional: __props.port.optional
212
91
  }, null, 8, [
213
92
  "type",
214
93
  "color",
215
- "filled"
94
+ "optional"
216
95
  ])]),
217
96
  createElementVNode("span", _hoisted_3$2, "Type: " + toDisplayString(__props.port.typeDisplayName), 1),
218
97
  createElementVNode("span", _hoisted_4, "Name: " + toDisplayString(__props.port.name), 1),
@@ -225,7 +104,7 @@ var PortTemplateInfo_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/
225
104
  ]);
226
105
  };
227
106
  }
228
- }), [["__scopeId", "data-v-4920a7fa"]]);
107
+ }), [["__scopeId", "data-v-24ca3cba"]]);
229
108
  //#endregion
230
109
  //#region src/nodes/NodeDescriptionTabs/PortGroup.vue?vue&type=script&setup=true&lang.ts
231
110
  var _hoisted_1$5 = { class: "port-group-card" };
@@ -578,10 +457,10 @@ var NodePreview_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
578
457
  },
579
458
  setup(__props) {
580
459
  useCssVars((_ctx) => ({
581
- "v040783bc": width.value,
582
- "a08071d8": unref(32)
460
+ "v6131ee48": width.value,
461
+ "v455a0ba0": unref(32)
583
462
  }));
584
- const horizontalSpaceForPorts = computed(() => __props.hidePorts ? 0 : 8);
463
+ const horizontalSpaceForPorts = computed(() => __props.hidePorts ? 0 : PORT_SIZE);
585
464
  const width = computed(() => 32 + 2 * horizontalSpaceForPorts.value);
586
465
  const height = 32;
587
466
  const viewBox = computed(() => `-${horizontalSpaceForPorts.value} 0 ${width.value} ${height}`);
@@ -589,8 +468,8 @@ var NodePreview_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
589
468
  let spacing = 1;
590
469
  if (total === 2) spacing = 12;
591
470
  else if (total === 3) spacing = 2;
592
- const delta = (32 - (total * 8 + (total - 1) * spacing)) / 2;
593
- return (spacing + 8) * index + delta + 8 / 2;
471
+ const delta = (32 - (total * PORT_SIZE + (total - 1) * spacing)) / 2;
472
+ return (spacing + PORT_SIZE) * index + delta + PORT_SIZE / 2;
594
473
  }
595
474
  const cutOffPorts = (ports) => {
596
475
  if (ports.length > maxShownPorts) return [...ports.slice(0, maxShownPorts)];
@@ -616,28 +495,30 @@ var NodePreview_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
616
495
  "icon",
617
496
  "is-component"
618
497
  ]), !__props.hidePorts ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [(openBlock(true), createElementBlock(Fragment, null, renderList(visibleInPorts.value, (port, index) => {
619
- return openBlock(), createBlock(SVGPortIcon_default, {
498
+ return openBlock(), createBlock(unref(KdsPortIcon), {
620
499
  key: `in-${index}`,
621
500
  color: port.color,
622
- filled: !port.optional,
501
+ optional: port.optional,
623
502
  type: port.type,
624
- transform: `translate(-${unref(8) / 2}, ${yPortShift(index, visibleInPorts.value.length)})`
503
+ standalone: false,
504
+ transform: `translate(-${unref(PORT_SIZE) / 2}, ${yPortShift(index, visibleInPorts.value.length)})`
625
505
  }, null, 8, [
626
506
  "color",
627
- "filled",
507
+ "optional",
628
508
  "type",
629
509
  "transform"
630
510
  ]);
631
511
  }), 128)), (openBlock(true), createElementBlock(Fragment, null, renderList(visibleOutPorts.value, (port, index) => {
632
- return openBlock(), createBlock(SVGPortIcon_default, {
512
+ return openBlock(), createBlock(unref(KdsPortIcon), {
633
513
  key: `out-${index}`,
634
514
  color: port.color,
635
- filled: !port.optional,
515
+ optional: port.optional,
636
516
  type: port.type,
637
- transform: `translate(${unref(32) + unref(8) / 2}, ${yPortShift(index, visibleOutPorts.value.length)})`
517
+ standalone: false,
518
+ transform: `translate(${unref(32) + unref(PORT_SIZE) / 2}, ${yPortShift(index, visibleOutPorts.value.length)})`
638
519
  }, null, 8, [
639
520
  "color",
640
- "filled",
521
+ "optional",
641
522
  "type",
642
523
  "transform"
643
524
  ]);
@@ -653,8 +534,8 @@ var NodePreview_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
653
534
  })) : createCommentVNode("", true)])) : createCommentVNode("", true)], 8, _hoisted_1);
654
535
  };
655
536
  }
656
- }), [["__scopeId", "data-v-a3b6413d"]]);
537
+ }), [["__scopeId", "data-v-1ba51279"]]);
657
538
  //#endregion
658
- export { NodeDescriptionTabs_default as NodeDescriptionTabs, NodePreview_default as NodePreview, PortIcon_default as PortIcon };
539
+ export { NodeDescriptionTabs_default as NodeDescriptionTabs, NodePreview_default as NodePreview };
659
540
 
660
541
  //# sourceMappingURL=nodes.js.map