@limetech/lime-crm-building-blocks 1.95.0 → 1.97.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 (246) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/{_MapCache-2e84a981.js → _MapCache-8b125fbb.js} +0 -26
  3. package/dist/cjs/{_Uint8Array-1e99726d.js → _Uint8Array-95263550.js} +1 -12
  4. package/dist/cjs/_baseIsEqual-cb7951b0.js +496 -0
  5. package/dist/cjs/_defineProperty-40a6ad5d.js +15 -0
  6. package/dist/cjs/{get-1acf79ce.js → get-932b213e.js} +5 -4
  7. package/dist/cjs/isEqual-e77cce75.js +37 -0
  8. package/dist/cjs/isSymbol-5b36aeee.js +30 -0
  9. package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
  10. package/dist/cjs/lime-query.types-bcb63a22.js +61 -0
  11. package/dist/cjs/limebb-component-config.cjs.entry.js +3 -2
  12. package/dist/cjs/limebb-document-item.cjs.entry.js +174 -0
  13. package/dist/cjs/limebb-document-picker.cjs.entry.js +82 -0
  14. package/dist/cjs/limebb-feed-item-thumbnail-file-info.cjs.entry.js +1 -1
  15. package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +1 -1
  16. package/dist/cjs/limebb-feed.cjs.entry.js +1 -1
  17. package/dist/cjs/limebb-icon-picker.cjs.entry.js +1 -1
  18. package/dist/cjs/limebb-info-tile-format.cjs.entry.js +1 -1
  19. package/dist/cjs/limebb-info-tile.cjs.entry.js +1 -1
  20. package/dist/cjs/limebb-kanban-group.cjs.entry.js +1 -1
  21. package/dist/cjs/limebb-kanban-item.cjs.entry.js +1 -1
  22. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +382 -150
  23. package/dist/cjs/limebb-lime-query-filter-and_5.cjs.entry.js +278 -0
  24. package/dist/cjs/limebb-lime-query-value-input.cjs.entry.js +239 -0
  25. package/dist/cjs/limebb-limetype-field_2.cjs.entry.js +406 -0
  26. package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
  27. package/dist/cjs/limebb-locale-picker.cjs.entry.js +13 -498
  28. package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
  29. package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +3 -3
  30. package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
  31. package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
  32. package/dist/cjs/limebb-property-selector.cjs.entry.js +234 -0
  33. package/dist/cjs/limebb-response-format-item.cjs.entry.js +80 -0
  34. package/dist/cjs/limebb-text-editor.cjs.entry.js +22 -83
  35. package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
  36. package/dist/cjs/limetype-1fe0207f.js +90 -0
  37. package/dist/cjs/loader.cjs.js +1 -1
  38. package/dist/cjs/property-resolution-fb42a46b.js +66 -0
  39. package/dist/cjs/random-string-aac0a74b.js +24 -0
  40. package/dist/collection/collection-manifest.json +12 -0
  41. package/dist/collection/components/document-picker/document-item/document-item.css +64 -0
  42. package/dist/collection/components/document-picker/document-item/document-item.js +265 -0
  43. package/dist/collection/components/document-picker/document-item/document-item.types.js +1 -0
  44. package/dist/collection/components/document-picker/document-picker.css +139 -0
  45. package/dist/collection/components/document-picker/document-picker.js +304 -0
  46. package/dist/collection/components/document-picker/document.types.js +1 -0
  47. package/dist/collection/components/feed/feed-item/feed-timeline-item.js +1 -1
  48. package/dist/collection/components/feed/feed-item-thumbnail-file-info/feed-item-thumbnail-file-info.js +1 -1
  49. package/dist/collection/components/feed/feed.js +1 -1
  50. package/dist/collection/components/icon-picker/icon-picker.js +1 -1
  51. package/dist/collection/components/info-tile/format/config/info-tile-format.js +1 -1
  52. package/dist/collection/components/info-tile/info-tile.js +1 -1
  53. package/dist/collection/components/kanban/kanban-group/kanban-group.js +1 -1
  54. package/dist/collection/components/kanban/kanban-item/kanban-item.js +1 -1
  55. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.css +121 -0
  56. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-and.js +257 -0
  57. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.css +39 -0
  58. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +246 -0
  59. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.css +104 -0
  60. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-expression.js +220 -0
  61. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.css +107 -0
  62. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +212 -0
  63. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.css +123 -0
  64. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-or.js +237 -0
  65. package/dist/collection/components/lime-query-builder/expressions/lime-query-value-input.css +48 -0
  66. package/dist/collection/components/lime-query-builder/expressions/lime-query-value-input.js +457 -0
  67. package/dist/collection/components/lime-query-builder/filter-conversion.js +118 -21
  68. package/dist/collection/components/lime-query-builder/lime-query-builder.css +30 -17
  69. package/dist/collection/components/lime-query-builder/lime-query-builder.js +233 -28
  70. package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +435 -0
  71. package/dist/collection/components/lime-query-builder/property-selection-format.js +158 -0
  72. package/dist/collection/components/lime-query-builder/property-selector/property-selector.css +8 -0
  73. package/dist/collection/components/lime-query-builder/property-selector/property-selector.js +422 -0
  74. package/dist/collection/components/lime-query-builder/response-format-editor.css +72 -0
  75. package/dist/collection/components/lime-query-builder/response-format-editor.js +249 -0
  76. package/dist/collection/components/lime-query-builder/response-format-item.css +61 -0
  77. package/dist/collection/components/lime-query-builder/response-format-item.js +208 -0
  78. package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
  79. package/dist/collection/components/locale-picker/locale-picker.js +1 -1
  80. package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
  81. package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
  82. package/dist/collection/components/summary-popover/summary-popover.js +3 -3
  83. package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
  84. package/dist/collection/components/text-editor/text-editor.js +1 -1
  85. package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
  86. package/dist/collection/util/format-bytes.js +36 -0
  87. package/dist/components/_MapCache.js +2 -27
  88. package/dist/components/_Uint8Array.js +2 -12
  89. package/dist/components/_baseIsEqual.js +494 -0
  90. package/dist/components/_defineProperty.js +13 -0
  91. package/dist/components/document-item.js +190 -0
  92. package/dist/components/feed-item-thumbnail-file-info.js +1 -1
  93. package/dist/components/feed-timeline-item.js +1 -1
  94. package/dist/components/get.js +2 -1
  95. package/dist/components/isEqual.js +35 -0
  96. package/dist/components/isSymbol.js +28 -0
  97. package/dist/components/kanban-group.js +1 -1
  98. package/dist/components/kanban-item.js +1 -1
  99. package/dist/components/lime-query-filter-and.js +408 -0
  100. package/dist/components/lime-query-filter-comparison.js +152 -0
  101. package/dist/components/lime-query-value-input.js +266 -0
  102. package/dist/components/limebb-document-item.d.ts +11 -0
  103. package/dist/components/limebb-document-item.js +6 -0
  104. package/dist/components/limebb-document-picker.d.ts +11 -0
  105. package/dist/components/limebb-document-picker.js +111 -0
  106. package/dist/components/limebb-feed.js +1 -1
  107. package/dist/components/limebb-icon-picker.js +1 -1
  108. package/dist/components/limebb-info-tile-format.js +1 -1
  109. package/dist/components/limebb-info-tile.js +1 -1
  110. package/dist/components/limebb-lime-query-builder.js +441 -149
  111. package/dist/components/limebb-lime-query-filter-and.d.ts +11 -0
  112. package/dist/components/limebb-lime-query-filter-and.js +6 -0
  113. package/dist/components/limebb-lime-query-filter-comparison.d.ts +11 -0
  114. package/dist/components/limebb-lime-query-filter-comparison.js +6 -0
  115. package/dist/components/limebb-lime-query-filter-expression.d.ts +11 -0
  116. package/dist/components/limebb-lime-query-filter-expression.js +6 -0
  117. package/dist/components/limebb-lime-query-filter-not.d.ts +11 -0
  118. package/dist/components/limebb-lime-query-filter-not.js +6 -0
  119. package/dist/components/limebb-lime-query-filter-or.d.ts +11 -0
  120. package/dist/components/limebb-lime-query-filter-or.js +6 -0
  121. package/dist/components/limebb-lime-query-value-input.d.ts +11 -0
  122. package/dist/components/limebb-lime-query-value-input.js +6 -0
  123. package/dist/components/limebb-limetype-field.d.ts +11 -0
  124. package/dist/components/limebb-limetype-field.js +6 -0
  125. package/dist/components/limebb-locale-picker.js +8 -493
  126. package/dist/components/limebb-mention-group-counter.js +2 -2
  127. package/dist/components/limebb-percentage-visualizer.js +2 -2
  128. package/dist/components/limebb-property-selector.d.ts +11 -0
  129. package/dist/components/limebb-property-selector.js +6 -0
  130. package/dist/components/limebb-response-format-editor.d.ts +11 -0
  131. package/dist/components/limebb-response-format-editor.js +6 -0
  132. package/dist/components/limebb-response-format-item.d.ts +11 -0
  133. package/dist/components/limebb-response-format-item.js +6 -0
  134. package/dist/components/limebb-text-editor.js +8 -69
  135. package/dist/components/limebb-trend-indicator.js +1 -1
  136. package/dist/components/limetype-field.js +184 -0
  137. package/dist/components/limetype.js +85 -0
  138. package/dist/components/live-docs-info.js +2 -2
  139. package/dist/components/notification-item.js +1 -1
  140. package/dist/components/property-selector.js +317 -0
  141. package/dist/components/random-string.js +22 -0
  142. package/dist/components/response-format-editor.js +278 -0
  143. package/dist/components/response-format-item.js +104 -0
  144. package/dist/components/summary-popover.js +3 -3
  145. package/dist/esm/{_MapCache-6484495d.js → _MapCache-af496e9d.js} +2 -27
  146. package/dist/esm/{_Uint8Array-e5cac922.js → _Uint8Array-d6ebd526.js} +3 -13
  147. package/dist/esm/_baseIsEqual-28053b81.js +494 -0
  148. package/dist/esm/_defineProperty-e6a185c3.js +13 -0
  149. package/dist/esm/{get-f9e0b2e1.js → get-3e42932b.js} +2 -1
  150. package/dist/esm/isEqual-57d0c223.js +35 -0
  151. package/dist/esm/isSymbol-1c5f65cc.js +28 -0
  152. package/dist/esm/lime-crm-building-blocks.js +1 -1
  153. package/dist/esm/lime-query.types-f72355e1.js +59 -0
  154. package/dist/esm/limebb-component-config.entry.js +3 -2
  155. package/dist/esm/limebb-document-item.entry.js +170 -0
  156. package/dist/esm/limebb-document-picker.entry.js +78 -0
  157. package/dist/esm/limebb-feed-item-thumbnail-file-info.entry.js +1 -1
  158. package/dist/esm/limebb-feed-timeline-item.entry.js +1 -1
  159. package/dist/esm/limebb-feed.entry.js +1 -1
  160. package/dist/esm/limebb-icon-picker.entry.js +1 -1
  161. package/dist/esm/limebb-info-tile-format.entry.js +1 -1
  162. package/dist/esm/limebb-info-tile.entry.js +1 -1
  163. package/dist/esm/limebb-kanban-group.entry.js +1 -1
  164. package/dist/esm/limebb-kanban-item.entry.js +1 -1
  165. package/dist/esm/limebb-lime-query-builder.entry.js +379 -147
  166. package/dist/esm/limebb-lime-query-filter-and_5.entry.js +270 -0
  167. package/dist/esm/limebb-lime-query-value-input.entry.js +235 -0
  168. package/dist/esm/limebb-limetype-field_2.entry.js +401 -0
  169. package/dist/esm/limebb-live-docs-info.entry.js +2 -2
  170. package/dist/esm/limebb-locale-picker.entry.js +9 -494
  171. package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
  172. package/dist/esm/limebb-navigation-button_2.entry.js +3 -3
  173. package/dist/esm/limebb-notification-item.entry.js +1 -1
  174. package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
  175. package/dist/esm/limebb-property-selector.entry.js +230 -0
  176. package/dist/esm/limebb-response-format-item.entry.js +76 -0
  177. package/dist/esm/limebb-text-editor.entry.js +8 -69
  178. package/dist/esm/limebb-trend-indicator.entry.js +1 -1
  179. package/dist/esm/limetype-6e7552a7.js +85 -0
  180. package/dist/esm/loader.js +1 -1
  181. package/dist/esm/property-resolution-fde2375e.js +63 -0
  182. package/dist/esm/random-string-f6ef6fbf.js +22 -0
  183. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  184. package/dist/lime-crm-building-blocks/{p-85e11ff7.entry.js → p-00da9b24.entry.js} +1 -1
  185. package/dist/lime-crm-building-blocks/p-02c0cc04.entry.js +1 -0
  186. package/dist/lime-crm-building-blocks/p-123190c3.js +1 -0
  187. package/dist/lime-crm-building-blocks/p-244ee55b.entry.js +1 -0
  188. package/dist/lime-crm-building-blocks/p-35897ec3.js +1 -0
  189. package/dist/lime-crm-building-blocks/{p-d6a07ea4.entry.js → p-3932077b.entry.js} +1 -1
  190. package/dist/lime-crm-building-blocks/p-3b0a15ec.js +1 -0
  191. package/dist/lime-crm-building-blocks/p-4a82410e.entry.js +1 -0
  192. package/dist/lime-crm-building-blocks/{p-a694aae5.entry.js → p-50d3d61a.entry.js} +1 -1
  193. package/dist/lime-crm-building-blocks/p-5a6d2e7f.js +1 -0
  194. package/dist/lime-crm-building-blocks/p-60971d64.js +1 -0
  195. package/dist/lime-crm-building-blocks/{p-a44f543c.entry.js → p-61282e1a.entry.js} +1 -1
  196. package/dist/lime-crm-building-blocks/p-6c1146ca.entry.js +1 -0
  197. package/dist/lime-crm-building-blocks/p-70a28b93.entry.js +1 -0
  198. package/dist/lime-crm-building-blocks/{p-16199127.entry.js → p-79d4668a.entry.js} +1 -1
  199. package/dist/lime-crm-building-blocks/p-7e6fb4af.js +1 -0
  200. package/dist/lime-crm-building-blocks/{p-88cc5b66.entry.js → p-82d33d43.entry.js} +1 -1
  201. package/dist/lime-crm-building-blocks/{p-7db8652e.entry.js → p-8c4eb49f.entry.js} +1 -1
  202. package/dist/lime-crm-building-blocks/p-96beaabc.entry.js +1 -0
  203. package/dist/lime-crm-building-blocks/p-9d25ed5a.entry.js +1 -0
  204. package/dist/lime-crm-building-blocks/{p-8dce83ad.entry.js → p-9d9f25da.entry.js} +1 -1
  205. package/dist/lime-crm-building-blocks/p-a659d55a.js +1 -0
  206. package/dist/lime-crm-building-blocks/p-b7c72179.entry.js +1 -0
  207. package/dist/lime-crm-building-blocks/p-baf4e428.entry.js +1 -0
  208. package/dist/lime-crm-building-blocks/{p-516210d4.entry.js → p-beb0d164.entry.js} +1 -1
  209. package/dist/lime-crm-building-blocks/p-d298b34e.js +1 -0
  210. package/dist/lime-crm-building-blocks/{p-047c89de.entry.js → p-d89c44ad.entry.js} +1 -1
  211. package/dist/lime-crm-building-blocks/p-e0ab1554.js +1 -0
  212. package/dist/lime-crm-building-blocks/{p-46d2f604.entry.js → p-e35299e0.entry.js} +1 -1
  213. package/dist/lime-crm-building-blocks/{p-8ef39ab8.entry.js → p-e9d23ef7.entry.js} +1 -1
  214. package/dist/lime-crm-building-blocks/p-ef8a5266.entry.js +1 -0
  215. package/dist/lime-crm-building-blocks/{p-abf1c197.entry.js → p-f52125a0.entry.js} +1 -1
  216. package/dist/lime-crm-building-blocks/p-f99c611d.entry.js +1 -0
  217. package/dist/lime-crm-building-blocks/p-fbda77a7.js +1 -0
  218. package/dist/lime-crm-building-blocks/p-fe2b91d9.js +1 -0
  219. package/dist/lime-crm-building-blocks/{p-d6af09a8.entry.js → p-ff0b244b.entry.js} +1 -1
  220. package/dist/types/components/document-picker/document-item/document-item.d.ts +46 -0
  221. package/dist/types/components/document-picker/document-item/document-item.types.d.ts +37 -0
  222. package/dist/types/components/document-picker/document-picker.d.ts +80 -0
  223. package/dist/types/components/document-picker/document.types.d.ts +2 -0
  224. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-and.d.ts +56 -0
  225. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-comparison.d.ts +64 -0
  226. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-expression.d.ts +53 -0
  227. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-not.d.ts +54 -0
  228. package/dist/types/components/lime-query-builder/expressions/lime-query-filter-or.d.ts +55 -0
  229. package/dist/types/components/lime-query-builder/expressions/lime-query-value-input.d.ts +92 -0
  230. package/dist/types/components/lime-query-builder/filter-conversion.d.ts +18 -0
  231. package/dist/types/components/lime-query-builder/lime-query-builder.d.ts +30 -8
  232. package/dist/types/components/lime-query-builder/limetype-field/limetype-field.d.ts +96 -0
  233. package/dist/types/components/lime-query-builder/property-selection-format.d.ts +23 -0
  234. package/dist/types/components/lime-query-builder/property-selector/property-selector.d.ts +71 -0
  235. package/dist/types/components/lime-query-builder/response-format-editor.d.ts +57 -0
  236. package/dist/types/components/lime-query-builder/response-format-item.d.ts +46 -0
  237. package/dist/types/components.d.ts +1795 -114
  238. package/dist/types/util/format-bytes.d.ts +20 -0
  239. package/package.json +2 -2
  240. package/dist/lime-crm-building-blocks/p-29346b1a.entry.js +0 -1
  241. package/dist/lime-crm-building-blocks/p-4ccce5cc.entry.js +0 -1
  242. package/dist/lime-crm-building-blocks/p-7ef3bace.entry.js +0 -1
  243. package/dist/lime-crm-building-blocks/p-8044ffbd.js +0 -1
  244. package/dist/lime-crm-building-blocks/p-92ec9205.entry.js +0 -1
  245. package/dist/lime-crm-building-blocks/p-bcc23575.js +0 -1
  246. package/dist/lime-crm-building-blocks/p-c40a3f4b.js +0 -1
@@ -0,0 +1,234 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-ff255a0d.js');
6
+ const index_esm = require('./index.esm-a894ac76.js');
7
+ const propertyResolution = require('./property-resolution-fb42a46b.js');
8
+
9
+ const propertySelectorCss = ":host(limebb-property-selector){display:block}limel-menu{display:block;width:100%}";
10
+ const LimebbPropertySelectorStyle0 = propertySelectorCss;
11
+
12
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
13
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
15
+ r = Reflect.decorate(decorators, target, key, desc);
16
+ else
17
+ for (var i = decorators.length - 1; i >= 0; i--)
18
+ if (d = decorators[i])
19
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
20
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
21
+ };
22
+ const PropertySelector = class {
23
+ constructor(hostRef) {
24
+ index.registerInstance(this, hostRef);
25
+ this.change = index.createEvent(this, "change", 7);
26
+ /**
27
+ * Label for the input
28
+ */
29
+ this.label = 'Property';
30
+ /**
31
+ * Whether the field is required
32
+ */
33
+ this.required = false;
34
+ this.isOpen = false;
35
+ this.navigationPath = '';
36
+ this.menuItems = [];
37
+ this.handleChipSetWrapperClick = (event) => {
38
+ // Stop all clicks on the chip-set from bubbling
39
+ // This prevents the menu from opening when clicking chip remove buttons
40
+ event.stopPropagation();
41
+ };
42
+ this.handleChipSetFocus = () => {
43
+ // Open menu when the chip-set input receives focus
44
+ // This happens when user clicks to type/edit
45
+ if (!this.isOpen) {
46
+ this.navigationPath = this.value || '';
47
+ this.loadMenuItems();
48
+ this.isOpen = true;
49
+ }
50
+ };
51
+ this.handleSelect = (event) => {
52
+ event.stopPropagation();
53
+ const selectedPath = event.detail.value;
54
+ if (!selectedPath) {
55
+ return;
56
+ }
57
+ // Check if this is a complete path (leaf property, not a relation)
58
+ const property = propertyResolution.getPropertyFromPath(this.limetypes, this.limetype, selectedPath);
59
+ if (property === null || property === void 0 ? void 0 : property.relation) {
60
+ // This is a relation - update navigation but don't emit
61
+ this.navigationPath = selectedPath;
62
+ }
63
+ else {
64
+ // This is a leaf property - emit and close
65
+ this.change.emit(selectedPath);
66
+ this.isOpen = false;
67
+ this.navigationPath = '';
68
+ }
69
+ };
70
+ this.handleNavigateMenu = (event) => {
71
+ var _a;
72
+ event.stopPropagation();
73
+ if ((_a = event.detail) === null || _a === void 0 ? void 0 : _a.value) {
74
+ // Update navigation path when drilling down
75
+ this.navigationPath = event.detail.value;
76
+ }
77
+ };
78
+ this.handleCancel = () => {
79
+ this.isOpen = false;
80
+ this.navigationPath = '';
81
+ };
82
+ this.handleChipSetChange = (event) => {
83
+ event.stopPropagation();
84
+ const detail = event.detail;
85
+ // Handle both single chip and array of chips
86
+ if (!detail) {
87
+ // Clear all was clicked
88
+ this.change.emit('');
89
+ this.navigationPath = '';
90
+ return;
91
+ }
92
+ // Convert to array if it's a single chip
93
+ const chips = Array.isArray(detail) ? detail : [detail];
94
+ if (chips.length === 0) {
95
+ // All chips removed
96
+ this.change.emit('');
97
+ this.navigationPath = '';
98
+ }
99
+ else {
100
+ // A chip was removed - emit the last remaining chip's value
101
+ const lastChip = chips.at(-1);
102
+ if (lastChip) {
103
+ this.change.emit(lastChip.value);
104
+ }
105
+ this.navigationPath = '';
106
+ }
107
+ };
108
+ }
109
+ render() {
110
+ if (!this.limetype || !this.limetypes) {
111
+ return null;
112
+ }
113
+ const chips = this.getChipsForPath(this.navigationPath || this.value || '');
114
+ return (index.h("limel-menu", { items: this.menuItems, open: this.isOpen, emptyResultMessage: "No available properties", surfaceWidth: "inherit-from-trigger", openDirection: "bottom-end", onSelect: this.handleSelect, onNavigateMenu: this.handleNavigateMenu, onCancel: this.handleCancel }, index.h("div", { slot: "trigger" }, index.h("div", { onClick: this.handleChipSetWrapperClick }, index.h("limel-chip-set", { type: "input", label: this.label, value: chips, required: this.required, helperText: this.helperText, delimiter: "\u203A", maxItems: 1, onChange: this.handleChipSetChange, onFocus: this.handleChipSetFocus })))));
115
+ }
116
+ loadMenuItems() {
117
+ // Get the limetype we're currently navigating in
118
+ const currentLimetype = this.getCurrentLimetype();
119
+ if (!currentLimetype) {
120
+ this.menuItems = [];
121
+ return;
122
+ }
123
+ this.menuItems = this.createMenuItems(currentLimetype, '');
124
+ }
125
+ getCurrentLimetype() {
126
+ if (!this.navigationPath) {
127
+ return this.limetypes[this.limetype];
128
+ }
129
+ // Get the limetype at the current navigation path
130
+ const property = propertyResolution.getPropertyFromPath(this.limetypes, this.limetype, this.navigationPath);
131
+ if (property === null || property === void 0 ? void 0 : property.relation) {
132
+ return property.relation.getLimetype();
133
+ }
134
+ return this.limetypes[this.limetype];
135
+ }
136
+ createMenuItems(limetype, pathPrefix) {
137
+ const results = [];
138
+ if (!limetype) {
139
+ return results;
140
+ }
141
+ const normalizedProperties = propertyResolution.getNormalizedProperties(limetype);
142
+ for (const [propName, property] of Object.entries(normalizedProperties)) {
143
+ // Skip hasMany and hasAndBelongsToMany relations
144
+ if (property.type === 'hasmany' ||
145
+ property.type === 'hasandbelongstomany') {
146
+ continue;
147
+ }
148
+ const fullPath = pathPrefix
149
+ ? `${pathPrefix}.${propName}`
150
+ : propName;
151
+ const isRelation = !!property.relation;
152
+ let items;
153
+ if (isRelation && property.relation) {
154
+ // Create submenu for relation (only belongsto at this point)
155
+ const relatedLimetype = property.relation.getLimetype();
156
+ if (relatedLimetype) {
157
+ items = async () => this.createMenuItems(relatedLimetype, fullPath);
158
+ }
159
+ }
160
+ results.push({
161
+ text: property.localname || propName,
162
+ secondaryText: this.getSecondaryText(property),
163
+ icon: this.getIconForProperty(property),
164
+ value: fullPath,
165
+ items: items,
166
+ });
167
+ }
168
+ if (results.length === 0) {
169
+ return [
170
+ {
171
+ text: 'No available properties',
172
+ value: '',
173
+ disabled: true,
174
+ },
175
+ ];
176
+ }
177
+ return results;
178
+ }
179
+ getSecondaryText(property) {
180
+ var _a;
181
+ if (property.relation) {
182
+ const relatedLimetype = property.relation.getLimetype();
183
+ return ((_a = relatedLimetype === null || relatedLimetype === void 0 ? void 0 : relatedLimetype.localname) === null || _a === void 0 ? void 0 : _a.singular) || 'Object';
184
+ }
185
+ // Return the property type as the secondary text
186
+ return property.type.charAt(0).toUpperCase() + property.type.slice(1);
187
+ }
188
+ getIconForProperty(property) {
189
+ if (property.relation) {
190
+ return {
191
+ name: 'link',
192
+ color: 'rgb(var(--color-sky-default))',
193
+ };
194
+ }
195
+ // Use generic property icon
196
+ return {
197
+ name: 'decision',
198
+ color: 'rgb(var(--color-gray-default))',
199
+ };
200
+ }
201
+ getChipsForPath(path) {
202
+ if (!path) {
203
+ return [];
204
+ }
205
+ const parts = path.split('.');
206
+ const chips = [];
207
+ let currentLimetype = this.limetypes[this.limetype];
208
+ let currentPath = '';
209
+ for (const part of parts) {
210
+ currentPath = currentPath ? `${currentPath}.${part}` : part;
211
+ // Use getNormalizedProperties to include _id and _timestamp
212
+ const normalizedProperties = propertyResolution.getNormalizedProperties(currentLimetype);
213
+ const property = normalizedProperties[part];
214
+ if (property) {
215
+ chips.push({
216
+ id: currentPath,
217
+ text: property.localname || part,
218
+ icon: this.getIconForProperty(property),
219
+ value: currentPath,
220
+ });
221
+ if (property.relation) {
222
+ currentLimetype = property.relation.getLimetype();
223
+ }
224
+ }
225
+ }
226
+ return chips;
227
+ }
228
+ };
229
+ __decorate([
230
+ index_esm.Te()
231
+ ], PropertySelector.prototype, "limetypes", void 0);
232
+ PropertySelector.style = LimebbPropertySelectorStyle0;
233
+
234
+ exports.limebb_property_selector = PropertySelector;
@@ -0,0 +1,80 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-ff255a0d.js');
6
+
7
+ const responseFormatItemCss = ":host(limebb-response-format-item){display:flex;flex-direction:column;gap:0.5rem;width:100%}.property-controls{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(20rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center;padding-top:0.5rem}.control-buttons limel-icon-button{opacity:0.6;transition:opacity 0.2s ease}.control-buttons limel-icon-button:hover{opacity:1}.control-buttons limel-icon-button.has-value{opacity:1;color:rgb(var(--color-blue-default))}.alias,.description{padding-left:1.5rem;width:calc(100% - 1.5rem);max-width:40rem}@media (max-width: 768px){.property-controls{flex-direction:column;gap:0.5rem}.control-buttons{padding-top:0}.alias,.description{padding-left:0;width:100%}}";
8
+ const LimebbResponseFormatItemStyle0 = responseFormatItemCss;
9
+
10
+ const ResponseFormatItem = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ this.itemChange = index.createEvent(this, "itemChange", 7);
14
+ this.showAliasInput = false;
15
+ this.showDescriptionInput = false;
16
+ this.handlePathChange = (event) => {
17
+ event.stopPropagation();
18
+ this.itemChange.emit(Object.assign(Object.assign({}, this.item), { path: event.detail }));
19
+ };
20
+ this.toggleAliasInput = () => {
21
+ this.showAliasInput = !this.showAliasInput;
22
+ };
23
+ this.toggleDescriptionInput = () => {
24
+ this.showDescriptionInput = !this.showDescriptionInput;
25
+ };
26
+ this.handleAliasChange = (event) => {
27
+ event.stopPropagation();
28
+ const alias = event.detail;
29
+ this.itemChange.emit(Object.assign(Object.assign({}, this.item), { alias: alias || undefined }));
30
+ };
31
+ this.handleDescriptionChange = (event) => {
32
+ event.stopPropagation();
33
+ const description = event.detail;
34
+ this.itemChange.emit(Object.assign(Object.assign({}, this.item), { description: description || undefined }));
35
+ };
36
+ this.handleAliasBlur = () => {
37
+ if (this.item.alias) {
38
+ const trimmed = this.item.alias.trim();
39
+ if (trimmed !== this.item.alias) {
40
+ this.itemChange.emit(Object.assign(Object.assign({}, this.item), { alias: trimmed || undefined }));
41
+ }
42
+ }
43
+ };
44
+ this.handleDescriptionBlur = () => {
45
+ if (this.item.description) {
46
+ const trimmed = this.item.description.trim();
47
+ if (trimmed !== this.item.description) {
48
+ this.itemChange.emit(Object.assign(Object.assign({}, this.item), { description: trimmed || undefined }));
49
+ }
50
+ }
51
+ };
52
+ this.handleRemove = () => {
53
+ this.itemChange.emit(null);
54
+ };
55
+ }
56
+ componentWillLoad() {
57
+ // Initialize visibility based on whether fields have values
58
+ this.showAliasInput = !!this.item.alias;
59
+ this.showDescriptionInput = !!this.item.description;
60
+ }
61
+ componentWillUpdate() {
62
+ // Keep inputs visible if they have values
63
+ if (this.item.alias && !this.showAliasInput) {
64
+ this.showAliasInput = true;
65
+ }
66
+ if (this.item.description && !this.showDescriptionInput) {
67
+ this.showDescriptionInput = true;
68
+ }
69
+ }
70
+ render() {
71
+ return [
72
+ index.h("div", { key: '842362f9a9cfd48420409e53f0a8dc84048e383f', class: "property-controls" }, index.h("div", { key: '9f1b758ca0a6123e9acdff4ee4e1480b1938bb8b', class: "property-path" }, index.h("limebb-property-selector", { key: '3f4ca007b7131c94c57af2883638e19657e0a876', platform: this.platform, context: this.context, limetype: this.limetype, label: "Property", value: this.item.path, required: true, onChange: this.handlePathChange })), index.h("div", { key: 'c0141d13b1af44df29ad6502817330da6fe62283', class: "control-buttons" }, index.h("limel-icon-button", { key: '24aa415a1a1d91a46a251fb947fe071cd8f6e36f', icon: "add_tag", label: "Add alias", class: this.item.alias ? 'has-value' : '', onClick: this.toggleAliasInput }), index.h("limel-icon-button", { key: '4fa60916e5e179361c9fa6ab49fa06ce4c88ca66', icon: "comments", label: "Add description", class: this.item.description ? 'has-value' : '', onClick: this.toggleDescriptionInput }), index.h("limel-icon-button", { key: '03db71a330ccc905e37ffb9d8375bb6b774812b9', icon: "trash", label: "Remove property", onClick: this.handleRemove }))),
73
+ this.showAliasInput && (index.h("div", { key: 'bebaa718fd408dfdcce2f4cfe479e1b56325df86', class: "alias" }, index.h("limel-input-field", { key: '2a7c1e65558ef4f4892f854da04d7e083847defd', label: "Alias", value: this.item.alias || '', placeholder: "Custom property name...", onChange: this.handleAliasChange, onBlur: this.handleAliasBlur }))),
74
+ this.showDescriptionInput && (index.h("div", { key: 'b32b9b5006a9a48e44f5725f070f9bd376c8b15f', class: "description" }, index.h("limel-input-field", { key: '98f63d70cc77c68cbf535d33210a8d5e0c15cf72', label: "Description", value: this.item.description || '', placeholder: "Describe this property for AI...", onChange: this.handleDescriptionChange, onBlur: this.handleDescriptionBlur }))),
75
+ ];
76
+ }
77
+ };
78
+ ResponseFormatItem.style = LimebbResponseFormatItemStyle0;
79
+
80
+ exports.limebb_response_format_item = ResponseFormatItem;
@@ -5,11 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-ff255a0d.js');
6
6
  const index_esm = require('./index.esm-a894ac76.js');
7
7
  const keycodes = require('./keycodes-88522d7f.js');
8
- const _Uint8Array = require('./_Uint8Array-1e99726d.js');
9
- const _MapCache = require('./_MapCache-2e84a981.js');
8
+ const _Uint8Array = require('./_Uint8Array-95263550.js');
9
+ const _defineProperty = require('./_defineProperty-40a6ad5d.js');
10
+ const _MapCache = require('./_MapCache-8b125fbb.js');
10
11
  const _Map = require('./_Map-60aae0ed.js');
11
12
  const _getTag = require('./_getTag-8809c5c6.js');
13
+ const randomString = require('./random-string-aac0a74b.js');
14
+ const limetype = require('./limetype-1fe0207f.js');
12
15
  const nonNull = require('./non-null-3bf14aa1.js');
16
+ const isSymbol = require('./isSymbol-5b36aeee.js');
13
17
 
14
18
  /** Used to match a single whitespace character. */
15
19
  var reWhitespace = /\s/;
@@ -87,7 +91,7 @@ function toNumber(value) {
87
91
  if (typeof value == 'number') {
88
92
  return value;
89
93
  }
90
- if (_MapCache.isSymbol(value)) {
94
+ if (isSymbol.isSymbol(value)) {
91
95
  return NAN;
92
96
  }
93
97
  if (_Map.isObject(value)) {
@@ -183,8 +187,8 @@ function arrayEach(array, iteratee) {
183
187
  * @param {*} value The value to assign.
184
188
  */
185
189
  function baseAssignValue(object, key, value) {
186
- if (key == '__proto__' && _Uint8Array.defineProperty) {
187
- _Uint8Array.defineProperty(object, key, {
190
+ if (key == '__proto__' && _defineProperty.defineProperty) {
191
+ _defineProperty.defineProperty(object, key, {
188
192
  'configurable': true,
189
193
  'enumerable': true,
190
194
  'value': value,
@@ -1095,71 +1099,6 @@ function getUpdatedItems(items, highlightedItemIndex) {
1095
1099
  });
1096
1100
  }
1097
1101
 
1098
- /* eslint-disable sonarjs/pseudo-random */
1099
- const createRandomString = () => {
1100
- var _a;
1101
- if (!('crypto' in window) ||
1102
- typeof ((_a = window.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) !== 'function') {
1103
- return legacyCreateRandomString();
1104
- }
1105
- return 'a_' + crypto.randomUUID(); // ids must start with letters
1106
- };
1107
- function legacyCreateRandomString() {
1108
- const USE_HEX = 36;
1109
- const SKIP_LEADING_ZERODOT = 2;
1110
- const ASCII_A = 97;
1111
- const NUMBER_OF_LETTERS = 26;
1112
- return (String.fromCodePoint(ASCII_A + Math.floor(Math.random() * NUMBER_OF_LETTERS)) +
1113
- Math.random()
1114
- .toString(USE_HEX)
1115
- .slice(Math.max(0, SKIP_LEADING_ZERODOT)) +
1116
- Math.random().toString(USE_HEX).slice(Math.max(0, SKIP_LEADING_ZERODOT)));
1117
- }
1118
-
1119
- /**
1120
- * Whether the given object has the given label or not.
1121
- *
1122
- * @param object the object to check label for
1123
- * @param label the label to check for
1124
- * @returns true if the object has the label
1125
- */
1126
- function hasLabel(object, label) {
1127
- return object.label === label;
1128
- }
1129
- /**
1130
- * Whether the given property is a hasmany relation or not.
1131
- *
1132
- * @param property the property to check
1133
- * @returns true if the property is a hasmany relation
1134
- */
1135
- function isManyRelation(property) {
1136
- return index_esm.De(property) && !index_esm.Me(property);
1137
- }
1138
- /**
1139
- * Finds a relation property on the given limetype that is related to a
1140
- * limetype with the given label.
1141
- *
1142
- * @param limetype the limetype to search for the relation property
1143
- * @param label the label of the target limetype to match
1144
- * @returns the relation property or undefined
1145
- */
1146
- function getRelationProperty(limetype, label) {
1147
- return Object.values(limetype.properties).find((property) => property &&
1148
- property.relation &&
1149
- hasLabel(property.relation.getLimetype(), label));
1150
- }
1151
- /**
1152
- * Whether the limetype has a hasmany relation of a limetype with the given label
1153
- *
1154
- * @param limetype the limetype
1155
- * @param relatedLabel the label of the related limetype
1156
- * @returns true if the limetype has the hasmany relation
1157
- */
1158
- function hasHasManyRelation(limetype, relatedLabel) {
1159
- const property = getRelationProperty(limetype, relatedLabel);
1160
- return !!property && isManyRelation(property);
1161
- }
1162
-
1163
1102
  /**
1164
1103
  * Get the limetypes that should be available for mentions
1165
1104
  *
@@ -1167,8 +1106,8 @@ function hasHasManyRelation(limetype, relatedLabel) {
1167
1106
  * @returns mention limetypes
1168
1107
  */
1169
1108
  function getMentionLimetypes(limetypes) {
1170
- return Object.values(limetypes).filter((limetype) => {
1171
- return (hasLabel(limetype, 'user') || hasHasManyRelation(limetype, 'user'));
1109
+ return Object.values(limetypes).filter((limetype$1) => {
1110
+ return (limetype.hasLabel(limetype$1, 'user') || limetype.hasHasManyRelation(limetype$1, 'user'));
1172
1111
  });
1173
1112
  }
1174
1113
  const MAX_MENTION_SEARCH_RESULTS = 10;
@@ -1242,17 +1181,17 @@ class MentionsService {
1242
1181
  }
1243
1182
  async loadGroupCounts() {
1244
1183
  const groupCountsLoads = this.searchableLimetypes
1245
- .filter((limetype) => !hasLabel(limetype, 'user') &&
1246
- hasHasManyRelation(limetype, 'user'))
1184
+ .filter((limetype$1) => !limetype.hasLabel(limetype$1, 'user') &&
1185
+ limetype.hasHasManyRelation(limetype$1, 'user'))
1247
1186
  .map((limetype) => this.getGroupCounts(limetype));
1248
1187
  for (const groupCount of await Promise.all(groupCountsLoads)) {
1249
1188
  Object.assign(this.groupCounts, groupCount);
1250
1189
  }
1251
1190
  }
1252
- async getGroupCounts(limetype) {
1191
+ async getGroupCounts(limetype$1) {
1253
1192
  var _a;
1254
- const coworkerProperty = getRelationProperty(limetype, 'user');
1255
- const limetypeName = limetype.name;
1193
+ const coworkerProperty = limetype.getRelationProperty(limetype$1, 'user');
1194
+ const limetypeName = limetype$1.name;
1256
1195
  try {
1257
1196
  const result = await this.queryService.execute({
1258
1197
  limetype: limetypeName,
@@ -1276,7 +1215,7 @@ class MentionsService {
1276
1215
  return { [limetypeName]: groupCount };
1277
1216
  }
1278
1217
  catch (error) {
1279
- console.error(`Error fetching group count for limetype: ${limetype.name}`, error);
1218
+ console.error(`Error fetching group count for limetype: ${limetype$1.name}`, error);
1280
1219
  return { [limetypeName]: {} };
1281
1220
  }
1282
1221
  }
@@ -1304,9 +1243,9 @@ class MentionsService {
1304
1243
  }
1305
1244
  getGroupCountComponent(limeobject) {
1306
1245
  var _a;
1307
- const limetype = limeobject.getLimetype();
1308
- const groupCount = (_a = this.groupCounts[limetype.name]) === null || _a === void 0 ? void 0 : _a[limeobject.id];
1309
- const coworkerProperty = getRelationProperty(limetype, 'user');
1246
+ const limetype$1 = limeobject.getLimetype();
1247
+ const groupCount = (_a = this.groupCounts[limetype$1.name]) === null || _a === void 0 ? void 0 : _a[limeobject.id];
1248
+ const coworkerProperty = limetype.getRelationProperty(limetype$1, 'user');
1310
1249
  if (groupCount === undefined || !coworkerProperty) {
1311
1250
  return;
1312
1251
  }
@@ -1722,7 +1661,7 @@ const LimeBBTextEditor = class {
1722
1661
  this.handleBeforeUnload = () => {
1723
1662
  this.saveDraft();
1724
1663
  };
1725
- this.portalId = createRandomString();
1664
+ this.portalId = randomString.createRandomString();
1726
1665
  this.debouncedSearchFn = debounce(async (searcher, editorPickerQuery) => {
1727
1666
  try {
1728
1667
  const items = await searcher(editorPickerQuery);
@@ -1835,7 +1774,7 @@ const LimeBBTextEditor = class {
1835
1774
  }
1836
1775
  render() {
1837
1776
  return [
1838
- index.h("limel-text-editor", { key: 'f2f48910b31ecf37bc6e41245f3e6e6a70b87695', ref: (el) => (this.textEditor = el), tabindex: this.disabled ? -1 : 0, value: this.value, contentType: this.contentType, customElements: this.registeredCustomElements, "aria-disabled": this.disabled, language: this.language, triggers: this.registeredTriggers, onTriggerStart: this.handleTriggerStart, onTriggerStop: this.handleTriggerStop, onTriggerChange: this.handleTriggerChange, onImagePasted: this.handleImagePasted, onMetadataChange: this.handleMetadataChange, ui: this.ui, allowResize: this.allowResize, required: this.required, disabled: this.disabled, readonly: this.readonly, helperText: this.helperText, placeholder: this.placeholder, label: this.label, invalid: this.invalid }),
1777
+ index.h("limel-text-editor", { key: 'de672970cfd1048cc232eeadd527153421f28f36', ref: (el) => (this.textEditor = el), tabindex: this.disabled ? -1 : 0, value: this.value, contentType: this.contentType, customElements: this.registeredCustomElements, "aria-disabled": this.disabled, language: this.language, triggers: this.registeredTriggers, onTriggerStart: this.handleTriggerStart, onTriggerStop: this.handleTriggerStop, onTriggerChange: this.handleTriggerChange, onImagePasted: this.handleImagePasted, onMetadataChange: this.handleMetadataChange, ui: this.ui, allowResize: this.allowResize, required: this.required, disabled: this.disabled, readonly: this.readonly, helperText: this.helperText, placeholder: this.placeholder, label: this.label, invalid: this.invalid }),
1839
1778
  this.renderPicker(),
1840
1779
  ];
1841
1780
  }
@@ -39,7 +39,7 @@ const TrendIndicator = class {
39
39
  this.numValue = this.parseValue(this.value);
40
40
  }
41
41
  render() {
42
- return (index.h(index.Host, { key: 'e3f051b38577e06c5b31fe18558747e9476ca7bd', class: this.getContainerClassList() }, index.h("limel-notched-outline", { key: '2d7eed12e714dcbdd4d7fa366c7ab5079d0e0c79', id: this.tooltipId, label: this.label, labelId: this.labelId, invalid: this.invalid, required: this.required, hasValue: true, hasFloatingLabel: true, "aria-labelledby": this.labelId, "aria-describedby": this.helperTextId, "aria-controls": this.helperTextId }, index.h("div", { key: '13f6acd297b66716dca8581d99fb129fb1dec035', slot: "content", tabIndex: 0 }, this.renderVisualization())), this.renderHelperLine(), this.renderTooltip()));
42
+ return (index.h(index.Host, { key: 'a0f458a114e5698f40899c44d532643f50bef249', class: this.getContainerClassList() }, index.h("limel-notched-outline", { key: 'fe9a66d44f3155d6594da5e7e16ce9a33907f800', id: this.tooltipId, label: this.label, labelId: this.labelId, invalid: this.invalid, required: this.required, hasValue: true, hasFloatingLabel: true, "aria-labelledby": this.labelId, "aria-describedby": this.helperTextId, "aria-controls": this.helperTextId }, index.h("div", { key: 'daff3b1e6ec7098e7353bca3664179fd9c2594c1', slot: "content", tabIndex: 0 }, this.renderVisualization())), this.renderHelperLine(), this.renderTooltip()));
43
43
  }
44
44
  renderVisualization() {
45
45
  if (this.reducePresence && (this.numValue === 0 || !this.hasValue())) {
@@ -0,0 +1,90 @@
1
+ 'use strict';
2
+
3
+ const index_esm = require('./index.esm-a894ac76.js');
4
+
5
+ /**
6
+ * Get the color for a limetype from its UI configuration
7
+ *
8
+ * @param limetype the limetype
9
+ * @returns the color string (CSS variable or RGB)
10
+ */
11
+ function getColor(limetype) {
12
+ var _a;
13
+ const limetypeWithUI = limetype;
14
+ const color = ((_a = limetypeWithUI === null || limetypeWithUI === void 0 ? void 0 : limetypeWithUI.ui) === null || _a === void 0 ? void 0 : _a.color) || 'rgb(var(--color-gray-default))';
15
+ return getLimeColor(color);
16
+ }
17
+ /**
18
+ * Convert lime color references to CSS variables
19
+ *
20
+ * @param color the color string
21
+ * @returns CSS-ready color string
22
+ */
23
+ function getLimeColor(color) {
24
+ if (color.startsWith('lime-')) {
25
+ return `var(--${color})`;
26
+ }
27
+ return color;
28
+ }
29
+ /**
30
+ * Get the icon configuration for a limetype
31
+ *
32
+ * @param limetype the limetype
33
+ * @returns Icon object with name and color
34
+ */
35
+ function getIcon(limetype) {
36
+ var _a;
37
+ const limetypeWithUI = limetype;
38
+ return {
39
+ name: ((_a = limetypeWithUI === null || limetypeWithUI === void 0 ? void 0 : limetypeWithUI.ui) === null || _a === void 0 ? void 0 : _a.icon) || 'decision',
40
+ color: getColor(limetype),
41
+ };
42
+ }
43
+ /**
44
+ * Whether the given object has the given label or not.
45
+ *
46
+ * @param object the object to check label for
47
+ * @param label the label to check for
48
+ * @returns true if the object has the label
49
+ */
50
+ function hasLabel(object, label) {
51
+ return object.label === label;
52
+ }
53
+ /**
54
+ * Whether the given property is a hasmany relation or not.
55
+ *
56
+ * @param property the property to check
57
+ * @returns true if the property is a hasmany relation
58
+ */
59
+ function isManyRelation(property) {
60
+ return index_esm.De(property) && !index_esm.Me(property);
61
+ }
62
+ /**
63
+ * Finds a relation property on the given limetype that is related to a
64
+ * limetype with the given label.
65
+ *
66
+ * @param limetype the limetype to search for the relation property
67
+ * @param label the label of the target limetype to match
68
+ * @returns the relation property or undefined
69
+ */
70
+ function getRelationProperty(limetype, label) {
71
+ return Object.values(limetype.properties).find((property) => property &&
72
+ property.relation &&
73
+ hasLabel(property.relation.getLimetype(), label));
74
+ }
75
+ /**
76
+ * Whether the limetype has a hasmany relation of a limetype with the given label
77
+ *
78
+ * @param limetype the limetype
79
+ * @param relatedLabel the label of the related limetype
80
+ * @returns true if the limetype has the hasmany relation
81
+ */
82
+ function hasHasManyRelation(limetype, relatedLabel) {
83
+ const property = getRelationProperty(limetype, relatedLabel);
84
+ return !!property && isManyRelation(property);
85
+ }
86
+
87
+ exports.getIcon = getIcon;
88
+ exports.getRelationProperty = getRelationProperty;
89
+ exports.hasHasManyRelation = hasHasManyRelation;
90
+ exports.hasLabel = hasLabel;