@teambit/compositions 0.0.880 → 0.0.882

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.
Files changed (44) hide show
  1. package/dist/composition.compare.section.js +0 -13
  2. package/dist/composition.compare.section.js.map +1 -1
  3. package/dist/composition.js +0 -10
  4. package/dist/composition.js.map +1 -1
  5. package/dist/composition.section.js +0 -13
  6. package/dist/composition.section.js.map +1 -1
  7. package/dist/compositions.aspect.js +0 -5
  8. package/dist/compositions.aspect.js.map +1 -1
  9. package/dist/compositions.composition.js +0 -6
  10. package/dist/compositions.composition.js.map +1 -1
  11. package/dist/compositions.graphql.js +0 -5
  12. package/dist/compositions.graphql.js.map +1 -1
  13. package/dist/compositions.js +9 -94
  14. package/dist/compositions.js.map +1 -1
  15. package/dist/compositions.main.runtime.js +8 -75
  16. package/dist/compositions.main.runtime.js.map +1 -1
  17. package/dist/compositions.preview-definition.js +0 -12
  18. package/dist/compositions.preview-definition.js.map +1 -1
  19. package/dist/compositions.preview.runtime.js +3 -33
  20. package/dist/compositions.preview.runtime.js.map +1 -1
  21. package/dist/compositions.ui.runtime.js +1 -35
  22. package/dist/compositions.ui.runtime.js.map +1 -1
  23. package/dist/index.js +0 -17
  24. package/dist/index.js.map +1 -1
  25. package/dist/ui/composition-preview.js +5 -22
  26. package/dist/ui/composition-preview.js.map +1 -1
  27. package/dist/ui/compositions-overview/compositions-overview.js +0 -12
  28. package/dist/ui/compositions-overview/compositions-overview.js.map +1 -1
  29. package/dist/ui/compositions-overview/index.js +0 -2
  30. package/dist/ui/compositions-overview/index.js.map +1 -1
  31. package/dist/ui/compositions-panel/compositions-panel.js +10 -31
  32. package/dist/ui/compositions-panel/compositions-panel.js.map +1 -1
  33. package/dist/ui/compositions-panel-node/compositions-panel-node.js +5 -19
  34. package/dist/ui/compositions-panel-node/compositions-panel-node.js.map +1 -1
  35. package/dist/ui/compositions-panel-node/index.js +0 -2
  36. package/dist/ui/compositions-panel-node/index.js.map +1 -1
  37. package/dist/ui/index.js +0 -3
  38. package/dist/ui/index.js.map +1 -1
  39. package/dist/ui/use-compositions.js +3 -0
  40. package/dist/ui/use-compositions.js.map +1 -1
  41. package/package-tar/teambit-compositions-0.0.882.tgz +0 -0
  42. package/package.json +15 -15
  43. package/{preview-1666312873430.js → preview-1666496165706.js} +2 -2
  44. package/package-tar/teambit-compositions-0.0.880.tgz +0 -0
@@ -1,42 +1,31 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.CompositionCompareSection = void 0;
9
-
10
8
  function _defineProperty2() {
11
9
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
-
13
10
  _defineProperty2 = function () {
14
11
  return data;
15
12
  };
16
-
17
13
  return data;
18
14
  }
19
-
20
15
  function _react() {
21
16
  const data = _interopRequireDefault(require("react"));
22
-
23
17
  _react = function () {
24
18
  return data;
25
19
  };
26
-
27
20
  return data;
28
21
  }
29
-
30
22
  function _compositionsUi() {
31
23
  const data = require("@teambit/compositions.ui.composition-compare");
32
-
33
24
  _compositionsUi = function () {
34
25
  return data;
35
26
  };
36
-
37
27
  return data;
38
28
  }
39
-
40
29
  class CompositionCompareSection {
41
30
  constructor(emptyStateSlot) {
42
31
  this.emptyStateSlot = emptyStateSlot;
@@ -52,9 +41,7 @@ class CompositionCompareSection {
52
41
  })
53
42
  });
54
43
  }
55
-
56
44
  }
57
-
58
45
  exports.CompositionCompareSection = CompositionCompareSection;
59
46
 
60
47
  //# sourceMappingURL=composition.compare.section.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CompositionCompareSection","constructor","emptyStateSlot","href","children","order","path","element"],"sources":["composition.compare.section.tsx"],"sourcesContent":["import React from 'react';\nimport { EmptyStateSlot } from '@teambit/compositions';\nimport { Section } from '@teambit/component';\nimport { CompositionCompare } from '@teambit/compositions.ui.composition-compare';\n\nexport class CompositionCompareSection implements Section {\n constructor(private emptyStateSlot: EmptyStateSlot) {}\n\n navigationLink = {\n href: 'compositions',\n children: 'Compositions',\n order: 1,\n };\n\n route = {\n path: 'compositions/*',\n element: <CompositionCompare emptyState={this.emptyStateSlot} />,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,yBAAN,CAAmD;EACxDC,WAAW,CAASC,cAAT,EAAyC;IAAA,KAAhCA,cAAgC,GAAhCA,cAAgC;IAAA,wDAEnC;MACfC,IAAI,EAAE,cADS;MAEfC,QAAQ,EAAE,cAFK;MAGfC,KAAK,EAAE;IAHQ,CAFmC;IAAA,+CAQ5C;MACNC,IAAI,EAAE,gBADA;MAENC,OAAO,eAAE,+BAAC,oCAAD;QAAoB,UAAU,EAAE,KAAKL;MAArC;IAFH,CAR4C;EAAE;;AADE"}
1
+ {"version":3,"names":["CompositionCompareSection","constructor","emptyStateSlot","href","children","order","path","element"],"sources":["composition.compare.section.tsx"],"sourcesContent":["import React from 'react';\nimport { EmptyStateSlot } from '@teambit/compositions';\nimport { Section } from '@teambit/component';\nimport { CompositionCompare } from '@teambit/compositions.ui.composition-compare';\n\nexport class CompositionCompareSection implements Section {\n constructor(private emptyStateSlot: EmptyStateSlot) {}\n\n navigationLink = {\n href: 'compositions',\n children: 'Compositions',\n order: 1,\n };\n\n route = {\n path: 'compositions/*',\n element: <CompositionCompare emptyState={this.emptyStateSlot} />,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,yBAAyB,CAAoB;EACxDC,WAAW,CAASC,cAA8B,EAAE;IAAA,KAAhCA,cAA8B,GAA9BA,cAA8B;IAAA,wDAEjC;MACfC,IAAI,EAAE,cAAc;MACpBC,QAAQ,EAAE,cAAc;MACxBC,KAAK,EAAE;IACT,CAAC;IAAA,+CAEO;MACNC,IAAI,EAAE,gBAAgB;MACtBC,OAAO,eAAE,+BAAC,oCAAkB;QAAC,UAAU,EAAE,IAAI,CAACL;MAAe;IAC/D,CAAC;EAXoD;AAYvD;AAAC"}
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Composition = void 0;
7
-
8
7
  function _compositionsModel() {
9
8
  const data = require("@teambit/compositions.model.composition-id");
10
-
11
9
  _compositionsModel = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  class Composition {
19
15
  constructor(
20
16
  /**
@@ -33,11 +29,9 @@ class Composition {
33
29
  this.filepath = filepath;
34
30
  this._displayName = _displayName;
35
31
  }
36
-
37
32
  get displayName() {
38
33
  return this._displayName || (0, _compositionsModel().humanizeCompositionId)(this.identifier);
39
34
  }
40
-
41
35
  toObject() {
42
36
  return {
43
37
  identifier: this.identifier,
@@ -45,22 +39,18 @@ class Composition {
45
39
  displayName: this._displayName
46
40
  };
47
41
  }
48
-
49
42
  toBrowserMetaDataObject() {
50
43
  return {
51
44
  identifier: this.identifier,
52
45
  displayName: this._displayName
53
46
  };
54
47
  }
55
-
56
48
  static fromArray(compositions) {
57
49
  return compositions.map(composition => {
58
50
  return new Composition(composition.identifier, composition.filepath, composition.displayName);
59
51
  });
60
52
  }
61
-
62
53
  }
63
-
64
54
  exports.Composition = Composition;
65
55
 
66
56
  //# sourceMappingURL=composition.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Composition","constructor","identifier","filepath","_displayName","displayName","humanizeCompositionId","toObject","toBrowserMetaDataObject","fromArray","compositions","map","composition"],"sources":["composition.ts"],"sourcesContent":["import { humanizeCompositionId } from '@teambit/compositions.model.composition-id';\n\nexport type CompositionProps = {\n identifier: string;\n filepath?: string;\n displayName?: string;\n};\n\nexport type CompositionBrowserMetadata = {\n displayName?: string;\n identifier: string;\n};\n\nexport type CompositionBrowserMetadataObject = {\n compositions: CompositionBrowserMetadata[];\n};\n\nexport class Composition {\n constructor(\n /**\n * identifier of the composition\n */\n readonly identifier: string,\n\n /**\n * file path in which the composition is contained.\n */\n readonly filepath?: string,\n\n /**\n * set explicit display name\n */\n private _displayName?: string\n ) {}\n\n get displayName() {\n return this._displayName || humanizeCompositionId(this.identifier);\n }\n\n toObject() {\n return {\n identifier: this.identifier,\n filepath: this.filepath,\n displayName: this._displayName,\n };\n }\n\n toBrowserMetaDataObject(): CompositionBrowserMetadata {\n return {\n identifier: this.identifier,\n displayName: this._displayName,\n };\n }\n\n static fromArray(compositions: CompositionProps[]): Composition[] {\n return compositions.map((composition) => {\n return new Composition(composition.identifier, composition.filepath, composition.displayName);\n });\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAiBO,MAAMA,WAAN,CAAkB;EACvBC,WAAW;EACT;AACJ;AACA;EACaC,UAJA;EAMT;AACJ;AACA;EACaC,QATA;EAWT;AACJ;AACA;EACYC,YAdC,EAeT;IAAA,KAXSF,UAWT,GAXSA,UAWT;IAAA,KANSC,QAMT,GANSA,QAMT;IAAA,KADQC,YACR,GADQA,YACR;EAAE;;EAEW,IAAXC,WAAW,GAAG;IAChB,OAAO,KAAKD,YAAL,IAAqB,IAAAE,0CAAA,EAAsB,KAAKJ,UAA3B,CAA5B;EACD;;EAEDK,QAAQ,GAAG;IACT,OAAO;MACLL,UAAU,EAAE,KAAKA,UADZ;MAELC,QAAQ,EAAE,KAAKA,QAFV;MAGLE,WAAW,EAAE,KAAKD;IAHb,CAAP;EAKD;;EAEDI,uBAAuB,GAA+B;IACpD,OAAO;MACLN,UAAU,EAAE,KAAKA,UADZ;MAELG,WAAW,EAAE,KAAKD;IAFb,CAAP;EAID;;EAEe,OAATK,SAAS,CAACC,YAAD,EAAkD;IAChE,OAAOA,YAAY,CAACC,GAAb,CAAkBC,WAAD,IAAiB;MACvC,OAAO,IAAIZ,WAAJ,CAAgBY,WAAW,CAACV,UAA5B,EAAwCU,WAAW,CAACT,QAApD,EAA8DS,WAAW,CAACP,WAA1E,CAAP;IACD,CAFM,CAAP;EAGD;;AAzCsB"}
1
+ {"version":3,"names":["Composition","constructor","identifier","filepath","_displayName","displayName","humanizeCompositionId","toObject","toBrowserMetaDataObject","fromArray","compositions","map","composition"],"sources":["composition.ts"],"sourcesContent":["import { humanizeCompositionId } from '@teambit/compositions.model.composition-id';\n\nexport type CompositionProps = {\n identifier: string;\n filepath?: string;\n displayName?: string;\n};\n\nexport type CompositionBrowserMetadata = {\n displayName?: string;\n identifier: string;\n};\n\nexport type CompositionBrowserMetadataObject = {\n compositions: CompositionBrowserMetadata[];\n};\n\nexport class Composition {\n constructor(\n /**\n * identifier of the composition\n */\n readonly identifier: string,\n\n /**\n * file path in which the composition is contained.\n */\n readonly filepath?: string,\n\n /**\n * set explicit display name\n */\n private _displayName?: string\n ) {}\n\n get displayName() {\n return this._displayName || humanizeCompositionId(this.identifier);\n }\n\n toObject() {\n return {\n identifier: this.identifier,\n filepath: this.filepath,\n displayName: this._displayName,\n };\n }\n\n toBrowserMetaDataObject(): CompositionBrowserMetadata {\n return {\n identifier: this.identifier,\n displayName: this._displayName,\n };\n }\n\n static fromArray(compositions: CompositionProps[]): Composition[] {\n return compositions.map((composition) => {\n return new Composition(composition.identifier, composition.filepath, composition.displayName);\n });\n }\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAiBO,MAAMA,WAAW,CAAC;EACvBC,WAAW;EACT;AACJ;AACA;EACaC,UAAkB;EAE3B;AACJ;AACA;EACaC,QAAiB;EAE1B;AACJ;AACA;EACYC,YAAqB,EAC7B;IAAA,KAXSF,UAAkB,GAAlBA,UAAkB;IAAA,KAKlBC,QAAiB,GAAjBA,QAAiB;IAAA,KAKlBC,YAAqB,GAArBA,YAAqB;EAC5B;EAEH,IAAIC,WAAW,GAAG;IAChB,OAAO,IAAI,CAACD,YAAY,IAAI,IAAAE,0CAAqB,EAAC,IAAI,CAACJ,UAAU,CAAC;EACpE;EAEAK,QAAQ,GAAG;IACT,OAAO;MACLL,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,QAAQ,EAAE,IAAI,CAACA,QAAQ;MACvBE,WAAW,EAAE,IAAI,CAACD;IACpB,CAAC;EACH;EAEAI,uBAAuB,GAA+B;IACpD,OAAO;MACLN,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BG,WAAW,EAAE,IAAI,CAACD;IACpB,CAAC;EACH;EAEA,OAAOK,SAAS,CAACC,YAAgC,EAAiB;IAChE,OAAOA,YAAY,CAACC,GAAG,CAAEC,WAAW,IAAK;MACvC,OAAO,IAAIZ,WAAW,CAACY,WAAW,CAACV,UAAU,EAAEU,WAAW,CAACT,QAAQ,EAAES,WAAW,CAACP,WAAW,CAAC;IAC/F,CAAC,CAAC;EACJ;AACF;AAAC"}
@@ -1,42 +1,31 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.CompositionsSection = void 0;
9
-
10
8
  function _defineProperty2() {
11
9
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
-
13
10
  _defineProperty2 = function () {
14
11
  return data;
15
12
  };
16
-
17
13
  return data;
18
14
  }
19
-
20
15
  function _react() {
21
16
  const data = _interopRequireDefault(require("react"));
22
-
23
17
  _react = function () {
24
18
  return data;
25
19
  };
26
-
27
20
  return data;
28
21
  }
29
-
30
22
  function _compositions() {
31
23
  const data = require("./compositions");
32
-
33
24
  _compositions = function () {
34
25
  return data;
35
26
  };
36
-
37
27
  return data;
38
28
  }
39
-
40
29
  class CompositionsSection {
41
30
  constructor(
42
31
  /**
@@ -59,9 +48,7 @@ class CompositionsSection {
59
48
  });
60
49
  (0, _defineProperty2().default)(this, "order", 20);
61
50
  }
62
-
63
51
  }
64
-
65
52
  exports.CompositionsSection = CompositionsSection;
66
53
 
67
54
  //# sourceMappingURL=composition.section.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CompositionsSection","constructor","compositions","options","emptyStateSlot","href","children","path","element","menuBarWidgetSlot"],"sources":["composition.section.tsx"],"sourcesContent":["import { Section } from '@teambit/component';\nimport React from 'react';\nimport { Compositions } from './compositions';\nimport type { CompositionsUI, CompositionsMenuSlot, EmptyStateSlot } from './compositions.ui.runtime';\n\ntype Options = { menuBarWidgetSlot: CompositionsMenuSlot };\n\nexport class CompositionsSection implements Section {\n constructor(\n /**\n * simulations ui extension.\n */\n private compositions: CompositionsUI,\n private options: Options,\n private emptyStateSlot: EmptyStateSlot\n ) {}\n\n navigationLink = {\n href: '~compositions',\n children: 'Compositions',\n };\n\n route = {\n path: '~compositions',\n element: <Compositions menuBarWidgets={this.options.menuBarWidgetSlot} emptyState={this.emptyStateSlot} />,\n };\n\n order = 20;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKO,MAAMA,mBAAN,CAA6C;EAClDC,WAAW;EACT;AACJ;AACA;EACYC,YAJC,EAKDC,OALC,EAMDC,cANC,EAOT;IAAA,KAHQF,YAGR,GAHQA,YAGR;IAAA,KAFQC,OAER,GAFQA,OAER;IAAA,KADQC,cACR,GADQA,cACR;IAAA,wDAEe;MACfC,IAAI,EAAE,eADS;MAEfC,QAAQ,EAAE;IAFK,CAFf;IAAA,+CAOM;MACNC,IAAI,EAAE,eADA;MAENC,OAAO,eAAE,+BAAC,4BAAD;QAAc,cAAc,EAAE,KAAKL,OAAL,CAAaM,iBAA3C;QAA8D,UAAU,EAAE,KAAKL;MAA/E;IAFH,CAPN;IAAA,+CAYM,EAZN;EAAE;;AAR8C"}
1
+ {"version":3,"names":["CompositionsSection","constructor","compositions","options","emptyStateSlot","href","children","path","element","menuBarWidgetSlot"],"sources":["composition.section.tsx"],"sourcesContent":["import { Section } from '@teambit/component';\nimport React from 'react';\nimport { Compositions } from './compositions';\nimport type { CompositionsUI, CompositionsMenuSlot, EmptyStateSlot } from './compositions.ui.runtime';\n\ntype Options = { menuBarWidgetSlot: CompositionsMenuSlot };\n\nexport class CompositionsSection implements Section {\n constructor(\n /**\n * simulations ui extension.\n */\n private compositions: CompositionsUI,\n private options: Options,\n private emptyStateSlot: EmptyStateSlot\n ) {}\n\n navigationLink = {\n href: '~compositions',\n children: 'Compositions',\n };\n\n route = {\n path: '~compositions',\n element: <Compositions menuBarWidgets={this.options.menuBarWidgetSlot} emptyState={this.emptyStateSlot} />,\n };\n\n order = 20;\n}\n"],"mappings":";;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKO,MAAMA,mBAAmB,CAAoB;EAClDC,WAAW;EACT;AACJ;AACA;EACYC,YAA4B,EAC5BC,OAAgB,EAChBC,cAA8B,EACtC;IAAA,KAHQF,YAA4B,GAA5BA,YAA4B;IAAA,KAC5BC,OAAgB,GAAhBA,OAAgB;IAAA,KAChBC,cAA8B,GAA9BA,cAA8B;IAAA,wDAGvB;MACfC,IAAI,EAAE,eAAe;MACrBC,QAAQ,EAAE;IACZ,CAAC;IAAA,+CAEO;MACNC,IAAI,EAAE,eAAe;MACrBC,OAAO,eAAE,+BAAC,4BAAY;QAAC,cAAc,EAAE,IAAI,CAACL,OAAO,CAACM,iBAAkB;QAAC,UAAU,EAAE,IAAI,CAACL;MAAe;IACzG,CAAC;IAAA,+CAEO,EAAE;EAZP;AAaL;AAAC"}
@@ -4,23 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.CompositionsAspect = void 0;
7
-
8
7
  function _harmony() {
9
8
  const data = require("@teambit/harmony");
10
-
11
9
  _harmony = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  const CompositionsAspect = _harmony().Aspect.create({
19
15
  id: 'teambit.compositions/compositions',
20
16
  dependencies: [],
21
17
  defaultConfig: {}
22
18
  });
23
-
24
19
  exports.CompositionsAspect = CompositionsAspect;
25
20
  var _default = CompositionsAspect;
26
21
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"names":["CompositionsAspect","Aspect","create","id","dependencies","defaultConfig"],"sources":["compositions.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const CompositionsAspect = Aspect.create({\n id: 'teambit.compositions/compositions',\n dependencies: [],\n defaultConfig: {},\n});\n\nexport default CompositionsAspect;\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,kBAAkB,GAAGC,iBAAA,CAAOC,MAAP,CAAc;EAC9CC,EAAE,EAAE,mCAD0C;EAE9CC,YAAY,EAAE,EAFgC;EAG9CC,aAAa,EAAE;AAH+B,CAAd,CAA3B;;;eAMQL,kB"}
1
+ {"version":3,"names":["CompositionsAspect","Aspect","create","id","dependencies","defaultConfig"],"sources":["compositions.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const CompositionsAspect = Aspect.create({\n id: 'teambit.compositions/compositions',\n dependencies: [],\n defaultConfig: {},\n});\n\nexport default CompositionsAspect;\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,kBAAkB,GAAGC,iBAAM,CAACC,MAAM,CAAC;EAC9CC,EAAE,EAAE,mCAAmC;EACvCC,YAAY,EAAE,EAAE;EAChBC,aAAa,EAAE,CAAC;AAClB,CAAC,CAAC;AAAC;AAAA,eAEYL,kBAAkB;AAAA"}
@@ -1,22 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.Logo = void 0;
9
-
10
8
  function _react() {
11
9
  const data = _interopRequireDefault(require("react"));
12
-
13
10
  _react = function () {
14
11
  return data;
15
12
  };
16
-
17
13
  return data;
18
14
  }
19
-
20
15
  const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
21
16
  style: {
22
17
  height: '100%',
@@ -29,7 +24,6 @@ const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
29
24
  },
30
25
  src: "https://static.bit.dev/extensions-icons/compositions.svg"
31
26
  }));
32
-
33
27
  exports.Logo = Logo;
34
28
 
35
29
  //# sourceMappingURL=compositions.composition.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["compositions.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/compositions.svg\" />\n </div>\n);\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAV;IAAkBC,OAAO,EAAE,MAA3B;IAAmCC,cAAc,EAAE;EAAnD;AAAZ,gBACE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAT,CAAZ;EAA2B,GAAG,EAAC;AAA/B,EADF,CADK"}
1
+ {"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["compositions.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/compositions.svg\" />\n </div>\n);\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAG,CAAE;EAAC,GAAG,EAAC;AAA0D,EAAG,CAE/F;AAAC"}
@@ -1,22 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.compositionsSchema = compositionsSchema;
9
-
10
8
  function _graphqlTag() {
11
9
  const data = _interopRequireDefault(require("graphql-tag"));
12
-
13
10
  _graphqlTag = function () {
14
11
  return data;
15
12
  };
16
-
17
13
  return data;
18
14
  }
19
-
20
15
  function compositionsSchema(compositions) {
21
16
  return {
22
17
  typeDefs: (0, _graphqlTag().default)`
@@ -1 +1 @@
1
- {"version":3,"names":["compositionsSchema","compositions","typeDefs","gql","resolvers","Component","component","getCompositions"],"sources":["compositions.graphql.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { Schema } from '@teambit/graphql';\nimport gql from 'graphql-tag';\n\nimport { CompositionsMain } from './compositions.main.runtime';\n\nexport function compositionsSchema(compositions: CompositionsMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n compositions: [Composition]\n }\n\n type Subscription {\n compositionAdded: Composition\n }\n\n type Composition {\n filepath: String\n identifier: String\n displayName: String\n }\n `,\n resolvers: {\n Component: {\n compositions: (component: Component) => {\n return compositions.getCompositions(component);\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIO,SAASA,kBAAT,CAA4BC,YAA5B,EAAoE;EACzE,OAAO;IACLC,QAAQ,EAAE,IAAAC,qBAAA,CAAI;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAfS;IAgBLC,SAAS,EAAE;MACTC,SAAS,EAAE;QACTJ,YAAY,EAAGK,SAAD,IAA0B;UACtC,OAAOL,YAAY,CAACM,eAAb,CAA6BD,SAA7B,CAAP;QACD;MAHQ;IADF;EAhBN,CAAP;AAwBD"}
1
+ {"version":3,"names":["compositionsSchema","compositions","typeDefs","gql","resolvers","Component","component","getCompositions"],"sources":["compositions.graphql.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { Schema } from '@teambit/graphql';\nimport gql from 'graphql-tag';\n\nimport { CompositionsMain } from './compositions.main.runtime';\n\nexport function compositionsSchema(compositions: CompositionsMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n compositions: [Composition]\n }\n\n type Subscription {\n compositionAdded: Composition\n }\n\n type Composition {\n filepath: String\n identifier: String\n displayName: String\n }\n `,\n resolvers: {\n Component: {\n compositions: (component: Component) => {\n return compositions.getCompositions(component);\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIO,SAASA,kBAAkB,CAACC,YAA8B,EAAU;EACzE,OAAO;IACLC,QAAQ,EAAE,IAAAC,qBAAG,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IACDC,SAAS,EAAE;MACTC,SAAS,EAAE;QACTJ,YAAY,EAAGK,SAAoB,IAAK;UACtC,OAAOL,YAAY,CAACM,eAAe,CAACD,SAAS,CAAC;QAChD;MACF;IACF;EACF,CAAC;AACH"}
@@ -1,295 +1,211 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.array.iterator.js");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.CompositionContent = CompositionContent;
11
9
  exports.Compositions = Compositions;
12
-
13
10
  function _react() {
14
11
  const data = _interopRequireWildcard(require("react"));
15
-
16
12
  _react = function () {
17
13
  return data;
18
14
  };
19
-
20
15
  return data;
21
16
  }
22
-
23
17
  function _lodash() {
24
18
  const data = _interopRequireDefault(require("lodash.head"));
25
-
26
19
  _lodash = function () {
27
20
  return data;
28
21
  };
29
-
30
22
  return data;
31
23
  }
32
-
33
24
  function _queryString() {
34
25
  const data = _interopRequireDefault(require("query-string"));
35
-
36
26
  _queryString = function () {
37
27
  return data;
38
28
  };
39
-
40
29
  return data;
41
30
  }
42
-
43
31
  function _documenterTheme() {
44
32
  const data = require("@teambit/documenter.theme.theme-context");
45
-
46
33
  _documenterTheme = function () {
47
34
  return data;
48
35
  };
49
-
50
36
  return data;
51
37
  }
52
-
53
38
  function _baseUiSurfacesSplitPane() {
54
39
  const data = require("@teambit/base-ui.surfaces.split-pane.split-pane");
55
-
56
40
  _baseUiSurfacesSplitPane = function () {
57
41
  return data;
58
42
  };
59
-
60
43
  return data;
61
44
  }
62
-
63
45
  function _baseUiSurfacesSplitPane2() {
64
46
  const data = require("@teambit/base-ui.surfaces.split-pane.hover-splitter");
65
-
66
47
  _baseUiSurfacesSplitPane2 = function () {
67
48
  return data;
68
49
  };
69
-
70
50
  return data;
71
51
  }
72
-
73
52
  function _component() {
74
53
  const data = require("@teambit/component");
75
-
76
54
  _component = function () {
77
55
  return data;
78
56
  };
79
-
80
57
  return data;
81
58
  }
82
-
83
59
  function _documenterUi() {
84
60
  const data = require("@teambit/documenter.ui.property-table");
85
-
86
61
  _documenterUi = function () {
87
62
  return data;
88
63
  };
89
-
90
64
  return data;
91
65
  }
92
-
93
66
  function _panels() {
94
67
  const data = require("@teambit/panels");
95
-
96
68
  _panels = function () {
97
69
  return data;
98
70
  };
99
-
100
71
  return data;
101
72
  }
102
-
103
73
  function _docsUiQueries() {
104
74
  const data = require("@teambit/docs.ui.queries.get-docs");
105
-
106
75
  _docsUiQueries = function () {
107
76
  return data;
108
77
  };
109
-
110
78
  return data;
111
79
  }
112
-
113
80
  function _uiFoundationUiButtons() {
114
81
  const data = require("@teambit/ui-foundation.ui.buttons.collapser");
115
-
116
82
  _uiFoundationUiButtons = function () {
117
83
  return data;
118
84
  };
119
-
120
85
  return data;
121
86
  }
122
-
123
87
  function _designUi() {
124
88
  const data = require("@teambit/design.ui.empty-box");
125
-
126
89
  _designUi = function () {
127
90
  return data;
128
91
  };
129
-
130
92
  return data;
131
93
  }
132
-
133
94
  function _previewUi() {
134
95
  const data = require("@teambit/preview.ui.component-preview");
135
-
136
96
  _previewUi = function () {
137
97
  return data;
138
98
  };
139
-
140
99
  return data;
141
100
  }
142
-
143
101
  function _uiFoundationUiHooks() {
144
102
  const data = require("@teambit/ui-foundation.ui.hooks.use-is-mobile");
145
-
146
103
  _uiFoundationUiHooks = function () {
147
104
  return data;
148
105
  };
149
-
150
106
  return data;
151
107
  }
152
-
153
108
  function _compositionsUi() {
154
109
  const data = require("@teambit/compositions.ui.compositions-menu-bar");
155
-
156
110
  _compositionsUi = function () {
157
111
  return data;
158
112
  };
159
-
160
113
  return data;
161
114
  }
162
-
163
115
  function _compositionsUiHooks() {
164
116
  const data = require("@teambit/compositions.ui.hooks.use-composition");
165
-
166
117
  _compositionsUiHooks = function () {
167
118
  return data;
168
119
  };
169
-
170
120
  return data;
171
121
  }
172
-
173
122
  function _mdxUi() {
174
123
  const data = require("@teambit/mdx.ui.mdx-layout");
175
-
176
124
  _mdxUi = function () {
177
125
  return data;
178
126
  };
179
-
180
127
  return data;
181
128
  }
182
-
183
129
  function _designUi2() {
184
130
  const data = require("@teambit/design.ui.separator");
185
-
186
131
  _designUi2 = function () {
187
132
  return data;
188
133
  };
189
-
190
134
  return data;
191
135
  }
192
-
193
136
  function _documenterUi2() {
194
137
  const data = require("@teambit/documenter.ui.heading");
195
-
196
138
  _documenterUi2 = function () {
197
139
  return data;
198
140
  };
199
-
200
141
  return data;
201
142
  }
202
-
203
143
  function _designUi3() {
204
144
  const data = require("@teambit/design.ui.alert-card");
205
-
206
145
  _designUi3 = function () {
207
146
  return data;
208
147
  };
209
-
210
148
  return data;
211
149
  }
212
-
213
150
  function _baseReactNavigation() {
214
151
  const data = require("@teambit/base-react.navigation.link");
215
-
216
152
  _baseReactNavigation = function () {
217
153
  return data;
218
154
  };
219
-
220
155
  return data;
221
156
  }
222
-
223
157
  function _designUiInput() {
224
158
  const data = require("@teambit/design.ui.input.option-button");
225
-
226
159
  _designUiInput = function () {
227
160
  return data;
228
161
  };
229
-
230
162
  return data;
231
163
  }
232
-
233
164
  function _designUiSurfaces() {
234
165
  const data = require("@teambit/design.ui.surfaces.status-message-card");
235
-
236
166
  _designUiSurfaces = function () {
237
167
  return data;
238
168
  };
239
-
240
169
  return data;
241
170
  }
242
-
243
171
  function _compositionsModule() {
244
172
  const data = _interopRequireDefault(require("./compositions.module.scss"));
245
-
246
173
  _compositionsModule = function () {
247
174
  return data;
248
175
  };
249
-
250
176
  return data;
251
177
  }
252
-
253
178
  function _ui() {
254
179
  const data = require("./ui");
255
-
256
180
  _ui = function () {
257
181
  return data;
258
182
  };
259
-
260
183
  return data;
261
184
  }
262
-
263
185
  function _compositionsPanel() {
264
186
  const data = require("./ui/compositions-panel/compositions-panel");
265
-
266
187
  _compositionsPanel = function () {
267
188
  return data;
268
189
  };
269
-
270
190
  return data;
271
191
  }
272
-
273
192
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
274
-
275
193
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
276
-
277
194
  function Compositions({
278
195
  menuBarWidgets,
279
196
  emptyState
280
197
  }) {
281
198
  var _component$preview;
282
-
283
199
  const component = (0, _react().useContext)(_component().ComponentContext);
284
200
  const [selected, selectComposition] = (0, _react().useState)((0, _lodash().default)(component.compositions));
285
201
  const selectedRef = (0, _react().useRef)(selected);
286
202
  selectedRef.current = selected;
287
- const properties = (0, _docsUiQueries().useDocs)(component.id); // reset selected composition when component changes.
288
- // this does trigger renderer, but perf seems to be ok
203
+ const properties = (0, _docsUiQueries().useDocs)(component.id);
289
204
 
205
+ // reset selected composition when component changes.
206
+ // this does trigger renderer, but perf seems to be ok
290
207
  (0, _react().useEffect)(() => {
291
208
  var _selectedRef$current;
292
-
293
209
  const prevId = (_selectedRef$current = selectedRef.current) === null || _selectedRef$current === void 0 ? void 0 : _selectedRef$current.identifier;
294
210
  const next = component.compositions.find(c => c.identifier === prevId) || component.compositions[0];
295
211
  selectComposition(next);
@@ -303,8 +219,9 @@ function Compositions({
303
219
  const compositionIdentifierParam = isScaling ? `name=${selected === null || selected === void 0 ? void 0 : selected.identifier}` : selected === null || selected === void 0 ? void 0 : selected.identifier;
304
220
  const currentCompositionFullUrl = (0, _previewUi().toPreviewUrl)(component, 'compositions', compositionIdentifierParam);
305
221
  const [compositionParams, setCompositionParams] = (0, _react().useState)({});
306
- const queryParams = (0, _react().useMemo)(() => _queryString().default.stringify(compositionParams), [compositionParams]); // collapse sidebar when empty, reopen when not
222
+ const queryParams = (0, _react().useMemo)(() => _queryString().default.stringify(compositionParams), [compositionParams]);
307
223
 
224
+ // collapse sidebar when empty, reopen when not
308
225
  (0, _react().useEffect)(() => setSidebarOpenness(showSidebar), [showSidebar]);
309
226
  return /*#__PURE__*/_react().default.createElement(_compositionsUiHooks().CompositionContextProvider, {
310
227
  queryParams: compositionParams,
@@ -361,7 +278,6 @@ function Compositions({
361
278
  showListView: true
362
279
  }) : /*#__PURE__*/_react().default.createElement("div", null)))))));
363
280
  }
364
-
365
281
  function CompositionContent({
366
282
  component,
367
283
  selected,
@@ -369,7 +285,6 @@ function CompositionContent({
369
285
  emptyState
370
286
  }) {
371
287
  var _component$environmen;
372
-
373
288
  const env = (_component$environmen = component.environment) === null || _component$environmen === void 0 ? void 0 : _component$environmen.id;
374
289
  const EmptyStateTemplate = emptyState === null || emptyState === void 0 ? void 0 : emptyState.get(env || ''); // || defaultTemplate;
375
290
 
@@ -386,7 +301,6 @@ function CompositionContent({
386
301
  title: "There are no compositions for this Component. Learn how to add compositions:"
387
302
  }, /*#__PURE__*/_react().default.createElement(_mdxUi().MDXLayout, null, /*#__PURE__*/_react().default.createElement(EmptyStateTemplate, null)))));
388
303
  }
389
-
390
304
  if ((component === null || component === void 0 ? void 0 : component.buildStatus) === 'pending' && (component === null || component === void 0 ? void 0 : component.host) === 'teambit.scope/scope') return /*#__PURE__*/_react().default.createElement(_designUiSurfaces().StatusMessageCard, {
391
305
  className: _compositionsModule().default.buildStatusMessage,
392
306
  status: "PROCESSING",
@@ -396,8 +310,9 @@ function CompositionContent({
396
310
  className: _compositionsModule().default.buildStatusMessage,
397
311
  status: "FAILURE",
398
312
  title: "failed to get component preview "
399
- }); // TODO: get the docs domain from the community aspect and pass it here as a prop
313
+ });
400
314
 
315
+ // TODO: get the docs domain from the community aspect and pass it here as a prop
401
316
  if (component.compositions.length === 0) {
402
317
  return /*#__PURE__*/_react().default.createElement(_designUi().EmptyBox, {
403
318
  title: "There are no compositions for this component.",
@@ -405,9 +320,9 @@ function CompositionContent({
405
320
  link: `https://bit.dev/docs/dev-services-overview/compositions/compositions-overview`
406
321
  });
407
322
  }
408
-
409
323
  return /*#__PURE__*/_react().default.createElement(_ui().ComponentComposition, {
410
- className: _compositionsModule().default.compositionsIframe // TODO: Oded to add control for viewport.
324
+ className: _compositionsModule().default.compositionsIframe
325
+ // TODO: Oded to add control for viewport.
411
326
  ,
412
327
  viewport: null,
413
328
  component: component,