@teambit/component.ui.component-compare.context 0.0.0-17964d1e3c74130606633ccf7a9eef40baebce48

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,28 @@
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 StateAndHooks = {
7
+ state?: ComponentCompareState;
8
+ hooks?: ComponentCompareHooks;
9
+ };
10
+
11
+ export type ViewState = {
12
+ isFullScreen?: boolean;
13
+ hidden?: boolean;
14
+ };
15
+ export type ComponentCompareContextType = ComponentCompareModel &
16
+ StateAndHooks & {
17
+ baseContext?: StateAndHooks;
18
+ compareContext?: StateAndHooks;
19
+ } & ViewState;
20
+
21
+ export const ComponentCompareContext: React.Context<ComponentCompareContextType | undefined> = createContext<
22
+ ComponentCompareContextType | undefined
23
+ >(undefined);
24
+
25
+ export const useComponentCompare: () => ComponentCompareContextType | undefined = () => {
26
+ const componentCompareContext = useContext(ComponentCompareContext);
27
+ return componentCompareContext;
28
+ };
@@ -0,0 +1,17 @@
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
+ export type StateAndHooks = {
5
+ state?: ComponentCompareState;
6
+ hooks?: ComponentCompareHooks;
7
+ };
8
+ export type ViewState = {
9
+ isFullScreen?: boolean;
10
+ hidden?: boolean;
11
+ };
12
+ export type ComponentCompareContextType = ComponentCompareModel & StateAndHooks & {
13
+ baseContext?: StateAndHooks;
14
+ compareContext?: StateAndHooks;
15
+ } & ViewState;
16
+ export declare const ComponentCompareContext: React.Context<ComponentCompareContextType | undefined>;
17
+ 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;AAiBrC,QAAA,uBAAuB,GAA2D,IAAA,qBAAa,EAE1G,SAAS,CAAC,CAAC;AAEN,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,2 @@
1
+ export { ComponentCompareContext, useComponentCompare } from './component-compare-context';
2
+ export type { StateAndHooks, 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,yEAA2F;AAAlF,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":[]};
package/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { ComponentCompareContext, useComponentCompare } from './component-compare-context';
2
+ export type { StateAndHooks, ComponentCompareContextType } from './component-compare-context';
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@teambit/component.ui.component-compare.context",
3
+ "version": "0.0.0-17964d1e3c74130606633ccf7a9eef40baebce48",
4
+ "homepage": "https://bit.cloud/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": "17964d1e3c74130606633ccf7a9eef40baebce48"
10
+ },
11
+ "dependencies": {
12
+ "core-js": "^3.0.0",
13
+ "@teambit/component.ui.component-compare.models.component-compare-hooks": "0.0.11",
14
+ "@teambit/component.ui.component-compare.models.component-compare-model": "0.0.112",
15
+ "@teambit/component.ui.component-compare.models.component-compare-state": "0.0.7"
16
+ },
17
+ "devDependencies": {
18
+ "@types/react": "^17.0.8",
19
+ "@types/mocha": "9.1.0",
20
+ "@types/node": "12.20.4",
21
+ "@types/react-dom": "^17.0.5",
22
+ "@types/jest": "^26.0.0",
23
+ "@babel/runtime": "7.20.0",
24
+ "@types/testing-library__jest-dom": "5.9.5"
25
+ },
26
+ "peerDependencies": {
27
+ "react": "^16.8.0 || ^17.0.0",
28
+ "react-dom": "^16.8.0 || ^17.0.0"
29
+ },
30
+ "license": "Apache-2.0",
31
+ "optionalDependencies": {},
32
+ "peerDependenciesMeta": {},
33
+ "private": false,
34
+ "engines": {
35
+ "node": ">=12.22.0"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/teambit/bit"
40
+ },
41
+ "keywords": [
42
+ "bit",
43
+ "components",
44
+ "collaboration",
45
+ "web",
46
+ "react",
47
+ "react-components",
48
+ "angular",
49
+ "angular-components"
50
+ ]
51
+ }
@@ -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
+ }