@nuraly/lumenui 0.1.0 → 0.2.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.
Files changed (312) hide show
  1. package/dist/nuralyui.bundle.js +23024 -17355
  2. package/dist/nuralyui.bundle.js.gz +0 -0
  3. package/dist/src/components/alert/alert.component.d.ts +8 -5
  4. package/dist/src/components/alert/alert.component.js +24 -20
  5. package/dist/src/components/alert/alert.style.d.ts +0 -7
  6. package/dist/src/components/alert/alert.style.js +48 -90
  7. package/dist/src/components/alert/bundle.js +82 -108
  8. package/dist/src/components/alert/bundle.js.gz +0 -0
  9. package/dist/src/components/badge/badge.component.d.ts +9 -8
  10. package/dist/src/components/badge/badge.component.js +17 -14
  11. package/dist/src/components/badge/badge.style.d.ts +0 -7
  12. package/dist/src/components/badge/badge.style.js +49 -107
  13. package/dist/src/components/badge/bundle.js +81 -119
  14. package/dist/src/components/badge/bundle.js.gz +0 -0
  15. package/dist/src/components/breadcrumb/breadcrumb.component.d.ts +8 -10
  16. package/dist/src/components/breadcrumb/breadcrumb.component.js +16 -15
  17. package/dist/src/components/breadcrumb/breadcrumb.style.d.ts +0 -7
  18. package/dist/src/components/breadcrumb/breadcrumb.style.js +42 -60
  19. package/dist/src/components/breadcrumb/bundle.js +96 -93
  20. package/dist/src/components/breadcrumb/bundle.js.gz +0 -0
  21. package/dist/src/components/button/bundle.js +221 -470
  22. package/dist/src/components/button/bundle.js.gz +0 -0
  23. package/dist/src/components/button/button.component.d.ts +2 -1
  24. package/dist/src/components/button/button.component.js +6 -6
  25. package/dist/src/components/button/button.style.d.ts +0 -7
  26. package/dist/src/components/button/button.style.js +167 -433
  27. package/dist/src/components/canvas/base-canvas.component.d.ts +2 -1
  28. package/dist/src/components/canvas/base-canvas.component.js +1 -0
  29. package/dist/src/components/canvas/bundle.js +16919 -9595
  30. package/dist/src/components/canvas/bundle.js.gz +0 -0
  31. package/dist/src/components/canvas/canvas.constants.d.ts +1 -1
  32. package/dist/src/components/canvas/canvas.constants.js +1 -1
  33. package/dist/src/components/canvas/chatbot-panel.style.js +31 -31
  34. package/dist/src/components/canvas/index.d.ts +2 -0
  35. package/dist/src/components/canvas/index.js +3 -0
  36. package/dist/src/components/canvas/whiteboard-canvas.component.d.ts +3 -1
  37. package/dist/src/components/canvas/whiteboard-canvas.component.js +19 -1
  38. package/dist/src/components/canvas/whiteboard-canvas.style.js +159 -138
  39. package/dist/src/components/canvas/whiteboard-node.component.d.ts +2 -1
  40. package/dist/src/components/canvas/whiteboard-node.component.js +2 -1
  41. package/dist/src/components/canvas/whiteboard-node.style.js +44 -44
  42. package/dist/src/components/canvas/workflow-canvas-only.d.ts +4 -0
  43. package/dist/src/components/canvas/workflow-canvas-only.js +5 -0
  44. package/dist/src/components/canvas/workflow-canvas.component.d.ts +3 -1
  45. package/dist/src/components/canvas/workflow-canvas.component.js +24 -2
  46. package/dist/src/components/canvas/workflow-canvas.style.js +776 -648
  47. package/dist/src/components/canvas/workflow-canvas.types.d.ts +113 -4
  48. package/dist/src/components/canvas/workflow-canvas.types.js +646 -3
  49. package/dist/src/components/canvas/workflow-node.component.d.ts +3 -2
  50. package/dist/src/components/canvas/workflow-node.component.js +5 -5
  51. package/dist/src/components/canvas/workflow-node.style.js +183 -181
  52. package/dist/src/components/card/bundle.js +43 -35
  53. package/dist/src/components/card/bundle.js.gz +0 -0
  54. package/dist/src/components/card/card.component.d.ts +6 -1
  55. package/dist/src/components/card/card.component.js +8 -2
  56. package/dist/src/components/card/card.style.js +26 -30
  57. package/dist/src/components/carousel/bundle.js +8 -8
  58. package/dist/src/components/carousel/bundle.js.gz +0 -0
  59. package/dist/src/components/carousel/carousel.component.d.ts +12 -0
  60. package/dist/src/components/carousel/carousel.component.js +16 -4
  61. package/dist/src/components/chatbot/bundle.js +422 -406
  62. package/dist/src/components/chatbot/bundle.js.gz +0 -0
  63. package/dist/src/components/chatbot/chatbot.component.d.ts +2 -1
  64. package/dist/src/components/chatbot/chatbot.component.js +1 -0
  65. package/dist/src/components/chatbot/chatbot.style.js +277 -277
  66. package/dist/src/components/checkbox/bundle.js +86 -245
  67. package/dist/src/components/checkbox/bundle.js.gz +0 -0
  68. package/dist/src/components/checkbox/checkbox.component.d.ts +5 -2
  69. package/dist/src/components/checkbox/checkbox.component.js +11 -13
  70. package/dist/src/components/checkbox/checkbox.style.js +56 -231
  71. package/dist/src/components/code-editor/bundle.js +151 -25
  72. package/dist/src/components/code-editor/bundle.js.gz +0 -0
  73. package/dist/src/components/code-editor/code-editor.component.d.ts +18 -56
  74. package/dist/src/components/code-editor/code-editor.component.js +141 -394
  75. package/dist/src/components/code-editor/code-editor.style.js +139 -15
  76. package/dist/src/components/collapse/bundle.js +97 -84
  77. package/dist/src/components/collapse/bundle.js.gz +0 -0
  78. package/dist/src/components/collapse/collapse.component.d.ts +7 -1
  79. package/dist/src/components/collapse/collapse.component.js +11 -2
  80. package/dist/src/components/collapse/collapse.style.js +60 -60
  81. package/dist/src/components/colorpicker/bundle.js +85 -48
  82. package/dist/src/components/colorpicker/bundle.js.gz +0 -0
  83. package/dist/src/components/colorpicker/color-holder.component.d.ts +2 -4
  84. package/dist/src/components/colorpicker/color-holder.component.js +5 -6
  85. package/dist/src/components/colorpicker/color-holder.style.js +11 -11
  86. package/dist/src/components/colorpicker/color-picker.component.d.ts +2 -1
  87. package/dist/src/components/colorpicker/color-picker.component.js +1 -0
  88. package/dist/src/components/colorpicker/color-picker.style.js +12 -12
  89. package/dist/src/components/colorpicker/default-color-sets.component.d.ts +2 -2
  90. package/dist/src/components/colorpicker/default-color-sets.component.js +4 -3
  91. package/dist/src/components/colorpicker/default-color-sets.style.js +5 -5
  92. package/dist/src/components/container/bundle.js +24 -14
  93. package/dist/src/components/container/bundle.js.gz +0 -0
  94. package/dist/src/components/container/container.component.d.ts +4 -1
  95. package/dist/src/components/container/container.component.js +7 -5
  96. package/dist/src/components/container/container.style.js +9 -9
  97. package/dist/src/components/datepicker/bundle.js +193 -177
  98. package/dist/src/components/datepicker/bundle.js.gz +0 -0
  99. package/dist/src/components/datepicker/datepicker.component.d.ts +2 -1
  100. package/dist/src/components/datepicker/datepicker.component.js +1 -0
  101. package/dist/src/components/datepicker/datepicker.style.js +65 -65
  102. package/dist/src/components/datepicker/datepicker.style.variables.js +91 -91
  103. package/dist/src/components/db-connection-select/bundle.js +7 -6
  104. package/dist/src/components/db-connection-select/bundle.js.gz +0 -0
  105. package/dist/src/components/db-connection-select/db-connection-select.component.d.ts +3 -0
  106. package/dist/src/components/db-connection-select/db-connection-select.component.js +4 -0
  107. package/dist/src/components/divider/bundle.js +61 -35
  108. package/dist/src/components/divider/bundle.js.gz +0 -0
  109. package/dist/src/components/divider/divider.component.d.ts +4 -6
  110. package/dist/src/components/divider/divider.component.js +10 -14
  111. package/dist/src/components/divider/divider.style.js +41 -31
  112. package/dist/src/components/document/bundle.js +50 -48
  113. package/dist/src/components/document/bundle.js.gz +0 -0
  114. package/dist/src/components/document/document.component.d.ts +12 -1
  115. package/dist/src/components/document/document.component.js +18 -6
  116. package/dist/src/components/document/document.style.js +21 -36
  117. package/dist/src/components/dropdown/bundle.js +117 -101
  118. package/dist/src/components/dropdown/bundle.js.gz +0 -0
  119. package/dist/src/components/dropdown/dropdown.component.d.ts +2 -1
  120. package/dist/src/components/dropdown/dropdown.component.js +1 -0
  121. package/dist/src/components/dropdown/dropdown.style.js +68 -68
  122. package/dist/src/components/file-upload/bundle.js +82 -76
  123. package/dist/src/components/file-upload/bundle.js.gz +0 -0
  124. package/dist/src/components/file-upload/file-upload.component.d.ts +2 -1
  125. package/dist/src/components/file-upload/file-upload.component.js +1 -0
  126. package/dist/src/components/file-upload/styles.js +59 -59
  127. package/dist/src/components/flex/bundle.js +18 -8
  128. package/dist/src/components/flex/bundle.js.gz +0 -0
  129. package/dist/src/components/flex/flex.component.d.ts +4 -1
  130. package/dist/src/components/flex/flex.component.js +7 -4
  131. package/dist/src/components/flex/flex.style.js +2 -2
  132. package/dist/src/components/form/bundle.js +22 -10
  133. package/dist/src/components/form/bundle.js.gz +0 -0
  134. package/dist/src/components/form/form.component.d.ts +4 -1
  135. package/dist/src/components/form/form.component.js +5 -1
  136. package/dist/src/components/form/form.style.js +2 -2
  137. package/dist/src/components/grid/bundle.js +26 -14
  138. package/dist/src/components/grid/bundle.js.gz +0 -0
  139. package/dist/src/components/grid/col.component.d.ts +4 -1
  140. package/dist/src/components/grid/col.component.js +4 -1
  141. package/dist/src/components/grid/col.style.js +2 -2
  142. package/dist/src/components/grid/row.component.d.ts +4 -1
  143. package/dist/src/components/grid/row.component.js +4 -1
  144. package/dist/src/components/grid/row.style.js +2 -2
  145. package/dist/src/components/icon/bundle.js +78 -252
  146. package/dist/src/components/icon/bundle.js.gz +0 -0
  147. package/dist/src/components/icon/icon-paths.d.ts +2 -0
  148. package/dist/src/components/icon/icon-paths.js +141 -0
  149. package/dist/src/components/icon/icon.component.d.ts +10 -12
  150. package/dist/src/components/icon/icon.component.js +42 -93
  151. package/dist/src/components/icon/icon.style.js +42 -130
  152. package/dist/src/components/icon/icon.variables.js +9 -9
  153. package/dist/src/components/iconpicker/bundle.js +859 -1511
  154. package/dist/src/components/iconpicker/bundle.js.gz +0 -0
  155. package/dist/src/components/iconpicker/icon-picker.component.d.ts +2 -1
  156. package/dist/src/components/iconpicker/icon-picker.component.js +1 -0
  157. package/dist/src/components/iconpicker/icon-picker.style.js +13 -13
  158. package/dist/src/components/image/bundle.js +43 -33
  159. package/dist/src/components/image/bundle.js.gz +0 -0
  160. package/dist/src/components/image/image.component.d.ts +10 -1
  161. package/dist/src/components/image/image.component.js +13 -3
  162. package/dist/src/components/image/image.style.js +19 -26
  163. package/dist/src/components/input/bundle.js +420 -644
  164. package/dist/src/components/input/bundle.js.gz +0 -0
  165. package/dist/src/components/input/input.component.d.ts +16 -3
  166. package/dist/src/components/input/input.component.js +43 -27
  167. package/dist/src/components/input/input.style.d.ts +1 -1
  168. package/dist/src/components/input/input.style.js +331 -634
  169. package/dist/src/components/kv-secret-select/bundle.js +2 -1
  170. package/dist/src/components/kv-secret-select/bundle.js.gz +0 -0
  171. package/dist/src/components/kv-secret-select/kv-secret-select.component.d.ts +3 -0
  172. package/dist/src/components/kv-secret-select/kv-secret-select.component.js +4 -0
  173. package/dist/src/components/label/bundle.js +37 -60
  174. package/dist/src/components/label/bundle.js.gz +0 -0
  175. package/dist/src/components/label/label.component.d.ts +8 -4
  176. package/dist/src/components/label/label.component.js +9 -14
  177. package/dist/src/components/label/label.style.js +17 -25
  178. package/dist/src/components/label/label.style.variables.js +18 -18
  179. package/dist/src/components/layout/bundle.js +86 -70
  180. package/dist/src/components/layout/bundle.js.gz +0 -0
  181. package/dist/src/components/layout/content.component.d.ts +2 -1
  182. package/dist/src/components/layout/content.component.js +2 -1
  183. package/dist/src/components/layout/content.style.js +3 -3
  184. package/dist/src/components/layout/footer.component.d.ts +2 -1
  185. package/dist/src/components/layout/footer.component.js +3 -2
  186. package/dist/src/components/layout/footer.style.js +7 -7
  187. package/dist/src/components/layout/header.component.d.ts +2 -1
  188. package/dist/src/components/layout/header.component.js +3 -2
  189. package/dist/src/components/layout/header.style.js +7 -7
  190. package/dist/src/components/layout/layout.component.d.ts +4 -7
  191. package/dist/src/components/layout/layout.component.js +9 -22
  192. package/dist/src/components/layout/layout.style.js +1 -1
  193. package/dist/src/components/layout/sider.component.d.ts +3 -1
  194. package/dist/src/components/layout/sider.component.js +3 -1
  195. package/dist/src/components/layout/sider.style.js +29 -29
  196. package/dist/src/components/menu/bundle.js +135 -125
  197. package/dist/src/components/menu/bundle.js.gz +0 -0
  198. package/dist/src/components/menu/menu.component.d.ts +2 -1
  199. package/dist/src/components/menu/menu.component.js +1 -0
  200. package/dist/src/components/menu/menu.style.js +87 -87
  201. package/dist/src/components/modal/bundle.js +105 -96
  202. package/dist/src/components/modal/bundle.js.gz +0 -0
  203. package/dist/src/components/modal/modal.component.d.ts +2 -1
  204. package/dist/src/components/modal/modal.component.js +1 -0
  205. package/dist/src/components/modal/modal.style.js +69 -71
  206. package/dist/src/components/panel/bundle.js +190 -391
  207. package/dist/src/components/panel/bundle.js.gz +0 -0
  208. package/dist/src/components/panel/panel.component.d.ts +2 -1
  209. package/dist/src/components/panel/panel.component.js +1 -0
  210. package/dist/src/components/panel/panel.style.js +65 -65
  211. package/dist/src/components/popconfirm/bundle.js +107 -93
  212. package/dist/src/components/popconfirm/bundle.js.gz +0 -0
  213. package/dist/src/components/popconfirm/popconfirm-manager.component.d.ts +2 -1
  214. package/dist/src/components/popconfirm/popconfirm-manager.component.js +1 -0
  215. package/dist/src/components/popconfirm/popconfirm-manager.style.js +16 -16
  216. package/dist/src/components/popconfirm/popconfirm.component.d.ts +2 -1
  217. package/dist/src/components/popconfirm/popconfirm.component.js +9 -5
  218. package/dist/src/components/popconfirm/popconfirm.style.js +43 -43
  219. package/dist/src/components/radio/bundle.js +56 -86
  220. package/dist/src/components/radio/bundle.js.gz +0 -0
  221. package/dist/src/components/radio/radio.component.d.ts +8 -2
  222. package/dist/src/components/radio/radio.component.js +17 -9
  223. package/dist/src/components/radio/radio.style.js +30 -77
  224. package/dist/src/components/radio-group/bundle.js +125 -89
  225. package/dist/src/components/radio-group/bundle.js.gz +0 -0
  226. package/dist/src/components/radio-group/radio-group.component.d.ts +5 -1
  227. package/dist/src/components/radio-group/radio-group.component.js +18 -10
  228. package/dist/src/components/radio-group/radio-group.style.js +44 -44
  229. package/dist/src/components/select/bundle.js +260 -367
  230. package/dist/src/components/select/bundle.js.gz +0 -0
  231. package/dist/src/components/select/select.component.d.ts +12 -17
  232. package/dist/src/components/select/select.component.js +35 -35
  233. package/dist/src/components/select/select.style.js +184 -324
  234. package/dist/src/components/skeleton/bundle.js +82 -162
  235. package/dist/src/components/skeleton/bundle.js.gz +0 -0
  236. package/dist/src/components/skeleton/skeleton.component.d.ts +10 -5
  237. package/dist/src/components/skeleton/skeleton.component.js +20 -7
  238. package/dist/src/components/skeleton/skeleton.style.js +34 -133
  239. package/dist/src/components/slider-input/bundle.js +89 -88
  240. package/dist/src/components/slider-input/bundle.js.gz +0 -0
  241. package/dist/src/components/slider-input/slider-input.component.d.ts +11 -0
  242. package/dist/src/components/slider-input/slider-input.component.js +20 -8
  243. package/dist/src/components/slider-input/slider-input.style.js +47 -47
  244. package/dist/src/components/slider-input/slider-input.style.variables.js +32 -32
  245. package/dist/src/components/table/bundle.js +149 -128
  246. package/dist/src/components/table/bundle.js.gz +0 -0
  247. package/dist/src/components/table/table.component.d.ts +2 -1
  248. package/dist/src/components/table/table.component.js +1 -0
  249. package/dist/src/components/table/table.style.js +79 -79
  250. package/dist/src/components/tabs/bundle.js +462 -663
  251. package/dist/src/components/tabs/bundle.js.gz +0 -0
  252. package/dist/src/components/tabs/tabs.component.d.ts +6 -1
  253. package/dist/src/components/tabs/tabs.component.js +8 -1
  254. package/dist/src/components/tabs/tabs.style.js +200 -201
  255. package/dist/src/components/tag/bundle.js +44 -36
  256. package/dist/src/components/tag/bundle.js.gz +0 -0
  257. package/dist/src/components/tag/tag.component.d.ts +7 -6
  258. package/dist/src/components/tag/tag.component.js +10 -19
  259. package/dist/src/components/tag/tag.style.js +20 -24
  260. package/dist/src/components/textarea/bundle.js +131 -94
  261. package/dist/src/components/textarea/bundle.js.gz +0 -0
  262. package/dist/src/components/textarea/textarea.component.d.ts +7 -1
  263. package/dist/src/components/textarea/textarea.component.js +10 -3
  264. package/dist/src/components/textarea/textarea.style.d.ts +1 -13
  265. package/dist/src/components/textarea/textarea.style.js +79 -91
  266. package/dist/src/components/timeline/bundle.js +71 -134
  267. package/dist/src/components/timeline/bundle.js.gz +0 -0
  268. package/dist/src/components/timeline/timeline.component.d.ts +9 -6
  269. package/dist/src/components/timeline/timeline.component.js +16 -13
  270. package/dist/src/components/timeline/timeline.style.d.ts +0 -7
  271. package/dist/src/components/timeline/timeline.style.js +41 -122
  272. package/dist/src/components/timepicker/bundle.js +196 -166
  273. package/dist/src/components/timepicker/bundle.js.gz +0 -0
  274. package/dist/src/components/timepicker/timepicker.component.d.ts +2 -1
  275. package/dist/src/components/timepicker/timepicker.component.js +1 -0
  276. package/dist/src/components/timepicker/timepicker.style.js +42 -42
  277. package/dist/src/components/timepicker/timepicker.style.variables.js +91 -91
  278. package/dist/src/components/toast/bundle.js +97 -81
  279. package/dist/src/components/toast/bundle.js.gz +0 -0
  280. package/dist/src/components/toast/toast.component.d.ts +2 -1
  281. package/dist/src/components/toast/toast.component.js +1 -0
  282. package/dist/src/components/toast/toast.style.js +62 -62
  283. package/dist/src/components/tooltips/bundle.js +10 -10
  284. package/dist/src/components/tooltips/bundle.js.gz +0 -0
  285. package/dist/src/components/tooltips/tooltips.component.d.ts +8 -0
  286. package/dist/src/components/tooltips/tooltips.component.js +9 -1
  287. package/dist/src/components/tooltips/tooltips.style.js +6 -6
  288. package/dist/src/components/video/bundle.js +47 -36
  289. package/dist/src/components/video/bundle.js.gz +0 -0
  290. package/dist/src/components/video/video.component.d.ts +12 -1
  291. package/dist/src/components/video/video.component.js +18 -6
  292. package/dist/src/components/video/video.style.js +18 -24
  293. package/package.json +25 -12
  294. package/packages/common/dist/VERSIONS.md +2 -2
  295. package/packages/common/dist/shared/base-mixin.d.ts +21 -19
  296. package/packages/common/dist/shared/base-mixin.d.ts.map +1 -1
  297. package/packages/common/dist/shared/base-mixin.js +102 -18
  298. package/packages/common/dist/shared/base-mixin.js.map +1 -1
  299. package/packages/common/dist/shared/index.d.ts +1 -0
  300. package/packages/common/dist/shared/index.d.ts.map +1 -1
  301. package/packages/common/dist/shared/index.js +2 -0
  302. package/packages/common/dist/shared/index.js.map +1 -1
  303. package/packages/common/dist/shared/style-injector.d.ts +11 -0
  304. package/packages/common/dist/shared/style-injector.d.ts.map +1 -0
  305. package/packages/common/dist/shared/style-injector.js +53 -0
  306. package/packages/common/dist/shared/style-injector.js.map +1 -0
  307. package/packages/common/dist/shared/theme-mixin.d.ts +2 -24
  308. package/packages/common/dist/shared/theme-mixin.d.ts.map +1 -1
  309. package/packages/common/dist/shared/theme-mixin.js +5 -38
  310. package/packages/common/dist/shared/theme-mixin.js.map +1 -1
  311. package/packages/themes/dist/default.css +0 -10
  312. package/packages/themes/dist/package.json +1 -1
@@ -1,303 +1,134 @@
1
1
  import { css } from 'lit';
2
2
  const checkBoxStyles = css `
3
- /* ========================================
4
- * CHECKBOX CSS VARIABLES - FALLBACK VALUES
5
- * ========================================
6
- * These fallback values ensure the component works even without theme files
7
- */
8
- :host {
9
- /* Base checkbox appearance */
10
- --nuraly-checkbox-background: var(--nuraly-color-checkbox-background, #ffffff);
11
- --nuraly-checkbox-text-color: var(--nuraly-color-checkbox-text, rgba(0, 0, 0, 0.88));
12
- --nuraly-checkbox-label-color: var(--nuraly-color-checkbox-label, rgba(0, 0, 0, 0.88));
13
-
14
- /* Checkbox borders and outline */
15
- --nuraly-checkbox-border: var(--nuraly-border-width-checkbox, 1px) solid var(--nuraly-color-checkbox-border, #d9d9d9);
16
- --nuraly-checkbox-border-radius: var(--nuraly-border-radius-checkbox, 2px);
17
- --nuraly-checkbox-border-focus: var(--nuraly-border-width-checkbox, 1px) solid var(--nuraly-color-checkbox-border-focus, #1890ff);
18
- --nuraly-checkbox-border-hover: var(--nuraly-border-width-checkbox, 1px) solid var(--nuraly-color-checkbox-border-hover, #40a9ff);
19
-
20
- /* Checked/active states */
21
- --nuraly-checkbox-checked-background: var(--nuraly-color-checkbox-checked-background, #1890ff);
22
- --nuraly-checkbox-checked-border: var(--nuraly-color-checkbox-checked-border, #1890ff);
23
- --nuraly-checkbox-checkmark-color: var(--nuraly-color-checkbox-checkmark, #ffffff);
24
- --nuraly-checkbox-indeterminate-background: var(--nuraly-color-checkbox-indeterminate-background, #1890ff);
25
- --nuraly-checkbox-indeterminate-mark-color: var(--nuraly-color-checkbox-indeterminate-mark, #ffffff);
26
-
27
- /* Disabled states */
28
- --nuraly-checkbox-disabled-background: var(--nuraly-color-checkbox-disabled-background, #f5f5f5);
29
- --nuraly-checkbox-disabled-border: var(--nuraly-color-checkbox-disabled-border, #d9d9d9);
30
- --nuraly-checkbox-disabled-text-color: var(--nuraly-color-checkbox-disabled-text, rgba(0, 0, 0, 0.25));
31
- --nuraly-checkbox-disabled-checkmark-color: var(--nuraly-color-checkbox-disabled-checkmark, rgba(0, 0, 0, 0.25));
32
-
33
- /* Focus states */
34
- --nuraly-checkbox-focus-outline: var(--nuraly-size-checkbox-focus-outline, 2px) solid var(--nuraly-color-checkbox-focus-outline, rgba(24, 144, 255, 0.2));
35
-
36
- /* Typography */
37
- --nuraly-checkbox-font-family: var(--nuraly-font-family-checkbox, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif);
38
- --nuraly-checkbox-font-size: var(--nuraly-font-size-checkbox, 14px);
39
- --nuraly-checkbox-font-weight: var(--nuraly-font-weight-checkbox, 400);
40
- --nuraly-checkbox-line-height: var(--nuraly-line-height-checkbox, 1.5715);
41
-
42
- /* Sizing */
43
- --nuraly-checkbox-size-small: var(--nuraly-size-checkbox-small, 14px);
44
- --nuraly-checkbox-size-medium: var(--nuraly-size-checkbox-medium, 16px);
45
- --nuraly-checkbox-size-large: var(--nuraly-size-checkbox-large, 18px);
46
-
47
- /* Spacing */
48
- --nuraly-checkbox-gap: var(--nuraly-spacing-checkbox-gap, 8px);
49
- --nuraly-checkbox-padding: var(--nuraly-spacing-checkbox-padding, 4px);
50
-
51
- /* Animation */
52
- --nuraly-checkbox-transition: var(--nuraly-transition-checkbox, all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1));
53
-
54
- /* ========================================
55
- * LEGACY COMPATIBILITY VARIABLES
56
- * ========================================
57
- * Keep old variable names for backward compatibility
58
- * These will be deprecated in future versions
59
- */
60
-
61
- /* Legacy local variables for backward compatibility */
62
- --nuraly-checkbox-local-filled-background-color: var(--nuraly-checkbox-checked-background);
63
- --nuraly-checkbox-local-color: var(--nuraly-checkbox-text-color);
64
- --nuraly-checkbox-local-empty-background-color: var(--nuraly-checkbox-background);
65
- --nuraly-checkbox-local-disabled-background-color: var(--nuraly-checkbox-disabled-background);
66
- --nuraly-checkbox-local-disabled-text-color: var(--nuraly-checkbox-disabled-text-color);
67
- --nuraly-checkbox-local-empty-border: var(--nuraly-checkbox-border);
68
- --nuraly-checkbox-local-symbol-color: var(--nuraly-checkbox-checkmark-color);
69
- --nuraly-checkbox-local-focus-border: var(--nuraly-checkbox-border-focus);
70
- --nuraly-checkbox-local-focus-outline: var(--nuraly-checkbox-focus-outline);
71
- --nuraly-checkbox-local-font-family: var(--nuraly-checkbox-font-family);
72
- --nuraly-checkbox-local-border-radius: var(--nuraly-checkbox-border-radius);
73
- --nuraly-checkbox-local-gap: var(--nuraly-checkbox-gap);
74
-
75
- /* Legacy size variables */
76
- --nuraly-checkbox-local-medium-width: var(--nuraly-checkbox-size-medium);
77
- --nuraly-checkbox-local-medium-height: var(--nuraly-checkbox-size-medium);
78
- --nuraly-checkbox-local-small-width: var(--nuraly-checkbox-size-small);
79
- --nuraly-checkbox-local-small-height: var(--nuraly-checkbox-size-small);
80
- --nuraly-checkbox-local-large-width: var(--nuraly-checkbox-size-large);
81
- --nuraly-checkbox-local-large-height: var(--nuraly-checkbox-size-large);
82
-
83
- /* Legacy checkmark sizing */
84
- --nuraly-checkbox-local-small-indeterminate-size: calc(var(--nuraly-checkbox-size-small) * 0.7);
85
- --nuraly-checkbox-local-large-indeterminate-size: calc(var(--nuraly-checkbox-size-large) * 0.7);
86
- --nuraly-checkbox-local-medium-indeterminate-size: calc(var(--nuraly-checkbox-size-medium) * 0.7);
87
-
88
- --nuraly-checkbox-local-small-checked-width: calc(var(--nuraly-checkbox-size-small) * 0.14);
89
- --nuraly-checkbox-local-small-checked-height: calc(var(--nuraly-checkbox-size-small) * 0.5);
90
- --nuraly-checkbox-local-medium-checked-width: calc(var(--nuraly-checkbox-size-medium) * 0.19);
91
- --nuraly-checkbox-local-medium-checked-height: calc(var(--nuraly-checkbox-size-medium) * 0.56);
92
- --nuraly-checkbox-local-large-checked-width: calc(var(--nuraly-checkbox-size-large) * 0.22);
93
- --nuraly-checkbox-local-large-checked-height: calc(var(--nuraly-checkbox-size-large) * 0.56);
94
- }
95
-
96
- /* ========================================
97
- * CHECKBOX COMPONENT STYLES
98
- * ========================================
99
- * Modern checkbox component with theme-aware styling
100
- * Uses CSS custom properties for consistent theming
101
- */
102
-
103
3
  :host {
104
4
  display: flex;
105
5
  align-items: center;
106
6
  flex-wrap: wrap;
107
- gap: var(--nuraly-checkbox-gap);
108
- font-family: var(--nuraly-checkbox-font-family);
109
- font-size: var(--nuraly-checkbox-font-size);
110
- font-weight: var(--nuraly-checkbox-font-weight);
111
- line-height: var(--nuraly-checkbox-line-height);
112
- color: var(--nuraly-checkbox-text-color);
7
+ gap: 8px;
8
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
9
+ font-size: 14px;
10
+ font-weight: 400;
11
+ line-height: 1.5715;
12
+ color: #161616;
113
13
  cursor: pointer;
114
- transition: var(--nuraly-checkbox-transition);
14
+ transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
115
15
  }
116
16
 
117
- /* ========================================
118
- * CHECKBOX INPUT ELEMENT STYLES
119
- * ======================================== */
120
-
17
+ /* Input base */
121
18
  input {
122
19
  appearance: none;
123
20
  -webkit-appearance: none;
124
21
  -moz-appearance: none;
125
22
  cursor: pointer;
126
23
  position: relative;
127
- border-radius: var(--nuraly-checkbox-border-radius);
128
- background-color: var(--nuraly-checkbox-background);
129
- border: var(--nuraly-checkbox-border);
130
- transition: var(--nuraly-checkbox-transition);
24
+ border-radius: 2px;
25
+ background-color: #ffffff;
26
+ border: 1px solid #d9d9d9;
27
+ transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
131
28
  margin: 0;
132
29
  outline: none;
133
30
  }
134
31
 
135
- /* ========================================
136
- * SIZE VARIATIONS
137
- * ======================================== */
138
-
139
- /* Medium size (default) */
32
+ /* Sizes */
140
33
  input {
141
- width: var(--nuraly-checkbox-size-medium);
142
- height: var(--nuraly-checkbox-size-medium);
143
- }
144
-
145
- :host([size='small']) input {
146
- width: var(--nuraly-checkbox-size-small);
147
- height: var(--nuraly-checkbox-size-small);
34
+ width: 16px;
35
+ height: 16px;
148
36
  }
149
-
150
- :host([size='large']) input {
151
- width: var(--nuraly-checkbox-size-large);
152
- height: var(--nuraly-checkbox-size-large);
37
+ :host([size="small"]) input {
38
+ width: 14px;
39
+ height: 14px;
153
40
  }
154
-
155
- /* ========================================
156
- * CHECKBOX STATE STYLES
157
- * ======================================== */
158
-
159
- /* Empty/unchecked state */
160
- :host(:not([checked]):not([indeterminate]):not([disabled])) input {
161
- background-color: var(--nuraly-checkbox-background);
162
- border: var(--nuraly-checkbox-border);
41
+ :host([size="large"]) input {
42
+ width: 18px;
43
+ height: 18px;
163
44
  }
164
45
 
165
- /* Checked and indeterminate states */
46
+ /* Checked / indeterminate */
166
47
  :host(:not([disabled])[checked]) input,
167
48
  :host(:not([disabled])[indeterminate]) input {
168
- background-color: var(--nuraly-checkbox-checked-background);
169
- border: 1px solid var(--nuraly-checkbox-checked-border);
49
+ background-color: #7c3aed;
50
+ border: 1px solid #7c3aed;
170
51
  }
171
52
 
172
- /* Hover states for interactive elements */
173
- :host(:not([disabled]):hover) input {
174
- border: var(--nuraly-checkbox-border-hover);
53
+ /* Hover */
54
+ :host(:not([disabled])):hover input {
55
+ border-color: #7c3aed;
175
56
  }
176
57
 
177
- :host(:not([disabled]):hover[checked]) input,
178
- :host(:not([disabled]):hover[indeterminate]) input {
179
- background-color: var(--nuraly-checkbox-checked-background);
180
- border: 1px solid var(--nuraly-checkbox-border-hover);
181
- filter: brightness(1.1);
182
- }
183
-
184
- /* Focus states */
58
+ /* Focus */
185
59
  input:focus,
186
60
  input:focus-visible {
187
- border: var(--nuraly-checkbox-border-focus);
188
- outline: var(--nuraly-checkbox-focus-outline);
61
+ border-color: #7c3aed;
62
+ outline: 2px solid rgba(124, 58, 237, 0.2);
189
63
  outline-offset: 2px;
190
64
  }
191
65
 
192
- /* ========================================
193
- * DISABLED STATE
194
- * ======================================== */
195
-
66
+ /* Disabled */
196
67
  :host([disabled]) {
197
- color: var(--nuraly-checkbox-disabled-text-color);
68
+ color: rgba(0, 0, 0, 0.25);
198
69
  cursor: not-allowed;
199
70
  }
200
-
201
71
  :host([disabled]) input {
202
- background-color: var(--nuraly-checkbox-disabled-background);
203
- border: 1px solid var(--nuraly-checkbox-disabled-border);
72
+ background-color: #f5f5f5;
73
+ border: 1px solid #d9d9d9;
204
74
  cursor: not-allowed;
205
75
  }
206
76
 
207
- /* ========================================
208
- * CHECKMARK AND INDETERMINATE SYMBOLS
209
- * ======================================== */
210
-
211
- /* Base symbol styling */
77
+ /* Checkmark base */
212
78
  input:after {
213
- color: var(--nuraly-checkbox-checkmark-color);
79
+ color: #ffffff;
214
80
  position: absolute;
215
81
  left: 50%;
216
82
  top: 50%;
217
83
  transform: translate(-50%, -51%);
218
- transition: var(--nuraly-checkbox-transition);
84
+ transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
219
85
  }
220
86
 
221
- /* Checked state checkmark */
87
+ /* Checked checkmark */
222
88
  :host([checked]) input:after {
223
- border: solid var(--nuraly-checkbox-checkmark-color);
89
+ border: solid #ffffff;
224
90
  border-width: 0 2px 2px 0;
225
91
  transform: translate(-50%, -51%) rotate(45deg);
226
92
  content: '';
227
- width: var(--nuraly-checkbox-local-medium-checked-width); /* Default to medium size */
228
- height: var(--nuraly-checkbox-local-medium-checked-height); /* Default to medium size */
229
- }
230
-
231
- /* Checkmark sizing per size variant */
232
- :host([checked][size='small']) input:after {
233
- width: var(--nuraly-checkbox-local-small-checked-width);
234
- height: var(--nuraly-checkbox-local-small-checked-height);
235
- }
236
-
237
- :host([checked][size='medium']) input:after {
238
- width: var(--nuraly-checkbox-local-medium-checked-width);
239
- height: var(--nuraly-checkbox-local-medium-checked-height);
240
93
  }
94
+ :host([checked]) input:after { width: 3px; height: 9px; }
95
+ :host([checked][size="small"]) input:after { width: 2px; height: 7px; }
96
+ :host([checked][size="large"]) input:after { width: 4px; height: 10px; }
241
97
 
242
- :host([checked][size='large']) input:after {
243
- width: var(--nuraly-checkbox-local-large-checked-width);
244
- height: var(--nuraly-checkbox-local-large-checked-height);
245
- }
246
-
247
- /* Indeterminate state symbol */
98
+ /* Indeterminate */
248
99
  :host([indeterminate]:not([checked])) input:after {
249
100
  content: '-';
250
- color: var(--nuraly-checkbox-indeterminate-mark-color);
101
+ color: #ffffff;
251
102
  font-weight: bold;
252
103
  transform: translate(-50%, -51%);
253
104
  }
105
+ :host([indeterminate][size="small"]) input:after { font-size: 10px; }
106
+ :host([indeterminate][size="medium"]) input:after { font-size: 11px; }
107
+ :host([indeterminate][size="large"]) input:after { font-size: 13px; }
254
108
 
255
- /* Indeterminate symbol sizing per size variant */
256
- :host([indeterminate][size='small']) input:after {
257
- font-size: var(--nuraly-checkbox-local-small-indeterminate-size);
258
- }
259
-
260
- :host([indeterminate][size='medium']) input:after {
261
- font-size: var(--nuraly-checkbox-local-medium-indeterminate-size);
262
- }
263
-
264
- :host([indeterminate][size='large']) input:after {
265
- font-size: var(--nuraly-checkbox-local-large-indeterminate-size);
266
- }
267
-
268
- /* Empty state - no symbol */
109
+ /* Empty state */
269
110
  :host(:not([checked]):not([indeterminate])) input:after {
270
111
  content: '';
271
112
  }
272
113
 
273
- /* ========================================
274
- * DISABLED STATE SYMBOLS
275
- * ======================================== */
276
-
114
+ /* Disabled checkmark */
277
115
  :host([disabled]) input:after {
278
- color: var(--nuraly-checkbox-disabled-checkmark-color);
279
- border-color: var(--nuraly-checkbox-disabled-checkmark-color);
116
+ color: rgba(0, 0, 0, 0.25);
117
+ border-color: rgba(0, 0, 0, 0.25);
280
118
  }
281
119
 
282
- /* ========================================
283
- * LABEL TEXT STYLING
284
- * ======================================== */
285
-
120
+ /* Label */
286
121
  .checkbox-label {
287
122
  flex: 1;
288
123
  cursor: pointer;
289
124
  user-select: none;
290
- transition: var(--nuraly-checkbox-transition);
125
+ transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
291
126
  }
292
-
293
127
  :host([disabled]) .checkbox-label {
294
128
  cursor: not-allowed;
295
129
  }
296
130
 
297
- /* ========================================
298
- * ACCESSIBILITY IMPROVEMENTS
299
- * ======================================== */
300
-
131
+ /* Accessibility */
301
132
  @media (prefers-reduced-motion: reduce) {
302
133
  :host,
303
134
  input,
@@ -307,16 +138,10 @@ const checkBoxStyles = css `
307
138
  }
308
139
  }
309
140
 
310
- /* High contrast mode support */
311
141
  @media (prefers-contrast: high) {
312
- input {
313
- border-width: 2px;
314
- }
315
-
142
+ input { border-width: 2px; }
316
143
  :host([checked]) input:after,
317
- :host([indeterminate]) input:after {
318
- font-weight: 900;
319
- }
144
+ :host([indeterminate]) input:after { font-weight: 900; }
320
145
  }
321
146
  `;
322
147
  export const styles = checkBoxStyles;
@@ -1,20 +1,13 @@
1
- import{css as e,html as t,LitElement as i}from"lit";import{property as a,customElement as s}from"lit/decorators.js";import{createRef as r,ref as n}from"lit/directives/ref.js";import*as o from"monaco-editor";import{registerCompletion as l}from"monacopilot";import d from"monaco-editor/min/vs/editor/editor.main.css?inline";import h from"monaco-editor/esm/vs/editor/editor.worker?worker";import c from"monaco-editor/esm/vs/language/typescript/ts.worker?worker";import m from"monaco-editor/esm/vs/language/html/html.worker?worker";import u from"monaco-editor/esm/vs/language/json/json.worker?worker";
1
+ import{css as t,html as e,LitElement as i}from"lit";import{property as r,customElement as o}from"lit/decorators.js";import{createRef as n,ref as s}from"lit/directives/ref.js";import{CodeJar as a}from"codejar";import l from"highlight.js/lib/core";import h from"highlight.js/lib/languages/javascript";import c from"highlight.js/lib/languages/typescript";import d from"highlight.js/lib/languages/json";import g from"highlight.js/lib/languages/xml";import u from"highlight.js/lib/languages/css";import m from"highlight.js/lib/languages/markdown";import p from"highlight.js/lib/languages/python";import b from"highlight.js/lib/languages/sql";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2024 Nuraly
5
5
  * SPDX-License-Identifier: MIT
6
- */const p=e`
6
+ */const f=t`
7
7
  :host {
8
- --nuraly-code-editor-width: 100%;
9
- --nuraly-code-editor-height: 100%;
10
- --nuraly-code-editor-min-height: 0;
11
- --nuraly-code-editor-max-height: none;
12
- --nuraly-code-editor-border-radius: 4px;
13
- --nuraly-code-editor-border: 1px solid var(--nuraly-border-color, #e0e0e0);
14
-
15
8
  display: block;
16
- width: var(--nuraly-code-editor-width);
17
- height: var(--nuraly-code-editor-height);
9
+ width: 100%;
10
+ height: 100%;
18
11
  }
19
12
 
20
13
  :host([hidden]) {
@@ -22,34 +15,167 @@ import{css as e,html as t,LitElement as i}from"lit";import{property as a,customE
22
15
  }
23
16
 
24
17
  .editor-container {
18
+ display: flex;
25
19
  width: 100%;
26
20
  height: 100%;
27
- min-height: var(--nuraly-code-editor-min-height);
28
- max-height: var(--nuraly-code-editor-max-height);
29
- border-radius: var(--nuraly-code-editor-border-radius);
21
+ min-height: 80px;
22
+ border-radius: 8px;
23
+ border: 1px solid var(--nr-border, #e0e0e0);
24
+ overflow: auto;
25
+ font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
26
+ font-size: 13px;
27
+ line-height: 1.6;
28
+ }
29
+
30
+ /* Light theme */
31
+ .editor-container.light {
32
+ background: #fafafa;
33
+ color: #24292e;
34
+ }
35
+
36
+ .editor-container.light .line-numbers-gutter {
37
+ background: #f0f0f0;
38
+ color: #999;
39
+ border-right: 1px solid #e0e0e0;
40
+ }
41
+
42
+ /* Dark theme */
43
+ .editor-container.dark {
44
+ background: #1e1e1e;
45
+ color: #d4d4d4;
46
+ border-color: #333;
47
+ }
48
+
49
+ .editor-container.dark .line-numbers-gutter {
50
+ background: #1a1a1a;
51
+ color: #555;
52
+ border-right: 1px solid #333;
53
+ }
54
+
55
+ /* Line numbers gutter */
56
+ .line-numbers-gutter {
57
+ flex-shrink: 0;
58
+ width: 48px;
59
+ padding: 10px 0;
60
+ text-align: right;
61
+ user-select: none;
30
62
  overflow: hidden;
31
63
  }
32
64
 
33
- main {
34
- width: 100%;
35
- height: 100%;
65
+ .line-number {
66
+ padding: 0 12px 0 0;
67
+ font-size: inherit;
68
+ line-height: inherit;
36
69
  }
70
+
71
+ /* Editor area */
72
+ .editor {
73
+ flex: 1;
74
+ min-width: 0;
75
+ padding: 10px 16px;
76
+ outline: none;
77
+ overflow: auto;
78
+ font-family: inherit;
79
+ font-size: inherit;
80
+ line-height: inherit;
81
+ white-space: pre;
82
+ -webkit-font-smoothing: antialiased;
83
+ -moz-osx-font-smoothing: grayscale;
84
+ }
85
+
86
+ .editor:focus {
87
+ outline: none;
88
+ }
89
+
90
+ /* Selection colors */
91
+ .editor-container.light .editor::selection,
92
+ .editor-container.light .editor *::selection {
93
+ background: rgba(124, 58, 237, 0.15);
94
+ }
95
+
96
+ .editor-container.dark .editor::selection,
97
+ .editor-container.dark .editor *::selection {
98
+ background: rgba(124, 58, 237, 0.3);
99
+ }
100
+
101
+ /* Caret color */
102
+ .editor-container.light .editor {
103
+ caret-color: #24292e;
104
+ }
105
+
106
+ .editor-container.dark .editor {
107
+ caret-color: #d4d4d4;
108
+ }
109
+
110
+ /* Readonly state */
111
+ :host([readonly]) .editor {
112
+ opacity: 0.7;
113
+ cursor: default;
114
+ }
115
+
116
+ /* ======== Syntax highlighting — Light theme ======== */
117
+ .editor-container.light .hljs-keyword { color: #d73a49; }
118
+ .editor-container.light .hljs-string { color: #032f62; }
119
+ .editor-container.light .hljs-number { color: #005cc5; }
120
+ .editor-container.light .hljs-comment { color: #6a737d; font-style: italic; }
121
+ .editor-container.light .hljs-function { color: #6f42c1; }
122
+ .editor-container.light .hljs-title { color: #6f42c1; }
123
+ .editor-container.light .hljs-params { color: #24292e; }
124
+ .editor-container.light .hljs-built_in { color: #e36209; }
125
+ .editor-container.light .hljs-literal { color: #005cc5; }
126
+ .editor-container.light .hljs-type { color: #005cc5; }
127
+ .editor-container.light .hljs-attr { color: #005cc5; }
128
+ .editor-container.light .hljs-tag { color: #22863a; }
129
+ .editor-container.light .hljs-name { color: #22863a; }
130
+ .editor-container.light .hljs-selector-class { color: #6f42c1; }
131
+ .editor-container.light .hljs-selector-id { color: #005cc5; }
132
+ .editor-container.light .hljs-attribute { color: #005cc5; }
133
+ .editor-container.light .hljs-variable { color: #e36209; }
134
+ .editor-container.light .hljs-regexp { color: #032f62; }
135
+ .editor-container.light .hljs-symbol { color: #005cc5; }
136
+ .editor-container.light .hljs-meta { color: #6a737d; }
137
+ .editor-container.light .hljs-punctuation { color: #24292e; }
138
+
139
+ /* ======== Syntax highlighting — Dark theme ======== */
140
+ .editor-container.dark .hljs-keyword { color: #c678dd; }
141
+ .editor-container.dark .hljs-string { color: #98c379; }
142
+ .editor-container.dark .hljs-number { color: #d19a66; }
143
+ .editor-container.dark .hljs-comment { color: #5c6370; font-style: italic; }
144
+ .editor-container.dark .hljs-function { color: #61afef; }
145
+ .editor-container.dark .hljs-title { color: #61afef; }
146
+ .editor-container.dark .hljs-params { color: #abb2bf; }
147
+ .editor-container.dark .hljs-built_in { color: #e6c07b; }
148
+ .editor-container.dark .hljs-literal { color: #d19a66; }
149
+ .editor-container.dark .hljs-type { color: #e6c07b; }
150
+ .editor-container.dark .hljs-attr { color: #d19a66; }
151
+ .editor-container.dark .hljs-tag { color: #e06c75; }
152
+ .editor-container.dark .hljs-name { color: #e06c75; }
153
+ .editor-container.dark .hljs-selector-class { color: #e6c07b; }
154
+ .editor-container.dark .hljs-selector-id { color: #61afef; }
155
+ .editor-container.dark .hljs-attribute { color: #d19a66; }
156
+ .editor-container.dark .hljs-variable { color: #e06c75; }
157
+ .editor-container.dark .hljs-regexp { color: #98c379; }
158
+ .editor-container.dark .hljs-symbol { color: #56b6c2; }
159
+ .editor-container.dark .hljs-meta { color: #5c6370; }
160
+ .editor-container.dark .hljs-punctuation { color: #abb2bf; }
37
161
  `
38
162
  /**
39
163
  * @license
40
164
  * Copyright 2024 Nuraly
41
165
  * SPDX-License-Identifier: MIT
42
- */,b={Light:"vs",Dark:"vs-dark",HighContrastDark:"hc-black",HighContrastLight:"hc-light"},y={JavaScript:"javascript",TypeScript:"typescript",JSON:"json",HTML:"html",CSS:"css",Markdown:"markdown",Python:"python",PlainText:"plaintext"},v=e=>class extends e{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupDesignSystemObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var e,t,i;super.disconnectedCallback(),null===(e=this.themeObserver)||void 0===e||e.disconnect(),null===(t=this.designSystemObserver)||void 0===t||t.disconnect(),null===(i=this.mediaQuery)||void 0===i||i.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var e;const t=this.explicitTheme;return t||((null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get explicitTheme(){var e;return(null===(e=this.closest("[data-theme]"))||void 0===e?void 0:e.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme")||null}get currentDesignSystem(){var e;const t=(null===(e=this.closest("[design-system]"))||void 0===e?void 0:e.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===t?t:"default"}setupThemeObserver(){this.themeObserver=new MutationObserver(()=>{this.requestUpdate()}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupDesignSystemObserver(){this.designSystemObserver=new MutationObserver(()=>{this.requestUpdate()}),this.designSystemObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["design-system"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}};
166
+ */,v={Light:"vs",Dark:"vs-dark",HighContrastDark:"hc-black",HighContrastLight:"hc-light"},j={JavaScript:"javascript",TypeScript:"typescript",JSON:"json",HTML:"html",CSS:"css",Markdown:"markdown",Python:"python",PlainText:"plaintext"},k=t=>class extends t{constructor(){super(...arguments),this.handleSystemThemeChange=()=>{this.closest("[data-theme]")||document.documentElement.hasAttribute("data-theme")||this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setupThemeObserver(),this.setupDesignSystemObserver(),this.setupSystemThemeListener()}disconnectedCallback(){var t,e,i;super.disconnectedCallback(),null===(t=this.themeObserver)||void 0===t||t.disconnect(),null===(e=this.designSystemObserver)||void 0===e||e.disconnect(),null===(i=this.mediaQuery)||void 0===i||i.removeEventListener("change",this.handleSystemThemeChange)}get currentTheme(){var t;const e=this.explicitTheme;return e||((null===(t=window.matchMedia)||void 0===t?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light")}get explicitTheme(){var t;return(null===(t=this.closest("[data-theme]"))||void 0===t?void 0:t.getAttribute("data-theme"))||document.documentElement.getAttribute("data-theme")||null}get currentDesignSystem(){var t;const e=(null===(t=this.closest("[design-system]"))||void 0===t?void 0:t.getAttribute("design-system"))||document.documentElement.getAttribute("design-system");return"carbon"===e?e:"default"}setupThemeObserver(){this.themeObserver=new MutationObserver(()=>{this.requestUpdate()}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}setupDesignSystemObserver(){this.designSystemObserver=new MutationObserver(()=>{this.requestUpdate()}),this.designSystemObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["design-system"]})}setupSystemThemeListener(){window.matchMedia&&(this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener("change",this.handleSystemThemeChange))}};
43
167
  /**
44
168
  * @license
45
169
  * Copyright 2024 Nuraly
46
170
  * SPDX-License-Identifier: MIT
47
171
  */
48
- var g=function(e,t,i,a){for(var s,r=arguments.length,n=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a,o=e.length-1;o>=0;o--)(s=e[o])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};"undefined"!=typeof self&&(self.MonacoEnvironment={getWorker:(e,t)=>"typescript"===t||"javascript"===t?new c:"json"===t?new u:"html"===t?new m:new h});let f=class extends(v(i)){constructor(){super(...arguments),this.isEditorReady=!1,this.containerRef=r(),this.readonly=!1,this.theme=b.Dark,this.language="javascript",this.code="",this.lineNumbers=!0,this.minimap=!1,this.wordWrap=!1,this.fontSize=13,this.aiCompletions=!0,this.completionsEndpoint="/api/v1/copilot/completion",this.extraTypeDefinitions=""}render(){return t`
49
- <style>
50
- ${d}
51
- </style>
52
- <div class="editor-container" part="editor-container">
53
- <main ${n(this.containerRef)}></main>
172
+ var y=function(t,e,i,r){for(var o,n=arguments.length,s=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r,a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,i,s):o(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};l.registerLanguage("javascript",h),l.registerLanguage("typescript",c),l.registerLanguage("json",d),l.registerLanguage("html",g),l.registerLanguage("xml",g),l.registerLanguage("css",u),l.registerLanguage("markdown",m),l.registerLanguage("python",p),l.registerLanguage("sql",b);let w=class extends(k(i)){constructor(){super(...arguments),this.isEditorReady=!1,this.editorRef=n(),this.suppressChange=!1,this.readonly=!1,this.theme=v.Dark,this.language="javascript",this.code="",this.lineNumbers=!0,this.fontSize=13,this.wordWrap=!1,this.tabSize=2}render(){const t=this.isDarkTheme();return e`
173
+ <div class="editor-container ${t?"dark":"light"}" part="editor-container">
174
+ <div class="line-numbers-gutter" style="display: ${this.lineNumbers?"block":"none"}"></div>
175
+ <code
176
+ ${s(this.editorRef)}
177
+ class="editor language-${this.language}"
178
+ style="font-size: ${this.fontSize}px; tab-size: ${this.tabSize}; white-space: ${this.wordWrap?"pre-wrap":"pre"};"
179
+ ></code>
54
180
  </div>
55
- `}getValue(){var e,t;return null!==(t=null===(e=this.editor)||void 0===e?void 0:e.getValue())&&void 0!==t?t:""}setValue(e){if(this.editor){const t=this.editor.getPosition();this.editor.setValue(e),t&&this.editor.setPosition(t)}}setOptions(e){var t;null===(t=this.editor)||void 0===t||t.updateOptions(e)}focus(){var e;null===(e=this.editor)||void 0===e||e.focus()}firstUpdated(){this.containerRef.value?this.initializeEditor():console.error("NrCodeEditor: Container element not available")}initializeEditor(){const e=this.getInitialTheme();try{this.editor=o.editor.create(this.containerRef.value,{value:this.code,language:this.language,theme:e,fontSize:this.fontSize,automaticLayout:!0,readOnly:this.readonly,lineNumbers:this.lineNumbers?"on":"off",minimap:{enabled:this.minimap},wordWrap:this.wordWrap?"on":"off"}),this.isEditorReady=!0}catch(e){return void console.error("NrCodeEditor: Failed to create editor",e)}this.setupCustomIntelliSense(),this.aiCompletions&&l(o,this.editor,{language:this.language,endpoint:this.completionsEndpoint}),this.setupEventListeners(),this.setupThemeListener(),this.dispatchEvent(new CustomEvent("nr-ready",{detail:{editor:this.editor},bubbles:!0,composed:!0}))}setupEventListeners(){var e;this.editor&&(null===(e=this.editor.getModel())||void 0===e||e.onDidChangeContent(()=>{this.emit("nr-change",{value:this.getValue()})}),this.editor.onKeyDown(e=>{this.emit("nr-keydown",this.createKeyEventDetail(e))}),this.editor.onKeyUp(e=>{this.emit("nr-keyup",this.createKeyEventDetail(e))}),this.editor.onDidFocusEditorWidget(()=>this.emit("nr-focus")),this.editor.onDidBlurEditorWidget(()=>this.emit("nr-blur")))}createKeyEventDetail(e){return{event:e.browserEvent,key:e.browserEvent.key,code:e.browserEvent.code,ctrlKey:e.browserEvent.ctrlKey,shiftKey:e.browserEvent.shiftKey,altKey:e.browserEvent.altKey,metaKey:e.browserEvent.metaKey}}emit(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}setupThemeListener(){this.applyThemeFromMixin()}getMonacoThemeFromMixin(){if(this.theme)return this.theme;return this.currentTheme.includes("dark")?b.Dark:b.Light}applyThemeFromMixin(){if(!this.isEditorReady||!this.editor)return;const e=this.getMonacoThemeFromMixin();if(e!==this.lastAppliedTheme)try{o.editor.setTheme(e),this.lastAppliedTheme=e}catch(e){}}getInitialTheme(){return this.getMonacoThemeFromMixin()}setupCustomIntelliSense(){const e=o.languages.typescript.typescriptDefaults,t=o.languages.typescript.javascriptDefaults;[e,t].forEach(e=>{this.extraTypeDefinitions&&e.addExtraLib(this.extraTypeDefinitions,"database-types.d.ts")});const i={target:o.languages.typescript.ScriptTarget.ES2020,allowNonTsExtensions:!0,moduleResolution:o.languages.typescript.ModuleResolutionKind.NodeJs,module:o.languages.typescript.ModuleKind.CommonJS,noEmit:!0,esModuleInterop:!0,allowJs:!0};e.setCompilerOptions(Object.assign(Object.assign({},i),{jsx:o.languages.typescript.JsxEmit.React,reactNamespace:"React",typeRoots:["node_modules/@types"]})),t.setCompilerOptions(Object.assign(Object.assign({},i),{checkJs:!1})),o.languages.registerCompletionItemProvider(["javascript","typescript"],{provideCompletionItems:()=>({suggestions:[{label:"Database",kind:o.languages.CompletionItemKind.Class,insertText:"Database",documentation:"Static Database Client for Nuraly Database Manager",detail:"class Database"},{label:"Database.select",kind:o.languages.CompletionItemKind.Method,insertText:'Database.select(${1:"tableName"}, {${2:}})',insertTextRules:o.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Select data from a table with optional criteria and relations",detail:"(method) Database.select(tableName: string, options?: SelectOptions): Promise<any>"},{label:"Database.insert",kind:o.languages.CompletionItemKind.Method,insertText:'Database.insert(${1:"tableName"}, ${2:{}})',insertTextRules:o.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Insert data into a table",detail:"(method) Database.insert(tableName: string, data: Record<string, any>): Promise<any>"},{label:"Database.update",kind:o.languages.CompletionItemKind.Method,insertText:'Database.update(${1:"tableName"}, ${2:{}}, ${3:{}})',insertTextRules:o.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Update data in a table",detail:"(method) Database.update(tableName: string, data: Record<string, any>, criteria: Record<string, any>): Promise<any>"},{label:"Database.delete",kind:o.languages.CompletionItemKind.Method,insertText:'Database.delete(${1:"tableName"}, ${2:{}})',insertTextRules:o.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Delete data from a table",detail:"(method) Database.delete(tableName: string, criteria: Record<string, any>): Promise<any>"},{label:"Database.createTable",kind:o.languages.CompletionItemKind.Method,insertText:'Database.createTable(${1:"tableName"}, {\n ${2:field}: { type: ${3:"varchar"}, nullable: ${4:false} }\n})',insertTextRules:o.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Create a new table with specified schema",detail:"(method) Database.createTable(tableName: string, schema: TableSchema, options?: Record<string, any>): Promise<any>"},{label:"Database.paginate",kind:o.languages.CompletionItemKind.Method,insertText:'Database.paginate(${1:"tableName"}, ${2:1}, ${3:10}, ${4:{}})',insertTextRules:o.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Get paginated results with metadata",detail:"(method) Database.paginate(tableName: string, page?: number, pageSize?: number, options?: SelectOptions): Promise<PaginationResult<any>>"},{label:"Database.schemaQuery",kind:o.languages.CompletionItemKind.Method,insertText:'Database.schemaQuery(${1:"LIST_TABLES"}${2:, "tableName"})',insertTextRules:o.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Execute schema queries for database introspection",detail:"(method) Database.schemaQuery(type: string, tableName?: string): Promise<any>"},{label:"Database.join",kind:o.languages.CompletionItemKind.Method,insertText:'Database.join(${1:"mainTable"}, [\n { table: ${2:"joinTable"}, on: ${3:"field1 = field2"}, type: ${4:"inner"} }\n], ${5:{}})',insertTextRules:o.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Perform complex join queries",detail:"(method) Database.join(mainTable: string, joins: JoinDefinition[], options?: Record<string, any>): Promise<any>"}]})}),o.languages.registerHoverProvider(["javascript","typescript"],{provideHover:(e,t)=>{const i=e.getWordAtPosition(t);if(!i)return;return{Database:{contents:[{value:"**Database**"},{value:"Static Database Client for Nuraly Database Manager"},{value:"Provides a comprehensive interface for database operations including:"},{value:"- Table management (create, drop, schema operations)"},{value:"- Data operations (select, insert, update, delete)"},{value:"- Advanced queries (joins, aggregations, pagination)"},{value:"- Schema introspection and management"}]}}[i.word]||null}})}updated(e){var t;if(super.updated(e),this.isEditorReady&&this.editor){if(this.applyThemeFromMixin(),e.has("code")&&this.code!==e.get("code")){if(this.editor.getModel()&&this.code!==this.getValue())try{const e=this.editor.getPosition();this.editor.setValue(null!==(t=this.code)&&void 0!==t?t:""),e&&this.editor.setPosition(e)}catch(e){}}if(e.has("readonly"))try{this.editor.updateOptions({readOnly:this.readonly})}catch(e){}if(e.has("language")&&this.editor.getModel())try{o.editor.setModelLanguage(this.editor.getModel(),this.language||"plaintext")}catch(e){}if(e.has("theme"))try{o.editor.setTheme(this.theme)}catch(e){}if(e.has("fontSize"))try{this.editor.updateOptions({fontSize:this.fontSize})}catch(e){}if(e.has("lineNumbers"))try{this.editor.updateOptions({lineNumbers:this.lineNumbers?"on":"off"})}catch(e){}if(e.has("minimap"))try{this.editor.updateOptions({minimap:{enabled:this.minimap}})}catch(e){}if(e.has("wordWrap"))try{this.editor.updateOptions({wordWrap:this.wordWrap?"on":"off"})}catch(e){}}}disconnectedCallback(){if(super.disconnectedCallback(),this.editor){const e=this.editor.getModel();this.editor.dispose(),null==e||e.dispose(),this.editor=void 0}this.isEditorReady=!1}};f.styles=p,g([a({type:Boolean,reflect:!0})],f.prototype,"readonly",void 0),g([a({type:String,reflect:!0})],f.prototype,"theme",void 0),g([a({type:String,reflect:!0})],f.prototype,"language",void 0),g([a({type:String})],f.prototype,"code",void 0),g([a({type:Boolean,attribute:"line-numbers"})],f.prototype,"lineNumbers",void 0),g([a({type:Boolean})],f.prototype,"minimap",void 0),g([a({type:Boolean,attribute:"word-wrap"})],f.prototype,"wordWrap",void 0),g([a({type:Number,attribute:"font-size"})],f.prototype,"fontSize",void 0),g([a({type:Boolean,attribute:"ai-completions"})],f.prototype,"aiCompletions",void 0),g([a({type:String,attribute:"completions-endpoint"})],f.prototype,"completionsEndpoint",void 0),g([a({attribute:!1})],f.prototype,"extraTypeDefinitions",void 0),f=g([s("nr-code-editor")],f);export{y as CODE_EDITOR_LANGUAGE,b as CODE_EDITOR_THEME,f as NrCodeEditorElement,p as codeEditorStyles};
181
+ `}getValue(){var t,e;return null!==(e=null===(t=this.editorRef.value)||void 0===t?void 0:t.textContent)&&void 0!==e?e:""}setValue(t){this.jar&&(this.suppressChange=!0,this.jar.updateCode(t),this.suppressChange=!1)}focus(){var t;null===(t=this.editorRef.value)||void 0===t||t.focus()}firstUpdated(){this.editorRef.value&&this.initializeEditor()}initializeEditor(){const t=this.editorRef.value;t.textContent=this.code;this.jar=a(t,t=>{const e=t.textContent||"",i=this.language||"plaintext";try{"plaintext"!==i&&l.getLanguage(i)?t.innerHTML=l.highlight(e,{language:i}).value:t.innerHTML=this.escapeHtml(e)}catch(i){t.innerHTML=this.escapeHtml(e)}},{tab:" ".repeat(this.tabSize),indentOn:/[({[]$/,addClosing:!0,catchTab:!0,preserveIdent:!0,history:!0}),this.isEditorReady=!0,this.jar.onUpdate(t=>{this.suppressChange||(this.code=t,this.updateLineNumbers(),this.emit("nr-change",{value:t}))}),t.addEventListener("keydown",t=>{this.readonly?t.preventDefault():this.emit("nr-keydown",this.createKeyEventDetail(t))}),t.addEventListener("keyup",t=>{this.emit("nr-keyup",this.createKeyEventDetail(t))}),t.addEventListener("focus",()=>this.emit("nr-focus")),t.addEventListener("blur",()=>this.emit("nr-blur")),this.readonly&&t.setAttribute("contenteditable","false"),this.updateLineNumbers(),this.emit("nr-ready",{editor:this.jar})}escapeHtml(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}updateLineNumbers(){var t,e,i;const r=null!==(e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".line-numbers-gutter"))&&void 0!==e?e:null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(".line-numbers-gutter");if(!r||!this.lineNumbers)return;const o=this.getValue().split("\n").length;r.innerHTML=Array.from({length:o},(t,e)=>`<div class="line-number">${e+1}</div>`).join("")}createKeyEventDetail(t){return{event:t,key:t.key,code:t.code,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey}}emit(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}isDarkTheme(){var t,e;return this.theme===v.Dark||this.theme===v.HighContrastDark||this.theme!==v.Light&&this.theme!==v.HighContrastLight&&(null!==(e=null===(t=this.currentTheme)||void 0===t?void 0:t.includes("dark"))&&void 0!==e&&e)}updated(t){var e;if(super.updated(t),this.isEditorReady&&this.jar){if(t.has("code")&&this.code!==t.get("code")){const t=this.getValue();this.code!==t&&(this.setValue(this.code),this.updateLineNumbers())}t.has("readonly")&&(null===(e=this.editorRef.value)||void 0===e||e.setAttribute("contenteditable",this.readonly?"false":"true"))}}disconnectedCallback(){super.disconnectedCallback(),this.jar&&(this.jar.destroy(),this.jar=void 0),this.isEditorReady=!1}};w.styles=f,w.useShadowDom=!0,y([r({type:Boolean,reflect:!0})],w.prototype,"readonly",void 0),y([r({type:String,reflect:!0})],w.prototype,"theme",void 0),y([r({type:String,reflect:!0})],w.prototype,"language",void 0),y([r({type:String})],w.prototype,"code",void 0),y([r({type:Boolean,attribute:"line-numbers"})],w.prototype,"lineNumbers",void 0),y([r({type:Number,attribute:"font-size"})],w.prototype,"fontSize",void 0),y([r({type:Boolean,attribute:"word-wrap"})],w.prototype,"wordWrap",void 0),y([r({type:Number,attribute:"tab-size"})],w.prototype,"tabSize",void 0),w=y([o("nr-code-editor")],w);export{j as CODE_EDITOR_LANGUAGE,v as CODE_EDITOR_THEME,w as NrCodeEditorElement,f as codeEditorStyles};