@knime/kds-code-editor 2.9.0 → 3.0.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,19 @@
1
1
  # @knime/kds-code-editor
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 615020a: `KdsCodeEditor`: add a "Copy to clipboard" tooltip to the copy button
8
+ - ced1a3a: `KdsCodeEditor`: fix monaco popovers appearing in the wrong place when the editor is rendered inside a container with a CSS `transform`
9
+ - Updated dependencies [13cbb42]
10
+ - Updated dependencies [356af93]
11
+ - Updated dependencies [356af93]
12
+ - Updated dependencies [e366f77]
13
+ - Updated dependencies [e26e15d]
14
+ - @knime/kds-styles@3.0.0
15
+ - @knime/kds-components@3.0.0
16
+
3
17
  ## 2.9.0
4
18
 
5
19
  ### Patch Changes
package/dist/index.css CHANGED
@@ -1,13 +1,13 @@
1
1
 
2
2
  .kds-code-editor {
3
- &[data-v-c9256fb0] {
3
+ &[data-v-26f569f5] {
4
4
  display: flex;
5
5
  flex-direction: column;
6
6
 
7
7
  /* No row bounds set: fill the width and height of the container. */
8
8
  }
9
9
  .editor {
10
- &[data-v-c9256fb0] {
10
+ &[data-v-26f569f5] {
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  overflow: hidden;
@@ -21,12 +21,12 @@
21
21
  /* Keeps its natural height — in fill mode only the code area grows /
22
22
  shrinks with the container. */
23
23
  }
24
- &.focused[data-v-c9256fb0] {
24
+ &.focused[data-v-26f569f5] {
25
25
  outline: var(--kds-border-action-focused);
26
26
  outline-offset: var(--kds-spacing-offset-focus);
27
27
  }
28
28
  .header {
29
- &[data-v-c9256fb0] {
29
+ &[data-v-26f569f5] {
30
30
  display: flex;
31
31
  align-items: center;
32
32
  justify-content: space-between;
@@ -34,7 +34,7 @@
34
34
  var(--kds-spacing-container-0-5x) var(--kds-spacing-container-0-25x)
35
35
  var(--kds-spacing-container-0-75x);
36
36
  }
37
- .left-block[data-v-c9256fb0] {
37
+ .left-block[data-v-26f569f5] {
38
38
  display: flex;
39
39
  flex: 1;
40
40
  gap: var(--kds-spacing-container-0-25x);
@@ -45,13 +45,13 @@
45
45
  buttons are present (matches the small button height). */
46
46
  min-height: var(--kds-dimension-component-height-1-5x);
47
47
  }
48
- .action-buttons[data-v-c9256fb0] {
48
+ .action-buttons[data-v-26f569f5] {
49
49
  display: flex;
50
50
  flex-shrink: 0;
51
51
  gap: var(--kds-spacing-container-0-12x);
52
52
  align-items: center;
53
53
  }
54
- .title[data-v-c9256fb0] {
54
+ .title[data-v-26f569f5] {
55
55
  overflow: hidden;
56
56
  text-overflow: ellipsis;
57
57
  font: var(--kds-font-base-interactive-small);
@@ -59,27 +59,27 @@
59
59
  white-space: nowrap;
60
60
  }
61
61
  }
62
- &.error .header[data-v-c9256fb0] {
62
+ &.error .header[data-v-26f569f5] {
63
63
  background-color: var(--kds-color-background-static-danger-muted);
64
64
  }
65
- &.warning .header[data-v-c9256fb0] {
65
+ &.warning .header[data-v-26f569f5] {
66
66
  background-color: var(--kds-color-background-static-warning-muted);
67
67
  }
68
- .code[data-v-c9256fb0] {
68
+ .code[data-v-26f569f5] {
69
69
  width: 100%;
70
70
  }
71
- .footer[data-v-c9256fb0] {
71
+ .footer[data-v-26f569f5] {
72
72
  flex-shrink: 0;
73
73
  width: 100%;
74
74
  }
75
75
  }
76
76
  &.fill {
77
- &[data-v-c9256fb0] {
77
+ &[data-v-26f569f5] {
78
78
  width: 100%;
79
79
  height: 100%;
80
80
  }
81
- .editor[data-v-c9256fb0],
82
- .code[data-v-c9256fb0] {
81
+ .editor[data-v-26f569f5],
82
+ .code[data-v-26f569f5] {
83
83
  flex: 1 1 auto;
84
84
  min-height: 0;
85
85
  }
package/dist/index.js CHANGED
@@ -4604,27 +4604,27 @@ var font = {
4604
4604
  code: {
4605
4605
  xsmall: {
4606
4606
  fontFamily: "Roboto Mono",
4607
- fontWeight: 400,
4607
+ fontWeight: 300,
4608
4608
  fontSize: {
4609
4609
  value: 10,
4610
4610
  unit: "px"
4611
4611
  },
4612
4612
  lineHeight: "normal",
4613
4613
  css: {
4614
- value: "400 10px/normal 'Roboto Mono', monospace",
4614
+ value: "300 10px/normal 'Roboto Mono', monospace",
4615
4615
  variable: "var(--kds-font-base-code-xsmall)"
4616
4616
  }
4617
4617
  },
4618
4618
  small: {
4619
4619
  fontFamily: "Roboto Mono",
4620
- fontWeight: 400,
4620
+ fontWeight: 300,
4621
4621
  fontSize: {
4622
- value: 11,
4622
+ value: 12,
4623
4623
  unit: "px"
4624
4624
  },
4625
4625
  lineHeight: "normal",
4626
4626
  css: {
4627
- value: "400 11px/normal 'Roboto Mono', monospace",
4627
+ value: "300 12px/normal 'Roboto Mono', monospace",
4628
4628
  variable: "var(--kds-font-base-code-small)"
4629
4629
  }
4630
4630
  }
@@ -5169,6 +5169,7 @@ var KdsCodeEditor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
5169
5169
  const subTextId = useId();
5170
5170
  const container = useTemplateRef("editor-container");
5171
5171
  let editorInstance;
5172
+ let overflowWidgetsDomNode;
5172
5173
  const isEditorFocused = ref(false);
5173
5174
  const headerLabel = computed(() => __props.languageLabel ?? __props.language.toUpperCase());
5174
5175
  const editorAriaLabel = computed(() => `${headerLabel.value} code editor${__props.readOnly ? ", read-only" : ""}. Press Escape followed by Tab to move focus out of the editor.`);
@@ -5202,6 +5203,9 @@ var KdsCodeEditor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
5202
5203
  };
5203
5204
  onMounted(() => {
5204
5205
  if (!container.value) return;
5206
+ overflowWidgetsDomNode = document.createElement("div");
5207
+ overflowWidgetsDomNode.classList.add("monaco-editor");
5208
+ document.body.appendChild(overflowWidgetsDomNode);
5205
5209
  editorInstance = editor.create(container.value, {
5206
5210
  value: modelValue.value,
5207
5211
  language: __props.language,
@@ -5214,6 +5218,7 @@ var KdsCodeEditor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
5214
5218
  fontWeight: `${codeFont.fontWeight}`,
5215
5219
  fontSize: codeFont.fontSize.value,
5216
5220
  fixedOverflowWidgets: true,
5221
+ overflowWidgetsDomNode,
5217
5222
  scrollbar: { alwaysConsumeMouseWheel: false },
5218
5223
  readOnly: __props.readOnly,
5219
5224
  theme: getMonacoTheme(isDarkMode.value),
@@ -5282,6 +5287,7 @@ var KdsCodeEditor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
5282
5287
  });
5283
5288
  onUnmounted(() => {
5284
5289
  editorInstance?.dispose();
5290
+ overflowWidgetsDomNode?.remove();
5285
5291
  });
5286
5292
  __expose({
5287
5293
  /** The underlying Monaco editor instance, available after mount. */
@@ -5317,6 +5323,7 @@ getEditor: () => editorInstance });
5317
5323
  state: unref(copied) ? "success" : "default",
5318
5324
  size: "small",
5319
5325
  variant: "transparent",
5326
+ tooltip: "Copy to clipboard",
5320
5327
  onClick: copyToClipboard
5321
5328
  }), null, 16, ["leading-icon", "state"])) : createCommentVNode("", true)])])) : createCommentVNode("", true),
5322
5329
  createElementVNode("div", {
@@ -5349,7 +5356,7 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
5349
5356
  };
5350
5357
  //#endregion
5351
5358
  //#region src/CodeEditor/KdsCodeEditor.vue
5352
- var KdsCodeEditor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(KdsCodeEditor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-c9256fb0"]]);
5359
+ var KdsCodeEditor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(KdsCodeEditor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-26f569f5"]]);
5353
5360
  //#endregion
5354
5361
  //#region src/Console/utils/buildTheme.ts
5355
5362
  /**