lucid-extension-sdk 0.0.337 → 0.0.339

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
@@ -964,8 +964,19 @@ export type AddSpreadsheetIntegrationQuery = {
964
964
  };
965
965
  /** getMultipleSheetsForSpreadsheetDetails */
966
966
  'gm': string;
967
+ /** IconConfiguration */
968
+ 'icu'?: {
969
+ /** Primary Icon Url */
970
+ 'pi': string;
971
+ /** Light Icon URl */
972
+ 'li'?: string;
973
+ /** Dark Icon URl */
974
+ 'di'?: string;
975
+ } | undefined;
967
976
  /** addCardsIntegration */
968
977
  'c'?: boolean;
978
+ /** getUpstreamSourceUrl */
979
+ 'gu'?: string;
969
980
  };
970
981
  /** @ignore until spreadsheet integration is ready for launch (CHART-51946) */
971
982
  export type AddSpreadsheetIntegrationResult = undefined;
@@ -49,9 +49,32 @@ export declare class CustomDetailsChooser {
49
49
  /** @ignore until spreadsheet integration is ready for launch (CHART-51946) */
50
50
  export declare abstract class LucidSpreadsheetIntegration {
51
51
  abstract labelDescription: string;
52
+ /**
53
+ * @deprecated Use iconConfiguration.primaryIconUrl.
54
+ */
52
55
  abstract labelIconUrl: string;
56
+ iconConfiguration?: {
57
+ /**
58
+ * URL for the primary icon to display in most components, usually on a white background.
59
+ * Should be at least 24x24.
60
+ */
61
+ primaryIconUrl: string;
62
+ /**
63
+ * Optional. URL for an alternate light icon to show in colored components where the primary icon may appear too dark.
64
+ * If not provided, the primaryIconUrl will be used. Should be at least 24x24.
65
+ */
66
+ lightIconUrl?: string;
67
+ /**
68
+ * Optional. URL for an alternate dark icon to show in colored components where the primary icon may appear too light.
69
+ * If not provided, the primaryIconUrl will be used. Should be at least 24x24.
70
+ */
71
+ darkIconUrl?: string;
72
+ };
53
73
  abstract dataConnectorName: string;
54
74
  addCardsIntegration: boolean;
55
75
  abstract configChooser: ListChooser | CustomDetailsChooser;
56
76
  abstract getMultipleSheetsForSpreadsheetDetails(spreadsheetDetails: string): Promise<Map<string, string> | LucidSpreadsheetIntegrationFailureType>;
77
+ getUpstreamSourceUrl?(spreadsheetDetails: string, sheetId: string): Promise<{
78
+ url: string;
79
+ } | LucidSpreadsheetIntegrationFailureType>;
57
80
  }
@@ -66,6 +66,33 @@ class LucidSpreadsheetIntegrationRegistry {
66
66
  'gs': configChooserActions,
67
67
  'gm': getMultipleSheetsForSpreadsheetDetailsActionName,
68
68
  };
69
+ if (spreadsheetIntegration.iconConfiguration) {
70
+ serialized['icu'] = {
71
+ 'pi': spreadsheetIntegration.iconConfiguration.primaryIconUrl,
72
+ 'li': spreadsheetIntegration.iconConfiguration.lightIconUrl,
73
+ 'di': spreadsheetIntegration.iconConfiguration.darkIconUrl,
74
+ };
75
+ }
76
+ if (spreadsheetIntegration.getUpstreamSourceUrl) {
77
+ const getUpstreamSourceUrl = LucidSpreadsheetIntegrationRegistry.nextHookName();
78
+ client.registerAction(getUpstreamSourceUrl, async (message) => {
79
+ try {
80
+ if (!spreadsheetIntegration.getUpstreamSourceUrl) {
81
+ return lucidspreadsheetintegration_1.LucidSpreadsheetIntegrationFailureType.GenericFailure;
82
+ }
83
+ const result = await spreadsheetIntegration.getUpstreamSourceUrl(message['spreadsheetDetails'], message['sheetId']);
84
+ if ((0, lucidspreadsheetintegration_1.lucidSpreadsheetIntegrationFailureTypeValidator)(result)) {
85
+ return result;
86
+ }
87
+ else {
88
+ return result.url;
89
+ }
90
+ }
91
+ catch (error) { }
92
+ return lucidspreadsheetintegration_1.LucidSpreadsheetIntegrationFailureType.GenericFailure;
93
+ });
94
+ serialized['gu'] = getUpstreamSourceUrl;
95
+ }
69
96
  client.sendCommand("asi" /* CommandName.AddSpreadsheetIntegration */, serialized);
70
97
  }
71
98
  }
@@ -128,6 +128,8 @@ export interface CollectionPatch {
128
128
  represents?: SemanticCollection[];
129
129
  /** The collection's display name */
130
130
  name?: string | undefined;
131
+ /** Whether the collection is hidden from the data panel */
132
+ hideFromDataPanel?: boolean;
131
133
  }
132
134
  /** @ignore */
133
135
  export declare function serializeFieldDefinitionForApi(field: FieldDefinition): SerializedFieldDefinitionForApi;
@@ -85,10 +85,18 @@ function serializeNameAsPropertyForApi(name) {
85
85
  'Name': name, // key needs to match 'Name' key in cake/app/webroot/ts/property/collection/collectionproperties.ts
86
86
  };
87
87
  }
88
+ function serializeHiddenFromDataPanelForApi(hiddenFromDataPanel) {
89
+ return {
90
+ 'IsHiddenFromDataPanel': hiddenFromDataPanel, // key needs to match 'IsHiddenFromDataPanel' key in cake/app/webroot/ts/property/collection/collectionproperties.ts
91
+ };
92
+ }
88
93
  function serializeCollectionPatch(patch) {
89
94
  const representsProperty = patch.represents && serializeRepresentsAsPropertyForApi(patch.represents);
90
95
  const nameProperty = (0, checks_1.isString)(patch.name) ? serializeNameAsPropertyForApi(patch.name) : undefined;
91
- const properties = (representsProperty || nameProperty) && Object.assign(Object.assign({}, representsProperty), nameProperty);
96
+ const isHiddenFromDataPanelProperty = (0, checks_1.isDef)(patch.hideFromDataPanel)
97
+ ? serializeHiddenFromDataPanelForApi(patch.hideFromDataPanel)
98
+ : undefined;
99
+ const properties = (representsProperty || nameProperty || isHiddenFromDataPanelProperty) && Object.assign(Object.assign(Object.assign({}, representsProperty), nameProperty), isHiddenFromDataPanelProperty);
92
100
  return {
93
101
  'schema': patch.schema && serializeSchemaForApi(patch.schema),
94
102
  'itemsPatch': serializeItemsPatch(patch.patch),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.337",
3
+ "version": "0.0.339",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",