lucid-extension-sdk 0.0.135 → 0.0.136

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.135",
3
+ "version": "0.0.136",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",
@@ -539,6 +539,8 @@ export declare type AddCardIntegrationQuery = {
539
539
  's': string;
540
540
  /** Import action */
541
541
  'i': string;
542
+ /** OnSetup action */
543
+ 'os'?: string | undefined;
542
544
  } | undefined;
543
545
  /** If specified, add-card settings */
544
546
  'ac'?: {
@@ -91,6 +91,10 @@ export declare abstract class LucidCardIntegration {
91
91
  * The user checked the boxes beside the given list of items in the collection returned from search().
92
92
  * Import them, and return the collection and primary keys in that final collection that were imported.
93
93
  *
94
+ * onSetup:
95
+ * If specified, it's going to be called everytime the modal is setting up, right after the modal is displayed
96
+ * and before the initial form fields are shown to the user.
97
+ *
94
98
  * The config provided here is only used on the first import from a given source; on subsequent imports,
95
99
  * the existing config will remain unchanged to preserve any customizations by the user.
96
100
  */
@@ -108,6 +112,7 @@ export declare abstract class LucidCardIntegration {
108
112
  collection: CollectionProxy;
109
113
  primaryKeys: string[];
110
114
  }>;
115
+ onSetup?: () => Promise<void>;
111
116
  };
112
117
  /**
113
118
  * If specified, allow the user to create new cards and convert other shapes to cards
@@ -77,6 +77,7 @@ class LucidCardIntegrationRegistry {
77
77
  'gsf': LucidCardIntegrationRegistry.nextHookName(),
78
78
  's': LucidCardIntegrationRegistry.nextHookName(),
79
79
  'i': LucidCardIntegrationRegistry.nextHookName(),
80
+ 'os': importModal.onSetup ? LucidCardIntegrationRegistry.nextHookName() : undefined,
80
81
  };
81
82
  client.registerAction(serialized['im']['gsf'], async ({ 's': searchSoFar }) => {
82
83
  const result = await importModal.getSearchFields(new Map(searchSoFar));
@@ -100,6 +101,12 @@ class LucidCardIntegrationRegistry {
100
101
  'pks': result.primaryKeys,
101
102
  };
102
103
  });
104
+ if (serialized['im']['os']) {
105
+ client.registerAction(serialized['im']['os'], async () => {
106
+ var _a;
107
+ await ((_a = importModal.onSetup) === null || _a === void 0 ? void 0 : _a.call(importModal));
108
+ });
109
+ }
103
110
  }
104
111
  if (cardIntegration.addCard) {
105
112
  const addCard = cardIntegration.addCard;