lucid-extension-sdk 0.0.438 → 0.0.439

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/commandtypes.d.ts CHANGED
@@ -747,6 +747,21 @@ export type AddCardsActions = {
747
747
  };
748
748
  export type AutoSyncSettings = {
749
749
  'h': string;
750
+ /** Phrases */
751
+ 'p'?: {
752
+ /** Header */
753
+ 'h': string;
754
+ /** query placeholder */
755
+ 'qph': string;
756
+ /**remove non matching label */
757
+ 'rnml': string;
758
+ /**no matched label */
759
+ 'nml': string;
760
+ /**syncing growl message*/
761
+ 'sgm'?: string | undefined;
762
+ /**removing growl message */
763
+ 'rgm'?: string | undefined;
764
+ };
750
765
  'gsf': string;
751
766
  'sqs'?: string | undefined;
752
767
  'syqs'?: string | undefined;
@@ -762,6 +777,8 @@ export type SerializedFieldConfiguration = {
762
777
  'dsc'?: string | undefined;
763
778
  /** Custom field display settings */
764
779
  'cfds'?: SerializedCustomFieldDisplaySettings;
780
+ /** Non-customizable fields */
781
+ 'ncf'?: string[] | undefined;
765
782
  };
766
783
  export type AddCardIntegrationQuery = {
767
784
  /** Title/name */
@@ -221,7 +221,6 @@ export declare function serializeLucidCardFieldDisplaySettings(settings: LucidCa
221
221
  export declare function deserializeLucidCardFieldDisplaySettings(settings: SerializedLucidCardFieldDisplaySettings): LucidCardFieldDisplaySettings;
222
222
  /**
223
223
  * These are the six possible values for the status of a basic card block.
224
- * Must be kept in sync with cake/app/webroot/ts/libraries/lucidcards/lucidcarddefaultstatus.ts
225
224
  */
226
225
  export declare enum StatusValues {
227
226
  New = "New",
@@ -189,10 +189,10 @@ function deserializeLucidCardFieldDisplaySettings(settings) {
189
189
  exports.deserializeLucidCardFieldDisplaySettings = deserializeLucidCardFieldDisplaySettings;
190
190
  /**
191
191
  * These are the six possible values for the status of a basic card block.
192
- * Must be kept in sync with cake/app/webroot/ts/libraries/lucidcards/lucidcarddefaultstatus.ts
193
192
  */
194
193
  var StatusValues;
195
194
  (function (StatusValues) {
195
+ // IMPORTANT: Must be kept in sync with cake/app/webroot/ts/libraries/lucidcards/lucidcarddefaultstatus.ts
196
196
  StatusValues["New"] = "New";
197
197
  StatusValues["Todo"] = "To Do";
198
198
  StatusValues["InProgress"] = "In Progress";
@@ -12,9 +12,13 @@ export declare const AutoSyncPaginationSize = 50;
12
12
  */
13
13
  export interface CardIntegrationAutoSyncConfig {
14
14
  /**
15
- * The header to display for the integration in the autosync modal.
15
+ * @deprecated Use AutoSyncConfigPhrasesType instead.
16
16
  */
17
17
  header: string;
18
+ /**
19
+ * The phrases to use for the auto sync callout. This is used to display the correct strings in the UI.
20
+ */
21
+ phrases?: AutoSyncConfigPhrasesType | undefined;
18
22
  /**
19
23
  * Callback that should return a single field that users can use to determine which instance, workspace,
20
24
  * organization (or any equivalent field for an extension) so that the data source id can be caluclated
@@ -36,3 +40,33 @@ export interface CardIntegrationAutoSyncConfig {
36
40
  */
37
41
  syncQueryString?: (queryString: string, otherFields: Map<string, SerializedFieldType>) => Promise<ImportResult | ImportResult[]>;
38
42
  }
43
+ export interface AutoSyncConfigPhrasesType {
44
+ /**
45
+ * The header to display for the integration in the autosync modal.
46
+ */
47
+ header: string;
48
+ /**
49
+ * The query placeholder string to display for the integration. For example, the Jira integration displays "Search with a JQL query..."
50
+ */
51
+ queryPlaceholder: string;
52
+ /**
53
+ * The string to display for the checkbox to set if non-matching items would be removed for syncing. For example, the Jira integration displays "Remove issues that don't match this query"
54
+ */
55
+ removeNonMatchingLabel: (generator: SupportedAutoSyncGeneratorType) => string;
56
+ /**
57
+ * The string to display when there are no matched items. For example, the Jira integration displays "No issues matched your search query"
58
+ */
59
+ noMatchedLabel: string;
60
+ /**
61
+ * If defined, A growl would show up with the string when the cards are syncing / importing into generators. For example, the Jira integration displays "Syncing 1 issue" or "Syncing 5 issues"
62
+ */
63
+ syncingGrowlMessage?: ((count: number) => string) | undefined;
64
+ /**
65
+ * If defined, A growl would show up with the string when cards gets removed because of they are not matched with the query . For example, the Jira integration displays "1 Jira issue removed" or "5 Jira issues removed"
66
+ */
67
+ removingGrowlMessage?: ((count: number) => string) | undefined;
68
+ }
69
+ export declare enum SupportedAutoSyncGeneratorType {
70
+ Timeline = "timeline"
71
+ }
72
+ export declare const isSupportedAutoSyncGeneratorType: (x: unknown) => x is SupportedAutoSyncGeneratorType.Timeline;
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AutoSyncPaginationSize = void 0;
3
+ exports.isSupportedAutoSyncGeneratorType = exports.SupportedAutoSyncGeneratorType = exports.AutoSyncPaginationSize = void 0;
4
+ const validators_1 = require("../validators/validators");
4
5
  /**
5
6
  * The amount of results that will be displayed per page when using pagination. To enable pagination, define the
6
7
  * {@link SearchResult.itemsPerSearchResult} field in your search results and return workitems equal to this variable's
7
8
  * value.
8
9
  */
9
10
  exports.AutoSyncPaginationSize = 50;
11
+ var SupportedAutoSyncGeneratorType;
12
+ (function (SupportedAutoSyncGeneratorType) {
13
+ SupportedAutoSyncGeneratorType["Timeline"] = "timeline";
14
+ })(SupportedAutoSyncGeneratorType || (exports.SupportedAutoSyncGeneratorType = SupportedAutoSyncGeneratorType = {}));
15
+ exports.isSupportedAutoSyncGeneratorType = (0, validators_1.stringEnumValidator)(SupportedAutoSyncGeneratorType);
@@ -23,17 +23,27 @@ export interface SearchParam {
23
23
  'o': number;
24
24
  'l': number;
25
25
  }
26
+ /** @ignore */
26
27
  export interface QuerySearchParam {
27
28
  'qs': string;
28
29
  'of': [string, SerializedFieldType][];
29
30
  'pn': number | undefined;
30
31
  'npt': string | undefined;
31
32
  }
33
+ /** @ignore */
32
34
  export interface QuerySyncParam {
33
35
  'qs': string;
34
36
  'of': [string, SerializedFieldType][];
35
37
  }
36
38
  /** @ignore */
39
+ export interface QuerySyncRemoveNonMatchingLabelParam {
40
+ 'g': string;
41
+ }
42
+ /** @ignore */
43
+ export interface QuerySyncGrowlMessageParam {
44
+ 'c': number;
45
+ }
46
+ /** @ignore */
37
47
  export interface ImportParam {
38
48
  'pks': string[];
39
49
  's': [string, SerializedFieldType][];
@@ -9,6 +9,7 @@ const importcardfrompastedlinkeventmessage_1 = require("../../message/importcard
9
9
  const checks_1 = require("../checks");
10
10
  const importcardfromdetails_1 = require("../importcardfromdetails/importcardfromdetails");
11
11
  const cardintegrationdefinitions_1 = require("../sharedcardintegration/cardintegrationdefinitions");
12
+ const cardintegrationautosyncconfig_1 = require("./cardintegrationautosyncconfig");
12
13
  const cardintegrationconfig_1 = require("./cardintegrationconfig");
13
14
  const lucidcardintegrationcustomimportmodal_1 = require("./lucidcardintegrationcustomimportmodal");
14
15
  const useritemeditpermissions_1 = require("./useritemeditpermissions");
@@ -236,7 +237,7 @@ class LucidCardIntegrationRegistry {
236
237
  * Register a card integration.
237
238
  */
238
239
  static addCardIntegration(client, cardIntegration) {
239
- var _a, _b, _c, _d;
240
+ var _a, _b, _c, _d, _e, _f;
240
241
  const getFieldsActionName = LucidCardIntegrationRegistry.nextHookName();
241
242
  client.registerAction(getFieldsActionName, async (param) => {
242
243
  const dataSource = new datasourceproxy_1.DataSourceProxy(param['d'], client);
@@ -384,6 +385,35 @@ class LucidCardIntegrationRegistry {
384
385
  'h': autoSync.header,
385
386
  'gsf': LucidCardIntegrationRegistry.nextHookName(),
386
387
  };
388
+ if (autoSync.phrases) {
389
+ serialized['as']['p'] = {
390
+ 'h': autoSync.phrases.header,
391
+ 'qph': autoSync.phrases.queryPlaceholder,
392
+ 'rnml': LucidCardIntegrationRegistry.nextHookName(),
393
+ 'nml': autoSync.phrases.noMatchedLabel,
394
+ };
395
+ client.registerAction(serialized['as']['p']['rnml'], ({ 'g': inputSoFar }) => {
396
+ var _a;
397
+ if (!(0, cardintegrationautosyncconfig_1.isSupportedAutoSyncGeneratorType)(inputSoFar)) {
398
+ return '';
399
+ }
400
+ return (_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.removeNonMatchingLabel(inputSoFar);
401
+ });
402
+ if ((_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.syncingGrowlMessage) {
403
+ serialized['as']['p']['sgm'] = LucidCardIntegrationRegistry.nextHookName();
404
+ client.registerAction(serialized['as']['p']['sgm'], ({ 'c': count }) => {
405
+ var _a, _b;
406
+ return (_b = (_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.syncingGrowlMessage) === null || _b === void 0 ? void 0 : _b.call(_a, count);
407
+ });
408
+ }
409
+ if ((_b = autoSync.phrases) === null || _b === void 0 ? void 0 : _b.removingGrowlMessage) {
410
+ serialized['as']['p']['rgm'] = LucidCardIntegrationRegistry.nextHookName();
411
+ client.registerAction(serialized['as']['p']['rgm'], ({ 'c': count }) => {
412
+ var _a, _b;
413
+ return (_b = (_a = autoSync.phrases) === null || _a === void 0 ? void 0 : _a.removingGrowlMessage) === null || _b === void 0 ? void 0 : _b.call(_a, count);
414
+ });
415
+ }
416
+ }
387
417
  client.registerAction(serialized['as']['gsf'], async ({ 'i': inputSoFar }) => {
388
418
  const result = await autoSync.getSyncDataSourceIdField(new Map(inputSoFar));
389
419
  return (0, cardintegrationdefinitions_1.serializeCardFieldArrayDefinition)(result);
@@ -416,10 +446,13 @@ class LucidCardIntegrationRegistry {
416
446
  if (cardIntegration.fieldConfiguration.customFieldDisplaySettings) {
417
447
  serialized['fc']['cfds'] = {
418
448
  'd': cardIntegration.fieldConfiguration.customFieldDisplaySettings.defaultToMultilineText,
419
- 'uri': (_b = (_a = cardIntegration.fieldConfiguration) === null || _a === void 0 ? void 0 : _a.customFieldDisplaySettings) === null || _b === void 0 ? void 0 : _b.useRoundIcons,
420
- 'dadr': (_d = (_c = cardIntegration.fieldConfiguration) === null || _c === void 0 ? void 0 : _c.customFieldDisplaySettings) === null || _d === void 0 ? void 0 : _d.displayMappedDatesAsDateRange,
449
+ 'uri': (_d = (_c = cardIntegration.fieldConfiguration) === null || _c === void 0 ? void 0 : _c.customFieldDisplaySettings) === null || _d === void 0 ? void 0 : _d.useRoundIcons,
450
+ 'dadr': (_f = (_e = cardIntegration.fieldConfiguration) === null || _e === void 0 ? void 0 : _e.customFieldDisplaySettings) === null || _f === void 0 ? void 0 : _f.displayMappedDatesAsDateRange,
421
451
  };
422
452
  }
453
+ if (cardIntegration.fieldConfiguration.nonCustomizableFields) {
454
+ serialized['fc']['ncf'] = cardIntegration.fieldConfiguration.nonCustomizableFields;
455
+ }
423
456
  this.registerDependencyMapping(client, cardIntegration, serialized);
424
457
  this.registerImportCardFromPastedLinkHandler(client, cardIntegration, serialized);
425
458
  if (cardIntegration.importFromSerializedFields) {
@@ -14,8 +14,6 @@
14
14
  * Integration Simplicity: Simplifies the process of integrating new data sources into Lucid by mapping to an established set of Lucid Fields.
15
15
  * Feature Compatibility: Allows for seamless use of Lucid’s intelligent features across all data, regardless of its origin.
16
16
  * Data Organization: Provides a structured approach to organizing and grouping data within the Lucid ecosystem.
17
- *
18
- * Must be kept in sync with src/jvm/com/lucidchart/data/model/fielddefinition/LucidFields.scala
19
17
  */
20
18
  export declare enum LucidFields {
21
19
  /**
@@ -18,11 +18,10 @@ const validators_1 = require("../../validators/validators");
18
18
  * Integration Simplicity: Simplifies the process of integrating new data sources into Lucid by mapping to an established set of Lucid Fields.
19
19
  * Feature Compatibility: Allows for seamless use of Lucid’s intelligent features across all data, regardless of its origin.
20
20
  * Data Organization: Provides a structured approach to organizing and grouping data within the Lucid ecosystem.
21
- *
22
- * Must be kept in sync with src/jvm/com/lucidchart/data/model/fielddefinition/LucidFields.scala
23
21
  */
24
22
  var LucidFields;
25
23
  (function (LucidFields) {
24
+ // IMPORTANT: this enum must be kept in sync with src/jvm/com/lucidchart/data/model/fielddefinition/LucidFields.scala
26
25
  /**
27
26
  * Represents the title or main descriptor of an item.
28
27
  */
@@ -23,6 +23,7 @@ export type SerializedImageFill = {
23
23
  'FlipX'?: boolean;
24
24
  'FlipY'?: boolean;
25
25
  'isSvg'?: boolean;
26
+ 'ImageId'?: string;
26
27
  };
27
28
  /** @ignore */
28
29
  export type SimpleSerializedFillStyle = string | SerializedImageFill;
@@ -273,6 +273,10 @@ export type ExtensionFieldConfiguration = {
273
273
  defaultSearchCallback?: string;
274
274
  /** Optional properties to configure how fields are displayed */
275
275
  customFieldDisplaySettings?: CustomFieldDisplaySettings;
276
+ /** List of field names that will not be displayed in the settings panel or edit panel, so its badge position cannot be changed by user
277
+ * Order matters here, as the order of the fields in this list will be used to determine the order of the badges in the card
278
+ */
279
+ nonCustomizableFields?: string[] | undefined;
276
280
  };
277
281
  /**
278
282
  * Maps item field names to icons that show next to the field labels in the card details panel.
@@ -20,6 +20,6 @@ export declare enum DocumentElementType {
20
20
  TrackedFormulaLocation = "TrackedFormulaLocation",
21
21
  ElementAlias = "ElementAlias",
22
22
  GeneratorCardSyncConfig = "GeneratorCardSyncConfig",
23
- ScenarioSet = "ScenarioSet",
23
+ Scenario = "Scenario",
24
24
  PropertyPrecedenceRegistry = "PropertyPrecedenceRegistry"
25
25
  }
@@ -32,6 +32,6 @@ var DocumentElementType;
32
32
  DocumentElementType["TrackedFormulaLocation"] = "TrackedFormulaLocation";
33
33
  DocumentElementType["ElementAlias"] = "ElementAlias";
34
34
  DocumentElementType["GeneratorCardSyncConfig"] = "GeneratorCardSyncConfig";
35
- DocumentElementType["ScenarioSet"] = "ScenarioSet";
35
+ DocumentElementType["Scenario"] = "Scenario";
36
36
  DocumentElementType["PropertyPrecedenceRegistry"] = "PropertyPrecedenceRegistry";
37
37
  })(DocumentElementType || (exports.DocumentElementType = DocumentElementType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.438",
3
+ "version": "0.0.439",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",