@usecsv/react 0.1.0 → 0.2.2
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 +21 -0
- package/build/index.cjs +61 -10
- package/build/index.cjs.map +1 -1
- package/build/index.esm.js +61 -10
- package/build/index.esm.js.map +1 -1
- package/build/index.js +61 -10
- package/build/index.js.map +1 -1
- package/build/index.mjs +61 -10
- package/build/index.mjs.map +1 -1
- package/build/index.umd.js +61 -10
- package/build/index.umd.js.map +1 -1
- package/build/index.umd.min.js +33 -4
- package/build/index.umd.min.js.map +1 -1
- package/build/types/lib/useCsvReactPlugin.d.ts +3 -7
- package/build/types/lib/useCsvReactPlugin.d.ts.map +1 -1
- package/package.json +4 -4
- package/.babelrc.jest.js +0 -14
- package/.editorconfig +0 -15
- package/.env +0 -0
- package/.env.example +0 -1
- package/.eslintignore +0 -1
- package/.eslintrc.airbnbts.js +0 -73
- package/.eslintrc.json +0 -91
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -7
- package/.github/dependabot.yml +0 -7
- package/.github/workflows/main.yml +0 -44
- package/.github/workflows/publish.yml +0 -19
- package/.github/workflows/sementic_release.yml +0 -27
- package/.gitignore +0 -8
- package/.nvmrc +0 -1
- package/.nyc_output/0196dd80-12a9-4176-bd5b-4a8bc6e984f9.json +0 -1
- package/.nyc_output/0d5259bc-f1f3-4ca2-9d4f-1f77daccebf4.json +0 -1
- package/.nyc_output/92c6bc34-84c6-46f7-9e14-0d1bd2068352.json +0 -1
- package/.nyc_output/a0942cca-db9b-40d2-833e-8fcf7011171f.json +0 -1
- package/.nyc_output/b3fc15a1-349d-4d4c-a8dd-2142cc988ac3.json +0 -1
- package/.nyc_output/processinfo/0196dd80-12a9-4176-bd5b-4a8bc6e984f9.json +0 -1
- package/.nyc_output/processinfo/0d5259bc-f1f3-4ca2-9d4f-1f77daccebf4.json +0 -1
- package/.nyc_output/processinfo/92c6bc34-84c6-46f7-9e14-0d1bd2068352.json +0 -1
- package/.nyc_output/processinfo/a0942cca-db9b-40d2-833e-8fcf7011171f.json +0 -1
- package/.nyc_output/processinfo/b3fc15a1-349d-4d4c-a8dd-2142cc988ac3.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/.nycrc +0 -8
- package/.prettierignore +0 -2
- package/.prettierrc.js +0 -6
- package/.releaserc.json +0 -39
- package/.vscode/extensions.json +0 -8
- package/.vscode/launch.json +0 -29
- package/.vscode/settings.json +0 -21
- package/commitlint.config.js +0 -1
- package/config/rollup.config.js +0 -78
- package/config/webpack.dev.js +0 -59
- package/reports/coverage/base.css +0 -224
- package/reports/coverage/block-navigation.js +0 -79
- package/reports/coverage/favicon.png +0 -0
- package/reports/coverage/index.html +0 -96
- package/reports/coverage/prettify.css +0 -1
- package/reports/coverage/prettify.js +0 -2
- package/reports/coverage/sort-arrow-sprite.png +0 -0
- package/reports/coverage/sorter.js +0 -170
- package/src/dev/index.html +0 -14
- package/src/dev/index.tsx +0 -22
- package/src/index.tsx +0 -3
- package/src/lib/useCsvReactPlugin.tsx +0 -42
- package/src/test/jest-setup.ts +0 -7
- package/tsconfig.json +0 -35
- package/tsconfig.module.json +0 -23
- package/yarn.lock +0 -11867
package/src/dev/index.html
DELETED
package/src/dev/index.tsx
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import ReactDOM from "react-dom";
|
|
3
|
-
|
|
4
|
-
import UseCsvButton from "../index";
|
|
5
|
-
|
|
6
|
-
ReactDOM.render(
|
|
7
|
-
<React.StrictMode>
|
|
8
|
-
<div
|
|
9
|
-
style={{
|
|
10
|
-
position: "absolute",
|
|
11
|
-
top: "50%",
|
|
12
|
-
left: "50%",
|
|
13
|
-
transform: "translateX(-50%) translateY(-50%)",
|
|
14
|
-
}}
|
|
15
|
-
>
|
|
16
|
-
<UseCsvButton importerKey="your-importer-key" user={{ userId: "12345" }} metadata={{ anotherId: "12345" }}>
|
|
17
|
-
Import Data
|
|
18
|
-
</UseCsvButton>
|
|
19
|
-
</div>
|
|
20
|
-
</React.StrictMode>,
|
|
21
|
-
document.getElementById("root"),
|
|
22
|
-
);
|
package/src/index.tsx
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import useCsvPlugin from "@usecsv/js";
|
|
2
|
-
import React, { FC, ReactNode } from "react";
|
|
3
|
-
|
|
4
|
-
type UserObject = {
|
|
5
|
-
readonly userId: string;
|
|
6
|
-
};
|
|
7
|
-
type UseCsvButtonTypes = {
|
|
8
|
-
readonly importerKey: string;
|
|
9
|
-
readonly user?: UserObject;
|
|
10
|
-
readonly metadata: Record<string, string | number> | undefined;
|
|
11
|
-
readonly render?: ((onClick: () => Promise<any>) => ReactNode) | undefined | null;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const UseCsvButton: FC<UseCsvButtonTypes> = ({ children, importerKey, user, metadata, render }) => {
|
|
15
|
-
return (
|
|
16
|
-
<>
|
|
17
|
-
{render ? (
|
|
18
|
-
<>{render(() => useCsvPlugin({ importerKey, user, metadata }))}</>
|
|
19
|
-
) : (
|
|
20
|
-
<button
|
|
21
|
-
type="button"
|
|
22
|
-
id="usecsv-button"
|
|
23
|
-
style={{
|
|
24
|
-
backgroundColor: "#FFF",
|
|
25
|
-
color: "#000",
|
|
26
|
-
border: "2px solid #000",
|
|
27
|
-
borderRadius: "6px",
|
|
28
|
-
padding: "10px 15px",
|
|
29
|
-
textAlign: "center",
|
|
30
|
-
fontSize: "16px",
|
|
31
|
-
cursor: "pointer",
|
|
32
|
-
}}
|
|
33
|
-
onClick={() => useCsvPlugin({ importerKey, user, metadata })}
|
|
34
|
-
>
|
|
35
|
-
{children}
|
|
36
|
-
</button>
|
|
37
|
-
)}
|
|
38
|
-
</>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default UseCsvButton;
|
package/src/test/jest-setup.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Module settings.
|
|
4
|
-
"allowSyntheticDefaultImports": true,
|
|
5
|
-
"esModuleInterop": true,
|
|
6
|
-
"isolatedModules": true,
|
|
7
|
-
"moduleResolution": "node",
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
// Strictness and quality settings.
|
|
10
|
-
"alwaysStrict": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"importsNotUsedAsValues": "error",
|
|
13
|
-
"noFallthroughCasesInSwitch": true,
|
|
14
|
-
"noImplicitOverride": true,
|
|
15
|
-
"noImplicitReturns": true,
|
|
16
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
17
|
-
"noUncheckedIndexedAccess": true,
|
|
18
|
-
"noUnusedLocals": true,
|
|
19
|
-
"noUnusedParameters": true,
|
|
20
|
-
"strict": true,
|
|
21
|
-
"pretty": true /* Stylize errors and messages using color and context. */,
|
|
22
|
-
// Type-checking settings.
|
|
23
|
-
"lib": [
|
|
24
|
-
"ES2020",
|
|
25
|
-
"DOM"
|
|
26
|
-
],
|
|
27
|
-
"skipDefaultLibCheck": true,
|
|
28
|
-
"skipLibCheck": true,
|
|
29
|
-
"jsx": "react"
|
|
30
|
-
},
|
|
31
|
-
"include": [
|
|
32
|
-
"./src/**/*.ts",
|
|
33
|
-
"src/index.tsx", "./src/**/*.tsx",
|
|
34
|
-
],
|
|
35
|
-
}
|
package/tsconfig.module.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
// Transpilation settings.
|
|
5
|
-
"module": "ES2020",
|
|
6
|
-
"target": "ES5",
|
|
7
|
-
// Output settings.
|
|
8
|
-
"charset": "utf-8",
|
|
9
|
-
"newLine": "LF",
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
// Type declaration settings.
|
|
12
|
-
"declaration": true,
|
|
13
|
-
"declarationDir": "build/types/",
|
|
14
|
-
// "emitDeclarationOnly": true,
|
|
15
|
-
"declarationMap": true,
|
|
16
|
-
"jsx": "react"
|
|
17
|
-
},
|
|
18
|
-
"exclude": [
|
|
19
|
-
"src/lib/**/*.spec.ts",
|
|
20
|
-
"src/**/dev",
|
|
21
|
-
"./**/test"
|
|
22
|
-
]
|
|
23
|
-
}
|