@limetech/lime-crm-building-blocks 1.103.1 → 1.103.2

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.103.2](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.103.1...v1.103.2) (2025-11-13)
2
+
3
+ ### Bug Fixes
4
+
5
+
6
+ * **response-format-builder:** allow empty object as valid format ([4f32e2e](https://github.com/Lundalogik/lime-crm-building-blocks/commit/4f32e2e92260c5e1825b7f29d33771cb6f64d540)), closes [Lundalogik/crm-insights-and-intelligence#138](https://github.com/Lundalogik/crm-insights-and-intelligence/issues/138)
7
+
1
8
  ## [1.103.1](https://github.com/Lundalogik/lime-crm-building-blocks/compare/v1.103.0...v1.103.1) (2025-11-12)
2
9
 
3
10
  ### Bug Fixes
@@ -41,7 +41,9 @@ function parseResponseFormat(json) {
41
41
  `Only 'object' and 'aggregates' are allowed.`);
42
42
  }
43
43
  // Must have at least one of object or aggregates
44
- if (!parsed.object && !parsed.aggregates) {
44
+ // Note: Empty objects {} are valid (starting point for GUI mode)
45
+ const hasProperties = keys.length > 0;
46
+ if (hasProperties && !parsed.object && !parsed.aggregates) {
45
47
  throw new Error('Response format must contain at least one of: object, aggregates');
46
48
  }
47
49
  return parsed;
@@ -163,7 +163,7 @@ function itemsToPropertySelection(items) {
163
163
  return result;
164
164
  }
165
165
 
166
- const responseFormatEditorCss = ":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;padding:1rem 0}limel-badge[slot=actions]{--badge-background-color:rgb(var(--contrast-200));margin-right:0.25rem}.property{border:1px solid var(--header-background-color);border-radius:0 0 0.75rem 0.75rem}.property-list{display:flex;flex-direction:column;border-radius:0.25rem;background-color:rgb(var(--contrast-100));gap:0.5rem;padding:0.5rem}.property-item{border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex}.actions limel-button{padding:0.5rem;width:100%}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}";
166
+ const responseFormatEditorCss = ":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;padding:1rem 0}limel-badge[slot=actions]{--badge-background-color:rgb(var(--contrast-200));margin-right:0.25rem}.property{border:1px solid var(--header-background-color);border-radius:0 0 0.75rem 0.75rem}.property-list{display:flex;flex-direction:column;border-radius:0.25rem;background-color:rgb(var(--contrast-100));gap:0.5rem;padding:0.5rem}.property-item{border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex}.actions limel-button{padding:0.5rem;width:100%}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}.empty-state .empty-state-message{margin-bottom:1rem;font-size:0.875rem}.empty-state limel-button{margin:0 auto;max-width:200px}";
167
167
  const LimebbLimeQueryResponseFormatEditorStyle0 = responseFormatEditorCss;
168
168
 
169
169
  const ResponseFormatEditor = class {
@@ -174,7 +174,7 @@ const ResponseFormatEditor = class {
174
174
  * Optional label
175
175
  */
176
176
  this.label = 'Properties';
177
- this.items = [{ path: '_id' }];
177
+ this.items = [];
178
178
  this.handleItemChange = (index) => (event) => {
179
179
  event.stopPropagation();
180
180
  const newItems = [...this.items];
@@ -186,10 +186,7 @@ const ResponseFormatEditor = class {
186
186
  // Update item
187
187
  newItems[index] = event.detail;
188
188
  }
189
- // Ensure we always have at least _id
190
- if (newItems.length === 0) {
191
- newItems.push({ path: '_id' });
192
- }
189
+ // Allow empty items - users can remove all properties
193
190
  this.items = newItems;
194
191
  this.emitChange();
195
192
  };
@@ -200,16 +197,45 @@ const ResponseFormatEditor = class {
200
197
  }
201
198
  componentWillLoad() {
202
199
  var _a;
203
- if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
200
+ // Check if value is truly empty ({}) - no object or aggregates
201
+ const isTrulyEmpty = this.value &&
202
+ Object.keys(this.value).length === 0 &&
203
+ !this.value.object &&
204
+ !this.value.aggregates;
205
+ if (isTrulyEmpty) {
206
+ // Keep items empty for truly empty objects
207
+ this.items = [];
208
+ }
209
+ else if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
204
210
  const converted = propertySelectionToItems(this.value.object);
205
211
  if (converted.length > 0) {
206
212
  this.items = converted;
207
213
  }
214
+ else {
215
+ // Empty object property, but not a truly empty value
216
+ // Use default _id for backward compatibility
217
+ this.items = [{ path: '_id' }];
218
+ }
219
+ }
220
+ else if (!this.value) {
221
+ // No value provided at all, use default _id
222
+ this.items = [{ path: '_id' }];
208
223
  }
209
224
  }
210
225
  componentWillUpdate() {
211
226
  var _a;
212
- if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
227
+ // Check if value is truly empty ({})
228
+ const isTrulyEmpty = this.value &&
229
+ Object.keys(this.value).length === 0 &&
230
+ !this.value.object &&
231
+ !this.value.aggregates;
232
+ if (isTrulyEmpty) {
233
+ // Keep items empty for truly empty objects
234
+ if (this.items.length > 0) {
235
+ this.items = [];
236
+ }
237
+ }
238
+ else if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
213
239
  const currentItems = propertySelectionToItems(this.value.object);
214
240
  // Check if items have changed
215
241
  const itemsChanged = currentItems.length !== this.items.length ||
@@ -221,8 +247,8 @@ const ResponseFormatEditor = class {
221
247
  item.description === current.description);
222
248
  });
223
249
  if (itemsChanged) {
224
- this.items =
225
- currentItems.length > 0 ? currentItems : [{ path: '_id' }];
250
+ // Allow empty items array - don't force _id
251
+ this.items = currentItems;
226
252
  }
227
253
  }
228
254
  }
@@ -230,6 +256,10 @@ const ResponseFormatEditor = class {
230
256
  if (!this.limetype) {
231
257
  return (index.h("div", { class: "empty-state" }, index.h("p", null, "Select a limetype to choose properties")));
232
258
  }
259
+ // Render empty state when no properties are selected
260
+ if (this.items.length === 0) {
261
+ return (index.h("div", { class: "response-format-editor" }, index.h("h4", { class: "header" }, this.label), index.h("div", { class: "empty-state" }, index.h("p", { class: "empty-state-message" }, "No properties selected. The response will return empty objects."), index.h("limel-button", { label: "Add Property", icon: "plus_math", onClick: this.handleAddProperty }))));
262
+ }
233
263
  return (index.h("div", { class: "response-format-editor" }, index.h("limel-header", { subheading: this.label }, this.renderPropertyCount()), index.h("div", { class: "property" }, index.h("div", { class: "property-list" }, this.items.map((item, index) => this.renderItem(item, index))), index.h("div", { class: "actions" }, index.h("limel-button", { label: "Property", icon: {
234
264
  name: 'plus_math',
235
265
  title: 'Add',
@@ -52,4 +52,12 @@ limel-badge[slot=actions] {
52
52
  }
53
53
  .empty-state p {
54
54
  margin: 0;
55
+ }
56
+ .empty-state .empty-state-message {
57
+ margin-bottom: 1rem;
58
+ font-size: 0.875rem;
59
+ }
60
+ .empty-state limel-button {
61
+ margin: 0 auto;
62
+ max-width: 200px;
55
63
  }
@@ -25,7 +25,7 @@ export class ResponseFormatEditor {
25
25
  * Optional label
26
26
  */
27
27
  this.label = 'Properties';
28
- this.items = [{ path: '_id' }];
28
+ this.items = [];
29
29
  this.handleItemChange = (index) => (event) => {
30
30
  event.stopPropagation();
31
31
  const newItems = [...this.items];
@@ -37,10 +37,7 @@ export class ResponseFormatEditor {
37
37
  // Update item
38
38
  newItems[index] = event.detail;
39
39
  }
40
- // Ensure we always have at least _id
41
- if (newItems.length === 0) {
42
- newItems.push({ path: '_id' });
43
- }
40
+ // Allow empty items - users can remove all properties
44
41
  this.items = newItems;
45
42
  this.emitChange();
46
43
  };
@@ -51,16 +48,45 @@ export class ResponseFormatEditor {
51
48
  }
52
49
  componentWillLoad() {
53
50
  var _a;
54
- if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
51
+ // Check if value is truly empty ({}) - no object or aggregates
52
+ const isTrulyEmpty = this.value &&
53
+ Object.keys(this.value).length === 0 &&
54
+ !this.value.object &&
55
+ !this.value.aggregates;
56
+ if (isTrulyEmpty) {
57
+ // Keep items empty for truly empty objects
58
+ this.items = [];
59
+ }
60
+ else if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
55
61
  const converted = propertySelectionToItems(this.value.object);
56
62
  if (converted.length > 0) {
57
63
  this.items = converted;
58
64
  }
65
+ else {
66
+ // Empty object property, but not a truly empty value
67
+ // Use default _id for backward compatibility
68
+ this.items = [{ path: '_id' }];
69
+ }
70
+ }
71
+ else if (!this.value) {
72
+ // No value provided at all, use default _id
73
+ this.items = [{ path: '_id' }];
59
74
  }
60
75
  }
61
76
  componentWillUpdate() {
62
77
  var _a;
63
- if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
78
+ // Check if value is truly empty ({})
79
+ const isTrulyEmpty = this.value &&
80
+ Object.keys(this.value).length === 0 &&
81
+ !this.value.object &&
82
+ !this.value.aggregates;
83
+ if (isTrulyEmpty) {
84
+ // Keep items empty for truly empty objects
85
+ if (this.items.length > 0) {
86
+ this.items = [];
87
+ }
88
+ }
89
+ else if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
64
90
  const currentItems = propertySelectionToItems(this.value.object);
65
91
  // Check if items have changed
66
92
  const itemsChanged = currentItems.length !== this.items.length ||
@@ -72,8 +98,8 @@ export class ResponseFormatEditor {
72
98
  item.description === current.description);
73
99
  });
74
100
  if (itemsChanged) {
75
- this.items =
76
- currentItems.length > 0 ? currentItems : [{ path: '_id' }];
101
+ // Allow empty items array - don't force _id
102
+ this.items = currentItems;
77
103
  }
78
104
  }
79
105
  }
@@ -81,6 +107,10 @@ export class ResponseFormatEditor {
81
107
  if (!this.limetype) {
82
108
  return (h("div", { class: "empty-state" }, h("p", null, "Select a limetype to choose properties")));
83
109
  }
110
+ // Render empty state when no properties are selected
111
+ if (this.items.length === 0) {
112
+ return (h("div", { class: "response-format-editor" }, h("h4", { class: "header" }, this.label), h("div", { class: "empty-state" }, h("p", { class: "empty-state-message" }, "No properties selected. The response will return empty objects."), h("limel-button", { label: "Add Property", icon: "plus_math", onClick: this.handleAddProperty }))));
113
+ }
84
114
  return (h("div", { class: "response-format-editor" }, h("limel-header", { subheading: this.label }, this.renderPropertyCount()), h("div", { class: "property" }, h("div", { class: "property-list" }, this.items.map((item, index) => this.renderItem(item, index))), h("div", { class: "actions" }, h("limel-button", { label: "Property", icon: {
85
115
  name: 'plus_math',
86
116
  title: 'Add',
@@ -32,7 +32,9 @@ export function parseResponseFormat(json) {
32
32
  `Only 'object' and 'aggregates' are allowed.`);
33
33
  }
34
34
  // Must have at least one of object or aggregates
35
- if (!parsed.object && !parsed.aggregates) {
35
+ // Note: Empty objects {} are valid (starting point for GUI mode)
36
+ const hasProperties = keys.length > 0;
37
+ if (hasProperties && !parsed.object && !parsed.aggregates) {
36
38
  throw new Error('Response format must contain at least one of: object, aggregates');
37
39
  }
38
40
  return parsed;
@@ -82,7 +84,9 @@ export function isValidResponseFormatStructure(json) {
82
84
  };
83
85
  }
84
86
  // Must have at least one of object or aggregates
85
- if (!json.object && !json.aggregates) {
87
+ // Note: Empty objects {} are valid (starting point for GUI mode)
88
+ const hasProperties = keys.length > 0;
89
+ if (hasProperties && !json.object && !json.aggregates) {
86
90
  return {
87
91
  valid: false,
88
92
  error: 'Response format must contain at least one of: object, aggregates',
@@ -39,7 +39,9 @@ function parseResponseFormat(json) {
39
39
  `Only 'object' and 'aggregates' are allowed.`);
40
40
  }
41
41
  // Must have at least one of object or aggregates
42
- if (!parsed.object && !parsed.aggregates) {
42
+ // Note: Empty objects {} are valid (starting point for GUI mode)
43
+ const hasProperties = keys.length > 0;
44
+ if (hasProperties && !parsed.object && !parsed.aggregates) {
43
45
  throw new Error('Response format must contain at least one of: object, aggregates');
44
46
  }
45
47
  return parsed;
@@ -161,7 +161,7 @@ function itemsToPropertySelection(items) {
161
161
  return result;
162
162
  }
163
163
 
164
- const responseFormatEditorCss = ":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;padding:1rem 0}limel-badge[slot=actions]{--badge-background-color:rgb(var(--contrast-200));margin-right:0.25rem}.property{border:1px solid var(--header-background-color);border-radius:0 0 0.75rem 0.75rem}.property-list{display:flex;flex-direction:column;border-radius:0.25rem;background-color:rgb(var(--contrast-100));gap:0.5rem;padding:0.5rem}.property-item{border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex}.actions limel-button{padding:0.5rem;width:100%}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}";
164
+ const responseFormatEditorCss = ":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;padding:1rem 0}limel-badge[slot=actions]{--badge-background-color:rgb(var(--contrast-200));margin-right:0.25rem}.property{border:1px solid var(--header-background-color);border-radius:0 0 0.75rem 0.75rem}.property-list{display:flex;flex-direction:column;border-radius:0.25rem;background-color:rgb(var(--contrast-100));gap:0.5rem;padding:0.5rem}.property-item{border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex}.actions limel-button{padding:0.5rem;width:100%}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}.empty-state .empty-state-message{margin-bottom:1rem;font-size:0.875rem}.empty-state limel-button{margin:0 auto;max-width:200px}";
165
165
  const LimebbLimeQueryResponseFormatEditorStyle0 = responseFormatEditorCss;
166
166
 
167
167
  const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseFormatEditor extends HTMLElement {
@@ -174,7 +174,7 @@ const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseForm
174
174
  * Optional label
175
175
  */
176
176
  this.label = 'Properties';
177
- this.items = [{ path: '_id' }];
177
+ this.items = [];
178
178
  this.handleItemChange = (index) => (event) => {
179
179
  event.stopPropagation();
180
180
  const newItems = [...this.items];
@@ -186,10 +186,7 @@ const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseForm
186
186
  // Update item
187
187
  newItems[index] = event.detail;
188
188
  }
189
- // Ensure we always have at least _id
190
- if (newItems.length === 0) {
191
- newItems.push({ path: '_id' });
192
- }
189
+ // Allow empty items - users can remove all properties
193
190
  this.items = newItems;
194
191
  this.emitChange();
195
192
  };
@@ -200,16 +197,45 @@ const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseForm
200
197
  }
201
198
  componentWillLoad() {
202
199
  var _a;
203
- if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
200
+ // Check if value is truly empty ({}) - no object or aggregates
201
+ const isTrulyEmpty = this.value &&
202
+ Object.keys(this.value).length === 0 &&
203
+ !this.value.object &&
204
+ !this.value.aggregates;
205
+ if (isTrulyEmpty) {
206
+ // Keep items empty for truly empty objects
207
+ this.items = [];
208
+ }
209
+ else if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
204
210
  const converted = propertySelectionToItems(this.value.object);
205
211
  if (converted.length > 0) {
206
212
  this.items = converted;
207
213
  }
214
+ else {
215
+ // Empty object property, but not a truly empty value
216
+ // Use default _id for backward compatibility
217
+ this.items = [{ path: '_id' }];
218
+ }
219
+ }
220
+ else if (!this.value) {
221
+ // No value provided at all, use default _id
222
+ this.items = [{ path: '_id' }];
208
223
  }
209
224
  }
210
225
  componentWillUpdate() {
211
226
  var _a;
212
- if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
227
+ // Check if value is truly empty ({})
228
+ const isTrulyEmpty = this.value &&
229
+ Object.keys(this.value).length === 0 &&
230
+ !this.value.object &&
231
+ !this.value.aggregates;
232
+ if (isTrulyEmpty) {
233
+ // Keep items empty for truly empty objects
234
+ if (this.items.length > 0) {
235
+ this.items = [];
236
+ }
237
+ }
238
+ else if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
213
239
  const currentItems = propertySelectionToItems(this.value.object);
214
240
  // Check if items have changed
215
241
  const itemsChanged = currentItems.length !== this.items.length ||
@@ -221,8 +247,8 @@ const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseForm
221
247
  item.description === current.description);
222
248
  });
223
249
  if (itemsChanged) {
224
- this.items =
225
- currentItems.length > 0 ? currentItems : [{ path: '_id' }];
250
+ // Allow empty items array - don't force _id
251
+ this.items = currentItems;
226
252
  }
227
253
  }
228
254
  }
@@ -230,6 +256,10 @@ const ResponseFormatEditor = /*@__PURE__*/ proxyCustomElement(class ResponseForm
230
256
  if (!this.limetype) {
231
257
  return (h("div", { class: "empty-state" }, h("p", null, "Select a limetype to choose properties")));
232
258
  }
259
+ // Render empty state when no properties are selected
260
+ if (this.items.length === 0) {
261
+ return (h("div", { class: "response-format-editor" }, h("h4", { class: "header" }, this.label), h("div", { class: "empty-state" }, h("p", { class: "empty-state-message" }, "No properties selected. The response will return empty objects."), h("limel-button", { label: "Add Property", icon: "plus_math", onClick: this.handleAddProperty }))));
262
+ }
233
263
  return (h("div", { class: "response-format-editor" }, h("limel-header", { subheading: this.label }, this.renderPropertyCount()), h("div", { class: "property" }, h("div", { class: "property-list" }, this.items.map((item, index) => this.renderItem(item, index))), h("div", { class: "actions" }, h("limel-button", { label: "Property", icon: {
234
264
  name: 'plus_math',
235
265
  title: 'Add',
@@ -37,7 +37,9 @@ function parseResponseFormat(json) {
37
37
  `Only 'object' and 'aggregates' are allowed.`);
38
38
  }
39
39
  // Must have at least one of object or aggregates
40
- if (!parsed.object && !parsed.aggregates) {
40
+ // Note: Empty objects {} are valid (starting point for GUI mode)
41
+ const hasProperties = keys.length > 0;
42
+ if (hasProperties && !parsed.object && !parsed.aggregates) {
41
43
  throw new Error('Response format must contain at least one of: object, aggregates');
42
44
  }
43
45
  return parsed;
@@ -159,7 +159,7 @@ function itemsToPropertySelection(items) {
159
159
  return result;
160
160
  }
161
161
 
162
- const responseFormatEditorCss = ":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;padding:1rem 0}limel-badge[slot=actions]{--badge-background-color:rgb(var(--contrast-200));margin-right:0.25rem}.property{border:1px solid var(--header-background-color);border-radius:0 0 0.75rem 0.75rem}.property-list{display:flex;flex-direction:column;border-radius:0.25rem;background-color:rgb(var(--contrast-100));gap:0.5rem;padding:0.5rem}.property-item{border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex}.actions limel-button{padding:0.5rem;width:100%}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}";
162
+ const responseFormatEditorCss = ":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;padding:1rem 0}limel-badge[slot=actions]{--badge-background-color:rgb(var(--contrast-200));margin-right:0.25rem}.property{border:1px solid var(--header-background-color);border-radius:0 0 0.75rem 0.75rem}.property-list{display:flex;flex-direction:column;border-radius:0.25rem;background-color:rgb(var(--contrast-100));gap:0.5rem;padding:0.5rem}.property-item{border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex}.actions limel-button{padding:0.5rem;width:100%}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}.empty-state .empty-state-message{margin-bottom:1rem;font-size:0.875rem}.empty-state limel-button{margin:0 auto;max-width:200px}";
163
163
  const LimebbLimeQueryResponseFormatEditorStyle0 = responseFormatEditorCss;
164
164
 
165
165
  const ResponseFormatEditor = class {
@@ -170,7 +170,7 @@ const ResponseFormatEditor = class {
170
170
  * Optional label
171
171
  */
172
172
  this.label = 'Properties';
173
- this.items = [{ path: '_id' }];
173
+ this.items = [];
174
174
  this.handleItemChange = (index) => (event) => {
175
175
  event.stopPropagation();
176
176
  const newItems = [...this.items];
@@ -182,10 +182,7 @@ const ResponseFormatEditor = class {
182
182
  // Update item
183
183
  newItems[index] = event.detail;
184
184
  }
185
- // Ensure we always have at least _id
186
- if (newItems.length === 0) {
187
- newItems.push({ path: '_id' });
188
- }
185
+ // Allow empty items - users can remove all properties
189
186
  this.items = newItems;
190
187
  this.emitChange();
191
188
  };
@@ -196,16 +193,45 @@ const ResponseFormatEditor = class {
196
193
  }
197
194
  componentWillLoad() {
198
195
  var _a;
199
- if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
196
+ // Check if value is truly empty ({}) - no object or aggregates
197
+ const isTrulyEmpty = this.value &&
198
+ Object.keys(this.value).length === 0 &&
199
+ !this.value.object &&
200
+ !this.value.aggregates;
201
+ if (isTrulyEmpty) {
202
+ // Keep items empty for truly empty objects
203
+ this.items = [];
204
+ }
205
+ else if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
200
206
  const converted = propertySelectionToItems(this.value.object);
201
207
  if (converted.length > 0) {
202
208
  this.items = converted;
203
209
  }
210
+ else {
211
+ // Empty object property, but not a truly empty value
212
+ // Use default _id for backward compatibility
213
+ this.items = [{ path: '_id' }];
214
+ }
215
+ }
216
+ else if (!this.value) {
217
+ // No value provided at all, use default _id
218
+ this.items = [{ path: '_id' }];
204
219
  }
205
220
  }
206
221
  componentWillUpdate() {
207
222
  var _a;
208
- if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
223
+ // Check if value is truly empty ({})
224
+ const isTrulyEmpty = this.value &&
225
+ Object.keys(this.value).length === 0 &&
226
+ !this.value.object &&
227
+ !this.value.aggregates;
228
+ if (isTrulyEmpty) {
229
+ // Keep items empty for truly empty objects
230
+ if (this.items.length > 0) {
231
+ this.items = [];
232
+ }
233
+ }
234
+ else if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.object) {
209
235
  const currentItems = propertySelectionToItems(this.value.object);
210
236
  // Check if items have changed
211
237
  const itemsChanged = currentItems.length !== this.items.length ||
@@ -217,8 +243,8 @@ const ResponseFormatEditor = class {
217
243
  item.description === current.description);
218
244
  });
219
245
  if (itemsChanged) {
220
- this.items =
221
- currentItems.length > 0 ? currentItems : [{ path: '_id' }];
246
+ // Allow empty items array - don't force _id
247
+ this.items = currentItems;
222
248
  }
223
249
  }
224
250
  }
@@ -226,6 +252,10 @@ const ResponseFormatEditor = class {
226
252
  if (!this.limetype) {
227
253
  return (h("div", { class: "empty-state" }, h("p", null, "Select a limetype to choose properties")));
228
254
  }
255
+ // Render empty state when no properties are selected
256
+ if (this.items.length === 0) {
257
+ return (h("div", { class: "response-format-editor" }, h("h4", { class: "header" }, this.label), h("div", { class: "empty-state" }, h("p", { class: "empty-state-message" }, "No properties selected. The response will return empty objects."), h("limel-button", { label: "Add Property", icon: "plus_math", onClick: this.handleAddProperty }))));
258
+ }
229
259
  return (h("div", { class: "response-format-editor" }, h("limel-header", { subheading: this.label }, this.renderPropertyCount()), h("div", { class: "property" }, h("div", { class: "property-list" }, this.items.map((item, index) => this.renderItem(item, index))), h("div", { class: "actions" }, h("limel-button", { label: "Property", icon: {
230
260
  name: 'plus_math',
231
261
  title: 'Add',
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-1556b545.js";export{s as setNonce}from"./p-1556b545.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t(JSON.parse('[["p-d18697e3",[[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]}]]],["p-ee1b00b9",[[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"]}]]],["p-3a406a20",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-2d5f83bc",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-32534eb7",[[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"]}]]],["p-03af0e66",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-6f6fed59",[[1,"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"],"editorPickerQuery":["watchQuery"]}]]],["p-8491aaa1",[[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]}]]],["p-4a82410e",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-568b7520",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-2fdcb868",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":["handleItemsChange"]}]]],["p-5464f0de",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-3175883d",[[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"],"configComponent":["watchconfigComponent"]}]]],["p-1be0eec7",[[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"]}]]],["p-10ac8b3e",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-e35299e0",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-a200954f",[[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]},null,{"filterId":["watchFilterId"],"propertyName":["watchPropertyName"],"aggregateOperator":["watchAggregateOperator"]}]]],["p-01cff04f",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-4caa8bbe",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-ff0b244b",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-25e1a434",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-6c56121c",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-206575e4",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-0de79b7f",[[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]}]]],["p-cfa1a4ad",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-d0721b22",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-3d1be1c9",[[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"]}]]],["p-577d8909",[[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"]}]]],["p-7271f47a",[[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]}]]],["p-eb81bceb",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-2faaacbc",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-218b7f38",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":["watchOpen"]}]]],["p-9031f136",[[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]}]]],["p-098ee6c1",[[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]}]]],["p-9d25ed5a",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513]}]]],["p-a9ac501f",[[1,"limebb-live-docs-info"]]],["p-0f7135ff",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-5c693302",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-5dc574a3",[[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-61282e1a",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-81dbda15",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":["handleValueChange"]}],[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]}]]],["p-292631ea",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-d8696b23",[[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]}]]],["p-a5bd74fb",[[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]}]]],["p-7e5528f6",[[1,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[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]}]]],["p-91074d93",[[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]}]]],["p-18e9e1bc",[[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":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]]]'),e))));
1
+ import{p as e,b as t}from"./p-1556b545.js";export{s as setNonce}from"./p-1556b545.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t(JSON.parse('[["p-d18697e3",[[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]}]]],["p-ee1b00b9",[[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"]}]]],["p-3a406a20",[[1,"limebb-kanban",{"platform":[16],"context":[16],"groups":[16]}]]],["p-f92ca0b8",[[1,"limebb-lime-query-response-format-builder",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"limetypes":[32],"mode":[32],"codeValue":[32],"internalValue":[32]}]]],["p-32534eb7",[[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"]}]]],["p-03af0e66",[[1,"limebb-limeobject-file-viewer",{"platform":[16],"context":[16],"property":[1],"fileTypes":[16],"limeobject":[32],"limetype":[32]}]]],["p-6f6fed59",[[1,"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"],"editorPickerQuery":["watchQuery"]}]]],["p-8491aaa1",[[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]}]]],["p-4a82410e",[[1,"limebb-document-picker",{"platform":[16],"context":[16],"items":[16],"label":[513],"helperText":[513,"helper-text"],"invalid":[516],"required":[516],"type":[513]}]]],["p-568b7520",[[1,"limebb-info-tile-currency-format",{"platform":[16],"context":[16],"value":[16]}]]],["p-2fdcb868",[[1,"limebb-notification-list",{"platform":[16],"context":[16],"items":[16],"loading":[4],"lastVisitedTimestamp":[1,"last-visited-timestamp"]},null,{"items":["handleItemsChange"]}]]],["p-5464f0de",[[17,"limebb-browser",{"platform":[16],"context":[16],"items":[16],"layout":[1],"filter":[32]}]]],["p-3175883d",[[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"],"configComponent":["watchconfigComponent"]}]]],["p-1be0eec7",[[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"]}]]],["p-10ac8b3e",[[1,"limebb-dashboard-widget",{"heading":[513],"subheading":[513],"supportingText":[513,"supporting-text"],"icon":[513]}]]],["p-e35299e0",[[1,"limebb-icon-picker",{"value":[1],"required":[4],"readonly":[4],"invalid":[4],"disabled":[4],"label":[1],"helperText":[1,"helper-text"]}]]],["p-a200954f",[[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]},null,{"filterId":["watchFilterId"],"propertyName":["watchPropertyName"],"aggregateOperator":["watchAggregateOperator"]}]]],["p-01cff04f",[[1,"limebb-info-tile-date-format",{"value":[16]}]]],["p-4caa8bbe",[[1,"limebb-info-tile-decimal-format",{"value":[16]}]]],["p-ff0b244b",[[1,"limebb-info-tile-format",{"platform":[16],"context":[16],"type":[1],"value":[16]}]]],["p-25e1a434",[[1,"limebb-info-tile-relative-date-format",{"value":[16]}]]],["p-6c56121c",[[1,"limebb-info-tile-unit-format",{"value":[16]}]]],["p-206575e4",[[1,"limebb-loader",{"platform":[16],"context":[16]}]]],["p-0de79b7f",[[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]}]]],["p-cfa1a4ad",[[1,"limebb-mention",{"limetype":[1],"objectid":[2],"limeobject":[32]}]]],["p-d0721b22",[[1,"limebb-mention-group-counter",{"count":[2],"limetype":[16],"helperLabel":[1,"helper-label"]}]]],["p-3d1be1c9",[[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"]}]]],["p-577d8909",[[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"]}]]],["p-7271f47a",[[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]}]]],["p-eb81bceb",[[1,"limebb-kanban-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-2faaacbc",[[1,"limebb-kanban-group",{"platform":[16],"context":[16],"identifier":[1],"heading":[513],"help":[1],"items":[16],"summary":[1],"loading":[516],"totalCount":[514,"total-count"]}]]],["p-218b7f38",[[1,"limebb-text-editor-picker",{"items":[16],"open":[516],"isSearching":[4,"is-searching"],"emptyMessage":[1,"empty-message"]},null,{"open":["watchOpen"]}]]],["p-9031f136",[[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]}]]],["p-098ee6c1",[[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]}]]],["p-9d25ed5a",[[17,"limebb-document-item",{"platform":[16],"context":[16],"item":[16],"type":[513]}]]],["p-a9ac501f",[[1,"limebb-live-docs-info"]]],["p-0f7135ff",[[1,"limebb-notification-item",{"platform":[16],"context":[16],"item":[16]}]]],["p-5c693302",[[1,"limebb-lime-query-order-by-item",{"platform":[16],"context":[16],"limetype":[1],"item":[16]}]]],["p-5dc574a3",[[1,"limebb-chat-item",{"platform":[16],"context":[16],"item":[16],"helperText":[1,"helper-text"],"hasError":[516,"has-error"]}],[1,"limebb-typing-indicator"]]],["p-61282e1a",[[1,"limebb-feed-item-thumbnail-file-info",{"description":[1]}]]],["p-81dbda15",[[1,"limebb-lime-query-filter-builder",{"platform":[16],"context":[16],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}],[1,"limebb-lime-query-order-by-editor",{"platform":[16],"context":[16],"limetype":[1],"value":[16],"label":[1],"items":[32]},null,{"value":["handleValueChange"]}],[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]}]]],["p-292631ea",[[1,"limebb-empty-state",{"heading":[513],"value":[513],"icon":[16]}]]],["p-d8696b23",[[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]}]]],["p-d724b3c6",[[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]}]]],["p-7e5528f6",[[1,"limebb-summary-popover",{"triggerDelay":[514,"trigger-delay"],"heading":[513],"subheading":[513],"image":[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]}]]],["p-91074d93",[[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]}]]],["p-18e9e1bc",[[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":[1],"limetype":[1],"activeLimetype":[1,"active-limetype"],"expression":[16]}]]]]'),e))));
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i}from"./p-1556b545.js";function s(t,e,i){if(null===i)return void t.push({path:e});const s=i,r="_alias"in s,a="#description"in s,l=Object.keys(s).filter((t=>"_alias"!==t&&"#description"!==t));if(0!==l.length)if(r||a){const i={};for(const t of l)i[t]=s[t];t.push(...o(i,e))}else t.push(...o(i,e));else{const i=s._alias,o=s["#description"];t.push(i||o?{path:e,alias:i,description:o}:{path:e})}}function o(t,e=""){if(!t)return[];const i=[];for(const[o,r]of Object.entries(t))"object"==typeof r&&s(i,e?`${e}.${o}`:o,r);return i}function r(t,e,i){const s=t[e];if(s&&"object"==typeof s&&!("_alias"in s)&&!("#description"in s))return;const o={};i.alias&&""!==i.alias.trim()&&(o._alias=i.alias),i.description&&""!==i.description.trim()&&(o["#description"]=i.description),t[e]=Object.keys(o).length>0?o:null}function a(t,e){const i=t[e];if(!i)return t[e]={},t[e];if("object"==typeof i){const t=i;return Object.keys(t).filter((t=>"_alias"!==t&&"#description"!==t)),t}return t[e]={},t[e]}const l=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.label="Properties",this.items=[],this.handleItemChange=t=>e=>{e.stopPropagation();const i=[...this.items];null===e.detail?i.splice(t,1):i[t]=e.detail,this.items=i,this.emitChange()},this.handleAddProperty=()=>{this.items=[...this.items,{path:""}],this.emitChange()}}componentWillLoad(){var t;if(!this.value||0!==Object.keys(this.value).length||this.value.object||this.value.aggregates)if(null===(t=this.value)||void 0===t?void 0:t.object){const t=o(this.value.object);this.items=t.length>0?t:[{path:"_id"}]}else this.value||(this.items=[{path:"_id"}]);else this.items=[]}componentWillUpdate(){var t;if(!this.value||0!==Object.keys(this.value).length||this.value.object||this.value.aggregates){if(null===(t=this.value)||void 0===t?void 0:t.object){const t=o(this.value.object);(t.length!==this.items.length||!t.every(((t,e)=>{const i=this.items[e];return i&&t.path===i.path&&t.alias===i.alias&&t.description===i.description})))&&(this.items=t)}}else this.items.length>0&&(this.items=[])}render(){return this.limetype?0===this.items.length?i("div",{class:"response-format-editor"},i("h4",{class:"header"},this.label),i("div",{class:"empty-state"},i("p",{class:"empty-state-message"},"No properties selected. The response will return empty objects."),i("limel-button",{label:"Add Property",icon:"plus_math",onClick:this.handleAddProperty}))):i("div",{class:"response-format-editor"},i("limel-header",{subheading:this.label},this.renderPropertyCount()),i("div",{class:"property"},i("div",{class:"property-list"},this.items.map(((t,e)=>this.renderItem(t,e)))),i("div",{class:"actions"},i("limel-button",{label:"Property",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddProperty})))):i("div",{class:"empty-state"},i("p",null,"Select a limetype to choose properties"))}renderPropertyCount(){return[i("limel-badge",{slot:"actions",id:"counter-badge",label:this.items.length.toString()}),i("limel-tooltip",{elementId:"counter-badge",slot:"actions",label:"Number of selected properties"})]}renderItem(t,e){return i("limebb-lime-query-response-format-item",{key:`${t.path}-${e}`,class:"property-item",platform:this.platform,context:this.context,limetype:this.limetype,item:t,onItemChange:this.handleItemChange(e)})}emitChange(){const t=function(t){const e={};for(const i of t){const t=i.path.split(".");let s=e;for(let e=0;e<t.length;e++){const o=t[e];e===t.length-1?r(s,o,i):s=a(s,o)}}return e}(this.items);this.change.emit({object:t})}};l.style=":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;padding:1rem 0}limel-badge[slot=actions]{--badge-background-color:rgb(var(--contrast-200));margin-right:0.25rem}.property{border:1px solid var(--header-background-color);border-radius:0 0 0.75rem 0.75rem}.property-list{display:flex;flex-direction:column;border-radius:0.25rem;background-color:rgb(var(--contrast-100));gap:0.5rem;padding:0.5rem}.property-item{border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex}.actions limel-button{padding:0.5rem;width:100%}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}.empty-state .empty-state-message{margin-bottom:1rem;font-size:0.875rem}.empty-state limel-button{margin:0 auto;max-width:200px}";const n=class{constructor(i){t(this,i),this.itemChange=e(this,"itemChange",7),this.showAliasInput=!1,this.showDescriptionInput=!1,this.handlePathChange=t=>{t.stopPropagation(),this.itemChange.emit(Object.assign(Object.assign({},this.item),{path:t.detail}))},this.toggleAliasInput=()=>{this.showAliasInput=!this.showAliasInput},this.toggleDescriptionInput=()=>{this.showDescriptionInput=!this.showDescriptionInput},this.handleAliasChange=t=>{t.stopPropagation();const e=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{alias:e||void 0}))},this.handleDescriptionChange=t=>{t.stopPropagation();const e=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{description:e||void 0}))},this.handleAliasBlur=()=>{if(this.item.alias){const t=this.item.alias.trim();t!==this.item.alias&&this.itemChange.emit(Object.assign(Object.assign({},this.item),{alias:t||void 0}))}},this.handleDescriptionBlur=()=>{if(this.item.description){const t=this.item.description.trim();t!==this.item.description&&this.itemChange.emit(Object.assign(Object.assign({},this.item),{description:t||void 0}))}},this.handleRemove=()=>{this.itemChange.emit(null)}}componentWillLoad(){this.showAliasInput=!!this.item.alias,this.showDescriptionInput=!!this.item.description}componentWillUpdate(){this.item.alias&&!this.showAliasInput&&(this.showAliasInput=!0),this.item.description&&!this.showDescriptionInput&&(this.showDescriptionInput=!0)}render(){return[i("div",{key:"e804c4feb61b44aeb2f141c5b5d3269a76ac9320",class:"property-controls"},i("div",{key:"becbf35e823b8b16df5366c099b98ce6566d514a",class:"property-path"},i("limebb-property-selector",{key:"2b35ccefecb9dbd4d2c418566482d9903a1c0d02",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:this.item.path,required:!0,onChange:this.handlePathChange})),i("div",{key:"1e598bbbb6df1c5e93bd4ae5f6b112a745a68df9",class:"control-buttons"},i("limel-icon-button",{key:"51d3dfaa9f3578802abf6f65ec876535740ae6a5",icon:this.getAliasIcon(),label:"Add alias",class:this.item.alias?"has-value":"",onClick:this.toggleAliasInput}),i("limel-icon-button",{key:"b2f6050b01d810cc20093e87a09452c625cd7847",icon:this.getDescriptionIcon(),label:"Add description",class:this.item.description?"has-value":"",onClick:this.toggleDescriptionInput}),i("limel-icon-button",{key:"cd58b575c383555db343ebe4a22392c51346751e",icon:"trash",label:"Remove property",onClick:this.handleRemove}))),this.showAliasInput&&i("div",{key:"cd95aa0e34945eb9da88e4be4e4c2326c41ec090",class:"alias"},i("limel-input-field",{key:"f62646327adfb8fcd3f0f2aa3a5325ad8a3bfcc3",label:"Alias",value:this.item.alias||"",placeholder:"Custom property name...",onChange:this.handleAliasChange,onBlur:this.handleAliasBlur})),this.showDescriptionInput&&i("div",{key:"b00f9859a80df3aacf3f524fc1451473e5fcdf5a",class:"description"},i("limel-input-field",{key:"044485f6a35f84816e7458a08882a40aaeacf2f4",label:"Description",value:this.item.description||"",placeholder:"Describe this property for AI...",onChange:this.handleDescriptionChange,onBlur:this.handleDescriptionBlur}))]}getAliasIcon(){return this.showAliasInput?{name:"add_tag",color:"rgb(var(--color-teal-default))"}:{name:"add_tag",color:"rgb(var(--color-gray-600))"}}getDescriptionIcon(){return this.showDescriptionInput?{name:"comments",color:"rgb(var(--color-teal-default))"}:{name:"comments",color:"rgb(var(--color-gray-600))"}}};n.style=":host(limebb-lime-query-response-format-item){display:flex;flex-direction:column;gap:0.5rem}.property-controls{display:flex;flex-wrap:wrap;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(10rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center}.control-buttons limel-icon-button{opacity:0.6;transition:opacity 0.2s ease}.control-buttons limel-icon-button:hover{opacity:1}.control-buttons limel-icon-button.has-value{opacity:1;color:rgb(var(--color-blue-default))}.alias,.description{padding-left:1rem;width:calc(100% - 8.75rem)}@media (max-width: 768px){.property-controls{flex-direction:column;gap:0.5rem}.alias,.description{padding-left:0;width:100%}}";export{l as limebb_lime_query_response_format_editor,n as limebb_lime_query_response_format_item}
@@ -0,0 +1 @@
1
+ import{r as e,c as t,h as i}from"./p-1556b545.js";import{T as o}from"./p-4838284a.js";import{v as r}from"./p-fa2da6bc.js";import"./p-b748c770.js";function s(e){let t;try{t=JSON.parse(e)}catch(e){throw new Error(`Invalid JSON: ${e.message}`)}if(null===t||"object"!=typeof t)throw new Error("Response format must be an object");const i=new Set(["object","aggregates"]),o=Object.keys(t),r=o.filter((e=>!i.has(e)));if(r.length>0)throw new Error(`Unexpected properties in response format: ${r.join(", ")}. Only 'object' and 'aggregates' are allowed.`);if(o.length>0&&!t.object&&!t.aggregates)throw new Error("Response format must contain at least one of: object, aggregates");return t}const l=class{constructor(i){e(this,i),this.change=t(this,"change",7),this.label="Response Format",this.mode="gui",this.codeValue="",this.handleModeChange=e=>{e.stopPropagation();const t=e.detail.id;"gui"===t?this.switchToGui():"code"===t&&this.switchToCode()},this.switchToGui=()=>{try{const e=s(this.codeValue);if(!r(e,this.limetypes,this.limetype,this.guiModeEnabled).guiSupported)return;this.internalValue=e,this.mode="gui",this.change.emit(e)}catch(e){}},this.switchToCode=()=>{this.updateCodeValue(),this.mode="code"},this.handleCodeChange=e=>{e.stopPropagation(),this.codeValue=e.detail;try{const e=s(this.codeValue);this.internalValue=e,this.change.emit(e)}catch(e){}},this.handleGuiChange=e=>{e.stopPropagation(),this.internalValue=e.detail,this.updateCodeValue(),this.change.emit(e.detail)}}get guiModeEnabled(){var e,t,i;return null!==(i=null===(t=null===(e=this.platform)||void 0===e?void 0:e.isFeatureEnabled)||void 0===t?void 0:t.call(e,"useLimeQueryBuilderGuiMode"))&&void 0!==i&&i}componentWillLoad(){this.internalValue=this.value||{object:{_id:null}},this.updateCodeValue(),this.guiModeEnabled&&this.checkGuiSupport().guiSupported||(this.mode="code")}componentWillUpdate(){this.value&&"gui"===this.mode&&(this.internalValue=this.value)}render(){const e=this.checkGuiSupport();return i("div",{key:"8b4116d9e6f1653ec429995647481b1df3df2712",class:"response-format-builder"},this.label&&i("h3",{key:"d5e532a64f4e735b67b0533b4896165f7862561e",class:"builder-label"},this.label),this.guiModeEnabled&&i("div",{key:"42af934f90de83855ff81306fe0bdb10c45fa808",class:"mode-controls"},this.renderModeSwitch(e)),this.guiModeEnabled&&"code"!==this.mode?i("div",{class:"gui-mode"},this.renderGuiMode()):i("div",{class:"code-mode"},this.renderCodeEditor(e)))}renderModeSwitch(e){const t=!e.guiSupported,o=[{id:"gui",title:"Visual"},{id:"code",title:"Code"}].map((e=>Object.assign(Object.assign({},e),{selected:e.id===this.mode})));return i("limel-button-group",{value:o,disabled:t,onChange:this.handleModeChange})}renderCodeEditor(e){return i("div",{class:"code-editor-container"},i("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!e.valid&&e.validationErrors.length>0&&i("div",{class:"validation-errors"},i("strong",null,"Invalid Response Format:"),i("ul",null,e.validationErrors.map((e=>i("li",null,e))))),this.guiModeEnabled&&e.valid&&!e.guiSupported&&e.guiLimitations.length>0&&i("div",{class:"gui-limitations"},i("strong",null,"Cannot switch to GUI mode:"),i("ul",null,e.guiLimitations.map((e=>i("li",null,e))))))}renderGuiMode(){return i("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalValue,onChange:this.handleGuiChange})}checkGuiSupport(){if(!this.limetypes)return{valid:!1,guiSupported:!1,validationErrors:["Limetypes not loaded"],guiLimitations:[]};let e;if("code"===this.mode)try{e=s(this.codeValue)}catch(e){return{valid:!1,guiSupported:!1,validationErrors:[e.message],guiLimitations:[]}}else e=this.internalValue;return r(e,this.limetypes,this.limetype,this.guiModeEnabled)}updateCodeValue(){this.codeValue=JSON.stringify(this.internalValue,null,2)}};(function(e,t,i,o){var r,s=arguments.length,l=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(l=(s<3?r(l):s>3?r(t,i,l):r(t,i))||l);s>3&&l&&Object.defineProperty(t,i,l)})([o()],l.prototype,"limetypes",void 0),l.style=":host(limebb-lime-query-response-format-builder){display:block;width:100%}.response-format-builder{display:flex;flex-direction:column}.builder-label{margin:0;font-size:1.25rem;font-weight:600;color:rgb(var(--contrast-1100))}.mode-controls{display:flex;justify-content:flex-end;padding:0.5rem}.gui-mode,.code-mode{display:block}.code-editor-container{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-editor-container .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .validation-errors ul{margin:0;padding-left:1.5rem}.code-editor-container .validation-errors li{margin:0.25rem 0}.code-editor-container .gui-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .gui-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .gui-limitations ul{margin:0;padding-left:1.5rem}.code-editor-container .gui-limitations li{margin:0.25rem 0}";export{l as limebb_lime_query_response_format_builder}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-crm-building-blocks",
3
- "version": "1.103.1",
3
+ "version": "1.103.2",
4
4
  "description": "A home for shared components meant for use with Lime CRM",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as e,c as t,h as i}from"./p-1556b545.js";import{T as o}from"./p-4838284a.js";import{v as r}from"./p-fa2da6bc.js";import"./p-b748c770.js";function s(e){let t;try{t=JSON.parse(e)}catch(e){throw new Error(`Invalid JSON: ${e.message}`)}if(null===t||"object"!=typeof t)throw new Error("Response format must be an object");const i=new Set(["object","aggregates"]),o=Object.keys(t).filter((e=>!i.has(e)));if(o.length>0)throw new Error(`Unexpected properties in response format: ${o.join(", ")}. Only 'object' and 'aggregates' are allowed.`);if(!t.object&&!t.aggregates)throw new Error("Response format must contain at least one of: object, aggregates");return t}const l=class{constructor(i){e(this,i),this.change=t(this,"change",7),this.label="Response Format",this.mode="gui",this.codeValue="",this.handleModeChange=e=>{e.stopPropagation();const t=e.detail.id;"gui"===t?this.switchToGui():"code"===t&&this.switchToCode()},this.switchToGui=()=>{try{const e=s(this.codeValue);if(!r(e,this.limetypes,this.limetype,this.guiModeEnabled).guiSupported)return;this.internalValue=e,this.mode="gui",this.change.emit(e)}catch(e){}},this.switchToCode=()=>{this.updateCodeValue(),this.mode="code"},this.handleCodeChange=e=>{e.stopPropagation(),this.codeValue=e.detail;try{const e=s(this.codeValue);this.internalValue=e,this.change.emit(e)}catch(e){}},this.handleGuiChange=e=>{e.stopPropagation(),this.internalValue=e.detail,this.updateCodeValue(),this.change.emit(e.detail)}}get guiModeEnabled(){var e,t,i;return null!==(i=null===(t=null===(e=this.platform)||void 0===e?void 0:e.isFeatureEnabled)||void 0===t?void 0:t.call(e,"useLimeQueryBuilderGuiMode"))&&void 0!==i&&i}componentWillLoad(){this.internalValue=this.value||{object:{_id:null}},this.updateCodeValue(),this.guiModeEnabled&&this.checkGuiSupport().guiSupported||(this.mode="code")}componentWillUpdate(){this.value&&"gui"===this.mode&&(this.internalValue=this.value)}render(){const e=this.checkGuiSupport();return i("div",{key:"8b4116d9e6f1653ec429995647481b1df3df2712",class:"response-format-builder"},this.label&&i("h3",{key:"d5e532a64f4e735b67b0533b4896165f7862561e",class:"builder-label"},this.label),this.guiModeEnabled&&i("div",{key:"42af934f90de83855ff81306fe0bdb10c45fa808",class:"mode-controls"},this.renderModeSwitch(e)),this.guiModeEnabled&&"code"!==this.mode?i("div",{class:"gui-mode"},this.renderGuiMode()):i("div",{class:"code-mode"},this.renderCodeEditor(e)))}renderModeSwitch(e){const t=!e.guiSupported,o=[{id:"gui",title:"Visual"},{id:"code",title:"Code"}].map((e=>Object.assign(Object.assign({},e),{selected:e.id===this.mode})));return i("limel-button-group",{value:o,disabled:t,onChange:this.handleModeChange})}renderCodeEditor(e){return i("div",{class:"code-editor-container"},i("limel-code-editor",{value:this.codeValue,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleCodeChange}),!e.valid&&e.validationErrors.length>0&&i("div",{class:"validation-errors"},i("strong",null,"Invalid Response Format:"),i("ul",null,e.validationErrors.map((e=>i("li",null,e))))),this.guiModeEnabled&&e.valid&&!e.guiSupported&&e.guiLimitations.length>0&&i("div",{class:"gui-limitations"},i("strong",null,"Cannot switch to GUI mode:"),i("ul",null,e.guiLimitations.map((e=>i("li",null,e))))))}renderGuiMode(){return i("limebb-lime-query-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalValue,onChange:this.handleGuiChange})}checkGuiSupport(){if(!this.limetypes)return{valid:!1,guiSupported:!1,validationErrors:["Limetypes not loaded"],guiLimitations:[]};let e;if("code"===this.mode)try{e=s(this.codeValue)}catch(e){return{valid:!1,guiSupported:!1,validationErrors:[e.message],guiLimitations:[]}}else e=this.internalValue;return r(e,this.limetypes,this.limetype,this.guiModeEnabled)}updateCodeValue(){this.codeValue=JSON.stringify(this.internalValue,null,2)}};(function(e,t,i,o){var r,s=arguments.length,l=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(l=(s<3?r(l):s>3?r(t,i,l):r(t,i))||l);s>3&&l&&Object.defineProperty(t,i,l)})([o()],l.prototype,"limetypes",void 0),l.style=":host(limebb-lime-query-response-format-builder){display:block;width:100%}.response-format-builder{display:flex;flex-direction:column}.builder-label{margin:0;font-size:1.25rem;font-weight:600;color:rgb(var(--contrast-1100))}.mode-controls{display:flex;justify-content:flex-end;padding:0.5rem}.gui-mode,.code-mode{display:block}.code-editor-container{--code-editor-max-height:70vh;display:flex;flex-direction:column;gap:1rem}.code-editor-container .validation-errors{padding:0.75rem 1rem;color:rgb(var(--color-red-default));background-color:rgb(var(--color-red-lighter));border-left:0.25rem solid rgb(var(--color-red-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .validation-errors strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .validation-errors ul{margin:0;padding-left:1.5rem}.code-editor-container .validation-errors li{margin:0.25rem 0}.code-editor-container .gui-limitations{padding:0.75rem 1rem;color:rgb(var(--color-blue-dark));background-color:rgb(var(--color-blue-lighter));border-left:0.25rem solid rgb(var(--color-blue-default));border-radius:0.25rem;font-size:0.875rem}.code-editor-container .gui-limitations strong{display:block;margin-bottom:0.5rem;font-weight:600}.code-editor-container .gui-limitations ul{margin:0;padding-left:1.5rem}.code-editor-container .gui-limitations li{margin:0.25rem 0}";export{l as limebb_lime_query_response_format_builder}
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i}from"./p-1556b545.js";function o(t,e,i){if(null===i)return void t.push({path:e});const o=i,r="_alias"in o,a="#description"in o,l=Object.keys(o).filter((t=>"_alias"!==t&&"#description"!==t));if(0!==l.length)if(r||a){const i={};for(const t of l)i[t]=o[t];t.push(...s(i,e))}else t.push(...s(i,e));else{const i=o._alias,s=o["#description"];t.push(i||s?{path:e,alias:i,description:s}:{path:e})}}function s(t,e=""){if(!t)return[];const i=[];for(const[s,r]of Object.entries(t))"object"==typeof r&&o(i,e?`${e}.${s}`:s,r);return i}function r(t,e,i){const o=t[e];if(o&&"object"==typeof o&&!("_alias"in o)&&!("#description"in o))return;const s={};i.alias&&""!==i.alias.trim()&&(s._alias=i.alias),i.description&&""!==i.description.trim()&&(s["#description"]=i.description),t[e]=Object.keys(s).length>0?s:null}function a(t,e){const i=t[e];if(!i)return t[e]={},t[e];if("object"==typeof i){const t=i;return Object.keys(t).filter((t=>"_alias"!==t&&"#description"!==t)),t}return t[e]={},t[e]}const l=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.label="Properties",this.items=[{path:"_id"}],this.handleItemChange=t=>e=>{e.stopPropagation();const i=[...this.items];null===e.detail?i.splice(t,1):i[t]=e.detail,0===i.length&&i.push({path:"_id"}),this.items=i,this.emitChange()},this.handleAddProperty=()=>{this.items=[...this.items,{path:""}],this.emitChange()}}componentWillLoad(){var t;if(null===(t=this.value)||void 0===t?void 0:t.object){const t=s(this.value.object);t.length>0&&(this.items=t)}}componentWillUpdate(){var t;if(null===(t=this.value)||void 0===t?void 0:t.object){const t=s(this.value.object);(t.length!==this.items.length||!t.every(((t,e)=>{const i=this.items[e];return i&&t.path===i.path&&t.alias===i.alias&&t.description===i.description})))&&(this.items=t.length>0?t:[{path:"_id"}])}}render(){return this.limetype?i("div",{class:"response-format-editor"},i("limel-header",{subheading:this.label},this.renderPropertyCount()),i("div",{class:"property"},i("div",{class:"property-list"},this.items.map(((t,e)=>this.renderItem(t,e)))),i("div",{class:"actions"},i("limel-button",{label:"Property",icon:{name:"plus_math",title:"Add"},onClick:this.handleAddProperty})))):i("div",{class:"empty-state"},i("p",null,"Select a limetype to choose properties"))}renderPropertyCount(){return[i("limel-badge",{slot:"actions",id:"counter-badge",label:this.items.length.toString()}),i("limel-tooltip",{elementId:"counter-badge",slot:"actions",label:"Number of selected properties"})]}renderItem(t,e){return i("limebb-lime-query-response-format-item",{key:`${t.path}-${e}`,class:"property-item",platform:this.platform,context:this.context,limetype:this.limetype,item:t,onItemChange:this.handleItemChange(e)})}emitChange(){const t=function(t){const e={};for(const i of t){const t=i.path.split(".");let o=e;for(let e=0;e<t.length;e++){const s=t[e];e===t.length-1?r(o,s,i):o=a(o,s)}}return e}(this.items);this.change.emit({object:t})}};l.style=":host(limebb-lime-query-response-format-editor){display:block;width:100%}.response-format-editor{display:flex;flex-direction:column;padding:1rem 0}limel-badge[slot=actions]{--badge-background-color:rgb(var(--contrast-200));margin-right:0.25rem}.property{border:1px solid var(--header-background-color);border-radius:0 0 0.75rem 0.75rem}.property-list{display:flex;flex-direction:column;border-radius:0.25rem;background-color:rgb(var(--contrast-100));gap:0.5rem;padding:0.5rem}.property-item{border-radius:0.25rem;transition:background-color 0.2s}.property-item:hover{background-color:rgb(var(--contrast-100))}.actions{display:flex}.actions limel-button{padding:0.5rem;width:100%}.empty-state{padding:2rem;text-align:center;color:rgb(var(--contrast-700));font-style:italic}.empty-state p{margin:0}";const n=class{constructor(i){t(this,i),this.itemChange=e(this,"itemChange",7),this.showAliasInput=!1,this.showDescriptionInput=!1,this.handlePathChange=t=>{t.stopPropagation(),this.itemChange.emit(Object.assign(Object.assign({},this.item),{path:t.detail}))},this.toggleAliasInput=()=>{this.showAliasInput=!this.showAliasInput},this.toggleDescriptionInput=()=>{this.showDescriptionInput=!this.showDescriptionInput},this.handleAliasChange=t=>{t.stopPropagation();const e=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{alias:e||void 0}))},this.handleDescriptionChange=t=>{t.stopPropagation();const e=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{description:e||void 0}))},this.handleAliasBlur=()=>{if(this.item.alias){const t=this.item.alias.trim();t!==this.item.alias&&this.itemChange.emit(Object.assign(Object.assign({},this.item),{alias:t||void 0}))}},this.handleDescriptionBlur=()=>{if(this.item.description){const t=this.item.description.trim();t!==this.item.description&&this.itemChange.emit(Object.assign(Object.assign({},this.item),{description:t||void 0}))}},this.handleRemove=()=>{this.itemChange.emit(null)}}componentWillLoad(){this.showAliasInput=!!this.item.alias,this.showDescriptionInput=!!this.item.description}componentWillUpdate(){this.item.alias&&!this.showAliasInput&&(this.showAliasInput=!0),this.item.description&&!this.showDescriptionInput&&(this.showDescriptionInput=!0)}render(){return[i("div",{key:"e804c4feb61b44aeb2f141c5b5d3269a76ac9320",class:"property-controls"},i("div",{key:"becbf35e823b8b16df5366c099b98ce6566d514a",class:"property-path"},i("limebb-property-selector",{key:"2b35ccefecb9dbd4d2c418566482d9903a1c0d02",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:this.item.path,required:!0,onChange:this.handlePathChange})),i("div",{key:"1e598bbbb6df1c5e93bd4ae5f6b112a745a68df9",class:"control-buttons"},i("limel-icon-button",{key:"51d3dfaa9f3578802abf6f65ec876535740ae6a5",icon:this.getAliasIcon(),label:"Add alias",class:this.item.alias?"has-value":"",onClick:this.toggleAliasInput}),i("limel-icon-button",{key:"b2f6050b01d810cc20093e87a09452c625cd7847",icon:this.getDescriptionIcon(),label:"Add description",class:this.item.description?"has-value":"",onClick:this.toggleDescriptionInput}),i("limel-icon-button",{key:"cd58b575c383555db343ebe4a22392c51346751e",icon:"trash",label:"Remove property",onClick:this.handleRemove}))),this.showAliasInput&&i("div",{key:"cd95aa0e34945eb9da88e4be4e4c2326c41ec090",class:"alias"},i("limel-input-field",{key:"f62646327adfb8fcd3f0f2aa3a5325ad8a3bfcc3",label:"Alias",value:this.item.alias||"",placeholder:"Custom property name...",onChange:this.handleAliasChange,onBlur:this.handleAliasBlur})),this.showDescriptionInput&&i("div",{key:"b00f9859a80df3aacf3f524fc1451473e5fcdf5a",class:"description"},i("limel-input-field",{key:"044485f6a35f84816e7458a08882a40aaeacf2f4",label:"Description",value:this.item.description||"",placeholder:"Describe this property for AI...",onChange:this.handleDescriptionChange,onBlur:this.handleDescriptionBlur}))]}getAliasIcon(){return this.showAliasInput?{name:"add_tag",color:"rgb(var(--color-teal-default))"}:{name:"add_tag",color:"rgb(var(--color-gray-600))"}}getDescriptionIcon(){return this.showDescriptionInput?{name:"comments",color:"rgb(var(--color-teal-default))"}:{name:"comments",color:"rgb(var(--color-gray-600))"}}};n.style=":host(limebb-lime-query-response-format-item){display:flex;flex-direction:column;gap:0.5rem}.property-controls{display:flex;flex-wrap:wrap;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(10rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center}.control-buttons limel-icon-button{opacity:0.6;transition:opacity 0.2s ease}.control-buttons limel-icon-button:hover{opacity:1}.control-buttons limel-icon-button.has-value{opacity:1;color:rgb(var(--color-blue-default))}.alias,.description{padding-left:1rem;width:calc(100% - 8.75rem)}@media (max-width: 768px){.property-controls{flex-direction:column;gap:0.5rem}.alias,.description{padding-left:0;width:100%}}";export{l as limebb_lime_query_response_format_editor,n as limebb_lime_query_response_format_item}