lucid-extension-sdk 0.0.445 → 0.0.446

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
@@ -31,7 +31,6 @@ export declare const enum CommandName {
31
31
  AddCardIntegration = "aci",
32
32
  AddDiagramFromMermaid = "adfm",
33
33
  AddDiagramFromLuma = "luma",
34
- AddDiagramFromText = "adft",
35
34
  AddLineTextArea = "alta",
36
35
  AddMenuItem = "ami",
37
36
  AddQuickAction = "aqa",
@@ -192,10 +191,6 @@ export type CommandArgs = {
192
191
  query: AddDiagramFromLumaQuery;
193
192
  result: AddDiagramFromLumaResult;
194
193
  };
195
- [CommandName.AddDiagramFromText]: {
196
- query: AddDiagramFromTextQuery;
197
- result: AddDiagramFromTextResult;
198
- };
199
194
  [CommandName.AddLineTextArea]: {
200
195
  query: AddLineTextAreaQuery;
201
196
  result: AddLineTextAreaResult;
@@ -935,7 +930,7 @@ export type AddCardIntegrationQuery = {
935
930
  * other helpful data, which are sent back to the extension as an import action.
936
931
  */
937
932
  'icfpl'?: {
938
- 'd': string;
933
+ 'd': string | string[];
939
934
  'cb': string;
940
935
  } | undefined;
941
936
  /**
@@ -946,13 +941,6 @@ export type AddCardIntegrationQuery = {
946
941
  'gaptfc'?: string | undefined;
947
942
  };
948
943
  export type AddCardIntegrationResult = undefined;
949
- /** @ignore */
950
- export type AddDiagramFromTextQuery = {
951
- /** The text prompt that will be used to generate the diagram. */
952
- 't': string;
953
- };
954
- /** @ignore */
955
- export type AddDiagramFromTextResult = Promise<{}>;
956
944
  export type AddLineTextAreaQuery = {
957
945
  /** Which line */
958
946
  'id': string;
package/commandtypes.js CHANGED
@@ -8,7 +8,6 @@ exports.commandTitles = new Map([
8
8
  ["aci" /* CommandName.AddCardIntegration */, 'AddCardIntegration'],
9
9
  ["adfm" /* CommandName.AddDiagramFromMermaid */, 'AddDiagramFromMermaid'],
10
10
  ["luma" /* CommandName.AddDiagramFromLuma */, 'AddDiagramFromLuma'],
11
- ["adft" /* CommandName.AddDiagramFromText */, 'AddDiagramFromText'],
12
11
  ["alta" /* CommandName.AddLineTextArea */, 'AddLineTextArea'],
13
12
  ["ami" /* CommandName.AddMenuItem */, 'AddMenuItem'],
14
13
  ["aqa" /* CommandName.AddQuickAction */, 'AddQuickAction'],
@@ -75,10 +75,16 @@ export declare abstract class LucidCardIntegration {
75
75
  */
76
76
  primaryIconUrl: string;
77
77
  /**
78
- * Optional. URL for an alternate light icon to show in colored components where the primary icon may appear too dark.
78
+ * Optional. URL for an alternate light icon to show in components with a colored background.
79
79
  * If not provided, the primaryIconUrl will be used. Should be at least 24x24.
80
80
  */
81
81
  lightIconUrl?: string;
82
+ /**
83
+ * @ignore @experimental Unused. Not yet wired up to Lucid frontend.
84
+ * Optional. URL for an alternate dark icon to show in components with a colored background.
85
+ * If not provided, the lightIconUrl will be used. Should be at least 24x24.
86
+ */
87
+ darkIconUrl?: string;
82
88
  /**
83
89
  * Optional. Callback function to fetch icons that show next to the field labels in the card details panel
84
90
  */
@@ -164,7 +170,7 @@ export declare abstract class LucidCardIntegration {
164
170
  * This function should interface with `SerializedFields` to get the data from the copied card necessary to trigger
165
171
  * the import.
166
172
  */
167
- importFromSerializedFields?: (data: SerializedFields[]) => Promise<ImportCardFromDetails>;
173
+ importFromSerializedFields?: (data: SerializedFields[]) => Promise<ImportCardFromDetails | ImportCardFromDetails[]>;
168
174
  /**
169
175
  * @experimental If specified, allows the extension to check whether the user can edit the given items.
170
176
  * Returns a Map with per-item permission results, keyed by item primary key.
@@ -502,6 +502,9 @@ class LucidCardIntegrationRegistry {
502
502
  serialized['ifs'] = LucidCardIntegrationRegistry.nextHookName();
503
503
  client.registerAction(serialized['ifs'], async ({ 'sf': serializedFields }) => {
504
504
  const result = await importFromSerializedFields(serializedFields);
505
+ if ((0, checks_1.isArray)(result)) {
506
+ return result.map(importcardfromdetails_1.serializeImportCardFromDetails);
507
+ }
505
508
  return (0, importcardfromdetails_1.serializeImportCardFromDetails)(result);
506
509
  });
507
510
  }
@@ -11,6 +11,11 @@ export type SerializedSourceForeignKey = {
11
11
  * Please reach out to #dev-data-platform before setting this to a defined value.
12
12
  */
13
13
  'TargetFields'?: string[] | undefined;
14
+ /**
15
+ * Indicates whether this relationship is bi-directional.
16
+ * "Related To" is a good example of a bi-directional relationship.
17
+ */
18
+ 'IsBidirectional'?: boolean | undefined;
14
19
  };
15
20
  export declare const isSerializedSourceForeignKey: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
16
21
  Id: typeof isString;
@@ -11,6 +11,11 @@ export type SourceForeignKey = {
11
11
  * Please reach out to #dev-data-platform before setting this to a defined value.
12
12
  */
13
13
  'targetFields'?: string[] | undefined;
14
+ /**
15
+ * Indicates whether this relationship is bi-directional.
16
+ * "Related To" is a good example of a bi-directional relationship.
17
+ */
18
+ 'isBidirectional'?: boolean | undefined;
14
19
  };
15
20
  export declare function serializeSourceForeignKey(foreignKey: SourceForeignKey): SerializedSourceForeignKey;
16
21
  export declare function deserializeSourceForeignKey(foreignKey: SerializedSourceForeignKey): SourceForeignKey;
@@ -10,6 +10,7 @@ function serializeSourceForeignKey(foreignKey) {
10
10
  'OutwardLabel': foreignKey.outwardLabel,
11
11
  'InwardLabel': foreignKey.inwardLabel,
12
12
  'TargetFields': foreignKey.targetFields,
13
+ 'IsBidirectional': foreignKey.isBidirectional,
13
14
  };
14
15
  }
15
16
  exports.serializeSourceForeignKey = serializeSourceForeignKey;
@@ -22,6 +23,7 @@ function deserializeSourceForeignKey(foreignKey) {
22
23
  'outwardLabel': foreignKey['OutwardLabel'],
23
24
  'inwardLabel': foreignKey['InwardLabel'],
24
25
  'targetFields': foreignKey['TargetFields'] === null ? undefined : foreignKey['TargetFields'],
26
+ 'isBidirectional': foreignKey['IsBidirectional'],
25
27
  };
26
28
  }
27
29
  exports.deserializeSourceForeignKey = deserializeSourceForeignKey;
@@ -246,6 +246,11 @@ export declare enum BannerType {
246
246
  Error = "error",
247
247
  Warning = "warning"
248
248
  }
249
+ /**
250
+ * Constant for the error banner type discriminator.
251
+ * @experimental
252
+ */
253
+ export declare const ErrorBannerType: "error-banner";
249
254
  /**
250
255
  * @experimental
251
256
  *
@@ -253,7 +258,7 @@ export declare enum BannerType {
253
258
  * Supports warnings, errors, partial results, and action buttons.
254
259
  */
255
260
  export interface ImportErrorBanner {
256
- readonly type: 'error-banner';
261
+ readonly type: typeof ErrorBannerType;
257
262
  message: string;
258
263
  bannerType?: BannerType;
259
264
  actionButton?: {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serializeTagCallbackResult = exports.isSerializedTagCallbackResult = exports.deserializePlaceholderImportMetadata = exports.serializePlaceholderImportMetadata = exports.isSerializedPlaceholderImportMetadata = exports.isSearchResult = exports.isImportErrorBanner = exports.isActionButton = exports.BannerType = exports.deserializeExtensionCardFieldsGroupArray = exports.isSerializedExtensionCardFieldsGroupArray = exports.isSerializedExtensionCardFieldsGroup = exports.serializeExtensionCardFieldsGroupArray = exports.serializeExtensionCardFieldsGroup = exports.deserializeCardFieldArrayDefinition = exports.deserializeCardFieldDefinition = exports.isSerializedExtensionCardFieldDefinition = exports.isSerializedFieldOptions = exports.isSerializedFieldOption = exports.deserializeFieldOption = exports.serializeCardFieldArrayDefinition = exports.serializeCardFieldDefinition = exports.serializeCardFieldOption = exports.isSerializedCardUserDataArray = exports.isSerializedCardUserData = exports.deserializeCardUserData = exports.serializeCardUserData = exports.isExtensionCardUserData = void 0;
3
+ exports.serializeTagCallbackResult = exports.isSerializedTagCallbackResult = exports.deserializePlaceholderImportMetadata = exports.serializePlaceholderImportMetadata = exports.isSerializedPlaceholderImportMetadata = exports.isSearchResult = exports.isImportErrorBanner = exports.isActionButton = exports.ErrorBannerType = exports.BannerType = exports.deserializeExtensionCardFieldsGroupArray = exports.isSerializedExtensionCardFieldsGroupArray = exports.isSerializedExtensionCardFieldsGroup = exports.serializeExtensionCardFieldsGroupArray = exports.serializeExtensionCardFieldsGroup = exports.deserializeCardFieldArrayDefinition = exports.deserializeCardFieldDefinition = exports.isSerializedExtensionCardFieldDefinition = exports.isSerializedFieldOptions = exports.isSerializedFieldOption = exports.deserializeFieldOption = exports.serializeCardFieldArrayDefinition = exports.serializeCardFieldDefinition = exports.serializeCardFieldOption = exports.isSerializedCardUserDataArray = exports.isSerializedCardUserData = exports.deserializeCardUserData = exports.serializeCardUserData = exports.isExtensionCardUserData = void 0;
4
4
  const collectiondefinition_1 = require("../../data/collectiondefinition");
5
5
  const schemadefinition_1 = require("../../data/schemadefinition");
6
6
  const checks_1 = require("../checks");
@@ -122,6 +122,11 @@ var BannerType;
122
122
  BannerType["Error"] = "error";
123
123
  BannerType["Warning"] = "warning";
124
124
  })(BannerType || (exports.BannerType = BannerType = {}));
125
+ /**
126
+ * Constant for the error banner type discriminator.
127
+ * @experimental
128
+ */
129
+ exports.ErrorBannerType = 'error-banner';
125
130
  exports.isActionButton = (0, validators_1.objectValidator)({
126
131
  label: checks_1.isString,
127
132
  actionId: (0, validators_1.option)(checks_1.isString),
@@ -23,5 +23,6 @@ export declare enum DocumentElementType {
23
23
  GeneratorCardSyncConfig = "GeneratorCardSyncConfig",
24
24
  Scenario = "Scenario",
25
25
  PropertyPrecedenceRegistry = "PropertyPrecedenceRegistry",
26
- RepositoryBranch = "RepositoryBranch"
26
+ RepositoryBranch = "RepositoryBranch",
27
+ DocumentInput = "DocumentInput"
27
28
  }
@@ -36,4 +36,5 @@ var DocumentElementType;
36
36
  DocumentElementType["Scenario"] = "Scenario";
37
37
  DocumentElementType["PropertyPrecedenceRegistry"] = "PropertyPrecedenceRegistry";
38
38
  DocumentElementType["RepositoryBranch"] = "RepositoryBranch";
39
+ DocumentElementType["DocumentInput"] = "DocumentInput";
39
40
  })(DocumentElementType || (exports.DocumentElementType = DocumentElementType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.445",
3
+ "version": "0.0.446",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",