@teambit/scope.models.scope-model 0.0.0-972bb96ed1343ce44f270d30eccdbc340e5f1762

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 @@
1
+ export { ScopeModel } from './scope.model';
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ScopeModel", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _scope().ScopeModel;
10
+ }
11
+ });
12
+ function _scope() {
13
+ const data = require("./scope.model");
14
+ _scope = function () {
15
+ return data;
16
+ };
17
+ return data;
18
+ }
19
+
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_scope","data","require"],"sources":["index.ts"],"sourcesContent":["export { ScopeModel } from './scope.model';\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,64 @@
1
+ import { ComponentModel, ComponentModelProps } from '@teambit/component';
2
+ import { ComponentDescriptor } from '@teambit/component-descriptor';
3
+ export type ScopeModelProps = {
4
+ name: string;
5
+ icon: string;
6
+ backgroundIconColor: string;
7
+ description: string;
8
+ components: ComponentModelProps[];
9
+ };
10
+ export declare class ScopeModel {
11
+ /**
12
+ * the scope name.
13
+ */
14
+ readonly name: string;
15
+ /**
16
+ * the scope icon.
17
+ */
18
+ readonly icon: string;
19
+ /**
20
+ * background icon color
21
+ */
22
+ readonly backgroundIconColor: string;
23
+ /**
24
+ * description of the scope
25
+ */
26
+ readonly description: string;
27
+ /**
28
+ * components contained in the scope.
29
+ */
30
+ readonly components: ComponentModel[];
31
+ /**
32
+ * components contained in the scope.
33
+ */
34
+ readonly componentDescriptors: ComponentDescriptor[];
35
+ constructor(
36
+ /**
37
+ * the scope name.
38
+ */
39
+ name: string,
40
+ /**
41
+ * the scope icon.
42
+ */
43
+ icon: string,
44
+ /**
45
+ * background icon color
46
+ */
47
+ backgroundIconColor: string,
48
+ /**
49
+ * description of the scope
50
+ */
51
+ description: string,
52
+ /**
53
+ * components contained in the scope.
54
+ */
55
+ components: ComponentModel[],
56
+ /**
57
+ * components contained in the scope.
58
+ */
59
+ componentDescriptors: ComponentDescriptor[]);
60
+ static from({ scope }: {
61
+ scope: ScopeModelProps;
62
+ }): ScopeModel;
63
+ static empty(): ScopeModel;
64
+ }
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ScopeModel = void 0;
7
+ function _component() {
8
+ const data = require("@teambit/component");
9
+ _component = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _componentDescriptor() {
15
+ const data = require("@teambit/component-descriptor");
16
+ _componentDescriptor = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _componentId() {
22
+ const data = require("@teambit/component-id");
23
+ _componentId = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ class ScopeModel {
29
+ constructor(
30
+ /**
31
+ * the scope name.
32
+ */
33
+ name,
34
+ /**
35
+ * the scope icon.
36
+ */
37
+ icon,
38
+ /**
39
+ * background icon color
40
+ */
41
+ backgroundIconColor,
42
+ /**
43
+ * description of the scope
44
+ */
45
+ description,
46
+ /**
47
+ * components contained in the scope.
48
+ */
49
+ components,
50
+ /**
51
+ * components contained in the scope.
52
+ */
53
+ componentDescriptors) {
54
+ this.name = name;
55
+ this.icon = icon;
56
+ this.backgroundIconColor = backgroundIconColor;
57
+ this.description = description;
58
+ this.components = components;
59
+ this.componentDescriptors = componentDescriptors;
60
+ }
61
+ static from({
62
+ scope
63
+ }) {
64
+ const components = scope.components || [];
65
+ const componentDescriptors = scope.components.map(component => {
66
+ const id = _componentId().ComponentID.fromObject(component.id);
67
+ return _componentDescriptor().ComponentDescriptor.fromObject({
68
+ id: id.toString()
69
+ });
70
+ });
71
+ return new ScopeModel(scope.name, scope.icon, scope.backgroundIconColor, scope.description, components.map(component => _component().ComponentModel.from(component)), componentDescriptors);
72
+ }
73
+ static empty() {
74
+ return new ScopeModel('', '', '', '', [], []);
75
+ }
76
+ }
77
+ exports.ScopeModel = ScopeModel;
78
+
79
+ //# sourceMappingURL=scope.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_component","data","require","_componentDescriptor","_componentId","ScopeModel","constructor","name","icon","backgroundIconColor","description","components","componentDescriptors","from","scope","map","component","id","ComponentID","fromObject","ComponentDescriptor","toString","ComponentModel","empty","exports"],"sources":["scope.model.ts"],"sourcesContent":["import { ComponentModel, ComponentModelProps } from '@teambit/component';\nimport { ComponentDescriptor } from '@teambit/component-descriptor';\nimport { ComponentID } from '@teambit/component-id';\n\nexport type ScopeModelProps = {\n name: string;\n icon: string;\n backgroundIconColor: string;\n description: string;\n components: ComponentModelProps[];\n};\n\nexport class ScopeModel {\n constructor(\n /**\n * the scope name.\n */\n readonly name: string,\n\n /**\n * the scope icon.\n */\n readonly icon: string,\n\n /**\n * background icon color\n */\n readonly backgroundIconColor: string,\n\n /**\n * description of the scope\n */\n readonly description: string,\n\n /**\n * components contained in the scope.\n */\n readonly components: ComponentModel[],\n\n /**\n * components contained in the scope.\n */\n readonly componentDescriptors: ComponentDescriptor[]\n ) {}\n\n static from({ scope }: { scope: ScopeModelProps }) {\n const components = scope.components || [];\n const componentDescriptors = scope.components.map((component) => {\n const id = ComponentID.fromObject(component.id);\n return ComponentDescriptor.fromObject({ id: id.toString() });\n });\n\n return new ScopeModel(\n scope.name,\n scope.icon,\n scope.backgroundIconColor,\n scope.description,\n components.map((component) => ComponentModel.from(component)),\n componentDescriptors\n );\n }\n\n static empty() {\n return new ScopeModel('', '', '', '', [], []);\n }\n}\n"],"mappings":";;;;;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F,OAAO,IAAIhB,UAAU,CACnBS,KAAK,CAACP,IAAI,EACVO,KAAK,CAACN,IAAI,EACVM,KAAK,CAACL,mBAAmB,EACzBK,KAAK,CAACJ,WAAW,EACjBC,UAAU,CAACI,GAAG,CAAEC,SAAS,IAAKM,2BAAc,CAACT,IAAI,CAACG,SAAS,CAAC,CAAC,EAC7DJ,oBACF,CAAC;EACH;EAEA,OAAOW,KAAKA,CAAA,EAAG;IACb,OAAO,IAAIlB,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;EAC/C;AACF;AAACmB,OAAA,CAAAnB,UAAA,GAAAA,UAAA","ignoreList":[]}
package/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { ScopeModel } from './scope.model';
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@teambit/scope.models.scope-model",
3
+ "version": "0.0.0-972bb96ed1343ce44f270d30eccdbc340e5f1762",
4
+ "homepage": "https://bit.cloud/teambit/scope/models/scope-model",
5
+ "main": "dist/index.js",
6
+ "componentId": {
7
+ "scope": "teambit.scope",
8
+ "name": "models/scope-model",
9
+ "version": "972bb96ed1343ce44f270d30eccdbc340e5f1762"
10
+ },
11
+ "dependencies": {
12
+ "@teambit/component-id": "1.2.4",
13
+ "@teambit/component-descriptor": "0.0.0-734e1d36769bc5edb27ab4bddcb379a977c9f232"
14
+ },
15
+ "devDependencies": {
16
+ "@types/mocha": "9.1.0",
17
+ "chai": "4.3.0",
18
+ "@teambit/node.envs.node-babel-mocha": "0.1.5"
19
+ },
20
+ "peerDependencies": {},
21
+ "license": "Apache-2.0",
22
+ "optionalDependencies": {},
23
+ "peerDependenciesMeta": {},
24
+ "private": false,
25
+ "engines": {
26
+ "node": ">=12.22.0"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/teambit/bit"
31
+ },
32
+ "keywords": [
33
+ "bit",
34
+ "components",
35
+ "collaboration",
36
+ "web",
37
+ "react",
38
+ "react-components",
39
+ "angular",
40
+ "angular-components"
41
+ ]
42
+ }
package/scope.model.ts ADDED
@@ -0,0 +1,66 @@
1
+ import { ComponentModel, ComponentModelProps } from '@teambit/component';
2
+ import { ComponentDescriptor } from '@teambit/component-descriptor';
3
+ import { ComponentID } from '@teambit/component-id';
4
+
5
+ export type ScopeModelProps = {
6
+ name: string;
7
+ icon: string;
8
+ backgroundIconColor: string;
9
+ description: string;
10
+ components: ComponentModelProps[];
11
+ };
12
+
13
+ export class ScopeModel {
14
+ constructor(
15
+ /**
16
+ * the scope name.
17
+ */
18
+ readonly name: string,
19
+
20
+ /**
21
+ * the scope icon.
22
+ */
23
+ readonly icon: string,
24
+
25
+ /**
26
+ * background icon color
27
+ */
28
+ readonly backgroundIconColor: string,
29
+
30
+ /**
31
+ * description of the scope
32
+ */
33
+ readonly description: string,
34
+
35
+ /**
36
+ * components contained in the scope.
37
+ */
38
+ readonly components: ComponentModel[],
39
+
40
+ /**
41
+ * components contained in the scope.
42
+ */
43
+ readonly componentDescriptors: ComponentDescriptor[]
44
+ ) {}
45
+
46
+ static from({ scope }: { scope: ScopeModelProps }) {
47
+ const components = scope.components || [];
48
+ const componentDescriptors = scope.components.map((component) => {
49
+ const id = ComponentID.fromObject(component.id);
50
+ return ComponentDescriptor.fromObject({ id: id.toString() });
51
+ });
52
+
53
+ return new ScopeModel(
54
+ scope.name,
55
+ scope.icon,
56
+ scope.backgroundIconColor,
57
+ scope.description,
58
+ components.map((component) => ComponentModel.from(component)),
59
+ componentDescriptors
60
+ );
61
+ }
62
+
63
+ static empty() {
64
+ return new ScopeModel('', '', '', '', [], []);
65
+ }
66
+ }
@@ -0,0 +1,41 @@
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<
9
+ SVGProps<SVGSVGElement> & { title?: string }
10
+ >;
11
+ const src: string;
12
+ export default src;
13
+ }
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
+ }
30
+ declare module '*.otf' {
31
+ const value: any;
32
+ export = value;
33
+ }
34
+ declare module '*.woff' {
35
+ const value: any;
36
+ export = value;
37
+ }
38
+ declare module '*.woff2' {
39
+ const value: any;
40
+ export = value;
41
+ }
@@ -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
+ }