Skip to content

Commit 382f49f

Browse files
author
Xiaoyu Yin
committed
[screenshotter] implement polyfill for requestAnimationFrame
1 parent 35299a0 commit 382f49f

File tree

13 files changed

+32
-84
lines changed

13 files changed

+32
-84
lines changed

package.json

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "@sigmacomputing/plugin",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Sigma Computing Plugin Client API",
55
"license": "MIT",
66
"homepage": "https://github.com/sigmacomputing/plugin",
7+
"main": "./dist/index.js",
78
"repository": {
89
"type": "git",
910
"url": "https://github.com/sigmacomputing/plugin.git"
@@ -12,23 +13,13 @@
1213
"email": "[email protected]",
1314
"url": "https://github.com/sigmacomputing/plugin/issues"
1415
},
15-
"module": "./src/index.ts",
16-
"main": "./dist/index.js",
17-
"types": "./dist/index.d.ts",
1816
"files": [
19-
"/dist",
20-
"/src",
21-
"!/src/**/__tests__/**"
17+
"dist/*"
2218
],
23-
"exports": {
24-
".": "./dist/index.js",
25-
"./react": "./dist/client/react/index.js",
26-
"./package.json": "./package.json"
27-
},
2819
"typesVersions": {
2920
"*": {
3021
"react": [
31-
"dist/client/react/index.d.ts"
22+
"dist/react/index.d.ts"
3223
]
3324
}
3425
},
@@ -44,7 +35,8 @@
4435
"tsc": "ttsc --build tsconfig.build.json"
4536
},
4637
"peerDependencies": {
47-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
38+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
39+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
4840
},
4941
"devDependencies": {
5042
"@jest/types": "^27.5.1",
@@ -56,8 +48,6 @@
5648
"jest-watch-typeahead": "^2.1.1",
5749
"lint-staged": "^13.0.3",
5850
"prettier": "^2.7.1",
59-
"react": "^18.2.0",
60-
"react-dom": "^18.2.0",
6151
"ts-jest": "^27.1.4",
6252
"ts-node": "^10.9.1",
6353
"ttypescript": "^1.5.13",

src/client.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { initialize } from "./client/initialize";
2+
3+
export const client = initialize();

src/client/index.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/client/initialize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
WorkbookSelection,
66
WorkbookVariable,
77
Unsubscriber,
8-
} from 'types';
8+
} from '../types';
99

1010
export function initialize<T = {}>(): PluginInstance<T> {
1111
const pluginConfig: Partial<PluginConfig<T>> = {

src/client/react/index.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
export * from 'client';
2-
export * from 'types';
1+
export * from './types';
2+
export * from './react';
3+
export * from './client';
4+
5+
export * from './utils/requestAnimationFramePolyfill';

src/react.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export * from './react/hooks';
2+
export {
3+
SigmaClientProviderProps,
4+
SigmaClientProvider,
5+
} from './react/Provider';
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createContext } from 'react';
22

3-
import { client } from 'client';
4-
import { PluginInstance } from 'types';
3+
import { client } from '../client';
4+
import { PluginInstance } from '../types';
55

66
export const PluginContext = createContext<PluginInstance>(client);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ReactNode } from 'react';
22

3-
import { PluginContext } from 'client/react/Context';
4-
import { PluginInstance } from 'types';
3+
import { PluginContext } from './Context';
4+
import { PluginInstance } from '../types';
55

66
export interface SigmaClientProviderProps<T = any> {
77
client: PluginInstance<T>;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { useContext, useEffect, useCallback, useRef, useState } from 'react';
22

3-
import { PluginContext } from 'client/react/Context';
3+
import { PluginContext } from './Context';
44
import {
55
PluginInstance,
66
CustomPluginConfigOptions,
77
WorkbookElementColumns,
88
WorkbookElementData,
99
WorkbookSelection,
1010
WorkbookVariable,
11-
} from 'types';
12-
import { deepEqual } from 'utils/deepEqual';
11+
} from '../types';
12+
import { deepEqual } from '../utils/deepEqual';
1313

1414
/**
1515
* Gets the entire plugin instance

0 commit comments

Comments
 (0)