@teambit/scope.models.scope-model 0.0.522 → 0.0.524
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/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/scope.model.js +73 -47
- package/dist/scope.model.js.map +1 -1
- package/package.json +5 -5
- package/types/asset.d.ts +15 -3
- package/dist/preview-1736911321716.js +0 -7
package/dist/index.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
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
|
+
|
|
6
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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":[]}
|
package/dist/scope.model.js
CHANGED
|
@@ -1,53 +1,79 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.ScopeModel = void 0;
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
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
|
+
}
|
|
7
28
|
class ScopeModel {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
+
}
|
|
51
76
|
}
|
|
52
77
|
exports.ScopeModel = ScopeModel;
|
|
78
|
+
|
|
53
79
|
//# sourceMappingURL=scope.model.js.map
|
package/dist/scope.model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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":";;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,qBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,oBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAUO,MAAMI,UAAU,CAAC;EACtBC,WAAWA;EACT;AACJ;AACA;EACaC,IAAY;EAErB;AACJ;AACA;EACaC,IAAY;EAErB;AACJ;AACA;EACaC,mBAA2B;EAEpC;AACJ;AACA;EACaC,WAAmB;EAE5B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0.
|
|
3
|
+
"version": "0.0.524",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/scope/models/scope-model",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.scope",
|
|
8
8
|
"name": "models/scope-model",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.524"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/component-id": "1.2.2",
|
|
13
|
-
"@teambit/component-descriptor": "0.0.
|
|
13
|
+
"@teambit/component-descriptor": "0.0.432"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/mocha": "9.1.0",
|
|
17
|
-
"
|
|
18
|
-
"@
|
|
17
|
+
"chai": "4.3.0",
|
|
18
|
+
"@teambit/node.envs.node-babel-mocha": "0.1.4"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {},
|
|
21
21
|
"license": "Apache-2.0",
|
package/types/asset.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ declare module '*.png' {
|
|
|
5
5
|
declare module '*.svg' {
|
|
6
6
|
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
7
|
|
|
8
|
-
export const ReactComponent: FunctionComponent<
|
|
8
|
+
export const ReactComponent: FunctionComponent<
|
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
|
10
|
+
>;
|
|
9
11
|
const src: string;
|
|
10
12
|
export default src;
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
// @TODO Gilad
|
|
14
14
|
declare module '*.jpg' {
|
|
15
15
|
const value: any;
|
|
16
16
|
export = value;
|
|
@@ -27,3 +27,15 @@ declare module '*.bmp' {
|
|
|
27
27
|
const value: any;
|
|
28
28
|
export = value;
|
|
29
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
|
+
}
|