@sigmacomputing/plugin 1.1.0-alpha.3 → 1.1.1
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/CHANGELOG.md +25 -0
- package/LICENSE +21 -0
- package/README.md +993 -0
- package/dist/client/initialize.d.ts +3 -0
- package/dist/client/initialize.d.ts.map +1 -0
- package/dist/client/initialize.js +223 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +5 -0
- package/dist/error.d.ts +3 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +9 -0
- package/dist/{types/index.d.ts → index.d.ts} +2 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/react/Context.d.ts +4 -0
- package/dist/react/Context.d.ts.map +1 -0
- package/dist/react/Context.js +6 -0
- package/dist/react/Provider.d.ts +8 -0
- package/dist/react/Provider.d.ts.map +1 -0
- package/dist/react/Provider.js +9 -0
- package/dist/react/hooks.d.ts +83 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/hooks.js +231 -0
- package/dist/react.d.ts +3 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +20 -0
- package/dist/{types/types/index.d.ts → types.d.ts} +132 -62
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/utils/deepEqual.d.ts +2 -0
- package/dist/utils/deepEqual.d.ts.map +1 -0
- package/dist/utils/deepEqual.js +28 -0
- package/dist/{types/utils → utils}/polyfillRequestAnimationFrame.d.ts +1 -1
- package/dist/utils/polyfillRequestAnimationFrame.d.ts.map +1 -0
- package/dist/{cjs/utils → utils}/polyfillRequestAnimationFrame.js +8 -9
- package/package.json +40 -29
- package/dist/cjs/client/index.js +0 -9
- package/dist/cjs/client/index.js.map +0 -1
- package/dist/cjs/client/initialize.js +0 -158
- package/dist/cjs/client/initialize.js.map +0 -1
- package/dist/cjs/index.js +0 -12
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/utils/polyfillRequestAnimationFrame.js.map +0 -1
- package/dist/esm/client/index.esm.js +0 -6
- package/dist/esm/client/index.esm.js.map +0 -1
- package/dist/esm/client/initialize.esm.js +0 -156
- package/dist/esm/client/initialize.esm.js.map +0 -1
- package/dist/esm/index.esm.js +0 -4
- package/dist/esm/index.esm.js.map +0 -1
- package/dist/esm/utils/polyfillRequestAnimationFrame.esm.js +0 -15
- package/dist/esm/utils/polyfillRequestAnimationFrame.esm.js.map +0 -1
- package/dist/mjs/client/index.mjs +0 -6
- package/dist/mjs/client/index.mjs.map +0 -1
- package/dist/mjs/client/initialize.mjs +0 -156
- package/dist/mjs/client/initialize.mjs.map +0 -1
- package/dist/mjs/index.mjs +0 -4
- package/dist/mjs/index.mjs.map +0 -1
- package/dist/mjs/utils/polyfillRequestAnimationFrame.mjs +0 -15
- package/dist/mjs/utils/polyfillRequestAnimationFrame.mjs.map +0 -1
- package/dist/types/.tsbuildinfo +0 -1
- package/dist/types/client/index.d.ts +0 -4
- package/dist/types/client/index.d.ts.map +0 -1
- package/dist/types/client/initialize.d.ts +0 -3
- package/dist/types/client/initialize.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/utils/polyfillRequestAnimationFrame.d.ts.map +0 -1
- package/dist/umd/plugin.development.js +0 -181
- package/dist/umd/plugin.development.js.map +0 -1
- package/dist/umd/plugin.production.min.js +0 -2
- package/dist/umd/plugin.production.min.js.map +0 -1
- package/src/client/index.ts +0 -5
- package/src/client/initialize.ts +0 -196
- package/src/globals.d.ts +0 -5
- package/src/index.ts +0 -4
- package/src/types/index.ts +0 -322
- package/src/utils/polyfillRequestAnimationFrame.ts +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.SigmaClientProvider = void 0;
|
|
18
|
+
__exportStar(require("./react/hooks"), exports);
|
|
19
|
+
var Provider_1 = require("./react/Provider");
|
|
20
|
+
Object.defineProperty(exports, "SigmaClientProvider", { enumerable: true, get: function () { return Provider_1.SigmaClientProvider; } });
|
|
@@ -11,17 +11,33 @@ export interface PluginConfig<T> {
|
|
|
11
11
|
screenshot: boolean;
|
|
12
12
|
[key: string]: any;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Style colors available to plugins
|
|
16
|
+
* @typedef {object} PluginStyle
|
|
17
|
+
* @property {string} backgroundColor Background color set from workbook if any
|
|
18
|
+
*/
|
|
19
|
+
export interface PluginStyle {
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
}
|
|
14
22
|
/**
|
|
15
23
|
* @typedef {object} WorkbookVariable
|
|
16
|
-
* @property {string} name Name of
|
|
17
|
-
* @property {{string}} defaultValue Current
|
|
24
|
+
* @property {string} name Name of control variable within workbook
|
|
25
|
+
* @property {{string}} defaultValue Current value containing at least type as string
|
|
18
26
|
*/
|
|
19
27
|
export interface WorkbookVariable {
|
|
20
28
|
name: string;
|
|
21
29
|
defaultValue: {
|
|
22
30
|
type: string;
|
|
31
|
+
value: any;
|
|
23
32
|
};
|
|
24
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* @typedef {object} UrlParameter
|
|
36
|
+
* @property {string} value Current url value
|
|
37
|
+
*/
|
|
38
|
+
export interface UrlParameter {
|
|
39
|
+
value: string;
|
|
40
|
+
}
|
|
25
41
|
export declare type WorkbookSelection = Record<string, {
|
|
26
42
|
type: string;
|
|
27
43
|
val?: unknown;
|
|
@@ -66,80 +82,82 @@ export interface WorkbookElementColumns {
|
|
|
66
82
|
* @typedef {() => void} Unsubscriber
|
|
67
83
|
*/
|
|
68
84
|
export declare type Unsubscriber = () => void;
|
|
69
|
-
|
|
70
|
-
* Different types Plugin Config Options
|
|
71
|
-
* @typedef {object} CustomPluginConfigOptions
|
|
72
|
-
* @property {string} type Type of config option
|
|
73
|
-
* @property {string} name Name ID of config option
|
|
74
|
-
* @property {(string | undefined)} label Displayed label for config option
|
|
75
|
-
*/
|
|
76
|
-
export declare type CustomPluginConfigOptions = {
|
|
77
|
-
type: 'group';
|
|
85
|
+
export interface CustomPluginConfigOptionBase {
|
|
78
86
|
name: string;
|
|
79
87
|
label?: string;
|
|
80
|
-
}
|
|
88
|
+
}
|
|
89
|
+
export interface CustomPluginConfigGroup extends CustomPluginConfigOptionBase {
|
|
90
|
+
type: 'group';
|
|
91
|
+
}
|
|
92
|
+
export interface CustomPluginConfigElement extends CustomPluginConfigOptionBase {
|
|
81
93
|
type: 'element';
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
} | {
|
|
94
|
+
}
|
|
95
|
+
export interface CustomPluginConfigColumn extends CustomPluginConfigOptionBase {
|
|
85
96
|
type: 'column';
|
|
86
|
-
name: string;
|
|
87
|
-
label?: string;
|
|
88
97
|
allowedTypes?: ValueType[];
|
|
89
98
|
source: string;
|
|
90
99
|
allowMultiple: boolean;
|
|
91
|
-
}
|
|
100
|
+
}
|
|
101
|
+
export interface CustomPluginConfigText extends CustomPluginConfigOptionBase {
|
|
92
102
|
type: 'text';
|
|
93
|
-
name: string;
|
|
94
|
-
label?: string;
|
|
95
103
|
source?: string;
|
|
96
104
|
secure?: boolean;
|
|
97
105
|
multiline?: boolean;
|
|
98
106
|
placeholder?: string;
|
|
99
107
|
defaultValue?: string;
|
|
100
|
-
}
|
|
108
|
+
}
|
|
109
|
+
export interface CustomPluginConfigToggle extends CustomPluginConfigOptionBase {
|
|
101
110
|
type: 'toggle';
|
|
102
|
-
name: string;
|
|
103
|
-
label?: string;
|
|
104
111
|
source?: string;
|
|
105
112
|
defaultValue?: boolean;
|
|
106
|
-
}
|
|
113
|
+
}
|
|
114
|
+
export interface CustomPluginConfigCheckbox extends CustomPluginConfigOptionBase {
|
|
107
115
|
type: 'checkbox';
|
|
108
|
-
name: string;
|
|
109
|
-
label?: string;
|
|
110
116
|
source?: string;
|
|
111
117
|
defaultValue?: boolean;
|
|
112
|
-
}
|
|
118
|
+
}
|
|
119
|
+
export interface CustomPluginConfigRadio extends CustomPluginConfigOptionBase {
|
|
113
120
|
type: 'radio';
|
|
114
|
-
name: string;
|
|
115
|
-
label?: string;
|
|
116
121
|
source?: string;
|
|
117
|
-
values: string[];
|
|
118
122
|
singleLine?: boolean;
|
|
123
|
+
values: string[];
|
|
119
124
|
defaultValue?: string;
|
|
120
|
-
}
|
|
125
|
+
}
|
|
126
|
+
export interface CustomPluginConfigDropdown extends CustomPluginConfigOptionBase {
|
|
121
127
|
type: 'dropdown';
|
|
122
|
-
name: string;
|
|
123
|
-
label?: string;
|
|
124
128
|
source?: string;
|
|
125
129
|
width?: string;
|
|
126
130
|
values: string[];
|
|
127
131
|
defaultValue?: string;
|
|
128
|
-
}
|
|
132
|
+
}
|
|
133
|
+
export interface CustomPluginConfigColor extends CustomPluginConfigOptionBase {
|
|
129
134
|
type: 'color';
|
|
130
|
-
name: string;
|
|
131
|
-
label?: string;
|
|
132
135
|
source?: string;
|
|
133
|
-
}
|
|
136
|
+
}
|
|
137
|
+
export interface CustomPluginConfigVariable extends CustomPluginConfigOptionBase {
|
|
134
138
|
type: 'variable';
|
|
135
|
-
name: string;
|
|
136
|
-
label?: string;
|
|
137
139
|
allowedTypes?: ControlType[];
|
|
138
|
-
}
|
|
140
|
+
}
|
|
141
|
+
export interface CustomPluginConfigInteraction extends CustomPluginConfigOptionBase {
|
|
139
142
|
type: 'interaction';
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
}
|
|
144
|
+
export interface CustomPluginConfigActionTrigger extends CustomPluginConfigOptionBase {
|
|
145
|
+
type: 'action-trigger';
|
|
146
|
+
}
|
|
147
|
+
export interface CustomPluginConfigActionEffect extends CustomPluginConfigOptionBase {
|
|
148
|
+
type: 'action-effect';
|
|
149
|
+
}
|
|
150
|
+
export interface CustomPluginConfigUrlParameter extends Omit<CustomPluginConfigOptionBase, 'label'> {
|
|
151
|
+
type: 'url-parameter';
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Different types Plugin Config Options
|
|
155
|
+
* @typedef {object} CustomPluginConfigOptions
|
|
156
|
+
* @property {string} type Type of config option
|
|
157
|
+
* @property {string} name Name ID of config option
|
|
158
|
+
* @property {(string | undefined)} label Displayed label for config option
|
|
159
|
+
*/
|
|
160
|
+
export declare type CustomPluginConfigOptions = CustomPluginConfigGroup | CustomPluginConfigElement | CustomPluginConfigColumn | CustomPluginConfigText | CustomPluginConfigToggle | CustomPluginConfigCheckbox | CustomPluginConfigRadio | CustomPluginConfigDropdown | CustomPluginConfigColor | CustomPluginConfigVariable | CustomPluginConfigInteraction | CustomPluginConfigActionTrigger | CustomPluginConfigActionEffect | CustomPluginConfigUrlParameter;
|
|
143
161
|
/**
|
|
144
162
|
* @typedef {object} PluginInstance
|
|
145
163
|
* @template T Type of Config passed in
|
|
@@ -190,28 +208,42 @@ export interface PluginInstance<T = any> {
|
|
|
190
208
|
configureEditorPanel(options: CustomPluginConfigOptions[]): void;
|
|
191
209
|
/**
|
|
192
210
|
* Gets a static image of a workbook variable
|
|
193
|
-
* @param {string}
|
|
211
|
+
* @param {string} configId ID from config of type: 'variable'
|
|
194
212
|
* @returns {WorkbookVariable} Current value of the workbook variable
|
|
195
213
|
*/
|
|
196
|
-
getVariable(
|
|
214
|
+
getVariable(configId: string): WorkbookVariable;
|
|
197
215
|
/**
|
|
198
216
|
* Setter for workbook variable passed in
|
|
199
|
-
* @param {string}
|
|
217
|
+
* @param {string} configId ID from config of type: 'variable'
|
|
200
218
|
* @param {unknown[]} values Values to assign to the workbook variable
|
|
201
219
|
*/
|
|
202
|
-
setVariable(
|
|
220
|
+
setVariable(configId: string, ...values: unknown[]): void;
|
|
203
221
|
/**
|
|
222
|
+
* @deprecated Use Action API instead
|
|
204
223
|
* Getter for interaction selection state
|
|
205
|
-
* @param {string}
|
|
224
|
+
* @param {string} configId ID from config of type: 'interaction'
|
|
206
225
|
*/
|
|
207
|
-
getInteraction(
|
|
226
|
+
getInteraction(configId: string): WorkbookSelection[];
|
|
208
227
|
/**
|
|
228
|
+
* @deprecated Use Action API instead
|
|
209
229
|
* Setter for interaction selection state
|
|
210
|
-
* @param {string}
|
|
230
|
+
* @param {string} configId ID from config of type: 'interaction'
|
|
211
231
|
* @param {string} elementId Source element ID from element type in Plugin Config
|
|
212
232
|
* @param {Object} selection List of column IDs or Columns and values and key-value pairs to select
|
|
213
233
|
*/
|
|
214
|
-
setInteraction(
|
|
234
|
+
setInteraction(configId: string, elementId: string, selection: WorkbookSelection[]): void;
|
|
235
|
+
/**
|
|
236
|
+
* Triggers an action based on the provided action trigger ID
|
|
237
|
+
* @param {string} configId ID from config of type: 'action-trigger'
|
|
238
|
+
*/
|
|
239
|
+
triggerAction(configId: string): void;
|
|
240
|
+
/**
|
|
241
|
+
* Registers an effect with the provided action effect ID
|
|
242
|
+
* @param {string} configId ID from config of type: 'action-effect'
|
|
243
|
+
* @param {Function} effect The effect function to register
|
|
244
|
+
* @returns {Unsubscriber} A callable unsubscriber
|
|
245
|
+
*/
|
|
246
|
+
registerEffect(configId: string, effect: () => void): () => void;
|
|
215
247
|
/**
|
|
216
248
|
* Overrider function for Config Ready state
|
|
217
249
|
* @param {boolean} loadingState Boolean representing if Plugin Config is still loading
|
|
@@ -219,44 +251,82 @@ export interface PluginInstance<T = any> {
|
|
|
219
251
|
setLoadingState(ready: boolean): void;
|
|
220
252
|
/**
|
|
221
253
|
* Allows users to subscribe to changes in the passed in variable
|
|
222
|
-
* @param {string}
|
|
254
|
+
* @param {string} configId ID from config of type: 'variable'
|
|
223
255
|
* @callback callback Function to be called upon receiving an updated workbook variable
|
|
224
256
|
* @returns {Unsubscriber} A callable unsubscriber
|
|
225
257
|
*/
|
|
226
|
-
subscribeToWorkbookVariable(
|
|
258
|
+
subscribeToWorkbookVariable(configId: string, callback: (input: WorkbookVariable) => void): Unsubscriber;
|
|
259
|
+
/**
|
|
260
|
+
* Allows users to subscribe to changes in the url parameter
|
|
261
|
+
* @param {string} configId ID from config of type: 'url-parameter'
|
|
262
|
+
* @callback callback Function to be called upon receiving an updated url parameter
|
|
263
|
+
* @returns {Unsubscriber} A callable unsubscriber
|
|
264
|
+
*/
|
|
265
|
+
subscribeToUrlParameter(configId: string, callback: (input: UrlParameter) => void): Unsubscriber;
|
|
266
|
+
/**
|
|
267
|
+
* Gets the current value of a url parameter
|
|
268
|
+
* @param {string} configId ID from config of type: 'url-parameter'
|
|
269
|
+
* @returns {UrlParameter} Current value of the url parameter
|
|
270
|
+
*/
|
|
271
|
+
getUrlParameter(configId: string): UrlParameter;
|
|
227
272
|
/**
|
|
273
|
+
* Setter for url parameter
|
|
274
|
+
* @param {string} configId ID from config of type: 'url-parameter'
|
|
275
|
+
* @param {string} value Value to assign to the url parameter
|
|
276
|
+
*/
|
|
277
|
+
setUrlParameter(configId: string, value: string): void;
|
|
278
|
+
/**
|
|
279
|
+
* @deprecated Use Action API instead
|
|
228
280
|
* Allows users to subscribe to changes in the passed in interaction ID
|
|
229
|
-
* @param {string}
|
|
281
|
+
* @param {string} configId ID from the config of type: 'interaction'
|
|
230
282
|
* @callback callback Function to be called upon receiving an updated interaction selection state
|
|
231
283
|
* @returns {Unsubscriber} A callable unsubscriber
|
|
232
284
|
*/
|
|
233
|
-
subscribeToWorkbookInteraction(
|
|
285
|
+
subscribeToWorkbookInteraction(configId: string, callback: (input: WorkbookSelection[]) => void): Unsubscriber;
|
|
234
286
|
};
|
|
235
287
|
elements: {
|
|
236
288
|
/**
|
|
237
289
|
* Getter for Column Data by parent sheet ID
|
|
238
|
-
* @param {string}
|
|
290
|
+
* @param {string} configId ID from config of type: 'element'
|
|
239
291
|
* @returns {WorkbookElementColumns} Column values contained within corresponding sheet
|
|
240
292
|
*/
|
|
241
|
-
getElementColumns(
|
|
293
|
+
getElementColumns(configId: string): Promise<WorkbookElementColumns>;
|
|
242
294
|
/**
|
|
243
295
|
* Subscriber to changes in column data by ID
|
|
244
|
-
* @param {string}
|
|
296
|
+
* @param {string} configId ID from config of type: 'element'
|
|
245
297
|
* @callback callback Callback function to be called upon changes to column data
|
|
246
298
|
* @returns {Unsubscriber} Callable unsubscriber to column data changes
|
|
247
299
|
*/
|
|
248
|
-
subscribeToElementColumns(
|
|
300
|
+
subscribeToElementColumns(configId: string, callback: (cols: WorkbookElementColumns) => void): Unsubscriber;
|
|
249
301
|
/**
|
|
250
302
|
* Subscriber for the data within a given sheet
|
|
251
|
-
* @param {string}
|
|
303
|
+
* @param {string} configId ID from config of type: 'element'
|
|
252
304
|
* @callback callback Function to call on data passed in
|
|
253
305
|
* @returns {Unsubscriber} A callable unsubscriber to changes in the data
|
|
254
306
|
*/
|
|
255
|
-
subscribeToElementData(
|
|
307
|
+
subscribeToElementData(configId: string, callback: (data: WorkbookElementData) => void): Unsubscriber;
|
|
308
|
+
/**
|
|
309
|
+
* Ask sigma to load more data
|
|
310
|
+
* @param {string} configId ID from config of type: 'element'
|
|
311
|
+
*/
|
|
312
|
+
fetchMoreElementData(configId: string): void;
|
|
313
|
+
};
|
|
314
|
+
style: {
|
|
315
|
+
/**
|
|
316
|
+
* Subscribe to style updates
|
|
317
|
+
* @param callback Function to call when style updates
|
|
318
|
+
* @returns Unsubscriber function
|
|
319
|
+
*/
|
|
320
|
+
subscribe(callback: (style: PluginStyle) => void): () => void;
|
|
321
|
+
/**
|
|
322
|
+
* Request current style from workbook
|
|
323
|
+
* @returns Promise with current style
|
|
324
|
+
*/
|
|
325
|
+
get(): Promise<PluginStyle>;
|
|
256
326
|
};
|
|
257
327
|
/**
|
|
258
328
|
* Destroys plugin instance and removes all subscribers
|
|
259
329
|
*/
|
|
260
330
|
destroy(): void;
|
|
261
331
|
}
|
|
262
|
-
//# sourceMappingURL=
|
|
332
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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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I,EAAE,GAAG,uBAc7C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deepEqual = void 0;
|
|
4
|
+
function isObject(obj) {
|
|
5
|
+
if (typeof obj === 'object' && obj != null) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function deepEqual(obj1, obj2) {
|
|
13
|
+
if (obj1 === obj2) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
else if (isObject(obj1) && isObject(obj2)) {
|
|
17
|
+
if (Object.keys(obj1).length !== Object.keys(obj2).length) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
for (const prop in obj1) {
|
|
21
|
+
if (!deepEqual(obj1[prop], obj2[prop])) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.deepEqual = deepEqual;
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
|
|
5
5
|
* @param w Window Object
|
|
6
6
|
*/
|
|
7
|
-
export declare function polyfillRequestAnimationFrame(
|
|
7
|
+
export declare function polyfillRequestAnimationFrame(w: Window): void;
|
|
8
8
|
//# sourceMappingURL=polyfillRequestAnimationFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polyfillRequestAnimationFrame.d.ts","sourceRoot":"","sources":["../../src/utils/polyfillRequestAnimationFrame.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,MAAM,QAKtD"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.polyfillRequestAnimationFrame = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* requestAnimationFrame() calls are paused in most browsers when running in background tabs or hidden <iframe>s in order to improve performance and battery life
|
|
5
6
|
*
|
|
6
7
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
|
|
7
8
|
* @param w Window Object
|
|
8
9
|
*/
|
|
9
|
-
function polyfillRequestAnimationFrame(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
function polyfillRequestAnimationFrame(w) {
|
|
11
|
+
if ('requestAnimationFrame' in w) {
|
|
12
|
+
w.requestAnimationFrame = cb => w.setTimeout(cb, 1000 / 60);
|
|
13
|
+
w.cancelAnimationFrame = id => w.clearTimeout(id);
|
|
14
|
+
}
|
|
14
15
|
}
|
|
15
|
-
|
|
16
16
|
exports.polyfillRequestAnimationFrame = polyfillRequestAnimationFrame;
|
|
17
|
-
//# sourceMappingURL=polyfillRequestAnimationFrame.js.map
|
package/package.json
CHANGED
|
@@ -1,45 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigmacomputing/plugin",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"
|
|
5
|
-
"description": "Sigma Computing Plugin: Vanilla Client API",
|
|
6
|
-
"homepage": "https://github.com/sigmacomputing/plugin",
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "Sigma Computing Plugin Client API",
|
|
7
5
|
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/sigmacomputing/plugin",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/sigmacomputing/plugin.git"
|
|
11
|
-
"directory": "packages/plugin"
|
|
10
|
+
"url": "https://github.com/sigmacomputing/plugin.git"
|
|
12
11
|
},
|
|
13
12
|
"bugs": {
|
|
14
13
|
"email": "support@sigmacomputing.com",
|
|
15
14
|
"url": "https://github.com/sigmacomputing/plugin/issues"
|
|
16
15
|
},
|
|
17
|
-
"
|
|
18
|
-
"sigma",
|
|
19
|
-
"sigma-plugin",
|
|
20
|
-
"sigmacomputing",
|
|
21
|
-
"sigmacomputing-plugin"
|
|
22
|
-
],
|
|
23
|
-
"main": "src/index.ts",
|
|
16
|
+
"packageManager": "yarn@4.4.1",
|
|
24
17
|
"files": [
|
|
25
|
-
"
|
|
26
|
-
"/src",
|
|
27
|
-
"!/src/**/__tests__/**"
|
|
18
|
+
"dist/**/*"
|
|
28
19
|
],
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"types": "./dist/types/index.d.ts"
|
|
20
|
+
"typesVersions": {
|
|
21
|
+
"*": {
|
|
22
|
+
"react": [
|
|
23
|
+
"dist/react/index.d.ts"
|
|
24
|
+
]
|
|
35
25
|
}
|
|
36
26
|
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
37
30
|
"scripts": {
|
|
38
|
-
"build
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
31
|
+
"build": "yarn tsc --build tsconfig.build.json",
|
|
32
|
+
"build:watch": "yarn build --watch",
|
|
33
|
+
"format": "prettier --write 'src/**/*.{ts,tsx}' 'jest.config.ts'",
|
|
34
|
+
"precommit": "lint-staged",
|
|
35
|
+
"prepublish": "yarn build",
|
|
36
|
+
"test": "jest --ci",
|
|
37
|
+
"test:watch": "yarn test --watch"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
41
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@jest/types": "^27.5.1",
|
|
45
|
+
"@types/jest": "^27.5.1",
|
|
46
|
+
"@types/node": "^18.7.14",
|
|
47
|
+
"@types/react": "^19.0.0",
|
|
48
|
+
"@types/react-dom": "^19.0.0",
|
|
49
|
+
"jest": "^27.5.1",
|
|
50
|
+
"jest-watch-typeahead": "^2.1.1",
|
|
51
|
+
"lint-staged": "^13.0.3",
|
|
52
|
+
"prettier": "^2.7.1",
|
|
53
|
+
"ts-jest": "^27.1.4",
|
|
54
|
+
"typescript": "^4.8.2"
|
|
44
55
|
}
|
|
45
|
-
}
|
|
56
|
+
}
|
package/dist/cjs/client/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/client/index.ts"],"sourcesContent":["import { initialize } from './initialize';\n\nexport const client = initialize();\n\nexport { initialize };\n"],"names":["client","initialize"],"mappings":";;;;AAEaA,MAAAA,MAAM,GAAGC,qBAAU;;;;;"}
|