@sigmacomputing/plugin 1.0.7-beta → 1.0.9-beta
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 +78 -42
- package/dist/client/initialize.d.ts.map +1 -1
- package/dist/client/initialize.js +49 -55
- package/dist/error.d.ts +3 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/react/hooks.d.ts +27 -16
- package/dist/react/hooks.d.ts.map +1 -1
- package/dist/react/hooks.js +57 -32
- package/dist/types.d.ts +34 -30
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -9
package/README.md
CHANGED
|
@@ -67,42 +67,52 @@ While you are not required to use React for your plugin, it must be written in
|
|
|
67
67
|
Javascript and React is recommended. We support both a standard Javascript API
|
|
68
68
|
and a React Hooks API.
|
|
69
69
|
|
|
70
|
-
#### Create a Project with
|
|
70
|
+
#### Create a Project with Vite
|
|
71
71
|
|
|
72
72
|
1. Open your terminal and navigate to the directory you want to create your
|
|
73
73
|
project in.
|
|
74
|
-
2. Create your new project. We recommend using
|
|
75
|
-
[`create-
|
|
74
|
+
2. Create your new project. We recommend using
|
|
75
|
+
[`create-vite`](https://www.npmjs.com/package/create-vite).
|
|
76
76
|
|
|
77
77
|
```sh
|
|
78
|
-
|
|
78
|
+
yarn create vite <my-cool-plugin>
|
|
79
|
+
# or
|
|
80
|
+
npm create vite@latest <my-cool-plugin>
|
|
79
81
|
```
|
|
80
82
|
|
|
81
|
-
3.
|
|
83
|
+
3. Then follow the prompts! You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a Vite + Vue project, run:
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
yarn create vite my-vue-app --template vue
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
4. Navigate to the project's main directory.
|
|
82
90
|
|
|
83
91
|
```sh
|
|
84
92
|
cd <my-cool-plugin>
|
|
85
93
|
```
|
|
86
94
|
|
|
87
|
-
|
|
95
|
+
5. Use your package manager to install Sigma’s plugin library. We recommend
|
|
88
96
|
using `yarn`.
|
|
89
97
|
|
|
90
98
|
```sh
|
|
91
99
|
yarn add @sigmacomputing/plugin
|
|
92
100
|
```
|
|
93
101
|
|
|
94
|
-
|
|
102
|
+
6. Spin up your local development server.
|
|
95
103
|
|
|
96
104
|
```sh
|
|
97
|
-
yarn && yarn
|
|
105
|
+
yarn && yarn dev
|
|
98
106
|
```
|
|
99
107
|
|
|
100
|
-
|
|
108
|
+
7. Start developing:
|
|
101
109
|
|
|
102
110
|
- Get started with Sigma’s Plugin APIs.
|
|
103
111
|
- Test your plugin directly in a Sigma workbook using the Sigma Plugin Dev
|
|
104
112
|
Playground.
|
|
105
|
-
- By default,
|
|
113
|
+
- By default, vite dev servers run on http://localhost:5173.
|
|
114
|
+
|
|
115
|
+
NOTE: Facebook's [create-react-app](https://github.com/facebook/create-react-app) is deprecated. You should use [vite](https://github.com/vitejs/vite) to setup your project.
|
|
106
116
|
|
|
107
117
|
## Testing your Plugin
|
|
108
118
|
|
|
@@ -159,8 +169,8 @@ Before you start:
|
|
|
159
169
|
#### CustomPluginConfigOptions
|
|
160
170
|
|
|
161
171
|
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
|
|
163
|
-
have
|
|
172
|
+
type has its own configuration options. Each field type is also guaranteed to
|
|
173
|
+
have the following options:
|
|
164
174
|
|
|
165
175
|
- `name : string` - the name of the field
|
|
166
176
|
- `type : string` - the field type
|
|
@@ -390,6 +400,10 @@ A configurable workbook interaction to interact with other charts within your wo
|
|
|
390
400
|
|
|
391
401
|
A configurable action trigger to trigger actions in other elements within your workbook
|
|
392
402
|
|
|
403
|
+
**Action Effect**
|
|
404
|
+
|
|
405
|
+
A configurable action effect that can be triggered by other elements within your workbook
|
|
406
|
+
|
|
393
407
|
#### PluginInstance
|
|
394
408
|
|
|
395
409
|
```ts
|
|
@@ -430,23 +444,23 @@ interface PluginInstance<T> {
|
|
|
430
444
|
/**
|
|
431
445
|
* Gets a static image of a workbook variable
|
|
432
446
|
*/
|
|
433
|
-
getVariable(
|
|
447
|
+
getVariable(configId: string): WorkbookVariable;
|
|
434
448
|
|
|
435
449
|
/**
|
|
436
450
|
* Setter for workbook variable passed in
|
|
437
451
|
*/
|
|
438
|
-
setVariable(
|
|
452
|
+
setVariable(configId: string, ...values: unknown[]): void;
|
|
439
453
|
|
|
440
454
|
/**
|
|
441
455
|
* Getter for interaction selection state
|
|
442
456
|
*/
|
|
443
|
-
getInteraction(
|
|
457
|
+
getInteraction(configId: string): WorkbookSelection[];
|
|
444
458
|
|
|
445
459
|
/**
|
|
446
460
|
* Setter for interaction selection state
|
|
447
461
|
*/
|
|
448
462
|
setInteraction(
|
|
449
|
-
|
|
463
|
+
configId: string,
|
|
450
464
|
elementId: string,
|
|
451
465
|
selection: WorkbookSelection[],
|
|
452
466
|
): void;
|
|
@@ -454,17 +468,12 @@ interface PluginInstance<T> {
|
|
|
454
468
|
/**
|
|
455
469
|
* Triggers an action based on the provided action trigger ID
|
|
456
470
|
*/
|
|
457
|
-
triggerAction(
|
|
471
|
+
triggerAction(configId: string): void;
|
|
458
472
|
|
|
459
473
|
/**
|
|
460
474
|
* Registers an effect with the provided action effect ID
|
|
461
475
|
*/
|
|
462
|
-
registerEffect(
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* Unregisters an effect based on the provided action effect ID
|
|
466
|
-
*/
|
|
467
|
-
unregisterEffect(id: string): void;
|
|
476
|
+
registerEffect(configId: string, effect: Function): void;
|
|
468
477
|
|
|
469
478
|
/**
|
|
470
479
|
* Overrider function for Config Ready state
|
|
@@ -475,15 +484,16 @@ interface PluginInstance<T> {
|
|
|
475
484
|
* Allows users to subscribe to changes in the passed in variable
|
|
476
485
|
*/
|
|
477
486
|
subscribeToWorkbookVariable(
|
|
478
|
-
|
|
487
|
+
configId: string,
|
|
479
488
|
callback: (input: WorkbookVariable) => void,
|
|
480
489
|
): Unsubscriber;
|
|
481
490
|
|
|
482
491
|
/**
|
|
492
|
+
* @deprecated Use Action API instead
|
|
483
493
|
* Allows users to subscribe to changes in the passed in interaction ID
|
|
484
494
|
*/
|
|
485
495
|
subscribeToWorkbookInteraction(
|
|
486
|
-
|
|
496
|
+
configId: string,
|
|
487
497
|
callback: (input: WorkbookSelection[]) => void,
|
|
488
498
|
): Unsubscriber;
|
|
489
499
|
};
|
|
@@ -492,13 +502,13 @@ interface PluginInstance<T> {
|
|
|
492
502
|
/**
|
|
493
503
|
* Getter for Column Data by parent sheet ID
|
|
494
504
|
*/
|
|
495
|
-
getElementColumns(
|
|
505
|
+
getElementColumns(configId: string): Promise<WbElementColumns>;
|
|
496
506
|
|
|
497
507
|
/**
|
|
498
508
|
* Subscriber to changes in column data by ID
|
|
499
509
|
*/
|
|
500
510
|
subscribeToElementColumns(
|
|
501
|
-
|
|
511
|
+
configId: string,
|
|
502
512
|
callback: (cols: WbElementColumns) => void,
|
|
503
513
|
): Unsubscriber;
|
|
504
514
|
|
|
@@ -506,7 +516,7 @@ interface PluginInstance<T> {
|
|
|
506
516
|
* Subscriber for the data within a given sheet
|
|
507
517
|
*/
|
|
508
518
|
subscribeToElementData(
|
|
509
|
-
|
|
519
|
+
configId: string,
|
|
510
520
|
callback: (data: WbElementData) => void,
|
|
511
521
|
): Unsubscriber;
|
|
512
522
|
};
|
|
@@ -644,15 +654,15 @@ interface WorkbookElementColumns {
|
|
|
644
654
|
|
|
645
655
|
#### useElementData()
|
|
646
656
|
|
|
647
|
-
Provides the latest data values from corresponding sheet
|
|
657
|
+
Provides the latest data values from corresponding sheet, up to 25000 values.
|
|
648
658
|
|
|
649
659
|
```ts
|
|
650
|
-
function useElementData(
|
|
660
|
+
function useElementData(configId: string): WorkbookElementData;
|
|
651
661
|
```
|
|
652
662
|
|
|
653
663
|
Arguments
|
|
654
664
|
|
|
655
|
-
- `
|
|
665
|
+
- `configId : string` - A workbook element’s unique identifier from the plugin config.
|
|
656
666
|
|
|
657
667
|
Returns the row data from the specified element.
|
|
658
668
|
|
|
@@ -662,19 +672,41 @@ interface WorkbookElementData {
|
|
|
662
672
|
}
|
|
663
673
|
```
|
|
664
674
|
|
|
675
|
+
#### usePaginatedElementData()
|
|
676
|
+
|
|
677
|
+
Provides the latest data values from the corresponding sheet (initially 25000), and provides a
|
|
678
|
+
callback for fetching more data in chunks of 25000 values.
|
|
679
|
+
|
|
680
|
+
```ts
|
|
681
|
+
function useElementData(configId: string): [WorkbookElementData, () => void];
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
Arguments
|
|
685
|
+
|
|
686
|
+
- `configId : string` - A workbook element’s unique identifier from the plugin config.
|
|
687
|
+
|
|
688
|
+
Returns the row data from the specified element, and a callback for fetching
|
|
689
|
+
more data.
|
|
690
|
+
|
|
691
|
+
```ts
|
|
692
|
+
interface WorkbookElementData {
|
|
693
|
+
[colId: string]: any[];
|
|
694
|
+
}
|
|
695
|
+
```
|
|
696
|
+
|
|
665
697
|
#### useVariable()
|
|
666
698
|
|
|
667
699
|
Returns a given variable's value and a setter to update that variable
|
|
668
700
|
|
|
669
701
|
```ts
|
|
670
702
|
function useVariable(
|
|
671
|
-
|
|
703
|
+
configId: string,
|
|
672
704
|
): [WorkbookVariable | undefined, (...values: unknown[]) => void];
|
|
673
705
|
```
|
|
674
706
|
|
|
675
707
|
Arguments
|
|
676
708
|
|
|
677
|
-
- `
|
|
709
|
+
- `configId : string` - The config ID corresponding to the workbook control variable
|
|
678
710
|
|
|
679
711
|
The returned setter function accepts 1 or more variable values expressed as an
|
|
680
712
|
array or multiple parameters
|
|
@@ -685,18 +717,18 @@ function setVariableCallback(...values: unknown[]): void;
|
|
|
685
717
|
|
|
686
718
|
#### useInteraction()
|
|
687
719
|
|
|
688
|
-
Returns a given interaction's selection state and a setter to update that
|
|
720
|
+
Returns a given interaction's selection state and a setter to update that interaction
|
|
689
721
|
|
|
690
722
|
```ts
|
|
691
723
|
function useInteraction(
|
|
692
|
-
|
|
724
|
+
configId: string,
|
|
693
725
|
elementId: string,
|
|
694
726
|
): [WorkbookSelection | undefined, (value: WorkbookSelection[]) => void];
|
|
695
727
|
```
|
|
696
728
|
|
|
697
729
|
Arguments
|
|
698
730
|
|
|
699
|
-
- `
|
|
731
|
+
- `configId : string` - The config ID corresponding to the workbook interaction
|
|
700
732
|
- `elementId : string` - The ID of the element that this interaction is
|
|
701
733
|
associated with
|
|
702
734
|
|
|
@@ -708,20 +740,24 @@ function setVariableCallback(value: WorkbookSelection[]): void;
|
|
|
708
740
|
|
|
709
741
|
#### useActionTrigger()
|
|
710
742
|
|
|
743
|
+
- `configId : string` - The config ID corresponding to the action trigger
|
|
744
|
+
|
|
711
745
|
Returns a callback function to trigger one or more action effects for a given action trigger
|
|
712
746
|
|
|
713
747
|
```ts
|
|
714
|
-
function useActionTrigger(
|
|
748
|
+
function useActionTrigger(configId: string): () => void;
|
|
715
749
|
```
|
|
716
750
|
|
|
751
|
+
#### triggerActionCallback();
|
|
752
|
+
|
|
717
753
|
Arguments
|
|
718
754
|
|
|
719
|
-
- `
|
|
755
|
+
- `configId : string` - The config ID corresponding to the action trigger
|
|
720
756
|
|
|
721
|
-
The function that can be called to trigger the action
|
|
757
|
+
The function that can be called to asynchronously trigger the action
|
|
722
758
|
|
|
723
759
|
```ts
|
|
724
|
-
function triggerActionCallback(): void;
|
|
760
|
+
function triggerActionCallback(configId: string): void;
|
|
725
761
|
```
|
|
726
762
|
|
|
727
763
|
#### useActionEffect()
|
|
@@ -729,12 +765,12 @@ function triggerActionCallback(): void;
|
|
|
729
765
|
Registers and unregisters an action effect within the plugin
|
|
730
766
|
|
|
731
767
|
```ts
|
|
732
|
-
function useActionEffect(
|
|
768
|
+
function useActionEffect(configId: string, effect: () => void);
|
|
733
769
|
```
|
|
734
770
|
|
|
735
771
|
Arguments
|
|
736
772
|
|
|
737
|
-
- `
|
|
773
|
+
- `configId : string` - The config ID corresponding to the action effect
|
|
738
774
|
- `effect : Function` - The function to be called when the effect is triggered
|
|
739
775
|
|
|
740
776
|
#### useConfig()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../src/client/initialize.ts"],"names":[],"mappings":"
|
|
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,15 +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 = {};
|
|
10
|
-
|
|
11
|
-
// console.log('registeredEffects', registeredEffects);
|
|
12
|
-
// console.log('TESSSSTTT!');
|
|
11
|
+
const registeredEffects = {};
|
|
13
12
|
const listeners = {};
|
|
14
13
|
for (const [key, value] of new URL(document.location.toString()).searchParams.entries())
|
|
15
14
|
pluginConfig[key] = JSON.parse(value);
|
|
@@ -37,16 +36,12 @@ function initialize() {
|
|
|
37
36
|
subscribedInteractions = {};
|
|
38
37
|
Object.assign(subscribedInteractions, updatedInteractions);
|
|
39
38
|
});
|
|
40
|
-
on('wb:plugin:action-effect:invoke', (
|
|
41
|
-
const effect = registeredEffects[
|
|
42
|
-
console.log('EFFECT:', registeredEffects, id);
|
|
39
|
+
on('wb:plugin:action-effect:invoke', (configId) => {
|
|
40
|
+
const effect = registeredEffects[configId];
|
|
43
41
|
if (!effect) {
|
|
44
|
-
throw new Error(
|
|
42
|
+
throw new Error(`Unknown action effect with name: ${configId}`);
|
|
45
43
|
}
|
|
46
|
-
console.log('registered:', registeredEffects);
|
|
47
44
|
effect();
|
|
48
|
-
// if (effect) effect();
|
|
49
|
-
// else console.warn('No effect found.');
|
|
50
45
|
});
|
|
51
46
|
function on(event, listener) {
|
|
52
47
|
listeners[event] = listeners[event] || [];
|
|
@@ -71,19 +66,6 @@ function initialize() {
|
|
|
71
66
|
off(event, callback);
|
|
72
67
|
};
|
|
73
68
|
on(event, callback);
|
|
74
|
-
// const processedArgs = args.map((arg: unknown) => {
|
|
75
|
-
// if (
|
|
76
|
-
// typeof arg === 'object' &&
|
|
77
|
-
// arg !== null &&
|
|
78
|
-
// 'effect' in arg &&
|
|
79
|
-
// typeof arg.effect === 'function'
|
|
80
|
-
// ) {
|
|
81
|
-
// const effectId = '123';
|
|
82
|
-
// registeredEffects[effectId] = arg.effect;
|
|
83
|
-
// return { ...arg, effect: effectId };
|
|
84
|
-
// }
|
|
85
|
-
// return arg;
|
|
86
|
-
// });
|
|
87
69
|
window.parent.postMessage({ type: event, args, elementId: pluginConfig.id }, (_a = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.wbOrigin) !== null && _a !== void 0 ? _a : '*');
|
|
88
70
|
});
|
|
89
71
|
}
|
|
@@ -115,26 +97,32 @@ function initialize() {
|
|
|
115
97
|
on('config', listener);
|
|
116
98
|
return () => off('config', listener);
|
|
117
99
|
},
|
|
118
|
-
getVariable(
|
|
119
|
-
|
|
100
|
+
getVariable(configId) {
|
|
101
|
+
(0, error_1.validateConfigId)(configId, 'variable');
|
|
102
|
+
return subscribedWorkbookVars[configId];
|
|
120
103
|
},
|
|
121
|
-
setVariable(
|
|
122
|
-
|
|
104
|
+
setVariable(configId, ...values) {
|
|
105
|
+
(0, error_1.validateConfigId)(configId, 'variable');
|
|
106
|
+
void execPromise('wb:plugin:variable:set', configId, ...values);
|
|
123
107
|
},
|
|
124
|
-
getInteraction(
|
|
125
|
-
|
|
108
|
+
getInteraction(configId) {
|
|
109
|
+
(0, error_1.validateConfigId)(configId, 'interaction');
|
|
110
|
+
return subscribedInteractions[configId];
|
|
126
111
|
},
|
|
127
|
-
setInteraction(
|
|
128
|
-
|
|
112
|
+
setInteraction(configId, elementId, selection) {
|
|
113
|
+
(0, error_1.validateConfigId)(configId, 'interaction');
|
|
114
|
+
void execPromise('wb:plugin:selection:set', configId, elementId, selection);
|
|
129
115
|
},
|
|
130
|
-
triggerAction(
|
|
131
|
-
|
|
116
|
+
triggerAction(configId) {
|
|
117
|
+
(0, error_1.validateConfigId)(configId, 'action-trigger');
|
|
118
|
+
void execPromise('wb:plugin:action-trigger:invoke', configId);
|
|
132
119
|
},
|
|
133
|
-
registerEffect(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
120
|
+
registerEffect(configId, effect) {
|
|
121
|
+
(0, error_1.validateConfigId)(configId, 'action-effect');
|
|
122
|
+
registeredEffects[configId] = effect;
|
|
123
|
+
return () => {
|
|
124
|
+
delete registeredEffects[configId];
|
|
125
|
+
};
|
|
138
126
|
},
|
|
139
127
|
configureEditorPanel(options) {
|
|
140
128
|
void execPromise('wb:plugin:config:inspector', options);
|
|
@@ -142,50 +130,56 @@ function initialize() {
|
|
|
142
130
|
setLoadingState(loadingState) {
|
|
143
131
|
void execPromise('wb:plugin:config:loading-state', loadingState);
|
|
144
132
|
},
|
|
145
|
-
subscribeToWorkbookVariable(
|
|
133
|
+
subscribeToWorkbookVariable(configId, callback) {
|
|
134
|
+
(0, error_1.validateConfigId)(configId, 'variable');
|
|
146
135
|
const setValues = (values) => {
|
|
147
|
-
callback(values[
|
|
136
|
+
callback(values[configId]);
|
|
148
137
|
};
|
|
149
138
|
on('wb:plugin:variable:update', setValues);
|
|
150
139
|
return () => {
|
|
151
140
|
off('wb:plugin:variable:update', setValues);
|
|
152
141
|
};
|
|
153
142
|
},
|
|
154
|
-
subscribeToWorkbookInteraction(
|
|
143
|
+
subscribeToWorkbookInteraction(configId, callback) {
|
|
144
|
+
(0, error_1.validateConfigId)(configId, 'interaction');
|
|
155
145
|
const setValues = (values) => {
|
|
156
|
-
callback(values[
|
|
146
|
+
callback(values[configId]);
|
|
157
147
|
};
|
|
158
148
|
on('wb:plugin:selection:update', setValues);
|
|
159
149
|
return () => {
|
|
160
150
|
off('wb:plugin:selection:update', setValues);
|
|
161
151
|
};
|
|
162
152
|
},
|
|
163
|
-
// getRegisteredEffects() {
|
|
164
|
-
// return registeredEffects;
|
|
165
|
-
// },
|
|
166
153
|
},
|
|
167
154
|
elements: {
|
|
168
|
-
getElementColumns(
|
|
169
|
-
|
|
155
|
+
getElementColumns(configId) {
|
|
156
|
+
(0, error_1.validateConfigId)(configId, 'element');
|
|
157
|
+
return execPromise('wb:plugin:element:columns:get', configId);
|
|
170
158
|
},
|
|
171
|
-
subscribeToElementColumns(
|
|
172
|
-
|
|
159
|
+
subscribeToElementColumns(configId, callback) {
|
|
160
|
+
(0, error_1.validateConfigId)(configId, 'element');
|
|
161
|
+
const eventName = `wb:plugin:element:${configId}:columns`;
|
|
173
162
|
on(eventName, callback);
|
|
174
|
-
void execPromise('wb:plugin:element:subscribe:columns',
|
|
163
|
+
void execPromise('wb:plugin:element:subscribe:columns', configId);
|
|
175
164
|
return () => {
|
|
176
165
|
off(eventName, callback);
|
|
177
|
-
void execPromise('wb:plugin:element:unsubscribe:columns',
|
|
166
|
+
void execPromise('wb:plugin:element:unsubscribe:columns', configId);
|
|
178
167
|
};
|
|
179
168
|
},
|
|
180
|
-
subscribeToElementData(
|
|
181
|
-
|
|
169
|
+
subscribeToElementData(configId, callback) {
|
|
170
|
+
(0, error_1.validateConfigId)(configId, 'element');
|
|
171
|
+
const eventName = `wb:plugin:element:${configId}:data`;
|
|
182
172
|
on(eventName, callback);
|
|
183
|
-
void execPromise('wb:plugin:element:subscribe:data',
|
|
173
|
+
void execPromise('wb:plugin:element:subscribe:data', configId);
|
|
184
174
|
return () => {
|
|
185
175
|
off(eventName, callback);
|
|
186
|
-
void execPromise('wb:plugin:element:unsubscribe:data',
|
|
176
|
+
void execPromise('wb:plugin:element:unsubscribe:data', configId);
|
|
187
177
|
};
|
|
188
178
|
},
|
|
179
|
+
fetchMoreElementData(configId) {
|
|
180
|
+
(0, error_1.validateConfigId)(configId, 'element');
|
|
181
|
+
void execPromise('wb:plugin:element:fetch-more', configId);
|
|
182
|
+
},
|
|
189
183
|
},
|
|
190
184
|
destroy() {
|
|
191
185
|
Object.keys(listeners).forEach(event => delete listeners[event]);
|
package/dist/error.d.ts
ADDED
|
@@ -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;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,
|
|
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"}
|
package/dist/react/hooks.d.ts
CHANGED
|
@@ -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
|
|
20
|
-
* @param {string}
|
|
21
|
-
* @returns {WorkbookElementColumns} Values of corresponding columns contained
|
|
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(
|
|
24
|
+
export declare function useElementColumns(configId: string): WorkbookElementColumns;
|
|
24
25
|
/**
|
|
25
|
-
* Provides the latest data values from
|
|
26
|
-
* @param {string}
|
|
27
|
-
* @returns {WorkbookElementData} Element Data for
|
|
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(
|
|
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,28 +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
|
|
39
|
-
* @returns {[(WorkbookVariable | undefined), Function]} Constantly updating
|
|
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
|
|
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}
|
|
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(
|
|
65
|
+
export declare function useActionTrigger(configId: string): () => void;
|
|
55
66
|
/**
|
|
56
67
|
* React hook for registering and unregistering an action effect
|
|
57
|
-
* @param {string}
|
|
68
|
+
* @param {string} configId ID from the config of type: 'action-effect'
|
|
58
69
|
* @param {Function} effect The function to be called when the action is triggered
|
|
59
70
|
*/
|
|
60
|
-
export declare function useActionEffect(
|
|
71
|
+
export declare function useActionEffect(configId: string, effect: () => void): void;
|
|
61
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,EACd,yBAAyB,EACzB,sBAAsB,EACtB,mBAAmB,EAEnB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAGlB;;;GAGG;AACH,wBAAgB,SAAS,IAAI,cAAc,CAAC,GAAG,CAAC,CAE/C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,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
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,mBAAmB,EAEnB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAGlB;;;GAGG;AACH,wBAAgB,SAAS,IAAI,cAAc,CAAC,GAAG,CAAC,CAE/C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,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"}
|
package/dist/react/hooks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useActionEffect = 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
|
|
56
|
-
* @param {string}
|
|
57
|
-
* @returns {WorkbookElementColumns} Values of corresponding columns contained
|
|
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(
|
|
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 (
|
|
64
|
-
return client.elements.subscribeToElementColumns(
|
|
64
|
+
if (configId) {
|
|
65
|
+
return client.elements.subscribeToElementColumns(configId, setColumns);
|
|
65
66
|
}
|
|
66
|
-
}, [client,
|
|
67
|
+
}, [client, configId]);
|
|
67
68
|
return columns;
|
|
68
69
|
}
|
|
69
70
|
exports.useElementColumns = useElementColumns;
|
|
70
71
|
/**
|
|
71
|
-
* Provides the latest data values from
|
|
72
|
-
* @param {string}
|
|
73
|
-
* @returns {WorkbookElementData} Element Data for
|
|
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(
|
|
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 (
|
|
80
|
-
return client.elements.subscribeToElementData(
|
|
80
|
+
if (configId) {
|
|
81
|
+
return client.elements.subscribeToElementData(configId, setData);
|
|
81
82
|
}
|
|
82
|
-
}, [client,
|
|
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
|
|
108
|
-
* @returns {[(WorkbookVariable | undefined), Function]} Constantly updating
|
|
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
|
|
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,30 +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}
|
|
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(
|
|
169
|
+
function useActionTrigger(configId) {
|
|
144
170
|
const client = usePlugin();
|
|
145
171
|
return (0, react_1.useCallback)(() => {
|
|
146
|
-
client.config.triggerAction(
|
|
147
|
-
}, [client,
|
|
172
|
+
client.config.triggerAction(configId);
|
|
173
|
+
}, [client, configId]);
|
|
148
174
|
}
|
|
149
175
|
exports.useActionTrigger = useActionTrigger;
|
|
150
176
|
/**
|
|
151
177
|
* React hook for registering and unregistering an action effect
|
|
152
|
-
* @param {string}
|
|
178
|
+
* @param {string} configId ID from the config of type: 'action-effect'
|
|
153
179
|
* @param {Function} effect The function to be called when the action is triggered
|
|
154
180
|
*/
|
|
155
|
-
function useActionEffect(
|
|
181
|
+
function useActionEffect(configId, effect) {
|
|
156
182
|
const client = usePlugin();
|
|
183
|
+
const effectRef = (0, react_1.useRef)(effect);
|
|
157
184
|
(0, react_1.useEffect)(() => {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return ()
|
|
162
|
-
|
|
163
|
-
};
|
|
164
|
-
}, [client, id]);
|
|
185
|
+
effectRef.current = effect;
|
|
186
|
+
});
|
|
187
|
+
(0, react_1.useEffect)(() => {
|
|
188
|
+
return client.config.registerEffect(configId, effectRef.current);
|
|
189
|
+
}, [client, configId, effect]);
|
|
165
190
|
}
|
|
166
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
|
|
17
|
-
* @property {{string}} defaultValue Current
|
|
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;
|
|
@@ -198,44 +198,42 @@ export interface PluginInstance<T = any> {
|
|
|
198
198
|
configureEditorPanel(options: CustomPluginConfigOptions[]): void;
|
|
199
199
|
/**
|
|
200
200
|
* Gets a static image of a workbook variable
|
|
201
|
-
* @param {string}
|
|
201
|
+
* @param {string} configId ID from config of type: 'variable'
|
|
202
202
|
* @returns {WorkbookVariable} Current value of the workbook variable
|
|
203
203
|
*/
|
|
204
|
-
getVariable(
|
|
204
|
+
getVariable(configId: string): WorkbookVariable;
|
|
205
205
|
/**
|
|
206
206
|
* Setter for workbook variable passed in
|
|
207
|
-
* @param {string}
|
|
207
|
+
* @param {string} configId ID from config of type: 'variable'
|
|
208
208
|
* @param {unknown[]} values Values to assign to the workbook variable
|
|
209
209
|
*/
|
|
210
|
-
setVariable(
|
|
210
|
+
setVariable(configId: string, ...values: unknown[]): void;
|
|
211
211
|
/**
|
|
212
|
+
* @deprecated Use Action API instead
|
|
212
213
|
* Getter for interaction selection state
|
|
213
|
-
* @param {string}
|
|
214
|
+
* @param {string} configId ID from config of type: 'interaction'
|
|
214
215
|
*/
|
|
215
|
-
getInteraction(
|
|
216
|
+
getInteraction(configId: string): WorkbookSelection[];
|
|
216
217
|
/**
|
|
218
|
+
* @deprecated Use Action API instead
|
|
217
219
|
* Setter for interaction selection state
|
|
218
|
-
* @param {string}
|
|
220
|
+
* @param {string} configId ID from config of type: 'interaction'
|
|
219
221
|
* @param {string} elementId Source element ID from element type in Plugin Config
|
|
220
222
|
* @param {Object} selection List of column IDs or Columns and values and key-value pairs to select
|
|
221
223
|
*/
|
|
222
|
-
setInteraction(
|
|
224
|
+
setInteraction(configId: string, elementId: string, selection: WorkbookSelection[]): void;
|
|
223
225
|
/**
|
|
224
226
|
* Triggers an action based on the provided action trigger ID
|
|
225
|
-
* @param {string}
|
|
227
|
+
* @param {string} configId ID from config of type: 'action-trigger'
|
|
226
228
|
*/
|
|
227
|
-
triggerAction(
|
|
229
|
+
triggerAction(configId: string): void;
|
|
228
230
|
/**
|
|
229
231
|
* Registers an effect with the provided action effect ID
|
|
230
|
-
* @param {string}
|
|
231
|
-
* @param effect The effect function to register
|
|
232
|
-
|
|
233
|
-
registerEffect(id: string, effect: Function): void;
|
|
234
|
-
/**
|
|
235
|
-
* Unregisters an effect based on the provided action effect ID
|
|
236
|
-
* @param {string} id ID from action-effect type in Plugin Config
|
|
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
|
|
237
235
|
*/
|
|
238
|
-
|
|
236
|
+
registerEffect(configId: string, effect: () => void): () => void;
|
|
239
237
|
/**
|
|
240
238
|
* Overrider function for Config Ready state
|
|
241
239
|
* @param {boolean} loadingState Boolean representing if Plugin Config is still loading
|
|
@@ -243,40 +241,46 @@ export interface PluginInstance<T = any> {
|
|
|
243
241
|
setLoadingState(ready: boolean): void;
|
|
244
242
|
/**
|
|
245
243
|
* Allows users to subscribe to changes in the passed in variable
|
|
246
|
-
* @param {string}
|
|
244
|
+
* @param {string} configId ID from config of type: 'variable'
|
|
247
245
|
* @callback callback Function to be called upon receiving an updated workbook variable
|
|
248
246
|
* @returns {Unsubscriber} A callable unsubscriber
|
|
249
247
|
*/
|
|
250
|
-
subscribeToWorkbookVariable(
|
|
248
|
+
subscribeToWorkbookVariable(configId: string, callback: (input: WorkbookVariable) => void): Unsubscriber;
|
|
251
249
|
/**
|
|
250
|
+
* @deprecated Use Action API instead
|
|
252
251
|
* Allows users to subscribe to changes in the passed in interaction ID
|
|
253
|
-
* @param {string}
|
|
252
|
+
* @param {string} configId ID from the config of type: 'interaction'
|
|
254
253
|
* @callback callback Function to be called upon receiving an updated interaction selection state
|
|
255
254
|
* @returns {Unsubscriber} A callable unsubscriber
|
|
256
255
|
*/
|
|
257
|
-
subscribeToWorkbookInteraction(
|
|
256
|
+
subscribeToWorkbookInteraction(configId: string, callback: (input: WorkbookSelection[]) => void): Unsubscriber;
|
|
258
257
|
};
|
|
259
258
|
elements: {
|
|
260
259
|
/**
|
|
261
260
|
* Getter for Column Data by parent sheet ID
|
|
262
|
-
* @param {string}
|
|
261
|
+
* @param {string} configId ID from config of type: 'element'
|
|
263
262
|
* @returns {WorkbookElementColumns} Column values contained within corresponding sheet
|
|
264
263
|
*/
|
|
265
|
-
getElementColumns(
|
|
264
|
+
getElementColumns(configId: string): Promise<WorkbookElementColumns>;
|
|
266
265
|
/**
|
|
267
266
|
* Subscriber to changes in column data by ID
|
|
268
|
-
* @param {string}
|
|
267
|
+
* @param {string} configId ID from config of type: 'element'
|
|
269
268
|
* @callback callback Callback function to be called upon changes to column data
|
|
270
269
|
* @returns {Unsubscriber} Callable unsubscriber to column data changes
|
|
271
270
|
*/
|
|
272
|
-
subscribeToElementColumns(
|
|
271
|
+
subscribeToElementColumns(configId: string, callback: (cols: WorkbookElementColumns) => void): Unsubscriber;
|
|
273
272
|
/**
|
|
274
273
|
* Subscriber for the data within a given sheet
|
|
275
|
-
* @param {string}
|
|
274
|
+
* @param {string} configId ID from config of type: 'element'
|
|
276
275
|
* @callback callback Function to call on data passed in
|
|
277
276
|
* @returns {Unsubscriber} A callable unsubscriber to changes in the data
|
|
278
277
|
*/
|
|
279
|
-
subscribeToElementData(
|
|
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;
|
|
280
284
|
};
|
|
281
285
|
/**
|
|
282
286
|
* Destroys plugin instance and removes all subscribers
|
package/dist/types.d.ts.map
CHANGED
|
@@ -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,CAAC,CAAC;AAEhF,oBAAY,qBAAqB,GAAG,YAAY,CAAC;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC,CAAC;AAEH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MA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ACjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigmacomputing/plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9-beta",
|
|
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
|
-
"
|
|
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": "ttsc --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,9 +48,6 @@
|
|
|
49
48
|
"lint-staged": "^13.0.3",
|
|
50
49
|
"prettier": "^2.7.1",
|
|
51
50
|
"ts-jest": "^27.1.4",
|
|
52
|
-
"
|
|
53
|
-
"ttypescript": "^1.5.13",
|
|
54
|
-
"typescript": "^4.8.2",
|
|
55
|
-
"typescript-transform-paths": "^3.3.1"
|
|
51
|
+
"typescript": "^4.8.2"
|
|
56
52
|
}
|
|
57
53
|
}
|