@teambit/component.ui.component-compare.context 0.0.4

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.
@@ -0,0 +1,15 @@
1
+ import { ComponentCompareModel } from '@teambit/component.ui.component-compare.models.component-compare-model';
2
+ import { ComponentCompareState } from '@teambit/component.ui.component-compare.models.component-compare-state';
3
+ import { ComponentCompareHooks } from '@teambit/component.ui.component-compare.models.component-compare-hooks';
4
+ import { createContext, useContext } from 'react';
5
+
6
+ export type ComponentCompareContextType = ComponentCompareModel & { state?: ComponentCompareState } & {
7
+ hooks?: ComponentCompareHooks;
8
+ };
9
+
10
+ export const ComponentCompareContext = createContext<ComponentCompareContextType | undefined>(undefined);
11
+
12
+ export const useComponentCompare: () => ComponentCompareContextType | undefined = () => {
13
+ const componentCompareContext = useContext(ComponentCompareContext);
14
+ return componentCompareContext;
15
+ };
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { ComponentCompareModel } from '@teambit/component.ui.component-compare.models.component-compare-model';
3
+ import { ComponentCompareState } from '@teambit/component.ui.component-compare.models.component-compare-state';
4
+ import { ComponentCompareHooks } from '@teambit/component.ui.component-compare.models.component-compare-hooks';
5
+ export declare type ComponentCompareContextType = ComponentCompareModel & {
6
+ state?: ComponentCompareState;
7
+ } & {
8
+ hooks?: ComponentCompareHooks;
9
+ };
10
+ export declare const ComponentCompareContext: import("react").Context<ComponentCompareContextType>;
11
+ export declare const useComponentCompare: () => ComponentCompareContextType | undefined;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useComponentCompare = exports.ComponentCompareContext = void 0;
4
+ const react_1 = require("react");
5
+ exports.ComponentCompareContext = (0, react_1.createContext)(undefined);
6
+ const useComponentCompare = () => {
7
+ const componentCompareContext = (0, react_1.useContext)(exports.ComponentCompareContext);
8
+ return componentCompareContext;
9
+ };
10
+ exports.useComponentCompare = useComponentCompare;
11
+ //# sourceMappingURL=component-compare-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-compare-context.js","sourceRoot":"","sources":["../component-compare-context.ts"],"names":[],"mappings":";;;AAGA,iCAAkD;AAMrC,QAAA,uBAAuB,GAAG,IAAA,qBAAa,EAA0C,SAAS,CAAC,CAAC;AAElG,MAAM,mBAAmB,GAAkD,GAAG,EAAE;IACrF,MAAM,uBAAuB,GAAG,IAAA,kBAAU,EAAC,+BAAuB,CAAC,CAAC;IACpE,OAAO,uBAAuB,CAAC;AACjC,CAAC,CAAC;AAHW,QAAA,mBAAmB,uBAG9B"}
@@ -0,0 +1 @@
1
+ export { ComponentCompareContext, useComponentCompare, ComponentCompareContextType } from './component-compare-context';
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useComponentCompare = exports.ComponentCompareContext = void 0;
4
+ var component_compare_context_1 = require("./component-compare-context");
5
+ Object.defineProperty(exports, "ComponentCompareContext", { enumerable: true, get: function () { return component_compare_context_1.ComponentCompareContext; } });
6
+ Object.defineProperty(exports, "useComponentCompare", { enumerable: true, get: function () { return component_compare_context_1.useComponentCompare; } });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,yEAAwH;AAA/G,oIAAA,uBAAuB,OAAA;AAAE,gIAAA,mBAAmB,OAAA"}
@@ -0,0 +1,7 @@
1
+ ;
2
+ ;
3
+
4
+ export const compositions = [];
5
+ export const overview = [];
6
+
7
+ export const compositions_metadata = {"compositions":[]};
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": [
4
+ "es2019",
5
+ "DOM",
6
+ "ES6",
7
+ "DOM.Iterable"
8
+ ],
9
+ "target": "es2015",
10
+ "module": "CommonJS",
11
+ "jsx": "react",
12
+ "allowJs": true,
13
+ "composite": true,
14
+ "declaration": true,
15
+ "sourceMap": true,
16
+ "skipLibCheck": true,
17
+ "experimentalDecorators": true,
18
+ "outDir": "dist",
19
+ "moduleResolution": "node",
20
+ "esModuleInterop": true,
21
+ "rootDir": ".",
22
+ "resolveJsonModule": true
23
+ },
24
+ "exclude": [
25
+ "dist",
26
+ "package.json"
27
+ ],
28
+ "include": [
29
+ "**/*",
30
+ "**/*.json"
31
+ ]
32
+ }
package/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { ComponentCompareContext, useComponentCompare, ComponentCompareContextType } from './component-compare-context';
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@teambit/component.ui.component-compare.context",
3
+ "version": "0.0.4",
4
+ "homepage": "https://bit.dev/teambit/component/ui/component-compare/context",
5
+ "main": "dist/index.js",
6
+ "componentId": {
7
+ "scope": "teambit.component",
8
+ "name": "ui/component-compare/context",
9
+ "version": "0.0.4"
10
+ },
11
+ "dependencies": {
12
+ "core-js": "^3.0.0",
13
+ "@teambit/component.ui.component-compare.models.component-compare-hooks": "0.0.1",
14
+ "@teambit/component.ui.component-compare.models.component-compare-model": "0.0.2",
15
+ "@teambit/component.ui.component-compare.models.component-compare-state": "0.0.1"
16
+ },
17
+ "devDependencies": {
18
+ "@types/react": "^17.0.8",
19
+ "@types/mocha": "9.1.0",
20
+ "@types/testing-library__jest-dom": "5.9.5",
21
+ "@babel/runtime": "7.20.0",
22
+ "@types/jest": "^26.0.0",
23
+ "@types/react-dom": "^17.0.5",
24
+ "@types/node": "12.20.4"
25
+ },
26
+ "peerDependencies": {
27
+ "react-dom": "^16.8.0 || ^17.0.0",
28
+ "react": "^16.8.0 || ^17.0.0"
29
+ },
30
+ "license": "Apache-2.0",
31
+ "private": false,
32
+ "engines": {
33
+ "node": ">=12.22.0"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/teambit/bit"
38
+ },
39
+ "keywords": [
40
+ "bit",
41
+ "components",
42
+ "collaboration",
43
+ "web",
44
+ "react",
45
+ "react-components",
46
+ "angular",
47
+ "angular-components"
48
+ ]
49
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": [
4
+ "es2019",
5
+ "DOM",
6
+ "ES6",
7
+ "DOM.Iterable"
8
+ ],
9
+ "target": "es2015",
10
+ "module": "CommonJS",
11
+ "jsx": "react",
12
+ "allowJs": true,
13
+ "composite": true,
14
+ "declaration": true,
15
+ "sourceMap": true,
16
+ "skipLibCheck": true,
17
+ "experimentalDecorators": true,
18
+ "outDir": "dist",
19
+ "moduleResolution": "node",
20
+ "esModuleInterop": true,
21
+ "rootDir": ".",
22
+ "resolveJsonModule": true
23
+ },
24
+ "exclude": [
25
+ "dist",
26
+ "package.json"
27
+ ],
28
+ "include": [
29
+ "**/*",
30
+ "**/*.json"
31
+ ]
32
+ }
@@ -0,0 +1,29 @@
1
+ declare module '*.png' {
2
+ const value: any;
3
+ export = value;
4
+ }
5
+ declare module '*.svg' {
6
+ import type { FunctionComponent, SVGProps } from 'react';
7
+
8
+ export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
9
+ const src: string;
10
+ export default src;
11
+ }
12
+
13
+ // @TODO Gilad
14
+ declare module '*.jpg' {
15
+ const value: any;
16
+ export = value;
17
+ }
18
+ declare module '*.jpeg' {
19
+ const value: any;
20
+ export = value;
21
+ }
22
+ declare module '*.gif' {
23
+ const value: any;
24
+ export = value;
25
+ }
26
+ declare module '*.bmp' {
27
+ const value: any;
28
+ export = value;
29
+ }
@@ -0,0 +1,42 @@
1
+ declare module '*.module.css' {
2
+ const classes: { readonly [key: string]: string };
3
+ export default classes;
4
+ }
5
+ declare module '*.module.scss' {
6
+ const classes: { readonly [key: string]: string };
7
+ export default classes;
8
+ }
9
+ declare module '*.module.sass' {
10
+ const classes: { readonly [key: string]: string };
11
+ export default classes;
12
+ }
13
+
14
+ declare module '*.module.less' {
15
+ const classes: { readonly [key: string]: string };
16
+ export default classes;
17
+ }
18
+
19
+ declare module '*.less' {
20
+ const classes: { readonly [key: string]: string };
21
+ export default classes;
22
+ }
23
+
24
+ declare module '*.css' {
25
+ const classes: { readonly [key: string]: string };
26
+ export default classes;
27
+ }
28
+
29
+ declare module '*.sass' {
30
+ const classes: { readonly [key: string]: string };
31
+ export default classes;
32
+ }
33
+
34
+ declare module '*.scss' {
35
+ const classes: { readonly [key: string]: string };
36
+ export default classes;
37
+ }
38
+
39
+ declare module '*.mdx' {
40
+ const component: any;
41
+ export default component;
42
+ }