@sigmacomputing/plugin 1.0.5 → 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 +105 -19
- package/dist/client/initialize.d.ts.map +1 -1
- package/dist/client/initialize.js +55 -22
- 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 +36 -12
- package/dist/react/hooks.d.ts.map +1 -1
- package/dist/react/hooks.js +74 -19
- package/dist/types.d.ts +48 -20
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -9
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
|
|
163
|
-
have
|
|
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
|
|
@@ -247,6 +247,16 @@ type CustomPluginConfigOptions =
|
|
|
247
247
|
type: 'interaction';
|
|
248
248
|
name: string;
|
|
249
249
|
label?: string;
|
|
250
|
+
}
|
|
251
|
+
| {
|
|
252
|
+
type: 'action-trigger';
|
|
253
|
+
name: string;
|
|
254
|
+
label?: string;
|
|
255
|
+
}
|
|
256
|
+
| {
|
|
257
|
+
type: 'action-effect';
|
|
258
|
+
name: string;
|
|
259
|
+
label?: string;
|
|
250
260
|
};
|
|
251
261
|
```
|
|
252
262
|
|
|
@@ -376,6 +386,14 @@ Additional Fields
|
|
|
376
386
|
|
|
377
387
|
A configurable workbook interaction to interact with other charts within your workbook
|
|
378
388
|
|
|
389
|
+
**Action Trigger**
|
|
390
|
+
|
|
391
|
+
A configurable action trigger to trigger actions in other elements within your workbook
|
|
392
|
+
|
|
393
|
+
**Action Effect**
|
|
394
|
+
|
|
395
|
+
A configurable action effect that can be triggered by other elements within your workbook
|
|
396
|
+
|
|
379
397
|
#### PluginInstance
|
|
380
398
|
|
|
381
399
|
```ts
|
|
@@ -416,27 +434,37 @@ interface PluginInstance<T> {
|
|
|
416
434
|
/**
|
|
417
435
|
* Gets a static image of a workbook variable
|
|
418
436
|
*/
|
|
419
|
-
getVariable(
|
|
437
|
+
getVariable(configId: string): WorkbookVariable;
|
|
420
438
|
|
|
421
439
|
/**
|
|
422
440
|
* Setter for workbook variable passed in
|
|
423
441
|
*/
|
|
424
|
-
setVariable(
|
|
442
|
+
setVariable(configId: string, ...values: unknown[]): void;
|
|
425
443
|
|
|
426
444
|
/**
|
|
427
445
|
* Getter for interaction selection state
|
|
428
446
|
*/
|
|
429
|
-
getInteraction(
|
|
447
|
+
getInteraction(configId: string): WorkbookSelection[];
|
|
430
448
|
|
|
431
449
|
/**
|
|
432
450
|
* Setter for interaction selection state
|
|
433
451
|
*/
|
|
434
452
|
setInteraction(
|
|
435
|
-
|
|
453
|
+
configId: string,
|
|
436
454
|
elementId: string,
|
|
437
455
|
selection: WorkbookSelection[],
|
|
438
456
|
): void;
|
|
439
457
|
|
|
458
|
+
/**
|
|
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
|
|
465
|
+
*/
|
|
466
|
+
registerEffect(configId: string, effect: Function): void;
|
|
467
|
+
|
|
440
468
|
/**
|
|
441
469
|
* Overrider function for Config Ready state
|
|
442
470
|
*/
|
|
@@ -446,15 +474,16 @@ interface PluginInstance<T> {
|
|
|
446
474
|
* Allows users to subscribe to changes in the passed in variable
|
|
447
475
|
*/
|
|
448
476
|
subscribeToWorkbookVariable(
|
|
449
|
-
|
|
477
|
+
configId: string,
|
|
450
478
|
callback: (input: WorkbookVariable) => void,
|
|
451
479
|
): Unsubscriber;
|
|
452
480
|
|
|
453
481
|
/**
|
|
482
|
+
* @deprecated Use Action API instead
|
|
454
483
|
* Allows users to subscribe to changes in the passed in interaction ID
|
|
455
484
|
*/
|
|
456
485
|
subscribeToWorkbookInteraction(
|
|
457
|
-
|
|
486
|
+
configId: string,
|
|
458
487
|
callback: (input: WorkbookSelection[]) => void,
|
|
459
488
|
): Unsubscriber;
|
|
460
489
|
};
|
|
@@ -463,13 +492,13 @@ interface PluginInstance<T> {
|
|
|
463
492
|
/**
|
|
464
493
|
* Getter for Column Data by parent sheet ID
|
|
465
494
|
*/
|
|
466
|
-
getElementColumns(
|
|
495
|
+
getElementColumns(configId: string): Promise<WbElementColumns>;
|
|
467
496
|
|
|
468
497
|
/**
|
|
469
498
|
* Subscriber to changes in column data by ID
|
|
470
499
|
*/
|
|
471
500
|
subscribeToElementColumns(
|
|
472
|
-
|
|
501
|
+
configId: string,
|
|
473
502
|
callback: (cols: WbElementColumns) => void,
|
|
474
503
|
): Unsubscriber;
|
|
475
504
|
|
|
@@ -477,7 +506,7 @@ interface PluginInstance<T> {
|
|
|
477
506
|
* Subscriber for the data within a given sheet
|
|
478
507
|
*/
|
|
479
508
|
subscribeToElementData(
|
|
480
|
-
|
|
509
|
+
configId: string,
|
|
481
510
|
callback: (data: WbElementData) => void,
|
|
482
511
|
): Unsubscriber;
|
|
483
512
|
};
|
|
@@ -615,15 +644,15 @@ interface WorkbookElementColumns {
|
|
|
615
644
|
|
|
616
645
|
#### useElementData()
|
|
617
646
|
|
|
618
|
-
Provides the latest data values from corresponding sheet
|
|
647
|
+
Provides the latest data values from corresponding sheet, up to 25000 values.
|
|
619
648
|
|
|
620
649
|
```ts
|
|
621
|
-
function useElementData(
|
|
650
|
+
function useElementData(configId: string): WorkbookElementData;
|
|
622
651
|
```
|
|
623
652
|
|
|
624
653
|
Arguments
|
|
625
654
|
|
|
626
|
-
- `
|
|
655
|
+
- `configId : string` - A workbook element’s unique identifier from the plugin config.
|
|
627
656
|
|
|
628
657
|
Returns the row data from the specified element.
|
|
629
658
|
|
|
@@ -633,19 +662,41 @@ interface WorkbookElementData {
|
|
|
633
662
|
}
|
|
634
663
|
```
|
|
635
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
|
+
|
|
636
687
|
#### useVariable()
|
|
637
688
|
|
|
638
689
|
Returns a given variable's value and a setter to update that variable
|
|
639
690
|
|
|
640
691
|
```ts
|
|
641
692
|
function useVariable(
|
|
642
|
-
|
|
693
|
+
configId: string,
|
|
643
694
|
): [WorkbookVariable | undefined, (...values: unknown[]) => void];
|
|
644
695
|
```
|
|
645
696
|
|
|
646
697
|
Arguments
|
|
647
698
|
|
|
648
|
-
- `
|
|
699
|
+
- `configId : string` - The config ID corresponding to the workbook control variable
|
|
649
700
|
|
|
650
701
|
The returned setter function accepts 1 or more variable values expressed as an
|
|
651
702
|
array or multiple parameters
|
|
@@ -656,18 +707,18 @@ function setVariableCallback(...values: unknown[]): void;
|
|
|
656
707
|
|
|
657
708
|
#### useInteraction()
|
|
658
709
|
|
|
659
|
-
Returns a given interaction's selection state and a setter to update that
|
|
710
|
+
Returns a given interaction's selection state and a setter to update that interaction
|
|
660
711
|
|
|
661
712
|
```ts
|
|
662
713
|
function useInteraction(
|
|
663
|
-
|
|
714
|
+
configId: string,
|
|
664
715
|
elementId: string,
|
|
665
716
|
): [WorkbookSelection | undefined, (value: WorkbookSelection[]) => void];
|
|
666
717
|
```
|
|
667
718
|
|
|
668
719
|
Arguments
|
|
669
720
|
|
|
670
|
-
- `
|
|
721
|
+
- `configId : string` - The config ID corresponding to the workbook interaction
|
|
671
722
|
- `elementId : string` - The ID of the element that this interaction is
|
|
672
723
|
associated with
|
|
673
724
|
|
|
@@ -677,6 +728,41 @@ The returned setter function accepts an array of workbook selection elements
|
|
|
677
728
|
function setVariableCallback(value: WorkbookSelection[]): void;
|
|
678
729
|
```
|
|
679
730
|
|
|
731
|
+
#### useActionTrigger()
|
|
732
|
+
|
|
733
|
+
- `configId : string` - The config ID corresponding to the action trigger
|
|
734
|
+
|
|
735
|
+
Returns a callback function to trigger one or more action effects for a given action trigger
|
|
736
|
+
|
|
737
|
+
```ts
|
|
738
|
+
function useActionTrigger(configId: string): () => void;
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
#### triggerActionCallback();
|
|
742
|
+
|
|
743
|
+
Arguments
|
|
744
|
+
|
|
745
|
+
- `configId : string` - The config ID corresponding to the action trigger
|
|
746
|
+
|
|
747
|
+
The function that can be called to asynchronously trigger the action
|
|
748
|
+
|
|
749
|
+
```ts
|
|
750
|
+
function triggerActionCallback(configId: string): void;
|
|
751
|
+
```
|
|
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
|
+
|
|
680
766
|
#### useConfig()
|
|
681
767
|
|
|
682
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":"
|
|
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,17 +97,32 @@ function initialize() {
|
|
|
88
97
|
on('config', listener);
|
|
89
98
|
return () => off('config', listener);
|
|
90
99
|
},
|
|
91
|
-
getVariable(
|
|
92
|
-
|
|
100
|
+
getVariable(configId) {
|
|
101
|
+
(0, error_1.validateConfigId)(configId, 'variable');
|
|
102
|
+
return subscribedWorkbookVars[configId];
|
|
103
|
+
},
|
|
104
|
+
setVariable(configId, ...values) {
|
|
105
|
+
(0, error_1.validateConfigId)(configId, 'variable');
|
|
106
|
+
void execPromise('wb:plugin:variable:set', configId, ...values);
|
|
107
|
+
},
|
|
108
|
+
getInteraction(configId) {
|
|
109
|
+
(0, error_1.validateConfigId)(configId, 'interaction');
|
|
110
|
+
return subscribedInteractions[configId];
|
|
93
111
|
},
|
|
94
|
-
|
|
95
|
-
|
|
112
|
+
setInteraction(configId, elementId, selection) {
|
|
113
|
+
(0, error_1.validateConfigId)(configId, 'interaction');
|
|
114
|
+
void execPromise('wb:plugin:selection:set', configId, elementId, selection);
|
|
96
115
|
},
|
|
97
|
-
|
|
98
|
-
|
|
116
|
+
triggerAction(configId) {
|
|
117
|
+
(0, error_1.validateConfigId)(configId, 'action-trigger');
|
|
118
|
+
void execPromise('wb:plugin:action-trigger:invoke', configId);
|
|
99
119
|
},
|
|
100
|
-
|
|
101
|
-
|
|
120
|
+
registerEffect(configId, effect) {
|
|
121
|
+
(0, error_1.validateConfigId)(configId, 'action-effect');
|
|
122
|
+
registeredEffects[configId] = effect;
|
|
123
|
+
return () => {
|
|
124
|
+
delete registeredEffects[configId];
|
|
125
|
+
};
|
|
102
126
|
},
|
|
103
127
|
configureEditorPanel(options) {
|
|
104
128
|
void execPromise('wb:plugin:config:inspector', options);
|
|
@@ -106,18 +130,20 @@ function initialize() {
|
|
|
106
130
|
setLoadingState(loadingState) {
|
|
107
131
|
void execPromise('wb:plugin:config:loading-state', loadingState);
|
|
108
132
|
},
|
|
109
|
-
subscribeToWorkbookVariable(
|
|
133
|
+
subscribeToWorkbookVariable(configId, callback) {
|
|
134
|
+
(0, error_1.validateConfigId)(configId, 'variable');
|
|
110
135
|
const setValues = (values) => {
|
|
111
|
-
callback(values[
|
|
136
|
+
callback(values[configId]);
|
|
112
137
|
};
|
|
113
138
|
on('wb:plugin:variable:update', setValues);
|
|
114
139
|
return () => {
|
|
115
140
|
off('wb:plugin:variable:update', setValues);
|
|
116
141
|
};
|
|
117
142
|
},
|
|
118
|
-
subscribeToWorkbookInteraction(
|
|
143
|
+
subscribeToWorkbookInteraction(configId, callback) {
|
|
144
|
+
(0, error_1.validateConfigId)(configId, 'interaction');
|
|
119
145
|
const setValues = (values) => {
|
|
120
|
-
callback(values[
|
|
146
|
+
callback(values[configId]);
|
|
121
147
|
};
|
|
122
148
|
on('wb:plugin:selection:update', setValues);
|
|
123
149
|
return () => {
|
|
@@ -126,27 +152,34 @@ function initialize() {
|
|
|
126
152
|
},
|
|
127
153
|
},
|
|
128
154
|
elements: {
|
|
129
|
-
getElementColumns(
|
|
130
|
-
|
|
155
|
+
getElementColumns(configId) {
|
|
156
|
+
(0, error_1.validateConfigId)(configId, 'element');
|
|
157
|
+
return execPromise('wb:plugin:element:columns:get', configId);
|
|
131
158
|
},
|
|
132
|
-
subscribeToElementColumns(
|
|
133
|
-
|
|
159
|
+
subscribeToElementColumns(configId, callback) {
|
|
160
|
+
(0, error_1.validateConfigId)(configId, 'element');
|
|
161
|
+
const eventName = `wb:plugin:element:${configId}:columns`;
|
|
134
162
|
on(eventName, callback);
|
|
135
|
-
void execPromise('wb:plugin:element:subscribe:columns',
|
|
163
|
+
void execPromise('wb:plugin:element:subscribe:columns', configId);
|
|
136
164
|
return () => {
|
|
137
165
|
off(eventName, callback);
|
|
138
|
-
void execPromise('wb:plugin:element:unsubscribe:columns',
|
|
166
|
+
void execPromise('wb:plugin:element:unsubscribe:columns', configId);
|
|
139
167
|
};
|
|
140
168
|
},
|
|
141
|
-
subscribeToElementData(
|
|
142
|
-
|
|
169
|
+
subscribeToElementData(configId, callback) {
|
|
170
|
+
(0, error_1.validateConfigId)(configId, 'element');
|
|
171
|
+
const eventName = `wb:plugin:element:${configId}:data`;
|
|
143
172
|
on(eventName, callback);
|
|
144
|
-
void execPromise('wb:plugin:element:subscribe:data',
|
|
173
|
+
void execPromise('wb:plugin:element:subscribe:data', configId);
|
|
145
174
|
return () => {
|
|
146
175
|
off(eventName, callback);
|
|
147
|
-
void execPromise('wb:plugin:element:unsubscribe:data',
|
|
176
|
+
void execPromise('wb:plugin:element:unsubscribe:data', configId);
|
|
148
177
|
};
|
|
149
178
|
},
|
|
179
|
+
fetchMoreElementData(configId) {
|
|
180
|
+
(0, error_1.validateConfigId)(configId, 'element');
|
|
181
|
+
void execPromise('wb:plugin:element:fetch-more', configId);
|
|
182
|
+
},
|
|
150
183
|
},
|
|
151
184
|
destroy() {
|
|
152
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,15 +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];
|
|
59
|
+
/**
|
|
60
|
+
* React hook for returning a triggering callback function for the registered
|
|
61
|
+
* action trigger
|
|
62
|
+
* @param {string} configId ID from the config of type: 'action-trigger'
|
|
63
|
+
* @returns {Function} A callback function to trigger the action
|
|
64
|
+
*/
|
|
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;
|
|
48
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.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) {
|
|
@@ -134,3 +160,32 @@ function useInteraction(id, elementId) {
|
|
|
134
160
|
return [workbookInteraction, setInteraction];
|
|
135
161
|
}
|
|
136
162
|
exports.useInteraction = useInteraction;
|
|
163
|
+
/**
|
|
164
|
+
* React hook for returning a triggering callback function for the registered
|
|
165
|
+
* action trigger
|
|
166
|
+
* @param {string} configId ID from the config of type: 'action-trigger'
|
|
167
|
+
* @returns {Function} A callback function to trigger the action
|
|
168
|
+
*/
|
|
169
|
+
function useActionTrigger(configId) {
|
|
170
|
+
const client = usePlugin();
|
|
171
|
+
return (0, react_1.useCallback)(() => {
|
|
172
|
+
client.config.triggerAction(configId);
|
|
173
|
+
}, [client, configId]);
|
|
174
|
+
}
|
|
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
|
|
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;
|
|
@@ -139,6 +139,14 @@ export declare type CustomPluginConfigOptions = {
|
|
|
139
139
|
type: 'interaction';
|
|
140
140
|
name: string;
|
|
141
141
|
label?: string;
|
|
142
|
+
} | {
|
|
143
|
+
type: 'action-trigger';
|
|
144
|
+
name: string;
|
|
145
|
+
label?: string;
|
|
146
|
+
} | {
|
|
147
|
+
type: 'action-effect';
|
|
148
|
+
name: string;
|
|
149
|
+
label?: string;
|
|
142
150
|
};
|
|
143
151
|
/**
|
|
144
152
|
* @typedef {object} PluginInstance
|
|
@@ -190,28 +198,42 @@ export interface PluginInstance<T = any> {
|
|
|
190
198
|
configureEditorPanel(options: CustomPluginConfigOptions[]): void;
|
|
191
199
|
/**
|
|
192
200
|
* Gets a static image of a workbook variable
|
|
193
|
-
* @param {string}
|
|
201
|
+
* @param {string} configId ID from config of type: 'variable'
|
|
194
202
|
* @returns {WorkbookVariable} Current value of the workbook variable
|
|
195
203
|
*/
|
|
196
|
-
getVariable(
|
|
204
|
+
getVariable(configId: string): WorkbookVariable;
|
|
197
205
|
/**
|
|
198
206
|
* Setter for workbook variable passed in
|
|
199
|
-
* @param {string}
|
|
207
|
+
* @param {string} configId ID from config of type: 'variable'
|
|
200
208
|
* @param {unknown[]} values Values to assign to the workbook variable
|
|
201
209
|
*/
|
|
202
|
-
setVariable(
|
|
210
|
+
setVariable(configId: string, ...values: unknown[]): void;
|
|
203
211
|
/**
|
|
212
|
+
* @deprecated Use Action API instead
|
|
204
213
|
* Getter for interaction selection state
|
|
205
|
-
* @param {string}
|
|
214
|
+
* @param {string} configId ID from config of type: 'interaction'
|
|
206
215
|
*/
|
|
207
|
-
getInteraction(
|
|
216
|
+
getInteraction(configId: string): WorkbookSelection[];
|
|
208
217
|
/**
|
|
218
|
+
* @deprecated Use Action API instead
|
|
209
219
|
* Setter for interaction selection state
|
|
210
|
-
* @param {string}
|
|
220
|
+
* @param {string} configId ID from config of type: 'interaction'
|
|
211
221
|
* @param {string} elementId Source element ID from element type in Plugin Config
|
|
212
222
|
* @param {Object} selection List of column IDs or Columns and values and key-value pairs to select
|
|
213
223
|
*/
|
|
214
|
-
setInteraction(
|
|
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;
|
|
230
|
+
/**
|
|
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
|
|
235
|
+
*/
|
|
236
|
+
registerEffect(configId: string, effect: () => void): () => void;
|
|
215
237
|
/**
|
|
216
238
|
* Overrider function for Config Ready state
|
|
217
239
|
* @param {boolean} loadingState Boolean representing if Plugin Config is still loading
|
|
@@ -219,40 +241,46 @@ export interface PluginInstance<T = any> {
|
|
|
219
241
|
setLoadingState(ready: boolean): void;
|
|
220
242
|
/**
|
|
221
243
|
* Allows users to subscribe to changes in the passed in variable
|
|
222
|
-
* @param {string}
|
|
244
|
+
* @param {string} configId ID from config of type: 'variable'
|
|
223
245
|
* @callback callback Function to be called upon receiving an updated workbook variable
|
|
224
246
|
* @returns {Unsubscriber} A callable unsubscriber
|
|
225
247
|
*/
|
|
226
|
-
subscribeToWorkbookVariable(
|
|
248
|
+
subscribeToWorkbookVariable(configId: string, callback: (input: WorkbookVariable) => void): Unsubscriber;
|
|
227
249
|
/**
|
|
250
|
+
* @deprecated Use Action API instead
|
|
228
251
|
* Allows users to subscribe to changes in the passed in interaction ID
|
|
229
|
-
* @param {string}
|
|
252
|
+
* @param {string} configId ID from the config of type: 'interaction'
|
|
230
253
|
* @callback callback Function to be called upon receiving an updated interaction selection state
|
|
231
254
|
* @returns {Unsubscriber} A callable unsubscriber
|
|
232
255
|
*/
|
|
233
|
-
subscribeToWorkbookInteraction(
|
|
256
|
+
subscribeToWorkbookInteraction(configId: string, callback: (input: WorkbookSelection[]) => void): Unsubscriber;
|
|
234
257
|
};
|
|
235
258
|
elements: {
|
|
236
259
|
/**
|
|
237
260
|
* Getter for Column Data by parent sheet ID
|
|
238
|
-
* @param {string}
|
|
261
|
+
* @param {string} configId ID from config of type: 'element'
|
|
239
262
|
* @returns {WorkbookElementColumns} Column values contained within corresponding sheet
|
|
240
263
|
*/
|
|
241
|
-
getElementColumns(
|
|
264
|
+
getElementColumns(configId: string): Promise<WorkbookElementColumns>;
|
|
242
265
|
/**
|
|
243
266
|
* Subscriber to changes in column data by ID
|
|
244
|
-
* @param {string}
|
|
267
|
+
* @param {string} configId ID from config of type: 'element'
|
|
245
268
|
* @callback callback Callback function to be called upon changes to column data
|
|
246
269
|
* @returns {Unsubscriber} Callable unsubscriber to column data changes
|
|
247
270
|
*/
|
|
248
|
-
subscribeToElementColumns(
|
|
271
|
+
subscribeToElementColumns(configId: string, callback: (cols: WorkbookElementColumns) => void): Unsubscriber;
|
|
249
272
|
/**
|
|
250
273
|
* Subscriber for the data within a given sheet
|
|
251
|
-
* @param {string}
|
|
274
|
+
* @param {string} configId ID from config of type: 'element'
|
|
252
275
|
* @callback callback Function to call on data passed in
|
|
253
276
|
* @returns {Unsubscriber} A callable unsubscriber to changes in the data
|
|
254
277
|
*/
|
|
255
|
-
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;
|
|
256
284
|
};
|
|
257
285
|
/**
|
|
258
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,MAAM,WAAW,mBAAmB;IAClC,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;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,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.
|
|
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
|
-
"
|
|
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
|
}
|