@sigmacomputing/plugin 1.0.6-beta → 1.0.6

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/README.md CHANGED
@@ -159,8 +159,8 @@ Before you start:
159
159
  #### CustomPluginConfigOptions
160
160
 
161
161
  A plugin can be configured with any number of configuration fields. Each field
162
- type has its own configuration options. Each field type is also garunteed to
163
- have a the following options:
162
+ type has its own configuration options. Each field type is also guaranteed to
163
+ have the following options:
164
164
 
165
165
  - `name : string` - the name of the field
166
166
  - `type : string` - the field type
@@ -252,6 +252,11 @@ type CustomPluginConfigOptions =
252
252
  type: 'action-trigger';
253
253
  name: string;
254
254
  label?: string;
255
+ }
256
+ | {
257
+ type: 'action-effect';
258
+ name: string;
259
+ label?: string;
255
260
  };
256
261
  ```
257
262
 
@@ -385,6 +390,10 @@ A configurable workbook interaction to interact with other charts within your wo
385
390
 
386
391
  A configurable action trigger to trigger actions in other elements within your workbook
387
392
 
393
+ **Action Effect**
394
+
395
+ A configurable action effect that can be triggered by other elements within your workbook
396
+
388
397
  #### PluginInstance
389
398
 
390
399
  ```ts
@@ -425,31 +434,36 @@ interface PluginInstance<T> {
425
434
  /**
426
435
  * Gets a static image of a workbook variable
427
436
  */
428
- getVariable(id: string): WorkbookVariable;
437
+ getVariable(configId: string): WorkbookVariable;
429
438
 
430
439
  /**
431
440
  * Setter for workbook variable passed in
432
441
  */
433
- setVariable(id: string, ...values: unknown[]): void;
442
+ setVariable(configId: string, ...values: unknown[]): void;
434
443
 
435
444
  /**
436
445
  * Getter for interaction selection state
437
446
  */
438
- getInteraction(id: string): WorkbookSelection[];
447
+ getInteraction(configId: string): WorkbookSelection[];
439
448
 
440
449
  /**
441
450
  * Setter for interaction selection state
442
451
  */
443
452
  setInteraction(
444
- id: string,
453
+ configId: string,
445
454
  elementId: string,
446
455
  selection: WorkbookSelection[],
447
456
  ): void;
448
457
 
449
458
  /**
450
- * Triggers an action based on the provided action trigger Id
459
+ * Triggers an action based on the provided action trigger ID
460
+ */
461
+ triggerAction(configId: string): void;
462
+
463
+ /**
464
+ * Registers an effect with the provided action effect ID
451
465
  */
452
- triggerAction(id: string): void;
466
+ registerEffect(configId: string, effect: Function): void;
453
467
 
454
468
  /**
455
469
  * Overrider function for Config Ready state
@@ -460,15 +474,16 @@ interface PluginInstance<T> {
460
474
  * Allows users to subscribe to changes in the passed in variable
461
475
  */
462
476
  subscribeToWorkbookVariable(
463
- id: string,
477
+ configId: string,
464
478
  callback: (input: WorkbookVariable) => void,
465
479
  ): Unsubscriber;
466
480
 
467
481
  /**
482
+ * @deprecated Use Action API instead
468
483
  * Allows users to subscribe to changes in the passed in interaction ID
469
484
  */
470
485
  subscribeToWorkbookInteraction(
471
- id: string,
486
+ configId: string,
472
487
  callback: (input: WorkbookSelection[]) => void,
473
488
  ): Unsubscriber;
474
489
  };
@@ -477,13 +492,13 @@ interface PluginInstance<T> {
477
492
  /**
478
493
  * Getter for Column Data by parent sheet ID
479
494
  */
480
- getElementColumns(id: string): Promise<WbElementColumns>;
495
+ getElementColumns(configId: string): Promise<WbElementColumns>;
481
496
 
482
497
  /**
483
498
  * Subscriber to changes in column data by ID
484
499
  */
485
500
  subscribeToElementColumns(
486
- id: string,
501
+ configId: string,
487
502
  callback: (cols: WbElementColumns) => void,
488
503
  ): Unsubscriber;
489
504
 
@@ -491,7 +506,7 @@ interface PluginInstance<T> {
491
506
  * Subscriber for the data within a given sheet
492
507
  */
493
508
  subscribeToElementData(
494
- id: string,
509
+ configId: string,
495
510
  callback: (data: WbElementData) => void,
496
511
  ): Unsubscriber;
497
512
  };
@@ -629,15 +644,15 @@ interface WorkbookElementColumns {
629
644
 
630
645
  #### useElementData()
631
646
 
632
- Provides the latest data values from corresponding sheet
647
+ Provides the latest data values from corresponding sheet, up to 25000 values.
633
648
 
634
649
  ```ts
635
- function useElementData(elementId: string): WorkbookElementData;
650
+ function useElementData(configId: string): WorkbookElementData;
636
651
  ```
637
652
 
638
653
  Arguments
639
654
 
640
- - `elementId : string` - A workbook element’s unique identifier.
655
+ - `configId : string` - A workbook element’s unique identifier from the plugin config.
641
656
 
642
657
  Returns the row data from the specified element.
643
658
 
@@ -647,19 +662,41 @@ interface WorkbookElementData {
647
662
  }
648
663
  ```
649
664
 
665
+ #### usePaginatedElementData()
666
+
667
+ Provides the latest data values from the corresponding sheet (initially 25000), and provides a
668
+ callback for fetching more data in chunks of 25000 values.
669
+
670
+ ```ts
671
+ function useElementData(configId: string): [WorkbookElementData, () => void];
672
+ ```
673
+
674
+ Arguments
675
+
676
+ - `configId : string` - A workbook element’s unique identifier from the plugin config.
677
+
678
+ Returns the row data from the specified element, and a callback for fetching
679
+ more data.
680
+
681
+ ```ts
682
+ interface WorkbookElementData {
683
+ [colId: string]: any[];
684
+ }
685
+ ```
686
+
650
687
  #### useVariable()
651
688
 
652
689
  Returns a given variable's value and a setter to update that variable
653
690
 
654
691
  ```ts
655
692
  function useVariable(
656
- variableId: string,
693
+ configId: string,
657
694
  ): [WorkbookVariable | undefined, (...values: unknown[]) => void];
658
695
  ```
659
696
 
660
697
  Arguments
661
698
 
662
- - `variableId : string` - The ID of the variable
699
+ - `configId : string` - The config ID corresponding to the workbook control variable
663
700
 
664
701
  The returned setter function accepts 1 or more variable values expressed as an
665
702
  array or multiple parameters
@@ -670,18 +707,18 @@ function setVariableCallback(...values: unknown[]): void;
670
707
 
671
708
  #### useInteraction()
672
709
 
673
- Returns a given interaction's selection state and a setter to update that interation
710
+ Returns a given interaction's selection state and a setter to update that interaction
674
711
 
675
712
  ```ts
676
713
  function useInteraction(
677
- interactionId: string,
714
+ configId: string,
678
715
  elementId: string,
679
716
  ): [WorkbookSelection | undefined, (value: WorkbookSelection[]) => void];
680
717
  ```
681
718
 
682
719
  Arguments
683
720
 
684
- - `interactionId : string` - The ID of the interaction
721
+ - `configId : string` - The config ID corresponding to the workbook interaction
685
722
  - `elementId : string` - The ID of the element that this interaction is
686
723
  associated with
687
724
 
@@ -693,22 +730,39 @@ function setVariableCallback(value: WorkbookSelection[]): void;
693
730
 
694
731
  #### useActionTrigger()
695
732
 
733
+ - `configId : string` - The config ID corresponding to the action trigger
734
+
696
735
  Returns a callback function to trigger one or more action effects for a given action trigger
697
736
 
698
737
  ```ts
699
- function useActionTrigger(triggerId: string);
738
+ function useActionTrigger(configId: string): () => void;
700
739
  ```
701
740
 
741
+ #### triggerActionCallback();
742
+
702
743
  Arguments
703
744
 
704
- - `triggerId : string` - The ID of the action trigger
745
+ - `configId : string` - The config ID corresponding to the action trigger
705
746
 
706
- The function that can be called to trigger the action
747
+ The function that can be called to asynchronously trigger the action
707
748
 
708
749
  ```ts
709
- function triggerActionCallback(): void;
750
+ function triggerActionCallback(configId: string): void;
710
751
  ```
711
752
 
753
+ #### useActionEffect()
754
+
755
+ Registers and unregisters an action effect within the plugin
756
+
757
+ ```ts
758
+ function useActionEffect(configId: string, effect: () => void);
759
+ ```
760
+
761
+ Arguments
762
+
763
+ - `configId : string` - The config ID corresponding to the action effect
764
+ - `effect : Function` - The function to be called when the effect is triggered
765
+
712
766
  #### useConfig()
713
767
 
714
768
  Returns the workbook element’s current configuration. If a key is provided, only
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../src/client/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EAKf,MAAM,UAAU,CAAC;AAElB,wBAAgB,UAAU,CAAC,CAAC,GAAG,EAAE,KAAK,cAAc,CAAC,CAAC,CAAC,CAgMtD"}
1
+ {"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../src/client/initialize.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,cAAc,EAIf,MAAM,UAAU,CAAC;AAElB,wBAAgB,UAAU,CAAC,CAAC,GAAG,EAAE,KAAK,cAAc,CAAC,CAAC,CAAC,CA6NtD"}
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initialize = void 0;
4
+ const error_1 = require("../error");
4
5
  function initialize() {
5
6
  const pluginConfig = {
6
7
  config: {},
7
8
  };
8
9
  let subscribedInteractions = {};
9
10
  let subscribedWorkbookVars = {};
11
+ const registeredEffects = {};
10
12
  const listeners = {};
11
13
  for (const [key, value] of new URL(document.location.toString()).searchParams.entries())
12
14
  pluginConfig[key] = JSON.parse(value);
@@ -34,6 +36,13 @@ function initialize() {
34
36
  subscribedInteractions = {};
35
37
  Object.assign(subscribedInteractions, updatedInteractions);
36
38
  });
39
+ on('wb:plugin:action-effect:invoke', (configId) => {
40
+ const effect = registeredEffects[configId];
41
+ if (!effect) {
42
+ throw new Error(`Unknown action effect with name: ${configId}`);
43
+ }
44
+ effect();
45
+ });
37
46
  function on(event, listener) {
38
47
  listeners[event] = listeners[event] || [];
39
48
  listeners[event].push(listener);
@@ -88,20 +97,32 @@ function initialize() {
88
97
  on('config', listener);
89
98
  return () => off('config', listener);
90
99
  },
91
- getVariable(id) {
92
- return subscribedWorkbookVars[id];
100
+ getVariable(configId) {
101
+ (0, error_1.validateConfigId)(configId, 'variable');
102
+ return subscribedWorkbookVars[configId];
93
103
  },
94
- setVariable(id, ...values) {
95
- void execPromise('wb:plugin:variable:set', id, ...values);
104
+ setVariable(configId, ...values) {
105
+ (0, error_1.validateConfigId)(configId, 'variable');
106
+ void execPromise('wb:plugin:variable:set', configId, ...values);
96
107
  },
97
- getInteraction(id) {
98
- return subscribedInteractions[id];
108
+ getInteraction(configId) {
109
+ (0, error_1.validateConfigId)(configId, 'interaction');
110
+ return subscribedInteractions[configId];
99
111
  },
100
- setInteraction(id, elementId, selection) {
101
- void execPromise('wb:plugin:selection:set', id, elementId, selection);
112
+ setInteraction(configId, elementId, selection) {
113
+ (0, error_1.validateConfigId)(configId, 'interaction');
114
+ void execPromise('wb:plugin:selection:set', configId, elementId, selection);
102
115
  },
103
- triggerAction(id) {
104
- void execPromise('wb:plugin:action-trigger:invoke', id);
116
+ triggerAction(configId) {
117
+ (0, error_1.validateConfigId)(configId, 'action-trigger');
118
+ void execPromise('wb:plugin:action-trigger:invoke', configId);
119
+ },
120
+ registerEffect(configId, effect) {
121
+ (0, error_1.validateConfigId)(configId, 'action-effect');
122
+ registeredEffects[configId] = effect;
123
+ return () => {
124
+ delete registeredEffects[configId];
125
+ };
105
126
  },
106
127
  configureEditorPanel(options) {
107
128
  void execPromise('wb:plugin:config:inspector', options);
@@ -109,18 +130,20 @@ function initialize() {
109
130
  setLoadingState(loadingState) {
110
131
  void execPromise('wb:plugin:config:loading-state', loadingState);
111
132
  },
112
- subscribeToWorkbookVariable(id, callback) {
133
+ subscribeToWorkbookVariable(configId, callback) {
134
+ (0, error_1.validateConfigId)(configId, 'variable');
113
135
  const setValues = (values) => {
114
- callback(values[id]);
136
+ callback(values[configId]);
115
137
  };
116
138
  on('wb:plugin:variable:update', setValues);
117
139
  return () => {
118
140
  off('wb:plugin:variable:update', setValues);
119
141
  };
120
142
  },
121
- subscribeToWorkbookInteraction(id, callback) {
143
+ subscribeToWorkbookInteraction(configId, callback) {
144
+ (0, error_1.validateConfigId)(configId, 'interaction');
122
145
  const setValues = (values) => {
123
- callback(values[id]);
146
+ callback(values[configId]);
124
147
  };
125
148
  on('wb:plugin:selection:update', setValues);
126
149
  return () => {
@@ -129,27 +152,34 @@ function initialize() {
129
152
  },
130
153
  },
131
154
  elements: {
132
- getElementColumns(id) {
133
- return execPromise('wb:plugin:element:columns:get', id);
155
+ getElementColumns(configId) {
156
+ (0, error_1.validateConfigId)(configId, 'element');
157
+ return execPromise('wb:plugin:element:columns:get', configId);
134
158
  },
135
- subscribeToElementColumns(id, callback) {
136
- const eventName = `wb:plugin:element:${id}:columns`;
159
+ subscribeToElementColumns(configId, callback) {
160
+ (0, error_1.validateConfigId)(configId, 'element');
161
+ const eventName = `wb:plugin:element:${configId}:columns`;
137
162
  on(eventName, callback);
138
- void execPromise('wb:plugin:element:subscribe:columns', id);
163
+ void execPromise('wb:plugin:element:subscribe:columns', configId);
139
164
  return () => {
140
165
  off(eventName, callback);
141
- void execPromise('wb:plugin:element:unsubscribe:columns', id);
166
+ void execPromise('wb:plugin:element:unsubscribe:columns', configId);
142
167
  };
143
168
  },
144
- subscribeToElementData(id, callback) {
145
- const eventName = `wb:plugin:element:${id}:data`;
169
+ subscribeToElementData(configId, callback) {
170
+ (0, error_1.validateConfigId)(configId, 'element');
171
+ const eventName = `wb:plugin:element:${configId}:data`;
146
172
  on(eventName, callback);
147
- void execPromise('wb:plugin:element:subscribe:data', id);
173
+ void execPromise('wb:plugin:element:subscribe:data', configId);
148
174
  return () => {
149
175
  off(eventName, callback);
150
- void execPromise('wb:plugin:element:unsubscribe:data', id);
176
+ void execPromise('wb:plugin:element:unsubscribe:data', configId);
151
177
  };
152
178
  },
179
+ fetchMoreElementData(configId) {
180
+ (0, error_1.validateConfigId)(configId, 'element');
181
+ void execPromise('wb:plugin:element:fetch-more', configId);
182
+ },
153
183
  },
154
184
  destroy() {
155
185
  Object.keys(listeners).forEach(event => delete listeners[event]);
@@ -0,0 +1,3 @@
1
+ import { CustomPluginConfigOptions } from './types';
2
+ export declare function validateConfigId(configId: string, expectedConfigType: CustomPluginConfigOptions['type']): void;
3
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEpD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,yBAAyB,CAAC,MAAM,CAAC,QAKtD"}
package/dist/error.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateConfigId = void 0;
4
+ function validateConfigId(configId, expectedConfigType) {
5
+ if (configId === undefined) {
6
+ console.warn(`Invalid config ${expectedConfigType}: ${configId}`);
7
+ }
8
+ }
9
+ exports.validateConfigId = validateConfigId;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AAEzB,OAAO,EAAC,6BAA6B,EAAC,MAAM,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AAEzB,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC"}
@@ -16,17 +16,26 @@ export declare function useEditorPanelConfig(nextOptions: CustomPluginConfigOpti
16
16
  */
17
17
  export declare function useLoadingState(initialState: boolean): [boolean, (nextState: boolean) => void];
18
18
  /**
19
- * Provides the latest column values from corresponding sheet
20
- * @param {string} id Sheet ID to retrieve from workbook
21
- * @returns {WorkbookElementColumns} Values of corresponding columns contained within the sheet
19
+ * Provides the latest column values from corresponding config element
20
+ * @param {string} configId ID from the config for fetching element columns, with type: 'element'
21
+ * @returns {WorkbookElementColumns} Values of corresponding columns contained
22
+ * within the config element
22
23
  */
23
- export declare function useElementColumns(id: string): WorkbookElementColumns;
24
+ export declare function useElementColumns(configId: string): WorkbookElementColumns;
24
25
  /**
25
- * Provides the latest data values from corresponding sheet
26
- * @param {string} id Sheet ID to get element data from
27
- * @returns {WorkbookElementData} Element Data for corresponding sheet, if any
26
+ * Provides the latest data values from config element (max 25_000)
27
+ * @param {string} configId ID from the config for fetching element data, with type: 'element'
28
+ * @returns {WorkbookElementData} Element Data for config element, if any
28
29
  */
29
- export declare function useElementData(id: string): WorkbookElementData;
30
+ export declare function useElementData(configId: string): WorkbookElementData;
31
+ /**
32
+ * Provides the latest data values from corresponding config element with a callback to
33
+ * fetch more in chunks of 25_000 data points
34
+ * @param {string} configId ID from the config for fetching paginated
35
+ * element data, with type: 'element'
36
+ * @returns {WorkbookElementData} Element Data for configured config element, if any
37
+ */
38
+ export declare function usePaginatedElementData(configId: string): [WorkbookElementData, () => void];
30
39
  /**
31
40
  * Provides the latest value for entire config or certain key within the config
32
41
  * @param {string} key Key within Plugin Config, optional
@@ -34,22 +43,30 @@ export declare function useElementData(id: string): WorkbookElementData;
34
43
  */
35
44
  export declare function useConfig(key?: string): any;
36
45
  /**
37
- * React hook for accessing a workbook variable
38
- * @param {string} id ID of variable within Plugin Config to use
39
- * @returns {[(WorkbookVariable | undefined), Function]} Constantly updating value of the variable and setter for the variable
46
+ * React hook for accessing a workbook control variable
47
+ * @param {string} id ID from the config of type: 'variable'
48
+ * @returns {[(WorkbookVariable | undefined), Function]} Constantly updating
49
+ * value of the control variable and setter for the variable
40
50
  */
41
51
  export declare function useVariable(id: string): [WorkbookVariable | undefined, Function];
42
52
  /**
53
+ * @deprecated Use Action API instead
43
54
  * React hook for accessing a workbook interaction selections state
44
- * @param {string} id ID of variable within Plugin Config to use
55
+ * @param {string} id ID from the config of type: 'interaction'
45
56
  * @returns {[(WorkbookSelection | undefined), Function]} Constantly updating selection state and setter thereof
46
57
  */
47
58
  export declare function useInteraction(id: string, elementId: string): [unknown, Function];
48
59
  /**
49
60
  * React hook for returning a triggering callback function for the registered
50
61
  * action trigger
51
- * @param {string} id ID of action trigger
62
+ * @param {string} configId ID from the config of type: 'action-trigger'
52
63
  * @returns {Function} A callback function to trigger the action
53
64
  */
54
- export declare function useActionTrigger(id: string): () => void;
65
+ export declare function useActionTrigger(configId: string): () => void;
66
+ /**
67
+ * React hook for registering and unregistering an action effect
68
+ * @param {string} configId ID from the config of type: 'action-effect'
69
+ * @param {Function} effect The function to be called when the action is triggered
70
+ */
71
+ export declare function useActionEffect(configId: string, effect: () => void): void;
55
72
  //# sourceMappingURL=hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc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E,yBAAyB,EAAE,GACvC,IAAI,CAWN;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,OAAO,GACpB,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC,CAezC;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,sBAAsB,CAW1E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAWpE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,GACf,CAAC,mBAAmB,EAAE,MAAM,IAAI,CAAC,CAiBnC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAmB3C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,EAAE,EAAE,MAAM,GACT,CAAC,gBAAgB,GAAG,SAAS,EAAE,QAAQ,CAAC,CAc1C;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,GAChB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAoBrB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,IAAI,CAM7D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,QAYnE"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useActionTrigger = exports.useInteraction = exports.useVariable = exports.useConfig = exports.useElementData = exports.useElementColumns = exports.useLoadingState = exports.useEditorPanelConfig = exports.usePlugin = void 0;
3
+ exports.useActionEffect = exports.useActionTrigger = exports.useInteraction = exports.useVariable = exports.useConfig = exports.usePaginatedElementData = exports.useElementData = exports.useElementColumns = exports.useLoadingState = exports.useEditorPanelConfig = exports.usePlugin = void 0;
4
4
  const react_1 = require("react");
5
5
  const Context_1 = require("./Context");
6
6
  const deepEqual_1 = require("../utils/deepEqual");
@@ -52,37 +52,61 @@ function useLoadingState(initialState) {
52
52
  }
53
53
  exports.useLoadingState = useLoadingState;
54
54
  /**
55
- * Provides the latest column values from corresponding sheet
56
- * @param {string} id Sheet ID to retrieve from workbook
57
- * @returns {WorkbookElementColumns} Values of corresponding columns contained within the sheet
55
+ * Provides the latest column values from corresponding config element
56
+ * @param {string} configId ID from the config for fetching element columns, with type: 'element'
57
+ * @returns {WorkbookElementColumns} Values of corresponding columns contained
58
+ * within the config element
58
59
  */
59
- function useElementColumns(id) {
60
+ function useElementColumns(configId) {
60
61
  const client = usePlugin();
61
62
  const [columns, setColumns] = (0, react_1.useState)({});
62
63
  (0, react_1.useEffect)(() => {
63
- if (id) {
64
- return client.elements.subscribeToElementColumns(id, setColumns);
64
+ if (configId) {
65
+ return client.elements.subscribeToElementColumns(configId, setColumns);
65
66
  }
66
- }, [client, id]);
67
+ }, [client, configId]);
67
68
  return columns;
68
69
  }
69
70
  exports.useElementColumns = useElementColumns;
70
71
  /**
71
- * Provides the latest data values from corresponding sheet
72
- * @param {string} id Sheet ID to get element data from
73
- * @returns {WorkbookElementData} Element Data for corresponding sheet, if any
72
+ * Provides the latest data values from config element (max 25_000)
73
+ * @param {string} configId ID from the config for fetching element data, with type: 'element'
74
+ * @returns {WorkbookElementData} Element Data for config element, if any
74
75
  */
75
- function useElementData(id) {
76
+ function useElementData(configId) {
76
77
  const client = usePlugin();
77
78
  const [data, setData] = (0, react_1.useState)({});
78
79
  (0, react_1.useEffect)(() => {
79
- if (id) {
80
- return client.elements.subscribeToElementData(id, setData);
80
+ if (configId) {
81
+ return client.elements.subscribeToElementData(configId, setData);
81
82
  }
82
- }, [client, id]);
83
+ }, [client, configId]);
83
84
  return data;
84
85
  }
85
86
  exports.useElementData = useElementData;
87
+ /**
88
+ * Provides the latest data values from corresponding config element with a callback to
89
+ * fetch more in chunks of 25_000 data points
90
+ * @param {string} configId ID from the config for fetching paginated
91
+ * element data, with type: 'element'
92
+ * @returns {WorkbookElementData} Element Data for configured config element, if any
93
+ */
94
+ function usePaginatedElementData(configId) {
95
+ const client = usePlugin();
96
+ const [data, setData] = (0, react_1.useState)({});
97
+ const loadMore = (0, react_1.useCallback)(() => {
98
+ if (configId) {
99
+ client.elements.fetchMoreElementData(configId);
100
+ }
101
+ }, [configId]);
102
+ (0, react_1.useEffect)(() => {
103
+ if (configId) {
104
+ return client.elements.subscribeToElementData(configId, setData);
105
+ }
106
+ }, [client, configId]);
107
+ return [data, loadMore];
108
+ }
109
+ exports.usePaginatedElementData = usePaginatedElementData;
86
110
  /**
87
111
  * Provides the latest value for entire config or certain key within the config
88
112
  * @param {string} key Key within Plugin Config, optional
@@ -103,9 +127,10 @@ function useConfig(key) {
103
127
  }
104
128
  exports.useConfig = useConfig;
105
129
  /**
106
- * React hook for accessing a workbook variable
107
- * @param {string} id ID of variable within Plugin Config to use
108
- * @returns {[(WorkbookVariable | undefined), Function]} Constantly updating value of the variable and setter for the variable
130
+ * React hook for accessing a workbook control variable
131
+ * @param {string} id ID from the config of type: 'variable'
132
+ * @returns {[(WorkbookVariable | undefined), Function]} Constantly updating
133
+ * value of the control variable and setter for the variable
109
134
  */
110
135
  function useVariable(id) {
111
136
  const client = usePlugin();
@@ -118,8 +143,9 @@ function useVariable(id) {
118
143
  }
119
144
  exports.useVariable = useVariable;
120
145
  /**
146
+ * @deprecated Use Action API instead
121
147
  * React hook for accessing a workbook interaction selections state
122
- * @param {string} id ID of variable within Plugin Config to use
148
+ * @param {string} id ID from the config of type: 'interaction'
123
149
  * @returns {[(WorkbookSelection | undefined), Function]} Constantly updating selection state and setter thereof
124
150
  */
125
151
  function useInteraction(id, elementId) {
@@ -137,13 +163,29 @@ exports.useInteraction = useInteraction;
137
163
  /**
138
164
  * React hook for returning a triggering callback function for the registered
139
165
  * action trigger
140
- * @param {string} id ID of action trigger
166
+ * @param {string} configId ID from the config of type: 'action-trigger'
141
167
  * @returns {Function} A callback function to trigger the action
142
168
  */
143
- function useActionTrigger(id) {
169
+ function useActionTrigger(configId) {
144
170
  const client = usePlugin();
145
171
  return (0, react_1.useCallback)(() => {
146
- client.config.triggerAction(id);
147
- }, [client, id]);
172
+ client.config.triggerAction(configId);
173
+ }, [client, configId]);
148
174
  }
149
175
  exports.useActionTrigger = useActionTrigger;
176
+ /**
177
+ * React hook for registering and unregistering an action effect
178
+ * @param {string} configId ID from the config of type: 'action-effect'
179
+ * @param {Function} effect The function to be called when the action is triggered
180
+ */
181
+ function useActionEffect(configId, effect) {
182
+ const client = usePlugin();
183
+ const effectRef = (0, react_1.useRef)(effect);
184
+ (0, react_1.useEffect)(() => {
185
+ effectRef.current = effect;
186
+ });
187
+ (0, react_1.useEffect)(() => {
188
+ return client.config.registerEffect(configId, effectRef.current);
189
+ }, [client, configId, effect]);
190
+ }
191
+ exports.useActionEffect = useActionEffect;
package/dist/types.d.ts CHANGED
@@ -13,8 +13,8 @@ export interface PluginConfig<T> {
13
13
  }
14
14
  /**
15
15
  * @typedef {object} WorkbookVariable
16
- * @property {string} name Name of Control Variable within Workbook
17
- * @property {{string}} defaultValue Current Value containing at least type as string
16
+ * @property {string} name Name of control variable within workbook
17
+ * @property {{string}} defaultValue Current value containing at least type as string
18
18
  */
19
19
  export interface WorkbookVariable {
20
20
  name: string;
@@ -143,6 +143,10 @@ export declare type CustomPluginConfigOptions = {
143
143
  type: 'action-trigger';
144
144
  name: string;
145
145
  label?: string;
146
+ } | {
147
+ type: 'action-effect';
148
+ name: string;
149
+ label?: string;
146
150
  };
147
151
  /**
148
152
  * @typedef {object} PluginInstance
@@ -194,33 +198,42 @@ export interface PluginInstance<T = any> {
194
198
  configureEditorPanel(options: CustomPluginConfigOptions[]): void;
195
199
  /**
196
200
  * Gets a static image of a workbook variable
197
- * @param {string} id ID of the workbook variable in config
201
+ * @param {string} configId ID from config of type: 'variable'
198
202
  * @returns {WorkbookVariable} Current value of the workbook variable
199
203
  */
200
- getVariable(id: string): WorkbookVariable;
204
+ getVariable(configId: string): WorkbookVariable;
201
205
  /**
202
206
  * Setter for workbook variable passed in
203
- * @param {string} id ID of the workbook variable in config
207
+ * @param {string} configId ID from config of type: 'variable'
204
208
  * @param {unknown[]} values Values to assign to the workbook variable
205
209
  */
206
- setVariable(id: string, ...values: unknown[]): void;
210
+ setVariable(configId: string, ...values: unknown[]): void;
207
211
  /**
212
+ * @deprecated Use Action API instead
208
213
  * Getter for interaction selection state
209
- * @param {string} id ID from interaction type in Plugin Config
214
+ * @param {string} configId ID from config of type: 'interaction'
210
215
  */
211
- getInteraction(id: string): WorkbookSelection[];
216
+ getInteraction(configId: string): WorkbookSelection[];
212
217
  /**
218
+ * @deprecated Use Action API instead
213
219
  * Setter for interaction selection state
214
- * @param {string} id ID from interaction type in Plugin Config
220
+ * @param {string} configId ID from config of type: 'interaction'
215
221
  * @param {string} elementId Source element ID from element type in Plugin Config
216
222
  * @param {Object} selection List of column IDs or Columns and values and key-value pairs to select
217
223
  */
218
- setInteraction(id: string, elementId: string, selection: WorkbookSelection[]): void;
224
+ setInteraction(configId: string, elementId: string, selection: WorkbookSelection[]): void;
225
+ /**
226
+ * Triggers an action based on the provided action trigger ID
227
+ * @param {string} configId ID from config of type: 'action-trigger'
228
+ */
229
+ triggerAction(configId: string): void;
219
230
  /**
220
- * Triggers an action based on the provided action trigger Id
221
- * @param {string} id ID from action-trigger type in Plugin Config
231
+ * Registers an effect with the provided action effect ID
232
+ * @param {string} configId ID from config of type: 'action-effect'
233
+ * @param {Function} effect The effect function to register
234
+ * @returns {Unsubscriber} A callable unsubscriber
222
235
  */
223
- triggerAction(id: string): void;
236
+ registerEffect(configId: string, effect: () => void): () => void;
224
237
  /**
225
238
  * Overrider function for Config Ready state
226
239
  * @param {boolean} loadingState Boolean representing if Plugin Config is still loading
@@ -228,40 +241,46 @@ export interface PluginInstance<T = any> {
228
241
  setLoadingState(ready: boolean): void;
229
242
  /**
230
243
  * Allows users to subscribe to changes in the passed in variable
231
- * @param {string} id ID of the workbook variable in config
244
+ * @param {string} configId ID from config of type: 'variable'
232
245
  * @callback callback Function to be called upon receiving an updated workbook variable
233
246
  * @returns {Unsubscriber} A callable unsubscriber
234
247
  */
235
- subscribeToWorkbookVariable(id: string, callback: (input: WorkbookVariable) => void): Unsubscriber;
248
+ subscribeToWorkbookVariable(configId: string, callback: (input: WorkbookVariable) => void): Unsubscriber;
236
249
  /**
250
+ * @deprecated Use Action API instead
237
251
  * Allows users to subscribe to changes in the passed in interaction ID
238
- * @param {string} id ID of the interaction variable within Plugin Config
252
+ * @param {string} configId ID from the config of type: 'interaction'
239
253
  * @callback callback Function to be called upon receiving an updated interaction selection state
240
254
  * @returns {Unsubscriber} A callable unsubscriber
241
255
  */
242
- subscribeToWorkbookInteraction(id: string, callback: (input: WorkbookSelection[]) => void): Unsubscriber;
256
+ subscribeToWorkbookInteraction(configId: string, callback: (input: WorkbookSelection[]) => void): Unsubscriber;
243
257
  };
244
258
  elements: {
245
259
  /**
246
260
  * Getter for Column Data by parent sheet ID
247
- * @param {string} id Sheet ID to retrieve columns from
261
+ * @param {string} configId ID from config of type: 'element'
248
262
  * @returns {WorkbookElementColumns} Column values contained within corresponding sheet
249
263
  */
250
- getElementColumns(id: string): Promise<WorkbookElementColumns>;
264
+ getElementColumns(configId: string): Promise<WorkbookElementColumns>;
251
265
  /**
252
266
  * Subscriber to changes in column data by ID
253
- * @param {string} id Column ID to subscribe to
267
+ * @param {string} configId ID from config of type: 'element'
254
268
  * @callback callback Callback function to be called upon changes to column data
255
269
  * @returns {Unsubscriber} Callable unsubscriber to column data changes
256
270
  */
257
- subscribeToElementColumns(id: string, callback: (cols: WorkbookElementColumns) => void): Unsubscriber;
271
+ subscribeToElementColumns(configId: string, callback: (cols: WorkbookElementColumns) => void): Unsubscriber;
258
272
  /**
259
273
  * Subscriber for the data within a given sheet
260
- * @param {string} id Sheet ID to get element data from
274
+ * @param {string} configId ID from config of type: 'element'
261
275
  * @callback callback Function to call on data passed in
262
276
  * @returns {Unsubscriber} A callable unsubscriber to changes in the data
263
277
  */
264
- subscribeToElementData(id: string, callback: (data: WorkbookElementData) => void): Unsubscriber;
278
+ subscribeToElementData(configId: string, callback: (data: WorkbookElementData) => void): Unsubscriber;
279
+ /**
280
+ * Ask sigma to load more data
281
+ * @param {string} configId ID from config of type: 'element'
282
+ */
283
+ fetchMoreElementData(configId: string): void;
265
284
  };
266
285
  /**
267
286
  * Destroys plugin instance and removes all subscribers
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAChF,oBAAY,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAC5D,oBAAY,SAAS,GAAG,aAAa,GAAG,OAAO,CAAC;AAEhD;;GAEG;AACH,oBAAY,WAAW,GACnB,SAAS,GACT,MAAM,GACN,QAAQ,GACR,MAAM,GACN,WAAW,GACX,aAAa,GACb,WAAW,GACX,cAAc,GACd,YAAY,CAAC;AAEjB,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,CAAC,CAAC;IACV,UAAU,EAAE,OAAO,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAChC;AAED,oBAAY,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,CAA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IAAI,GAC1C,YAAY,CAAC;QAEhB;;;;;;WAMG;QACH,8BAA8B,CAC5B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,IAAI,GAC7C,YAAY,CAAC;KACjB,CAAC;IAEF,QAAQ,EAAE;QACR;;;;WAIG;QACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;QAErE;;;;;WAKG;QACH,yBAAyB,CACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,GAC/C,YAAY,CAAC;QAEhB;;;;;WAKG;QACH,sBAAsB,CACpB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,GAC5C,YAAY,CAAC;QAEhB;;;WAGG;QACH,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9C,CAAC;IAEF;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigmacomputing/plugin",
3
- "version": "1.0.6-beta",
3
+ "version": "1.0.6",
4
4
  "description": "Sigma Computing Plugin Client API",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/sigmacomputing/plugin",
@@ -13,6 +13,7 @@
13
13
  "email": "support@sigmacomputing.com",
14
14
  "url": "https://github.com/sigmacomputing/plugin/issues"
15
15
  },
16
+ "packageManager": "yarn@4.4.1",
16
17
  "files": [
17
18
  "dist/*"
18
19
  ],
@@ -24,15 +25,13 @@
24
25
  }
25
26
  },
26
27
  "scripts": {
27
- "clean": "rimraf dist tsconfig*.tsbuildinfo",
28
- "build": "yarn clean && yarn tsc",
28
+ "build": "yarn tsc --build tsconfig.build.json",
29
29
  "build:watch": "yarn build --watch",
30
30
  "format": "prettier --write 'src/**/*.{ts,tsx}' 'jest.config.ts'",
31
31
  "precommit": "lint-staged",
32
32
  "prepublish": "yarn build",
33
33
  "test": "jest --ci",
34
- "test:watch": "yarn test --watch",
35
- "tsc": "tsc --build tsconfig.build.json"
34
+ "test:watch": "yarn test --watch"
36
35
  },
37
36
  "peerDependencies": {
38
37
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
@@ -49,10 +48,6 @@
49
48
  "lint-staged": "^13.0.3",
50
49
  "prettier": "^2.7.1",
51
50
  "ts-jest": "^27.1.4",
52
- "ts-node": "^10.9.1",
53
- "ttypescript": "^1.5.13",
54
- "typescript": "^4.8.2",
55
- "typescript-transform-paths": "^3.3.1"
56
- },
57
- "packageManager": "yarn@4.3.1+sha512.af78262d7d125afbfeed740602ace8c5e4405cd7f4735c08feb327286b2fdb2390fbca01589bfd1f50b1240548b74806767f5a063c94b67e431aabd0d86f7774"
51
+ "typescript": "^4.8.2"
52
+ }
58
53
  }