lucid-extension-sdk 0.0.376 → 0.0.377

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
@@ -862,6 +862,10 @@ export type AddCardIntegrationQuery = {
862
862
  */
863
863
  'sih'?: string;
864
864
  };
865
+ /**
866
+ * Item label phrase
867
+ */
868
+ 'ilp'?: string;
865
869
  } | undefined;
866
870
  };
867
871
  export type AddCardIntegrationResult = undefined;
@@ -36,6 +36,10 @@ interface DependenciesForItemParam {
36
36
  export interface DependenciesForItemsParam {
37
37
  'dfi': DependenciesForItemParam[];
38
38
  }
39
+ export interface DependencyMappingItemLabelPhraseParam {
40
+ 'ci': string;
41
+ 'pk': string;
42
+ }
39
43
  /** @ignore */
40
44
  export interface CustomImportParam {
41
45
  'd': JsonSerializable;
@@ -1,3 +1,4 @@
1
+ import { DataItemProxy } from '../../data/dataitemproxy';
1
2
  interface DependencyManagerEmptyStatePhrasesType {
2
3
  readonly multipleIssueKeyWithNoLink?: string;
3
4
  readonly createLinkInstruction?: string;
@@ -27,5 +28,9 @@ export interface DependencyMappingPhrasesType {
27
28
  cardLabel?: (locale: string, count: number) => string;
28
29
  manager?: DependencyManagerPhrasesType;
29
30
  edit?: DependencyEditPhrasesType;
31
+ /**
32
+ * This function is used to map the dataItemProxy to item label phrase.
33
+ */
34
+ itemLabelPhrase?: (dataItem: DataItemProxy) => string;
30
35
  }
31
36
  export {};
@@ -47,6 +47,7 @@ class LucidCardIntegrationRegistry {
47
47
  const manager = dependencyMappingPhrases.manager;
48
48
  const emptyState = manager === null || manager === void 0 ? void 0 : manager.emptyState;
49
49
  const edit = dependencyMappingPhrases.edit;
50
+ const itemLabelPhrase = dependencyMappingPhrases.itemLabelPhrase;
50
51
  // Strings that appear on the canvas must calculate their locale at runtime,
51
52
  // so all users get canvas content in the same locale
52
53
  const cardLabelActionName = dependencyMappingPhrases.cardLabel
@@ -73,6 +74,15 @@ class LucidCardIntegrationRegistry {
73
74
  return (_a = edit === null || edit === void 0 ? void 0 : edit.selectedIssueHeading) === null || _a === void 0 ? void 0 : _a.call(edit, key);
74
75
  });
75
76
  }
77
+ let itemLabelPhraseActionName = undefined;
78
+ if (itemLabelPhrase) {
79
+ itemLabelPhraseActionName = LucidCardIntegrationRegistry.nextHookName();
80
+ client.registerAction(itemLabelPhraseActionName, ({ 'ci': ci, 'pk': pk }) => {
81
+ const collectionProxy = new collectionproxy_1.CollectionProxy(ci, client);
82
+ const itemProxy = new dataitemproxy_1.DataItemProxy(pk, collectionProxy, client);
83
+ return itemLabelPhrase(itemProxy);
84
+ });
85
+ }
76
86
  serialized['dmp'] = {
77
87
  'ep': dependencyMappingPhrases.entrypoint,
78
88
  'cl': cardLabelActionName,
@@ -105,6 +115,7 @@ class LucidCardIntegrationRegistry {
105
115
  'sih': selectedIssueHeadingActionName,
106
116
  }
107
117
  : undefined,
118
+ 'ilp': itemLabelPhraseActionName,
108
119
  };
109
120
  }
110
121
  if (cardIntegration.importDependencies) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.376",
3
+ "version": "0.0.377",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",