@kong-ui-public/entities-plugins 9.251.1 → 9.251.2

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/README.md CHANGED
@@ -7,6 +7,7 @@ Plugin entity components.
7
7
  - [Usage](#usage)
8
8
  - [Install](#install)
9
9
  - [Registration](#registration)
10
+ - [Color mode (light/dark theme)](#color-mode-lightdark-theme)
10
11
  - [Individual component documentation](#individual-component-documentation)
11
12
 
12
13
  ## Requirements
@@ -43,6 +44,20 @@ import { PluginList, PluginSelect, PluginForm, PluginConfigCard } from '@kong-ui
43
44
  import '@kong-ui-public/entities-plugins/dist/style.css'
44
45
  ```
45
46
 
47
+ ### Color mode (light/dark theme)
48
+
49
+ Components in this package that embed a Monaco-based editor (for example the plugin free-form code editors) automatically match the host application's active color mode. To enable this, the host application should `provide` a `ComputedRef<'light' | 'dark'>` under the `app:konnectColorMode` injection key. When provided, the editors reactively switch between their light and dark themes as the value changes. When the key is not provided, the editors fall back to the `'light'` theme.
50
+
51
+ ```ts
52
+ // In the host application (e.g. within your root component's setup)
53
+ import { computed, provide } from 'vue'
54
+
55
+ // `isDarkMode` is however your app tracks its current theme
56
+ const colorMode = computed<'light' | 'dark'>(() => (isDarkMode.value ? 'dark' : 'light'))
57
+
58
+ provide('app:konnectColorMode', colorMode)
59
+ ```
60
+
46
61
  ## Individual component documentation
47
62
 
48
63
  - [`<PluginList.vue />`](docs/plugin-list.md)