@adaptabletools/adaptable 16.0.0 → 16.0.1-canary.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "16.0.0",
3
+ "version": "16.0.1-canary.0",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1691761279963;
1
+ declare const _default: 1691780853920;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1691761279963;
3
+ exports.default = 1691780853920;
@@ -1,7 +1,7 @@
1
1
  import { ChartContext, ChatInitSettingsContext, ContactContext, ContactListContext, CountryContext, CurrencyContext, EmailContext, Fdc3Context, Fdc3ContextType, Fdc3CustomContext, Fdc3CustomContextType, InstrumentContext, InstrumentListContext, OrganizationContext, PortfolioContext, PositionContext, TimeRangeContext, ValuationContext } from '../PredefinedConfig/Common/Fdc3Context';
2
2
  import { BaseContext } from '../PredefinedConfig/Common/BaseContext';
3
3
  import { IRowNode } from '@ag-grid-community/core';
4
- import { Context, ContextMetadata, IntentResult } from '@finos/fdc3';
4
+ import { Context, ContextMetadata, IntentResolution, IntentResult } from '@finos/fdc3';
5
5
  import { CompatibleContext, Fdc3CustomIntentType, Fdc3IntentType } from '../PredefinedConfig/Common/Fdc3Intent';
6
6
  import { AdaptableIcon } from '../PredefinedConfig/Common/AdaptableIcon';
7
7
  import { ButtonStyle } from '../PredefinedConfig/Common/ButtonStyle';
@@ -201,6 +201,7 @@ export interface RaiseIntentConfig<K extends Fdc3IntentType = any> {
201
201
  button: Fdc3AdaptableButton;
202
202
  width?: number;
203
203
  };
204
+ handleIntentResolution?: (context: HandleFdc3IntentResolutionContext) => Promise<IntentResult>;
204
205
  }
205
206
  export interface BroadcastConfig {
206
207
  contextMenu?: {
@@ -214,6 +215,15 @@ export interface BroadcastConfig {
214
215
  defaultWidth?: number;
215
216
  };
216
217
  }
218
+ /**
219
+ * Context provided in `handleIntentResolution` callback
220
+ */
221
+ export interface HandleFdc3IntentResolutionContext extends BaseContext {
222
+ /**
223
+ * The FDC3 Intent Resolution
224
+ */
225
+ intentResolution: IntentResolution;
226
+ }
217
227
  /**
218
228
  * Context provided in dynamic FDC3 Buttons
219
229
  */
@@ -1,6 +1,7 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
2
  import { Fdc3Context, Fdc3ContextType, Fdc3CustomContextType } from '../../PredefinedConfig/Common/Fdc3Context';
3
3
  import { ColDef, IRowNode } from '@ag-grid-community/core';
4
+ import { AppIdentifier, Context, IntentResolution } from '@finos/fdc3';
4
5
  import { AdaptableButton } from '../../PredefinedConfig/Common/AdaptableButton';
5
6
  import { ActionColumnContext } from '../../AdaptableOptions/ActionColumnOptions';
6
7
  export declare class Fdc3InternalApi extends ApiBase {
@@ -14,6 +15,7 @@ export declare class Fdc3InternalApi extends ApiBase {
14
15
  getButtonsForFdc3StandaloneActionColumn(columnId: string): AdaptableButton<ActionColumnContext<any>>[];
15
16
  isFdc3MainActionColumn(columnId: string): boolean;
16
17
  isFdc3StandaloneActionColumn(columnId: string, columnType: string | string[]): boolean;
18
+ handleIntentResolution(intentResolution: IntentResolution, context: Context, raisedIntent: string, app?: AppIdentifier): void;
17
19
  private isAtLeastOneActionButtonConfigured;
18
20
  private getIntentConfigsWithActionButtons;
19
21
  private getCustomIntentConfigsWithActionButtons;
@@ -247,6 +247,17 @@ class Fdc3InternalApi extends ApiBase_1.ApiBase {
247
247
  const types = typeof columnType === 'string' ? [columnType] : columnType;
248
248
  return types.includes(GeneralConstants_1.AB_FDC3_COLUMN) && !this.isFdc3MainActionColumn(columnId);
249
249
  }
250
+ handleIntentResolution(intentResolution, context, raisedIntent, app) {
251
+ var _a, _b, _c;
252
+ const raiseIntents = (_a = this.getFdc3Options().intents) === null || _a === void 0 ? void 0 : _a.raises;
253
+ const raiseCustomIntents = (_b = this.getFdc3Options().customIntents) === null || _b === void 0 ? void 0 : _b.raises;
254
+ const raiseAllIntents = Object.assign(Object.assign({}, raiseIntents), raiseCustomIntents);
255
+ const raiseIntentConfig = raiseAllIntents === null || raiseAllIntents === void 0 ? void 0 : raiseAllIntents[raisedIntent];
256
+ if (raiseIntentConfig === null || raiseIntentConfig === void 0 ? void 0 : raiseIntentConfig.length) {
257
+ const relevantContextConfig = raiseIntentConfig.find((config) => config.contextType === context.type);
258
+ (_c = relevantContextConfig === null || relevantContextConfig === void 0 ? void 0 : relevantContextConfig.handleIntentResolution) === null || _c === void 0 ? void 0 : _c.call(relevantContextConfig, Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { intentResolution }));
259
+ }
260
+ }
250
261
  isAtLeastOneActionButtonConfigured() {
251
262
  return (!!Object.keys(this.getIntentConfigsWithActionButtons()).length ||
252
263
  !!Object.keys(this.getContextConfigsWithActionButtons()).length ||
@@ -59,15 +59,20 @@ class Fdc3Service {
59
59
  this.contextHandlerSubscriptions.forEach((subscription) => subscription.unsubscribe());
60
60
  this.intentHandlerSubscriptions.forEach((subscription) => subscription.unsubscribe());
61
61
  }
62
- raiseIntent(intent, context, app) {
62
+ async raiseIntent(intent, context, app) {
63
63
  var _a;
64
64
  this.logFdc3Event('OUT', `raise ${intent}`, JSON.stringify(context));
65
- return (_a = this.getDesktopAgent()) === null || _a === void 0 ? void 0 : _a.raiseIntent(intent, context, app);
65
+ const intentResolution = await ((_a = this.getDesktopAgent()) === null || _a === void 0 ? void 0 : _a.raiseIntent(intent, context, app));
66
+ this.getFdc3Api().internalApi.handleIntentResolution(intentResolution, context, intent, app);
67
+ return intentResolution;
66
68
  }
67
- raiseIntentForContext(context, app) {
69
+ async raiseIntentForContext(context, app) {
68
70
  var _a;
69
71
  this.logFdc3Event('OUT', `raise for context`, JSON.stringify(context));
70
- return (_a = this.getDesktopAgent()) === null || _a === void 0 ? void 0 : _a.raiseIntentForContext(context, app);
72
+ const intentResolution = await ((_a = this.getDesktopAgent()) === null || _a === void 0 ? void 0 : _a.raiseIntentForContext(context, app));
73
+ // TODO AFL
74
+ // this.getFdc3Api().internalApi.handleIntentResolution(intentResolution, context, null, app);
75
+ return intentResolution;
71
76
  }
72
77
  broadcast(context) {
73
78
  var _a;
@@ -3433,6 +3433,17 @@ export declare const ADAPTABLE_METAMODEL: {
3433
3433
  desc: string;
3434
3434
  }[];
3435
3435
  };
3436
+ HandleFdc3IntentResolutionContext: {
3437
+ name: string;
3438
+ kind: string;
3439
+ desc: string;
3440
+ props: {
3441
+ name: string;
3442
+ kind: string;
3443
+ desc: string;
3444
+ ref: string;
3445
+ }[];
3446
+ };
3436
3447
  IAdaptableNoCodeWizard: {
3437
3448
  name: string;
3438
3449
  kind: string;