@kispace-io/core 0.7.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.
Files changed (272) hide show
  1. package/dist/api/base-classes.d.ts +7 -0
  2. package/dist/api/base-classes.d.ts.map +1 -0
  3. package/dist/api/constants.d.ts +2 -0
  4. package/dist/api/constants.d.ts.map +1 -0
  5. package/dist/api/index.d.ts +6 -0
  6. package/dist/api/index.d.ts.map +1 -0
  7. package/dist/api/index.js +80 -0
  8. package/dist/api/index.js.map +1 -0
  9. package/dist/api/services.d.ts +27 -0
  10. package/dist/api/services.d.ts.map +1 -0
  11. package/dist/api/types.d.ts +11 -0
  12. package/dist/api/types.d.ts.map +1 -0
  13. package/dist/commands/files.d.ts +2 -0
  14. package/dist/commands/files.d.ts.map +1 -0
  15. package/dist/commands/global.d.ts +1 -0
  16. package/dist/commands/global.d.ts.map +1 -0
  17. package/dist/commands/index.d.ts +1 -0
  18. package/dist/commands/index.d.ts.map +1 -0
  19. package/dist/commands/version-info.d.ts +2 -0
  20. package/dist/commands/version-info.d.ts.map +1 -0
  21. package/dist/components/index.d.ts +1 -0
  22. package/dist/components/index.d.ts.map +1 -0
  23. package/dist/components/k-app-selector.d.ts +17 -0
  24. package/dist/components/k-app-selector.d.ts.map +1 -0
  25. package/dist/components/k-app-switcher.d.ts +13 -0
  26. package/dist/components/k-app-switcher.d.ts.map +1 -0
  27. package/dist/components/k-command.d.ts +31 -0
  28. package/dist/components/k-command.d.ts.map +1 -0
  29. package/dist/components/k-extensions.d.ts +32 -0
  30. package/dist/components/k-extensions.d.ts.map +1 -0
  31. package/dist/components/k-fastviews.d.ts +34 -0
  32. package/dist/components/k-fastviews.d.ts.map +1 -0
  33. package/dist/components/k-filebrowser.d.ts +40 -0
  34. package/dist/components/k-filebrowser.d.ts.map +1 -0
  35. package/dist/components/k-language-selector.d.ts +12 -0
  36. package/dist/components/k-language-selector.d.ts.map +1 -0
  37. package/dist/components/k-log-terminal.d.ts +36 -0
  38. package/dist/components/k-log-terminal.d.ts.map +1 -0
  39. package/dist/components/k-part-name.d.ts +12 -0
  40. package/dist/components/k-part-name.d.ts.map +1 -0
  41. package/dist/components/k-tasks.d.ts +13 -0
  42. package/dist/components/k-tasks.d.ts.map +1 -0
  43. package/dist/components/k-workspace-name.d.ts +14 -0
  44. package/dist/components/k-workspace-name.d.ts.map +1 -0
  45. package/dist/contributions/default-ui-contributions.d.ts +2 -0
  46. package/dist/contributions/default-ui-contributions.d.ts.map +1 -0
  47. package/dist/contributions/index.d.ts +1 -0
  48. package/dist/contributions/index.d.ts.map +1 -0
  49. package/dist/contributions/marketplace-catalog-contributions.d.ts +2 -0
  50. package/dist/contributions/marketplace-catalog-contributions.d.ts.map +1 -0
  51. package/dist/core/app-host-config.d.ts +7 -0
  52. package/dist/core/app-host-config.d.ts.map +1 -0
  53. package/dist/core/apploader.d.ts +214 -0
  54. package/dist/core/apploader.d.ts.map +1 -0
  55. package/dist/core/appstate.d.ts +12 -0
  56. package/dist/core/appstate.d.ts.map +1 -0
  57. package/dist/core/commandregistry.d.ts +79 -0
  58. package/dist/core/commandregistry.d.ts.map +1 -0
  59. package/dist/core/config.d.ts +15 -0
  60. package/dist/core/config.d.ts.map +1 -0
  61. package/dist/core/constants.d.ts +21 -0
  62. package/dist/core/constants.d.ts.map +1 -0
  63. package/dist/core/contributionregistry.d.ts +49 -0
  64. package/dist/core/contributionregistry.d.ts.map +1 -0
  65. package/dist/core/di.d.ts +18 -0
  66. package/dist/core/di.d.ts.map +1 -0
  67. package/dist/core/dialogservice.d.ts +33 -0
  68. package/dist/core/dialogservice.d.ts.map +1 -0
  69. package/dist/core/editorregistry.d.ts +73 -0
  70. package/dist/core/editorregistry.d.ts.map +1 -0
  71. package/dist/core/esmsh-service.d.ts +40 -0
  72. package/dist/core/esmsh-service.d.ts.map +1 -0
  73. package/dist/core/events.d.ts +7 -0
  74. package/dist/core/events.d.ts.map +1 -0
  75. package/dist/core/events.js +63 -0
  76. package/dist/core/events.js.map +1 -0
  77. package/dist/core/extensionregistry.d.ts +98 -0
  78. package/dist/core/extensionregistry.d.ts.map +1 -0
  79. package/dist/core/filesys.d.ts +139 -0
  80. package/dist/core/filesys.d.ts.map +1 -0
  81. package/dist/core/i18n.d.ts +50 -0
  82. package/dist/core/i18n.d.ts.map +1 -0
  83. package/dist/core/index.d.ts +1 -0
  84. package/dist/core/index.d.ts.map +1 -0
  85. package/dist/core/k-utils.d.ts +2 -0
  86. package/dist/core/k-utils.d.ts.map +1 -0
  87. package/dist/core/keybindings.d.ts +67 -0
  88. package/dist/core/keybindings.d.ts.map +1 -0
  89. package/dist/core/logger.d.ts +44 -0
  90. package/dist/core/logger.d.ts.map +1 -0
  91. package/dist/core/marketplaceregistry.d.ts +25 -0
  92. package/dist/core/marketplaceregistry.d.ts.map +1 -0
  93. package/dist/core/packageinfoservice.d.ts +16 -0
  94. package/dist/core/packageinfoservice.d.ts.map +1 -0
  95. package/dist/core/persistenceservice.d.ts +6 -0
  96. package/dist/core/persistenceservice.d.ts.map +1 -0
  97. package/dist/core/settingsservice.d.ts +19 -0
  98. package/dist/core/settingsservice.d.ts.map +1 -0
  99. package/dist/core/signals.d.ts +3 -0
  100. package/dist/core/signals.d.ts.map +1 -0
  101. package/dist/core/taskservice.d.ts +20 -0
  102. package/dist/core/taskservice.d.ts.map +1 -0
  103. package/dist/core/toast.d.ts +4 -0
  104. package/dist/core/toast.d.ts.map +1 -0
  105. package/dist/core/tree-utils.d.ts +16 -0
  106. package/dist/core/tree-utils.d.ts.map +1 -0
  107. package/dist/dialogs/confirm-dialog.d.ts +14 -0
  108. package/dist/dialogs/confirm-dialog.d.ts.map +1 -0
  109. package/dist/dialogs/index.d.ts +5 -0
  110. package/dist/dialogs/index.d.ts.map +1 -0
  111. package/dist/dialogs/info-dialog.d.ts +13 -0
  112. package/dist/dialogs/info-dialog.d.ts.map +1 -0
  113. package/dist/dialogs/navigable-info-dialog.d.ts +33 -0
  114. package/dist/dialogs/navigable-info-dialog.d.ts.map +1 -0
  115. package/dist/dialogs/prompt-dialog.d.ts +21 -0
  116. package/dist/dialogs/prompt-dialog.d.ts.map +1 -0
  117. package/dist/externals/lit.d.ts +20 -0
  118. package/dist/externals/lit.d.ts.map +1 -0
  119. package/dist/externals/lit.js +15 -0
  120. package/dist/externals/lit.js.map +1 -0
  121. package/dist/externals/third-party.d.ts +7 -0
  122. package/dist/externals/third-party.d.ts.map +1 -0
  123. package/dist/externals/third-party.js +2 -0
  124. package/dist/externals/third-party.js.map +1 -0
  125. package/dist/externals/webawesome.d.ts +1 -0
  126. package/dist/externals/webawesome.d.ts.map +1 -0
  127. package/dist/externals/webawesome.js +52 -0
  128. package/dist/externals/webawesome.js.map +1 -0
  129. package/dist/i18n/extensions.json.d.ts +42 -0
  130. package/dist/i18n/fastviews.json.d.ts +13 -0
  131. package/dist/i18n/filebrowser.json.d.ts +35 -0
  132. package/dist/i18n/index.d.ts +2 -0
  133. package/dist/i18n/index.d.ts.map +1 -0
  134. package/dist/i18n/logterminal.json.d.ts +45 -0
  135. package/dist/i18n/partname.json.d.ts +15 -0
  136. package/dist/i18n/tasks.json.d.ts +15 -0
  137. package/dist/i18n/workspace.json.d.ts +15 -0
  138. package/dist/index.d.ts +2 -0
  139. package/dist/index.d.ts.map +1 -0
  140. package/dist/index.js +80 -0
  141. package/dist/index.js.map +1 -0
  142. package/dist/k-icon-BZC7dQV0.js +492 -0
  143. package/dist/k-icon-BZC7dQV0.js.map +1 -0
  144. package/dist/k-nocontent-Bh_yToGh.js +48 -0
  145. package/dist/k-nocontent-Bh_yToGh.js.map +1 -0
  146. package/dist/k-resizable-grid-Ch3iWZaL.js +3157 -0
  147. package/dist/k-resizable-grid-Ch3iWZaL.js.map +1 -0
  148. package/dist/k-standard-layout-CQ1VZoxa.js +5011 -0
  149. package/dist/k-standard-layout-CQ1VZoxa.js.map +1 -0
  150. package/dist/layouts/k-standard-layout.d.ts +16 -0
  151. package/dist/layouts/k-standard-layout.d.ts.map +1 -0
  152. package/dist/parts/index.d.ts +1 -0
  153. package/dist/parts/index.d.ts.map +1 -0
  154. package/dist/parts/index.js +53 -0
  155. package/dist/parts/index.js.map +1 -0
  156. package/dist/parts/k-app.d.ts +11 -0
  157. package/dist/parts/k-app.d.ts.map +1 -0
  158. package/dist/parts/k-container.d.ts +4 -0
  159. package/dist/parts/k-container.d.ts.map +1 -0
  160. package/dist/parts/k-contextmenu.d.ts +38 -0
  161. package/dist/parts/k-contextmenu.d.ts.map +1 -0
  162. package/dist/parts/k-dialog-content.d.ts +9 -0
  163. package/dist/parts/k-dialog-content.d.ts.map +1 -0
  164. package/dist/parts/k-element.d.ts +36 -0
  165. package/dist/parts/k-element.d.ts.map +1 -0
  166. package/dist/parts/k-part.d.ts +96 -0
  167. package/dist/parts/k-part.d.ts.map +1 -0
  168. package/dist/parts/k-resizable-grid.d.ts +31 -0
  169. package/dist/parts/k-resizable-grid.d.ts.map +1 -0
  170. package/dist/parts/k-tabs.d.ts +74 -0
  171. package/dist/parts/k-tabs.d.ts.map +1 -0
  172. package/dist/parts/k-toolbar.d.ts +21 -0
  173. package/dist/parts/k-toolbar.d.ts.map +1 -0
  174. package/dist/widgets/index.d.ts +1 -0
  175. package/dist/widgets/index.d.ts.map +1 -0
  176. package/dist/widgets/index.js +3 -0
  177. package/dist/widgets/index.js.map +1 -0
  178. package/dist/widgets/k-icon.d.ts +10 -0
  179. package/dist/widgets/k-icon.d.ts.map +1 -0
  180. package/dist/widgets/k-nocontent.d.ts +13 -0
  181. package/dist/widgets/k-nocontent.d.ts.map +1 -0
  182. package/dist/widgets/k-widget.d.ts +25 -0
  183. package/dist/widgets/k-widget.d.ts.map +1 -0
  184. package/package.json +81 -0
  185. package/src/api/base-classes.ts +10 -0
  186. package/src/api/constants.ts +3 -0
  187. package/src/api/index.ts +31 -0
  188. package/src/api/services.ts +52 -0
  189. package/src/api/types.ts +46 -0
  190. package/src/commands/files.ts +829 -0
  191. package/src/commands/global.ts +225 -0
  192. package/src/commands/index.ts +4 -0
  193. package/src/commands/version-info.ts +214 -0
  194. package/src/components/index.ts +10 -0
  195. package/src/components/k-app-selector.ts +233 -0
  196. package/src/components/k-app-switcher.ts +126 -0
  197. package/src/components/k-command.ts +236 -0
  198. package/src/components/k-extensions.ts +615 -0
  199. package/src/components/k-fastviews.ts +314 -0
  200. package/src/components/k-filebrowser.ts +442 -0
  201. package/src/components/k-language-selector.ts +166 -0
  202. package/src/components/k-log-terminal.ts +337 -0
  203. package/src/components/k-part-name.ts +54 -0
  204. package/src/components/k-tasks.ts +267 -0
  205. package/src/components/k-workspace-name.ts +56 -0
  206. package/src/contributions/default-ui-contributions.ts +51 -0
  207. package/src/contributions/index.ts +3 -0
  208. package/src/contributions/marketplace-catalog-contributions.ts +6 -0
  209. package/src/core/app-host-config.ts +23 -0
  210. package/src/core/apploader.ts +630 -0
  211. package/src/core/appstate.ts +15 -0
  212. package/src/core/commandregistry.ts +210 -0
  213. package/src/core/config.ts +29 -0
  214. package/src/core/constants.ts +27 -0
  215. package/src/core/contributionregistry.ts +77 -0
  216. package/src/core/di.ts +54 -0
  217. package/src/core/dialogservice.ts +266 -0
  218. package/src/core/editorregistry.ts +303 -0
  219. package/src/core/esmsh-service.ts +404 -0
  220. package/src/core/events.ts +68 -0
  221. package/src/core/extensionregistry.ts +399 -0
  222. package/src/core/filesys.ts +618 -0
  223. package/src/core/i18n.ts +221 -0
  224. package/src/core/index.ts +51 -0
  225. package/src/core/k-utils.ts +11 -0
  226. package/src/core/keybindings.ts +274 -0
  227. package/src/core/logger.ts +187 -0
  228. package/src/core/marketplaceregistry.ts +197 -0
  229. package/src/core/packageinfoservice.ts +56 -0
  230. package/src/core/persistenceservice.ts +15 -0
  231. package/src/core/settingsservice.ts +70 -0
  232. package/src/core/signals.ts +18 -0
  233. package/src/core/taskservice.ts +72 -0
  234. package/src/core/toast.ts +11 -0
  235. package/src/core/tree-utils.ts +24 -0
  236. package/src/dialogs/confirm-dialog.ts +72 -0
  237. package/src/dialogs/index.ts +4 -0
  238. package/src/dialogs/info-dialog.ts +67 -0
  239. package/src/dialogs/navigable-info-dialog.ts +256 -0
  240. package/src/dialogs/prompt-dialog.ts +123 -0
  241. package/src/externals/lit.ts +26 -0
  242. package/src/externals/third-party.ts +9 -0
  243. package/src/externals/webawesome.ts +54 -0
  244. package/src/i18n/extensions.json +39 -0
  245. package/src/i18n/fastviews.json +10 -0
  246. package/src/i18n/filebrowser.json +33 -0
  247. package/src/i18n/index.ts +25 -0
  248. package/src/i18n/logterminal.json +42 -0
  249. package/src/i18n/partname.json +12 -0
  250. package/src/i18n/tasks.json +12 -0
  251. package/src/i18n/workspace.json +12 -0
  252. package/src/icons/icons.txt +3 -0
  253. package/src/icons/js.svg +6 -0
  254. package/src/icons/jupyter.svg +18 -0
  255. package/src/icons/python.svg +15 -0
  256. package/src/index.ts +3 -0
  257. package/src/layouts/k-standard-layout.ts +174 -0
  258. package/src/parts/index.ts +6 -0
  259. package/src/parts/k-app.ts +29 -0
  260. package/src/parts/k-container.ts +4 -0
  261. package/src/parts/k-contextmenu.ts +245 -0
  262. package/src/parts/k-dialog-content.ts +31 -0
  263. package/src/parts/k-element.ts +100 -0
  264. package/src/parts/k-part.ts +158 -0
  265. package/src/parts/k-resizable-grid.ts +366 -0
  266. package/src/parts/k-tabs.ts +574 -0
  267. package/src/parts/k-toolbar.ts +158 -0
  268. package/src/vite-env.d.ts +2 -0
  269. package/src/widgets/index.ts +2 -0
  270. package/src/widgets/k-icon.ts +39 -0
  271. package/src/widgets/k-nocontent.ts +40 -0
  272. package/src/widgets/k-widget.ts +90 -0
@@ -0,0 +1,314 @@
1
+ import { css, html, nothing } from 'lit'
2
+ import { customElement, property, state } from 'lit/decorators.js'
3
+ import { createRef, ref, Ref } from 'lit/directives/ref.js'
4
+ import { KWidget } from '../widgets/k-widget'
5
+ import '../widgets/k-icon'
6
+ import { contributionRegistry, TabContribution, ContributionChangeEvent, TOPIC_CONTRIBUTEIONS_CHANGED } from '../core/contributionregistry'
7
+ import { subscribe } from '../core/events'
8
+ import { Signal } from '@lit-labs/signals'
9
+ import { KTabs } from '../parts/k-tabs'
10
+ import { i18n } from '../core/i18n'
11
+
12
+ const t = i18n('fastviews');
13
+
14
+ @customElement('k-fastviews')
15
+ export class KFastViews extends KWidget {
16
+ @property()
17
+ target: string = ''
18
+
19
+ @property()
20
+ title: string = ''
21
+
22
+ @property()
23
+ icon?: string
24
+
25
+ @property({ type: Boolean })
26
+ disabled: boolean = false
27
+
28
+ @property()
29
+ appearance: 'default' | 'plain' | 'outline' = 'plain'
30
+
31
+ @property()
32
+ size: 'small' | 'medium' | 'large' = 'small'
33
+
34
+ @property()
35
+ placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end' = 'bottom-start'
36
+
37
+ @property()
38
+ containerId?: string
39
+
40
+ @state()
41
+ private tabContributions: TabContribution[] = []
42
+
43
+ @state()
44
+ private drawerOpen: boolean = false
45
+
46
+ @state()
47
+ private drawerSize: string = '50vw'
48
+
49
+ private drawerRef: Ref<HTMLElement> = createRef()
50
+ private tabsRef: Ref<KTabs> = createRef()
51
+ private resizeHandleRef: Ref<HTMLElement> = createRef()
52
+
53
+ private resizing: {
54
+ startX: number
55
+ startSize: number
56
+ handleMouseMove: (e: MouseEvent) => void
57
+ handleMouseUp: () => void
58
+ rafId: number | null
59
+ } | null = null
60
+
61
+ private getDrawerTabsId(): string {
62
+ return `fastviews-drawer-tabs-${this.target}`
63
+ }
64
+
65
+ private handleTabClick(contribution: TabContribution) {
66
+ if (this.disabled) return
67
+
68
+ if (this.containerId) {
69
+ const tabContainer = document.querySelector(`k-tabs#${this.containerId}`) as KTabs | null
70
+ if (!tabContainer) {
71
+ console.error(`k-fastviews: Tab container with id "${this.containerId}" not found`)
72
+ return
73
+ }
74
+ tabContainer.open(contribution)
75
+ } else {
76
+ this.drawerOpen = true
77
+
78
+ this.updateComplete.then(() => {
79
+ const tabsContainer = this.tabsRef.value
80
+ if (tabsContainer) {
81
+ tabsContainer.open(contribution)
82
+ }
83
+ })
84
+ }
85
+ }
86
+
87
+ private handleDrawerHide() {
88
+ this.drawerOpen = false
89
+ }
90
+
91
+ private startResize(e: MouseEvent) {
92
+ e.preventDefault()
93
+ e.stopPropagation()
94
+
95
+ const drawer = this.drawerRef.value as any
96
+ if (!drawer) return
97
+
98
+ const getDrawerSize = (): number => {
99
+ const drawerPanel = drawer.shadowRoot?.querySelector('[part="panel"]') as HTMLElement
100
+ if (drawerPanel && drawerPanel.offsetWidth > 0) {
101
+ return drawerPanel.offsetWidth
102
+ }
103
+ const computedStyle = window.getComputedStyle(drawer)
104
+ const sizeValue = computedStyle.getPropertyValue('--size') || this.drawerSize
105
+ const match = sizeValue.match(/^(\d+(?:\.\d+)?)(px|vw|vh|%)$/)
106
+ if (match) {
107
+ const value = parseFloat(match[1])
108
+ const unit = match[2]
109
+ if (unit === 'px') return value
110
+ if (unit === 'vw') return (value / 100) * window.innerWidth
111
+ if (unit === 'vh') return (value / 100) * window.innerHeight
112
+ if (unit === '%') return (value / 100) * window.innerWidth
113
+ }
114
+ return 0
115
+ }
116
+
117
+ let currentSize = getDrawerSize()
118
+ if (currentSize === 0) {
119
+ currentSize = window.innerWidth * 0.5
120
+ }
121
+
122
+ const handleMouseMove = (moveEvent: MouseEvent) => {
123
+ if (!this.resizing) return
124
+
125
+ moveEvent.preventDefault()
126
+ moveEvent.stopPropagation()
127
+
128
+ if (this.resizing.rafId !== null) {
129
+ cancelAnimationFrame(this.resizing.rafId)
130
+ }
131
+
132
+ this.resizing.rafId = requestAnimationFrame(() => {
133
+ if (!this.resizing) return
134
+
135
+ const delta = this.resizing.startX - moveEvent.clientX
136
+ const newSize = Math.round(this.resizing.startSize + delta)
137
+ const minSize = 200
138
+ const maxSize = Math.round(window.innerWidth * 0.9)
139
+
140
+ if (newSize >= minSize && newSize <= maxSize) {
141
+ this.drawerSize = `${newSize}px`
142
+
143
+ const drawer = this.drawerRef.value as any
144
+ if (drawer) {
145
+ drawer.style.setProperty('--size', this.drawerSize)
146
+ drawer.style.setProperty('transition', 'none')
147
+ }
148
+ }
149
+ this.resizing.rafId = null
150
+ })
151
+ }
152
+
153
+ const handleMouseUp = () => {
154
+ if (this.resizing) {
155
+ if (this.resizing.rafId !== null) {
156
+ cancelAnimationFrame(this.resizing.rafId)
157
+ this.resizing.rafId = null
158
+ }
159
+
160
+ document.removeEventListener('mousemove', this.resizing.handleMouseMove)
161
+ document.removeEventListener('mouseup', this.resizing.handleMouseUp)
162
+ document.body.style.cursor = ''
163
+ document.body.style.userSelect = ''
164
+
165
+ const drawer = this.drawerRef.value as any
166
+ if (drawer) {
167
+ drawer.style.removeProperty('transition')
168
+ }
169
+
170
+ this.resizing = null
171
+ }
172
+ }
173
+
174
+ this.resizing = {
175
+ startX: e.clientX,
176
+ startSize: currentSize,
177
+ handleMouseMove,
178
+ handleMouseUp,
179
+ rafId: null
180
+ }
181
+
182
+ document.addEventListener('mousemove', handleMouseMove, { passive: false })
183
+ document.addEventListener('mouseup', handleMouseUp, { passive: false })
184
+ document.body.style.cursor = 'col-resize'
185
+ document.body.style.userSelect = 'none'
186
+ }
187
+
188
+ protected doBeforeUI() {
189
+ if (this.target) {
190
+ this.loadTabContributions()
191
+
192
+ subscribe(TOPIC_CONTRIBUTEIONS_CHANGED, (event: ContributionChangeEvent) => {
193
+ if (this.target && event.target === this.target) {
194
+ this.loadTabContributions()
195
+ }
196
+ })
197
+ }
198
+ }
199
+
200
+ private loadTabContributions() {
201
+ if (!this.target) return
202
+
203
+ const allContributions = contributionRegistry.getContributions(this.target)
204
+ this.tabContributions = allContributions.filter((c): c is TabContribution => 'name' in c)
205
+ this.requestUpdate()
206
+ }
207
+
208
+ private renderTabContribution(contribution: TabContribution) {
209
+ return html`
210
+ <wa-dropdown-item
211
+ @click=${() => this.handleTabClick(contribution)}>
212
+ <k-icon name="${contribution.icon || ''}" label="${contribution.label}" slot="icon"></k-icon>
213
+ ${contribution.label}
214
+ </wa-dropdown-item>
215
+ `
216
+ }
217
+
218
+ render() {
219
+ if (!this.target) {
220
+ return nothing
221
+ }
222
+
223
+ if (this.tabContributions.length === 0) {
224
+ return nothing
225
+ }
226
+
227
+ return html`
228
+ <wa-dropdown placement=${this.placement}>
229
+ <wa-button
230
+ slot="trigger"
231
+ appearance=${this.appearance}
232
+ size=${this.size}
233
+ ?disabled=${this.disabled}
234
+ with-caret
235
+ title=${this.title}>
236
+ <k-icon slot="start" name="${this.icon}" label="${this.title}"></k-icon>
237
+ <slot></slot>
238
+ </wa-button>
239
+
240
+ ${this.title ? html`
241
+ <h6 style="padding: var(--wa-space-xs) var(--wa-space-s); margin: 0; color: var(--wa-color-neutral-50); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;">
242
+ ${this.title}
243
+ </h6>
244
+ ` : nothing}
245
+
246
+ ${this.tabContributions.map(c => this.renderTabContribution(c))}
247
+ </wa-dropdown>
248
+
249
+ ${!this.containerId ? html`
250
+ <wa-drawer
251
+ ${ref(this.drawerRef)}
252
+ label="${this.title || t('FAST_VIEWS')}"
253
+ placement="end"
254
+ ?open=${this.drawerOpen}
255
+ @wa-hide=${this.handleDrawerHide}
256
+ style="--size: ${this.drawerSize};">
257
+ <div
258
+ ${ref(this.resizeHandleRef)}
259
+ class="resize-handle"
260
+ @mousedown=${this.startResize}>
261
+ </div>
262
+ <k-tabs
263
+ ${ref(this.tabsRef)}
264
+ id="${this.getDrawerTabsId()}"
265
+ style="width: 100%; height: 100%; display: flex; flex-direction: column;">
266
+ </k-tabs>
267
+ </wa-drawer>
268
+ ` : nothing}
269
+ `
270
+ }
271
+
272
+ static styles = css`
273
+ :host {
274
+ display: inline-block;
275
+ }
276
+
277
+ wa-drawer {
278
+ position: relative;
279
+ }
280
+
281
+ wa-drawer::part(panel) {
282
+ position: relative;
283
+ }
284
+
285
+ .resize-handle {
286
+ position: absolute;
287
+ left: 0;
288
+ top: 0;
289
+ bottom: 0;
290
+ width: 4px;
291
+ cursor: col-resize;
292
+ z-index: 1000;
293
+ background: transparent;
294
+ transition: background-color 0.2s;
295
+ user-select: none;
296
+ touch-action: none;
297
+ }
298
+
299
+ .resize-handle:hover {
300
+ background: var(--wa-color-brand-fill-loud);
301
+ }
302
+
303
+ .resize-handle:active {
304
+ background: var(--wa-color-brand-fill-loud);
305
+ }
306
+ `
307
+ }
308
+
309
+ declare global {
310
+ interface HTMLElementTagNameMap {
311
+ 'k-fastviews': KFastViews
312
+ }
313
+ }
314
+