@limetech/lime-crm-building-blocks 1.101.0 → 1.102.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 (113) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/lime-crm-building-blocks.cjs.js +1 -1
  3. package/dist/cjs/lime-query-validation-6be10fa7.js +558 -0
  4. package/dist/cjs/limebb-lime-query-builder.cjs.entry.js +4 -514
  5. package/dist/cjs/{limebb-lime-query-filter-builder_4.cjs.entry.js → limebb-lime-query-filter-builder_3.cjs.entry.js} +1 -243
  6. package/dist/cjs/limebb-lime-query-filter-comparison_2.cjs.entry.js +1 -1
  7. package/dist/cjs/limebb-lime-query-filter-group_3.cjs.entry.js +2 -2
  8. package/dist/cjs/limebb-lime-query-order-by-item.cjs.entry.js +2 -2
  9. package/dist/cjs/limebb-lime-query-response-format-builder.cjs.entry.js +242 -0
  10. package/dist/cjs/limebb-lime-query-response-format-editor_2.cjs.entry.js +322 -0
  11. package/dist/cjs/limebb-live-docs-info.cjs.entry.js +2 -2
  12. package/dist/cjs/limebb-locale-picker.cjs.entry.js +1 -1
  13. package/dist/cjs/limebb-mention-group-counter.cjs.entry.js +2 -2
  14. package/dist/cjs/limebb-navigation-button_2.cjs.entry.js +3 -3
  15. package/dist/cjs/limebb-notification-item.cjs.entry.js +1 -1
  16. package/dist/cjs/limebb-percentage-visualizer.cjs.entry.js +2 -2
  17. package/dist/cjs/limebb-text-editor.cjs.entry.js +1 -1
  18. package/dist/cjs/limebb-trend-indicator.cjs.entry.js +1 -1
  19. package/dist/cjs/loader.cjs.js +1 -1
  20. package/dist/collection/collection-manifest.json +3 -2
  21. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-comparison.js +1 -1
  22. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-group.js +1 -1
  23. package/dist/collection/components/lime-query-builder/expressions/lime-query-filter-not.js +1 -1
  24. package/dist/collection/components/lime-query-builder/lime-query-builder.js +1 -1
  25. package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.css +91 -0
  26. package/dist/collection/components/lime-query-builder/lime-query-response-format-builder.js +355 -0
  27. package/dist/collection/components/lime-query-builder/lime-query-validation.js +40 -0
  28. package/dist/collection/components/lime-query-builder/limetype-field/limetype-field.js +1 -1
  29. package/dist/collection/components/lime-query-builder/order-by/order-by-item.js +2 -2
  30. package/dist/collection/components/lime-query-builder/{response-format-editor.css → response-format/response-format-editor.css} +1 -1
  31. package/dist/collection/components/lime-query-builder/{response-format-editor.js → response-format/response-format-editor.js} +5 -5
  32. package/dist/collection/components/lime-query-builder/response-format/response-format-helpers.js +92 -0
  33. package/dist/collection/components/lime-query-builder/{response-format-item.css → response-format/response-format-item.css} +1 -1
  34. package/dist/collection/components/lime-query-builder/{response-format-item.js → response-format/response-format-item.js} +6 -6
  35. package/dist/collection/components/limeobject/file-viewer/live-docs-info.js +2 -2
  36. package/dist/collection/components/locale-picker/locale-picker.js +1 -1
  37. package/dist/collection/components/notification-list/notification-item/notification-item.js +1 -1
  38. package/dist/collection/components/percentage-visualizer/percentage-visualizer.js +2 -2
  39. package/dist/collection/components/summary-popover/summary-popover.js +3 -3
  40. package/dist/collection/components/text-editor/mention-group-counter.js +2 -2
  41. package/dist/collection/components/text-editor/text-editor.js +1 -1
  42. package/dist/collection/components/trend-indicator/trend-indicator.js +1 -1
  43. package/dist/components/lime-query-filter-comparison.js +1 -1
  44. package/dist/components/lime-query-filter-expression.js +2 -2
  45. package/dist/components/lime-query-validation.js +555 -0
  46. package/dist/components/limebb-lime-query-builder.js +14 -524
  47. package/dist/components/limebb-lime-query-response-format-builder.d.ts +11 -0
  48. package/dist/components/limebb-lime-query-response-format-builder.js +283 -0
  49. package/dist/components/limebb-lime-query-response-format-editor.d.ts +11 -0
  50. package/dist/components/{limebb-response-format-editor.js → limebb-lime-query-response-format-editor.js} +2 -2
  51. package/dist/components/limebb-lime-query-response-format-item.d.ts +11 -0
  52. package/dist/components/{limebb-response-format-item.js → limebb-lime-query-response-format-item.js} +2 -2
  53. package/dist/components/limebb-locale-picker.js +1 -1
  54. package/dist/components/limebb-mention-group-counter.js +2 -2
  55. package/dist/components/limebb-percentage-visualizer.js +2 -2
  56. package/dist/components/limebb-text-editor.js +1 -1
  57. package/dist/components/limebb-trend-indicator.js +1 -1
  58. package/dist/components/limetype-field.js +1 -1
  59. package/dist/components/live-docs-info.js +2 -2
  60. package/dist/components/notification-item.js +1 -1
  61. package/dist/components/order-by-item.js +2 -2
  62. package/dist/components/response-format-editor.js +11 -11
  63. package/dist/components/response-format-item.js +9 -9
  64. package/dist/components/summary-popover.js +3 -3
  65. package/dist/esm/lime-crm-building-blocks.js +1 -1
  66. package/dist/esm/lime-query-validation-573223a5.js +555 -0
  67. package/dist/esm/limebb-lime-query-builder.entry.js +4 -514
  68. package/dist/esm/{limebb-lime-query-filter-builder_4.entry.js → limebb-lime-query-filter-builder_3.entry.js} +2 -243
  69. package/dist/esm/limebb-lime-query-filter-comparison_2.entry.js +1 -1
  70. package/dist/esm/limebb-lime-query-filter-group_3.entry.js +2 -2
  71. package/dist/esm/limebb-lime-query-order-by-item.entry.js +2 -2
  72. package/dist/esm/limebb-lime-query-response-format-builder.entry.js +238 -0
  73. package/dist/esm/limebb-lime-query-response-format-editor_2.entry.js +317 -0
  74. package/dist/esm/limebb-live-docs-info.entry.js +2 -2
  75. package/dist/esm/limebb-locale-picker.entry.js +1 -1
  76. package/dist/esm/limebb-mention-group-counter.entry.js +2 -2
  77. package/dist/esm/limebb-navigation-button_2.entry.js +3 -3
  78. package/dist/esm/limebb-notification-item.entry.js +1 -1
  79. package/dist/esm/limebb-percentage-visualizer.entry.js +2 -2
  80. package/dist/esm/limebb-text-editor.entry.js +1 -1
  81. package/dist/esm/limebb-trend-indicator.entry.js +1 -1
  82. package/dist/esm/loader.js +1 -1
  83. package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
  84. package/dist/lime-crm-building-blocks/{p-5cf4898d.entry.js → p-0de79b7f.entry.js} +1 -1
  85. package/dist/lime-crm-building-blocks/{p-8c2fb1c9.entry.js → p-0f7135ff.entry.js} +1 -1
  86. package/dist/lime-crm-building-blocks/{p-6aa216ec.entry.js → p-186e9f1a.entry.js} +1 -1
  87. package/dist/lime-crm-building-blocks/p-289ce8b9.entry.js +1 -0
  88. package/dist/lime-crm-building-blocks/p-3351395b.entry.js +1 -0
  89. package/dist/lime-crm-building-blocks/p-33e6d0ec.entry.js +1 -0
  90. package/dist/lime-crm-building-blocks/{p-a1ee8990.entry.js → p-3d1be1c9.entry.js} +1 -1
  91. package/dist/lime-crm-building-blocks/{p-92dfc5f8.entry.js → p-577d8909.entry.js} +1 -1
  92. package/dist/lime-crm-building-blocks/{p-ccf34631.entry.js → p-6579412e.entry.js} +1 -1
  93. package/dist/lime-crm-building-blocks/{p-d84874dc.entry.js → p-6f6fed59.entry.js} +1 -1
  94. package/dist/lime-crm-building-blocks/{p-0cd036ed.entry.js → p-7e5528f6.entry.js} +1 -1
  95. package/dist/lime-crm-building-blocks/{p-8601eab5.entry.js → p-a9ac501f.entry.js} +1 -1
  96. package/dist/lime-crm-building-blocks/p-be845252.entry.js +1 -0
  97. package/dist/lime-crm-building-blocks/{p-2725671e.entry.js → p-cb338753.entry.js} +1 -1
  98. package/dist/lime-crm-building-blocks/{p-425eaba2.entry.js → p-d0721b22.entry.js} +1 -1
  99. package/dist/lime-crm-building-blocks/p-fa2da6bc.js +1 -0
  100. package/dist/types/components/lime-query-builder/lime-query-response-format-builder.d.ts +102 -0
  101. package/dist/types/components/lime-query-builder/lime-query-validation.d.ts +13 -0
  102. package/dist/types/components/lime-query-builder/{response-format-editor.d.ts → response-format/response-format-editor.d.ts} +2 -2
  103. package/dist/types/components/lime-query-builder/response-format/response-format-helpers.d.ts +42 -0
  104. package/dist/types/components/lime-query-builder/{response-format-item.d.ts → response-format/response-format-item.d.ts} +2 -2
  105. package/dist/types/components.d.ts +394 -222
  106. package/package.json +1 -1
  107. package/dist/cjs/limebb-response-format-item.cjs.entry.js +0 -80
  108. package/dist/components/limebb-response-format-editor.d.ts +0 -11
  109. package/dist/components/limebb-response-format-item.d.ts +0 -11
  110. package/dist/esm/limebb-response-format-item.entry.js +0 -76
  111. package/dist/lime-crm-building-blocks/p-244ee55b.entry.js +0 -1
  112. package/dist/lime-crm-building-blocks/p-67c174d0.entry.js +0 -1
  113. package/dist/lime-crm-building-blocks/p-f9efca1d.entry.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-crm-building-blocks",
3
- "version": "1.101.0",
3
+ "version": "1.102.0",
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,80 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-ff255a0d.js');
6
-
7
- const responseFormatItemCss = ":host(limebb-response-format-item){display:flex;flex-direction:column;gap:0.5rem;width:100%}.property-controls{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(20rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center;padding-top:0.5rem}.control-buttons limel-icon-button{opacity:0.6;transition:opacity 0.2s ease}.control-buttons limel-icon-button:hover{opacity:1}.control-buttons limel-icon-button.has-value{opacity:1;color:rgb(var(--color-blue-default))}.alias,.description{padding-left:1.5rem;width:calc(100% - 1.5rem);max-width:40rem}@media (max-width: 768px){.property-controls{flex-direction:column;gap:0.5rem}.control-buttons{padding-top:0}.alias,.description{padding-left:0;width:100%}}";
8
- const LimebbResponseFormatItemStyle0 = responseFormatItemCss;
9
-
10
- const ResponseFormatItem = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.itemChange = index.createEvent(this, "itemChange", 7);
14
- this.showAliasInput = false;
15
- this.showDescriptionInput = false;
16
- this.handlePathChange = (event) => {
17
- event.stopPropagation();
18
- this.itemChange.emit(Object.assign(Object.assign({}, this.item), { path: event.detail }));
19
- };
20
- this.toggleAliasInput = () => {
21
- this.showAliasInput = !this.showAliasInput;
22
- };
23
- this.toggleDescriptionInput = () => {
24
- this.showDescriptionInput = !this.showDescriptionInput;
25
- };
26
- this.handleAliasChange = (event) => {
27
- event.stopPropagation();
28
- const alias = event.detail;
29
- this.itemChange.emit(Object.assign(Object.assign({}, this.item), { alias: alias || undefined }));
30
- };
31
- this.handleDescriptionChange = (event) => {
32
- event.stopPropagation();
33
- const description = event.detail;
34
- this.itemChange.emit(Object.assign(Object.assign({}, this.item), { description: description || undefined }));
35
- };
36
- this.handleAliasBlur = () => {
37
- if (this.item.alias) {
38
- const trimmed = this.item.alias.trim();
39
- if (trimmed !== this.item.alias) {
40
- this.itemChange.emit(Object.assign(Object.assign({}, this.item), { alias: trimmed || undefined }));
41
- }
42
- }
43
- };
44
- this.handleDescriptionBlur = () => {
45
- if (this.item.description) {
46
- const trimmed = this.item.description.trim();
47
- if (trimmed !== this.item.description) {
48
- this.itemChange.emit(Object.assign(Object.assign({}, this.item), { description: trimmed || undefined }));
49
- }
50
- }
51
- };
52
- this.handleRemove = () => {
53
- this.itemChange.emit(null);
54
- };
55
- }
56
- componentWillLoad() {
57
- // Initialize visibility based on whether fields have values
58
- this.showAliasInput = !!this.item.alias;
59
- this.showDescriptionInput = !!this.item.description;
60
- }
61
- componentWillUpdate() {
62
- // Keep inputs visible if they have values
63
- if (this.item.alias && !this.showAliasInput) {
64
- this.showAliasInput = true;
65
- }
66
- if (this.item.description && !this.showDescriptionInput) {
67
- this.showDescriptionInput = true;
68
- }
69
- }
70
- render() {
71
- return [
72
- index.h("div", { key: '842362f9a9cfd48420409e53f0a8dc84048e383f', class: "property-controls" }, index.h("div", { key: '9f1b758ca0a6123e9acdff4ee4e1480b1938bb8b', class: "property-path" }, index.h("limebb-property-selector", { key: '3f4ca007b7131c94c57af2883638e19657e0a876', platform: this.platform, context: this.context, limetype: this.limetype, label: "Property", value: this.item.path, required: true, onChange: this.handlePathChange })), index.h("div", { key: 'c0141d13b1af44df29ad6502817330da6fe62283', class: "control-buttons" }, index.h("limel-icon-button", { key: '24aa415a1a1d91a46a251fb947fe071cd8f6e36f', icon: "add_tag", label: "Add alias", class: this.item.alias ? 'has-value' : '', onClick: this.toggleAliasInput }), index.h("limel-icon-button", { key: '4fa60916e5e179361c9fa6ab49fa06ce4c88ca66', icon: "comments", label: "Add description", class: this.item.description ? 'has-value' : '', onClick: this.toggleDescriptionInput }), index.h("limel-icon-button", { key: '03db71a330ccc905e37ffb9d8375bb6b774812b9', icon: "trash", label: "Remove property", onClick: this.handleRemove }))),
73
- this.showAliasInput && (index.h("div", { key: 'bebaa718fd408dfdcce2f4cfe479e1b56325df86', class: "alias" }, index.h("limel-input-field", { key: '2a7c1e65558ef4f4892f854da04d7e083847defd', label: "Alias", value: this.item.alias || '', placeholder: "Custom property name...", onChange: this.handleAliasChange, onBlur: this.handleAliasBlur }))),
74
- this.showDescriptionInput && (index.h("div", { key: 'b32b9b5006a9a48e44f5725f070f9bd376c8b15f', class: "description" }, index.h("limel-input-field", { key: '98f63d70cc77c68cbf535d33210a8d5e0c15cf72', label: "Description", value: this.item.description || '', placeholder: "Describe this property for AI...", onChange: this.handleDescriptionChange, onBlur: this.handleDescriptionBlur }))),
75
- ];
76
- }
77
- };
78
- ResponseFormatItem.style = LimebbResponseFormatItemStyle0;
79
-
80
- exports.limebb_response_format_item = ResponseFormatItem;
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../types/components";
2
-
3
- interface LimebbResponseFormatEditor extends Components.LimebbResponseFormatEditor, HTMLElement {}
4
- export const LimebbResponseFormatEditor: {
5
- prototype: LimebbResponseFormatEditor;
6
- new (): LimebbResponseFormatEditor;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../types/components";
2
-
3
- interface LimebbResponseFormatItem extends Components.LimebbResponseFormatItem, HTMLElement {}
4
- export const LimebbResponseFormatItem: {
5
- prototype: LimebbResponseFormatItem;
6
- new (): LimebbResponseFormatItem;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,76 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-96dd111f.js';
2
-
3
- const responseFormatItemCss = ":host(limebb-response-format-item){display:flex;flex-direction:column;gap:0.5rem;width:100%}.property-controls{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(20rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center;padding-top:0.5rem}.control-buttons limel-icon-button{opacity:0.6;transition:opacity 0.2s ease}.control-buttons limel-icon-button:hover{opacity:1}.control-buttons limel-icon-button.has-value{opacity:1;color:rgb(var(--color-blue-default))}.alias,.description{padding-left:1.5rem;width:calc(100% - 1.5rem);max-width:40rem}@media (max-width: 768px){.property-controls{flex-direction:column;gap:0.5rem}.control-buttons{padding-top:0}.alias,.description{padding-left:0;width:100%}}";
4
- const LimebbResponseFormatItemStyle0 = responseFormatItemCss;
5
-
6
- const ResponseFormatItem = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.itemChange = createEvent(this, "itemChange", 7);
10
- this.showAliasInput = false;
11
- this.showDescriptionInput = false;
12
- this.handlePathChange = (event) => {
13
- event.stopPropagation();
14
- this.itemChange.emit(Object.assign(Object.assign({}, this.item), { path: event.detail }));
15
- };
16
- this.toggleAliasInput = () => {
17
- this.showAliasInput = !this.showAliasInput;
18
- };
19
- this.toggleDescriptionInput = () => {
20
- this.showDescriptionInput = !this.showDescriptionInput;
21
- };
22
- this.handleAliasChange = (event) => {
23
- event.stopPropagation();
24
- const alias = event.detail;
25
- this.itemChange.emit(Object.assign(Object.assign({}, this.item), { alias: alias || undefined }));
26
- };
27
- this.handleDescriptionChange = (event) => {
28
- event.stopPropagation();
29
- const description = event.detail;
30
- this.itemChange.emit(Object.assign(Object.assign({}, this.item), { description: description || undefined }));
31
- };
32
- this.handleAliasBlur = () => {
33
- if (this.item.alias) {
34
- const trimmed = this.item.alias.trim();
35
- if (trimmed !== this.item.alias) {
36
- this.itemChange.emit(Object.assign(Object.assign({}, this.item), { alias: trimmed || undefined }));
37
- }
38
- }
39
- };
40
- this.handleDescriptionBlur = () => {
41
- if (this.item.description) {
42
- const trimmed = this.item.description.trim();
43
- if (trimmed !== this.item.description) {
44
- this.itemChange.emit(Object.assign(Object.assign({}, this.item), { description: trimmed || undefined }));
45
- }
46
- }
47
- };
48
- this.handleRemove = () => {
49
- this.itemChange.emit(null);
50
- };
51
- }
52
- componentWillLoad() {
53
- // Initialize visibility based on whether fields have values
54
- this.showAliasInput = !!this.item.alias;
55
- this.showDescriptionInput = !!this.item.description;
56
- }
57
- componentWillUpdate() {
58
- // Keep inputs visible if they have values
59
- if (this.item.alias && !this.showAliasInput) {
60
- this.showAliasInput = true;
61
- }
62
- if (this.item.description && !this.showDescriptionInput) {
63
- this.showDescriptionInput = true;
64
- }
65
- }
66
- render() {
67
- return [
68
- h("div", { key: '842362f9a9cfd48420409e53f0a8dc84048e383f', class: "property-controls" }, h("div", { key: '9f1b758ca0a6123e9acdff4ee4e1480b1938bb8b', class: "property-path" }, h("limebb-property-selector", { key: '3f4ca007b7131c94c57af2883638e19657e0a876', platform: this.platform, context: this.context, limetype: this.limetype, label: "Property", value: this.item.path, required: true, onChange: this.handlePathChange })), h("div", { key: 'c0141d13b1af44df29ad6502817330da6fe62283', class: "control-buttons" }, h("limel-icon-button", { key: '24aa415a1a1d91a46a251fb947fe071cd8f6e36f', icon: "add_tag", label: "Add alias", class: this.item.alias ? 'has-value' : '', onClick: this.toggleAliasInput }), h("limel-icon-button", { key: '4fa60916e5e179361c9fa6ab49fa06ce4c88ca66', icon: "comments", label: "Add description", class: this.item.description ? 'has-value' : '', onClick: this.toggleDescriptionInput }), h("limel-icon-button", { key: '03db71a330ccc905e37ffb9d8375bb6b774812b9', icon: "trash", label: "Remove property", onClick: this.handleRemove }))),
69
- this.showAliasInput && (h("div", { key: 'bebaa718fd408dfdcce2f4cfe479e1b56325df86', class: "alias" }, h("limel-input-field", { key: '2a7c1e65558ef4f4892f854da04d7e083847defd', label: "Alias", value: this.item.alias || '', placeholder: "Custom property name...", onChange: this.handleAliasChange, onBlur: this.handleAliasBlur }))),
70
- this.showDescriptionInput && (h("div", { key: 'b32b9b5006a9a48e44f5725f070f9bd376c8b15f', class: "description" }, h("limel-input-field", { key: '98f63d70cc77c68cbf535d33210a8d5e0c15cf72', label: "Description", value: this.item.description || '', placeholder: "Describe this property for AI...", onChange: this.handleDescriptionChange, onBlur: this.handleDescriptionBlur }))),
71
- ];
72
- }
73
- };
74
- ResponseFormatItem.style = LimebbResponseFormatItemStyle0;
75
-
76
- export { ResponseFormatItem as limebb_response_format_item };
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as e}from"./p-1556b545.js";const s=class{constructor(e){t(this,e),this.itemChange=i(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 i=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{alias:i||void 0}))},this.handleDescriptionChange=t=>{t.stopPropagation();const i=t.detail;this.itemChange.emit(Object.assign(Object.assign({},this.item),{description:i||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[e("div",{key:"842362f9a9cfd48420409e53f0a8dc84048e383f",class:"property-controls"},e("div",{key:"9f1b758ca0a6123e9acdff4ee4e1480b1938bb8b",class:"property-path"},e("limebb-property-selector",{key:"3f4ca007b7131c94c57af2883638e19657e0a876",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:this.item.path,required:!0,onChange:this.handlePathChange})),e("div",{key:"c0141d13b1af44df29ad6502817330da6fe62283",class:"control-buttons"},e("limel-icon-button",{key:"24aa415a1a1d91a46a251fb947fe071cd8f6e36f",icon:"add_tag",label:"Add alias",class:this.item.alias?"has-value":"",onClick:this.toggleAliasInput}),e("limel-icon-button",{key:"4fa60916e5e179361c9fa6ab49fa06ce4c88ca66",icon:"comments",label:"Add description",class:this.item.description?"has-value":"",onClick:this.toggleDescriptionInput}),e("limel-icon-button",{key:"03db71a330ccc905e37ffb9d8375bb6b774812b9",icon:"trash",label:"Remove property",onClick:this.handleRemove}))),this.showAliasInput&&e("div",{key:"bebaa718fd408dfdcce2f4cfe479e1b56325df86",class:"alias"},e("limel-input-field",{key:"2a7c1e65558ef4f4892f854da04d7e083847defd",label:"Alias",value:this.item.alias||"",placeholder:"Custom property name...",onChange:this.handleAliasChange,onBlur:this.handleAliasBlur})),this.showDescriptionInput&&e("div",{key:"b32b9b5006a9a48e44f5725f070f9bd376c8b15f",class:"description"},e("limel-input-field",{key:"98f63d70cc77c68cbf535d33210a8d5e0c15cf72",label:"Description",value:this.item.description||"",placeholder:"Describe this property for AI...",onChange:this.handleDescriptionChange,onBlur:this.handleDescriptionBlur}))]}};s.style=":host(limebb-response-format-item){display:flex;flex-direction:column;gap:0.5rem;width:100%}.property-controls{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(20rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center;padding-top:0.5rem}.control-buttons limel-icon-button{opacity:0.6;transition:opacity 0.2s ease}.control-buttons limel-icon-button:hover{opacity:1}.control-buttons limel-icon-button.has-value{opacity:1;color:rgb(var(--color-blue-default))}.alias,.description{padding-left:1.5rem;width:calc(100% - 1.5rem);max-width:40rem}@media (max-width: 768px){.property-controls{flex-direction:column;gap:0.5rem}.control-buttons{padding-top:0}.alias,.description{padding-left:0;width:100%}}";export{s as limebb_response_format_item}
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i}from"./p-1556b545.js";import{Z as r,T as o}from"./p-4838284a.js";import{g as n,a as s}from"./p-b748c770.js";const l=new Set(["$yesterday","$now","$today","$tomorrow","$this_week","$this_month","$this_quarter","$this_year"]),a=/^\$(previous|next)_(day|week|month|quarter|year)\(\d+\)$/,d=/^\$me(\.\w+)*$/;function c(t,e,i=!0){const r=Object.keys(t),o=[];if(i){const t=r.filter((t=>t.startsWith("#")&&"#description"!==t));t.length>0&&o.push(`Property '${e}' contains # properties not supported in GUI: ${t.join(", ")}`)}return{keys:r.filter((t=>"_alias"!==t&&!t.startsWith("#"))),guiLimitations:o}}function u(t,e,i,r,o,n=!0){if(""===t){if(n&&null!==e)throw new Error("Empty property name must have null value");return[]}const s=i[t];if(!s)throw new Error(`Property '${t}' does not exist on limetype '${o}'`);return s.relation?function(t,e,i,r,o=!0){if(null===e)return[];if("object"!=typeof e)throw new TypeError(`Relation property '${t}' must be null or an object`);const n=e,{keys:s,guiLimitations:l}=c(n,t,o);if(0===s.length)return l;const a=r.relation.getLimetype();if(!a)throw new Error(`Could not determine related limetype for property '${t}'`);const d={};for(const t of s)d[t]=n[t];const u=h(d,i,a.name,o);return[...l,...u]}(t,e,r,s,n):function(t,e,i=!0){if(null===e)return[];if("object"==typeof e){const{keys:r,guiLimitations:o}=c(e,t,i);if(0===r.length)return o;throw new Error(`Non-relation property '${t}' cannot have nested properties other than _alias or # properties (got: ${r.join(", ")})`)}throw new Error(`Non-relation property '${t}' must be null or an object (got ${typeof e})`)}(t,e,n)}function h(t,e,i,r=!0){const o=e[i];if(!o)throw new Error(`Unknown limetype: ${i}`);const n=s(o),l=[];for(const[o,s]of Object.entries(t)){if(o.startsWith("#"))continue;const t=u(o,s,n,e,i,r);l.push(...t)}return l}function m(t,e,i,o=!0){t&&("key"in t?function(t,e,i){if(!Object.values(r).includes(t.op))throw new Error(`Unsupported filter operator: ${t.op}`);const o=function(t,e,i){if(function(t){return"string"==typeof t&&(l.has(t)||a.test(t)||d.test(t))}(t))return{valid:!0};if("string"!=typeof t||!t.startsWith("%activeObject%"))return{valid:!0};if(!e)return{valid:!0};const r=t.replace(/^%activeObject%\.?/,"");if(!r)return{valid:!0};try{return n(i,e,r)?{valid:!0}:{valid:!1,error:`Property path '${r}' does not exist on limetype '${e}'`}}catch(t){return{valid:!1,error:`Invalid placeholder path: ${t.message}`}}}(t.exp,e,i);if(!o.valid)throw new Error(`Invalid placeholder in filter '${t.key}': ${o.error}`)}(t,e,i):"exp"in t&&function(t,e,i,o){if(t.op!==r.AND&&t.op!==r.OR&&t.op!==r.NOT)throw new Error(`Unsupported group operator: ${t.op}`);if(t.op===r.NOT)m(t.exp,e,i,o);else if(t.op===r.AND||t.op===r.OR){const r=t.exp;for(const t of r)m(t,e,i,o)}}(t,e,i,o))}function p(t,e,i,r){const o=[],s=function(t,e){return"object"!=typeof t||null===t?`orderBy[${e}] must be an object`:null}(t,e);if(s)return[s];const l=Object.keys(t),a=function(t,e){return 0===t.length?`orderBy[${e}] must have a property path`:t.length>1?`orderBy[${e}] must have exactly one property, got ${t.length}`:null}(l,e);if(a)return[a];const d=l[0],c=function(t,e){return"ASC"!==t&&"DESC"!==t?`orderBy[${e}]: direction must be 'ASC' or 'DESC', got '${t}'`:null}(t[d],e);c&&o.push(c);const u=function(t,e,i,r){if(!t||""===t)return null;return n(e,i,t)?null:`orderBy[${r}]: property path '${t}' does not exist on limetype '${i}'`}(d,i,r,e);return u&&o.push(u),o}function f(t,e,i,r=!0){if(!t)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};const o=[],n=[];if(t.limetype&&!e[t.limetype]&&o.push(`Unknown limetype: ${t.limetype}`),void 0===t.offset||t.orderBy||o.push("offset requires orderBy to be specified"),t.orderBy){const i=function(t,e,i){const r=[];if(!Array.isArray(t))return r.push("orderBy must be an array"),r;if(!i||!e[i])return r;for(const[o,n]of t.entries()){const t=p(n,o,e,i);r.push(...t)}return r}(t.orderBy,e,t.limetype);o.push(...i)}if(r&&void 0!==t.offset&&n.push("offset is not yet supported in GUI mode"),t.filter){const n=function(t,e,i,r){const o=[];try{m(t,e,i,r)}catch(t){o.push(`Invalid filter: ${t.message}`)}return o}(t.filter,i,e,r);o.push(...n)}if(t.responseFormat){const{errors:i,limitations:s}=function(t,e,i,r){const o=[],n=[];try{const o=function(t,e,i,r=!0){const o=[];if(r&&t.aggregates&&o.push("responseFormat.aggregates is not yet supported in GUI mode"),t.object){const n=h(t.object,e,i,r);o.push(...n)}return o}(t,e,i,r);n.push(...o)}catch(t){o.push(`Invalid responseFormat: ${t.message}`)}return{errors:o,limitations:n}}(t.responseFormat,e,t.limetype,r);o.push(...i),n.push(...s)}return{valid:0===o.length,guiSupported:0===n.length,validationErrors:o,guiLimitations:n}}const y=class{constructor(i){t(this,i),this.change=e(this,"change",7),this.mode="gui",this.codeValue="",this.limetype="",this.handleLimetypeChange=t=>{t.stopPropagation(),this.limetype=t.detail,this.filter=void 0,this.internalResponseFormat={object:{_id:null}},this.emitChange()},this.handleFilterChange=t=>{var e;t.stopPropagation(),this.filter=null!==(e=t.detail)&&void 0!==e?e:void 0,this.emitChange()},this.handleResponseFormatChange=t=>{t.stopPropagation(),this.internalResponseFormat=t.detail,this.emitChange()},this.handleLimitChange=t=>{t.stopPropagation();const e=t.detail;this.limit=e?Number.parseInt(e,10):void 0,this.emitChange()},this.handleOrderByChange=t=>{t.stopPropagation(),this.orderBy=t.detail,this.emitChange()},this.switchToGui=()=>{try{const t=JSON.parse(this.codeValue);if(!this.checkGuiSupport().guiSupported)return;this.limetype=t.limetype||"",this.filter=t.filter,this.internalResponseFormat=t.responseFormat,this.limit=t.limit,this.orderBy=t.orderBy,this.mode="gui",this.change.emit(t)}catch(t){}},this.switchToCode=()=>{this.updateCodeValue(),this.mode="code"},this.handleCodeChange=t=>{t.stopPropagation(),this.codeValue=t.detail;try{const t=JSON.parse(this.codeValue);this.change.emit(t)}catch(t){}}}get guiModeEnabled(){var t,e,i;return null!==(i=null===(e=null===(t=this.platform)||void 0===t?void 0:t.isFeatureEnabled)||void 0===e?void 0:e.call(t,"useLimeQueryBuilderGuiMode"))&&void 0!==i&&i}componentWillLoad(){if(!this.guiModeEnabled)return this.mode="code",void this.updateCodeValue();this.value&&(this.limetype=this.value.limetype||"",this.filter=this.value.filter,this.internalResponseFormat=this.value.responseFormat,this.limit=this.value.limit,this.orderBy=this.value.orderBy),this.updateCodeValue(),this.checkGuiSupport().guiSupported||(this.mode="code")}render(){const t=this.checkGuiSupport(),e=!this.guiModeEnabled||"code"===this.mode;return i("div",{key:"f51ae0459c1c7f482f3a790abb4cc3bd60b83e70",class:"lime-query-builder"},this.renderLabel(),this.renderModeControls(t),e?this.renderCodeMode(t):this.renderGuiMode())}emitChange(){"code"!==this.mode&&this.limetype&&this.change.emit(this.buildLimeQuery())}updateCodeValue(){this.codeValue=this.limetype?JSON.stringify(this.buildLimeQuery(),null,2):JSON.stringify(this.value||{},null,2)}buildLimeQuery(){const t={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter};return void 0!==this.limit&&this.limit>0&&(t.limit=this.limit),this.orderBy&&this.orderBy.length>0&&(t.orderBy=this.orderBy),t}checkGuiSupport(){if(!this.limetypes)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};let t;if("code"===this.mode&&this.codeValue)try{t=JSON.parse(this.codeValue)}catch(t){return{valid:!1,guiSupported:!1,validationErrors:["Invalid JSON"],guiLimitations:[]}}else{if(!this.limetype)return{valid:!0,guiSupported:!0,validationErrors:[],guiLimitations:[]};t={limetype:this.limetype,responseFormat:this.internalResponseFormat||{object:{_id:null}},filter:this.filter},void 0!==this.limit&&this.limit>0&&(t.limit=this.limit)}return f(t,this.limetypes,this.activeLimetype,this.guiModeEnabled)}renderModeSwitch(t){return i("div",{class:"mode-switch"},i("limel-button",{label:"GUI",primary:"gui"===this.mode,disabled:!t.guiSupported,onClick:this.switchToGui}),i("limel-button",{label:"Code",primary:"code"===this.mode,onClick:this.switchToCode}))}renderCodeEditor(t){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}),!t.valid&&t.validationErrors.length>0&&i("div",{class:"validation-errors"},i("strong",null,"Invalid Lime Query:"),i("ul",null,t.validationErrors.map((t=>i("li",null,t))))),this.guiModeEnabled&&t.valid&&!t.guiSupported&&t.guiLimitations.length>0&&i("div",{class:"gui-limitations"},i("strong",null,"Cannot switch to GUI mode:"),i("ul",null,t.guiLimitations.map((t=>i("li",null,t))))))}renderLimetypeSection(){return i("div",{class:"limetype-section"},i("limebb-limetype-field",{platform:this.platform,context:this.context,label:"Object Type",value:this.limetype,required:!0,fieldName:"limetype",helperText:"Select the type of object you want to query",onChange:this.handleLimetypeChange}))}renderResponseFormatSection(){if(this.limetype)return i("div",{class:"response-format-section"},i("limebb-response-format-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.internalResponseFormat,onChange:this.handleResponseFormatChange}))}renderFilterSection(){if(this.limetype)return i("div",{class:"filter-section"},i("h4",{class:"section-label"},"Filter Conditions"),i("limebb-lime-query-filter-builder",{platform:this.platform,context:this.context,limetype:this.limetype,activeLimetype:this.activeLimetype,expression:this.filter,onExpressionChange:this.handleFilterChange}))}renderQueryOptionsSection(){var t;if(this.limetype)return i("div",{class:"query-options-section"},i("h4",{class:"section-label"},"Query Options"),i("div",{class:"query-options-controls"},i("limel-input-field",{label:"Limit",type:"number",value:(null===(t=this.limit)||void 0===t?void 0:t.toString())||"",placeholder:"No limit",helperText:"Maximum number of results",onChange:this.handleLimitChange}),i("limebb-lime-query-order-by-editor",{platform:this.platform,context:this.context,limetype:this.limetype,value:this.orderBy,onChange:this.handleOrderByChange})))}renderGuiMode(){return i("div",{class:"gui-mode"},this.renderLimetypeSection(),this.renderResponseFormatSection(),this.renderFilterSection(),this.renderQueryOptionsSection())}renderLabel(){if(this.label)return i("h3",{class:"lime-query-builder-label"},this.label)}renderModeControls(t){if(this.guiModeEnabled)return i("div",{class:"mode-controls"},this.renderModeSwitch(t))}renderCodeMode(t){return i("div",{class:"code-mode"},this.renderCodeEditor(t))}};(function(t,e,i,r){var o,n=arguments.length,s=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(n<3?o(s):n>3?o(e,i,s):o(e,i))||s);n>3&&s&&Object.defineProperty(e,i,s)})([o()],y.prototype,"limetypes",void 0),y.style=":host(limebb-lime-lime-query-builder){display:block;width:100%}.lime-query-builder{display:flex;flex-direction:column;gap:2rem}.mode-controls{display:flex;align-items:center;gap:0.5rem;padding:0.5rem}.mode-switch{display:flex;align-items:center;gap:0.5rem}.mode-switch limel-button{min-width:5rem}.mode-switch limel-helper-text{margin-left:1rem;color:rgb(var(--color-red-default))}.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}.lime-query-builder-label{margin:0;font-size:1.5rem;font-weight:600;color:rgb(var(--contrast-1100))}.limetype-section{display:flex;flex-direction:column}.filter-section,.query-options-section{display:flex;flex-direction:column;gap:1rem}.section-label{margin:0;font-size:1.125rem;font-weight:600;color:rgb(var(--contrast-1000))}.query-options-controls{display:flex;flex-direction:column;gap:1rem}@media (max-width: 768px){.lime-query-builder{gap:1.5rem}}";export{y as limebb_lime_query_builder}
@@ -1 +0,0 @@
1
- import{r as e,c as t,h as i}from"./p-1556b545.js";const o=class{constructor(i){e(this,i),this.itemChange=t(this,"itemChange",7),this.handlePathChange=e=>{e.stopPropagation();const t=e.detail;if(!t){const e=this.item[Object.keys(this.item)[0]]||"ASC";return void this.itemChange.emit({"":e})}const i=Object.keys(this.item)[0],o=this.item[i]||"ASC";this.itemChange.emit({[t]:o})},this.handleToggleDirection=()=>{const e=Object.keys(this.item)[0]||"",t="ASC"===(this.item[e]||"ASC")?"DESC":"ASC";this.itemChange.emit({[e]:t})},this.handleRemove=()=>{this.itemChange.emit(null)}}render(){const e=Object.keys(this.item)[0]||"",t=this.item[e]||"ASC";return i("div",{key:"e0faeb5b370d8aba00a668f0861e8e1cb4eec495",class:"order-by-controls"},i("div",{key:"d013e829ca193b6ce9cc3756c3700584984f4478",class:"property-path"},i("limebb-property-selector",{key:"11dee28e5de28d0dc6934abdfe613e87a8b8fbed",platform:this.platform,context:this.context,limetype:this.limetype,label:"Property",value:e,required:!0,onChange:this.handlePathChange})),i("div",{key:"66aa416b1f9683a15357d609e3685379d8993733",class:"control-buttons"},i("limel-icon-button",{key:"360f271ecd3cf42581ae21617d297c84ee93569e",icon:"ASC"===t?"sort_ascending":"sort_descending",label:"ASC"===t?"Ascending":"Descending",onClick:this.handleToggleDirection}),i("limel-icon-button",{key:"3cbb13bff679a0ca95bb30b7853551b8bc276520",icon:"trash",label:"Remove",onClick:this.handleRemove})))}};o.style=":host(limebb-lime-query-order-by-item){display:flex;flex-direction:column;gap:0.5rem;width:100%}.order-by-controls{display:flex;flex-direction:row;align-items:flex-start;gap:0.5rem;width:100%}.property-path{flex-grow:1;min-width:min(20rem, 100%)}.control-buttons{flex-shrink:0;display:flex;flex-direction:row;gap:0.25rem;align-items:center;padding-top:0.5rem}.control-buttons limel-icon-button{opacity:0.6;transition:opacity 0.2s ease}.control-buttons limel-icon-button:hover{opacity:1}@media (max-width: 768px){.order-by-controls{flex-direction:column;gap:0.5rem}.control-buttons{padding-top:0}}";export{o as limebb_lime_query_order_by_item}