lucid-extension-sdk 0.0.311 → 0.0.312
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 +57 -0
- package/core/cardintegration/dependencymappingphrases.d.ts +31 -0
- package/core/cardintegration/dependencymappingphrases.js +2 -0
- package/core/cardintegration/lucidcardintegration.d.ts +6 -0
- package/core/cardintegration/lucidcardintegrationdefinitions.d.ts +13 -0
- package/core/cardintegration/lucidcardintegrationregistry.d.ts +1 -0
- package/core/cardintegration/lucidcardintegrationregistry.js +72 -3
- package/package.json +1 -1
package/commandtypes.d.ts
CHANGED
|
@@ -764,6 +764,63 @@ export type AddCardIntegrationQuery = {
|
|
|
764
764
|
} | undefined;
|
|
765
765
|
/** Whether to enable dependency mapping for this integration */
|
|
766
766
|
'sdm'?: boolean;
|
|
767
|
+
/**
|
|
768
|
+
* If specified, the text phrases to show in the dependency mapping UI.
|
|
769
|
+
* If not specified, dependency mapping for this integration uses the default fallback phrases.
|
|
770
|
+
*/
|
|
771
|
+
'dmp'?: {
|
|
772
|
+
/** Entrypoint text */
|
|
773
|
+
'ep'?: string;
|
|
774
|
+
/**
|
|
775
|
+
* Text for on-card badge for dependency mapping
|
|
776
|
+
* String, not a function itself; this is the name of the client's registered action hook
|
|
777
|
+
*/
|
|
778
|
+
'cl'?: string;
|
|
779
|
+
/** Text for the dependency manager */
|
|
780
|
+
'm'?: {
|
|
781
|
+
/** Header */
|
|
782
|
+
'h'?: string;
|
|
783
|
+
/** All links label */
|
|
784
|
+
'all'?: string;
|
|
785
|
+
/** Show all links button text */
|
|
786
|
+
'salb'?: string;
|
|
787
|
+
/** Hide all links button text */
|
|
788
|
+
'halb'?: string;
|
|
789
|
+
/** Show all links tooltip text (when disabled) */
|
|
790
|
+
'dsalt'?: string;
|
|
791
|
+
/** Hide all links tooltip text (when disabled) */
|
|
792
|
+
'dhalt'?: string;
|
|
793
|
+
/** Text for various empty states */
|
|
794
|
+
'es'?: {
|
|
795
|
+
/** Create link instruction text */
|
|
796
|
+
'cli'?: string;
|
|
797
|
+
/** Instructional text when no items are selected */
|
|
798
|
+
'nssi'?: string;
|
|
799
|
+
/** Heading text when no items are selected */
|
|
800
|
+
'nssh'?: string;
|
|
801
|
+
/**
|
|
802
|
+
* Heading text when selected item has no links
|
|
803
|
+
* String, not a function itself; this is the name of the client's registered action hook
|
|
804
|
+
*/
|
|
805
|
+
'ndh'?: string;
|
|
806
|
+
/** Text when multiple items are selected and have no links */
|
|
807
|
+
'mikwnl'?: string;
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
/** Text for editing a dependency */
|
|
811
|
+
'ed'?: {
|
|
812
|
+
'ch'?: string;
|
|
813
|
+
'cnlo'?: string;
|
|
814
|
+
'dh'?: string;
|
|
815
|
+
'dd'?: string;
|
|
816
|
+
'dab'?: string;
|
|
817
|
+
/**
|
|
818
|
+
* Selected issue heading
|
|
819
|
+
* String, not a function itself; this is the name of the client's registered action hook
|
|
820
|
+
*/
|
|
821
|
+
'sih'?: string;
|
|
822
|
+
};
|
|
823
|
+
} | undefined;
|
|
767
824
|
};
|
|
768
825
|
export type AddCardIntegrationResult = undefined;
|
|
769
826
|
/** @ignore */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface DependencyManagerEmptyStatePhrasesType {
|
|
2
|
+
readonly multipleIssueKeyWithNoLink?: string;
|
|
3
|
+
readonly createLinkInstruction?: string;
|
|
4
|
+
readonly noSelectionStateInstruction?: string;
|
|
5
|
+
readonly noSelectionStateHeading?: string;
|
|
6
|
+
noDependencyHeading?: (key: string) => string;
|
|
7
|
+
}
|
|
8
|
+
interface DependencyManagerPhrasesType {
|
|
9
|
+
readonly header?: string;
|
|
10
|
+
readonly allLinksLabel?: string;
|
|
11
|
+
readonly showAllLinksButton?: string;
|
|
12
|
+
readonly hideAllLinksButton?: string;
|
|
13
|
+
readonly disabledShowAllLinksTooltip?: string;
|
|
14
|
+
readonly disabledHideAllLinksTooltip?: string;
|
|
15
|
+
readonly emptyState?: DependencyManagerEmptyStatePhrasesType;
|
|
16
|
+
}
|
|
17
|
+
interface DependencyEditPhrasesType {
|
|
18
|
+
readonly createHeader?: string;
|
|
19
|
+
readonly createNoLinkOption?: string;
|
|
20
|
+
readonly deleteHeader?: string;
|
|
21
|
+
readonly deleteDescription?: string;
|
|
22
|
+
readonly deleteActionButton?: string;
|
|
23
|
+
selectedIssueHeading?: (key: string) => string;
|
|
24
|
+
}
|
|
25
|
+
export interface DependencyMappingPhrasesType {
|
|
26
|
+
entrypoint?: string;
|
|
27
|
+
cardLabel?: (locale: string, count: number) => string;
|
|
28
|
+
manager?: DependencyManagerPhrasesType;
|
|
29
|
+
edit?: DependencyEditPhrasesType;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -5,6 +5,7 @@ import { EditorClient } from '../../editorclient';
|
|
|
5
5
|
import { SerializedFieldType } from '../data/serializedfield/serializedfields';
|
|
6
6
|
import { CardIntegrationConfig } from './cardintegrationconfig';
|
|
7
7
|
import { ExtensionCardFieldDefinition } from './cardintegrationdefinitions';
|
|
8
|
+
import { DependencyMappingPhrasesType } from './dependencymappingphrases';
|
|
8
9
|
import { LucidCardIntegrationCustomImportModal } from './lucidcardintegrationcustomimportmodal';
|
|
9
10
|
import { LucidCardIntegrationStandardImportModal } from './lucidcardintegrationstandardimportmodal';
|
|
10
11
|
export { ImportResult, SearchResult } from './lucidcardintegrationstandardimportmodal';
|
|
@@ -96,4 +97,9 @@ export declare abstract class LucidCardIntegration {
|
|
|
96
97
|
};
|
|
97
98
|
showCardImport(name: string): import("../../commandtypes").ImportCardsResult;
|
|
98
99
|
showDependencyMapping?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* If specified, the text phrases to show in the dependency mapping UI.
|
|
102
|
+
* If not specified, dependency mapping for this integration uses the default fallback phrases.
|
|
103
|
+
*/
|
|
104
|
+
dependencyMappingPhrases?: DependencyMappingPhrasesType;
|
|
99
105
|
}
|
|
@@ -47,3 +47,16 @@ export interface SearchOptionsParam {
|
|
|
47
47
|
's': string;
|
|
48
48
|
'i': [string, SerializedFieldType][];
|
|
49
49
|
}
|
|
50
|
+
/** @ignore */
|
|
51
|
+
export interface DependencyMappingCardLabelParam {
|
|
52
|
+
'l': string;
|
|
53
|
+
'c': number;
|
|
54
|
+
}
|
|
55
|
+
/** @ignore */
|
|
56
|
+
export interface DependencyMappingNoDependencyHeadingParam {
|
|
57
|
+
'k': string;
|
|
58
|
+
}
|
|
59
|
+
/** @ignore */
|
|
60
|
+
export interface DependencyMappingSelectedIssueHeadingParam {
|
|
61
|
+
'k': string;
|
|
62
|
+
}
|
|
@@ -7,6 +7,7 @@ export declare class LucidCardIntegrationRegistry {
|
|
|
7
7
|
private static nextHookName;
|
|
8
8
|
static registerFieldOptionsCallback(client: EditorClient, callback: (inputSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldOption[]>): string;
|
|
9
9
|
static registerFieldSearchCallback(client: EditorClient, callback: (searchText: string, inputSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldOption[]>): string;
|
|
10
|
+
private static registerDependencyMapping;
|
|
10
11
|
/**
|
|
11
12
|
* Register a card integration.
|
|
12
13
|
*/
|
|
@@ -26,6 +26,77 @@ class LucidCardIntegrationRegistry {
|
|
|
26
26
|
});
|
|
27
27
|
return name;
|
|
28
28
|
}
|
|
29
|
+
static registerDependencyMapping(client, cardIntegration, serialized) {
|
|
30
|
+
if (cardIntegration.showDependencyMapping) {
|
|
31
|
+
serialized['sdm'] = true;
|
|
32
|
+
}
|
|
33
|
+
if (cardIntegration.dependencyMappingPhrases) {
|
|
34
|
+
const dependencyMappingPhrases = cardIntegration.dependencyMappingPhrases;
|
|
35
|
+
const manager = dependencyMappingPhrases.manager;
|
|
36
|
+
const emptyState = manager === null || manager === void 0 ? void 0 : manager.emptyState;
|
|
37
|
+
const edit = dependencyMappingPhrases.edit;
|
|
38
|
+
// Strings that appear on the canvas must calculate their locale at runtime,
|
|
39
|
+
// so all users get canvas content in the same locale
|
|
40
|
+
const cardLabelActionName = dependencyMappingPhrases.cardLabel
|
|
41
|
+
? LucidCardIntegrationRegistry.nextHookName()
|
|
42
|
+
: undefined;
|
|
43
|
+
if (cardLabelActionName) {
|
|
44
|
+
client.registerAction(cardLabelActionName, ({ 'l': locale, 'c': count }) => { var _a; return (_a = dependencyMappingPhrases.cardLabel) === null || _a === void 0 ? void 0 : _a.call(dependencyMappingPhrases, locale, count); });
|
|
45
|
+
}
|
|
46
|
+
const noDependencyHeadingActionName = (emptyState === null || emptyState === void 0 ? void 0 : emptyState.noDependencyHeading)
|
|
47
|
+
? LucidCardIntegrationRegistry.nextHookName()
|
|
48
|
+
: undefined;
|
|
49
|
+
if (noDependencyHeadingActionName) {
|
|
50
|
+
client.registerAction(noDependencyHeadingActionName, ({ 'k': key }) => {
|
|
51
|
+
var _a;
|
|
52
|
+
return (_a = emptyState === null || emptyState === void 0 ? void 0 : emptyState.noDependencyHeading) === null || _a === void 0 ? void 0 : _a.call(emptyState, key);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const selectedIssueHeadingActionName = (edit === null || edit === void 0 ? void 0 : edit.selectedIssueHeading)
|
|
56
|
+
? LucidCardIntegrationRegistry.nextHookName()
|
|
57
|
+
: undefined;
|
|
58
|
+
if (selectedIssueHeadingActionName) {
|
|
59
|
+
client.registerAction(selectedIssueHeadingActionName, ({ 'k': key }) => {
|
|
60
|
+
var _a;
|
|
61
|
+
return (_a = edit === null || edit === void 0 ? void 0 : edit.selectedIssueHeading) === null || _a === void 0 ? void 0 : _a.call(edit, key);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
serialized['dmp'] = {
|
|
65
|
+
'ep': dependencyMappingPhrases.entrypoint,
|
|
66
|
+
'cl': cardLabelActionName,
|
|
67
|
+
'm': manager
|
|
68
|
+
? {
|
|
69
|
+
'h': manager.header,
|
|
70
|
+
'all': manager.allLinksLabel,
|
|
71
|
+
'salb': manager.showAllLinksButton,
|
|
72
|
+
'halb': manager.hideAllLinksButton,
|
|
73
|
+
'dsalt': manager.disabledShowAllLinksTooltip,
|
|
74
|
+
'dhalt': manager.disabledHideAllLinksTooltip,
|
|
75
|
+
'es': emptyState
|
|
76
|
+
? {
|
|
77
|
+
'cli': emptyState.createLinkInstruction,
|
|
78
|
+
'nssi': emptyState.noSelectionStateInstruction,
|
|
79
|
+
'nssh': emptyState.noSelectionStateHeading,
|
|
80
|
+
'ndh': noDependencyHeadingActionName,
|
|
81
|
+
'mikwnl': emptyState.multipleIssueKeyWithNoLink,
|
|
82
|
+
}
|
|
83
|
+
: undefined,
|
|
84
|
+
}
|
|
85
|
+
: undefined,
|
|
86
|
+
'ed': edit
|
|
87
|
+
? {
|
|
88
|
+
'ch': edit.createHeader,
|
|
89
|
+
'cnlo': edit.createNoLinkOption,
|
|
90
|
+
'dh': edit.deleteHeader,
|
|
91
|
+
'dd': edit.deleteDescription,
|
|
92
|
+
'dab': edit.deleteActionButton,
|
|
93
|
+
'sih': selectedIssueHeadingActionName,
|
|
94
|
+
}
|
|
95
|
+
: undefined,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return serialized;
|
|
99
|
+
}
|
|
29
100
|
/**
|
|
30
101
|
* Register a card integration.
|
|
31
102
|
*/
|
|
@@ -141,9 +212,7 @@ class LucidCardIntegrationRegistry {
|
|
|
141
212
|
};
|
|
142
213
|
});
|
|
143
214
|
}
|
|
144
|
-
|
|
145
|
-
serialized['sdm'] = true;
|
|
146
|
-
}
|
|
215
|
+
this.registerDependencyMapping(client, cardIntegration, serialized);
|
|
147
216
|
client.sendCommand("aci" /* CommandName.AddCardIntegration */, serialized);
|
|
148
217
|
}
|
|
149
218
|
}
|