lucid-extension-sdk 0.0.389 → 0.0.390

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
@@ -735,6 +735,18 @@ export type AddCardsActions = {
735
735
  /** Create card action */
736
736
  'cc': string;
737
737
  };
738
+ export type SerializedFieldConfiguration = {
739
+ /** Callback to get field definitions for all fields supported by the card integration */
740
+ 'gf': string;
741
+ /** Callback to handle a change in the fields the user want to be displayed */
742
+ 'osfc'?: string | undefined;
743
+ /** Field name -> callback name tuples for searching for legal field values in an enum */
744
+ 'fvsc'?: [string, string][] | undefined;
745
+ /** Default search callback for searching for legal field values in an enum */
746
+ 'dsc'?: string | undefined;
747
+ /** Custom field display settings */
748
+ 'cfds'?: SerializedCustomFieldDisplaySettings;
749
+ };
738
750
  export type AddCardIntegrationQuery = {
739
751
  /** Title/name */
740
752
  'n': string;
@@ -751,18 +763,7 @@ export type AddCardIntegrationQuery = {
751
763
  /** Text style */
752
764
  'ts'?: Partial<TextStyle> | undefined;
753
765
  /** Field configuration */
754
- 'fc': {
755
- /** Callback to get field definitions for all fields supported by the card integration */
756
- 'gf': string;
757
- /** Callback to handle a change in the fields the user want to be displayed */
758
- 'osfc'?: string | undefined;
759
- /** Field name -> callback name tuples for searching for legal field values in an enum */
760
- 'fvsc'?: [string, string][] | undefined;
761
- /** Default search callback for searching for legal field values in an enum */
762
- 'dsc'?: string | undefined;
763
- /** Custom field display settings */
764
- 'cfds'?: SerializedCustomFieldDisplaySettings;
765
- };
766
+ 'fc': SerializedFieldConfiguration;
766
767
  /** If we can only search for user by their name (and not email) in the card integration. */
767
768
  'subn'?: boolean | undefined;
768
769
  /** Callback to search for a user in the card integration */
@@ -1193,6 +1194,12 @@ export type CreateUserImageResult = Promise<RawCreateUserImageResult>;
1193
1194
  export type SerializedCustomFieldDisplaySettings = {
1194
1195
  /** Default to multiline text */
1195
1196
  'd'?: boolean | undefined;
1197
+ /** allowMultiSelectEnums */
1198
+ 'amse'?: boolean | undefined;
1199
+ /** useRoundIcons */
1200
+ 'uri'?: boolean | undefined;
1201
+ /** displayMappedDatesAsDateRange */
1202
+ 'dadr'?: boolean | undefined;
1196
1203
  };
1197
1204
  export type DataActionQuery = {
1198
1205
  /** Flow Name */
@@ -4,7 +4,7 @@ import { TextStyle } from '../../document/text/textstyle';
4
4
  import { EditorClient } from '../../editorclient';
5
5
  import { isString } from '../checks';
6
6
  import { SerializedFieldType } from '../data/serializedfield/serializedfields';
7
- import { CustomFieldDisplaySettings, DependenciesForItems, ExtensionCardFieldDefinition, ImportResult } from '../sharedcardintegration/cardintegrationdefinitions';
7
+ import { DependenciesForItems, ExtensionCardFieldDefinition, ExtensionFieldConfiguration, ImportResult } from '../sharedcardintegration/cardintegrationdefinitions';
8
8
  import { CardIntegrationConfig } from './cardintegrationconfig';
9
9
  import { DependencyMappingPhrasesType } from './dependencymappingphrases';
10
10
  import { LucidCardIntegrationCustomImportModal } from './lucidcardintegrationcustomimportmodal';
@@ -55,37 +55,7 @@ export declare abstract class LucidCardIntegration {
55
55
  * individual fields that should have different styles.
56
56
  */
57
57
  textStyle?: Partial<TextStyle>;
58
- abstract fieldConfiguration: {
59
- /**
60
- * Callback to provide a list of all supported field names for the card integration.
61
- */
62
- getAllFields: (dataSource: DataSourceProxy) => Promise<string[] | FieldDescriptor[]>;
63
- /**
64
- * Callback that handled changes in the fields the user wants to be displayed in the card integration.
65
- * If this callback is not provided then the user will not be shown the modal to configure fields.
66
- */
67
- onSelectedFieldsChange?: (dataSource: DataSourceProxy, selectedFields: string[]) => Promise<void>;
68
- /**
69
- * Specify callbacks for searching for legal values for the given fields.
70
- *
71
- * For example, a Task collection may have an Assignee field that references a User collection,
72
- * but you don't import all the users in the entire source data set. Here, you can provide a way
73
- * to search for legal values for the Assignee field, similar to the `ExtensionCardFieldDefinition.search`
74
- * functionality.
75
- *
76
- * Register a search callback using LucidCardIntegrationRegistry.registerFieldSearchCallback, then set
77
- * the returned string as a value in this Map. The `inputSoFar` parameter passed to the callback will
78
- * be all the current field values on the item being edited.
79
- */
80
- fieldValueSearchCallbacks?: Map<string, string>;
81
- /**
82
- * Optional callback that's used when a field name may not map to any field defined in fieldValueSearchCallbacks.
83
- * Useful for when you don't know the field name ahead of time (e.g. a dynamically generated field name).
84
- */
85
- defaultSearchCallback?: string;
86
- /** Optional properties to configure how fields are displayed */
87
- customFieldDisplaySettings?: CustomFieldDisplaySettings;
88
- };
58
+ abstract fieldConfiguration: ExtensionFieldConfiguration;
89
59
  iconConfiguration?: {
90
60
  /**
91
61
  * URL for the primary icon to display in most components, usually on a white background.
@@ -156,6 +156,7 @@ class LucidCardIntegrationRegistry {
156
156
  * Register a card integration.
157
157
  */
158
158
  static addCardIntegration(client, cardIntegration) {
159
+ var _a, _b, _c, _d, _e, _f;
159
160
  const getFieldsActionName = LucidCardIntegrationRegistry.nextHookName();
160
161
  client.registerAction(getFieldsActionName, async (param) => {
161
162
  const dataSource = new datasourceproxy_1.DataSourceProxy(param['d'], client);
@@ -291,6 +292,9 @@ class LucidCardIntegrationRegistry {
291
292
  if (cardIntegration.fieldConfiguration.customFieldDisplaySettings) {
292
293
  serialized['fc']['cfds'] = {
293
294
  'd': cardIntegration.fieldConfiguration.customFieldDisplaySettings.defaultToMultilineText,
295
+ 'amse': (_b = (_a = cardIntegration.fieldConfiguration) === null || _a === void 0 ? void 0 : _a.customFieldDisplaySettings) === null || _b === void 0 ? void 0 : _b.allowMultiSelectEnums,
296
+ 'uri': (_d = (_c = cardIntegration.fieldConfiguration) === null || _c === void 0 ? void 0 : _c.customFieldDisplaySettings) === null || _d === void 0 ? void 0 : _d.useRoundIcons,
297
+ 'dadr': (_f = (_e = cardIntegration.fieldConfiguration) === null || _e === void 0 ? void 0 : _e.customFieldDisplaySettings) === null || _f === void 0 ? void 0 : _f.displayMappedDatesAsDateRange,
294
298
  };
295
299
  }
296
300
  this.registerDependencyMapping(client, cardIntegration, serialized);
@@ -1,7 +1,9 @@
1
1
  import { CollectionDefinition } from '../../data/collectiondefinition';
2
2
  import { CollectionProxy } from '../../data/collectionproxy';
3
3
  import { DataItemProxy } from '../../data/dataitemproxy';
4
+ import { DataSourceProxy } from '../../data/datasourceproxy';
4
5
  import { FieldDefinition } from '../../data/schemadefinition';
6
+ import { FieldDescriptor } from '../cardintegration/lucidcardintegration';
5
7
  import { isString } from '../checks';
6
8
  import { isSerializedFieldTypeDefinition } from '../data/fieldtypedefinition/fieldtypedefinition';
7
9
  import { SerializedFieldDefinition } from '../data/serializedfield/serializedfielddefinition';
@@ -157,5 +159,47 @@ export interface CustomFieldDisplaySettings {
157
159
  * If you would like certain fields to be shown as single line text, you can add the
158
160
  * `FieldConstraintType.SINGLE_LINE_ONLY` constraint to the necessary fields.
159
161
  * */
160
- defaultToMultilineText: boolean;
162
+ defaultToMultilineText?: boolean;
163
+ /** Whether multi-select dropdown fields are allowed.
164
+ * If false, all enum fields are coerced to single-select regardless of their type.
165
+ */
166
+ allowMultiSelectEnums?: boolean;
167
+ /** Whether to default to using round icons in dropdowns in both the edit details panel and basic edit panel */
168
+ useRoundIcons?: boolean;
169
+ /**
170
+ * When this is true and a user has setup their mappings for LucidFields.Time and LucidFields.EndTime, the dates
171
+ * will be combined into a single date field in the edit panel.
172
+ */
173
+ displayMappedDatesAsDateRange?: boolean;
161
174
  }
175
+ export type ExtensionFieldConfiguration = {
176
+ /**
177
+ * Callback to provide a list of all supported field names for the card integration.
178
+ */
179
+ getAllFields: (dataSource: DataSourceProxy) => Promise<string[] | FieldDescriptor[]>;
180
+ /**
181
+ * Callback that handled changes in the fields the user wants to be displayed in the card integration.
182
+ * If this callback is not provided then the user will not be shown the modal to configure fields.
183
+ */
184
+ onSelectedFieldsChange?: (dataSource: DataSourceProxy, selectedFields: string[]) => Promise<void>;
185
+ /**
186
+ * Specify callbacks for searching for legal values for the given fields.
187
+ *
188
+ * For example, a Task collection may have an Assignee field that references a User collection,
189
+ * but you don't import all the users in the entire source data set. Here, you can provide a way
190
+ * to search for legal values for the Assignee field, similar to the `ExtensionCardFieldDefinition.search`
191
+ * functionality.
192
+ *
193
+ * Register a search callback using LucidCardIntegrationRegistry.registerFieldSearchCallback, then set
194
+ * the returned string as a value in this Map. The `inputSoFar` parameter passed to the callback will
195
+ * be all the current field values on the item being edited.
196
+ */
197
+ fieldValueSearchCallbacks?: Map<string, string>;
198
+ /**
199
+ * Optional callback that's used when a field name may not map to any field defined in fieldValueSearchCallbacks.
200
+ * Useful for when you don't know the field name ahead of time (e.g. a dynamically generated field name).
201
+ */
202
+ defaultSearchCallback?: string;
203
+ /** Optional properties to configure how fields are displayed */
204
+ customFieldDisplaySettings?: CustomFieldDisplaySettings;
205
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.389",
3
+ "version": "0.0.390",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",