@limetech/lime-crm-building-blocks 2.3.1 → 2.4.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 (293) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/{condition-tree-translate-B_qIQz9s.js → condition-tree-translate-BQwKtiNZ.js} +1 -1
  3. package/dist/cjs/{filter-group-logic-Bt5tIbfP.js → filter-group-logic-CeGmYgsu.js} +1 -1
  4. package/dist/cjs/{filter-operators-CzIq9qKC.js → filter-operators-C3T2czC_.js} +1 -1
  5. package/dist/cjs/{index-mDIvByXc.js → index-Du4GyM0Y.js} +13 -8
  6. package/dist/cjs/index.cjs.js +3 -3
  7. package/dist/cjs/{index.esm-D1EzGa8X.js → index.esm-C2zw0QJK.js} +2 -2
  8. package/dist/cjs/lime-crm-building-blocks.cjs.js +3 -3
  9. package/dist/cjs/{lime-query-validation-Df4GZRGm.js → lime-query-validation-CzYkphmi.js} +1 -1
  10. package/dist/cjs/limebb-alert-dialog.cjs.entry.js +1 -1
  11. package/dist/cjs/limebb-browser.cjs.entry.js +2 -2
  12. package/dist/cjs/limebb-chat-icon-list_3.cjs.entry.js +2 -2
  13. package/dist/cjs/limebb-chat-list.cjs.entry.js +2 -2
  14. package/dist/cjs/limebb-color-palette-picker.cjs.entry.js +1 -1
  15. package/dist/cjs/limebb-color-palette-swatches.cjs.entry.js +1 -1
  16. package/dist/cjs/limebb-component-config.cjs.entry.js +3 -3
  17. package/dist/cjs/limebb-component-picker.cjs.entry.js +2 -2
  18. package/dist/cjs/limebb-composer-toolbar.cjs.entry.js +2 -2
  19. package/dist/cjs/limebb-condition-tree-editor.cjs.entry.js +24 -9
  20. package/dist/cjs/limebb-condition-tree.cjs.entry.js +121 -34
  21. package/dist/cjs/limebb-currency-picker.cjs.entry.js +2 -2
  22. package/dist/cjs/limebb-dashboard-widget.cjs.entry.js +1 -1
  23. package/dist/cjs/limebb-data-cells.cjs.entry.js +2 -2
  24. package/dist/cjs/limebb-date-picker.cjs.entry.js +2 -2
  25. package/dist/cjs/limebb-date-range.cjs.entry.js +1 -1
  26. package/dist/cjs/limebb-document-chips.cjs.entry.js +1 -1
  27. package/dist/cjs/limebb-document-item.cjs.entry.js +1 -1
  28. package/dist/cjs/limebb-document-picker.cjs.entry.js +1 -1
  29. package/dist/cjs/limebb-empty-state.cjs.entry.js +1 -1
  30. package/dist/cjs/limebb-feed-item-thumbnail-file-info.cjs.entry.js +1 -1
  31. package/dist/cjs/limebb-feed-timeline-item.cjs.entry.js +2 -2
  32. package/dist/cjs/limebb-feed.cjs.entry.js +2 -2
  33. package/dist/cjs/limebb-filter-chip_6.cjs.entry.js +4 -4
  34. package/dist/cjs/limebb-icon-picker.cjs.entry.js +1 -1
  35. package/dist/cjs/limebb-info-tile-currency-format.cjs.entry.js +1 -1
  36. package/dist/cjs/limebb-info-tile-date-format.cjs.entry.js +1 -1
  37. package/dist/cjs/limebb-info-tile-decimal-format.cjs.entry.js +1 -1
  38. package/dist/cjs/limebb-info-tile-format.cjs.entry.js +1 -1
  39. package/dist/cjs/limebb-info-tile-relative-date-format.cjs.entry.js +1 -1
  40. package/dist/cjs/limebb-info-tile-unit-format.cjs.entry.js +1 -1
  41. package/dist/cjs/limebb-info-tile.cjs.entry.js +3 -3
  42. package/dist/cjs/limebb-inline-image.cjs.entry.js +2 -2
  43. package/dist/cjs/limebb-kanban-group.cjs.entry.js +2 -2
  44. package/dist/cjs/limebb-kanban-item.cjs.entry.js +2 -2
  45. package/dist/cjs/limebb-kanban.cjs.entry.js +1 -1
  46. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +3 -3
  47. package/dist/cjs/limebb-lime-query-filter-builder.cjs.entry.js +3 -3
  48. package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +4 -4
  49. package/dist/cjs/limebb-lime-query-order-by-editor_2.cjs.entry.js +3 -3
  50. package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +1 -1
  51. package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +3 -3
  52. package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +1 -1
  53. package/dist/cjs/limebb-limeobject-file-viewer.cjs.entry.js +2 -2
  54. package/dist/cjs/limebb-live-docs-info.cjs.entry.js +1 -1
  55. package/dist/cjs/limebb-loader.cjs.entry.js +2 -2
  56. package/dist/cjs/limebb-locale-picker.cjs.entry.js +2 -2
  57. package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +1 -1
  58. package/dist/cjs/limebb-mention.cjs.entry.js +2 -2
  59. package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +1 -1
  60. package/dist/cjs/limebb-notification-item.cjs.entry.js +2 -2
  61. package/dist/cjs/limebb-notification-list.cjs.entry.js +2 -2
  62. package/dist/cjs/limebb-object-chip.cjs.entry.js +3 -3
  63. package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
  64. package/dist/cjs/limebb-property-selector.cjs.entry.js +3 -3
  65. package/dist/cjs/limebb-rule-arg-filter-editor.cjs.entry.js +2 -2
  66. package/dist/cjs/limebb-rule-condition-chip.cjs.entry.js +71 -0
  67. package/dist/cjs/limebb-rule-condition-editor-CHWTMOmi.js +285 -0
  68. package/dist/cjs/limebb-rule-condition-editor.cjs.entry.js +9 -0
  69. package/dist/cjs/limebb-rule-editor.cjs.entry.js +217 -573
  70. package/dist/cjs/limebb-rule-gate.cjs.entry.js +3 -3
  71. package/dist/cjs/limebb-text-editor-picker.cjs.entry.js +1 -1
  72. package/dist/cjs/limebb-text-editor.cjs.entry.js +3 -3
  73. package/dist/cjs/limebb-trend-indicator.cjs.entry.js +2 -2
  74. package/dist/cjs/limebb-value-comparison-editor.cjs.entry.js +3 -3
  75. package/dist/cjs/{limetype-BPuuRLtH.js → limetype-BzVDjAKS.js} +1 -1
  76. package/dist/cjs/loader.cjs.js +2 -2
  77. package/dist/cjs/{web-component-template-DRMW9wHN.js → web-component-template-C-AkY5as.js} +1 -1
  78. package/dist/collection/collection-manifest.json +3 -2
  79. package/dist/collection/components/condition-tree/condition-tree-editor/condition-tree-editor.js +46 -5
  80. package/dist/collection/components/condition-tree/condition-tree-nodes.js +13 -6
  81. package/dist/collection/components/condition-tree/condition-tree.js +69 -18
  82. package/dist/collection/components/condition-tree/group-node-view.js +41 -5
  83. package/dist/collection/components/condition-tree/leaf-node-view.js +19 -2
  84. package/dist/collection/components/rule-editor/condition-tree-adapter.js +229 -0
  85. package/dist/collection/components/rule-editor/rule-condition-chip/rule-condition-chip.css +4 -0
  86. package/dist/collection/components/rule-editor/rule-condition-chip/rule-condition-chip.js +322 -0
  87. package/dist/collection/components/rule-editor/rule-condition-editor/rule-condition-editor.css +5 -0
  88. package/dist/collection/components/rule-editor/rule-condition-editor/rule-condition-editor.js +259 -0
  89. package/dist/collection/components/rule-editor/rule-editor.css +1 -73
  90. package/dist/collection/components/rule-editor/rule-editor.js +143 -153
  91. package/dist/collection/components/rule-editor/rule-issues.js +89 -0
  92. package/dist/collection/components/rule-editor/view-helpers.js +19 -41
  93. package/dist/collection/components/rule-gate/rule-gate.css +3 -3
  94. package/dist/components/condition-tree-adapter.js +1 -0
  95. package/dist/components/condition-tree-editor.js +1 -1
  96. package/dist/components/condition-tree.js +1 -0
  97. package/dist/components/limebb-condition-tree.js +1 -1
  98. package/dist/components/limebb-rule-condition-chip.d.ts +11 -0
  99. package/dist/components/limebb-rule-condition-chip.js +1 -0
  100. package/dist/components/limebb-rule-condition-editor.d.ts +11 -0
  101. package/dist/components/limebb-rule-condition-editor.js +1 -0
  102. package/dist/components/limebb-rule-editor.js +1 -1
  103. package/dist/components/limebb-rule-gate.js +1 -1
  104. package/dist/esm/{condition-tree-translate-CBeXbZ_z.js → condition-tree-translate-ZQptbaXF.js} +1 -1
  105. package/dist/esm/{filter-group-logic-CzThKf85.js → filter-group-logic-nqCMmV0e.js} +1 -1
  106. package/dist/esm/{filter-operators-u3T1PKhm.js → filter-operators-QbKK26m2.js} +1 -1
  107. package/dist/esm/{index-COtSgrC5.js → index-BK566_jX.js} +13 -8
  108. package/dist/esm/{index.esm-B9D_MXA6.js → index.esm-C__n3hug.js} +1 -1
  109. package/dist/esm/index.js +3 -3
  110. package/dist/esm/lime-crm-building-blocks.js +4 -4
  111. package/dist/esm/{lime-query-validation-dGoN_93p.js → lime-query-validation-BvB2v-yP.js} +1 -1
  112. package/dist/esm/limebb-alert-dialog.entry.js +1 -1
  113. package/dist/esm/limebb-browser.entry.js +2 -2
  114. package/dist/esm/limebb-chat-icon-list_3.entry.js +2 -2
  115. package/dist/esm/limebb-chat-list.entry.js +2 -2
  116. package/dist/esm/limebb-color-palette-picker.entry.js +1 -1
  117. package/dist/esm/limebb-color-palette-swatches.entry.js +1 -1
  118. package/dist/esm/limebb-component-config.entry.js +3 -3
  119. package/dist/esm/limebb-component-picker.entry.js +2 -2
  120. package/dist/esm/limebb-composer-toolbar.entry.js +2 -2
  121. package/dist/esm/limebb-condition-tree-editor.entry.js +24 -9
  122. package/dist/esm/limebb-condition-tree.entry.js +121 -34
  123. package/dist/esm/limebb-currency-picker.entry.js +2 -2
  124. package/dist/esm/limebb-dashboard-widget.entry.js +1 -1
  125. package/dist/esm/limebb-data-cells.entry.js +2 -2
  126. package/dist/esm/limebb-date-picker.entry.js +2 -2
  127. package/dist/esm/limebb-date-range.entry.js +1 -1
  128. package/dist/esm/limebb-document-chips.entry.js +1 -1
  129. package/dist/esm/limebb-document-item.entry.js +1 -1
  130. package/dist/esm/limebb-document-picker.entry.js +1 -1
  131. package/dist/esm/limebb-empty-state.entry.js +1 -1
  132. package/dist/esm/limebb-feed-item-thumbnail-file-info.entry.js +1 -1
  133. package/dist/esm/limebb-feed-timeline-item.entry.js +2 -2
  134. package/dist/esm/limebb-feed.entry.js +2 -2
  135. package/dist/esm/limebb-filter-chip_6.entry.js +4 -4
  136. package/dist/esm/limebb-icon-picker.entry.js +1 -1
  137. package/dist/esm/limebb-info-tile-currency-format.entry.js +1 -1
  138. package/dist/esm/limebb-info-tile-date-format.entry.js +1 -1
  139. package/dist/esm/limebb-info-tile-decimal-format.entry.js +1 -1
  140. package/dist/esm/limebb-info-tile-format.entry.js +1 -1
  141. package/dist/esm/limebb-info-tile-relative-date-format.entry.js +1 -1
  142. package/dist/esm/limebb-info-tile-unit-format.entry.js +1 -1
  143. package/dist/esm/limebb-info-tile.entry.js +3 -3
  144. package/dist/esm/limebb-inline-image.entry.js +2 -2
  145. package/dist/esm/limebb-kanban-group.entry.js +2 -2
  146. package/dist/esm/limebb-kanban-item.entry.js +2 -2
  147. package/dist/esm/limebb-kanban.entry.js +1 -1
  148. package/dist/esm/limebb-lime-query-builder.entry.js +3 -3
  149. package/dist/esm/limebb-lime-query-filter-builder.entry.js +3 -3
  150. package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +4 -4
  151. package/dist/esm/limebb-lime-query-order-by-editor_2.entry.js +3 -3
  152. package/dist/esm/limebb-lime-query-order-by-item.entry.js +1 -1
  153. package/dist/esm/limebb-lime-query-response-format-builder.entry.js +3 -3
  154. package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +1 -1
  155. package/dist/esm/limebb-limeobject-file-viewer.entry.js +2 -2
  156. package/dist/esm/limebb-live-docs-info.entry.js +1 -1
  157. package/dist/esm/limebb-loader.entry.js +2 -2
  158. package/dist/esm/limebb-locale-picker.entry.js +2 -2
  159. package/dist/esm/limebb-mention-group-counter.entry.js +1 -1
  160. package/dist/esm/limebb-mention.entry.js +2 -2
  161. package/dist/esm/limebb-navigation-button_2.entry.js +1 -1
  162. package/dist/esm/limebb-notification-item.entry.js +2 -2
  163. package/dist/esm/limebb-notification-list.entry.js +2 -2
  164. package/dist/esm/limebb-object-chip.entry.js +3 -3
  165. package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
  166. package/dist/esm/limebb-property-selector.entry.js +3 -3
  167. package/dist/esm/limebb-rule-arg-filter-editor.entry.js +2 -2
  168. package/dist/esm/limebb-rule-condition-chip.entry.js +69 -0
  169. package/dist/esm/limebb-rule-condition-editor-DeY758N-.js +281 -0
  170. package/dist/esm/limebb-rule-condition-editor.entry.js +3 -0
  171. package/dist/esm/limebb-rule-editor.entry.js +217 -573
  172. package/dist/esm/limebb-rule-gate.entry.js +3 -3
  173. package/dist/esm/limebb-text-editor-picker.entry.js +1 -1
  174. package/dist/esm/limebb-text-editor.entry.js +3 -3
  175. package/dist/esm/limebb-trend-indicator.entry.js +2 -2
  176. package/dist/esm/limebb-value-comparison-editor.entry.js +3 -3
  177. package/dist/esm/{limetype-BcELY1NF.js → limetype-Muf9VutX.js} +1 -1
  178. package/dist/esm/loader.js +3 -3
  179. package/dist/esm/{web-component-template-DxbwHsvw.js → web-component-template-D1JpeNy_.js} +1 -1
  180. package/dist/lime-crm-building-blocks/index.esm.js +1 -1
  181. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  182. package/dist/lime-crm-building-blocks/p-0621e884.entry.js +1 -0
  183. package/dist/lime-crm-building-blocks/{p-ab0f8170.entry.js → p-087d5651.entry.js} +1 -1
  184. package/dist/lime-crm-building-blocks/{p-ce2755a0.entry.js → p-1917956c.entry.js} +1 -1
  185. package/dist/lime-crm-building-blocks/{p-07a9c8f2.entry.js → p-1ae4962d.entry.js} +1 -1
  186. package/dist/lime-crm-building-blocks/{p-021e452a.entry.js → p-23d2632b.entry.js} +1 -1
  187. package/dist/lime-crm-building-blocks/{p-ffca266e.entry.js → p-251784bf.entry.js} +1 -1
  188. package/dist/lime-crm-building-blocks/{p-635a45ad.entry.js → p-27240bb0.entry.js} +1 -1
  189. package/dist/lime-crm-building-blocks/p-2adeac66.entry.js +1 -0
  190. package/dist/lime-crm-building-blocks/{p-6a8422d2.entry.js → p-32339f09.entry.js} +1 -1
  191. package/dist/lime-crm-building-blocks/{p-1990e369.entry.js → p-3446290c.entry.js} +1 -1
  192. package/dist/lime-crm-building-blocks/{p-d495cc19.entry.js → p-35d9b3ad.entry.js} +1 -1
  193. package/dist/lime-crm-building-blocks/{p-eed0b2c2.entry.js → p-3865eec4.entry.js} +1 -1
  194. package/dist/lime-crm-building-blocks/{p-dacf9e77.entry.js → p-394b521a.entry.js} +1 -1
  195. package/dist/lime-crm-building-blocks/{p-8c36b847.entry.js → p-39a36450.entry.js} +1 -1
  196. package/dist/lime-crm-building-blocks/{p-97e75dee.entry.js → p-3b672249.entry.js} +1 -1
  197. package/dist/lime-crm-building-blocks/{p-ad5dcefd.entry.js → p-47b56a75.entry.js} +1 -1
  198. package/dist/lime-crm-building-blocks/{p-402a9c97.entry.js → p-4af3ea2c.entry.js} +1 -1
  199. package/dist/lime-crm-building-blocks/{p-0cc47cad.entry.js → p-4bdaf436.entry.js} +1 -1
  200. package/dist/lime-crm-building-blocks/{p-cf66256a.entry.js → p-4f60b7bc.entry.js} +1 -1
  201. package/dist/lime-crm-building-blocks/{p-90f0c96b.entry.js → p-4fd9d615.entry.js} +1 -1
  202. package/dist/lime-crm-building-blocks/{p-28550961.entry.js → p-53b44865.entry.js} +1 -1
  203. package/dist/lime-crm-building-blocks/{p-7ae27308.entry.js → p-550606f6.entry.js} +1 -1
  204. package/dist/lime-crm-building-blocks/p-573f9e95.entry.js +1 -0
  205. package/dist/lime-crm-building-blocks/{p-a5f3913d.entry.js → p-5c541d0c.entry.js} +1 -1
  206. package/dist/lime-crm-building-blocks/{p-ce723c21.entry.js → p-612c6b28.entry.js} +1 -1
  207. package/dist/lime-crm-building-blocks/{p-6f923112.entry.js → p-621ab65a.entry.js} +1 -1
  208. package/dist/lime-crm-building-blocks/{p-5f682c06.entry.js → p-627b0c79.entry.js} +1 -1
  209. package/dist/lime-crm-building-blocks/{p-49d042aa.entry.js → p-6303201b.entry.js} +1 -1
  210. package/dist/lime-crm-building-blocks/{p-8e9fcf3c.entry.js → p-6bd61290.entry.js} +1 -1
  211. package/dist/lime-crm-building-blocks/{p-dcb49a62.entry.js → p-6d2dba20.entry.js} +1 -1
  212. package/dist/lime-crm-building-blocks/{p-0193ed83.entry.js → p-6e2553b4.entry.js} +1 -1
  213. package/dist/lime-crm-building-blocks/{p-Cz5s8qGk.js → p-7DQ7qvMa.js} +1 -1
  214. package/dist/lime-crm-building-blocks/p-7c3d3e06.entry.js +1 -0
  215. package/dist/lime-crm-building-blocks/{p-dd02821e.entry.js → p-7d53756b.entry.js} +1 -1
  216. package/dist/lime-crm-building-blocks/{p-79d743bb.entry.js → p-895c8966.entry.js} +1 -1
  217. package/dist/lime-crm-building-blocks/{p-da35bcc7.entry.js → p-8c0455e4.entry.js} +1 -1
  218. package/dist/lime-crm-building-blocks/{p-a201df35.entry.js → p-8f80d024.entry.js} +1 -1
  219. package/dist/lime-crm-building-blocks/{p-32a81271.entry.js → p-949ed056.entry.js} +1 -1
  220. package/dist/lime-crm-building-blocks/{p-cf03a756.entry.js → p-985ae787.entry.js} +1 -1
  221. package/dist/lime-crm-building-blocks/p-9959019d.entry.js +1 -0
  222. package/dist/lime-crm-building-blocks/{p-DLec4QaM.js → p-B7whyaAL.js} +1 -1
  223. package/dist/lime-crm-building-blocks/{p-COtSgrC5.js → p-BK566_jX.js} +1 -1
  224. package/dist/lime-crm-building-blocks/p-ClYOFrOo.js +1 -0
  225. package/dist/lime-crm-building-blocks/{p-DVypQWZ4.js → p-Cve-3L4y.js} +1 -1
  226. package/dist/lime-crm-building-blocks/p-DOULPRTn.js +1 -0
  227. package/dist/lime-crm-building-blocks/{p-Cj_3f9vm.js → p-DhGRAeCH.js} +1 -1
  228. package/dist/lime-crm-building-blocks/p-DjoMDjMo.js +1 -0
  229. package/dist/lime-crm-building-blocks/p-DuWEcQ7n.js +1 -0
  230. package/dist/lime-crm-building-blocks/{p-dfaef740.entry.js → p-a1052482.entry.js} +1 -1
  231. package/dist/lime-crm-building-blocks/{p-3babfbe0.entry.js → p-a14bed52.entry.js} +1 -1
  232. package/dist/lime-crm-building-blocks/{p-cc53a8ca.entry.js → p-a2e291b4.entry.js} +1 -1
  233. package/dist/lime-crm-building-blocks/{p-8a17a7ea.entry.js → p-a2ebd5a4.entry.js} +1 -1
  234. package/dist/lime-crm-building-blocks/{p-0cbe2180.entry.js → p-a4556649.entry.js} +1 -1
  235. package/dist/lime-crm-building-blocks/{p-f5c1ed0c.entry.js → p-a598f92f.entry.js} +1 -1
  236. package/dist/lime-crm-building-blocks/{p-b44b9dbc.entry.js → p-a938384f.entry.js} +1 -1
  237. package/dist/lime-crm-building-blocks/{p-f3539042.entry.js → p-ab0210b2.entry.js} +1 -1
  238. package/dist/lime-crm-building-blocks/{p-c0d49532.entry.js → p-b272730c.entry.js} +1 -1
  239. package/dist/lime-crm-building-blocks/{p-0370200d.entry.js → p-b4571d32.entry.js} +1 -1
  240. package/dist/lime-crm-building-blocks/{p-551a36f6.entry.js → p-b72c748b.entry.js} +1 -1
  241. package/dist/lime-crm-building-blocks/{p-0ed9a7cc.entry.js → p-bac9d3a9.entry.js} +1 -1
  242. package/dist/lime-crm-building-blocks/p-bd6c12bc.entry.js +1 -0
  243. package/dist/lime-crm-building-blocks/{p-81783bd4.entry.js → p-bf693702.entry.js} +1 -1
  244. package/dist/lime-crm-building-blocks/{p-e6cc320a.entry.js → p-c58067ec.entry.js} +1 -1
  245. package/dist/lime-crm-building-blocks/{p-08797129.entry.js → p-c7bfa2e4.entry.js} +1 -1
  246. package/dist/lime-crm-building-blocks/{p-a953d48e.entry.js → p-d4635a39.entry.js} +1 -1
  247. package/dist/lime-crm-building-blocks/{p-d3c58bc1.entry.js → p-d6099dc7.entry.js} +1 -1
  248. package/dist/lime-crm-building-blocks/{p-bf05d9de.entry.js → p-d6c7cf0f.entry.js} +1 -1
  249. package/dist/lime-crm-building-blocks/{p-1ebe45b8.entry.js → p-da79c5fc.entry.js} +1 -1
  250. package/dist/lime-crm-building-blocks/p-e18a2cef.entry.js +1 -0
  251. package/dist/lime-crm-building-blocks/{p-f9991c35.entry.js → p-e19f4b3b.entry.js} +1 -1
  252. package/dist/lime-crm-building-blocks/{p-46aec244.entry.js → p-eb95767a.entry.js} +1 -1
  253. package/dist/lime-crm-building-blocks/{p-ddc4ede8.entry.js → p-ec9b5e30.entry.js} +1 -1
  254. package/dist/lime-crm-building-blocks/{p-95ba7a84.entry.js → p-f49250f3.entry.js} +1 -1
  255. package/dist/types/components/condition-tree/condition-tree-editor/condition-tree-editor.d.ts +20 -3
  256. package/dist/types/components/condition-tree/condition-tree-nodes.d.ts +11 -4
  257. package/dist/types/components/condition-tree/condition-tree-view-context.d.ts +3 -2
  258. package/dist/types/components/condition-tree/condition-tree.d.ts +41 -8
  259. package/dist/types/components/condition-tree/condition-tree.types.d.ts +21 -2
  260. package/dist/types/components/rule-editor/condition-tree-adapter.d.ts +67 -0
  261. package/dist/types/components/rule-editor/rule-condition-chip/rule-condition-chip.d.ts +82 -0
  262. package/dist/types/components/rule-editor/rule-condition-editor/rule-condition-editor.d.ts +61 -0
  263. package/dist/types/components/rule-editor/rule-editor.d.ts +105 -47
  264. package/dist/types/components/rule-editor/rule-issues.d.ts +12 -0
  265. package/dist/types/components/rule-editor/view-helpers.d.ts +16 -35
  266. package/dist/types/components.d.ts +304 -79
  267. package/dist/types/stencil-public-runtime.d.ts +61 -55
  268. package/package.json +4 -4
  269. package/dist/cjs/limebb-rule-chip-popover.cjs.entry.js +0 -82
  270. package/dist/collection/components/rule-editor/chip-picker-view.js +0 -148
  271. package/dist/collection/components/rule-editor/group-node-view.js +0 -79
  272. package/dist/collection/components/rule-editor/rule-chip-popover/rule-chip-popover.css +0 -36
  273. package/dist/collection/components/rule-editor/rule-chip-popover/rule-chip-popover.js +0 -344
  274. package/dist/collection/components/rule-editor/rule-editor-views.js +0 -43
  275. package/dist/collection/components/rule-editor/rule-operations.js +0 -145
  276. package/dist/components/limebb-rule-chip-popover.d.ts +0 -11
  277. package/dist/components/limebb-rule-chip-popover.js +0 -1
  278. package/dist/components/rule-chip-popover.js +0 -1
  279. package/dist/esm/limebb-rule-chip-popover.entry.js +0 -80
  280. package/dist/lime-crm-building-blocks/p-1578c8f0.entry.js +0 -1
  281. package/dist/lime-crm-building-blocks/p-229d018c.entry.js +0 -1
  282. package/dist/lime-crm-building-blocks/p-6331f9c5.entry.js +0 -1
  283. package/dist/lime-crm-building-blocks/p-705c53c0.entry.js +0 -1
  284. package/dist/lime-crm-building-blocks/p-84ad9159.entry.js +0 -1
  285. package/dist/lime-crm-building-blocks/p-BxCq236x.js +0 -1
  286. package/dist/lime-crm-building-blocks/p-Css8537O.js +0 -1
  287. package/dist/lime-crm-building-blocks/p-a58c9e1e.entry.js +0 -1
  288. package/dist/lime-crm-building-blocks/p-hsyotUav.js +0 -1
  289. package/dist/types/components/rule-editor/chip-picker-view.d.ts +0 -35
  290. package/dist/types/components/rule-editor/group-node-view.d.ts +0 -11
  291. package/dist/types/components/rule-editor/rule-chip-popover/rule-chip-popover.d.ts +0 -43
  292. package/dist/types/components/rule-editor/rule-editor-views.d.ts +0 -58
  293. package/dist/types/components/rule-editor/rule-operations.d.ts +0 -70
@@ -173,20 +173,27 @@ export class ConditionTreeWalker {
173
173
  return this.replaceAt(root, path, this.adapter.group(combinator, group.children));
174
174
  }
175
175
  /**
176
- * The tree with the condition at `path` negated, or not.
176
+ * The condition at `path`, negated or not — the condition itself, not a
177
+ * tree holding it.
177
178
  *
178
- * An adapter with no way to rebuild a negated condition leaves the tree
179
- * alone: it has already told the tree not to offer the control.
179
+ * Handed back on its own because negating replaces the condition, and
180
+ * whatever is watching the one being replaced has to be told which object
181
+ * takes its place before the new tree goes out. Putting it into the tree is
182
+ * `replaceAt`, one step later.
183
+ *
184
+ * `undefined` when there is nothing at `path`, or when the adapter has no
185
+ * way to rebuild a negated condition — it has already told the tree not to
186
+ * offer the control.
180
187
  * @param root
181
188
  * @param path
182
189
  * @param negated
183
190
  */
184
- negateAt(root, path, negated) {
191
+ negated(root, path, negated) {
185
192
  const target = this.nodeAt(root, path);
186
193
  if (target === undefined || !this.adapter.negate) {
187
- return root;
194
+ return undefined;
188
195
  }
189
- return this.replaceAt(root, path, this.adapter.negate(target, negated));
196
+ return this.adapter.negate(target, negated);
190
197
  }
191
198
  /**
192
199
  * A group holding `children`, or nothing at all when there are none left: a
@@ -123,11 +123,12 @@ export class ConditionTree {
123
123
  negatable: !!this.adapter.negate,
124
124
  openNode: this.openState.openNode,
125
125
  addOptions: this.addOptions,
126
+ addSearcher: this.addSearcher,
126
127
  onAddLeaf: (path, item) => this.addLeaf(path, item),
127
- onAddGroup: (path) => this.addGroup(path),
128
+ onAddGroup: (path, item) => this.addGroup(path, item),
128
129
  onDelete: (path) => this.applyEdit((root) => this.walker.replaceAt(root, path, undefined)),
129
130
  onCombinator: (path, combinator) => this.applyEdit((root) => this.walker.rejoinAt(root, path, combinator)),
130
- onNegate: (path, negated) => this.applyEdit((root) => this.walker.negateAt(root, path, negated)),
131
+ onNegate: (path, negated) => this.negate(path, negated),
131
132
  onConditionChange: (path, next) => {
132
133
  this.openState = this.openState.expect(next);
133
134
  this.applyEdit((root) => this.walker.replaceAt(root, path, next));
@@ -137,6 +138,25 @@ export class ConditionTree {
137
138
  },
138
139
  };
139
140
  }
141
+ /**
142
+ * Negate the condition at `path`, or stop negating it.
143
+ *
144
+ * Negating rebuilds the condition, so the one an open editor is bound to
145
+ * is about to be a different object. Saying which object that is, before
146
+ * the edit goes out, is what keeps the editor from shutting under the very
147
+ * switch the user just reached for — the same courtesy an editor's own
148
+ * change already gets.
149
+ * @param path
150
+ * @param negated
151
+ */
152
+ negate(path, negated) {
153
+ const next = this.walker.negated(this.value, path, negated);
154
+ if (next === undefined) {
155
+ return;
156
+ }
157
+ this.openState = this.openState.expect(next);
158
+ this.applyEdit((root) => this.walker.replaceAt(root, path, next));
159
+ }
140
160
  addLeaf(path, item) {
141
161
  this.grow(path, this.adapter.createLeaf(item));
142
162
  }
@@ -146,24 +166,31 @@ export class ConditionTree {
146
166
  * not already say.
147
167
  * @param path
148
168
  */
149
- addGroup(path) {
150
- var _a, _b;
151
- const combinator = (_b = (_a = this.walker.groupAt(this.value, path)) === null || _a === void 0 ? void 0 : _a.combinator) !== null && _b !== void 0 ? _b : this.rootCombinator();
152
- this.grow(path, this.adapter.group(oppositeCombinator(combinator), this.newGroupChildren()));
153
- }
154
169
  /**
155
- * What a new group starts with: one blank condition, so that a group is
156
- * never handed over saying nothing — the same rule by which a group emptied
157
- * of its last condition is dropped rather than kept. A consumer offering a
158
- * menu of kinds is the exception, since the tree cannot know which kind to
159
- * make.
170
+ * Add a group, holding the one condition it was asked for.
171
+ *
172
+ * A group is never handed over with nothing in it, which is the same rule
173
+ * by which a group emptied of its last condition is dropped rather than
174
+ * kept — and here it is not tidiness but arithmetic. An empty group is not
175
+ * an undecided one: `all` of nothing is true and `any` of nothing is
176
+ * false, so a group left unfilled answers for itself. Since a new group
177
+ * joins the other way round from the one holding it, that answer is always
178
+ * the one that settles its parent, and every real condition beside it
179
+ * stops counting.
180
+ *
181
+ * So the consumer that names its kinds is asked which one first — the same
182
+ * question the add-condition button asks, put before the group is made
183
+ * rather than after. One that names none has only one kind to make, and
184
+ * the tree makes it.
185
+ * @param path
186
+ * @param item
160
187
  */
161
- newGroupChildren() {
162
- var _a;
163
- if ((_a = this.addOptions) === null || _a === void 0 ? void 0 : _a.length) {
164
- return [];
165
- }
166
- return [this.adapter.createLeaf()];
188
+ addGroup(path, item) {
189
+ var _a, _b;
190
+ const combinator = (_b = (_a = this.walker.groupAt(this.value, path)) === null || _a === void 0 ? void 0 : _a.combinator) !== null && _b !== void 0 ? _b : this.rootCombinator();
191
+ this.grow(path, this.adapter.group(oppositeCombinator(combinator), [
192
+ this.adapter.createLeaf(item),
193
+ ]));
167
194
  }
168
195
  /**
169
196
  * Add a condition, or a group to put conditions in.
@@ -384,6 +411,30 @@ export class ConditionTree {
384
411
  "getter": false,
385
412
  "setter": false
386
413
  },
414
+ "addSearcher": {
415
+ "type": "unknown",
416
+ "mutable": false,
417
+ "complexType": {
418
+ "original": "MenuSearcher",
419
+ "resolved": "((query: string) => Promise<(ListSeparator | MenuItem<any>)[]>) | undefined",
420
+ "references": {
421
+ "MenuSearcher": {
422
+ "location": "import",
423
+ "path": "@limetech/lime-elements",
424
+ "id": "node_modules::MenuSearcher",
425
+ "referenceLocation": "MenuSearcher"
426
+ }
427
+ }
428
+ },
429
+ "required": false,
430
+ "optional": true,
431
+ "docs": {
432
+ "tags": [],
433
+ "text": "How to narrow `addOptions` as the user types, which is what puts a search\nfield at the top of the add menu.\n\nWorth setting as soon as the kinds on offer stop fitting on a screen \u2014\nand a consumer whose kinds are contributed by add-ons cannot know that\nthey still do. `addOptions` is still what the menu opens on, so an\nunsearched menu reads exactly as it did before."
434
+ },
435
+ "getter": false,
436
+ "setter": false
437
+ },
387
438
  "readonly": {
388
439
  "type": "boolean",
389
440
  "mutable": false,
@@ -119,23 +119,55 @@ function renderDeleteGroup(path, ctx, placeholder) {
119
119
  return (h("limel-icon-button", { class: "delete-group", icon: "trash", label: ctx.translate('webclient.delete-group', 'Delete this group'), disabled: ctx.disabled || !!placeholder, onClick: handleDelete(path, ctx) }));
120
120
  }
121
121
  function renderAddCondition(path, marker, ctx) {
122
- var _a;
123
122
  if (ctx.readonly) {
124
123
  return null;
125
124
  }
126
- const offersChoice = !!((_a = ctx.addOptions) === null || _a === void 0 ? void 0 : _a.length);
127
- const chip = (h("limel-chip", { slot: offersChoice ? 'trigger' : undefined, class: "add-condition", text: ctx.translate('webclient.condition', 'Condition'), disabled: ctx.disabled, icon: addIcon(ctx), onClick: offersChoice ? undefined : handleAddLeaf(path, ctx) }));
125
+ const chip = (h("limel-chip", { slot: offersChoice(ctx) ? 'trigger' : undefined, class: "add-condition", text: ctx.translate('webclient.condition', 'Condition'), disabled: ctx.disabled || hasNoKinds(ctx), icon: addIcon(ctx), onClick: offersChoice(ctx) ? undefined : handleAddLeaf(path, ctx) }));
128
126
  // A row of its own rather than a bare chip, so that the join between it
129
127
  // and the condition before it is drawn by the same rule that joins any two
130
128
  // rows: the button is where the next condition goes, and it reads as part
131
129
  // of the sequence — "Won or 100000 or + Condition".
132
- return (h("li", { class: "row", "data-marker": marker, key: `${pathKey(path)}.add` }, offersChoice ? (h("limel-menu", { class: "add-condition-menu", items: ctx.addOptions, openDirection: "bottom-start", onSelect: handleAddLeafPick(path, ctx) }, chip)) : (chip)));
130
+ return (h("li", { class: "row", "data-marker": marker, key: `${pathKey(path)}.add` }, withKindMenu(chip, 'add-condition-menu', handleAddLeafPick(path, ctx), ctx)));
133
131
  }
134
132
  function renderAddGroup(path, ctx) {
135
133
  if (ctx.readonly) {
136
134
  return null;
137
135
  }
138
- return (h("limel-chip", { class: "add-group", size: "small", text: ctx.translate('webclient.group', 'Group'), disabled: ctx.disabled, icon: addIcon(ctx, 'var(--group-rail-color)'), onClick: handleAddGroup(path, ctx) }));
136
+ const chip = (h("limel-chip", { slot: offersChoice(ctx) ? 'trigger' : undefined, class: "add-group", size: "small", text: ctx.translate('webclient.group', 'Group'), disabled: ctx.disabled || hasNoKinds(ctx), icon: addIcon(ctx, 'var(--group-rail-color)'), onClick: offersChoice(ctx) ? undefined : handleAddGroup(path, ctx) }));
137
+ return withKindMenu(chip, 'add-group-menu', handleAddGroupPick(path, ctx), ctx);
138
+ }
139
+ /**
140
+ * Whether the consumer picks what a new condition is rather than the tree.
141
+ * @param ctx
142
+ */
143
+ function offersChoice(ctx) {
144
+ return !!ctx.addOptions;
145
+ }
146
+ /**
147
+ * Whether the consumer offers a choice but has nothing to choose from, which
148
+ * is a tree that cannot be added to at all.
149
+ * @param ctx
150
+ */
151
+ function hasNoKinds(ctx) {
152
+ var _a;
153
+ return ((_a = ctx.addOptions) === null || _a === void 0 ? void 0 : _a.length) === 0;
154
+ }
155
+ /**
156
+ * The trigger, behind the menu of kinds when there is one to put behind it.
157
+ *
158
+ * Both buttons ask the same question — which kind of condition — because both
159
+ * make one: the group button makes a group to put it in first. A consumer that
160
+ * names no kinds is adding the only kind it has, and the button acts directly.
161
+ * @param trigger
162
+ * @param className
163
+ * @param onPick
164
+ * @param ctx
165
+ */
166
+ function withKindMenu(trigger, className, onPick, ctx) {
167
+ if (!offersChoice(ctx)) {
168
+ return trigger;
169
+ }
170
+ return (h("limel-menu", { class: className, items: ctx.addOptions, searcher: ctx.addSearcher, openDirection: "bottom-start", onSelect: onPick }, trigger));
139
171
  }
140
172
  const handleCombinator = (path, ctx) => (event) => {
141
173
  var _a;
@@ -151,3 +183,7 @@ const handleAddLeafPick = (path, ctx) => (event) => {
151
183
  ctx.onAddLeaf(path, event.detail);
152
184
  };
153
185
  const handleAddGroup = (path, ctx) => () => ctx.onAddGroup(path);
186
+ const handleAddGroupPick = (path, ctx) => (event) => {
187
+ event.stopPropagation();
188
+ ctx.onAddGroup(path, event.detail);
189
+ };
@@ -9,7 +9,7 @@ export const LeafView = (props) => {
9
9
  const { node, description, path, ctx } = props;
10
10
  const isOpen = ctx.openNode === node;
11
11
  return [
12
- h("limel-popover", { class: "leaf", key: pathKey(path), open: isOpen, openDirection: "bottom-start", onClose: handleClose(ctx) }, h(ChipView, { node: node, description: description, path: path, ctx: ctx }), h("limebb-condition-tree-editor", { platform: ctx.platform, context: ctx.context, open: isOpen, editor: description.editor, value: node, heading: description.chip.label, negated: ctx.negatable ? description.negated : undefined, readonly: ctx.readonly, disabled: ctx.disabled, onNegateChange: handleNegate(path, ctx), onConditionChange: handleConditionChange(path, ctx) })),
12
+ h("limel-popover", { class: "leaf", key: pathKey(path), open: isOpen, openDirection: "bottom-start", onClose: handleClose(ctx) }, h(ChipView, { node: node, description: description, path: path, ctx: ctx }), h("limebb-condition-tree-editor", { platform: ctx.platform, context: ctx.context, open: isOpen, editor: description.editor, value: node, heading: description.chip.label, icon: description.chip.icon, negated: ctx.negatable ? description.negated : undefined, readonly: ctx.readonly, disabled: ctx.disabled, onNegateChange: handleNegate(path, ctx), onConditionChange: handleConditionChange(path, ctx) })),
13
13
  h(IssuesView, { issues: description.issues }),
14
14
  ];
15
15
  };
@@ -56,10 +56,27 @@ function drivenProps(props) {
56
56
  };
57
57
  }
58
58
  const handleOpen = (node, description, ctx) => () => {
59
- if (description.editor && !ctx.disabled) {
59
+ if (hasSomethingToOpen(description, ctx) && !ctx.disabled) {
60
60
  ctx.onOpen(node);
61
61
  }
62
62
  };
63
+ /**
64
+ * Whether opening this condition would show anything at all.
65
+ *
66
+ * Its editor is the usual answer. The other one is a condition the tree negates
67
+ * on its behalf: the switch that does so is the only thing in its popover, and
68
+ * a condition that cannot be opened is a condition that cannot be negated.
69
+ *
70
+ * A condition with neither is a label, and stays shut.
71
+ * @param description
72
+ * @param ctx
73
+ */
74
+ function hasSomethingToOpen(description, ctx) {
75
+ if (description.editor) {
76
+ return true;
77
+ }
78
+ return ctx.negatable && description.negated !== undefined;
79
+ }
63
80
  const handleClose = (ctx) => (event) => {
64
81
  event.stopPropagation();
65
82
  ctx.onOpen(null);
@@ -0,0 +1,229 @@
1
+ /** What a chip says for a condition with no name to put on it. */
2
+ const UNNAMED = '…';
3
+ /**
4
+ * Which `all`/`any` a combinator is built on, and whether a `not` goes round it.
5
+ * The wrapper is not a node of its own in a condition tree: it folds into the
6
+ * combinator of the group it wraps, and unfolds again on the way back out.
7
+ */
8
+ const SHAPE = {
9
+ all: { type: 'all', negated: false },
10
+ any: { type: 'any', negated: false },
11
+ 'not-all': { type: 'all', negated: true },
12
+ none: { type: 'any', negated: true },
13
+ };
14
+ const NEGATED_COMBINATOR = {
15
+ all: 'not-all',
16
+ any: 'none',
17
+ 'not-all': 'all',
18
+ none: 'any',
19
+ };
20
+ /**
21
+ * How `limebb-condition-tree` reads and rebuilds a {@link Rule}. Everything
22
+ * structural belongs to the tree; everything about what a rule *is* belongs
23
+ * here.
24
+ * @param source
25
+ */
26
+ export function createRuleConditionTreeAdapter(source) {
27
+ return {
28
+ describe: (node, state) => describeRule(node, state, source),
29
+ group: group,
30
+ negate: negate,
31
+ createLeaf: (item) => {
32
+ var _a;
33
+ const leaf = { type: 'ref', id: String((_a = item === null || item === void 0 ? void 0 : item.value) !== null && _a !== void 0 ? _a : '') };
34
+ source.created().add(leaf);
35
+ return leaf;
36
+ },
37
+ };
38
+ }
39
+ /**
40
+ * How the rule joins what is inside it, and what that is — or nothing when it
41
+ * is a single condition rather than a group. A `not` is transparent: it becomes
42
+ * the group's combinator, and chains of them fold down to one.
43
+ * @param rule
44
+ */
45
+ export function groupOf(rule) {
46
+ if (!isNode(rule)) {
47
+ return undefined;
48
+ }
49
+ if (rule.type === 'all' || rule.type === 'any') {
50
+ return Array.isArray(rule.rules)
51
+ ? { combinator: rule.type, rules: rule.rules }
52
+ : undefined;
53
+ }
54
+ if (rule.type !== 'not') {
55
+ return undefined;
56
+ }
57
+ const inner = groupOf(rule.rule);
58
+ return inner
59
+ ? {
60
+ combinator: NEGATED_COMBINATOR[inner.combinator],
61
+ rules: inner.rules,
62
+ }
63
+ : undefined;
64
+ }
65
+ /**
66
+ * The primitive a rule refers to, and whether it is negated — or nothing when
67
+ * the rule refers to none. Wrapping in a `not` is the only negation a rule
68
+ * condition has, having no "is not" vocabulary of its own.
69
+ * @param rule
70
+ */
71
+ export function refOf(rule) {
72
+ if (!isNode(rule)) {
73
+ return undefined;
74
+ }
75
+ if (rule.type === 'ref') {
76
+ return { ref: rule, negated: false };
77
+ }
78
+ if (rule.type === 'not' && isNode(rule.rule) && rule.rule.type === 'ref') {
79
+ return { ref: rule.rule, negated: true };
80
+ }
81
+ return undefined;
82
+ }
83
+ /**
84
+ * Whether there is a rule here at all. A hand-edited rule can hold a `null` or
85
+ * a bare value where a node should be, and reading `type` off one throws, so
86
+ * everything that asks about structure asks this first.
87
+ * @param rule
88
+ */
89
+ function isNode(rule) {
90
+ return typeof rule === 'object' && rule !== null;
91
+ }
92
+ function describeRule(node, state, source) {
93
+ const issues = source.issues().get(node);
94
+ const group = groupOf(node);
95
+ if (group) {
96
+ return {
97
+ kind: 'group',
98
+ combinator: group.combinator,
99
+ // Never copies: the tree tells conditions apart by identity.
100
+ children: group.rules,
101
+ issues: issues,
102
+ };
103
+ }
104
+ const reference = refOf(node);
105
+ if (!reference) {
106
+ return unreadable(node, source, issues);
107
+ }
108
+ return describeRef(reference, state, source, issues);
109
+ }
110
+ /**
111
+ * How a condition reads: its primitive's name, the bare id when nobody
112
+ * registered it, and the placeholder when it has not even got that.
113
+ * @param ref
114
+ * @param source
115
+ */
116
+ function nameOf(ref, source) {
117
+ return source.titles.get(ref.id) || ref.id || UNNAMED;
118
+ }
119
+ function describeRef(reference, state, source, issues) {
120
+ const { ref, negated } = reference;
121
+ const metadata = source.metadata.get(ref.id);
122
+ const fresh = source.created().has(ref);
123
+ const editor = metadata === null || metadata === void 0 ? void 0 : metadata.configComponent;
124
+ return {
125
+ kind: 'leaf',
126
+ chip: {
127
+ label: nameOf(ref, source),
128
+ icon: glyphOf(metadata),
129
+ // Marked before validation has had its say, so that a rule loaded
130
+ // from storage does not read as sound for a render.
131
+ invalid: !metadata || !!(issues === null || issues === void 0 ? void 0 : issues.length),
132
+ component: {
133
+ name: 'limebb-rule-condition-chip',
134
+ props: {
135
+ negated: negated,
136
+ iconColor: colourOf(metadata),
137
+ },
138
+ },
139
+ },
140
+ // Every condition here is opaque, so the tree offers the negation and
141
+ // rebuilds it through `negate`.
142
+ negated: negated,
143
+ issues: issues,
144
+ // Just added and with something to configure: the one thing left to do
145
+ // is put in front of the author. One with nothing to configure is
146
+ // already complete, and stays shut.
147
+ autoOpen: fresh && !!editor,
148
+ editor: editor && {
149
+ name: 'limebb-rule-condition-editor',
150
+ props: {
151
+ configComponent: editor,
152
+ // Never into one they merely re-opened to look at.
153
+ focusOnOpen: fresh && !state.visited,
154
+ },
155
+ },
156
+ };
157
+ }
158
+ /**
159
+ * A rule this adapter cannot read: neither a group nor a reference. Drawn, so
160
+ * the tree is not silently short of a condition, and marked — but with no
161
+ * editor, which is what keeps it shut.
162
+ * @param node
163
+ * @param source
164
+ * @param issues
165
+ */
166
+ function unreadable(node, source, issues) {
167
+ var _a;
168
+ return {
169
+ kind: 'leaf',
170
+ chip: {
171
+ label: (_a = typeNameOf(node)) !== null && _a !== void 0 ? _a : UNNAMED,
172
+ icon: 'question',
173
+ invalid: true,
174
+ component: { name: 'limebb-rule-condition-chip' },
175
+ },
176
+ issues: (issues === null || issues === void 0 ? void 0 : issues.length)
177
+ ? issues
178
+ : [
179
+ source.translate('webclient.rule-editor.unreadable-condition', 'This condition cannot be read, and so cannot be edited here.'),
180
+ ],
181
+ };
182
+ }
183
+ /**
184
+ * What a node says it is, when it says anything at all. Read defensively: the
185
+ * nodes that get here are the ones that are not rules, so a `type` that is
186
+ * missing or is not a word is exactly how one arrives.
187
+ * @param node
188
+ */
189
+ function typeNameOf(node) {
190
+ if (!isNode(node)) {
191
+ return undefined;
192
+ }
193
+ const type = node.type;
194
+ return typeof type === 'string' && type ? type : undefined;
195
+ }
196
+ /**
197
+ * The primitive's glyph, or the one standing for a primitive nobody registered.
198
+ * Its colour travels separately — see {@link colourOf} — because the tree's
199
+ * chip vocabulary has room only for the name.
200
+ * @param metadata
201
+ */
202
+ function glyphOf(metadata) {
203
+ if (!metadata) {
204
+ return 'question';
205
+ }
206
+ if (!metadata.icon) {
207
+ return undefined;
208
+ }
209
+ return typeof metadata.icon === 'string'
210
+ ? metadata.icon
211
+ : metadata.icon.name;
212
+ }
213
+ /**
214
+ * The colour the primitive asked for its glyph, when it asked for one.
215
+ * @param metadata
216
+ */
217
+ function colourOf(metadata) {
218
+ return typeof (metadata === null || metadata === void 0 ? void 0 : metadata.icon) === 'object' ? metadata.icon.color : undefined;
219
+ }
220
+ function group(combinator, children) {
221
+ const inner = { type: SHAPE[combinator].type, rules: [...children] };
222
+ return SHAPE[combinator].negated ? { type: 'not', rule: inner } : inner;
223
+ }
224
+ function negate(node, negated) {
225
+ if (negated) {
226
+ return node.type === 'not' ? node : { type: 'not', rule: node };
227
+ }
228
+ return node.type === 'not' ? node.rule : node;
229
+ }
@@ -0,0 +1,4 @@
1
+ :host {
2
+ display: inline-flex;
3
+ min-width: 0;
4
+ }