@limetech/lime-crm-building-blocks 1.128.0 → 1.130.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 (27) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
  3. package/dist/cjs/limebb-loader.cjs.entry.js +15 -0
  4. package/dist/cjs/limebb-rule-editor.cjs.entry.js +101 -9
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/collection/components/loader/loader.js +2 -0
  7. package/dist/collection/components/rule-editor/chip-picker-view.js +2 -2
  8. package/dist/collection/components/rule-editor/rule-arg-filter-editor/rule-arg-filter-editor-metadata.js +13 -0
  9. package/dist/collection/components/rule-editor/rule-editor.js +102 -10
  10. package/dist/collection/components/rule-editor/view-helpers.js +9 -0
  11. package/dist/components/limebb-loader.js +1 -1
  12. package/dist/components/limebb-rule-editor.js +1 -1
  13. package/dist/esm/lime-crm-building-blocks.js +1 -1
  14. package/dist/esm/limebb-loader.entry.js +15 -0
  15. package/dist/esm/limebb-rule-editor.entry.js +102 -10
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  18. package/dist/lime-crm-building-blocks/p-492b1b0c.entry.js +1 -0
  19. package/dist/lime-crm-building-blocks/p-f1d9e133.entry.js +1 -0
  20. package/dist/types/components/rule-editor/rule-arg-filter-editor/rule-arg-filter-editor-metadata.d.ts +10 -0
  21. package/dist/types/components/rule-editor/rule-editor-views.d.ts +2 -1
  22. package/dist/types/components/rule-editor/rule-editor.d.ts +54 -3
  23. package/dist/types/components/rule-editor/view-helpers.d.ts +8 -1
  24. package/dist/types/components.d.ts +30 -2
  25. package/package.json +2 -2
  26. package/dist/lime-crm-building-blocks/p-bd6e12e6.entry.js +0 -1
  27. package/dist/lime-crm-building-blocks/p-ce3e52ac.entry.js +0 -1
@@ -2,7 +2,7 @@ import { h, } from "@stencil/core";
2
2
  import { PlatformServiceName, } from "@limetech/lime-web-components";
3
3
  import { deleteNode, replaceNode, updateArgs, } from "./rule-operations";
4
4
  import { extractGroup, RuleNodeView, } from "./rule-editor-views";
5
- import { createPrimitiveOptions } from "./view-helpers";
5
+ import { createPrimitiveOptions, primitiveReadsCovered } from "./view-helpers";
6
6
  /**
7
7
  * Tree editor for {@link Rule}.
8
8
  *
@@ -19,6 +19,14 @@ import { createPrimitiveOptions } from "./view-helpers";
19
19
  * forwards it to `RuleRegistry.validate` so `missing-slot` diagnostics
20
20
  * surface inline on the offending nodes.
21
21
  *
22
+ * The palette is surface-aware. When the editor is mounted in the DOM,
23
+ * it walks its host's ancestors through the context registry and unions
24
+ * the result with `availableContexts` to determine which context slots
25
+ * are reachable where the rule runs. Primitives whose `reads` slots
26
+ * aren't all reachable are hidden from the add palette, so an author
27
+ * can't pick a primitive that would silently fail closed at evaluation
28
+ * time.
29
+ *
22
30
  * @exampleComponent limebb-example-rule-editor
23
31
  *
24
32
  * @alpha
@@ -29,8 +37,11 @@ export class RuleEditor {
29
37
  this.issues = [];
30
38
  this.openChipPath = null;
31
39
  this.metadataById = new Map();
32
- this.primitiveOptions = [];
40
+ this.allPrimitiveOptions = [];
41
+ this.availablePrimitiveOptions = [];
42
+ this.reachableSlots = new Set();
33
43
  this.normalizedCache = null;
44
+ this.hasLoaded = false;
34
45
  this.handleDelete = (path) => {
35
46
  this.openChipPath = null;
36
47
  this.emitIfChanged(deleteNode(this.normalizedValue, path));
@@ -49,10 +60,30 @@ export class RuleEditor {
49
60
  };
50
61
  }
51
62
  componentWillLoad() {
63
+ this.rebuildFromRegistries();
64
+ }
65
+ rebuildFromRegistries() {
66
+ this.computeReachableSlots();
52
67
  this.indexMetadata();
68
+ this.rebuildAvailableOptions();
69
+ this.runValidation();
70
+ }
71
+ /**
72
+ * Re-walk reachable slots when the editor is re-attached to the DOM,
73
+ * e.g. moved between surfaces. The reachable set depends on the host's
74
+ * ancestors, so a move can change which primitives the palette offers.
75
+ * Skipped on the first connect — `componentWillLoad` covers that.
76
+ */
77
+ connectedCallback() {
78
+ if (!this.hasLoaded) {
79
+ return;
80
+ }
81
+ this.computeReachableSlots();
82
+ this.rebuildAvailableOptions();
53
83
  this.runValidation();
54
84
  }
55
85
  componentDidLoad() {
86
+ this.hasLoaded = true;
56
87
  this.emitNormalization();
57
88
  }
58
89
  onValueChange() {
@@ -62,14 +93,14 @@ export class RuleEditor {
62
93
  this.runValidation();
63
94
  }
64
95
  onAvailableContextsChange() {
65
- this.runValidation();
96
+ this.rebuildFromRegistries();
66
97
  }
67
98
  render() {
68
99
  const containerClasses = {
69
100
  'rule-editor': true,
70
101
  'rule-editor--disabled': this.disabled,
71
102
  };
72
- return (h("div", { key: '8e0da39f6544c86de0143e91a6c48c9f2654315f', class: containerClasses }, this.renderLabel(), h(RuleNodeView, { key: 'cd093f5dc5a9b747036f581e6230f1205cf834e6', node: this.normalizedValue, path: [], ctx: this.createRenderContext() }), this.renderHelperText()));
103
+ return (h("div", { key: 'dfdc801d8c0d48b8276b9d4cff8a4a2c0754c52f', class: containerClasses }, this.renderLabel(), h(RuleNodeView, { key: '250d53eba7681872f181003c709303238971be2a', node: this.normalizedValue, path: [], ctx: this.createRenderContext() }), this.renderHelperText()));
73
104
  }
74
105
  renderLabel() {
75
106
  if (!this.label) {
@@ -87,13 +118,14 @@ export class RuleEditor {
87
118
  return {
88
119
  issues: this.issues,
89
120
  metadataById: this.metadataById,
90
- primitiveOptions: this.primitiveOptions,
121
+ allPrimitiveOptions: this.allPrimitiveOptions,
122
+ availablePrimitiveOptions: this.availablePrimitiveOptions,
91
123
  isMutable: !this.readonly && !this.disabled,
92
124
  readonly: this.readonly,
93
125
  disabled: this.disabled,
94
126
  platform: this.platform,
95
127
  context: this.context,
96
- translator: this.platform.get(PlatformServiceName.Translate),
128
+ translator: this.translator,
97
129
  openChipPath: this.openChipPath,
98
130
  onDelete: this.handleDelete,
99
131
  onUpdateArgs: this.handleUpdateArgs,
@@ -106,14 +138,66 @@ export class RuleEditor {
106
138
  var _a, _b, _c;
107
139
  const metadata = (_c = (_b = (_a = this.ruleRegistry).listMetadata) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : [];
108
140
  this.metadataById = new Map(metadata.map((item) => [item.id, item]));
109
- this.primitiveOptions = createPrimitiveOptions(this.metadataById, this.platform.get(PlatformServiceName.Translate));
141
+ this.allPrimitiveOptions = createPrimitiveOptions(this.metadataById, this.translator);
142
+ }
143
+ /**
144
+ * Recompute the cached add-palette options. The inputs — indexed
145
+ * metadata, the reachable slot set, and the translator — only change
146
+ * in `rebuildFromRegistries` and `connectedCallback`, so caching here
147
+ * keeps `render` from rebuilding and sorting the list every pass.
148
+ */
149
+ rebuildAvailableOptions() {
150
+ this.availablePrimitiveOptions = createPrimitiveOptions(this.availablePrimitiveMetadata(), this.translator);
151
+ }
152
+ /**
153
+ * The subset of registered metadata offered for adding in the
154
+ * palette: primitives whose `reads` aren't fully covered by the
155
+ * reachable slots are dropped. Filtering only the palette — not the
156
+ * full `allPrimitiveOptions` — keeps already-placed chips resolving
157
+ * to their proper title even when their read slot isn't reachable.
158
+ */
159
+ availablePrimitiveMetadata() {
160
+ const filtered = new Map();
161
+ for (const [id, meta] of this.metadataById) {
162
+ if (primitiveReadsCovered(meta, this.reachableSlots)) {
163
+ filtered.set(id, meta);
164
+ }
165
+ }
166
+ return filtered;
167
+ }
168
+ /**
169
+ * Recompute the context slots reachable from the editor's mount
170
+ * point, unioning two sources:
171
+ *
172
+ * - the registered keys the resolver answers for — it walks the DOM
173
+ * from the host (and the session-wide fallbacks) the same way the
174
+ * runtime scope does, so a key resolves only when an ancestor
175
+ * actually provides it;
176
+ * - `availableContexts`, a hardcoded hint for keys (notably
177
+ * `limeobject`) that have no session-wide fallback and are provided
178
+ * by a different application than the one hosting the editor, so the
179
+ * DOM walk can't discover them.
180
+ */
181
+ computeReachableSlots() {
182
+ var _a;
183
+ const contextRegistry = this.contextRegistry;
184
+ const resolvable = contextRegistry
185
+ .list()
186
+ .map((metadata) => metadata.id)
187
+ .filter((key) => contextRegistry.get(key, this.host) !== undefined);
188
+ this.reachableSlots = new Set([
189
+ ...resolvable,
190
+ ...((_a = this.availableContexts) !== null && _a !== void 0 ? _a : []),
191
+ ]);
110
192
  }
111
193
  runValidation() {
112
194
  if (!this.value) {
113
195
  this.issues = [];
114
196
  return;
115
197
  }
116
- const result = this.ruleRegistry.validate(this.normalizedValue, this.availableContexts);
198
+ const result = this.ruleRegistry.validate(this.normalizedValue, [
199
+ ...this.reachableSlots,
200
+ ]);
117
201
  this.issues = result.ok ? [] : result.issues;
118
202
  }
119
203
  emitIfChanged(next) {
@@ -164,6 +248,12 @@ export class RuleEditor {
164
248
  get ruleRegistry() {
165
249
  return this.platform.get(PlatformServiceName.RuleRegistry);
166
250
  }
251
+ get translator() {
252
+ return this.platform.get(PlatformServiceName.Translate);
253
+ }
254
+ get contextRegistry() {
255
+ return this.platform.get(PlatformServiceName.ContextRegistry);
256
+ }
167
257
  static get is() { return "limebb-rule-editor"; }
168
258
  static get encapsulation() { return "shadow"; }
169
259
  static get originalStyleUrls() {
@@ -272,7 +362,7 @@ export class RuleEditor {
272
362
  "optional": true,
273
363
  "docs": {
274
364
  "tags": [],
275
- "text": "Context keys the caller knows will be available where the rule\nruns. Forwarded to the rule registry's `validate` method so\n`missing-slot` issues surface inline. Leave unset when the\nevaluation context is not known (typical for editors that target\nthe saved-rule library)."
365
+ "text": "Context keys the caller knows will be available where the rule\nruns. Forwarded to the rule registry's `validate` method so\n`missing-slot` issues surface inline. Leave unset when the\nevaluation context is not known \u2014 typical for editors that target\nthe saved-rule library."
276
366
  },
277
367
  "getter": false,
278
368
  "setter": false
@@ -392,7 +482,8 @@ export class RuleEditor {
392
482
  static get states() {
393
483
  return {
394
484
  "issues": {},
395
- "openChipPath": {}
485
+ "openChipPath": {},
486
+ "availablePrimitiveOptions": {}
396
487
  };
397
488
  }
398
489
  static get events() {
@@ -420,6 +511,7 @@ export class RuleEditor {
420
511
  }
421
512
  }];
422
513
  }
514
+ static get elementRef() { return "host"; }
423
515
  static get watchers() {
424
516
  return [{
425
517
  "propName": "value",
@@ -36,6 +36,15 @@ export function createPrimitiveOptions(metadataById, translator) {
36
36
  }))
37
37
  .sort((a, b) => a.text.localeCompare(b.text));
38
38
  }
39
+ /**
40
+ * Whether every context key a primitive reads is in the reachable set.
41
+ * A primitive that reads nothing is always covered.
42
+ * @param meta
43
+ * @param reachable
44
+ */
45
+ export function primitiveReadsCovered(meta, reachable) {
46
+ return meta.reads.every((key) => reachable.has(key));
47
+ }
39
48
  /**
40
49
  * Find the picker item for `id`, falling back to a placeholder marked
41
50
  * with the unknown-primitive icon when the id isn't in the registry.
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as o,transformTag as n}from"@stencil/core/internal/client";import{H as i,b as l}from"./index.esm.js";import{H as s}from"./highlight-item.handler.js";let c=class{constructor(e){this.itemId=e}};c=function(e,t,o,n){var i,l=arguments.length,s=l<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(i=e[c])&&(s=(l<3?i(s):l>3?i(t,o,s):i(t,o))||s);return l>3&&s&&Object.defineProperty(t,o,s),s}([i({id:"limebb-feed.highlight-item"})],c);const r=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.loaded=o(this,"loaded",7)}connectedCallback(){}async componentWillLoad(){const e=new s;this.platform.register(s.SERVICE_NAME,e),this.commandBus.register(c,e),this.loaded.emit()}componentWillUpdate(){}disconnectedCallback(){}get commandBus(){return this.platform.get(l.CommandBus)}},[1,"limebb-loader",{platform:[16],context:[16]}]),m=r,a=function(){"undefined"!=typeof customElements&&["limebb-loader"].forEach((e=>{"limebb-loader"===e&&(customElements.get(n(e))||customElements.define(n(e),r))}))};export{m as LimebbLoader,a as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as o,transformTag as i}from"@stencil/core/internal/client";import{H as l,b as n}from"./index.esm.js";import{H as c}from"./highlight-item.handler.js";let s=class{constructor(e){this.itemId=e}};s=function(e,t,o,i){var l,n=arguments.length,c=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,o,i);else for(var s=e.length-1;s>=0;s--)(l=e[s])&&(c=(n<3?l(c):n>3?l(t,o,c):l(t,o))||c);return n>3&&c&&Object.defineProperty(t,o,c),c}([l({id:"limebb-feed.highlight-item"})],s);const r=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.loaded=o(this,"loaded",7)}connectedCallback(){}async componentWillLoad(){const e=new c;this.platform.register(c.SERVICE_NAME,e),this.commandBus.register(s,e),(()=>{this.platform.get(n.RuleRegistry).attachMetadata("limetech.limeobject-matches-filter",{configComponent:{name:"limebb-rule-arg-filter-editor"}})})(),this.loaded.emit()}componentWillUpdate(){}disconnectedCallback(){}get commandBus(){return this.platform.get(n.CommandBus)}},[1,"limebb-loader",{platform:[16],context:[16]}]),m=r,a=function(){"undefined"!=typeof customElements&&["limebb-loader"].forEach((e=>{"limebb-loader"===e&&(customElements.get(i(e))||customElements.define(i(e),r))}))};export{m as LimebbLoader,a as defineCustomElement}
@@ -1 +1 @@
1
- import{h as e,proxyCustomElement as t,HTMLElement as n,createEvent as r,transformTag as l}from"@stencil/core/internal/client";import{b as o}from"./index.esm.js";import{d as i}from"./rule-chip-popover.js";function s(e,t){return t?{type:"not",rule:e}:e}function u(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}function a(e,t){return e.filter((e=>u(e.path,t)))}function c(e,t){let n=e;for(const e of t)n=h(n,e);return n}function d(e,t,n){if(0===t.length)return n;const[r,...l]=t;if("not"===e.type&&"rule"===r)return Object.assign(Object.assign({},e),{rule:d(e.rule,l,n)});if(("all"===e.type||"any"===e.type)&&"rules"===r){if(0===l.length)return n;const[t,...r]=l;if("number"!=typeof t)return e;const o=[...e.rules];return o[t]=d(o[t],r,n),Object.assign(Object.assign({},e),{rules:o})}return e}function h(e,t){return"not"===e.type&&"rule"===t?e.rule:"all"!==e.type&&"any"!==e.type||"rules"!==t?"all"!==e.type&&"any"!==e.type||"number"!=typeof t?e:e.rules[t]:e}const p={name:"question",color:"rgb(var(--color-glaucous-light))"};function f(e,t){return{"rule-node":!0,["rule-node--"+e]:!0,"rule-node--invalid":t.length>0}}function b(e){return"__chip__:"+e}function m(e){return"ref"===e.type?{ref:e,isNegated:!1}:"not"===e.type&&"ref"===e.rule.type?{ref:e.rule,isNegated:!0}:null}const v=({groupNode:t,groupPath:n,chipChildren:r,ctx:l})=>{const o=new Map,i=r.map((e=>{const t=b(e.index);o.set(t,e);const n=function(e,t){var n;return null!==(n=e.find((e=>e.value===t)))&&void 0!==n?n:{value:t,text:t,icon:p}}(l.primitiveOptions,e.ref.id);return Object.assign(Object.assign({},n),{text:e.isNegated?"¬ "+n.text:n.text,value:t})})),s=function(e){return t=>Promise.resolve(function(e,t){if(!t)return e;const n=t.toLocaleLowerCase().split(/\s+/);return e.filter((e=>n.every((t=>{var n,r;return e.text.toLocaleLowerCase().includes(t)||(null===(n=e.secondaryText)||void 0===n?void 0:n.toLocaleLowerCase().includes(t))||(null===(r=e.value)||void 0===r?void 0:r.toLocaleLowerCase().includes(t))}))))}(e,t))}(l.primitiveOptions),u=function(e,t,n){var r;const l=j(t,n);return null===l?null:null!==(r=e.find((e=>e.index===l)))&&void 0!==r?r:null}(r,n,l.openChipPath),a="all"===t.type?"&":"|";return e("limel-popover",{class:"rule-node__chips-popover",open:null!==u,openDirection:"bottom-start",onClose:l.onPopoverClose},e("div",{slot:"trigger",class:"rule-node__chips"},e("limel-picker",{multiple:!0,label:l.translator.get("webclient.rule-editor.rules-label"),value:i,searcher:s,delimiter:a,readonly:l.readonly,disabled:l.disabled,onChange:g(t,n,o,l),onInteract:_(n,o,l)})),e("div",null,function(t,n,r){if(!t)return null;const l=function(e,t){return[...e,"rules",t]}(n,t.index);return e("limebb-rule-chip-popover",{platform:r.platform,context:r.context,refNode:t.ref,isNegated:t.isNegated,metadata:r.metadataById.get(t.ref.id),readonly:r.readonly,disabled:r.disabled,isMutable:r.isMutable,onNegate:y(t,l,r),onUpdateArgs:x(t,l,r),onDeleteChip:C(l,r)})}(u,n,l)))},g=(e,t,n,r)=>l=>{l.stopPropagation();const o=Array.isArray(l.detail)?l.detail:[],i=j(t,r.openChipPath);if(null!==i){const e=b(i);o.every((t=>t.value!==e))&&r.onPopoverClose()}const s=o.flatMap((e=>{if("string"!=typeof e.value)return[];const t=n.get(e.value);return t?[t.isNegated?{type:"not",rule:t.ref}:t.ref]:[{type:"ref",id:e.value}]})),u=e.rules.filter((e=>null===m(e)));r.onReplaceNode(t,Object.assign(Object.assign({},e),{rules:[...s,...u]}))},_=(e,t,n)=>r=>{r.stopPropagation();const l=function(e){if("string"==typeof e)return e;if(e&&"object"==typeof e&&"value"in e){const t=e.value;return"string"==typeof t?t:void 0}}(r.detail),o=l?t.get(l):void 0;o&&n.onChipInteract([...e,"rules",o.index])},y=(e,t,n)=>r=>{r.stopPropagation(),n.onReplaceNode(t,r.detail?{type:"not",rule:e.ref}:e.ref)},x=(e,t,n)=>r=>{r.stopPropagation();const l=e.isNegated?[...t,"rule"]:t;n.onUpdateArgs(l,r.detail)},C=(e,t)=>()=>{t.onDelete(e)};function j(e,t){if(!t||t.length<2)return null;if(!u(function(e){return e.slice(0,-2)}(t),e))return null;const n=t.at(-1);return"number"==typeof n?n:null}const w=({node:t,path:n,isNegated:r,ctx:l})=>{const o=r?[...n,"rule"]:n,i=r?[...a(l.issues,n),...a(l.issues,o)]:a(l.issues,n),s=[],u=[];for(const[e,n]of t.rules.entries()){const t=m(n);t?s.push(Object.assign(Object.assign({},t),{index:e})):u.push({child:n,index:e})}const c=function(e){return[{value:"all",text:e.translator.get("webclient.rule-editor.combinator.all")},{value:"any",text:e.translator.get("webclient.rule-editor.combinator.any")}]}(l),d=c.find((e=>e.value===t.type));return e("div",{class:f(t.type,i),key:O(n)},e("div",{class:"rule-node__header"},e("limel-select",{class:"rule-node__combinator-select",value:d,options:c,disabled:!l.isMutable,onChange:k(t,n,r,l)}),function(t,n,r,l){return l.isMutable?e("div",{class:"rule-node__header-actions"},e("limel-switch",{class:"rule-node__negate-switch",label:l.translator.get("webclient.rule-editor.negate"),value:r,onChange:A(t,n,l)}),e("limel-icon-button",{icon:"trash",label:l.translator.get("webclient.rule-editor.delete"),onClick:()=>l.onDelete(n)})):null}(t,n,r,l)),e("div",{class:"rule-node__body"},e(D,{issues:i}),e(v,{groupNode:t,groupPath:o,chipChildren:s,ctx:l}),function(t,n,r){return 0===t.length?null:e("div",{class:"rule-node__children"},t.map((t=>e(M,{node:t.child,path:[...n,"rules",t.index],ctx:r}))))}(u,o,l),function(t,n,r,l){return l.isMutable?e("div",{class:"rule-node__footer"},e("limel-button",{icon:"add",label:l.translator.get("webclient.rule-editor.add-nested-group"),onClick:z(t,n,r,l)})):null}(t,n,r,l)))};function O(e){return 0===e.length?"root":e.join("/")}function N(e,t,n,r){r.onReplaceNode(t,s(e,n))}const k=(e,t,n,r)=>l=>{l.stopPropagation();const o=l.detail.value;o!==e.type&&N(Object.assign(Object.assign({},e),{type:o}),t,n,r)},z=(e,t,n,r)=>()=>{N(function(e){return Object.assign(Object.assign({},e),{rules:[...e.rules,{type:"all",rules:[]}]})}(e),t,n,r)},A=(e,t,n)=>r=>{r.stopPropagation(),n.onReplaceNode(t,s(e,r.detail))},M=t=>{const{node:n,path:r,ctx:l}=t,o=V(n);return o?e(w,{node:o.node,path:r,isNegated:o.isNegated,ctx:l}):null},P=e=>"not"===e.type&&("all"===e.rule.type||"any"===e.rule.type);function V(e){if("all"===e.type||"any"===e.type)return{node:e,isNegated:!1};if(P(e))return{node:e.rule,isNegated:!0};if("not"===e.type){const t=V(e.rule);if(t)return{node:t.node,isNegated:!t.isNegated}}return null}const D=({issues:t})=>0===t.length?null:t.map((t=>e("div",{class:"rule-node__issue"},t.message))),E=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.change=r(this,"change",7),this.issues=[],this.openChipPath=null,this.metadataById=new Map,this.primitiveOptions=[],this.normalizedCache=null,this.handleDelete=e=>{this.openChipPath=null,this.emitIfChanged(function(e,t){if(0===t.length)return{type:"all",rules:[]};const n=t.slice(0,-1),r=t.at(-1),l=c(e,n);if(("all"===l.type||"any"===l.type)&&"number"==typeof r){const t=[...l.rules];return t.splice(r,1),d(e,n,Object.assign(Object.assign({},l),{rules:t}))}return"not"===l.type&&"rule"===r?d(e,n,{type:"all",rules:[]}):e}(this.normalizedValue,e))},this.handleUpdateArgs=(e,t)=>{this.emitIfChanged(function(e,t,n){const r=c(e,t);return"ref"!==r.type?e:d(e,t,Object.assign(Object.assign({},r),{args:n}))}(this.normalizedValue,e,t))},this.handleReplaceNode=(e,t)=>{this.emitIfChanged(function(e,t,n){return d(e,t,n)}(this.normalizedValue,e,t))},this.handleChipInteract=e=>{this.openChipPath=e},this.handlePopoverClose=()=>{this.openChipPath=null}}componentWillLoad(){this.indexMetadata(),this.runValidation()}componentDidLoad(){this.emitNormalization()}onValueChange(){this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.runValidation()}render(){return e("div",{key:"8e0da39f6544c86de0143e91a6c48c9f2654315f",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled}},this.renderLabel(),e(M,{key:"cd093f5dc5a9b747036f581e6230f1205cf834e6",node:this.normalizedValue,path:[],ctx:this.createRenderContext()}),this.renderHelperText())}renderLabel(){return this.label?e("div",{class:"rule-editor__label"},this.label):null}renderHelperText(){return this.helperText?e("div",{class:"rule-editor__helper-text"},this.helperText):null}createRenderContext(){return{issues:this.issues,metadataById:this.metadataById,primitiveOptions:this.primitiveOptions,isMutable:!this.readonly&&!this.disabled,readonly:this.readonly,disabled:this.disabled,platform:this.platform,context:this.context,translator:this.platform.get(o.Translate),openChipPath:this.openChipPath,onDelete:this.handleDelete,onUpdateArgs:this.handleUpdateArgs,onReplaceNode:this.handleReplaceNode,onChipInteract:this.handleChipInteract,onPopoverClose:this.handlePopoverClose}}indexMetadata(){var e,t,n;const r=null!==(n=null===(t=(e=this.ruleRegistry).listMetadata)||void 0===t?void 0:t.call(e))&&void 0!==n?n:[];this.metadataById=new Map(r.map((e=>[e.id,e]))),this.primitiveOptions=function(e,t){return[...e.values()].map((e=>({value:e.id,text:e.title?t.get(e.title):e.id,secondaryText:e.description?t.get(e.description):"",icon:e.icon}))).sort(((e,t)=>e.text.localeCompare(t.text)))}(this.metadataById,this.platform.get(o.Translate))}runValidation(){if(!this.value)return void(this.issues=[]);const e=this.ruleRegistry.validate(this.normalizedValue,this.availableContexts);this.issues=e.ok?[]:e.issues}emitIfChanged(e){e!==this.normalizedValue&&this.change.emit(function(e){return"all"!==e.type&&"any"!==e.type?e:0===e.rules.length?void 0:e}(e))}get normalizedValue(){if(null!==this.normalizedCache&&this.normalizedCache.source===this.value)return this.normalizedCache.normalized;const e=function(e){return e?V(e)?e:{type:"all",rules:[e]}:{type:"all",rules:[]}}(this.value);return this.normalizedCache={source:this.value,normalized:e},e}emitNormalization(){if(!this.value)return!1;const e=this.normalizedValue;return e!==this.value&&(this.change.emit(e),!0)}get ruleRegistry(){return this.platform.get(o.RuleRegistry)}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}static get style(){return":host{display:block}.rule-editor--disabled{opacity:0.6;pointer-events:none}.rule-editor__label{font-size:0.75rem;font-weight:600;color:rgb(var(--contrast-1500));margin-bottom:0.25rem}.rule-editor__helper-text{font-size:0.75rem;color:rgb(var(--contrast-1300));margin-top:0.25rem}.rule-node{border:1px solid rgb(var(--contrast-500));border-radius:0.5rem;margin:0.25rem 0;overflow:hidden;background-color:rgb(var(--contrast-100))}.rule-node--invalid{border-color:rgb(var(--color-red-default))}.rule-node--all>.rule-node__header,.rule-node--any>.rule-node__header{background-color:rgb(var(--contrast-300));padding:0.375rem 0.75rem;border-bottom:1px solid rgb(var(--contrast-500))}.rule-node__header{display:flex;align-items:center;gap:0.5rem}.rule-node__header-actions{margin-left:auto;display:grid;grid-auto-flow:column;grid-gap:0.5rem;padding:0.125rem;align-items:center}.rule-node__combinator-select{min-width:6rem}.rule-node__body{padding:0.75rem;display:flex;flex-direction:column;gap:0.75rem}limel-popover.rule-node__chips-popover{display:contents}.rule-node__chips{display:block;width:100%}.rule-node__chips limel-picker{display:block;width:100%}.rule-node__children{display:flex;flex-direction:column;gap:0.5rem}.rule-node__footer{display:flex;justify-content:center}.rule-node__issue{color:rgb(var(--color-red-default));font-size:0.875rem}"}},[1,"limebb-rule-editor",{platform:[16],context:[16],value:[16],availableContexts:[16],required:[516],readonly:[516],disabled:[516],label:[513],helperText:[1,"helper-text"],issues:[32],openChipPath:[32]},void 0,{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}]),I=E,L=function(){"undefined"!=typeof customElements&&["limebb-rule-editor","limebb-rule-chip-popover"].forEach((e=>{switch(e){case"limebb-rule-editor":customElements.get(l(e))||customElements.define(l(e),E);break;case"limebb-rule-chip-popover":customElements.get(l(e))||i()}}))};export{I as LimebbRuleEditor,L as defineCustomElement}
1
+ import{h as e,proxyCustomElement as t,HTMLElement as n,createEvent as r,transformTag as i}from"@stencil/core/internal/client";import{b as l}from"./index.esm.js";import{d as o}from"./rule-chip-popover.js";function s(e,t){return t?{type:"not",rule:e}:e}function u(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}function a(e,t){return e.filter((e=>u(e.path,t)))}function c(e,t){let n=e;for(const e of t)n=h(n,e);return n}function d(e,t,n){if(0===t.length)return n;const[r,...i]=t;if("not"===e.type&&"rule"===r)return Object.assign(Object.assign({},e),{rule:d(e.rule,i,n)});if(("all"===e.type||"any"===e.type)&&"rules"===r){if(0===i.length)return n;const[t,...r]=i;if("number"!=typeof t)return e;const l=[...e.rules];return l[t]=d(l[t],r,n),Object.assign(Object.assign({},e),{rules:l})}return e}function h(e,t){return"not"===e.type&&"rule"===t?e.rule:"all"!==e.type&&"any"!==e.type||"rules"!==t?"all"!==e.type&&"any"!==e.type||"number"!=typeof t?e:e.rules[t]:e}const p={name:"question",color:"rgb(var(--color-glaucous-light))"};function f(e,t){return{"rule-node":!0,["rule-node--"+e]:!0,"rule-node--invalid":t.length>0}}function b(e,t){return[...e.values()].map((e=>({value:e.id,text:e.title?t.get(e.title):e.id,secondaryText:e.description?t.get(e.description):"",icon:e.icon}))).sort(((e,t)=>e.text.localeCompare(t.text)))}function m(e,t){return e.reads.every((e=>t.has(e)))}function v(e){return"__chip__:"+e}function g(e){return"ref"===e.type?{ref:e,isNegated:!1}:"not"===e.type&&"ref"===e.rule.type?{ref:e.rule,isNegated:!0}:null}const _=({groupNode:t,groupPath:n,chipChildren:r,ctx:i})=>{const l=new Map,o=r.map((e=>{const t=v(e.index);l.set(t,e);const n=function(e,t){var n;return null!==(n=e.find((e=>e.value===t)))&&void 0!==n?n:{value:t,text:t,icon:p}}(i.allPrimitiveOptions,e.ref.id);return Object.assign(Object.assign({},n),{text:e.isNegated?"¬ "+n.text:n.text,value:t})})),s=function(e){return t=>Promise.resolve(function(e,t){if(!t)return e;const n=t.toLocaleLowerCase().split(/\s+/);return e.filter((e=>n.every((t=>{var n,r;return e.text.toLocaleLowerCase().includes(t)||(null===(n=e.secondaryText)||void 0===n?void 0:n.toLocaleLowerCase().includes(t))||(null===(r=e.value)||void 0===r?void 0:r.toLocaleLowerCase().includes(t))}))))}(e,t))}(i.availablePrimitiveOptions),u=function(e,t,n){var r;const i=O(t,n);return null===i?null:null!==(r=e.find((e=>e.index===i)))&&void 0!==r?r:null}(r,n,i.openChipPath),a="all"===t.type?"&":"|";return e("limel-popover",{class:"rule-node__chips-popover",open:null!==u,openDirection:"bottom-start",onClose:i.onPopoverClose},e("div",{slot:"trigger",class:"rule-node__chips"},e("limel-picker",{multiple:!0,label:i.translator.get("webclient.rule-editor.rules-label"),value:o,searcher:s,delimiter:a,readonly:i.readonly,disabled:i.disabled,onChange:y(t,n,l,i),onInteract:x(n,l,i)})),e("div",null,function(t,n,r){if(!t)return null;const i=function(e,t){return[...e,"rules",t]}(n,t.index);return e("limebb-rule-chip-popover",{platform:r.platform,context:r.context,refNode:t.ref,isNegated:t.isNegated,metadata:r.metadataById.get(t.ref.id),readonly:r.readonly,disabled:r.disabled,isMutable:r.isMutable,onNegate:C(t,i,r),onUpdateArgs:j(t,i,r),onDeleteChip:w(i,r)})}(u,n,i)))},y=(e,t,n,r)=>i=>{i.stopPropagation();const l=Array.isArray(i.detail)?i.detail:[],o=O(t,r.openChipPath);if(null!==o){const e=v(o);l.every((t=>t.value!==e))&&r.onPopoverClose()}const s=l.flatMap((e=>{if("string"!=typeof e.value)return[];const t=n.get(e.value);return t?[t.isNegated?{type:"not",rule:t.ref}:t.ref]:[{type:"ref",id:e.value}]})),u=e.rules.filter((e=>null===g(e)));r.onReplaceNode(t,Object.assign(Object.assign({},e),{rules:[...s,...u]}))},x=(e,t,n)=>r=>{r.stopPropagation();const i=function(e){if("string"==typeof e)return e;if(e&&"object"==typeof e&&"value"in e){const t=e.value;return"string"==typeof t?t:void 0}}(r.detail),l=i?t.get(i):void 0;l&&n.onChipInteract([...e,"rules",l.index])},C=(e,t,n)=>r=>{r.stopPropagation(),n.onReplaceNode(t,r.detail?{type:"not",rule:e.ref}:e.ref)},j=(e,t,n)=>r=>{r.stopPropagation();const i=e.isNegated?[...t,"rule"]:t;n.onUpdateArgs(i,r.detail)},w=(e,t)=>()=>{t.onDelete(e)};function O(e,t){if(!t||t.length<2)return null;if(!u(function(e){return e.slice(0,-2)}(t),e))return null;const n=t.at(-1);return"number"==typeof n?n:null}const k=({node:t,path:n,isNegated:r,ctx:i})=>{const l=r?[...n,"rule"]:n,o=r?[...a(i.issues,n),...a(i.issues,l)]:a(i.issues,n),s=[],u=[];for(const[e,n]of t.rules.entries()){const t=g(n);t?s.push(Object.assign(Object.assign({},t),{index:e})):u.push({child:n,index:e})}const c=function(e){return[{value:"all",text:e.translator.get("webclient.rule-editor.combinator.all")},{value:"any",text:e.translator.get("webclient.rule-editor.combinator.any")}]}(i),d=c.find((e=>e.value===t.type));return e("div",{class:f(t.type,o),key:N(n)},e("div",{class:"rule-node__header"},e("limel-select",{class:"rule-node__combinator-select",value:d,options:c,disabled:!i.isMutable,onChange:M(t,n,r,i)}),function(t,n,r,i){return i.isMutable?e("div",{class:"rule-node__header-actions"},e("limel-switch",{class:"rule-node__negate-switch",label:i.translator.get("webclient.rule-editor.negate"),value:r,onChange:z(t,n,i)}),e("limel-icon-button",{icon:"trash",label:i.translator.get("webclient.rule-editor.delete"),onClick:()=>i.onDelete(n)})):null}(t,n,r,i)),e("div",{class:"rule-node__body"},e(E,{issues:o}),e(_,{groupNode:t,groupPath:l,chipChildren:s,ctx:i}),function(t,n,r){return 0===t.length?null:e("div",{class:"rule-node__children"},t.map((t=>e(R,{node:t.child,path:[...n,"rules",t.index],ctx:r}))))}(u,l,i),function(t,n,r,i){return i.isMutable?e("div",{class:"rule-node__footer"},e("limel-button",{icon:"add",label:i.translator.get("webclient.rule-editor.add-nested-group"),onClick:A(t,n,r,i)})):null}(t,n,r,i)))};function N(e){return 0===e.length?"root":e.join("/")}function P(e,t,n,r){r.onReplaceNode(t,s(e,n))}const M=(e,t,n,r)=>i=>{i.stopPropagation();const l=i.detail.value;l!==e.type&&P(Object.assign(Object.assign({},e),{type:l}),t,n,r)},A=(e,t,n,r)=>()=>{P(function(e){return Object.assign(Object.assign({},e),{rules:[...e.rules,{type:"all",rules:[]}]})}(e),t,n,r)},z=(e,t,n)=>r=>{r.stopPropagation(),n.onReplaceNode(t,s(e,r.detail))},R=t=>{const{node:n,path:r,ctx:i}=t,l=D(n);return l?e(k,{node:l.node,path:r,isNegated:l.isNegated,ctx:i}):null},V=e=>"not"===e.type&&("all"===e.rule.type||"any"===e.rule.type);function D(e){if("all"===e.type||"any"===e.type)return{node:e,isNegated:!1};if(V(e))return{node:e.rule,isNegated:!0};if("not"===e.type){const t=D(e.rule);if(t)return{node:t.node,isNegated:!t.isNegated}}return null}const E=({issues:t})=>0===t.length?null:t.map((t=>e("div",{class:"rule-node__issue"},t.message))),I=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.change=r(this,"change",7),this.issues=[],this.openChipPath=null,this.metadataById=new Map,this.allPrimitiveOptions=[],this.availablePrimitiveOptions=[],this.reachableSlots=new Set,this.normalizedCache=null,this.hasLoaded=!1,this.handleDelete=e=>{this.openChipPath=null,this.emitIfChanged(function(e,t){if(0===t.length)return{type:"all",rules:[]};const n=t.slice(0,-1),r=t.at(-1),i=c(e,n);if(("all"===i.type||"any"===i.type)&&"number"==typeof r){const t=[...i.rules];return t.splice(r,1),d(e,n,Object.assign(Object.assign({},i),{rules:t}))}return"not"===i.type&&"rule"===r?d(e,n,{type:"all",rules:[]}):e}(this.normalizedValue,e))},this.handleUpdateArgs=(e,t)=>{this.emitIfChanged(function(e,t,n){const r=c(e,t);return"ref"!==r.type?e:d(e,t,Object.assign(Object.assign({},r),{args:n}))}(this.normalizedValue,e,t))},this.handleReplaceNode=(e,t)=>{this.emitIfChanged(function(e,t,n){return d(e,t,n)}(this.normalizedValue,e,t))},this.handleChipInteract=e=>{this.openChipPath=e},this.handlePopoverClose=()=>{this.openChipPath=null}}componentWillLoad(){this.rebuildFromRegistries()}rebuildFromRegistries(){this.computeReachableSlots(),this.indexMetadata(),this.rebuildAvailableOptions(),this.runValidation()}connectedCallback(){this.hasLoaded&&(this.computeReachableSlots(),this.rebuildAvailableOptions(),this.runValidation())}componentDidLoad(){this.hasLoaded=!0,this.emitNormalization()}onValueChange(){this.emitNormalization()||this.runValidation()}onAvailableContextsChange(){this.rebuildFromRegistries()}render(){return e("div",{key:"dfdc801d8c0d48b8276b9d4cff8a4a2c0754c52f",class:{"rule-editor":!0,"rule-editor--disabled":this.disabled}},this.renderLabel(),e(R,{key:"250d53eba7681872f181003c709303238971be2a",node:this.normalizedValue,path:[],ctx:this.createRenderContext()}),this.renderHelperText())}renderLabel(){return this.label?e("div",{class:"rule-editor__label"},this.label):null}renderHelperText(){return this.helperText?e("div",{class:"rule-editor__helper-text"},this.helperText):null}createRenderContext(){return{issues:this.issues,metadataById:this.metadataById,allPrimitiveOptions:this.allPrimitiveOptions,availablePrimitiveOptions:this.availablePrimitiveOptions,isMutable:!this.readonly&&!this.disabled,readonly:this.readonly,disabled:this.disabled,platform:this.platform,context:this.context,translator:this.translator,openChipPath:this.openChipPath,onDelete:this.handleDelete,onUpdateArgs:this.handleUpdateArgs,onReplaceNode:this.handleReplaceNode,onChipInteract:this.handleChipInteract,onPopoverClose:this.handlePopoverClose}}indexMetadata(){var e,t,n;const r=null!==(n=null===(t=(e=this.ruleRegistry).listMetadata)||void 0===t?void 0:t.call(e))&&void 0!==n?n:[];this.metadataById=new Map(r.map((e=>[e.id,e]))),this.allPrimitiveOptions=b(this.metadataById,this.translator)}rebuildAvailableOptions(){this.availablePrimitiveOptions=b(this.availablePrimitiveMetadata(),this.translator)}availablePrimitiveMetadata(){const e=new Map;for(const[t,n]of this.metadataById)m(n,this.reachableSlots)&&e.set(t,n);return e}computeReachableSlots(){var e;const t=this.contextRegistry,n=t.list().map((e=>e.id)).filter((e=>void 0!==t.get(e,this.host)));this.reachableSlots=new Set([...n,...null!==(e=this.availableContexts)&&void 0!==e?e:[]])}runValidation(){if(!this.value)return void(this.issues=[]);const e=this.ruleRegistry.validate(this.normalizedValue,[...this.reachableSlots]);this.issues=e.ok?[]:e.issues}emitIfChanged(e){e!==this.normalizedValue&&this.change.emit(function(e){return"all"!==e.type&&"any"!==e.type?e:0===e.rules.length?void 0:e}(e))}get normalizedValue(){if(null!==this.normalizedCache&&this.normalizedCache.source===this.value)return this.normalizedCache.normalized;const e=function(e){return e?D(e)?e:{type:"all",rules:[e]}:{type:"all",rules:[]}}(this.value);return this.normalizedCache={source:this.value,normalized:e},e}emitNormalization(){if(!this.value)return!1;const e=this.normalizedValue;return e!==this.value&&(this.change.emit(e),!0)}get ruleRegistry(){return this.platform.get(l.RuleRegistry)}get translator(){return this.platform.get(l.Translate)}get contextRegistry(){return this.platform.get(l.ContextRegistry)}get host(){return this}static get watchers(){return{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}}static get style(){return":host{display:block}.rule-editor--disabled{opacity:0.6;pointer-events:none}.rule-editor__label{font-size:0.75rem;font-weight:600;color:rgb(var(--contrast-1500));margin-bottom:0.25rem}.rule-editor__helper-text{font-size:0.75rem;color:rgb(var(--contrast-1300));margin-top:0.25rem}.rule-node{border:1px solid rgb(var(--contrast-500));border-radius:0.5rem;margin:0.25rem 0;overflow:hidden;background-color:rgb(var(--contrast-100))}.rule-node--invalid{border-color:rgb(var(--color-red-default))}.rule-node--all>.rule-node__header,.rule-node--any>.rule-node__header{background-color:rgb(var(--contrast-300));padding:0.375rem 0.75rem;border-bottom:1px solid rgb(var(--contrast-500))}.rule-node__header{display:flex;align-items:center;gap:0.5rem}.rule-node__header-actions{margin-left:auto;display:grid;grid-auto-flow:column;grid-gap:0.5rem;padding:0.125rem;align-items:center}.rule-node__combinator-select{min-width:6rem}.rule-node__body{padding:0.75rem;display:flex;flex-direction:column;gap:0.75rem}limel-popover.rule-node__chips-popover{display:contents}.rule-node__chips{display:block;width:100%}.rule-node__chips limel-picker{display:block;width:100%}.rule-node__children{display:flex;flex-direction:column;gap:0.5rem}.rule-node__footer{display:flex;justify-content:center}.rule-node__issue{color:rgb(var(--color-red-default));font-size:0.875rem}"}},[1,"limebb-rule-editor",{platform:[16],context:[16],value:[16],availableContexts:[16],required:[516],readonly:[516],disabled:[516],label:[513],helperText:[1,"helper-text"],issues:[32],openChipPath:[32],availablePrimitiveOptions:[32]},void 0,{value:[{onValueChange:0}],availableContexts:[{onAvailableContextsChange:0}]}]),L=I,S=function(){"undefined"!=typeof customElements&&["limebb-rule-editor","limebb-rule-chip-popover"].forEach((e=>{switch(e){case"limebb-rule-editor":customElements.get(i(e))||customElements.define(i(e),I);break;case"limebb-rule-chip-popover":customElements.get(i(e))||o()}}))};export{L as LimebbRuleEditor,S as defineCustomElement}
@@ -17,5 +17,5 @@ var patchBrowser = () => {
17
17
 
18
18
  patchBrowser().then(async (options) => {
19
19
  await globalScripts();
20
- return bootstrapLazy(JSON.parse("[[\"limebb-lime-query-builder\",[[1,\"limebb-lime-query-builder\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"label\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"limetypes\":[32],\"mode\":[32],\"codeValue\":[32],\"limetype\":[32],\"filter\":[32],\"internalResponseFormat\":[32],\"limit\":[32],\"orderBy\":[32],\"description\":[32]}]]],[\"limebb-rule-arg-filter-editor\",[[1,\"limebb-rule-arg-filter-editor\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"resolvedContext\":[32]}]]],[\"limebb-feed\",[[1,\"limebb-feed\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"emptyStateMessage\":[1,\"empty-state-message\"],\"heading\":[1],\"loading\":[4],\"minutesOfProximity\":[2,\"minutes-of-proximity\"],\"totalCount\":[2,\"total-count\"],\"direction\":[513],\"lastVisitedTimestamp\":[1,\"last-visited-timestamp\"],\"highlightedItemId\":[8,\"highlighted-item-id\"]},null,{\"highlightedItemId\":[{\"highlightedItemIdChanged\":0}]}]]],[\"limebb-kanban\",[[1,\"limebb-kanban\",{\"platform\":[16],\"context\":[16],\"groups\":[16]}]]],[\"limebb-chat-list\",[[1,\"limebb-chat-list\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"loading\":[516],\"isTypingIndicatorVisible\":[516,\"is-typing-indicator-visible\"],\"lastVisitedTimestamp\":[513,\"last-visited-timestamp\"],\"order\":[513]},null,{\"items\":[{\"handleItemsChange\":0}],\"order\":[{\"handleItemsChange\":0}]}]]],[\"limebb-lime-query-response-format-builder\",[[1,\"limebb-lime-query-response-format-builder\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"helperText\":[1,\"helper-text\"],\"limetypes\":[32],\"mode\":[32],\"codeValue\":[32],\"internalValue\":[32]}]]],[\"limebb-document-chips\",[[1,\"limebb-document-chips\",{\"accessibleLabel\":[513,\"accessible-label\"],\"files\":[16]},null,{\"files\":[{\"onFilesChanged\":0}]}]]],[\"limebb-limeobject-file-viewer\",[[1,\"limebb-limeobject-file-viewer\",{\"platform\":[16],\"context\":[16],\"property\":[1],\"fileTypes\":[16],\"limeobject\":[32],\"limetype\":[32]}]]],[\"limebb-text-editor\",[[17,\"limebb-text-editor\",{\"platform\":[16],\"context\":[16],\"allowMentioning\":[4,\"allow-mentioning\"],\"contentType\":[1,\"content-type\"],\"language\":[513],\"disabled\":[516],\"readonly\":[516],\"helperText\":[513,\"helper-text\"],\"placeholder\":[513],\"label\":[513],\"invalid\":[516],\"required\":[516],\"selectedContext\":[16],\"ui\":[513],\"allowResize\":[4,\"allow-resize\"],\"value\":[1],\"draftIdentifier\":[1,\"draft-identifier\"],\"triggerMap\":[16],\"customElements\":[16],\"allowInlineImages\":[4,\"allow-inline-images\"],\"items\":[32],\"highlightedItemIndex\":[32],\"editorPickerQuery\":[32],\"searchableLimetypes\":[32],\"isPickerOpen\":[32],\"isSearching\":[32]},null,{\"isPickerOpen\":[{\"watchOpen\":0}],\"editorPickerQuery\":[{\"watchQuery\":0}]}]]],[\"limebb-data-cells\",[[1,\"limebb-data-cells\",{\"platform\":[16],\"context\":[16],\"limeobject\":[8],\"items\":[16],\"image\":[16],\"relativeDates\":[4,\"relative-dates\"]}]]],[\"limebb-date-range\",[[1,\"limebb-date-range\",{\"platform\":[16],\"context\":[16],\"startTime\":[16],\"endTime\":[16],\"startTimeLabel\":[1,\"start-time-label\"],\"endTimeLabel\":[1,\"end-time-label\"],\"language\":[1],\"timeFormat\":[1,\"time-format\"],\"type\":[1]}]]],[\"limebb-document-picker\",[[1,\"limebb-document-picker\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"invalid\":[516],\"required\":[516],\"type\":[513]}]]],[\"limebb-info-tile-currency-format\",[[1,\"limebb-info-tile-currency-format\",{\"platform\":[16],\"context\":[16],\"value\":[16]}]]],[\"limebb-notification-list\",[[1,\"limebb-notification-list\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"loading\":[4],\"lastVisitedTimestamp\":[1,\"last-visited-timestamp\"]},null,{\"items\":[{\"handleItemsChange\":0}]}]]],[\"limebb-rule-editor\",[[1,\"limebb-rule-editor\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"availableContexts\":[16],\"required\":[516],\"readonly\":[516],\"disabled\":[516],\"label\":[513],\"helperText\":[1,\"helper-text\"],\"issues\":[32],\"openChipPath\":[32]},null,{\"value\":[{\"onValueChange\":0}],\"availableContexts\":[{\"onAvailableContextsChange\":0}]}]]],[\"limebb-alert-dialog\",[[257,\"limebb-alert-dialog\",{\"type\":[513],\"open\":[516],\"icon\":[513],\"heading\":[513],\"subheading\":[1]}]]],[\"limebb-browser\",[[17,\"limebb-browser\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"layout\":[1],\"filter\":[32]}]]],[\"limebb-color-palette-picker\",[[1,\"limebb-color-palette-picker\",{\"value\":[513],\"required\":[516],\"readonly\":[516],\"invalid\":[516],\"disabled\":[516],\"label\":[513],\"helperText\":[1,\"helper-text\"]}]]],[\"limebb-color-palette-swatches\",[[1,\"limebb-color-palette-swatches\",{\"colors\":[16]}]]],[\"limebb-component-config\",[[1,\"limebb-component-config\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"],\"formInfo\":[16],\"type\":[1],\"nameField\":[1,\"name-field\"],\"configComponent\":[32],\"configViewType\":[32]},null,{\"formInfo\":[{\"watchFormInfo\":0}],\"configComponent\":[{\"watchconfigComponent\":0}]}]]],[\"limebb-component-picker\",[[1,\"limebb-component-picker\",{\"platform\":[16],\"context\":[16],\"type\":[1],\"tags\":[16],\"value\":[1],\"copyLabel\":[1,\"copy-label\"],\"hideCopyButton\":[4,\"hide-copy-button\"],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"]}]]],[\"limebb-composer-toolbar\",[[257,\"limebb-composer-toolbar\",{\"platform\":[16],\"mentions\":[516],\"textSnippets\":[516,\"text-snippets\"],\"internalLinks\":[516,\"internal-links\"],\"richText\":[516,\"rich-text\"],\"fileInput\":[16]}]]],[\"limebb-dashboard-widget\",[[257,\"limebb-dashboard-widget\",{\"heading\":[513],\"subheading\":[513],\"supportingText\":[513,\"supporting-text\"],\"icon\":[513]}]]],[\"limebb-icon-picker\",[[1,\"limebb-icon-picker\",{\"value\":[1],\"required\":[4],\"readonly\":[4],\"invalid\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"]}]]],[\"limebb-info-tile\",[[1,\"limebb-info-tile\",{\"platform\":[16],\"context\":[16],\"filterId\":[513,\"filter-id\"],\"disabled\":[4],\"icon\":[513],\"label\":[1],\"prefix\":[1],\"suffix\":[1],\"propertyName\":[1,\"property-name\"],\"aggregateOperator\":[1,\"aggregate-operator\"],\"format\":[16],\"config\":[32],\"filters\":[32],\"value\":[32],\"loading\":[32],\"error\":[32],\"limetypes\":[32]},null,{\"filterId\":[{\"watchFilterId\":0}],\"propertyName\":[{\"watchPropertyName\":0}],\"aggregateOperator\":[{\"watchAggregateOperator\":0}]}]]],[\"limebb-info-tile-date-format\",[[1,\"limebb-info-tile-date-format\",{\"value\":[16]}]]],[\"limebb-info-tile-decimal-format\",[[1,\"limebb-info-tile-decimal-format\",{\"value\":[16]}]]],[\"limebb-info-tile-format\",[[1,\"limebb-info-tile-format\",{\"platform\":[16],\"context\":[16],\"type\":[1],\"value\":[16]}]]],[\"limebb-info-tile-relative-date-format\",[[1,\"limebb-info-tile-relative-date-format\",{\"value\":[16]}]]],[\"limebb-info-tile-unit-format\",[[1,\"limebb-info-tile-unit-format\",{\"value\":[16]}]]],[\"limebb-loader\",[[1,\"limebb-loader\",{\"platform\":[16],\"context\":[16]}]]],[\"limebb-locale-picker\",[[1,\"limebb-locale-picker\",{\"platform\":[16],\"context\":[16],\"value\":[1],\"required\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"],\"readonly\":[4],\"multipleChoice\":[4,\"multiple-choice\"],\"allLanguages\":[32]}]]],[\"limebb-mention\",[[257,\"limebb-mention\",{\"limetype\":[1],\"objectid\":[2],\"limeobject\":[32]}]]],[\"limebb-mention-group-counter\",[[1,\"limebb-mention-group-counter\",{\"count\":[2],\"limetype\":[16],\"helperLabel\":[1,\"helper-label\"]}]]],[\"limebb-object-chip\",[[1,\"limebb-object-chip\",{\"limetype\":[1],\"objectid\":[2],\"size\":[1],\"platform\":[16],\"data\":[32]},null,{\"limetype\":[{\"handlePropChange\":0}],\"objectid\":[{\"handlePropChange\":0}]}]]],[\"limebb-rule-gate\",[[257,\"limebb-rule-gate\",{\"platform\":[16],\"rule\":[16],\"scope\":[16],\"shouldRender\":[32]},null,{\"rule\":[{\"onRuleChange\":0}],\"scope\":[{\"onScopeChange\":0}]}]]],[\"limebb-trend-indicator\",[[1,\"limebb-trend-indicator\",{\"platform\":[16],\"context\":[16],\"value\":[520],\"formerValue\":[514,\"former-value\"],\"suffix\":[513],\"label\":[513],\"invalid\":[516],\"required\":[516],\"helperText\":[513,\"helper-text\"],\"reducePresence\":[516,\"reduce-presence\"]},null,{\"value\":[{\"valueChanged\":0}]}]]],[\"limebb-feed-item-thumbnail-file-info\",[[1,\"limebb-feed-item-thumbnail-file-info\",{\"description\":[1]}]]],[\"limebb-feed-timeline-item\",[[1,\"limebb-feed-timeline-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"ui\":[513],\"helperText\":[1,\"helper-text\"],\"hasError\":[516,\"has-error\"],\"isBundled\":[516,\"is-bundled\"],\"headingCanExpand\":[32],\"isHeadingExpanded\":[32],\"showMore\":[32],\"isTall\":[32]}]]],[\"limebb-kanban-group\",[[1,\"limebb-kanban-group\",{\"platform\":[16],\"context\":[16],\"identifier\":[1],\"heading\":[513],\"help\":[1],\"items\":[16],\"summary\":[1],\"loading\":[516],\"totalCount\":[514,\"total-count\"]}]]],[\"limebb-document-item\",[[17,\"limebb-document-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"type\":[513],\"fileTypes\":[16]}]]],[\"limebb-empty-state\",[[1,\"limebb-empty-state\",{\"heading\":[513],\"value\":[513],\"icon\":[16]}]]],[\"limebb-text-editor-picker\",[[1,\"limebb-text-editor-picker\",{\"items\":[16],\"open\":[516],\"isSearching\":[4,\"is-searching\"],\"emptyMessage\":[1,\"empty-message\"]},null,{\"open\":[{\"watchOpen\":0}]}]]],[\"limebb-currency-picker\",[[1,\"limebb-currency-picker\",{\"platform\":[16],\"context\":[16],\"label\":[513],\"currencies\":[16],\"helperText\":[513,\"helper-text\"],\"required\":[516],\"readonly\":[516],\"invalid\":[516],\"disabled\":[516],\"value\":[1]}]]],[\"limebb-date-picker\",[[1,\"limebb-date-picker\",{\"platform\":[16],\"context\":[16],\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"label\":[513],\"placeholder\":[513],\"helperText\":[513,\"helper-text\"],\"required\":[516],\"value\":[1],\"type\":[513]}]]],[\"limebb-live-docs-info\",[[1,\"limebb-live-docs-info\"]]],[\"limebb-notification-item\",[[1,\"limebb-notification-item\",{\"platform\":[16],\"context\":[16],\"item\":[16]}]]],[\"limebb-percentage-visualizer\",[[1,\"limebb-percentage-visualizer\",{\"platform\":[16],\"context\":[16],\"value\":[520],\"rangeMax\":[514,\"range-max\"],\"rangeMin\":[514,\"range-min\"],\"multiplier\":[514],\"label\":[513],\"invalid\":[516],\"required\":[516],\"helperText\":[513,\"helper-text\"],\"reducePresence\":[516,\"reduce-presence\"],\"displayPercentageColors\":[516,\"display-percentage-colors\"]},null,{\"value\":[{\"valueChanged\":0}]}]]],[\"limebb-rule-chip-popover\",[[1,\"limebb-rule-chip-popover\",{\"platform\":[16],\"context\":[16],\"refNode\":[16],\"isNegated\":[4,\"is-negated\"],\"metadata\":[16],\"readonly\":[4],\"disabled\":[4],\"isMutable\":[4,\"is-mutable\"]}]]],[\"limebb-lime-query-filter-builder\",[[1,\"limebb-lime-query-filter-builder\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}]]],[\"limebb-kanban-item\",[[257,\"limebb-kanban-item\",{\"platform\":[16],\"context\":[16],\"item\":[16]}]]],[\"limebb-property-selector\",[[1,\"limebb-property-selector\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[1],\"label\":[1],\"required\":[4],\"helperText\":[1,\"helper-text\"],\"limetypes\":[32],\"isOpen\":[32],\"navigationPath\":[32]}]]],[\"limebb-lime-query-order-by-item\",[[1,\"limebb-lime-query-order-by-item\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"item\":[16]}]]],[\"limebb-lime-query-order-by-editor_2\",[[1,\"limebb-lime-query-order-by-editor\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"items\":[32]},null,{\"value\":[{\"handleValueChange\":0}]}],[0,\"limebb-limetype-field\",{\"platform\":[16],\"context\":[16],\"label\":[513],\"required\":[516],\"readonly\":[516],\"disabled\":[516],\"value\":[513],\"helperText\":[513,\"helper-text\"],\"invalid\":[4],\"limetypes\":[16],\"propertyFields\":[16],\"fieldName\":[1,\"field-name\"],\"formInfo\":[16]}]]],[\"limebb-chat-icon-list_3\",[[1,\"limebb-chat-icon-list\",{\"item\":[16]}],[1,\"limebb-chat-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"helperText\":[1,\"helper-text\"],\"hasError\":[516,\"has-error\"]}],[1,\"limebb-typing-indicator\"]]],[\"limebb-lime-query-response-format-editor_2\",[[1,\"limebb-lime-query-response-format-editor\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"items\":[32]}],[1,\"limebb-lime-query-response-format-item\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"item\":[16],\"showAliasInput\":[32],\"showDescriptionInput\":[32]}]]],[\"limebb-lime-query-filter-comparison_2\",[[1,\"limebb-lime-query-filter-expression\",{\"platform\":[16],\"context\":[16],\"label\":[1],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}],[1,\"limebb-lime-query-filter-comparison\",{\"platform\":[16],\"context\":[16],\"label\":[513],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}]]],[\"limebb-navigation-button_2\",[[257,\"limebb-summary-popover\",{\"triggerDelay\":[514,\"trigger-delay\"],\"heading\":[513],\"subheading\":[513],\"image\":[16],\"file\":[16],\"icon\":[513],\"value\":[1],\"openDirection\":[513,\"open-direction\"],\"popoverMaxWidth\":[513,\"popover-max-width\"],\"popoverMaxHeight\":[513,\"popover-max-height\"],\"actions\":[16],\"isPopoverOpen\":[32]}],[17,\"limebb-navigation-button\",{\"href\":[513],\"tooltipLabel\":[513,\"tooltip-label\"],\"tooltipHelperLabel\":[513,\"tooltip-helper-label\"],\"type\":[513]}]]],[\"limebb-lime-query-filter-group_3\",[[1,\"limebb-lime-query-value-input\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"propertyPath\":[1,\"property-path\"],\"operator\":[1],\"value\":[8],\"label\":[1],\"limetypes\":[32],\"inputMode\":[32]}],[1,\"limebb-lime-query-filter-group\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16],\"value\":[32]}],[1,\"limebb-lime-query-filter-not\",{\"platform\":[16],\"context\":[16],\"label\":[1],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}]]]]"), options);
20
+ return bootstrapLazy(JSON.parse("[[\"limebb-lime-query-builder\",[[1,\"limebb-lime-query-builder\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"label\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"limetypes\":[32],\"mode\":[32],\"codeValue\":[32],\"limetype\":[32],\"filter\":[32],\"internalResponseFormat\":[32],\"limit\":[32],\"orderBy\":[32],\"description\":[32]}]]],[\"limebb-rule-arg-filter-editor\",[[1,\"limebb-rule-arg-filter-editor\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"resolvedContext\":[32]}]]],[\"limebb-feed\",[[1,\"limebb-feed\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"emptyStateMessage\":[1,\"empty-state-message\"],\"heading\":[1],\"loading\":[4],\"minutesOfProximity\":[2,\"minutes-of-proximity\"],\"totalCount\":[2,\"total-count\"],\"direction\":[513],\"lastVisitedTimestamp\":[1,\"last-visited-timestamp\"],\"highlightedItemId\":[8,\"highlighted-item-id\"]},null,{\"highlightedItemId\":[{\"highlightedItemIdChanged\":0}]}]]],[\"limebb-kanban\",[[1,\"limebb-kanban\",{\"platform\":[16],\"context\":[16],\"groups\":[16]}]]],[\"limebb-chat-list\",[[1,\"limebb-chat-list\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"loading\":[516],\"isTypingIndicatorVisible\":[516,\"is-typing-indicator-visible\"],\"lastVisitedTimestamp\":[513,\"last-visited-timestamp\"],\"order\":[513]},null,{\"items\":[{\"handleItemsChange\":0}],\"order\":[{\"handleItemsChange\":0}]}]]],[\"limebb-lime-query-response-format-builder\",[[1,\"limebb-lime-query-response-format-builder\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"helperText\":[1,\"helper-text\"],\"limetypes\":[32],\"mode\":[32],\"codeValue\":[32],\"internalValue\":[32]}]]],[\"limebb-document-chips\",[[1,\"limebb-document-chips\",{\"accessibleLabel\":[513,\"accessible-label\"],\"files\":[16]},null,{\"files\":[{\"onFilesChanged\":0}]}]]],[\"limebb-limeobject-file-viewer\",[[1,\"limebb-limeobject-file-viewer\",{\"platform\":[16],\"context\":[16],\"property\":[1],\"fileTypes\":[16],\"limeobject\":[32],\"limetype\":[32]}]]],[\"limebb-text-editor\",[[17,\"limebb-text-editor\",{\"platform\":[16],\"context\":[16],\"allowMentioning\":[4,\"allow-mentioning\"],\"contentType\":[1,\"content-type\"],\"language\":[513],\"disabled\":[516],\"readonly\":[516],\"helperText\":[513,\"helper-text\"],\"placeholder\":[513],\"label\":[513],\"invalid\":[516],\"required\":[516],\"selectedContext\":[16],\"ui\":[513],\"allowResize\":[4,\"allow-resize\"],\"value\":[1],\"draftIdentifier\":[1,\"draft-identifier\"],\"triggerMap\":[16],\"customElements\":[16],\"allowInlineImages\":[4,\"allow-inline-images\"],\"items\":[32],\"highlightedItemIndex\":[32],\"editorPickerQuery\":[32],\"searchableLimetypes\":[32],\"isPickerOpen\":[32],\"isSearching\":[32]},null,{\"isPickerOpen\":[{\"watchOpen\":0}],\"editorPickerQuery\":[{\"watchQuery\":0}]}]]],[\"limebb-data-cells\",[[1,\"limebb-data-cells\",{\"platform\":[16],\"context\":[16],\"limeobject\":[8],\"items\":[16],\"image\":[16],\"relativeDates\":[4,\"relative-dates\"]}]]],[\"limebb-date-range\",[[1,\"limebb-date-range\",{\"platform\":[16],\"context\":[16],\"startTime\":[16],\"endTime\":[16],\"startTimeLabel\":[1,\"start-time-label\"],\"endTimeLabel\":[1,\"end-time-label\"],\"language\":[1],\"timeFormat\":[1,\"time-format\"],\"type\":[1]}]]],[\"limebb-document-picker\",[[1,\"limebb-document-picker\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"label\":[513],\"helperText\":[513,\"helper-text\"],\"invalid\":[516],\"required\":[516],\"type\":[513]}]]],[\"limebb-info-tile-currency-format\",[[1,\"limebb-info-tile-currency-format\",{\"platform\":[16],\"context\":[16],\"value\":[16]}]]],[\"limebb-notification-list\",[[1,\"limebb-notification-list\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"loading\":[4],\"lastVisitedTimestamp\":[1,\"last-visited-timestamp\"]},null,{\"items\":[{\"handleItemsChange\":0}]}]]],[\"limebb-rule-editor\",[[1,\"limebb-rule-editor\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"availableContexts\":[16],\"required\":[516],\"readonly\":[516],\"disabled\":[516],\"label\":[513],\"helperText\":[1,\"helper-text\"],\"issues\":[32],\"openChipPath\":[32],\"availablePrimitiveOptions\":[32]},null,{\"value\":[{\"onValueChange\":0}],\"availableContexts\":[{\"onAvailableContextsChange\":0}]}]]],[\"limebb-alert-dialog\",[[257,\"limebb-alert-dialog\",{\"type\":[513],\"open\":[516],\"icon\":[513],\"heading\":[513],\"subheading\":[1]}]]],[\"limebb-browser\",[[17,\"limebb-browser\",{\"platform\":[16],\"context\":[16],\"items\":[16],\"layout\":[1],\"filter\":[32]}]]],[\"limebb-color-palette-picker\",[[1,\"limebb-color-palette-picker\",{\"value\":[513],\"required\":[516],\"readonly\":[516],\"invalid\":[516],\"disabled\":[516],\"label\":[513],\"helperText\":[1,\"helper-text\"]}]]],[\"limebb-color-palette-swatches\",[[1,\"limebb-color-palette-swatches\",{\"colors\":[16]}]]],[\"limebb-component-config\",[[1,\"limebb-component-config\",{\"platform\":[16],\"context\":[16],\"value\":[16],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"],\"formInfo\":[16],\"type\":[1],\"nameField\":[1,\"name-field\"],\"configComponent\":[32],\"configViewType\":[32]},null,{\"formInfo\":[{\"watchFormInfo\":0}],\"configComponent\":[{\"watchconfigComponent\":0}]}]]],[\"limebb-component-picker\",[[1,\"limebb-component-picker\",{\"platform\":[16],\"context\":[16],\"type\":[1],\"tags\":[16],\"value\":[1],\"copyLabel\":[1,\"copy-label\"],\"hideCopyButton\":[4,\"hide-copy-button\"],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"]}]]],[\"limebb-composer-toolbar\",[[257,\"limebb-composer-toolbar\",{\"platform\":[16],\"mentions\":[516],\"textSnippets\":[516,\"text-snippets\"],\"internalLinks\":[516,\"internal-links\"],\"richText\":[516,\"rich-text\"],\"fileInput\":[16]}]]],[\"limebb-dashboard-widget\",[[257,\"limebb-dashboard-widget\",{\"heading\":[513],\"subheading\":[513],\"supportingText\":[513,\"supporting-text\"],\"icon\":[513]}]]],[\"limebb-icon-picker\",[[1,\"limebb-icon-picker\",{\"value\":[1],\"required\":[4],\"readonly\":[4],\"invalid\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"]}]]],[\"limebb-info-tile\",[[1,\"limebb-info-tile\",{\"platform\":[16],\"context\":[16],\"filterId\":[513,\"filter-id\"],\"disabled\":[4],\"icon\":[513],\"label\":[1],\"prefix\":[1],\"suffix\":[1],\"propertyName\":[1,\"property-name\"],\"aggregateOperator\":[1,\"aggregate-operator\"],\"format\":[16],\"config\":[32],\"filters\":[32],\"value\":[32],\"loading\":[32],\"error\":[32],\"limetypes\":[32]},null,{\"filterId\":[{\"watchFilterId\":0}],\"propertyName\":[{\"watchPropertyName\":0}],\"aggregateOperator\":[{\"watchAggregateOperator\":0}]}]]],[\"limebb-info-tile-date-format\",[[1,\"limebb-info-tile-date-format\",{\"value\":[16]}]]],[\"limebb-info-tile-decimal-format\",[[1,\"limebb-info-tile-decimal-format\",{\"value\":[16]}]]],[\"limebb-info-tile-format\",[[1,\"limebb-info-tile-format\",{\"platform\":[16],\"context\":[16],\"type\":[1],\"value\":[16]}]]],[\"limebb-info-tile-relative-date-format\",[[1,\"limebb-info-tile-relative-date-format\",{\"value\":[16]}]]],[\"limebb-info-tile-unit-format\",[[1,\"limebb-info-tile-unit-format\",{\"value\":[16]}]]],[\"limebb-loader\",[[1,\"limebb-loader\",{\"platform\":[16],\"context\":[16]}]]],[\"limebb-locale-picker\",[[1,\"limebb-locale-picker\",{\"platform\":[16],\"context\":[16],\"value\":[1],\"required\":[4],\"disabled\":[4],\"label\":[1],\"helperText\":[1,\"helper-text\"],\"readonly\":[4],\"multipleChoice\":[4,\"multiple-choice\"],\"allLanguages\":[32]}]]],[\"limebb-mention\",[[257,\"limebb-mention\",{\"limetype\":[1],\"objectid\":[2],\"limeobject\":[32]}]]],[\"limebb-mention-group-counter\",[[1,\"limebb-mention-group-counter\",{\"count\":[2],\"limetype\":[16],\"helperLabel\":[1,\"helper-label\"]}]]],[\"limebb-object-chip\",[[1,\"limebb-object-chip\",{\"limetype\":[1],\"objectid\":[2],\"size\":[1],\"platform\":[16],\"data\":[32]},null,{\"limetype\":[{\"handlePropChange\":0}],\"objectid\":[{\"handlePropChange\":0}]}]]],[\"limebb-rule-gate\",[[257,\"limebb-rule-gate\",{\"platform\":[16],\"rule\":[16],\"scope\":[16],\"shouldRender\":[32]},null,{\"rule\":[{\"onRuleChange\":0}],\"scope\":[{\"onScopeChange\":0}]}]]],[\"limebb-trend-indicator\",[[1,\"limebb-trend-indicator\",{\"platform\":[16],\"context\":[16],\"value\":[520],\"formerValue\":[514,\"former-value\"],\"suffix\":[513],\"label\":[513],\"invalid\":[516],\"required\":[516],\"helperText\":[513,\"helper-text\"],\"reducePresence\":[516,\"reduce-presence\"]},null,{\"value\":[{\"valueChanged\":0}]}]]],[\"limebb-feed-item-thumbnail-file-info\",[[1,\"limebb-feed-item-thumbnail-file-info\",{\"description\":[1]}]]],[\"limebb-feed-timeline-item\",[[1,\"limebb-feed-timeline-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"ui\":[513],\"helperText\":[1,\"helper-text\"],\"hasError\":[516,\"has-error\"],\"isBundled\":[516,\"is-bundled\"],\"headingCanExpand\":[32],\"isHeadingExpanded\":[32],\"showMore\":[32],\"isTall\":[32]}]]],[\"limebb-kanban-group\",[[1,\"limebb-kanban-group\",{\"platform\":[16],\"context\":[16],\"identifier\":[1],\"heading\":[513],\"help\":[1],\"items\":[16],\"summary\":[1],\"loading\":[516],\"totalCount\":[514,\"total-count\"]}]]],[\"limebb-document-item\",[[17,\"limebb-document-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"type\":[513],\"fileTypes\":[16]}]]],[\"limebb-empty-state\",[[1,\"limebb-empty-state\",{\"heading\":[513],\"value\":[513],\"icon\":[16]}]]],[\"limebb-text-editor-picker\",[[1,\"limebb-text-editor-picker\",{\"items\":[16],\"open\":[516],\"isSearching\":[4,\"is-searching\"],\"emptyMessage\":[1,\"empty-message\"]},null,{\"open\":[{\"watchOpen\":0}]}]]],[\"limebb-currency-picker\",[[1,\"limebb-currency-picker\",{\"platform\":[16],\"context\":[16],\"label\":[513],\"currencies\":[16],\"helperText\":[513,\"helper-text\"],\"required\":[516],\"readonly\":[516],\"invalid\":[516],\"disabled\":[516],\"value\":[1]}]]],[\"limebb-date-picker\",[[1,\"limebb-date-picker\",{\"platform\":[16],\"context\":[16],\"disabled\":[516],\"readonly\":[516],\"invalid\":[516],\"label\":[513],\"placeholder\":[513],\"helperText\":[513,\"helper-text\"],\"required\":[516],\"value\":[1],\"type\":[513]}]]],[\"limebb-live-docs-info\",[[1,\"limebb-live-docs-info\"]]],[\"limebb-notification-item\",[[1,\"limebb-notification-item\",{\"platform\":[16],\"context\":[16],\"item\":[16]}]]],[\"limebb-percentage-visualizer\",[[1,\"limebb-percentage-visualizer\",{\"platform\":[16],\"context\":[16],\"value\":[520],\"rangeMax\":[514,\"range-max\"],\"rangeMin\":[514,\"range-min\"],\"multiplier\":[514],\"label\":[513],\"invalid\":[516],\"required\":[516],\"helperText\":[513,\"helper-text\"],\"reducePresence\":[516,\"reduce-presence\"],\"displayPercentageColors\":[516,\"display-percentage-colors\"]},null,{\"value\":[{\"valueChanged\":0}]}]]],[\"limebb-rule-chip-popover\",[[1,\"limebb-rule-chip-popover\",{\"platform\":[16],\"context\":[16],\"refNode\":[16],\"isNegated\":[4,\"is-negated\"],\"metadata\":[16],\"readonly\":[4],\"disabled\":[4],\"isMutable\":[4,\"is-mutable\"]}]]],[\"limebb-lime-query-filter-builder\",[[1,\"limebb-lime-query-filter-builder\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}]]],[\"limebb-kanban-item\",[[257,\"limebb-kanban-item\",{\"platform\":[16],\"context\":[16],\"item\":[16]}]]],[\"limebb-property-selector\",[[1,\"limebb-property-selector\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[1],\"label\":[1],\"required\":[4],\"helperText\":[1,\"helper-text\"],\"limetypes\":[32],\"isOpen\":[32],\"navigationPath\":[32]}]]],[\"limebb-lime-query-order-by-item\",[[1,\"limebb-lime-query-order-by-item\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"item\":[16]}]]],[\"limebb-lime-query-order-by-editor_2\",[[1,\"limebb-lime-query-order-by-editor\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"items\":[32]},null,{\"value\":[{\"handleValueChange\":0}]}],[0,\"limebb-limetype-field\",{\"platform\":[16],\"context\":[16],\"label\":[513],\"required\":[516],\"readonly\":[516],\"disabled\":[516],\"value\":[513],\"helperText\":[513,\"helper-text\"],\"invalid\":[4],\"limetypes\":[16],\"propertyFields\":[16],\"fieldName\":[1,\"field-name\"],\"formInfo\":[16]}]]],[\"limebb-chat-icon-list_3\",[[1,\"limebb-chat-icon-list\",{\"item\":[16]}],[1,\"limebb-chat-item\",{\"platform\":[16],\"context\":[16],\"item\":[16],\"helperText\":[1,\"helper-text\"],\"hasError\":[516,\"has-error\"]}],[1,\"limebb-typing-indicator\"]]],[\"limebb-lime-query-response-format-editor_2\",[[1,\"limebb-lime-query-response-format-editor\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"value\":[16],\"label\":[1],\"items\":[32]}],[1,\"limebb-lime-query-response-format-item\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"item\":[16],\"showAliasInput\":[32],\"showDescriptionInput\":[32]}]]],[\"limebb-lime-query-filter-comparison_2\",[[1,\"limebb-lime-query-filter-expression\",{\"platform\":[16],\"context\":[16],\"label\":[1],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}],[1,\"limebb-lime-query-filter-comparison\",{\"platform\":[16],\"context\":[16],\"label\":[513],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}]]],[\"limebb-navigation-button_2\",[[257,\"limebb-summary-popover\",{\"triggerDelay\":[514,\"trigger-delay\"],\"heading\":[513],\"subheading\":[513],\"image\":[16],\"file\":[16],\"icon\":[513],\"value\":[1],\"openDirection\":[513,\"open-direction\"],\"popoverMaxWidth\":[513,\"popover-max-width\"],\"popoverMaxHeight\":[513,\"popover-max-height\"],\"actions\":[16],\"isPopoverOpen\":[32]}],[17,\"limebb-navigation-button\",{\"href\":[513],\"tooltipLabel\":[513,\"tooltip-label\"],\"tooltipHelperLabel\":[513,\"tooltip-helper-label\"],\"type\":[513]}]]],[\"limebb-lime-query-filter-group_3\",[[1,\"limebb-lime-query-value-input\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"propertyPath\":[1,\"property-path\"],\"operator\":[1],\"value\":[8],\"label\":[1],\"limetypes\":[32],\"inputMode\":[32]}],[1,\"limebb-lime-query-filter-group\",{\"platform\":[16],\"context\":[16],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16],\"value\":[32]}],[1,\"limebb-lime-query-filter-not\",{\"platform\":[16],\"context\":[16],\"label\":[1],\"limetype\":[1],\"activeLimetype\":[1,\"active-limetype\"],\"expression\":[16]}]]]]"), options);
21
21
  });
@@ -39,6 +39,20 @@ HighlightFeedItemCommand = __decorate([
39
39
  })
40
40
  ], HighlightFeedItemCommand);
41
41
 
42
+ const LIMEOBJECT_MATCHES_FILTER_ID = 'limetech.limeobject-matches-filter';
43
+ /**
44
+ * Attach `limebb-rule-arg-filter-editor` as the args editor for the
45
+ * `limeobject-matches-filter` primitive, so the rule editor renders the
46
+ * filter builder instead of a raw JSON field.
47
+ *
48
+ * @param registry - the platform's rule registry.
49
+ */
50
+ const attachRuleArgFilterEditorMetadata = (registry) => {
51
+ registry.attachMetadata(LIMEOBJECT_MATCHES_FILTER_ID, {
52
+ configComponent: { name: 'limebb-rule-arg-filter-editor' },
53
+ });
54
+ };
55
+
42
56
  const CrmComponentsLoader = class {
43
57
  constructor(hostRef) {
44
58
  registerInstance(this, hostRef);
@@ -49,6 +63,7 @@ const CrmComponentsLoader = class {
49
63
  const highlightFeedItemHandler = new HighlightFeedItemHandler();
50
64
  this.platform.register(HighlightFeedItemHandler.SERVICE_NAME, highlightFeedItemHandler);
51
65
  this.commandBus.register(HighlightFeedItemCommand, highlightFeedItemHandler);
66
+ attachRuleArgFilterEditorMetadata(this.platform.get(n.RuleRegistry));
52
67
  this.loaded.emit();
53
68
  }
54
69
  componentWillUpdate() { }
@@ -1,4 +1,4 @@
1
- import { h, r as registerInstance, c as createEvent } from './index-BIwHMk6j.js';
1
+ import { h, r as registerInstance, c as createEvent, g as getElement } from './index-BIwHMk6j.js';
2
2
  import { b as n } from './index.esm-CJU4N9K8.js';
3
3
 
4
4
  /**
@@ -172,6 +172,15 @@ function createPrimitiveOptions(metadataById, translator) {
172
172
  }))
173
173
  .sort((a, b) => a.text.localeCompare(b.text));
174
174
  }
175
+ /**
176
+ * Whether every context key a primitive reads is in the reachable set.
177
+ * A primitive that reads nothing is always covered.
178
+ * @param meta
179
+ * @param reachable
180
+ */
181
+ function primitiveReadsCovered(meta, reachable) {
182
+ return meta.reads.every((key) => reachable.has(key));
183
+ }
175
184
  /**
176
185
  * Find the picker item for `id`, falling back to a placeholder marked
177
186
  * with the unknown-primitive icon when the id isn't in the registry.
@@ -243,10 +252,10 @@ const GroupChipsView = ({ groupNode, groupPath, chipChildren, ctx }) => {
243
252
  const value = chipChildren.map((entry) => {
244
253
  const token = chipTokenFor(entry.index);
245
254
  chipsByToken.set(token, entry);
246
- const base = resolveItem(ctx.primitiveOptions, entry.ref.id);
255
+ const base = resolveItem(ctx.allPrimitiveOptions, entry.ref.id);
247
256
  return Object.assign(Object.assign({}, base), { text: entry.isNegated ? `¬ ${base.text}` : base.text, value: token });
248
257
  });
249
- const searcher = createSearcher(ctx.primitiveOptions);
258
+ const searcher = createSearcher(ctx.availablePrimitiveOptions);
250
259
  const openChip = findOpenChip(chipChildren, groupPath, ctx.openChipPath);
251
260
  const delimiter = groupNode.type === 'all' ? '&' : '|';
252
261
  return (h("limel-popover", { class: "rule-node__chips-popover", open: openChip !== null, openDirection: "bottom-start", onClose: ctx.onPopoverClose }, h("div", { slot: "trigger", class: "rule-node__chips" }, h("limel-picker", { multiple: true, label: ctx.translator.get('webclient.rule-editor.rules-label'), value: value, searcher: searcher, delimiter: delimiter, readonly: ctx.readonly, disabled: ctx.disabled, onChange: chipsChangeHandler(groupNode, groupPath, chipsByToken, ctx), onInteract: chipInteractHandler(groupPath, chipsByToken, ctx) })), h("div", null, renderChipPopoverContent(openChip, groupPath, ctx))));
@@ -473,8 +482,11 @@ const RuleEditor = class {
473
482
  this.issues = [];
474
483
  this.openChipPath = null;
475
484
  this.metadataById = new Map();
476
- this.primitiveOptions = [];
485
+ this.allPrimitiveOptions = [];
486
+ this.availablePrimitiveOptions = [];
487
+ this.reachableSlots = new Set();
477
488
  this.normalizedCache = null;
489
+ this.hasLoaded = false;
478
490
  this.handleDelete = (path) => {
479
491
  this.openChipPath = null;
480
492
  this.emitIfChanged(deleteNode(this.normalizedValue, path));
@@ -493,10 +505,30 @@ const RuleEditor = class {
493
505
  };
494
506
  }
495
507
  componentWillLoad() {
508
+ this.rebuildFromRegistries();
509
+ }
510
+ rebuildFromRegistries() {
511
+ this.computeReachableSlots();
496
512
  this.indexMetadata();
513
+ this.rebuildAvailableOptions();
514
+ this.runValidation();
515
+ }
516
+ /**
517
+ * Re-walk reachable slots when the editor is re-attached to the DOM,
518
+ * e.g. moved between surfaces. The reachable set depends on the host's
519
+ * ancestors, so a move can change which primitives the palette offers.
520
+ * Skipped on the first connect — `componentWillLoad` covers that.
521
+ */
522
+ connectedCallback() {
523
+ if (!this.hasLoaded) {
524
+ return;
525
+ }
526
+ this.computeReachableSlots();
527
+ this.rebuildAvailableOptions();
497
528
  this.runValidation();
498
529
  }
499
530
  componentDidLoad() {
531
+ this.hasLoaded = true;
500
532
  this.emitNormalization();
501
533
  }
502
534
  onValueChange() {
@@ -506,14 +538,14 @@ const RuleEditor = class {
506
538
  this.runValidation();
507
539
  }
508
540
  onAvailableContextsChange() {
509
- this.runValidation();
541
+ this.rebuildFromRegistries();
510
542
  }
511
543
  render() {
512
544
  const containerClasses = {
513
545
  'rule-editor': true,
514
546
  'rule-editor--disabled': this.disabled,
515
547
  };
516
- return (h("div", { key: '8e0da39f6544c86de0143e91a6c48c9f2654315f', class: containerClasses }, this.renderLabel(), h(RuleNodeView, { key: 'cd093f5dc5a9b747036f581e6230f1205cf834e6', node: this.normalizedValue, path: [], ctx: this.createRenderContext() }), this.renderHelperText()));
548
+ return (h("div", { key: 'dfdc801d8c0d48b8276b9d4cff8a4a2c0754c52f', class: containerClasses }, this.renderLabel(), h(RuleNodeView, { key: '250d53eba7681872f181003c709303238971be2a', node: this.normalizedValue, path: [], ctx: this.createRenderContext() }), this.renderHelperText()));
517
549
  }
518
550
  renderLabel() {
519
551
  if (!this.label) {
@@ -531,13 +563,14 @@ const RuleEditor = class {
531
563
  return {
532
564
  issues: this.issues,
533
565
  metadataById: this.metadataById,
534
- primitiveOptions: this.primitiveOptions,
566
+ allPrimitiveOptions: this.allPrimitiveOptions,
567
+ availablePrimitiveOptions: this.availablePrimitiveOptions,
535
568
  isMutable: !this.readonly && !this.disabled,
536
569
  readonly: this.readonly,
537
570
  disabled: this.disabled,
538
571
  platform: this.platform,
539
572
  context: this.context,
540
- translator: this.platform.get(n.Translate),
573
+ translator: this.translator,
541
574
  openChipPath: this.openChipPath,
542
575
  onDelete: this.handleDelete,
543
576
  onUpdateArgs: this.handleUpdateArgs,
@@ -550,14 +583,66 @@ const RuleEditor = class {
550
583
  var _a, _b, _c;
551
584
  const metadata = (_c = (_b = (_a = this.ruleRegistry).listMetadata) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : [];
552
585
  this.metadataById = new Map(metadata.map((item) => [item.id, item]));
553
- this.primitiveOptions = createPrimitiveOptions(this.metadataById, this.platform.get(n.Translate));
586
+ this.allPrimitiveOptions = createPrimitiveOptions(this.metadataById, this.translator);
587
+ }
588
+ /**
589
+ * Recompute the cached add-palette options. The inputs — indexed
590
+ * metadata, the reachable slot set, and the translator — only change
591
+ * in `rebuildFromRegistries` and `connectedCallback`, so caching here
592
+ * keeps `render` from rebuilding and sorting the list every pass.
593
+ */
594
+ rebuildAvailableOptions() {
595
+ this.availablePrimitiveOptions = createPrimitiveOptions(this.availablePrimitiveMetadata(), this.translator);
596
+ }
597
+ /**
598
+ * The subset of registered metadata offered for adding in the
599
+ * palette: primitives whose `reads` aren't fully covered by the
600
+ * reachable slots are dropped. Filtering only the palette — not the
601
+ * full `allPrimitiveOptions` — keeps already-placed chips resolving
602
+ * to their proper title even when their read slot isn't reachable.
603
+ */
604
+ availablePrimitiveMetadata() {
605
+ const filtered = new Map();
606
+ for (const [id, meta] of this.metadataById) {
607
+ if (primitiveReadsCovered(meta, this.reachableSlots)) {
608
+ filtered.set(id, meta);
609
+ }
610
+ }
611
+ return filtered;
612
+ }
613
+ /**
614
+ * Recompute the context slots reachable from the editor's mount
615
+ * point, unioning two sources:
616
+ *
617
+ * - the registered keys the resolver answers for — it walks the DOM
618
+ * from the host (and the session-wide fallbacks) the same way the
619
+ * runtime scope does, so a key resolves only when an ancestor
620
+ * actually provides it;
621
+ * - `availableContexts`, a hardcoded hint for keys (notably
622
+ * `limeobject`) that have no session-wide fallback and are provided
623
+ * by a different application than the one hosting the editor, so the
624
+ * DOM walk can't discover them.
625
+ */
626
+ computeReachableSlots() {
627
+ var _a;
628
+ const contextRegistry = this.contextRegistry;
629
+ const resolvable = contextRegistry
630
+ .list()
631
+ .map((metadata) => metadata.id)
632
+ .filter((key) => contextRegistry.get(key, this.host) !== undefined);
633
+ this.reachableSlots = new Set([
634
+ ...resolvable,
635
+ ...((_a = this.availableContexts) !== null && _a !== void 0 ? _a : []),
636
+ ]);
554
637
  }
555
638
  runValidation() {
556
639
  if (!this.value) {
557
640
  this.issues = [];
558
641
  return;
559
642
  }
560
- const result = this.ruleRegistry.validate(this.normalizedValue, this.availableContexts);
643
+ const result = this.ruleRegistry.validate(this.normalizedValue, [
644
+ ...this.reachableSlots,
645
+ ]);
561
646
  this.issues = result.ok ? [] : result.issues;
562
647
  }
563
648
  emitIfChanged(next) {
@@ -608,6 +693,13 @@ const RuleEditor = class {
608
693
  get ruleRegistry() {
609
694
  return this.platform.get(n.RuleRegistry);
610
695
  }
696
+ get translator() {
697
+ return this.platform.get(n.Translate);
698
+ }
699
+ get contextRegistry() {
700
+ return this.platform.get(n.ContextRegistry);
701
+ }
702
+ get host() { return getElement(this); }
611
703
  static get watchers() { return {
612
704
  "value": [{
613
705
  "onValueChange": 0