@teambit/workspace 0.0.881 → 0.0.883

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 (108) hide show
  1. package/dist/bit-map.js +10 -51
  2. package/dist/bit-map.js.map +1 -1
  3. package/dist/build-graph-from-fs.js +1 -53
  4. package/dist/build-graph-from-fs.js.map +1 -1
  5. package/dist/capsule.cmd.js +2 -34
  6. package/dist/capsule.cmd.js.map +1 -1
  7. package/dist/component-config-file/component-config-file.js +2 -60
  8. package/dist/component-config-file/component-config-file.js.map +1 -1
  9. package/dist/component-config-file/exceptions/already-exists.js +0 -6
  10. package/dist/component-config-file/exceptions/already-exists.js.map +1 -1
  11. package/dist/component-config-file/exceptions/index.js +0 -3
  12. package/dist/component-config-file/exceptions/index.js.map +1 -1
  13. package/dist/component-config-file/index.js +0 -6
  14. package/dist/component-config-file/index.js.map +1 -1
  15. package/dist/component-tree.widget.js +0 -18
  16. package/dist/component-tree.widget.js.map +1 -1
  17. package/dist/constants.js.map +1 -1
  18. package/dist/eject-conf.cmd.js +0 -23
  19. package/dist/eject-conf.cmd.js.map +1 -1
  20. package/dist/envs-subcommands/envs-replace.cmd.js +0 -13
  21. package/dist/envs-subcommands/envs-replace.cmd.js.map +1 -1
  22. package/dist/envs-subcommands/envs-set.cmd.js +0 -16
  23. package/dist/envs-subcommands/envs-set.cmd.js.map +1 -1
  24. package/dist/envs-subcommands/envs-unset.cmd.js +0 -18
  25. package/dist/envs-subcommands/envs-unset.cmd.js.map +1 -1
  26. package/dist/events/index.js +0 -6
  27. package/dist/events/index.js.map +1 -1
  28. package/dist/events/on-component-add-event.js +1 -12
  29. package/dist/events/on-component-add-event.js.map +1 -1
  30. package/dist/events/on-component-change-event.js +1 -12
  31. package/dist/events/on-component-change-event.js.map +1 -1
  32. package/dist/events/on-component-removed-event.js +1 -12
  33. package/dist/events/on-component-removed-event.js.map +1 -1
  34. package/dist/exceptions/incorrect-env-aspect.js +0 -6
  35. package/dist/exceptions/incorrect-env-aspect.js.map +1 -1
  36. package/dist/index.js +0 -19
  37. package/dist/index.js.map +1 -1
  38. package/dist/list.cmd.js +2 -15
  39. package/dist/list.cmd.js.map +1 -1
  40. package/dist/pattern.cmd.js +0 -16
  41. package/dist/pattern.cmd.js.map +1 -1
  42. package/dist/scope-subcommands/scope-set.cmd.js +0 -17
  43. package/dist/scope-subcommands/scope-set.cmd.js.map +1 -1
  44. package/dist/ui/index.js +0 -3
  45. package/dist/ui/index.js.map +1 -1
  46. package/dist/ui/workspace/default-component.js.map +1 -1
  47. package/dist/ui/workspace/index.js +0 -2
  48. package/dist/ui/workspace/index.js.map +1 -1
  49. package/dist/ui/workspace/use-workspace.js +14 -49
  50. package/dist/ui/workspace/use-workspace.js.map +1 -1
  51. package/dist/ui/workspace/workspace-context.js +0 -7
  52. package/dist/ui/workspace/workspace-context.js.map +1 -1
  53. package/dist/ui/workspace/workspace-model.js +2 -14
  54. package/dist/ui/workspace/workspace-model.js.map +1 -1
  55. package/dist/ui/workspace/workspace-overview/index.js +0 -3
  56. package/dist/ui/workspace/workspace-overview/index.js.map +1 -1
  57. package/dist/ui/workspace/workspace-overview/workspace-overview.js +0 -23
  58. package/dist/ui/workspace/workspace-overview/workspace-overview.js.map +1 -1
  59. package/dist/ui/workspace/workspace-provider.js +0 -8
  60. package/dist/ui/workspace/workspace-provider.js.map +1 -1
  61. package/dist/ui/workspace/workspace.js +2 -52
  62. package/dist/ui/workspace/workspace.js.map +1 -1
  63. package/dist/use.cmd.js +0 -13
  64. package/dist/use.cmd.js.map +1 -1
  65. package/dist/watch/check-types.js +0 -1
  66. package/dist/watch/check-types.js.map +1 -1
  67. package/dist/watch/output-formatter.js +1 -12
  68. package/dist/watch/output-formatter.js.map +1 -1
  69. package/dist/watch/watch-queue.js +0 -13
  70. package/dist/watch/watch-queue.js.map +1 -1
  71. package/dist/watch/watch.cmd.js +6 -41
  72. package/dist/watch/watch.cmd.js.map +1 -1
  73. package/dist/watch/watcher.js +13 -133
  74. package/dist/watch/watcher.js.map +1 -1
  75. package/dist/workspace-component/component-status.js +0 -4
  76. package/dist/workspace-component/component-status.js.map +1 -1
  77. package/dist/workspace-component/index.js +0 -6
  78. package/dist/workspace-component/index.js.map +1 -1
  79. package/dist/workspace-component/workspace-component-loader.js +31 -116
  80. package/dist/workspace-component/workspace-component-loader.js.map +1 -1
  81. package/dist/workspace-component/workspace-component.js +1 -11
  82. package/dist/workspace-component/workspace-component.js.map +1 -1
  83. package/dist/workspace-section.js +2 -0
  84. package/dist/workspace-section.js.map +1 -1
  85. package/dist/workspace.aspect.js +0 -5
  86. package/dist/workspace.aspect.js.map +1 -1
  87. package/dist/workspace.composition.js +0 -6
  88. package/dist/workspace.composition.js.map +1 -1
  89. package/dist/workspace.d.ts +1 -0
  90. package/dist/workspace.graphql.js +0 -12
  91. package/dist/workspace.graphql.js.map +1 -1
  92. package/dist/workspace.js +141 -545
  93. package/dist/workspace.js.map +1 -1
  94. package/dist/workspace.main.runtime.js +0 -55
  95. package/dist/workspace.main.runtime.js.map +1 -1
  96. package/dist/workspace.provider.js +8 -77
  97. package/dist/workspace.provider.js.map +1 -1
  98. package/dist/workspace.ui-root.js +3 -17
  99. package/dist/workspace.ui-root.js.map +1 -1
  100. package/dist/workspace.ui.drawer.js +2 -24
  101. package/dist/workspace.ui.drawer.js.map +1 -1
  102. package/dist/workspace.ui.runtime.js +0 -75
  103. package/dist/workspace.ui.runtime.js.map +1 -1
  104. package/package-tar/teambit-workspace-0.0.883.tgz +0 -0
  105. package/package.json +18 -18
  106. package/{preview-1666409808293.js → preview-1666582798766.js} +2 -2
  107. package/workspace-component/workspace-component-loader.ts +13 -3
  108. package/package-tar/teambit-workspace-0.0.881.tgz +0 -0
@@ -4,27 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.WorkspaceContext = void 0;
7
-
8
7
  function _react() {
9
8
  const data = require("react");
10
-
11
9
  _react = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _workspaceModel() {
19
15
  const data = require("./workspace-model");
20
-
21
16
  _workspaceModel = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  const WorkspaceContext = /*#__PURE__*/(0, _react().createContext)(_workspaceModel().Workspace.empty());
29
22
  exports.WorkspaceContext = WorkspaceContext;
30
23
 
@@ -1 +1 @@
1
- {"version":3,"names":["WorkspaceContext","createContext","WorkspaceModel","empty"],"sources":["workspace-context.tsx"],"sourcesContent":["import { createContext } from 'react';\n\nimport { Workspace as WorkspaceModel } from './workspace-model';\n\nexport const WorkspaceContext: React.Context<WorkspaceModel> = createContext<WorkspaceModel>(WorkspaceModel.empty());\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,gBAA+C,gBAAG,IAAAC,sBAAA,EAA8BC,2BAAA,CAAeC,KAAf,EAA9B,CAAxD"}
1
+ {"version":3,"names":["WorkspaceContext","createContext","WorkspaceModel","empty"],"sources":["workspace-context.tsx"],"sourcesContent":["import { createContext } from 'react';\n\nimport { Workspace as WorkspaceModel } from './workspace-model';\n\nexport const WorkspaceContext: React.Context<WorkspaceModel> = createContext<WorkspaceModel>(WorkspaceModel.empty());\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,gBAA+C,gBAAG,IAAAC,sBAAa,EAAiBC,2BAAc,CAACC,KAAK,EAAE,CAAC;AAAC"}
@@ -4,28 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Workspace = void 0;
7
-
8
7
  function _component() {
9
8
  const data = require("@teambit/component");
10
-
11
9
  _component = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _componentDescriptor() {
19
15
  const data = require("@teambit/component-descriptor");
20
-
21
16
  _componentDescriptor = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  // import { ComponentMeta } from '@teambit/component';
22
+
29
23
  class Workspace {
30
24
  constructor(
31
25
  /**
@@ -54,15 +48,13 @@ class Workspace {
54
48
  this.components = components;
55
49
  this.componentDescriptors = componentDescriptors;
56
50
  }
51
+
57
52
  /**
58
53
  * return a component from the workspace.
59
54
  */
60
-
61
-
62
55
  getComponent(id) {
63
56
  return this.components.find(component => component.id.fullName === id.fullName);
64
57
  }
65
-
66
58
  static from({
67
59
  name,
68
60
  path,
@@ -71,7 +63,6 @@ class Workspace {
71
63
  }) {
72
64
  const componentDescriptors = components.map(component => {
73
65
  const id = _component().ComponentID.fromObject(component.id);
74
-
75
66
  return _componentDescriptor().ComponentDescriptor.fromObject({
76
67
  id: id.toString()
77
68
  });
@@ -80,13 +71,10 @@ class Workspace {
80
71
  return _component().ComponentModel.from(value);
81
72
  }), componentDescriptors);
82
73
  }
83
-
84
74
  static empty() {
85
75
  return new Workspace('', '', '', [], []);
86
76
  }
87
-
88
77
  }
89
-
90
78
  exports.Workspace = Workspace;
91
79
 
92
80
  //# sourceMappingURL=workspace-model.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Workspace","constructor","name","path","icon","components","componentDescriptors","getComponent","id","find","component","fullName","from","map","ComponentID","fromObject","ComponentDescriptor","toString","value","ComponentModel","empty"],"sources":["workspace-model.ts"],"sourcesContent":["// import { ComponentMeta } from '@teambit/component';\nimport { ComponentID, ComponentModel, ComponentModelProps } from '@teambit/component';\nimport { ComponentDescriptor } from '@teambit/component-descriptor';\nimport { DeprecationInfo } from '@teambit/deprecation';\nimport { Descriptor } from '@teambit/envs';\n\nimport { ComponentStatus } from '../../workspace-component/component-status';\n\nexport type WorkspaceModelComponent = {\n id: ComponentID;\n status: ComponentStatus;\n deprecation: DeprecationInfo;\n env: Descriptor;\n};\n\nexport type WorkspaceProps = {\n name: string;\n path: string;\n components: ComponentModelProps[];\n icon: string;\n};\n\nexport class Workspace {\n constructor(\n /**\n * name of the workspace.\n */\n readonly name: string,\n\n /**\n * absolute path of the workspace.\n */\n readonly path: string,\n\n /**\n * icon of the workspace.\n */\n readonly icon: string,\n\n /**\n * components container in the workspace.\n */\n readonly components: ComponentModel[],\n\n /**\n * components contained in the workspace.\n */\n readonly componentDescriptors: ComponentDescriptor[]\n ) {}\n\n /**\n * return a component from the workspace.\n */\n getComponent(id: ComponentID) {\n return this.components.find((component) => component.id.fullName === id.fullName);\n }\n\n static from({ name, path, components, icon }: WorkspaceProps) {\n const componentDescriptors = components.map((component) => {\n const id = ComponentID.fromObject(component.id);\n return ComponentDescriptor.fromObject({ id: id.toString() });\n });\n return new Workspace(\n name,\n path,\n icon,\n components.map((value) => {\n return ComponentModel.from(value);\n }),\n componentDescriptors\n );\n }\n\n static empty() {\n return new Workspace('', '', '', [], []);\n }\n}\n"],"mappings":";;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAFA;AAsBO,MAAMA,SAAN,CAAgB;EACrBC,WAAW;EACT;AACJ;AACA;EACaC,IAJA;EAMT;AACJ;AACA;EACaC,IATA;EAWT;AACJ;AACA;EACaC,IAdA;EAgBT;AACJ;AACA;EACaC,UAnBA;EAqBT;AACJ;AACA;EACaC,oBAxBA,EAyBT;IAAA,KArBSJ,IAqBT,GArBSA,IAqBT;IAAA,KAhBSC,IAgBT,GAhBSA,IAgBT;IAAA,KAXSC,IAWT,GAXSA,IAWT;IAAA,KANSC,UAMT,GANSA,UAMT;IAAA,KADSC,oBACT,GADSA,oBACT;EAAE;EAEJ;AACF;AACA;;;EACEC,YAAY,CAACC,EAAD,EAAkB;IAC5B,OAAO,KAAKH,UAAL,CAAgBI,IAAhB,CAAsBC,SAAD,IAAeA,SAAS,CAACF,EAAV,CAAaG,QAAb,KAA0BH,EAAE,CAACG,QAAjE,CAAP;EACD;;EAEU,OAAJC,IAAI,CAAC;IAAEV,IAAF;IAAQC,IAAR;IAAcE,UAAd;IAA0BD;EAA1B,CAAD,EAAmD;IAC5D,MAAME,oBAAoB,GAAGD,UAAU,CAACQ,GAAX,CAAgBH,SAAD,IAAe;MACzD,MAAMF,EAAE,GAAGM,wBAAA,CAAYC,UAAZ,CAAuBL,SAAS,CAACF,EAAjC,CAAX;;MACA,OAAOQ,0CAAA,CAAoBD,UAApB,CAA+B;QAAEP,EAAE,EAAEA,EAAE,CAACS,QAAH;MAAN,CAA/B,CAAP;IACD,CAH4B,CAA7B;IAIA,OAAO,IAAIjB,SAAJ,CACLE,IADK,EAELC,IAFK,EAGLC,IAHK,EAILC,UAAU,CAACQ,GAAX,CAAgBK,KAAD,IAAW;MACxB,OAAOC,2BAAA,CAAeP,IAAf,CAAoBM,KAApB,CAAP;IACD,CAFD,CAJK,EAOLZ,oBAPK,CAAP;EASD;;EAEW,OAALc,KAAK,GAAG;IACb,OAAO,IAAIpB,SAAJ,CAAc,EAAd,EAAkB,EAAlB,EAAsB,EAAtB,EAA0B,EAA1B,EAA8B,EAA9B,CAAP;EACD;;AArDoB"}
1
+ {"version":3,"names":["Workspace","constructor","name","path","icon","components","componentDescriptors","getComponent","id","find","component","fullName","from","map","ComponentID","fromObject","ComponentDescriptor","toString","value","ComponentModel","empty"],"sources":["workspace-model.ts"],"sourcesContent":["// import { ComponentMeta } from '@teambit/component';\nimport { ComponentID, ComponentModel, ComponentModelProps } from '@teambit/component';\nimport { ComponentDescriptor } from '@teambit/component-descriptor';\nimport { DeprecationInfo } from '@teambit/deprecation';\nimport { Descriptor } from '@teambit/envs';\n\nimport { ComponentStatus } from '../../workspace-component/component-status';\n\nexport type WorkspaceModelComponent = {\n id: ComponentID;\n status: ComponentStatus;\n deprecation: DeprecationInfo;\n env: Descriptor;\n};\n\nexport type WorkspaceProps = {\n name: string;\n path: string;\n components: ComponentModelProps[];\n icon: string;\n};\n\nexport class Workspace {\n constructor(\n /**\n * name of the workspace.\n */\n readonly name: string,\n\n /**\n * absolute path of the workspace.\n */\n readonly path: string,\n\n /**\n * icon of the workspace.\n */\n readonly icon: string,\n\n /**\n * components container in the workspace.\n */\n readonly components: ComponentModel[],\n\n /**\n * components contained in the workspace.\n */\n readonly componentDescriptors: ComponentDescriptor[]\n ) {}\n\n /**\n * return a component from the workspace.\n */\n getComponent(id: ComponentID) {\n return this.components.find((component) => component.id.fullName === id.fullName);\n }\n\n static from({ name, path, components, icon }: WorkspaceProps) {\n const componentDescriptors = components.map((component) => {\n const id = ComponentID.fromObject(component.id);\n return ComponentDescriptor.fromObject({ id: id.toString() });\n });\n return new Workspace(\n name,\n path,\n icon,\n components.map((value) => {\n return ComponentModel.from(value);\n }),\n componentDescriptors\n );\n }\n\n static empty() {\n return new Workspace('', '', '', [], []);\n }\n}\n"],"mappings":";;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAFA;;AAsBO,MAAMA,SAAS,CAAC;EACrBC,WAAW;EACT;AACJ;AACA;EACaC,IAAY;EAErB;AACJ;AACA;EACaC,IAAY;EAErB;AACJ;AACA;EACaC,IAAY;EAErB;AACJ;AACA;EACaC,UAA4B;EAErC;AACJ;AACA;EACaC,oBAA2C,EACpD;IAAA,KArBSJ,IAAY,GAAZA,IAAY;IAAA,KAKZC,IAAY,GAAZA,IAAY;IAAA,KAKZC,IAAY,GAAZA,IAAY;IAAA,KAKZC,UAA4B,GAA5BA,UAA4B;IAAA,KAK5BC,oBAA2C,GAA3CA,oBAA2C;EACnD;;EAEH;AACF;AACA;EACEC,YAAY,CAACC,EAAe,EAAE;IAC5B,OAAO,IAAI,CAACH,UAAU,CAACI,IAAI,CAAEC,SAAS,IAAKA,SAAS,CAACF,EAAE,CAACG,QAAQ,KAAKH,EAAE,CAACG,QAAQ,CAAC;EACnF;EAEA,OAAOC,IAAI,CAAC;IAAEV,IAAI;IAAEC,IAAI;IAAEE,UAAU;IAAED;EAAqB,CAAC,EAAE;IAC5D,MAAME,oBAAoB,GAAGD,UAAU,CAACQ,GAAG,CAAEH,SAAS,IAAK;MACzD,MAAMF,EAAE,GAAGM,wBAAW,CAACC,UAAU,CAACL,SAAS,CAACF,EAAE,CAAC;MAC/C,OAAOQ,0CAAmB,CAACD,UAAU,CAAC;QAAEP,EAAE,EAAEA,EAAE,CAACS,QAAQ;MAAG,CAAC,CAAC;IAC9D,CAAC,CAAC;IACF,OAAO,IAAIjB,SAAS,CAClBE,IAAI,EACJC,IAAI,EACJC,IAAI,EACJC,UAAU,CAACQ,GAAG,CAAEK,KAAK,IAAK;MACxB,OAAOC,2BAAc,CAACP,IAAI,CAACM,KAAK,CAAC;IACnC,CAAC,CAAC,EACFZ,oBAAoB,CACrB;EACH;EAEA,OAAOc,KAAK,GAAG;IACb,OAAO,IAAIpB,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;EAC1C;AACF;AAAC"}
@@ -9,14 +9,11 @@ Object.defineProperty(exports, "WorkspaceOverview", {
9
9
  return _workspaceOverview().WorkspaceOverview;
10
10
  }
11
11
  });
12
-
13
12
  function _workspaceOverview() {
14
13
  const data = require("./workspace-overview");
15
-
16
14
  _workspaceOverview = function () {
17
15
  return data;
18
16
  };
19
-
20
17
  return data;
21
18
  }
22
19
 
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { WorkspaceOverview } from './workspace-overview';\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { WorkspaceOverview } from './workspace-overview';\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
@@ -1,76 +1,54 @@
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.WorkspaceOverview = WorkspaceOverview;
9
-
10
8
  function _react() {
11
9
  const data = _interopRequireWildcard(require("react"));
12
-
13
10
  _react = function () {
14
11
  return data;
15
12
  };
16
-
17
13
  return data;
18
14
  }
19
-
20
15
  function _explorerUiGallery() {
21
16
  const data = require("@teambit/explorer.ui.gallery.component-grid");
22
-
23
17
  _explorerUiGallery = function () {
24
18
  return data;
25
19
  };
26
-
27
20
  return data;
28
21
  }
29
-
30
22
  function _workspaceUi() {
31
23
  const data = require("@teambit/workspace.ui.empty-workspace");
32
-
33
24
  _workspaceUi = function () {
34
25
  return data;
35
26
  };
36
-
37
27
  return data;
38
28
  }
39
-
40
29
  function _workspaceUi2() {
41
30
  const data = require("@teambit/workspace.ui.workspace-component-card");
42
-
43
31
  _workspaceUi2 = function () {
44
32
  return data;
45
33
  };
46
-
47
34
  return data;
48
35
  }
49
-
50
36
  function _workspaceContext() {
51
37
  const data = require("../workspace-context");
52
-
53
38
  _workspaceContext = function () {
54
39
  return data;
55
40
  };
56
-
57
41
  return data;
58
42
  }
59
-
60
43
  function _workspaceOverviewModule() {
61
44
  const data = _interopRequireDefault(require("./workspace-overview.module.scss"));
62
-
63
45
  _workspaceOverviewModule = function () {
64
46
  return data;
65
47
  };
66
-
67
48
  return data;
68
49
  }
69
-
70
50
  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); }
71
-
72
51
  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; }
73
-
74
52
  function WorkspaceOverview() {
75
53
  const workspace = (0, _react().useContext)(_workspaceContext().WorkspaceContext);
76
54
  const {
@@ -83,7 +61,6 @@ function WorkspaceOverview() {
83
61
  className: _workspaceOverviewModule().default.container
84
62
  }, /*#__PURE__*/_react().default.createElement(_explorerUiGallery().ComponentGrid, null, components.map((component, index) => {
85
63
  var _component$deprecatio;
86
-
87
64
  if ((_component$deprecatio = component.deprecation) !== null && _component$deprecatio !== void 0 && _component$deprecatio.isDeprecate) return null;
88
65
  return /*#__PURE__*/_react().default.createElement(_workspaceUi2().WorkspaceComponentCard, {
89
66
  key: index,
@@ -1 +1 @@
1
- {"version":3,"names":["WorkspaceOverview","workspace","useContext","WorkspaceContext","components","length","name","styles","container","map","component","index","deprecation","isDeprecate"],"sources":["workspace-overview.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { ComponentGrid } from '@teambit/explorer.ui.gallery.component-grid';\nimport { EmptyWorkspace } from '@teambit/workspace.ui.empty-workspace';\nimport { WorkspaceComponentCard } from '@teambit/workspace.ui.workspace-component-card';\nimport { WorkspaceContext } from '../workspace-context';\nimport styles from './workspace-overview.module.scss';\n\nexport function WorkspaceOverview() {\n const workspace = useContext(WorkspaceContext);\n const { components } = workspace;\n if (!components || components.length === 0) return <EmptyWorkspace name={workspace.name} />;\n return (\n <div className={styles.container}>\n <ComponentGrid>\n {components.map((component, index) => {\n if (component.deprecation?.isDeprecate) return null;\n return <WorkspaceComponentCard key={index} component={component} />;\n })}\n </ComponentGrid>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;AAEO,SAASA,iBAAT,GAA6B;EAClC,MAAMC,SAAS,GAAG,IAAAC,mBAAA,EAAWC,oCAAX,CAAlB;EACA,MAAM;IAAEC;EAAF,IAAiBH,SAAvB;EACA,IAAI,CAACG,UAAD,IAAeA,UAAU,CAACC,MAAX,KAAsB,CAAzC,EAA4C,oBAAO,+BAAC,6BAAD;IAAgB,IAAI,EAAEJ,SAAS,CAACK;EAAhC,EAAP;EAC5C,oBACE;IAAK,SAAS,EAAEC,kCAAA,CAAOC;EAAvB,gBACE,+BAAC,kCAAD,QACGJ,UAAU,CAACK,GAAX,CAAe,CAACC,SAAD,EAAYC,KAAZ,KAAsB;IAAA;;IACpC,6BAAID,SAAS,CAACE,WAAd,kDAAI,sBAAuBC,WAA3B,EAAwC,OAAO,IAAP;IACxC,oBAAO,+BAAC,sCAAD;MAAwB,GAAG,EAAEF,KAA7B;MAAoC,SAAS,EAAED;IAA/C,EAAP;EACD,CAHA,CADH,CADF,CADF;AAUD"}
1
+ {"version":3,"names":["WorkspaceOverview","workspace","useContext","WorkspaceContext","components","length","name","styles","container","map","component","index","deprecation","isDeprecate"],"sources":["workspace-overview.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { ComponentGrid } from '@teambit/explorer.ui.gallery.component-grid';\nimport { EmptyWorkspace } from '@teambit/workspace.ui.empty-workspace';\nimport { WorkspaceComponentCard } from '@teambit/workspace.ui.workspace-component-card';\nimport { WorkspaceContext } from '../workspace-context';\nimport styles from './workspace-overview.module.scss';\n\nexport function WorkspaceOverview() {\n const workspace = useContext(WorkspaceContext);\n const { components } = workspace;\n if (!components || components.length === 0) return <EmptyWorkspace name={workspace.name} />;\n return (\n <div className={styles.container}>\n <ComponentGrid>\n {components.map((component, index) => {\n if (component.deprecation?.isDeprecate) return null;\n return <WorkspaceComponentCard key={index} component={component} />;\n })}\n </ComponentGrid>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAsD;AAAA;AAE/C,SAASA,iBAAiB,GAAG;EAClC,MAAMC,SAAS,GAAG,IAAAC,mBAAU,EAACC,oCAAgB,CAAC;EAC9C,MAAM;IAAEC;EAAW,CAAC,GAAGH,SAAS;EAChC,IAAI,CAACG,UAAU,IAAIA,UAAU,CAACC,MAAM,KAAK,CAAC,EAAE,oBAAO,+BAAC,6BAAc;IAAC,IAAI,EAAEJ,SAAS,CAACK;EAAK,EAAG;EAC3F,oBACE;IAAK,SAAS,EAAEC,kCAAM,CAACC;EAAU,gBAC/B,+BAAC,kCAAa,QACXJ,UAAU,CAACK,GAAG,CAAC,CAACC,SAAS,EAAEC,KAAK,KAAK;IAAA;IACpC,6BAAID,SAAS,CAACE,WAAW,kDAArB,sBAAuBC,WAAW,EAAE,OAAO,IAAI;IACnD,oBAAO,+BAAC,sCAAsB;MAAC,GAAG,EAAEF,KAAM;MAAC,SAAS,EAAED;IAAU,EAAG;EACrE,CAAC,CAAC,CACY,CACZ;AAEV"}
@@ -1,32 +1,24 @@
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.WorkspaceProvider = WorkspaceProvider;
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
  function _workspaceContext() {
21
16
  const data = require("./workspace-context");
22
-
23
17
  _workspaceContext = function () {
24
18
  return data;
25
19
  };
26
-
27
20
  return data;
28
21
  }
29
-
30
22
  /**
31
23
  * context provider of the workspace
32
24
  */
@@ -1 +1 @@
1
- {"version":3,"names":["WorkspaceProvider","workspace","children"],"sources":["workspace-provider.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\n\nimport { WorkspaceContext } from './workspace-context';\nimport { Workspace } from './workspace-model';\n\nexport type WorkspaceProviderProps = {\n /**\n * workspace model.\n */\n workspace: Workspace;\n\n /**\n * react children.\n */\n children: ReactNode;\n};\n\n/**\n * context provider of the workspace\n */\nexport function WorkspaceProvider({ workspace, children }: WorkspaceProviderProps) {\n return <WorkspaceContext.Provider value={workspace}>{children}</WorkspaceContext.Provider>;\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAeA;AACA;AACA;AACO,SAASA,iBAAT,CAA2B;EAAEC,SAAF;EAAaC;AAAb,CAA3B,EAA4E;EACjF,oBAAO,+BAAC,oCAAD,CAAkB,QAAlB;IAA2B,KAAK,EAAED;EAAlC,GAA8CC,QAA9C,CAAP;AACD"}
1
+ {"version":3,"names":["WorkspaceProvider","workspace","children"],"sources":["workspace-provider.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\n\nimport { WorkspaceContext } from './workspace-context';\nimport { Workspace } from './workspace-model';\n\nexport type WorkspaceProviderProps = {\n /**\n * workspace model.\n */\n workspace: Workspace;\n\n /**\n * react children.\n */\n children: ReactNode;\n};\n\n/**\n * context provider of the workspace\n */\nexport function WorkspaceProvider({ workspace, children }: WorkspaceProviderProps) {\n return <WorkspaceContext.Provider value={workspace}>{children}</WorkspaceContext.Provider>;\n}\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAeA;AACA;AACA;AACO,SAASA,iBAAiB,CAAC;EAAEC,SAAS;EAAEC;AAAiC,CAAC,EAAE;EACjF,oBAAO,+BAAC,oCAAgB,CAAC,QAAQ;IAAC,KAAK,EAAED;EAAU,GAAEC,QAAQ,CAA6B;AAC5F"}
@@ -1,160 +1,112 @@
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.Workspace = Workspace;
11
-
12
9
  require("reset-css");
13
-
14
10
  function _pluralize() {
15
11
  const data = _interopRequireDefault(require("pluralize"));
16
-
17
12
  _pluralize = function () {
18
13
  return data;
19
14
  };
20
-
21
15
  return data;
22
16
  }
23
-
24
17
  function _react() {
25
18
  const data = _interopRequireWildcard(require("react"));
26
-
27
19
  _react = function () {
28
20
  return data;
29
21
  };
30
-
31
22
  return data;
32
23
  }
33
-
34
24
  function _reactRouterDom() {
35
25
  const data = require("react-router-dom");
36
-
37
26
  _reactRouterDom = function () {
38
27
  return data;
39
28
  };
40
-
41
29
  return data;
42
30
  }
43
-
44
31
  function _uiFoundationUiNotifications() {
45
32
  const data = require("@teambit/ui-foundation.ui.notifications.notification-context");
46
-
47
33
  _uiFoundationUiNotifications = function () {
48
34
  return data;
49
35
  };
50
-
51
36
  return data;
52
37
  }
53
-
54
38
  function _uiFoundationUiReactRouter() {
55
39
  const data = require("@teambit/ui-foundation.ui.react-router.slot-router");
56
-
57
40
  _uiFoundationUiReactRouter = function () {
58
41
  return data;
59
42
  };
60
-
61
43
  return data;
62
44
  }
63
-
64
45
  function _uiFoundationUi() {
65
46
  const data = require("@teambit/ui-foundation.ui.corner");
66
-
67
47
  _uiFoundationUi = function () {
68
48
  return data;
69
49
  };
70
-
71
50
  return data;
72
51
  }
73
-
74
52
  function _uiFoundationUiButtons() {
75
53
  const data = require("@teambit/ui-foundation.ui.buttons.collapser");
76
-
77
54
  _uiFoundationUiButtons = function () {
78
55
  return data;
79
56
  };
80
-
81
57
  return data;
82
58
  }
83
-
84
59
  function _baseUiSurfacesSplitPane() {
85
60
  const data = require("@teambit/base-ui.surfaces.split-pane.split-pane");
86
-
87
61
  _baseUiSurfacesSplitPane = function () {
88
62
  return data;
89
63
  };
90
-
91
64
  return data;
92
65
  }
93
-
94
66
  function _baseUiSurfacesSplitPane2() {
95
67
  const data = require("@teambit/base-ui.surfaces.split-pane.hover-splitter");
96
-
97
68
  _baseUiSurfacesSplitPane2 = function () {
98
69
  return data;
99
70
  };
100
-
101
71
  return data;
102
72
  }
103
-
104
73
  function _uiFoundationUi2() {
105
74
  const data = require("@teambit/ui-foundation.ui.top-bar");
106
-
107
75
  _uiFoundationUi2 = function () {
108
76
  return data;
109
77
  };
110
-
111
78
  return data;
112
79
  }
113
-
114
80
  function _useWorkspace() {
115
81
  const data = require("./use-workspace");
116
-
117
82
  _useWorkspace = function () {
118
83
  return data;
119
84
  };
120
-
121
85
  return data;
122
86
  }
123
-
124
87
  function _workspaceOverview() {
125
88
  const data = require("./workspace-overview");
126
-
127
89
  _workspaceOverview = function () {
128
90
  return data;
129
91
  };
130
-
131
92
  return data;
132
93
  }
133
-
134
94
  function _workspaceProvider() {
135
95
  const data = require("./workspace-provider");
136
-
137
96
  _workspaceProvider = function () {
138
97
  return data;
139
98
  };
140
-
141
99
  return data;
142
100
  }
143
-
144
101
  function _workspaceModule() {
145
102
  const data = _interopRequireDefault(require("./workspace.module.scss"));
146
-
147
103
  _workspaceModule = function () {
148
104
  return data;
149
105
  };
150
-
151
106
  return data;
152
107
  }
153
-
154
108
  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); }
155
-
156
109
  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; }
157
-
158
110
  /**
159
111
  * main workspace component.
160
112
  */
@@ -172,13 +124,11 @@ function Workspace({
172
124
  const [isSidebarOpen, handleSidebarToggle] = (0, _react().useReducer)(x => !x, true);
173
125
  const sidebarOpenness = isSidebarOpen ? _baseUiSurfacesSplitPane().Layout.row : _baseUiSurfacesSplitPane().Layout.right;
174
126
  onSidebarTogglerChange(handleSidebarToggle);
175
-
176
127
  if (!workspace) {
177
128
  return /*#__PURE__*/_react().default.createElement("div", {
178
129
  className: _workspaceModule().default.emptyContainer
179
130
  });
180
131
  }
181
-
182
132
  workspaceUI.setComponents(workspace.components);
183
133
  return /*#__PURE__*/_react().default.createElement(_workspaceProvider().WorkspaceProvider, {
184
134
  workspace: workspace
@@ -212,10 +162,10 @@ function Workspace({
212
162
  element: /*#__PURE__*/_react().default.createElement(_workspaceOverview().WorkspaceOverview, null)
213
163
  }))))));
214
164
  }
215
-
216
165
  function useComponentNotifications() {
217
- const notifications = (0, _uiFoundationUiNotifications().useNotifications)(); // memo not really needed, but for peace of mind
166
+ const notifications = (0, _uiFoundationUiNotifications().useNotifications)();
218
167
 
168
+ // memo not really needed, but for peace of mind
219
169
  return (0, _react().useMemo)(() => ({
220
170
  onComponentAdded: comps => {
221
171
  const notificationId = notifications.log(`added ${(0, _pluralize().default)('component', comps.length)}: ${comps.map(comp => comp.id.toString()).join(', ')}`);
@@ -1 +1 @@
1
- {"version":3,"names":["Workspace","routeSlot","menuSlot","sidebar","workspaceUI","onSidebarTogglerChange","reactions","useComponentNotifications","workspace","useWorkspace","isSidebarOpen","handleSidebarToggle","useReducer","x","sidebarOpenness","Layout","row","right","styles","emptyContainer","setComponents","components","workspaceWrapper","topbar","name","icon","main","splitter","e","stopPropagation","notifications","useNotifications","useMemo","onComponentAdded","comps","notificationId","log","pluralize","length","map","comp","id","toString","join","setTimeout","dismiss","onComponentRemoved","ids"],"sources":["workspace.tsx"],"sourcesContent":["import 'reset-css';\nimport pluralize from 'pluralize';\nimport React, { useReducer, useMemo } from 'react';\nimport { Route } from 'react-router-dom';\nimport type { ComponentModel } from '@teambit/component';\nimport type { ComponentID } from '@teambit/component-id';\nimport { useNotifications } from '@teambit/ui-foundation.ui.notifications.notification-context';\nimport { RouteSlot, SlotRouter } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { Corner } from '@teambit/ui-foundation.ui.corner';\nimport { Collapser } from '@teambit/ui-foundation.ui.buttons.collapser';\nimport { SplitPane, Pane, Layout } from '@teambit/base-ui.surfaces.split-pane.split-pane';\nimport { HoverSplitter } from '@teambit/base-ui.surfaces.split-pane.hover-splitter';\nimport { TopBar } from '@teambit/ui-foundation.ui.top-bar';\n\nimport { useWorkspace } from './use-workspace';\nimport { WorkspaceOverview } from './workspace-overview';\nimport { WorkspaceProvider } from './workspace-provider';\nimport styles from './workspace.module.scss';\nimport WorkspaceUI from '../../workspace.ui.runtime';\n\nexport type WorkspaceProps = {\n routeSlot: RouteSlot;\n menuSlot: RouteSlot;\n sidebar: JSX.Element;\n workspaceUI: WorkspaceUI;\n onSidebarTogglerChange: (callback: () => void) => void;\n};\n\n/**\n * main workspace component.\n */\nexport function Workspace({ routeSlot, menuSlot, sidebar, workspaceUI, onSidebarTogglerChange }: WorkspaceProps) {\n const reactions = useComponentNotifications();\n const { workspace } = useWorkspace(reactions);\n\n const [isSidebarOpen, handleSidebarToggle] = useReducer((x) => !x, true);\n const sidebarOpenness = isSidebarOpen ? Layout.row : Layout.right;\n\n onSidebarTogglerChange(handleSidebarToggle);\n\n if (!workspace) {\n return <div className={styles.emptyContainer}></div>;\n }\n\n workspaceUI.setComponents(workspace.components);\n\n return (\n <WorkspaceProvider workspace={workspace}>\n <div className={styles.workspaceWrapper}>\n <TopBar\n className={styles.topbar}\n Corner={() => <Corner name={workspace.name} icon={workspace.icon} />}\n menu={menuSlot}\n />\n\n <SplitPane className={styles.main} size={264} layout={sidebarOpenness}>\n <Pane className={styles.sidebar}>{sidebar}</Pane>\n <HoverSplitter className={styles.splitter}>\n <Collapser\n isOpen={isSidebarOpen}\n onMouseDown={(e) => e.stopPropagation()} // avoid split-pane drag\n onClick={handleSidebarToggle}\n tooltipContent={`${isSidebarOpen ? 'Hide' : 'Show'} side panel`}\n />\n </HoverSplitter>\n <Pane>\n <SlotRouter slot={routeSlot}>\n <Route index element={<WorkspaceOverview />} />\n </SlotRouter>\n </Pane>\n </SplitPane>\n </div>\n </WorkspaceProvider>\n );\n}\nfunction useComponentNotifications() {\n const notifications = useNotifications();\n\n // memo not really needed, but for peace of mind\n return useMemo(\n () => ({\n onComponentAdded: (comps: ComponentModel[]) => {\n const notificationId = notifications.log(\n `added ${pluralize('component', comps.length)}: ${comps.map((comp) => comp.id.toString()).join(', ')}`\n );\n setTimeout(() => notifications.dismiss(notificationId), 12 * 1000);\n },\n\n onComponentRemoved: (ids: ComponentID[]) => {\n const notificationId = notifications.log(\n `removed ${pluralize('component', ids.length)} ${ids.map((id) => id.toString()).join(', ')}`\n );\n setTimeout(() => not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AAgB,EAAGC,KAAD,IAA6B;MAC7C,MAAMC,cAAc,GAAGL,aAAa,CAACM,GAAd,CACpB,SAAQ,IAAAC,oBAAA,EAAU,WAAV,EAAuBH,KAAK,CAACI,MAA7B,CAAqC,KAAIJ,KAAK,CAACK,GAAN,CAAWC,IAAD,IAAUA,IAAI,CAACC,EAAL,CAAQC,QAAR,EAApB,EAAwCC,IAAxC,CAA6C,IAA7C,CAAmD,EADhF,CAAvB;MAGAC,UAAU,CAAC,MAAMd,aAAa,CAACe,OAAd,CAAsBV,cAAtB,CAAP,EAA8C,KAAK,IAAnD,CAAV;IACD,CANI;IAQLW,kBAAkB,EAAGC,GAAD,IAAwB;MAC1C,MAAMZ,cAAc,GAAGL,aAAa,CAACM,GAAd,CACpB,WAAU,IAAAC,oBAAA,EAAU,WAAV,EAAuBU,GAAG,CAACT,MAA3B,CAAmC,IAAGS,GAAG,CAACR,GAAJ,CAASE,EAAD,IAAQA,EAAE,CAACC,QAAH,EAAhB,EAA+BC,IAA/B,CAAoC,IAApC,CAA0C,EADtE,CAAvB;MAGAC,UAAU,CAAC,MAAMd,aAAa,CAACe,OAAd,CAAsBV,cAAtB,CAAP,EAA8C,KAAK,IAAnD,CAAV;IACD;EAbI,CAAP,CADK,EAgBL,CAACL,aAAD,CAhBK,CAAP;AAkBD"}
1
+ {"version":3,"names":["Workspace","routeSlot","menuSlot","sidebar","workspaceUI","onSidebarTogglerChange","reactions","useComponentNotifications","workspace","useWorkspace","isSidebarOpen","handleSidebarToggle","useReducer","x","sidebarOpenness","Layout","row","right","styles","emptyContainer","setComponents","components","workspaceWrapper","topbar","name","icon","main","splitter","e","stopPropagation","notifications","useNotifications","useMemo","onComponentAdded","comps","notificationId","log","pluralize","length","map","comp","id","toString","join","setTimeout","dismiss","onComponentRemoved","ids"],"sources":["workspace.tsx"],"sourcesContent":["import 'reset-css';\nimport pluralize from 'pluralize';\nimport React, { useReducer, useMemo } from 'react';\nimport { Route } from 'react-router-dom';\nimport type { ComponentModel } from '@teambit/component';\nimport type { ComponentID } from '@teambit/component-id';\nimport { useNotifications } from '@teambit/ui-foundation.ui.notifications.notification-context';\nimport { RouteSlot, SlotRouter } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { Corner } from '@teambit/ui-foundation.ui.corner';\nimport { Collapser } from '@teambit/ui-foundation.ui.buttons.collapser';\nimport { SplitPane, Pane, Layout } from '@teambit/base-ui.surfaces.split-pane.split-pane';\nimport { HoverSplitter } from '@teambit/base-ui.surfaces.split-pane.hover-splitter';\nimport { TopBar } from '@teambit/ui-foundation.ui.top-bar';\n\nimport { useWorkspace } from './use-workspace';\nimport { WorkspaceOverview } from './workspace-overview';\nimport { WorkspaceProvider } from './workspace-provider';\nimport styles from './workspace.module.scss';\nimport WorkspaceUI from '../../workspace.ui.runtime';\n\nexport type WorkspaceProps = {\n routeSlot: RouteSlot;\n menuSlot: RouteSlot;\n sidebar: JSX.Element;\n workspaceUI: WorkspaceUI;\n onSidebarTogglerChange: (callback: () => void) => void;\n};\n\n/**\n * main workspace component.\n */\nexport function Workspace({ routeSlot, menuSlot, sidebar, workspaceUI, onSidebarTogglerChange }: WorkspaceProps) {\n const reactions = useComponentNotifications();\n const { workspace } = useWorkspace(reactions);\n\n const [isSidebarOpen, handleSidebarToggle] = useReducer((x) => !x, true);\n const sidebarOpenness = isSidebarOpen ? Layout.row : Layout.right;\n\n onSidebarTogglerChange(handleSidebarToggle);\n\n if (!workspace) {\n return <div className={styles.emptyContainer}></div>;\n }\n\n workspaceUI.setComponents(workspace.components);\n\n return (\n <WorkspaceProvider workspace={workspace}>\n <div className={styles.workspaceWrapper}>\n <TopBar\n className={styles.topbar}\n Corner={() => <Corner name={workspace.name} icon={workspace.icon} />}\n menu={menuSlot}\n />\n\n <SplitPane className={styles.main} size={264} layout={sidebarOpenness}>\n <Pane className={styles.sidebar}>{sidebar}</Pane>\n <HoverSplitter className={styles.splitter}>\n <Collapser\n isOpen={isSidebarOpen}\n onMouseDown={(e) => e.stopPropagation()} // avoid split-pane drag\n onClick={handleSidebarToggle}\n tooltipContent={`${isSidebarOpen ? 'Hide' : 'Show'} side panel`}\n />\n </HoverSplitter>\n <Pane>\n <SlotRouter slot={routeSlot}>\n <Route index element={<WorkspaceOverview />} />\n </SlotRouter>\n </Pane>\n </SplitPane>\n </div>\n </WorkspaceProvider>\n );\n}\nfunction useComponentNotifications() {\n const notifications = useNotifications();\n\n // memo not really needed, but for peace of mind\n return useMemo(\n () => ({\n onComponentAdded: (comps: ComponentModel[]) => {\n const notificationId = notifications.log(\n `added ${pluralize('component', comps.length)}: ${comps.map((comp) => comp.id.toString()).join(', ')}`\n );\n setTimeout(() => notifications.dismiss(notificationId), 12 * 1000);\n },\n\n onComponentRemoved: (ids: ComponentID[]) => {\n const notificationId = notifications.log(\n `removed ${pluralize('component', ids.length)} ${ids.map((id) => id.toString()).join(', ')}`\n );\n setTimeout(() => notifications.dismiss(notificationId), 12 * 1000);\n },\n }),\n [notifications]\n );\n}\n"],"mappings":";;;;;;;;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA6C;AAAA;AAW7C;AAC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AC,CAAC,EACF,CAACL,aAAa,CAAC,CAChB;AACH"}
package/dist/use.cmd.js CHANGED
@@ -1,36 +1,26 @@
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
  require("core-js/modules/es.promise.js");
8
-
9
6
  Object.defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
9
  exports.UseCmd = void 0;
13
-
14
10
  function _defineProperty2() {
15
11
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
-
17
12
  _defineProperty2 = function () {
18
13
  return data;
19
14
  };
20
-
21
15
  return data;
22
16
  }
23
-
24
17
  function _chalk() {
25
18
  const data = _interopRequireDefault(require("chalk"));
26
-
27
19
  _chalk = function () {
28
20
  return data;
29
21
  };
30
-
31
22
  return data;
32
23
  }
33
-
34
24
  class UseCmd {
35
25
  constructor(workspace) {
36
26
  this.workspace = workspace;
@@ -47,14 +37,11 @@ class UseCmd {
47
37
  (0, _defineProperty2().default)(this, "migration", true);
48
38
  (0, _defineProperty2().default)(this, "remoteOp", true);
49
39
  }
50
-
51
40
  async report([id]) {
52
41
  const aspectIdAdded = await this.workspace.use(id);
53
42
  return _chalk().default.green(`aspect "${aspectIdAdded}" has been saved into the workspace.jsonc file.`);
54
43
  }
55
-
56
44
  }
57
-
58
45
  exports.UseCmd = UseCmd;
59
46
 
60
47
  //# sourceMappingURL=use.cmd.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UseCmd","constructor","workspace","name","description","report","id","aspectIdAdded","use","chalk","green"],"sources":["use.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { Workspace } from './workspace';\n\nexport class UseCmd implements Command {\n name = 'use <component-id>';\n group = 'collaborate';\n description = 'set aspects in the workspace/scope config to make them loadable by the workspace/scope';\n arguments = [{ name: 'component-id', description: 'the component ID of the aspect' }];\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n migration = true;\n remoteOp = true;\n\n constructor(private workspace: Workspace) {}\n\n async report([id]: [string]): Promise<any> {\n const aspectIdAdded = await this.workspace.use(id);\n return chalk.green(`aspect \"${aspectIdAdded}\" has been saved into the workspace.jsonc file.`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,MAAN,CAAgC;EAWrCC,WAAW,CAASC,SAAT,EAA+B;IAAA,KAAtBA,SAAsB,GAAtBA,SAAsB;IAAA,8CAVnC,oBAUmC;IAAA,+CATlC,aASkC;IAAA,qDAR5B,wFAQ4B;IAAA,mDAP9B,CAAC;MAAEC,IAAI,EAAE,cAAR;MAAwBC,WAAW,EAAE;IAArC,CAAD,CAO8B;IAAA,+CANlC,EAMkC;IAAA,iDALhC,EAKgC;IAAA,gDAJjC,IAIiC;IAAA,mDAH9B,IAG8B;IAAA,kDAF/B,IAE+B;EAAE;;EAEhC,MAANC,MAAM,CAAC,CAACC,EAAD,CAAD,EAA+B;IACzC,MAAMC,aAAa,GAAG,MAAM,KAAKL,SAAL,CAAeM,GAAf,CAAmBF,EAAnB,CAA5B;IACA,OAAOG,gBAAA,CAAMC,KAAN,CAAa,WAAUH,aAAc,iDAArC,CAAP;EACD;;AAhBoC"}
1
+ {"version":3,"names":["UseCmd","constructor","workspace","name","description","report","id","aspectIdAdded","use","chalk","green"],"sources":["use.cmd.ts"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { Workspace } from './workspace';\n\nexport class UseCmd implements Command {\n name = 'use <component-id>';\n group = 'collaborate';\n description = 'set aspects in the workspace/scope config to make them loadable by the workspace/scope';\n arguments = [{ name: 'component-id', description: 'the component ID of the aspect' }];\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n migration = true;\n remoteOp = true;\n\n constructor(private workspace: Workspace) {}\n\n async report([id]: [string]): Promise<any> {\n const aspectIdAdded = await this.workspace.use(id);\n return chalk.green(`aspect \"${aspectIdAdded}\" has been saved into the workspace.jsonc file.`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,MAAM,CAAoB;EAWrCC,WAAW,CAASC,SAAoB,EAAE;IAAA,KAAtBA,SAAoB,GAApBA,SAAoB;IAAA,8CAVjC,oBAAoB;IAAA,+CACnB,aAAa;IAAA,qDACP,wFAAwF;IAAA,mDAC1F,CAAC;MAAEC,IAAI,EAAE,cAAc;MAAEC,WAAW,EAAE;IAAiC,CAAC,CAAC;IAAA,+CAC7E,EAAE;IAAA,iDACA,EAAE;IAAA,gDACH,IAAI;IAAA,mDACD,IAAI;IAAA,kDACL,IAAI;EAE4B;EAE3C,MAAMC,MAAM,CAAC,CAACC,EAAE,CAAW,EAAgB;IACzC,MAAMC,aAAa,GAAG,MAAM,IAAI,CAACL,SAAS,CAACM,GAAG,CAACF,EAAE,CAAC;IAClD,OAAOG,gBAAK,CAACC,KAAK,CAAE,WAAUH,aAAc,iDAAgD,CAAC;EAC/F;AACF;AAAC"}
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.CheckTypes = void 0;
7
7
  let CheckTypes;
8
8
  exports.CheckTypes = CheckTypes;
9
-
10
9
  (function (CheckTypes) {
11
10
  CheckTypes[CheckTypes["None"] = 0] = "None";
12
11
  CheckTypes[CheckTypes["EntireProject"] = 1] = "EntireProject";
@@ -1 +1 @@
1
- {"version":3,"names":["CheckTypes"],"sources":["check-types.ts"],"sourcesContent":["export enum CheckTypes {\n None, // keep this. it equals zero. this way we can do \"if checkTypes() ... \"\n EntireProject,\n ChangedFile,\n}\n"],"mappings":";;;;;;IAAYA,U;;;WAAAA,U;EAAAA,U,CAAAA,U;EAAAA,U,CAAAA,U;EAAAA,U,CAAAA,U;GAAAA,U,0BAAAA,U"}
1
+ {"version":3,"names":["CheckTypes"],"sources":["check-types.ts"],"sourcesContent":["export enum CheckTypes {\n None, // keep this. it equals zero. this way we can do \"if checkTypes() ... \"\n EntireProject,\n ChangedFile,\n}\n"],"mappings":";;;;;;IAAYA,UAAU;AAAA;AAAA,WAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;AAAA,GAAVA,UAAU,0BAAVA,UAAU"}