lucid-extension-sdk 0.0.369 → 0.0.371

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
@@ -756,6 +756,8 @@ export type AddCardIntegrationQuery = {
756
756
  'osfc'?: string | undefined;
757
757
  /** Field name -> callback name tuples for searching for legal field values in an enum */
758
758
  'fvsc'?: [string, string][] | undefined;
759
+ /** Default search callback for searching for legal field values in an enum */
760
+ 'dsc'?: string | undefined;
759
761
  };
760
762
  /** If we can only search for user by their name (and not email) in the card integration. */
761
763
  'subn'?: boolean | undefined;
@@ -56,6 +56,9 @@ export interface GetOptionsParam {
56
56
  export interface SearchOptionsParam {
57
57
  's': string;
58
58
  'i': [string, SerializedFieldType][];
59
+ 'fd'?: {
60
+ 'n'?: string;
61
+ };
59
62
  }
60
63
  /** @ignore */
61
64
  export interface DependencyMappingCardLabelParam {
@@ -73,6 +73,11 @@ export declare abstract class LucidCardIntegration {
73
73
  * be all the current field values on the item being edited.
74
74
  */
75
75
  fieldValueSearchCallbacks?: Map<string, string>;
76
+ /**
77
+ * Optional callback that's used when a field name may not map to any field defined in fieldValueSearchCallbacks.
78
+ * Useful for when you don't know the field name ahead of time (e.g. a dynamically generated field name).
79
+ */
80
+ defaultSearchCallback?: string;
76
81
  };
77
82
  iconConfiguration?: {
78
83
  /**
@@ -6,7 +6,9 @@ export declare class LucidCardIntegrationRegistry {
6
6
  private static nextHookId;
7
7
  private static nextHookName;
8
8
  static registerFieldOptionsCallback(client: EditorClient, callback: (inputSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldOption[]>): string;
9
- static registerFieldSearchCallback(client: EditorClient, callback: (searchText: string, inputSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardFieldOption[]>): string;
9
+ static registerFieldSearchCallback(client: EditorClient, callback: (searchText: string, inputSoFar: Map<string, SerializedFieldType>, fieldData?: {
10
+ name?: string;
11
+ }) => Promise<ExtensionCardFieldOption[]>): string;
10
12
  static registerUserSearchCallback(client: EditorClient, callback: (searchText: string, inputSoFar: Map<string, SerializedFieldType>) => Promise<ExtensionCardUserData[]>): string;
11
13
  private static registerDependencyMapping;
12
14
  private static serializeSearchResult;
@@ -23,8 +23,9 @@ class LucidCardIntegrationRegistry {
23
23
  }
24
24
  static registerFieldSearchCallback(client, callback) {
25
25
  const name = LucidCardIntegrationRegistry.nextHookName();
26
- client.registerAction(name, async ({ 'i': inputSoFar, 's': searchText }) => {
27
- const result = await callback(searchText, new Map(inputSoFar));
26
+ client.registerAction(name, async ({ 'i': inputSoFar, 's': searchText, 'fd': serializedFieldData }) => {
27
+ const fieldData = serializedFieldData ? { name: serializedFieldData.n } : undefined;
28
+ const result = await callback(searchText, new Map(inputSoFar), fieldData);
28
29
  return result.map((option) => (0, cardintegrationdefinitions_1.serializeCardFieldOption)(option));
29
30
  });
30
31
  return name;
@@ -180,6 +181,7 @@ class LucidCardIntegrationRegistry {
180
181
  'fvsc': cardIntegration.fieldConfiguration.fieldValueSearchCallbacks
181
182
  ? [...cardIntegration.fieldConfiguration.fieldValueSearchCallbacks.entries()]
182
183
  : undefined,
184
+ 'dsc': cardIntegration.fieldConfiguration.defaultSearchCallback,
183
185
  },
184
186
  'subn': cardIntegration.searchUserByName,
185
187
  'usc': cardIntegration.userSearchCallback,
@@ -10,7 +10,7 @@ import { SerializedFieldType, isSerializedFieldType } from '../data/serializedfi
10
10
  export interface ExtensionCardFieldOption {
11
11
  label: string;
12
12
  value: SerializedFieldType;
13
- iconUrl?: string;
13
+ iconUrl?: string | undefined;
14
14
  }
15
15
  export interface ExtensionCardFieldDefinition extends FieldDefinition {
16
16
  /** The label to display in the UI */
@@ -17,6 +17,8 @@ export interface BlockEndpointDefinition extends EndpointStyle {
17
17
  inside?: boolean;
18
18
  /** If true, this endpoint may move around the target block in order to make the line less complex */
19
19
  autoLink?: boolean;
20
+ /** If true, this endpoint will use multiple ports on the same side of the block when auto-linking */
21
+ autoLinkMultiPort?: boolean;
20
22
  /** If set, the distance from the connected block this endpoint should be */
21
23
  padding?: number;
22
24
  }
@@ -53,6 +53,7 @@ class LineProxy extends itemproxy_1.ItemProxy {
53
53
  linkY: raw['LinkY'],
54
54
  inside: raw['Inside'],
55
55
  autoLink: raw['AutoLink'],
56
+ autoLinkMultiPort: raw['AutoLink'],
56
57
  padding: raw['Padding'],
57
58
  x: raw['x'],
58
59
  y: raw['y'],
@@ -78,6 +79,7 @@ class LineProxy extends itemproxy_1.ItemProxy {
78
79
  'LinkY': ep.linkY,
79
80
  'Inside': ep.inside,
80
81
  'AutoLink': ep.autoLink,
82
+ 'AutoLinkMultiPort': ep.autoLinkMultiPort,
81
83
  'Padding': ep.padding,
82
84
  };
83
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.369",
3
+ "version": "0.0.371",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",