@limetech/lime-web-components 6.13.2-dev.1 → 6.15.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.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,24 @@
1
- ## [6.13.2-dev.1](https://github.com/Lundalogik/lime-web-components/compare/v6.13.1...v6.13.2-dev.1) (2026-03-28)
1
+ ## [6.15.0](https://github.com/Lundalogik/lime-web-components/compare/v6.14.0...v6.15.0) (2026-04-29)
2
2
 
3
3
 
4
+ ### Features
5
+
6
+
7
+ * **conditionregistry:** add support for metadata for conditions ([6199f5b](https://github.com/Lundalogik/lime-web-components/commit/6199f5b9c8de3a0f6c4b55345554d3a1a928bae1))
8
+
4
9
  ### Bug Fixes
5
10
 
6
11
 
7
- * **limeobject/repository:** possible to exclude aggregates ([9d5c4fc](https://github.com/Lundalogik/lime-web-components/commit/9d5c4fcd85549c7eba15e2a99ec82fddf34e0615))
12
+ * **conditionregistry:** improve typing of conditions ([c627b1c](https://github.com/Lundalogik/lime-web-components/commit/c627b1c1e9d6d0f571bde92cbf1f842235aed497))
13
+ * **conditionregistry:** make evaluate bivariant ([16c63a2](https://github.com/Lundalogik/lime-web-components/commit/16c63a2e6e57057288ed4e0b39e5cb08742d45e9))
14
+
15
+ ## [6.14.0](https://github.com/Lundalogik/lime-web-components/compare/v6.13.1...v6.14.0) (2026-04-17)
16
+
17
+
18
+ ### Features
19
+
20
+
21
+ * **ai-context:** add contextType to GatheredAIContext ([de015ef](https://github.com/Lundalogik/lime-web-components/commit/de015ef191004bd9f0933a313938bdb120d8e8e6)), closes [Lundalogik/limeclient.js#969](https://github.com/Lundalogik/limeclient.js/issues/969)
8
22
 
9
23
  ## [6.13.1](https://github.com/Lundalogik/lime-web-components/compare/v6.13.0...v6.13.1) (2026-02-27)
10
24
 
@@ -67,6 +67,14 @@ export interface AIContextContribution {
67
67
  * @group AI Context
68
68
  */
69
69
  export interface GatheredAIContext extends AIContextContribution {
70
+ /**
71
+ * The provider's {@link AIContextProvider.contextType | contextType} label.
72
+ *
73
+ * Identifies the kind of context this contribution represents
74
+ * (e.g. `'current-user'`, `'table-view'`, `'explorer-view'`).
75
+ * Copied from the provider by the registry at gather time.
76
+ */
77
+ type: string;
70
78
  /**
71
79
  * The component's {@link LimeWebComponentContext} at the time of gathering.
72
80
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ai-context-registry.d.ts","sourceRoot":"","sources":["../../src/ai-context/ai-context-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IAClC;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAEjC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,eAAe,EAAE,uBAAuB,CAAC;CAC5C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B;;;;;;;;;;;;;OAaG;IACH,UAAU,IAAI,qBAAqB,GAAG,IAAI,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,QAAQ,CACJ,QAAQ,EAAE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QAAQ,EAAE,iBAAiB,EAC3B,OAAO,EAAE,WAAW,GAAG,gBAAgB,GACxC,MAAM,IAAI,CAAC;IAEd;;;;;;OAMG;IACH,YAAY,IAAI,iBAAiB,EAAE,CAAC;IAEpC;;;;;;;;;;;OAWG;IACH,aAAa,IAAI,iBAAiB,EAAE,CAAC;CACxC"}
@@ -1,5 +1,6 @@
1
1
  import { Action } from '../action';
2
2
  import { LimeObject } from '../limeobject';
3
+ import { ConfigMetadata } from '../core';
3
4
  /**
4
5
  * Represents a conditional evaluation rule that can be registered and used
5
6
  * throughout the application.
@@ -64,7 +65,7 @@ export type Condition<T = unknown> = {
64
65
  *
65
66
  * Custom types can be defined for specialized evaluation contexts.
66
67
  */
67
- type: string;
68
+ type: ConditionType;
68
69
  /**
69
70
  * The evaluation function that determines if the condition is met.
70
71
  *
@@ -98,7 +99,7 @@ export type Condition<T = unknown> = {
98
99
  * };
99
100
  * ```
100
101
  */
101
- evaluate: (subject: T, params?: unknown) => boolean;
102
+ evaluate(subject: T, params?: unknown): boolean;
102
103
  /**
103
104
  * Unique identifier for this condition.
104
105
  *
@@ -203,7 +204,7 @@ export type ActionCondition = Condition<Action> & {
203
204
  * @beta
204
205
  * @group Conditions
205
206
  */
206
- export declare function isLimeObjectCondition(condition: Condition): condition is Condition<LimeObject>;
207
+ export declare function isLimeObjectCondition(condition: Condition): condition is LimeObjectCondition;
207
208
  /**
208
209
  * Check if condition expects an action to be passed when it is evaluated
209
210
  *
@@ -214,7 +215,7 @@ export declare function isLimeObjectCondition(condition: Condition): condition i
214
215
  * @beta
215
216
  * @group Conditions
216
217
  */
217
- export declare function isActionCondition(condition: Condition): condition is Condition<Action>;
218
+ export declare function isActionCondition(condition: Condition): condition is ActionCondition;
218
219
  /**
219
220
  * Central registry for managing conditional evaluation rules across the application.
220
221
  *
@@ -286,6 +287,7 @@ export interface ConditionRegistry {
286
287
  * It's recommended to register conditions during application startup.
287
288
  *
288
289
  * @param condition - The condition to register. Must have a unique ID.
290
+ * @param metadata - Optional metadata associated with the condition.
289
291
  * @throws Error if a condition with the same ID already exists in the registry.
290
292
  *
291
293
  * @example
@@ -299,7 +301,7 @@ export interface ConditionRegistry {
299
301
  * registry.addCondition(isActive);
300
302
  * ```
301
303
  */
302
- addCondition(condition: Condition): any;
304
+ addCondition<T extends Condition = Condition>(condition: T, metadata?: ConfigMetadata): void;
303
305
  /**
304
306
  * Removes a condition from the registry.
305
307
  *
@@ -323,7 +325,7 @@ export interface ConditionRegistry {
323
325
  * }
324
326
  * ```
325
327
  */
326
- removeCondition(condition: Condition): any;
328
+ removeCondition(condition: Condition): void;
327
329
  /**
328
330
  * Checks whether a condition with the given ID exists in the registry.
329
331
  *
@@ -388,5 +390,52 @@ export interface ConditionRegistry {
388
390
  * ```
389
391
  */
390
392
  getCondition(id: string): Condition;
393
+ /**
394
+ * Retrieves metadata for all conditions in the registry.
395
+ *
396
+ * This method returns an array of metadata objects containing information
397
+ * about all registered conditions, including their IDs, types, and configuration details.
398
+ *
399
+ * @returns An array of condition metadata objects, or undefined if not supported by the registry implementation.
400
+ *
401
+ * @example
402
+ * ```typescript
403
+ * const allMetadata = registry.getAllMetadata();
404
+ * if (allMetadata) {
405
+ * allMetadata.forEach(meta => {
406
+ * console.log(`Condition: ${meta.id}, Type: ${meta.type}, Title: ${meta.title}`);
407
+ * });
408
+ * }
409
+ * ```
410
+ */
411
+ getAllMetadata?(): ConditionMetadata[];
391
412
  }
413
+ /**
414
+ * Metadata for a condition
415
+ *
416
+ * @group Conditions
417
+ * @beta
418
+ */
419
+ export type ConditionMetadata = ConfigMetadata & {
420
+ /**
421
+ * Unique identifier of the condition
422
+ */
423
+ id: string;
424
+ /**
425
+ * Type identifier indicating the kind of subject this condition evaluates
426
+ */
427
+ type: ConditionType;
428
+ };
429
+ /**
430
+ * Type identifier for a condition
431
+ *
432
+ * Specifies the kind of subject the condition evaluates.
433
+ * - `'limeobject'`: Condition evaluates LimeObject instances
434
+ * - `'action'`: Condition evaluates Action instances
435
+ * Custom string types can also be used for domain-specific conditions
436
+ *
437
+ * @group Conditions
438
+ * @beta
439
+ */
440
+ export type ConditionType = 'limeobject' | 'action' | (string & {});
392
441
  //# sourceMappingURL=conditionregistry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditionregistry.d.ts","sourceRoot":"","sources":["../../src/conditionregistry/conditionregistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,OAAO,IAAI;IACjC;;;;;;;;OAQG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IAEpD;;;;;;OAMG;IACH,EAAE,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,MAAM,mBAAmB,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG;IACtD,IAAI,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG;IAC9C,IAAI,EAAE,QAAQ,CAAC;CAClB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACjC,SAAS,EAAE,SAAS,GACrB,SAAS,IAAI,SAAS,CAAC,UAAU,CAAC,CAEpC;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC7B,SAAS,EAAE,SAAS,GACrB,S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