@knime/kds-code-editor 5.0.0 → 6.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,14 @@
1
1
  # @knime/kds-code-editor
2
2
 
3
+ ## 6.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 3041c30: `KdsCodeEditor` and `KdsConsole` now theme from the effective dark-mode state (`useKdsDarkMode().isDark`), so they follow the `system` (OS) preference instead of only an explicit dark/light preference.
8
+ - Updated dependencies [3041c30]
9
+ - @knime/kds-components@6.0.0
10
+ - @knime/kds-styles@6.0.0
11
+
3
12
  ## 5.0.0
4
13
 
5
14
  ### Patch Changes
package/dist/index.css CHANGED
@@ -1,13 +1,13 @@
1
1
 
2
2
  .kds-code-editor {
3
- &[data-v-26f569f5] {
3
+ &[data-v-b08b3037] {
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-26f569f5] {
10
+ &[data-v-b08b3037] {
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-26f569f5] {
24
+ &.focused[data-v-b08b3037] {
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-26f569f5] {
29
+ &[data-v-b08b3037] {
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-26f569f5] {
37
+ .left-block[data-v-b08b3037] {
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-26f569f5] {
48
+ .action-buttons[data-v-b08b3037] {
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-26f569f5] {
54
+ .title[data-v-b08b3037] {
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-26f569f5] {
62
+ &.error .header[data-v-b08b3037] {
63
63
  background-color: var(--kds-color-background-static-danger-muted);
64
64
  }
65
- &.warning .header[data-v-26f569f5] {
65
+ &.warning .header[data-v-b08b3037] {
66
66
  background-color: var(--kds-color-background-static-warning-muted);
67
67
  }
68
- .code[data-v-26f569f5] {
68
+ .code[data-v-b08b3037] {
69
69
  width: 100%;
70
70
  }
71
- .footer[data-v-26f569f5] {
71
+ .footer[data-v-b08b3037] {
72
72
  flex-shrink: 0;
73
73
  width: 100%;
74
74
  }
75
75
  }
76
76
  &.fill {
77
- &[data-v-26f569f5] {
77
+ &[data-v-b08b3037] {
78
78
  width: 100%;
79
79
  height: 100%;
80
80
  }
81
- .editor[data-v-26f569f5],
82
- .code[data-v-26f569f5] {
81
+ .editor[data-v-b08b3037],
82
+ .code[data-v-b08b3037] {
83
83
  flex: 1 1 auto;
84
84
  min-height: 0;
85
85
  }
@@ -305,7 +305,7 @@
305
305
  }
306
306
 
307
307
  .terminal {
308
- &[data-v-c23d8d58] {
308
+ &[data-v-646b2bdc] {
309
309
  height: 100%;
310
310
  overflow: hidden;
311
311
  border-radius: var(--kds-border-radius-container-0-12x);
@@ -313,7 +313,7 @@
313
313
  /* Only paint a focus ring when the user navigated to the terminal with the
314
314
  keyboard (mouse focus doesn't need the extra ring). */
315
315
  }
316
- &.focus-painted[data-v-c23d8d58]:focus-within {
316
+ &.focus-painted[data-v-646b2bdc]:focus-within {
317
317
  outline: var(--kds-border-action-focused);
318
318
  outline-offset: var(--kds-spacing-offset-focus);
319
319
  }
package/dist/index.js CHANGED
@@ -5184,8 +5184,8 @@ var KdsCodeEditor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
5184
5184
  return `${lineHeight.value * rows + EXTRA_PADDING}px`;
5185
5185
  });
5186
5186
  const codeFont = font.base.code.small;
5187
- const getMonacoTheme = (isDark) => isDark ? MONACO_THEME_DARK : MONACO_THEME_LIGHT;
5188
- const { isDarkMode } = useKdsDarkMode();
5187
+ const getMonacoTheme = (dark) => dark ? MONACO_THEME_DARK : MONACO_THEME_LIGHT;
5188
+ const { isDark } = useKdsDarkMode();
5189
5189
  const getEditorInputElement = () => container.value?.querySelector("[role=\"textbox\"]");
5190
5190
  const syncEditorInputAria = () => {
5191
5191
  const input = getEditorInputElement();
@@ -5221,7 +5221,7 @@ var KdsCodeEditor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
5221
5221
  overflowWidgetsDomNode,
5222
5222
  scrollbar: { alwaysConsumeMouseWheel: false },
5223
5223
  readOnly: __props.readOnly,
5224
- theme: getMonacoTheme(isDarkMode.value),
5224
+ theme: getMonacoTheme(isDark.value),
5225
5225
  ariaLabel: editorAriaLabel.value,
5226
5226
  accessibilitySupport: "on"
5227
5227
  });
@@ -5259,8 +5259,8 @@ var KdsCodeEditor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
5259
5259
  isEditorFocused.value = false;
5260
5260
  });
5261
5261
  });
5262
- watch(isDarkMode, (isDark) => {
5263
- if (editorInstance) editorInstance.updateOptions({ theme: getMonacoTheme(isDark) });
5262
+ watch(isDark, (dark) => {
5263
+ if (editorInstance) editorInstance.updateOptions({ theme: getMonacoTheme(dark) });
5264
5264
  });
5265
5265
  watch(() => __props.readOnly, (isReadOnly) => {
5266
5266
  editorInstance?.updateOptions({ readOnly: isReadOnly });
@@ -5356,7 +5356,7 @@ var _plugin_vue_export_helper_default = (sfc, props) => {
5356
5356
  };
5357
5357
  //#endregion
5358
5358
  //#region src/CodeEditor/KdsCodeEditor.vue
5359
- var KdsCodeEditor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(KdsCodeEditor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-26f569f5"]]);
5359
+ var KdsCodeEditor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(KdsCodeEditor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-b08b3037"]]);
5360
5360
  //#endregion
5361
5361
  //#region src/Console/utils/buildTheme.ts
5362
5362
  /**
@@ -5491,7 +5491,7 @@ var KdsConsole_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
5491
5491
  emits: ["console-created"],
5492
5492
  setup(__props, { emit: __emit }) {
5493
5493
  const emit = __emit;
5494
- const { isDarkMode } = useKdsDarkMode();
5494
+ const { isDark } = useKdsDarkMode();
5495
5495
  const codeFont = font.base.code.small;
5496
5496
  const term = new Terminal({
5497
5497
  letterSpacing: 0,
@@ -5501,7 +5501,7 @@ var KdsConsole_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
5501
5501
  convertEol: true,
5502
5502
  disableStdin: true,
5503
5503
  cursorBlink: false,
5504
- theme: buildTheme(isDarkMode.value ? "dark" : "light")
5504
+ theme: buildTheme(isDark.value ? "dark" : "light")
5505
5505
  });
5506
5506
  const unicode11Addon = new Unicode11Addon();
5507
5507
  term.loadAddon(unicode11Addon);
@@ -5532,7 +5532,7 @@ var KdsConsole_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
5532
5532
  });
5533
5533
  term.onWriteParsed(() => term.scrollToBottom());
5534
5534
  watchEffect(() => {
5535
- term.options.theme = buildTheme(isDarkMode.value ? "dark" : "light");
5535
+ term.options.theme = buildTheme(isDark.value ? "dark" : "light");
5536
5536
  });
5537
5537
  const format = (text) => {
5538
5538
  if ("error" in text) return `\x1b[31m[ERROR] ${text.error}\x1b[0m`;
@@ -5562,7 +5562,7 @@ var KdsConsole_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
5562
5562
  }, null, 2);
5563
5563
  };
5564
5564
  }
5565
- }), [["__scopeId", "data-v-c23d8d58"]]);
5565
+ }), [["__scopeId", "data-v-646b2bdc"]]);
5566
5566
  //#endregion
5567
5567
  export { KdsCodeEditor_default as KdsCodeEditor, KdsConsole_default as KdsConsole, kdsCodeEditorState, kdsCodeEditorStates, setupMonacoEnvironment };
5568
5568