@teambit/component-sizer 0.0.27 → 0.0.28

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.
@@ -1,21 +1,26 @@
1
- import { ComponentAspect } from '@teambit/component';
1
+ import React from 'react';
2
2
  import { UIRuntime } from '@teambit/ui';
3
- import { DocsAspect } from '@teambit/docs';
4
- import { ComponentSizerAspect } from './component-sizer.aspect';
3
+ import type { ComponentDescriptor } from '@teambit/component-descriptor';
4
+ import { DocsAspect, DocsUI } from '@teambit/docs';
5
+ import { ComponentSize } from '@teambit/component.ui.component-size';
6
+ // import { ComponentSizerAspect } from './component-sizer.aspect';
5
7
 
6
8
  /**
7
- * Component code tab aspect. Presents the code tab page and allows to control the code tab and register specific icons for each file type.
8
- * @example CodeUI.registerEnvFileIcon([(fileName) => (/your-regexp/.test(fileName) ? 'your.icon.url' : undefined)])
9
+ * Component size aspect.
9
10
  */
10
11
  export class SizerUIRuntime {
11
- static dependencies = [ComponentAspect, DocsAspect];
12
+ static dependencies = [DocsAspect];
12
13
 
13
14
  static runtime = UIRuntime;
14
15
 
15
- static async provider() {
16
- const ui = new SizerUIRuntime();
17
- return ui;
16
+ static async provider([docs]: [DocsUI]) {
17
+ docs.registerTitleBadge({
18
+ component: function badge({ componentDescriptor }: { componentDescriptor: ComponentDescriptor }) {
19
+ return <ComponentSize componentDescriptor={componentDescriptor} />;
20
+ },
21
+ weight: 30,
22
+ });
18
23
  }
19
24
  }
20
25
 
21
- ComponentSizerAspect.addRuntime(SizerUIRuntime);
26
+ // ComponentSizerAspect.addRuntime(SizerUIRuntime);
@@ -1,9 +1,9 @@
1
+ import { DocsUI } from '@teambit/docs';
1
2
  /**
2
- * Component code tab aspect. Presents the code tab page and allows to control the code tab and register specific icons for each file type.
3
- * @example CodeUI.registerEnvFileIcon([(fileName) => (/your-regexp/.test(fileName) ? 'your.icon.url' : undefined)])
3
+ * Component size aspect.
4
4
  */
5
5
  export declare class SizerUIRuntime {
6
6
  static dependencies: import("@teambit/harmony").Aspect[];
7
7
  static runtime: import("@teambit/harmony").RuntimeDefinition;
8
- static provider(): Promise<SizerUIRuntime>;
8
+ static provider([docs]: [DocsUI]): Promise<void>;
9
9
  }
@@ -2,6 +2,8 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
+ require("core-js/modules/es.array.iterator.js");
6
+
5
7
  require("core-js/modules/es.promise.js");
6
8
 
7
9
  Object.defineProperty(exports, "__esModule", {
@@ -19,10 +21,10 @@ function _defineProperty2() {
19
21
  return data;
20
22
  }
21
23
 
22
- function _component() {
23
- const data = require("@teambit/component");
24
+ function _react() {
25
+ const data = _interopRequireDefault(require("react"));
24
26
 
25
- _component = function () {
27
+ _react = function () {
26
28
  return data;
27
29
  };
28
30
 
@@ -49,32 +51,40 @@ function _docs() {
49
51
  return data;
50
52
  }
51
53
 
52
- function _componentSizer() {
53
- const data = require("./component-sizer.aspect");
54
+ function _componentUi() {
55
+ const data = require("@teambit/component.ui.component-size");
54
56
 
55
- _componentSizer = function () {
57
+ _componentUi = function () {
56
58
  return data;
57
59
  };
58
60
 
59
61
  return data;
60
62
  }
61
63
 
64
+ // import { ComponentSizerAspect } from './component-sizer.aspect';
65
+
62
66
  /**
63
- * Component code tab aspect. Presents the code tab page and allows to control the code tab and register specific icons for each file type.
64
- * @example CodeUI.registerEnvFileIcon([(fileName) => (/your-regexp/.test(fileName) ? 'your.icon.url' : undefined)])
67
+ * Component size aspect.
65
68
  */
66
69
  class SizerUIRuntime {
67
- static async provider() {
68
- const ui = new SizerUIRuntime();
69
- return ui;
70
+ static async provider([docs]) {
71
+ docs.registerTitleBadge({
72
+ component: function badge({
73
+ componentDescriptor
74
+ }) {
75
+ return /*#__PURE__*/_react().default.createElement(_componentUi().ComponentSize, {
76
+ componentDescriptor: componentDescriptor
77
+ });
78
+ },
79
+ weight: 30
80
+ });
70
81
  }
71
82
 
72
- }
83
+ } // ComponentSizerAspect.addRuntime(SizerUIRuntime);
84
+
73
85
 
74
86
  exports.SizerUIRuntime = SizerUIRuntime;
75
- (0, _defineProperty2().default)(SizerUIRuntime, "dependencies", [_component().ComponentAspect, _docs().DocsAspect]);
87
+ (0, _defineProperty2().default)(SizerUIRuntime, "dependencies", [_docs().DocsAspect]);
76
88
  (0, _defineProperty2().default)(SizerUIRuntime, "runtime", _ui().UIRuntime);
77
89
 
78
- _componentSizer().ComponentSizerAspect.addRuntime(SizerUIRuntime);
79
-
80
90
  //# sourceMappingURL=component-sizer.ui.runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["component-sizer.ui.runtime.tsx"],"names":["SizerUIRuntime","provider","ui","ComponentAspect","DocsAspect","UIRuntime","ComponentSizerAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AACA;AACA;AACA;AACO,MAAMA,cAAN,CAAqB;AAKL,eAARC,QAAQ,GAAG;AACtB,UAAMC,EAAE,GAAG,IAAIF,cAAJ,EAAX;AACA,WAAOE,EAAP;AACD;;AARyB;;;gCAAfF,c,kBACW,CAACG,4BAAD,EAAkBC,kBAAlB,C;gCADXJ,c,aAGMK,e;;AAQnBC,uCAAqBC,UAArB,CAAgCP,cAAhC","sourcesContent":["import { ComponentAspect } from '@teambit/component';\nimport { UIRuntime } from '@teambit/ui';\nimport { DocsAspect } from '@teambit/docs';\nimport { ComponentSizerAspect } from './component-sizer.aspect';\n\n/**\n * Component code tab aspect. Presents the code tab page and allows to control the code tab and register specific icons for each file type.\n * @example CodeUI.registerEnvFileIcon([(fileName) => (/your-regexp/.test(fileName) ? 'your.icon.url' : undefined)])\n */\nexport class SizerUIRuntime {\n static dependencies = [ComponentAspect, DocsAspect];\n\n static runtime = UIRuntime;\n\n static async provider() {\n const ui = new SizerUIRuntime();\n return ui;\n }\n}\n\nComponentSizerAspect.addRuntime(SizerUIRuntime);\n"]}
1
+ {"version":3,"sources":["component-sizer.ui.runtime.tsx"],"names":["SizerUIRuntime","provider","docs","registerTitleBadge","component","badge","componentDescriptor","weight","DocsAspect","UIRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAEA;AACA;AACA;AACO,MAAMA,cAAN,CAAqB;AAKL,eAARC,QAAQ,CAAC,CAACC,IAAD,CAAD,EAAmB;AACtCA,IAAAA,IAAI,CAACC,kBAAL,CAAwB;AACtBC,MAAAA,SAAS,EAAE,SAASC,KAAT,CAAe;AAAEC,QAAAA;AAAF,OAAf,EAAsF;AAC/F,4BAAO,+BAAC,4BAAD;AAAe,UAAA,mBAAmB,EAAEA;AAApC,UAAP;AACD,OAHqB;AAItBC,MAAAA,MAAM,EAAE;AAJc,KAAxB;AAMD;;AAZyB,C,CAe5B;;;;gCAfaP,c,kBACW,CAACQ,kBAAD,C;gCADXR,c,aAGMS,e","sourcesContent":["import React from 'react';\nimport { UIRuntime } from '@teambit/ui';\nimport type { ComponentDescriptor } from '@teambit/component-descriptor';\nimport { DocsAspect, DocsUI } from '@teambit/docs';\nimport { ComponentSize } from '@teambit/component.ui.component-size';\n// import { ComponentSizerAspect } from './component-sizer.aspect';\n\n/**\n * Component size aspect.\n */\nexport class SizerUIRuntime {\n static dependencies = [DocsAspect];\n\n static runtime = UIRuntime;\n\n static async provider([docs]: [DocsUI]) {\n docs.registerTitleBadge({\n component: function badge({ componentDescriptor }: { componentDescriptor: ComponentDescriptor }) {\n return <ComponentSize componentDescriptor={componentDescriptor} />;\n },\n weight: 30,\n });\n }\n}\n\n// ComponentSizerAspect.addRuntime(SizerUIRuntime);\n"]}
package/package.json CHANGED
@@ -1,31 +1,33 @@
1
1
  {
2
2
  "name": "@teambit/component-sizer",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "homepage": "https://bit.dev/teambit/component/component-sizer",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "component-sizer",
9
- "version": "0.0.27"
9
+ "version": "0.0.28"
10
10
  },
11
11
  "dependencies": {
12
12
  "@teambit/harmony": "0.2.11",
13
13
  "graphql-tag": "2.12.1",
14
14
  "@babel/runtime": "7.12.18",
15
15
  "core-js": "^3.0.0",
16
- "@teambit/component": "0.0.654",
17
- "@teambit/graphql": "0.0.654",
16
+ "@teambit/component": "0.0.655",
17
+ "@teambit/graphql": "0.0.655",
18
18
  "@teambit/cli": "0.0.446",
19
- "@teambit/preview": "0.0.654",
20
- "@teambit/docs": "0.0.654",
21
- "@teambit/ui": "0.0.654"
19
+ "@teambit/preview": "0.0.655",
20
+ "@teambit/component-descriptor": "0.0.4",
21
+ "@teambit/component.ui.component-size": "0.0.1",
22
+ "@teambit/docs": "0.0.655",
23
+ "@teambit/ui": "0.0.655"
22
24
  },
23
25
  "devDependencies": {
26
+ "@types/react": "^17.0.8",
24
27
  "@types/mocha": "9.1.0",
25
28
  "@types/testing-library__jest-dom": "5.9.5",
26
29
  "@types/jest": "^26.0.0",
27
30
  "@types/react-dom": "^17.0.5",
28
- "@types/react": "^17.0.8",
29
31
  "@types/node": "12.20.4"
30
32
  },
31
33
  "peerDependencies": {