@teambit/workspace 1.0.482 → 1.0.483
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_workspace_workspace-preview.js +1 -1
- package/artifacts/schema.json +13 -13
- package/dist/{preview-1733069682179.js → preview-1733196057323.js} +2 -2
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +13 -0
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/workspace/workspace-menu.d.ts +2 -0
- package/dist/ui/workspace/workspace-menu.js +47 -0
- package/dist/ui/workspace/workspace-menu.js.map +1 -0
- package/dist/ui/workspace/workspace-overview/workspace-overview.d.ts +2 -1
- package/dist/ui/workspace/workspace-overview/workspace-overview.js +17 -4
- package/dist/ui/workspace/workspace-overview/workspace-overview.js.map +1 -1
- package/dist/ui/workspace/workspace.js +20 -3
- package/dist/ui/workspace/workspace.js.map +1 -1
- package/dist/ui/workspace/workspace.module.scss +8 -0
- package/dist/workspace.ui.runtime.js +1 -8
- package/dist/workspace.ui.runtime.js.map +1 -1
- package/package.json +29 -27
- package/ui/index.ts +1 -0
- package/ui/workspace/workspace-menu.tsx +16 -0
- package/ui/workspace/workspace-overview/workspace-overview.tsx +7 -2
- package/ui/workspace/workspace.module.scss +8 -0
- package/ui/workspace/workspace.tsx +37 -31
- package/workspace.ui.runtime.tsx +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="0" failures="0" errors="0" skipped="0">
|
|
3
|
-
<testsuite name="teambit.workspace/workspace@1.0.
|
|
3
|
+
<testsuite name="teambit.workspace/workspace@1.0.483" tests="0" failures="0" errors="0" skipped="0"/>
|
|
4
4
|
</testsuites>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see teambit_workspace_workspace-preview.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.workspace/workspace-preview"]=t():e["teambit.workspace/workspace-preview"]=t()}(self,(()=>(()=>{var e={8443:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var i=r.apply(null,n);i&&e.push(i)}else if("object"===a)for(var s in n)o.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},9685:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},8552:()=>{!function(){if("undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof HTMLElement){var e=!1;try{var t=document.createElement("div");t.addEventListener("focus",(function(e){e.preventDefault(),e.stopPropagation()}),!0),t.focus(Object.defineProperty({},"preventScroll",{get:function(){e=!0}}))}catch(e){}void 0!==HTMLElement.prototype.nativeFocus||e||(HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus,HTMLElement.prototype.focus=function(e){var t=window.scrollY||window.pageYOffset;this.nativeFocus(),e&&e.preventScroll&&setTimeout((function(){window.scroll(window.scrollX||window.pageXOffset,t)}),0)})}}()},1486:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNavigator=t.isBrowser=t.off=t.on=t.noop=void 0,t.noop=function(){},t.on=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)},t.off=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)},t.isBrowser="undefined"!=typeof window,t.isNavigator="undefined"!=typeof navigator},7364:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1594);t.default=function(e){o.useEffect(e,[])}},7654:(e,t,n)=>{"use strict";var o=n(1594),r=n(1486),a=r.isBrowser?window:null,i=function(e){return!!e.addEventListener},s=function(e){return!!e.on};t.A=function(e,t,n,c){void 0===n&&(n=a),o.useEffect((function(){if(t&&n)return i(n)?r.on(n,e,t,c):s(n)&&n.on(e,t,c),function(){i(n)?r.off(n,e,t,c):s(n)&&n.off(e,t,c)}}),[e,t,n,JSON.stringify(c)])}},2818:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(7046),r=n(1594),a=o.__importDefault(n(7542));t.default=function(e){var t=r.useRef(0),n=r.useState(e),o=n[0],i=n[1],s=r.useCallback((function(e){cancelAnimationFrame(t.current),t.current=requestAnimationFrame((function(){i(e)}))}),[]);return a.default((function(){cancelAnimationFrame(t.current)})),[o,s]}},7542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(7046),r=n(1594),a=o.__importDefault(n(7364));t.default=function(e){var t=r.useRef(e);t.current=e,a.default((function(){return function(){return t.current()}}))}},9801:(e,t,n)=>{"use strict";var o=n(7046),r=n(1594),a=o.__importDefault(n(2818)),i=n(1486);t.A=function(e,t){void 0===e&&(e=1/0),void 0===t&&(t=1/0);var n=a.default({width:i.isBrowser?window.innerWidth:e,height:i.isBrowser?window.innerHeight:t}),o=n[0],s=n[1];return r.useEffect((function(){if(i.isBrowser){var e=function(){s({width:window.innerWidth,height:window.innerHeight})};return i.on(window,"resize",e),function(){i.off(window,"resize",e)}}}),[]),o}},8888:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseImage=void 0;const a=r(n(1594)),i=r(n(8443)),s=r(n(4749));function c(e){var{alt:t,className:n,fullWidth:r}=e,c=o(e,["alt","className","fullWidth"]);return a.default.createElement("img",Object.assign({"data-bit-id":"teambit.base-ui/elements/image",alt:t},c,{className:i.default(s.default.image,r&&s.default.fullWidth,n)}))}c.__bit_component={id:"teambit.base-ui/elements/image@1.0.0",homepage:"https://bit.dev/teambit/base-ui/elements/image",exported:!0},t.BaseImage=c},4437:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(8888),t)},6614:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Image:()=>y});var o=n(1594),r=n.n(o),a=n(9685),i=n.n(a);n(8552);const s=ReactDom;var c=n(7654),l=n(9801),p=n(7046),u=function(e){return e+"ms"},d={getBoundingClientRect:function(){return{height:0,left:0,top:0,width:0}},style:{transform:null}},m=(0,o.memo)((function(e){var t=e.children,n=e.closeText,a=void 0===n?"Unzoom Image":n,i=e.onUnload,m=e.onLoad,f=e.overlayBgColorEnd,h=void 0===f?"rgba(255, 255, 255, 0.95)":f,y=e.overlayBgColorStart,v=void 0===y?"rgba(255, 255, 255, 0)":y,g=e.parentRef,w=e.portalEl,b=void 0===w?document.body:w,_=e.scrollableEl,x=void 0===_?window:_,O=e.transitionDuration,k=void 0===O?300:O,j=e.zoomMargin,N=void 0===j?0:j,P=e.zoomZindex,S=void 0===P?2147483647:P,E=(0,o.useRef)(null),C=(0,o.useState)(0)[1],T=(0,o.useState)(!1),I=T[0],M=T[1],D=(0,o.useState)(!1),z=D[0],B=D[1],A=(0,l.A)(),R=A.width,L=A.height,W=(0,o.useCallback)((function(e){e.preventDefault(),B(!0)}),[]),F=(0,o.useCallback)((function(e){"Escape"!==e.key&&27!==e.keyCode||(e.stopPropagation(),B(!0))}),[]),H=(0,o.useCallback)((function(){C((function(e){return e+1})),z||B(!0)}),[z]);(0,c.A)("keydown",F,document),(0,c.A)("scroll",H,x),(0,o.useEffect)((function(){M(!0),m(),E.current&&E.current.focus({preventScroll:!0})}),[m]),(0,o.useEffect)((function(){var e=z?setTimeout(i,k):null;return function(){e&&clearTimeout(e)}}),[z,i,k]);var U=g.current||d,X=U.getBoundingClientRect(),Y=X.height,G=X.left,Z=X.top,$=X.width,q=function(e){var t=e.isLoaded,n=e.isUnloading,o=e.overlayBgColorEnd,r=e.zoomZindex,a={backgroundColor:e.overlayBgColorStart,transitionDuration:u(e.transitionDuration),zIndex:r};return t&&!n&&(a.backgroundColor=o),a}({isLoaded:I,isUnloading:z,overlayBgColorEnd:h,overlayBgColorStart:v,transitionDuration:k,zoomZindex:S}),K=function(e){var t=e.height,n=e.innerHeight,o=e.innerWidth,r=e.isLoaded,a=e.isUnloading,i=e.left,s=e.originalTransform,c=e.top,l=e.transitionDuration,d=e.width,m=e.zoomMargin,f=u(l);if(!r||a){var h=(0,p.__spreadArrays)(["scale(1)","translate(0, 0)"],s?[s]:[]).join(" ");return{height:t,left:i,top:c,transform:h,WebkitTransform:h,transitionDuration:f,width:d}}var y=function(e){var t=e.zoomMargin,n=e.innerWidth/(e.width+t),o=e.innerHeight/(e.height+t);return Math.min(n,o)}({height:t,innerWidth:o,innerHeight:n,width:d,zoomMargin:m}),v=(o/2-(i+d/2))/y,g=(n/2-(c+t/2))/y,w=(0,p.__spreadArrays)(["scale("+y+")","translate("+v+"px, "+g+"px)"],s?[s]:[]).join(" ");return{height:t,left:i,top:c,transform:w,WebkitTransform:w,transitionDuration:f,width:d}}({height:Y,isLoaded:I,innerHeight:L,innerWidth:R,isUnloading:z,left:G,originalTransform:U.style.transform,top:Z,transitionDuration:k,width:$,zoomMargin:N});return(0,s.createPortal)(r().createElement("div",{"aria-modal":!0,"data-rmiz-overlay":!0,role:"dialog",style:q},r().createElement("div",{"data-rmiz-modal-content":!0,style:K},t),r().createElement("button",{"aria-label":a,"data-rmiz-btn-close":!0,onClick:W,ref:E})),b)}));const f=(0,o.memo)((function(e){var t=e.children,n=e.closeText,a=void 0===n?"Unzoom image":n,i=e.overlayBgColorEnd,s=void 0===i?"rgba(255, 255, 255, 0.95)":i,c=e.overlayBgColorStart,l=void 0===c?"rgba(255, 255, 255, 0)":c,p=e.portalEl,u=e.openText,d=void 0===u?"Zoom image":u,f=e.scrollableEl,h=e.transitionDuration,y=void 0===h?300:h,v=e.wrapElement,g=void 0===v?"div":v,w=e.wrapStyle,b=e.zoomMargin,_=void 0===b?0:b,x=e.zoomZindex,O=void 0===x?2147483647:x,k=(0,o.useState)(!1),j=k[0],N=k[1],P=(0,o.useState)(!1),S=P[0],E=P[1],C=(0,o.useRef)(null),T=(0,o.useRef)(null),I=(0,o.useCallback)((function(e){j||(e.preventDefault(),N(!0))}),[j]),M=(0,o.useCallback)((function(){E(!0)}),[]),D=(0,o.useCallback)((function(){N(!1),E(!1),T.current&&T.current.focus({preventScroll:!0})}),[]),z=j&&S?"hidden":"visible";return r().createElement(o.StrictMode,null,r().createElement(g,{"data-rmiz-wrap":z,ref:C,style:w},t,r().createElement("button",{"aria-label":d,"data-rmiz-btn-open":!0,onClick:I,ref:T}),"undefined"!=typeof window&&j&&r().createElement(m,{closeText:a,onLoad:M,onUnload:D,overlayBgColorEnd:s,overlayBgColorStart:l,parentRef:C,portalEl:p,scrollableEl:f,transitionDuration:y,zoomMargin:_,zoomZindex:O},t)))}));var h=n(4437);const y=e=>{var{center:t=!0,width:n,alt:o,src:a,className:s}=e,c=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["center","width","alt","src","className"]);return r().createElement("div",{style:{width:n||"100%"},className:i()(t&&"image_center__6-xCb",s)},r().createElement(f,null,r().createElement(h.BaseImage,Object.assign({fullWidth:!0,alt:o,src:a},c))))};y.__bit_component={id:"teambit.docs/ui/zoomable-image@1.95.0",homepage:"https://bit.dev/teambit/docs/ui/zoomable-image",exported:!0}},1593:(e,t,n)=>{"use strict";Object.defineProperty(t,"Ay",{enumerable:!0,get:function(){return o.default}});var o=r(n(6475));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.workspace/content/workspace-overview@1.95.0",homepage:"https://bit.dev/teambit/workspace/content/workspace-overview",exported:!0}},6475:(e,t,n)=>{"use strict";var o={id:"teambit.workspace/content/workspace-overview@1.95.0",homepage:"https://bit.dev/teambit/workspace/content/workspace-overview",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=v,u(n(1594));var r=n(5016),a=n(5682),i=n(6614),s=u(n(8800)),c=u(n(176)),l=u(n(6903)),p=["components"];function u(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(this,arguments)}function m(e,t){if(null==e)return{};var n,o,r=f(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}u.__bit_component=o,d.__bit_component=o,m.__bit_component=o,f.__bit_component=o;var h={},y="wrapper";function v(e){var t=e.components,n=m(e,p);return(0,r.mdx)(y,d({},h,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{Image:i.Image,wsScreenshot:s.default,looseComponents:c.default,multiRepo:l.default},mdxType:"MDXScopeProvider"},(0,r.mdx)("h1",null,"Workspace Overview"),(0,r.mdx)("p",null,"You can use the Bit workspace to either create, use or import components, make changes to them, and export these changes back.\nWorkspaces are tech-agnonstic and allow development of components of all kinds. They can be used by a single developer maintaining few components, exist on top of\nexisting repositories or shared as a Workspace component."),(0,r.mdx)(i.Image,{src:c.default,width:"85%",mdxType:"Image"}),(0,r.mdx)("p",null,"Get started and generate a demo workspace:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"bit new react demo\n")),(0,r.mdx)("h2",null,"Component development server"),(0,r.mdx)("p",null,"All components in your workspace are rendered and presented on a local development server. To start it, run the following command:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-sh"},"bit start\n")),(0,r.mdx)(i.Image,{src:s.default,width:"80%",mdxType:"Image"}),(0,r.mdx)("h2",null,"Simple, scalable dev experience"),(0,r.mdx)("p",null,"Keeping a similar dev-experience across workspaces allows you to jump in and out from codebases. When you don't need to deal with a per-project setup or learn the workflow commands/scripts you simply focus on the code."),(0,r.mdx)("p",null,"Simple dev experience means you can ",(0,r.mdx)("strong",{parentName:"p"},"easily onboard")," yourself to a workspace, thanks to:"),(0,r.mdx)("ul",null,(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("strong",{parentName:"li"},"Use the same commands")," - Regardless of the tooling and configs used in a workspace, you use the same commands (",(0,r.mdx)("inlineCode",{parentName:"li"},"compile"),", ",(0,r.mdx)("inlineCode",{parentName:"li"},"test"),", etc) and get similarly structured outputs."),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("strong",{parentName:"li"},"Minimal configuration")," - Most of the configuration and setup is automated. No need to define per-component dependencies and no additional files needed to change a component's build pipeline."),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("strong",{parentName:"li"},"Templates and standards")," - Create new components with templates and apply your formatting, linting, compilation and testing standards with a single policy."),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("strong",{parentName:"li"},"Components are directories")," - Each ",(0,r.mdx)("a",{parentName:"li",href:"docs/workspace/component-directory"},"component in your workspace is a directory")," so relevant files, assets and tests available in a single place.")),(0,r.mdx)("p",null,"This makes it easy to scale the amount of components in a workspace, scale the amount of workspaces and even scale the amount of developers!"),(0,r.mdx)("h2",null,"Composition of components"),(0,r.mdx)("p",null,'The workspace is a container for the components. You get a monolithic-like developer experience and ability to refactor many components in a single place. In this "container" a component manages its own implementation, history and config (',(0,r.mdx)("a",{parentName:"p",href:"/docs/components/component-overview"},"read more"),").",(0,r.mdx)("br",{parentName:"p"}),"\n","This allows you to be flexible with how you structure a workspace and its contents. For example, you can ",(0,r.mdx)("a",{parentName:"p",href:"/docs/components/importing-components"},"import a component"),":"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"bit import teambit.community/ui/graph/bubble-graph\n")),(0,r.mdx)("p",null,"Bit adds the new component to the list of components in the workspace, pulls down the complete revision history, configs and dependencies. Now you can do local modifications, see the component when running ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit start"),", and maintain it as if you implemented it in your own workspace."),(0,r.mdx)("p",null,"In the same sense you can ",(0,r.mdx)("inlineCode",{parentName:"p"},"export")," and even ",(0,r.mdx)("inlineCode",{parentName:"p"},"eject")," any of your components from a workspace, and more it to another one. So if you started with building all components in the same place, you are not locked to that decision."),(0,r.mdx)(i.Image,{src:l.default,width:"85%",mdxType:"Image"}),(0,r.mdx)("h3",null,"Personalize your workspace"),(0,r.mdx)("p",null,"With composability in mind you can personalize your workspace on a per-feature basis or on the work you are currently focus on. You can start your flow by using ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit import")," and fetch all required components, starting to modify and work on them as needed.",(0,r.mdx)("br",{parentName:"p"}),"\n","When done, you can version and eject unneeded components. Instead of you working in the boundaries of your workspace, have the workspace fit to your current work."),(0,r.mdx)("h2",null,"Configuration-less"),(0,r.mdx)("p",null,"Regardless of the amount of components you have in your workspace, and how different they may be in their configuration, it only requires two files to manage components."),(0,r.mdx)("ul",null,(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("inlineCode",{parentName:"li"},"workspace.jsonc")," - Contains the configuration policy for all components in the workspace."),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("inlineCode",{parentName:"li"},".bitmap")," - Maps Bit components to their corresponding location (dir) in the workspace.")),(0,r.mdx)("p",null,"With both these files you track where each component is located and can apply configuration from a centralized location according to various ",(0,r.mdx)("a",{parentName:"p",href:"/docs/workspace/variants"},(0,r.mdx)("inlineCode",{parentName:"a"},"variant"))," rules. The workspace then calculates the configuration to apply on a per-component basis."),(0,r.mdx)("p",null,"The end result is a clean workspace where you have a minimal amount of configuration files, no matter how many components you have and their variants."),(0,r.mdx)("h2",null,"Any dev environment, any framework"),(0,r.mdx)("p",null,"Angular modules, React components, Node modules or any other type of components you might need are rendered with the same ",(0,r.mdx)("a",{parentName:"p",href:"docs/workspace/workspace-ui"},"workspace UI"),", compiled by the same ",(0,r.mdx)("inlineCode",{parentName:"p"},"compile")," command, etc.",(0,r.mdx)("br",{parentName:"p"}),"\n","You can maintain components of different types and frameworks in a Bit workspace, as each component has it's own configured ",(0,r.mdx)("a",{parentName:"p",href:"/docs/envs/envs-overview"},"Component Development Environment"),", which the workspace use to run various workflows."),(0,r.mdx)("h2",null,"Components in the workspace"),(0,r.mdx)("p",null,"A Bit Workspace manages many components. It aims to create symmetry between component naming and the directory structure."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-sh"},"├── cart\n│ ├── purchase-summary\n│ └── shopping-cart\n└── design\n ├── ui\n │ ├── button\n │ └── card // for example, the corresponding component ID: my-org.design/ui/button\n └── theme\n ├── color-pallet\n └── theme-context\n")),(0,r.mdx)("div",{className:"admonition admonition-tip alert alert--success"},(0,r.mdx)("div",{parentName:"div",className:"admonition-heading"},(0,r.mdx)("h5",{parentName:"div"},(0,r.mdx)("span",{parentName:"h5",className:"admonition-icon"},(0,r.mdx)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,r.mdx)("path",{parentName:"svg",fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))),"The structure is not rigid. You can sort components however you see fit.")),(0,r.mdx)("div",{parentName:"div",className:"admonition-content"})),(0,r.mdx)("p",null,"For each component Bit generates a link in the root ",(0,r.mdx)("inlineCode",{parentName:"p"},"node_modules")," directory according to the component ID. It contains the compiled output of a component."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"└── node_modules\n └── @my-org\n └── my-scope.ui.card\n")),(0,r.mdx)("p",null,"Use these modules when consuming one component in another, even in the same workspace."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-jsx"},"import { Card } from '@my-org/my-scope.ui.card';\n")),(0,r.mdx)("div",{className:"admonition admonition-info alert alert--info"},(0,r.mdx)("div",{parentName:"div",className:"admonition-heading"},(0,r.mdx)("h5",{parentName:"div"},(0,r.mdx)("span",{parentName:"h5",className:"admonition-icon"},(0,r.mdx)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,r.mdx)("path",{parentName:"svg",fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))),"Absolute import statements decouple a component from the project's file structure.")),(0,r.mdx)("div",{parentName:"div",className:"admonition-content"})),(0,r.mdx)("h2",null,"Dependency Policy"),(0,r.mdx)("p",null,"The workspace dependency policy defines how external dependencies are installed and in which version. You may apply complex setups to have multiple versions of a dependency installed to fit different components. It allows you to determine where you want to adopt to a new version and which components should still use past versions."),(0,r.mdx)("p",null,"In your workspace you also have a ",(0,r.mdx)("a",{parentName:"p",href:"/docs/dependencies/dependencies-overview"},"dependency resolver")," that uses the policy to determine the type of dependency on a per-component basis.",(0,r.mdx)("br",{parentName:"p"}),"\n","Types of dependencies, like ",(0,r.mdx)("inlineCode",{parentName:"p"},"dependency")," and ",(0,r.mdx)("inlineCode",{parentName:"p"},"devDependency")," are contextual for each component. Meaning that according to where a component ",(0,r.mdx)("inlineCode",{parentName:"p"},"import"),"s a dependency, it will be set with the corresponding type. For example, a dependency only used in a test file will set as a ",(0,r.mdx)("inlineCode",{parentName:"p"},"devDependency")," for that specific component."),(0,r.mdx)("h2",null,"Performance"),(0,r.mdx)("p",null,"Bit workspace is optimized for quick and snappy feedback loop on code changes. It leaves the tough work of ensuring de-coupling and isolation to a more robust CI flow."),(0,r.mdx)("p",null,"To optimize performance even further any time you change a component Bit find which components are affected by the change. Bit then build your modified components and their affected dependents."),(0,r.mdx)("h2",null,"Integrate to existing codebases"),(0,r.mdx)("p",null,"Bit is a build tool that allows you to manage independent components. You may create a Bit workspace in a fresh directory or initialize one as part of an existing repository.",(0,r.mdx)("br",{parentName:"p"}),"\n","You can get started working on independent components alongside projects built with ",(0,r.mdx)("a",{parentName:"p",href:"https://angular.io/tutorial/toh-pt0"},"Angular"),", ",(0,r.mdx)("a",{parentName:"p",href:"https://create-react-app.dev"},"CRA")," and even ",(0,r.mdx)("a",{parentName:"p",href:"https://lerna.js.org"},"Lerna"),"."),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"cd")," to a pre-existing repository and run:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"bit init\n")),(0,r.mdx)("p",null,"From here you may use any Bit command and flow to build independent components and integrate them into your application.")))}v.__bit_component=o,v.isMDXComponent=!0},232:(e,t,n)=>{"use strict";var o={id:"teambit.workspace/workspace@1.0.482",homepage:"https://bit.cloud/teambit/workspace/workspace",exported:!0};function r(){const e=a(n(1594));return r=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=o,a.__bit_component=o;const i=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/workspace.svg"}));i.__bit_component=o,t.Logo=i},4749:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={fullWidth:"image_fullWidth__sELLz"}},176:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/b40d450de296e275550f.png"},6903:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/2f046646df38433e90d7.png"},8800:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/cb67fb802479e2710016.png"},5016:e=>{"use strict";e.exports=MdxJsReact},1594:e=>{"use strict";e.exports=React},5682:e=>{"use strict";e.exports=TeambitMdxUiMdxScopeContext},7046:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>z,__assign:()=>a,__asyncDelegator:()=>j,__asyncGenerator:()=>k,__asyncValues:()=>N,__await:()=>O,__awaiter:()=>f,__classPrivateFieldGet:()=>I,__classPrivateFieldIn:()=>D,__classPrivateFieldSet:()=>M,__createBinding:()=>y,__decorate:()=>s,__disposeResources:()=>A,__esDecorate:()=>l,__exportStar:()=>v,__extends:()=>r,__generator:()=>h,__importDefault:()=>T,__importStar:()=>C,__makeTemplateObject:()=>P,__metadata:()=>m,__param:()=>c,__propKey:()=>u,__read:()=>w,__rest:()=>i,__rewriteRelativeImportExtension:()=>R,__runInitializers:()=>p,__setFunctionName:()=>d,__spread:()=>b,__spreadArray:()=>x,__spreadArrays:()=>_,__values:()=>g,default:()=>L});var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function s(e,t,n,o){var r,a=arguments.length,i=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(i=(a<3?r(i):a>3?r(t,n,i):r(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i}function c(e,t){return function(n,o){t(n,o,e)}}function l(e,t,n,o,r,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=o.kind,l="getter"===c?"get":"setter"===c?"set":"value",p=!t&&e?o.static?e:e.prototype:null,u=t||(p?Object.getOwnPropertyDescriptor(p,o.name):{}),d=!1,m=n.length-1;m>=0;m--){var f={};for(var h in o)f[h]="access"===h?{}:o[h];for(var h in o.access)f.access[h]=o.access[h];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var y=(0,n[m])("accessor"===c?{get:u.get,set:u.set}:u[l],f);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&r.unshift(s)}else(s=i(y))&&("field"===c?r.unshift(s):u[l]=s)}p&&Object.defineProperty(p,o.name,u),d=!0}function p(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0}function u(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function m(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{c(o.next(e))}catch(e){a(e)}}function s(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}c((o=o.apply(e,t||[])).next())}))}function h(e,t){var n,o,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var y=Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]};function v(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||y(t,e,n)}function g(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e}function _(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,r++)o[r]=a[i];return o}function x(e,t,n){if(n||2===arguments.length)for(var o,r=0,a=t.length;r<a;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function O(e){return this instanceof O?(this.v=e,this):new O(e)}function k(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),a=[];return o=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),i("next"),i("throw"),i("return",(function(e){return function(t){return Promise.resolve(t).then(e,l)}})),o[Symbol.asyncIterator]=function(){return this},o;function i(e,t){r[e]&&(o[e]=function(t){return new Promise((function(n,o){a.push([e,t,n,o])>1||s(e,t)}))},t&&(o[e]=t(o[e])))}function s(e,t){try{(n=r[e](t)).value instanceof O?Promise.resolve(n.value.v).then(c,l):p(a[0][2],n)}catch(e){p(a[0][3],e)}var n}function c(e){s("next",e)}function l(e){s("throw",e)}function p(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function j(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:O(e[o](t)),done:!1}:r?r(t):t}:r}}function N(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=g(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){!function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)}(o,r,(t=e[n](t)).done,t.value)}))}}}function P(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var S=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},E=function(e){return E=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},E(e)};function C(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=E(e),o=0;o<n.length;o++)"default"!==n[o]&&y(t,e,n[o]);return S(t,e),t}function T(e){return e&&e.__esModule?e:{default:e}}function I(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function M(e,t,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,n):r?r.value=n:t.set(e,n),n}function D(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function z(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var o,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=t[Symbol.asyncDispose]}if(void 0===o){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=t[Symbol.dispose],n&&(r=o)}if("function"!=typeof o)throw new TypeError("Object not disposable.");r&&(o=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:o,async:n})}else n&&e.stack.push({async:!0});return t}var B="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var o=new Error(n);return o.name="SuppressedError",o.error=e,o.suppressed=t,o};function A(e){function t(t){e.error=e.hasError?new B(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var n,o=0;return function r(){for(;n=e.stack.pop();)try{if(!n.async&&1===o)return o=0,e.stack.push(n),Promise.resolve().then(r);if(n.dispose){var a=n.dispose.call(n.value);if(n.async)return o|=2,Promise.resolve(a).then(r,(function(e){return t(e),r()}))}else o|=1}catch(e){t(e)}if(1===o)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function R(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(e,n,o,r,a){return n?t?".jsx":".js":!o||r&&a?o+r+"."+a.toLowerCase()+"js":e})):e}const L={__extends:r,__assign:a,__rest:i,__decorate:s,__param:c,__esDecorate:l,__runInitializers:p,__propKey:u,__setFunctionName:d,__metadata:m,__awaiter:f,__generator:h,__createBinding:y,__exportStar:v,__values:g,__read:w,__spread:b,__spreadArrays:_,__spreadArray:x,__await:O,__asyncGenerator:k,__asyncDelegator:j,__asyncValues:N,__makeTemplateObject:P,__importStar:C,__importDefault:T,__classPrivateFieldGet:I,__classPrivateFieldSet:M,__classPrivateFieldIn:D,__addDisposableResource:z,__disposeResources:A,__rewriteRelativeImportExtension:R}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var r=o.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=o[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var o={};return(()=>{"use strict";n.r(o),n.d(o,{compositions:()=>d,compositions_metadata:()=>f,overview:()=>m});var e={};n.r(e),n.d(e,{default:()=>u});var t=n(232),r=(n(1594),n(5016)),a=n(5682),i=n(1593),s=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c.apply(null,arguments)}var l={},p="wrapper";function u(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.includes(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,s);return(0,r.mdx)(p,c({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{WorkspaceOverview:i.Ay},mdxType:"MDXScopeProvider"},(0,r.mdx)(i.Ay,{mdxType:"WorkspaceOverview"})))}u.isMDXComponent=!0;const d=[t],m=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.workspace/workspace-preview"]=t():e["teambit.workspace/workspace-preview"]=t()}(self,(()=>(()=>{var e={8443:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var i=r.apply(null,n);i&&e.push(i)}else if("object"===a)for(var s in n)o.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},9685:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},8552:()=>{!function(){if("undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof HTMLElement){var e=!1;try{var t=document.createElement("div");t.addEventListener("focus",(function(e){e.preventDefault(),e.stopPropagation()}),!0),t.focus(Object.defineProperty({},"preventScroll",{get:function(){e=!0}}))}catch(e){}void 0!==HTMLElement.prototype.nativeFocus||e||(HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus,HTMLElement.prototype.focus=function(e){var t=window.scrollY||window.pageYOffset;this.nativeFocus(),e&&e.preventScroll&&setTimeout((function(){window.scroll(window.scrollX||window.pageXOffset,t)}),0)})}}()},1486:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNavigator=t.isBrowser=t.off=t.on=t.noop=void 0,t.noop=function(){},t.on=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)},t.off=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)},t.isBrowser="undefined"!=typeof window,t.isNavigator="undefined"!=typeof navigator},7364:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1594);t.default=function(e){o.useEffect(e,[])}},7654:(e,t,n)=>{"use strict";var o=n(1594),r=n(1486),a=r.isBrowser?window:null,i=function(e){return!!e.addEventListener},s=function(e){return!!e.on};t.A=function(e,t,n,c){void 0===n&&(n=a),o.useEffect((function(){if(t&&n)return i(n)?r.on(n,e,t,c):s(n)&&n.on(e,t,c),function(){i(n)?r.off(n,e,t,c):s(n)&&n.off(e,t,c)}}),[e,t,n,JSON.stringify(c)])}},2818:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(7046),r=n(1594),a=o.__importDefault(n(7542));t.default=function(e){var t=r.useRef(0),n=r.useState(e),o=n[0],i=n[1],s=r.useCallback((function(e){cancelAnimationFrame(t.current),t.current=requestAnimationFrame((function(){i(e)}))}),[]);return a.default((function(){cancelAnimationFrame(t.current)})),[o,s]}},7542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(7046),r=n(1594),a=o.__importDefault(n(7364));t.default=function(e){var t=r.useRef(e);t.current=e,a.default((function(){return function(){return t.current()}}))}},9801:(e,t,n)=>{"use strict";var o=n(7046),r=n(1594),a=o.__importDefault(n(2818)),i=n(1486);t.A=function(e,t){void 0===e&&(e=1/0),void 0===t&&(t=1/0);var n=a.default({width:i.isBrowser?window.innerWidth:e,height:i.isBrowser?window.innerHeight:t}),o=n[0],s=n[1];return r.useEffect((function(){if(i.isBrowser){var e=function(){s({width:window.innerWidth,height:window.innerHeight})};return i.on(window,"resize",e),function(){i.off(window,"resize",e)}}}),[]),o}},8888:function(e,t,n){"use strict";var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseImage=void 0;const a=r(n(1594)),i=r(n(8443)),s=r(n(4749));function c(e){var{alt:t,className:n,fullWidth:r}=e,c=o(e,["alt","className","fullWidth"]);return a.default.createElement("img",Object.assign({"data-bit-id":"teambit.base-ui/elements/image",alt:t},c,{className:i.default(s.default.image,r&&s.default.fullWidth,n)}))}c.__bit_component={id:"teambit.base-ui/elements/image@1.0.0",homepage:"https://bit.dev/teambit/base-ui/elements/image",exported:!0},t.BaseImage=c},4437:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(8888),t)},6614:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Image:()=>y});var o=n(1594),r=n.n(o),a=n(9685),i=n.n(a);n(8552);const s=ReactDom;var c=n(7654),l=n(9801),p=n(7046),u=function(e){return e+"ms"},d={getBoundingClientRect:function(){return{height:0,left:0,top:0,width:0}},style:{transform:null}},m=(0,o.memo)((function(e){var t=e.children,n=e.closeText,a=void 0===n?"Unzoom Image":n,i=e.onUnload,m=e.onLoad,f=e.overlayBgColorEnd,h=void 0===f?"rgba(255, 255, 255, 0.95)":f,y=e.overlayBgColorStart,v=void 0===y?"rgba(255, 255, 255, 0)":y,g=e.parentRef,w=e.portalEl,b=void 0===w?document.body:w,_=e.scrollableEl,x=void 0===_?window:_,O=e.transitionDuration,k=void 0===O?300:O,j=e.zoomMargin,N=void 0===j?0:j,P=e.zoomZindex,S=void 0===P?2147483647:P,E=(0,o.useRef)(null),C=(0,o.useState)(0)[1],T=(0,o.useState)(!1),I=T[0],M=T[1],D=(0,o.useState)(!1),z=D[0],B=D[1],A=(0,l.A)(),R=A.width,L=A.height,W=(0,o.useCallback)((function(e){e.preventDefault(),B(!0)}),[]),F=(0,o.useCallback)((function(e){"Escape"!==e.key&&27!==e.keyCode||(e.stopPropagation(),B(!0))}),[]),H=(0,o.useCallback)((function(){C((function(e){return e+1})),z||B(!0)}),[z]);(0,c.A)("keydown",F,document),(0,c.A)("scroll",H,x),(0,o.useEffect)((function(){M(!0),m(),E.current&&E.current.focus({preventScroll:!0})}),[m]),(0,o.useEffect)((function(){var e=z?setTimeout(i,k):null;return function(){e&&clearTimeout(e)}}),[z,i,k]);var U=g.current||d,X=U.getBoundingClientRect(),Y=X.height,G=X.left,Z=X.top,$=X.width,q=function(e){var t=e.isLoaded,n=e.isUnloading,o=e.overlayBgColorEnd,r=e.zoomZindex,a={backgroundColor:e.overlayBgColorStart,transitionDuration:u(e.transitionDuration),zIndex:r};return t&&!n&&(a.backgroundColor=o),a}({isLoaded:I,isUnloading:z,overlayBgColorEnd:h,overlayBgColorStart:v,transitionDuration:k,zoomZindex:S}),K=function(e){var t=e.height,n=e.innerHeight,o=e.innerWidth,r=e.isLoaded,a=e.isUnloading,i=e.left,s=e.originalTransform,c=e.top,l=e.transitionDuration,d=e.width,m=e.zoomMargin,f=u(l);if(!r||a){var h=(0,p.__spreadArrays)(["scale(1)","translate(0, 0)"],s?[s]:[]).join(" ");return{height:t,left:i,top:c,transform:h,WebkitTransform:h,transitionDuration:f,width:d}}var y=function(e){var t=e.zoomMargin,n=e.innerWidth/(e.width+t),o=e.innerHeight/(e.height+t);return Math.min(n,o)}({height:t,innerWidth:o,innerHeight:n,width:d,zoomMargin:m}),v=(o/2-(i+d/2))/y,g=(n/2-(c+t/2))/y,w=(0,p.__spreadArrays)(["scale("+y+")","translate("+v+"px, "+g+"px)"],s?[s]:[]).join(" ");return{height:t,left:i,top:c,transform:w,WebkitTransform:w,transitionDuration:f,width:d}}({height:Y,isLoaded:I,innerHeight:L,innerWidth:R,isUnloading:z,left:G,originalTransform:U.style.transform,top:Z,transitionDuration:k,width:$,zoomMargin:N});return(0,s.createPortal)(r().createElement("div",{"aria-modal":!0,"data-rmiz-overlay":!0,role:"dialog",style:q},r().createElement("div",{"data-rmiz-modal-content":!0,style:K},t),r().createElement("button",{"aria-label":a,"data-rmiz-btn-close":!0,onClick:W,ref:E})),b)}));const f=(0,o.memo)((function(e){var t=e.children,n=e.closeText,a=void 0===n?"Unzoom image":n,i=e.overlayBgColorEnd,s=void 0===i?"rgba(255, 255, 255, 0.95)":i,c=e.overlayBgColorStart,l=void 0===c?"rgba(255, 255, 255, 0)":c,p=e.portalEl,u=e.openText,d=void 0===u?"Zoom image":u,f=e.scrollableEl,h=e.transitionDuration,y=void 0===h?300:h,v=e.wrapElement,g=void 0===v?"div":v,w=e.wrapStyle,b=e.zoomMargin,_=void 0===b?0:b,x=e.zoomZindex,O=void 0===x?2147483647:x,k=(0,o.useState)(!1),j=k[0],N=k[1],P=(0,o.useState)(!1),S=P[0],E=P[1],C=(0,o.useRef)(null),T=(0,o.useRef)(null),I=(0,o.useCallback)((function(e){j||(e.preventDefault(),N(!0))}),[j]),M=(0,o.useCallback)((function(){E(!0)}),[]),D=(0,o.useCallback)((function(){N(!1),E(!1),T.current&&T.current.focus({preventScroll:!0})}),[]),z=j&&S?"hidden":"visible";return r().createElement(o.StrictMode,null,r().createElement(g,{"data-rmiz-wrap":z,ref:C,style:w},t,r().createElement("button",{"aria-label":d,"data-rmiz-btn-open":!0,onClick:I,ref:T}),"undefined"!=typeof window&&j&&r().createElement(m,{closeText:a,onLoad:M,onUnload:D,overlayBgColorEnd:s,overlayBgColorStart:l,parentRef:C,portalEl:p,scrollableEl:f,transitionDuration:y,zoomMargin:_,zoomZindex:O},t)))}));var h=n(4437);const y=e=>{var{center:t=!0,width:n,alt:o,src:a,className:s}=e,c=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["center","width","alt","src","className"]);return r().createElement("div",{style:{width:n||"100%"},className:i()(t&&"image_center__6-xCb",s)},r().createElement(f,null,r().createElement(h.BaseImage,Object.assign({fullWidth:!0,alt:o,src:a},c))))};y.__bit_component={id:"teambit.docs/ui/zoomable-image@1.95.0",homepage:"https://bit.dev/teambit/docs/ui/zoomable-image",exported:!0}},1593:(e,t,n)=>{"use strict";Object.defineProperty(t,"Ay",{enumerable:!0,get:function(){return o.default}});var o=r(n(6475));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.workspace/content/workspace-overview@1.95.0",homepage:"https://bit.dev/teambit/workspace/content/workspace-overview",exported:!0}},6475:(e,t,n)=>{"use strict";var o={id:"teambit.workspace/content/workspace-overview@1.95.0",homepage:"https://bit.dev/teambit/workspace/content/workspace-overview",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=v,u(n(1594));var r=n(5016),a=n(5682),i=n(6614),s=u(n(8800)),c=u(n(176)),l=u(n(6903)),p=["components"];function u(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(this,arguments)}function m(e,t){if(null==e)return{};var n,o,r=f(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}u.__bit_component=o,d.__bit_component=o,m.__bit_component=o,f.__bit_component=o;var h={},y="wrapper";function v(e){var t=e.components,n=m(e,p);return(0,r.mdx)(y,d({},h,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{Image:i.Image,wsScreenshot:s.default,looseComponents:c.default,multiRepo:l.default},mdxType:"MDXScopeProvider"},(0,r.mdx)("h1",null,"Workspace Overview"),(0,r.mdx)("p",null,"You can use the Bit workspace to either create, use or import components, make changes to them, and export these changes back.\nWorkspaces are tech-agnonstic and allow development of components of all kinds. They can be used by a single developer maintaining few components, exist on top of\nexisting repositories or shared as a Workspace component."),(0,r.mdx)(i.Image,{src:c.default,width:"85%",mdxType:"Image"}),(0,r.mdx)("p",null,"Get started and generate a demo workspace:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"bit new react demo\n")),(0,r.mdx)("h2",null,"Component development server"),(0,r.mdx)("p",null,"All components in your workspace are rendered and presented on a local development server. To start it, run the following command:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-sh"},"bit start\n")),(0,r.mdx)(i.Image,{src:s.default,width:"80%",mdxType:"Image"}),(0,r.mdx)("h2",null,"Simple, scalable dev experience"),(0,r.mdx)("p",null,"Keeping a similar dev-experience across workspaces allows you to jump in and out from codebases. When you don't need to deal with a per-project setup or learn the workflow commands/scripts you simply focus on the code."),(0,r.mdx)("p",null,"Simple dev experience means you can ",(0,r.mdx)("strong",{parentName:"p"},"easily onboard")," yourself to a workspace, thanks to:"),(0,r.mdx)("ul",null,(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("strong",{parentName:"li"},"Use the same commands")," - Regardless of the tooling and configs used in a workspace, you use the same commands (",(0,r.mdx)("inlineCode",{parentName:"li"},"compile"),", ",(0,r.mdx)("inlineCode",{parentName:"li"},"test"),", etc) and get similarly structured outputs."),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("strong",{parentName:"li"},"Minimal configuration")," - Most of the configuration and setup is automated. No need to define per-component dependencies and no additional files needed to change a component's build pipeline."),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("strong",{parentName:"li"},"Templates and standards")," - Create new components with templates and apply your formatting, linting, compilation and testing standards with a single policy."),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("strong",{parentName:"li"},"Components are directories")," - Each ",(0,r.mdx)("a",{parentName:"li",href:"docs/workspace/component-directory"},"component in your workspace is a directory")," so relevant files, assets and tests available in a single place.")),(0,r.mdx)("p",null,"This makes it easy to scale the amount of components in a workspace, scale the amount of workspaces and even scale the amount of developers!"),(0,r.mdx)("h2",null,"Composition of components"),(0,r.mdx)("p",null,'The workspace is a container for the components. You get a monolithic-like developer experience and ability to refactor many components in a single place. In this "container" a component manages its own implementation, history and config (',(0,r.mdx)("a",{parentName:"p",href:"/docs/components/component-overview"},"read more"),").",(0,r.mdx)("br",{parentName:"p"}),"\n","This allows you to be flexible with how you structure a workspace and its contents. For example, you can ",(0,r.mdx)("a",{parentName:"p",href:"/docs/components/importing-components"},"import a component"),":"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"bit import teambit.community/ui/graph/bubble-graph\n")),(0,r.mdx)("p",null,"Bit adds the new component to the list of components in the workspace, pulls down the complete revision history, configs and dependencies. Now you can do local modifications, see the component when running ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit start"),", and maintain it as if you implemented it in your own workspace."),(0,r.mdx)("p",null,"In the same sense you can ",(0,r.mdx)("inlineCode",{parentName:"p"},"export")," and even ",(0,r.mdx)("inlineCode",{parentName:"p"},"eject")," any of your components from a workspace, and more it to another one. So if you started with building all components in the same place, you are not locked to that decision."),(0,r.mdx)(i.Image,{src:l.default,width:"85%",mdxType:"Image"}),(0,r.mdx)("h3",null,"Personalize your workspace"),(0,r.mdx)("p",null,"With composability in mind you can personalize your workspace on a per-feature basis or on the work you are currently focus on. You can start your flow by using ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit import")," and fetch all required components, starting to modify and work on them as needed.",(0,r.mdx)("br",{parentName:"p"}),"\n","When done, you can version and eject unneeded components. Instead of you working in the boundaries of your workspace, have the workspace fit to your current work."),(0,r.mdx)("h2",null,"Configuration-less"),(0,r.mdx)("p",null,"Regardless of the amount of components you have in your workspace, and how different they may be in their configuration, it only requires two files to manage components."),(0,r.mdx)("ul",null,(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("inlineCode",{parentName:"li"},"workspace.jsonc")," - Contains the configuration policy for all components in the workspace."),(0,r.mdx)("li",{parentName:"ul"},(0,r.mdx)("inlineCode",{parentName:"li"},".bitmap")," - Maps Bit components to their corresponding location (dir) in the workspace.")),(0,r.mdx)("p",null,"With both these files you track where each component is located and can apply configuration from a centralized location according to various ",(0,r.mdx)("a",{parentName:"p",href:"/docs/workspace/variants"},(0,r.mdx)("inlineCode",{parentName:"a"},"variant"))," rules. The workspace then calculates the configuration to apply on a per-component basis."),(0,r.mdx)("p",null,"The end result is a clean workspace where you have a minimal amount of configuration files, no matter how many components you have and their variants."),(0,r.mdx)("h2",null,"Any dev environment, any framework"),(0,r.mdx)("p",null,"Angular modules, React components, Node modules or any other type of components you might need are rendered with the same ",(0,r.mdx)("a",{parentName:"p",href:"docs/workspace/workspace-ui"},"workspace UI"),", compiled by the same ",(0,r.mdx)("inlineCode",{parentName:"p"},"compile")," command, etc.",(0,r.mdx)("br",{parentName:"p"}),"\n","You can maintain components of different types and frameworks in a Bit workspace, as each component has it's own configured ",(0,r.mdx)("a",{parentName:"p",href:"/docs/envs/envs-overview"},"Component Development Environment"),", which the workspace use to run various workflows."),(0,r.mdx)("h2",null,"Components in the workspace"),(0,r.mdx)("p",null,"A Bit Workspace manages many components. It aims to create symmetry between component naming and the directory structure."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-sh"},"├── cart\n│ ├── purchase-summary\n│ └── shopping-cart\n└── design\n ├── ui\n │ ├── button\n │ └── card // for example, the corresponding component ID: my-org.design/ui/button\n └── theme\n ├── color-pallet\n └── theme-context\n")),(0,r.mdx)("div",{className:"admonition admonition-tip alert alert--success"},(0,r.mdx)("div",{parentName:"div",className:"admonition-heading"},(0,r.mdx)("h5",{parentName:"div"},(0,r.mdx)("span",{parentName:"h5",className:"admonition-icon"},(0,r.mdx)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"},(0,r.mdx)("path",{parentName:"svg",fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))),"The structure is not rigid. You can sort components however you see fit.")),(0,r.mdx)("div",{parentName:"div",className:"admonition-content"})),(0,r.mdx)("p",null,"For each component Bit generates a link in the root ",(0,r.mdx)("inlineCode",{parentName:"p"},"node_modules")," directory according to the component ID. It contains the compiled output of a component."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"└── node_modules\n └── @my-org\n └── my-scope.ui.card\n")),(0,r.mdx)("p",null,"Use these modules when consuming one component in another, even in the same workspace."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-jsx"},"import { Card } from '@my-org/my-scope.ui.card';\n")),(0,r.mdx)("div",{className:"admonition admonition-info alert alert--info"},(0,r.mdx)("div",{parentName:"div",className:"admonition-heading"},(0,r.mdx)("h5",{parentName:"div"},(0,r.mdx)("span",{parentName:"h5",className:"admonition-icon"},(0,r.mdx)("svg",{parentName:"span",xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"},(0,r.mdx)("path",{parentName:"svg",fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))),"Absolute import statements decouple a component from the project's file structure.")),(0,r.mdx)("div",{parentName:"div",className:"admonition-content"})),(0,r.mdx)("h2",null,"Dependency Policy"),(0,r.mdx)("p",null,"The workspace dependency policy defines how external dependencies are installed and in which version. You may apply complex setups to have multiple versions of a dependency installed to fit different components. It allows you to determine where you want to adopt to a new version and which components should still use past versions."),(0,r.mdx)("p",null,"In your workspace you also have a ",(0,r.mdx)("a",{parentName:"p",href:"/docs/dependencies/dependencies-overview"},"dependency resolver")," that uses the policy to determine the type of dependency on a per-component basis.",(0,r.mdx)("br",{parentName:"p"}),"\n","Types of dependencies, like ",(0,r.mdx)("inlineCode",{parentName:"p"},"dependency")," and ",(0,r.mdx)("inlineCode",{parentName:"p"},"devDependency")," are contextual for each component. Meaning that according to where a component ",(0,r.mdx)("inlineCode",{parentName:"p"},"import"),"s a dependency, it will be set with the corresponding type. For example, a dependency only used in a test file will set as a ",(0,r.mdx)("inlineCode",{parentName:"p"},"devDependency")," for that specific component."),(0,r.mdx)("h2",null,"Performance"),(0,r.mdx)("p",null,"Bit workspace is optimized for quick and snappy feedback loop on code changes. It leaves the tough work of ensuring de-coupling and isolation to a more robust CI flow."),(0,r.mdx)("p",null,"To optimize performance even further any time you change a component Bit find which components are affected by the change. Bit then build your modified components and their affected dependents."),(0,r.mdx)("h2",null,"Integrate to existing codebases"),(0,r.mdx)("p",null,"Bit is a build tool that allows you to manage independent components. You may create a Bit workspace in a fresh directory or initialize one as part of an existing repository.",(0,r.mdx)("br",{parentName:"p"}),"\n","You can get started working on independent components alongside projects built with ",(0,r.mdx)("a",{parentName:"p",href:"https://angular.io/tutorial/toh-pt0"},"Angular"),", ",(0,r.mdx)("a",{parentName:"p",href:"https://create-react-app.dev"},"CRA")," and even ",(0,r.mdx)("a",{parentName:"p",href:"https://lerna.js.org"},"Lerna"),"."),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"cd")," to a pre-existing repository and run:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"bit init\n")),(0,r.mdx)("p",null,"From here you may use any Bit command and flow to build independent components and integrate them into your application.")))}v.__bit_component=o,v.isMDXComponent=!0},9373:(e,t,n)=>{"use strict";var o={id:"teambit.workspace/workspace@1.0.483",homepage:"https://bit.cloud/teambit/workspace/workspace",exported:!0};function r(){const e=a(n(1594));return r=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=o,a.__bit_component=o;const i=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/workspace.svg"}));i.__bit_component=o,t.Logo=i},4749:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={fullWidth:"image_fullWidth__sELLz"}},176:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/b40d450de296e275550f.png"},6903:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/2f046646df38433e90d7.png"},8800:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/cb67fb802479e2710016.png"},5016:e=>{"use strict";e.exports=MdxJsReact},1594:e=>{"use strict";e.exports=React},5682:e=>{"use strict";e.exports=TeambitMdxUiMdxScopeContext},7046:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>z,__assign:()=>a,__asyncDelegator:()=>j,__asyncGenerator:()=>k,__asyncValues:()=>N,__await:()=>O,__awaiter:()=>f,__classPrivateFieldGet:()=>I,__classPrivateFieldIn:()=>D,__classPrivateFieldSet:()=>M,__createBinding:()=>y,__decorate:()=>s,__disposeResources:()=>A,__esDecorate:()=>l,__exportStar:()=>v,__extends:()=>r,__generator:()=>h,__importDefault:()=>T,__importStar:()=>C,__makeTemplateObject:()=>P,__metadata:()=>m,__param:()=>c,__propKey:()=>u,__read:()=>w,__rest:()=>i,__rewriteRelativeImportExtension:()=>R,__runInitializers:()=>p,__setFunctionName:()=>d,__spread:()=>b,__spreadArray:()=>x,__spreadArrays:()=>_,__values:()=>g,default:()=>L});var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function s(e,t,n,o){var r,a=arguments.length,i=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(i=(a<3?r(i):a>3?r(t,n,i):r(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i}function c(e,t){return function(n,o){t(n,o,e)}}function l(e,t,n,o,r,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=o.kind,l="getter"===c?"get":"setter"===c?"set":"value",p=!t&&e?o.static?e:e.prototype:null,u=t||(p?Object.getOwnPropertyDescriptor(p,o.name):{}),d=!1,m=n.length-1;m>=0;m--){var f={};for(var h in o)f[h]="access"===h?{}:o[h];for(var h in o.access)f.access[h]=o.access[h];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var y=(0,n[m])("accessor"===c?{get:u.get,set:u.set}:u[l],f);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&r.unshift(s)}else(s=i(y))&&("field"===c?r.unshift(s):u[l]=s)}p&&Object.defineProperty(p,o.name,u),d=!0}function p(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0}function u(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function m(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{c(o.next(e))}catch(e){a(e)}}function s(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}c((o=o.apply(e,t||[])).next())}))}function h(e,t){var n,o,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var y=Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]};function v(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||y(t,e,n)}function g(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e}function _(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,r++)o[r]=a[i];return o}function x(e,t,n){if(n||2===arguments.length)for(var o,r=0,a=t.length;r<a;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function O(e){return this instanceof O?(this.v=e,this):new O(e)}function k(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),a=[];return o=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),i("next"),i("throw"),i("return",(function(e){return function(t){return Promise.resolve(t).then(e,l)}})),o[Symbol.asyncIterator]=function(){return this},o;function i(e,t){r[e]&&(o[e]=function(t){return new Promise((function(n,o){a.push([e,t,n,o])>1||s(e,t)}))},t&&(o[e]=t(o[e])))}function s(e,t){try{(n=r[e](t)).value instanceof O?Promise.resolve(n.value.v).then(c,l):p(a[0][2],n)}catch(e){p(a[0][3],e)}var n}function c(e){s("next",e)}function l(e){s("throw",e)}function p(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function j(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:O(e[o](t)),done:!1}:r?r(t):t}:r}}function N(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=g(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){!function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)}(o,r,(t=e[n](t)).done,t.value)}))}}}function P(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var S=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},E=function(e){return E=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},E(e)};function C(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=E(e),o=0;o<n.length;o++)"default"!==n[o]&&y(t,e,n[o]);return S(t,e),t}function T(e){return e&&e.__esModule?e:{default:e}}function I(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function M(e,t,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,n):r?r.value=n:t.set(e,n),n}function D(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function z(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var o,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=t[Symbol.asyncDispose]}if(void 0===o){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=t[Symbol.dispose],n&&(r=o)}if("function"!=typeof o)throw new TypeError("Object not disposable.");r&&(o=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:o,async:n})}else n&&e.stack.push({async:!0});return t}var B="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var o=new Error(n);return o.name="SuppressedError",o.error=e,o.suppressed=t,o};function A(e){function t(t){e.error=e.hasError?new B(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var n,o=0;return function r(){for(;n=e.stack.pop();)try{if(!n.async&&1===o)return o=0,e.stack.push(n),Promise.resolve().then(r);if(n.dispose){var a=n.dispose.call(n.value);if(n.async)return o|=2,Promise.resolve(a).then(r,(function(e){return t(e),r()}))}else o|=1}catch(e){t(e)}if(1===o)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function R(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,(function(e,n,o,r,a){return n?t?".jsx":".js":!o||r&&a?o+r+"."+a.toLowerCase()+"js":e})):e}const L={__extends:r,__assign:a,__rest:i,__decorate:s,__param:c,__esDecorate:l,__runInitializers:p,__propKey:u,__setFunctionName:d,__metadata:m,__awaiter:f,__generator:h,__createBinding:y,__exportStar:v,__values:g,__read:w,__spread:b,__spreadArrays:_,__spreadArray:x,__await:O,__asyncGenerator:k,__asyncDelegator:j,__asyncValues:N,__makeTemplateObject:P,__importStar:C,__importDefault:T,__classPrivateFieldGet:I,__classPrivateFieldSet:M,__classPrivateFieldIn:D,__addDisposableResource:z,__disposeResources:A,__rewriteRelativeImportExtension:R}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var r=o.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=o[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var o={};return(()=>{"use strict";n.r(o),n.d(o,{compositions:()=>d,compositions_metadata:()=>f,overview:()=>m});var e={};n.r(e),n.d(e,{default:()=>u});var t=n(9373),r=(n(1594),n(5016)),a=n(5682),i=n(1593),s=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c.apply(null,arguments)}var l={},p="wrapper";function u(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.includes(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,s);return(0,r.mdx)(p,c({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(a.MDXScopeProvider,{components:{WorkspaceOverview:i.Ay},mdxType:"MDXScopeProvider"},(0,r.mdx)(i.Ay,{mdxType:"WorkspaceOverview"})))}u.isMDXComponent=!0;const d=[t],m=[e],f={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -10482,7 +10482,7 @@
|
|
|
10482
10482
|
"_legacy": {
|
|
10483
10483
|
"scope": "teambit.workspace",
|
|
10484
10484
|
"name": "workspace",
|
|
10485
|
-
"version": "1.0.
|
|
10485
|
+
"version": "1.0.483"
|
|
10486
10486
|
},
|
|
10487
10487
|
"_scope": "teambit.workspace"
|
|
10488
10488
|
}
|
|
@@ -10693,7 +10693,7 @@
|
|
|
10693
10693
|
"_legacy": {
|
|
10694
10694
|
"scope": "teambit.workspace",
|
|
10695
10695
|
"name": "workspace",
|
|
10696
|
-
"version": "1.0.
|
|
10696
|
+
"version": "1.0.483"
|
|
10697
10697
|
},
|
|
10698
10698
|
"_scope": "teambit.workspace"
|
|
10699
10699
|
}
|
|
@@ -11136,7 +11136,7 @@
|
|
|
11136
11136
|
"_legacy": {
|
|
11137
11137
|
"scope": "teambit.workspace",
|
|
11138
11138
|
"name": "workspace",
|
|
11139
|
-
"version": "1.0.
|
|
11139
|
+
"version": "1.0.483"
|
|
11140
11140
|
},
|
|
11141
11141
|
"_scope": "teambit.workspace"
|
|
11142
11142
|
}
|
|
@@ -11291,7 +11291,7 @@
|
|
|
11291
11291
|
"_legacy": {
|
|
11292
11292
|
"scope": "teambit.workspace",
|
|
11293
11293
|
"name": "workspace",
|
|
11294
|
-
"version": "1.0.
|
|
11294
|
+
"version": "1.0.483"
|
|
11295
11295
|
},
|
|
11296
11296
|
"_scope": "teambit.workspace"
|
|
11297
11297
|
}
|
|
@@ -11426,7 +11426,7 @@
|
|
|
11426
11426
|
"_legacy": {
|
|
11427
11427
|
"scope": "teambit.workspace",
|
|
11428
11428
|
"name": "workspace",
|
|
11429
|
-
"version": "1.0.
|
|
11429
|
+
"version": "1.0.483"
|
|
11430
11430
|
},
|
|
11431
11431
|
"_scope": "teambit.workspace"
|
|
11432
11432
|
}
|
|
@@ -13440,7 +13440,7 @@
|
|
|
13440
13440
|
"_legacy": {
|
|
13441
13441
|
"scope": "teambit.workspace",
|
|
13442
13442
|
"name": "workspace",
|
|
13443
|
-
"version": "1.0.
|
|
13443
|
+
"version": "1.0.483"
|
|
13444
13444
|
},
|
|
13445
13445
|
"_scope": "teambit.workspace"
|
|
13446
13446
|
}
|
|
@@ -13784,7 +13784,7 @@
|
|
|
13784
13784
|
"_legacy": {
|
|
13785
13785
|
"scope": "teambit.workspace",
|
|
13786
13786
|
"name": "workspace",
|
|
13787
|
-
"version": "1.0.
|
|
13787
|
+
"version": "1.0.483"
|
|
13788
13788
|
},
|
|
13789
13789
|
"_scope": "teambit.workspace"
|
|
13790
13790
|
}
|
|
@@ -26298,7 +26298,7 @@
|
|
|
26298
26298
|
"_legacy": {
|
|
26299
26299
|
"scope": "teambit.workspace",
|
|
26300
26300
|
"name": "workspace",
|
|
26301
|
-
"version": "1.0.
|
|
26301
|
+
"version": "1.0.483"
|
|
26302
26302
|
},
|
|
26303
26303
|
"_scope": "teambit.workspace"
|
|
26304
26304
|
}
|
|
@@ -27821,7 +27821,7 @@
|
|
|
27821
27821
|
"_legacy": {
|
|
27822
27822
|
"scope": "teambit.workspace",
|
|
27823
27823
|
"name": "workspace",
|
|
27824
|
-
"version": "1.0.
|
|
27824
|
+
"version": "1.0.483"
|
|
27825
27825
|
},
|
|
27826
27826
|
"_scope": "teambit.workspace"
|
|
27827
27827
|
}
|
|
@@ -28064,7 +28064,7 @@
|
|
|
28064
28064
|
"_legacy": {
|
|
28065
28065
|
"scope": "teambit.workspace",
|
|
28066
28066
|
"name": "workspace",
|
|
28067
|
-
"version": "1.0.
|
|
28067
|
+
"version": "1.0.483"
|
|
28068
28068
|
},
|
|
28069
28069
|
"_scope": "teambit.workspace"
|
|
28070
28070
|
}
|
|
@@ -28287,7 +28287,7 @@
|
|
|
28287
28287
|
"_legacy": {
|
|
28288
28288
|
"scope": "teambit.workspace",
|
|
28289
28289
|
"name": "workspace",
|
|
28290
|
-
"version": "1.0.
|
|
28290
|
+
"version": "1.0.483"
|
|
28291
28291
|
},
|
|
28292
28292
|
"_scope": "teambit.workspace"
|
|
28293
28293
|
}
|
|
@@ -31200,7 +31200,7 @@
|
|
|
31200
31200
|
"_legacy": {
|
|
31201
31201
|
"scope": "teambit.workspace",
|
|
31202
31202
|
"name": "workspace",
|
|
31203
|
-
"version": "1.0.
|
|
31203
|
+
"version": "1.0.483"
|
|
31204
31204
|
},
|
|
31205
31205
|
"_scope": "teambit.workspace"
|
|
31206
31206
|
}
|
|
@@ -33110,7 +33110,7 @@
|
|
|
33110
33110
|
"componentId": {
|
|
33111
33111
|
"scope": "teambit.workspace",
|
|
33112
33112
|
"name": "workspace",
|
|
33113
|
-
"version": "1.0.
|
|
33113
|
+
"version": "1.0.483"
|
|
33114
33114
|
},
|
|
33115
33115
|
"taggedModuleExports": []
|
|
33116
33116
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.483/dist/workspace.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.483/dist/workspace.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/dist/ui/index.d.ts
CHANGED
package/dist/ui/index.js
CHANGED
|
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "Workspace", {
|
|
|
9
9
|
return _workspace().Workspace;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "WorkspaceMenu", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _workspaceMenu().WorkspaceMenu;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
function _workspace() {
|
|
13
19
|
const data = require("./workspace");
|
|
14
20
|
_workspace = function () {
|
|
@@ -16,5 +22,12 @@ function _workspace() {
|
|
|
16
22
|
};
|
|
17
23
|
return data;
|
|
18
24
|
}
|
|
25
|
+
function _workspaceMenu() {
|
|
26
|
+
const data = require("./workspace/workspace-menu");
|
|
27
|
+
_workspaceMenu = function () {
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
19
32
|
|
|
20
33
|
//# sourceMappingURL=index.js.map
|
package/dist/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_workspace","data","require"],"sources":["index.ts"],"sourcesContent":["export { Workspace } from './workspace';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_workspace","data","require","_workspaceMenu"],"sources":["index.ts"],"sourcesContent":["export { Workspace } from './workspace';\nexport { WorkspaceMenu } from './workspace/workspace-menu';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,eAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,cAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.WorkspaceMenu = void 0;
|
|
7
|
+
function _react() {
|
|
8
|
+
const data = _interopRequireDefault(require("react"));
|
|
9
|
+
_react = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _uiFoundationUi() {
|
|
15
|
+
const data = require("@teambit/ui-foundation.ui.menu");
|
|
16
|
+
_uiFoundationUi = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _workspaceUi() {
|
|
22
|
+
const data = require("@teambit/workspace.ui.use-workspace-mode");
|
|
23
|
+
_workspaceUi = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
+
const WorkspaceMenu = ({
|
|
30
|
+
menuSlot,
|
|
31
|
+
widgetSlot,
|
|
32
|
+
menuItemSlot,
|
|
33
|
+
className
|
|
34
|
+
}) => {
|
|
35
|
+
const {
|
|
36
|
+
isMinimal
|
|
37
|
+
} = (0, _workspaceUi().useWorkspaceMode)();
|
|
38
|
+
return /*#__PURE__*/_react().default.createElement(_uiFoundationUi().Menu, {
|
|
39
|
+
menuSlot: menuSlot,
|
|
40
|
+
widgetSlot: widgetSlot,
|
|
41
|
+
menuItemSlot: isMinimal ? undefined : menuItemSlot,
|
|
42
|
+
className: className
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
exports.WorkspaceMenu = WorkspaceMenu;
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=workspace-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_uiFoundationUi","_workspaceUi","e","__esModule","default","WorkspaceMenu","menuSlot","widgetSlot","menuItemSlot","className","isMinimal","useWorkspaceMode","createElement","Menu","undefined","exports"],"sources":["workspace-menu.tsx"],"sourcesContent":["import React from 'react';\nimport { Menu, MenuProps } from '@teambit/ui-foundation.ui.menu';\nimport { useWorkspaceMode } from '@teambit/workspace.ui.use-workspace-mode';\n\nexport const WorkspaceMenu = ({ menuSlot, widgetSlot, menuItemSlot, className }: MenuProps) => {\n const { isMinimal } = useWorkspaceMode();\n\n return (\n <Menu\n menuSlot={menuSlot}\n widgetSlot={widgetSlot}\n menuItemSlot={isMinimal ? undefined : menuItemSlot}\n className={className}\n />\n );\n};\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4E,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErE,MAAMG,aAAa,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,UAAU;EAAEC,YAAY;EAAEC;AAAqB,CAAC,KAAK;EAC7F,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,+BAAgB,EAAC,CAAC;EAExC,oBACEf,MAAA,GAAAQ,OAAA,CAAAQ,aAAA,CAACZ,eAAA,GAAAa,IAAI;IACHP,QAAQ,EAAEA,QAAS;IACnBC,UAAU,EAAEA,UAAW;IACvBC,YAAY,EAAEE,SAAS,GAAGI,SAAS,GAAGN,YAAa;IACnDC,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAACM,OAAA,CAAAV,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentModel } from '@teambit/component';
|
|
2
2
|
import type { ComponentCardPluginType, PluginProps } from '@teambit/explorer.ui.component-card';
|
|
3
3
|
export declare function WorkspaceOverview(): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare function useCardPlugins({ compModelsById, }: {
|
|
4
|
+
export declare function useCardPlugins({ compModelsById, showPreview, }: {
|
|
5
5
|
compModelsById: Map<string, ComponentModel>;
|
|
6
|
+
showPreview?: boolean;
|
|
6
7
|
}): ComponentCardPluginType<PluginProps>[];
|
|
@@ -75,6 +75,13 @@ function _workspaceUi2() {
|
|
|
75
75
|
};
|
|
76
76
|
return data;
|
|
77
77
|
}
|
|
78
|
+
function _workspaceUi3() {
|
|
79
|
+
const data = require("@teambit/workspace.ui.use-workspace-mode");
|
|
80
|
+
_workspaceUi3 = function () {
|
|
81
|
+
return data;
|
|
82
|
+
};
|
|
83
|
+
return data;
|
|
84
|
+
}
|
|
78
85
|
function _workspaceContext() {
|
|
79
86
|
const data = require("../workspace-context");
|
|
80
87
|
_workspaceContext = function () {
|
|
@@ -101,6 +108,9 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
101
108
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
102
109
|
function WorkspaceOverview() {
|
|
103
110
|
const workspace = (0, _react().useContext)(_workspaceContext().WorkspaceContext);
|
|
111
|
+
const {
|
|
112
|
+
isMinimal
|
|
113
|
+
} = (0, _workspaceUi3().useWorkspaceMode)();
|
|
104
114
|
const compModelsById = new Map(workspace.components.map(comp => [comp.id.toString(), comp]));
|
|
105
115
|
const {
|
|
106
116
|
components,
|
|
@@ -113,7 +123,8 @@ function WorkspaceOverview() {
|
|
|
113
123
|
} = (0, _cloudHooks().useCloudScopes)(uniqueScopesArr);
|
|
114
124
|
const cloudScopesById = new Map(cloudScopes.map(scope => [scope.id.toString(), scope]));
|
|
115
125
|
const plugins = useCardPlugins({
|
|
116
|
-
compModelsById
|
|
126
|
+
compModelsById,
|
|
127
|
+
showPreview: isMinimal
|
|
117
128
|
});
|
|
118
129
|
if (!components || components.length === 0) return /*#__PURE__*/_react().default.createElement(_workspaceUi().EmptyWorkspace, {
|
|
119
130
|
name: workspace.name
|
|
@@ -147,12 +158,14 @@ function WorkspaceOverview() {
|
|
|
147
158
|
componentDescriptor: componentDescriptor,
|
|
148
159
|
component: component,
|
|
149
160
|
plugins: plugins,
|
|
150
|
-
scope: scope
|
|
161
|
+
scope: scope,
|
|
162
|
+
shouldShowPreviewState: isMinimal
|
|
151
163
|
});
|
|
152
164
|
})));
|
|
153
165
|
}
|
|
154
166
|
function useCardPlugins({
|
|
155
|
-
compModelsById
|
|
167
|
+
compModelsById,
|
|
168
|
+
showPreview
|
|
156
169
|
}) {
|
|
157
170
|
const plugins = _react().default.useMemo(() => [{
|
|
158
171
|
preview: function Preview({
|
|
@@ -164,7 +177,7 @@ function useCardPlugins({
|
|
|
164
177
|
return /*#__PURE__*/_react().default.createElement(_previewUi().PreviewPlaceholder, {
|
|
165
178
|
componentDescriptor: component,
|
|
166
179
|
component: compModel,
|
|
167
|
-
shouldShowPreview: shouldShowPreview
|
|
180
|
+
shouldShowPreview: showPreview || shouldShowPreview
|
|
168
181
|
});
|
|
169
182
|
}
|
|
170
183
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_explorerUiGallery","_workspaceUi","_previewUi","_designUi","_componentId","_cloudHooks","_scopes","_lodash","_workspaceUi2","_workspaceContext","_workspaceOverviewModule","_interopRequireDefault","_linkPlugin","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","WorkspaceOverview","workspace","useContext","WorkspaceContext","compModelsById","Map","components","map","comp","id","toString","componentDescriptors","uniqueScopes","Set","c","scope","uniqueScopesArr","Array","from","cloudScopes","useCloudScopes","cloudScopesById","plugins","useCardPlugins","length","createElement","EmptyWorkspace","name","compDescriptorById","componentsWithDescriptorAndScope","compact","component","deprecation","isDeprecate","componentDescriptor","cloudScope","ScopeID","isValid","fromString","undefined","className","styles","container","ComponentGrid","cardGrid","WorkspaceComponentCard","key","React","useMemo","preview","Preview","shouldShowPreview","compModel","PreviewPlaceholder","previewBottomRight","PreviewBottomRight","env","envComponentId","ComponentID","rightPreviewPlugins","badge","Tooltip","delay","content","src","icon","envIcon","LinkPlugin","size"],"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 { PreviewPlaceholder } from '@teambit/preview.ui.preview-placeholder';\nimport { Tooltip } from '@teambit/design.ui.tooltip';\nimport { ComponentID } from '@teambit/component-id';\nimport { ComponentModel } from '@teambit/component';\nimport { useCloudScopes } from '@teambit/cloud.hooks.use-cloud-scopes';\nimport { ScopeID } from '@teambit/scopes.scope-id';\nimport { compact } from 'lodash';\nimport { WorkspaceComponentCard } from '@teambit/workspace.ui.workspace-component-card';\nimport type { ComponentCardPluginType, PluginProps } from '@teambit/explorer.ui.component-card';\nimport { WorkspaceContext } from '../workspace-context';\nimport styles from './workspace-overview.module.scss';\nimport { LinkPlugin } from './link-plugin';\n\nexport function WorkspaceOverview() {\n const workspace = useContext(WorkspaceContext);\n const compModelsById = new Map(workspace.components.map((comp) => [comp.id.toString(), comp]));\n const { components, componentDescriptors } = workspace;\n const uniqueScopes = new Set(components.map((c) => c.id.scope));\n const uniqueScopesArr = Array.from(uniqueScopes);\n const { cloudScopes = [] } = useCloudScopes(uniqueScopesArr);\n const cloudScopesById = new Map(cloudScopes.map((scope) => [scope.id.toString(), scope]));\n\n const plugins = useCardPlugins({ compModelsById });\n\n if (!components || components.length === 0) return <EmptyWorkspace name={workspace.name} />;\n\n const compDescriptorById = new Map(componentDescriptors.map((comp) => [comp.id.toString(), comp]));\n const componentsWithDescriptorAndScope = compact(\n components.map((component) => {\n if (component.deprecation?.isDeprecate) return null;\n const componentDescriptor = compDescriptorById.get(component.id.toString());\n if (!componentDescriptor) return null;\n const cloudScope = cloudScopesById.get(component.id.scope);\n const scope =\n cloudScope ||\n (ScopeID.isValid(component.id.scope) && { id: ScopeID.fromString(component.id.scope) }) ||\n undefined;\n\n return { component, componentDescriptor, scope };\n })\n );\n\n return (\n <div className={styles.container}>\n <ComponentGrid className={styles.cardGrid}>\n {componentsWithDescriptorAndScope.map(({ component, componentDescriptor, scope }) => {\n return (\n <WorkspaceComponentCard\n key={component.id.toString()}\n componentDescriptor={componentDescriptor}\n component={component}\n plugins={plugins}\n scope={scope}\n />\n );\n })}\n </ComponentGrid>\n </div>\n );\n}\n\nexport function useCardPlugins({\n compModelsById,\n}: {\n compModelsById: Map<string, ComponentModel>;\n}): ComponentCardPluginType<PluginProps>[] {\n const plugins = React.useMemo(\n () => [\n {\n preview: function Preview({ component, shouldShowPreview }) {\n const compModel = compModelsById.get(component.id.toString());\n if (!compModel) return null;\n return (\n <PreviewPlaceholder\n componentDescriptor={component}\n component={compModel}\n shouldShowPreview={shouldShowPreview}\n />\n );\n },\n },\n {\n previewBottomRight: function PreviewBottomRight({ component }) {\n const env = component.get('teambit.envs/envs');\n const envComponentId = env?.id ? ComponentID.fromString(env?.id) : undefined;\n\n return (\n <div className={styles.rightPreviewPlugins}>\n <div className={styles.badge}>\n <Tooltip delay={300} content={envComponentId?.name}>\n <img src={env?.icon} className={styles.envIcon} />\n </Tooltip>\n </div>\n </div>\n );\n },\n },\n new LinkPlugin(),\n ],\n [compModelsById.size]\n );\n\n return plugins;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,aAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,YAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,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D,IAAI,CAAC0C,SAAS,EAAE,OAAO,IAAI;MAC3B,oBACEzF,MAAA,GAAAmB,OAAA,CAAA2C,aAAA,CAACxD,UAAA,GAAAoF,kBAAkB;QACjBnB,mBAAmB,EAAEH,SAAU;QAC/BA,SAAS,EAAEqB,SAAU;QACrBD,iBAAiB,EAAEA;MAAkB,CACtC,CAAC;IAEN;EACF,CAAC,EACD;IACEG,kBAAkB,EAAE,SAASC,kBAAkBA,CAAC;MAAExB;IAAU,CAAC,EAAE;MAC7D,MAAMyB,GAAG,GAAGzB,SAAS,CAAC3C,GAAG,CAAC,mBAAmB,CAAC;MAC9C,MAAMqE,cAAc,GAAGD,GAAG,EAAE/C,EAAE,GAAGiD,0BAAW,CAACpB,UAAU,CAACkB,GAAG,EAAE/C,EAAE,CAAC,GAAG8B,SAAS;MAE5E,oBACE5E,MAAA,GAAAmB,OAAA,CAAA2C,aAAA;QAAKe,SAAS,EAAEC,kCAAM,CAACkB;MAAoB,gBACzChG,MAAA,GAAAmB,OAAA,CAAA2C,aAAA;QAAKe,SAAS,EAAEC,kCAAM,CAACmB;MAAM,gBAC3BjG,MAAA,GAAAmB,OAAA,CAAA2C,aAAA,CAACvD,SAAA,GAAA2F,OAAO;QAACC,KAAK,EAAE,GAAI;QAACC,OAAO,EAAEN,cAAc,EAAE9B;MAAK,gBACjDhE,MAAA,GAAAmB,OAAA,CAAA2C,aAAA;QAAKuC,GAAG,EAAER,GAAG,EAAES,IAAK;QAACzB,SAAS,EAAEC,kCAAM,CAACyB;MAAQ,CAAE,CAC1C,CACN,CACF,CAAC;IAEV;EACF,CAAC,EACD,KAAIC,wBAAU,EAAC,CAAC,CACjB,EACD,CAAC/D,cAAc,CAACgE,IAAI,CACtB,CAAC;EAED,OAAO9C,OAAO;AAChB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_explorerUiGallery","_workspaceUi","_previewUi","_designUi","_componentId","_cloudHooks","_scopes","_lodash","_workspaceUi2","_workspaceUi3","_workspaceContext","_workspaceOverviewModule","_interopRequireDefault","_linkPlugin","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","WorkspaceOverview","workspace","useContext","WorkspaceContext","isMinimal","useWorkspaceMode","compModelsById","Map","components","map","comp","id","toString","componentDescriptors","uniqueScopes","Set","c","scope","uniqueScopesArr","Array","from","cloudScopes","useCloudScopes","cloudScopesById","plugins","useCardPlugins","showPreview","length","createElement","EmptyWorkspace","name","compDescriptorById","componentsWithDescriptorAndScope","compact","component","deprecation","isDeprecate","componentDescriptor","cloudScope","ScopeID","isValid","fromString","undefined","className","styles","container","ComponentGrid","cardGrid","WorkspaceComponentCard","key","shouldShowPreviewState","React","useMemo","preview","Preview","shouldShowPreview","compModel","PreviewPlaceholder","previewBottomRight","PreviewBottomRight","env","envComponentId","ComponentID","rightPreviewPlugins","badge","Tooltip","delay","content","src","icon","envIcon","LinkPlugin","size"],"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 { PreviewPlaceholder } from '@teambit/preview.ui.preview-placeholder';\nimport { Tooltip } from '@teambit/design.ui.tooltip';\nimport { ComponentID } from '@teambit/component-id';\nimport { ComponentModel } from '@teambit/component';\nimport { useCloudScopes } from '@teambit/cloud.hooks.use-cloud-scopes';\nimport { ScopeID } from '@teambit/scopes.scope-id';\nimport { compact } from 'lodash';\nimport { WorkspaceComponentCard } from '@teambit/workspace.ui.workspace-component-card';\nimport type { ComponentCardPluginType, PluginProps } from '@teambit/explorer.ui.component-card';\nimport { useWorkspaceMode } from '@teambit/workspace.ui.use-workspace-mode';\nimport { WorkspaceContext } from '../workspace-context';\nimport styles from './workspace-overview.module.scss';\nimport { LinkPlugin } from './link-plugin';\n\nexport function WorkspaceOverview() {\n const workspace = useContext(WorkspaceContext);\n const { isMinimal } = useWorkspaceMode();\n const compModelsById = new Map(workspace.components.map((comp) => [comp.id.toString(), comp]));\n const { components, componentDescriptors } = workspace;\n const uniqueScopes = new Set(components.map((c) => c.id.scope));\n const uniqueScopesArr = Array.from(uniqueScopes);\n const { cloudScopes = [] } = useCloudScopes(uniqueScopesArr);\n const cloudScopesById = new Map(cloudScopes.map((scope) => [scope.id.toString(), scope]));\n\n const plugins = useCardPlugins({ compModelsById, showPreview: isMinimal });\n\n if (!components || components.length === 0) return <EmptyWorkspace name={workspace.name} />;\n\n const compDescriptorById = new Map(componentDescriptors.map((comp) => [comp.id.toString(), comp]));\n const componentsWithDescriptorAndScope = compact(\n components.map((component) => {\n if (component.deprecation?.isDeprecate) return null;\n const componentDescriptor = compDescriptorById.get(component.id.toString());\n if (!componentDescriptor) return null;\n const cloudScope = cloudScopesById.get(component.id.scope);\n const scope =\n cloudScope ||\n (ScopeID.isValid(component.id.scope) && { id: ScopeID.fromString(component.id.scope) }) ||\n undefined;\n\n return { component, componentDescriptor, scope };\n })\n );\n\n return (\n <div className={styles.container}>\n <ComponentGrid className={styles.cardGrid}>\n {componentsWithDescriptorAndScope.map(({ component, componentDescriptor, scope }) => {\n return (\n <WorkspaceComponentCard\n key={component.id.toString()}\n componentDescriptor={componentDescriptor}\n component={component}\n plugins={plugins}\n scope={scope}\n shouldShowPreviewState={isMinimal}\n />\n );\n })}\n </ComponentGrid>\n </div>\n );\n}\n\nexport function useCardPlugins({\n compModelsById,\n showPreview,\n}: {\n compModelsById: Map<string, ComponentModel>;\n showPreview?: boolean;\n}): ComponentCardPluginType<PluginProps>[] {\n const plugins = React.useMemo(\n () => [\n {\n preview: function Preview({ component, shouldShowPreview }) {\n const compModel = compModelsById.get(component.id.toString());\n if (!compModel) return null;\n return (\n <PreviewPlaceholder\n componentDescriptor={component}\n component={compModel}\n shouldShowPreview={showPreview || shouldShowPreview}\n />\n );\n },\n },\n {\n previewBottomRight: function PreviewBottomRight({ component }) {\n const env = component.get('teambit.envs/envs');\n const envComponentId = env?.id ? ComponentID.fromString(env?.id) : undefined;\n\n return (\n <div className={styles.rightPreviewPlugins}>\n <div className={styles.badge}>\n <Tooltip delay={300} content={envComponentId?.name}>\n <img src={env?.icon} className={styles.envIcon} />\n </Tooltip>\n </div>\n </div>\n );\n },\n },\n new LinkPlugin(),\n ],\n [compModelsById.size]\n );\n\n return plugins;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,aAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,YAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,YAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,WAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,QAAA;EAAA,MA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reList":[]}
|
|
@@ -82,6 +82,13 @@ function _uiFoundationUi2() {
|
|
|
82
82
|
};
|
|
83
83
|
return data;
|
|
84
84
|
}
|
|
85
|
+
function _workspaceUi() {
|
|
86
|
+
const data = require("@teambit/workspace.ui.preserve-workspace-mode");
|
|
87
|
+
_workspaceUi = function () {
|
|
88
|
+
return data;
|
|
89
|
+
};
|
|
90
|
+
return data;
|
|
91
|
+
}
|
|
85
92
|
function _classnames() {
|
|
86
93
|
const data = _interopRequireDefault(require("classnames"));
|
|
87
94
|
_classnames = function () {
|
|
@@ -89,6 +96,13 @@ function _classnames() {
|
|
|
89
96
|
};
|
|
90
97
|
return data;
|
|
91
98
|
}
|
|
99
|
+
function _workspaceUi2() {
|
|
100
|
+
const data = require("@teambit/workspace.ui.use-workspace-mode");
|
|
101
|
+
_workspaceUi2 = function () {
|
|
102
|
+
return data;
|
|
103
|
+
};
|
|
104
|
+
return data;
|
|
105
|
+
}
|
|
92
106
|
function _useWorkspace() {
|
|
93
107
|
const data = require("./use-workspace");
|
|
94
108
|
_useWorkspace = function () {
|
|
@@ -130,6 +144,9 @@ function Workspace({
|
|
|
130
144
|
workspaceUI,
|
|
131
145
|
onSidebarTogglerChange
|
|
132
146
|
}) {
|
|
147
|
+
const {
|
|
148
|
+
isMinimal
|
|
149
|
+
} = (0, _workspaceUi2().useWorkspaceMode)();
|
|
133
150
|
const reactions = useComponentNotifications();
|
|
134
151
|
const {
|
|
135
152
|
workspace
|
|
@@ -154,12 +171,12 @@ function Workspace({
|
|
|
154
171
|
workspaceUI.setComponents(workspace.components);
|
|
155
172
|
return /*#__PURE__*/_react().default.createElement(_workspaceProvider().WorkspaceProvider, {
|
|
156
173
|
workspace: workspace
|
|
157
|
-
}, /*#__PURE__*/_react().default.createElement("div", {
|
|
174
|
+
}, /*#__PURE__*/_react().default.createElement(_workspaceUi().PreserveWorkspaceMode, null, /*#__PURE__*/_react().default.createElement("div", {
|
|
158
175
|
className: _workspaceModule().default.workspaceWrapper
|
|
159
176
|
}, /*#__PURE__*/_react().default.createElement(_uiFoundationUi2().TopBar, {
|
|
160
177
|
className: (0, _classnames().default)(_workspaceModule().default.topbar, _workspaceModule().default[themeName]),
|
|
161
178
|
Corner: () => /*#__PURE__*/_react().default.createElement(_uiFoundationUi().Corner, {
|
|
162
|
-
className: (0, _classnames().default)(_workspaceModule().default.corner, _workspaceModule().default[themeName]),
|
|
179
|
+
className: (0, _classnames().default)(isMinimal && _workspaceModule().default.minimalCorner || _workspaceModule().default.corner, _workspaceModule().default[themeName]),
|
|
163
180
|
name: workspace.name,
|
|
164
181
|
icon: workspace.icon
|
|
165
182
|
}),
|
|
@@ -183,7 +200,7 @@ function Workspace({
|
|
|
183
200
|
}, /*#__PURE__*/_react().default.createElement(_reactRouterDom().Route, {
|
|
184
201
|
index: true,
|
|
185
202
|
element: /*#__PURE__*/_react().default.createElement(_workspaceOverview().WorkspaceOverview, null)
|
|
186
|
-
}))))));
|
|
203
|
+
})))))));
|
|
187
204
|
}
|
|
188
205
|
function useComponentNotifications() {
|
|
189
206
|
const notifications = (0, _uiFoundationUiNotifications().useNotifications)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["require","_pluralize","data","_interopRequireDefault","_react","_interopRequireWildcard","_reactRouterDom","_uiFoundationUiNotifications","_uiFoundationUiReactRouter","_uiFoundationUi","_uiFoundationUiButtons","_baseUiSurfacesSplitPane","_baseReactThemes","_baseUiSurfacesSplitPane2","_uiFoundationUi2","_classnames","_useWorkspace","_workspaceOverview","_workspaceProvider","_workspaceModule","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Workspace","routeSlot","menuSlot","sidebar","workspaceUI","onSidebarTogglerChange","reactions","useComponentNotifications","workspace","useWorkspace","theme","useThemePicker","currentTheme","current","isSidebarOpen","handleSidebarToggle","useReducer","x","sidebarOpenness","Layout","row","right","themeName","useEffect","window","innerWidth","createElement","className","styles","emptyContainer","setComponents","components","WorkspaceProvider","workspaceWrapper","TopBar","classNames","topbar","Corner","corner","name","icon","menu","SplitPane","main","size","layout","Pane","closed","HoverSplitter","splitter","Collapser","isOpen","onMouseDown","stopPropagation","onClick","tooltipContent","SlotRouter","slot","Route","index","element","WorkspaceOverview","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, useEffect } 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 { SlotRouter } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport type { RouteSlot } 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 { useThemePicker } from '@teambit/base-react.themes.theme-switcher';\nimport { HoverSplitter } from '@teambit/base-ui.surfaces.split-pane.hover-splitter';\nimport { TopBar } from '@teambit/ui-foundation.ui.top-bar';\nimport classNames from 'classnames';\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 const theme = useThemePicker();\n const currentTheme = theme?.current;\n const [isSidebarOpen, handleSidebarToggle] = useReducer((x) => !x, true);\n const sidebarOpenness = isSidebarOpen ? Layout.row : Layout.right;\n const themeName = currentTheme?.themeName || 'light';\n onSidebarTogglerChange(handleSidebarToggle);\n\n useEffect(() => {\n if (!window) return;\n if (window.innerWidth <= 1024) {\n handleSidebarToggle();\n }\n }, []);\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={classNames(styles.topbar, styles[themeName])}\n Corner={() => (\n <Corner\n className={classNames(styles.corner, styles[themeName])}\n name={workspace.name}\n icon={workspace.icon}\n />\n )}\n menu={menuSlot}\n />\n\n <SplitPane className={styles.main} size={246} layout={sidebarOpenness}>\n <Pane className={classNames(styles.sidebar, styles[themeName], !isSidebarOpen && styles.closed)}>\n {sidebar}\n </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":";;;;;;AAAAA,OAAA;AACA,SAAAC,WAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAH,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAL,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAF,OAAA;EAAAM,eAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,6BAAA;EAAA,MAAAL,IAAA,GAAAF,OAAA;EAAAO,4BAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,2BAAA;EAAA,MAAAN,IAAA,GAAAF,OAAA;EAAAQ,0BAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,gBAAA;EAAA,MAAAP,IAAA,GAAAF,OAAA;EAAAS,eAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,uBAAA;EAAA,MAAAR,IAAA,GAAAF,OAAA;EAAAU,sBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,yBAAA;EAAA,MAAAT,IAAA,GAAAF,OAAA;EAAAW,wBAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAU,iBAAA;EA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opRequireDefault","_react","_interopRequireWildcard","_reactRouterDom","_uiFoundationUiNotifications","_uiFoundationUiReactRouter","_uiFoundationUi","_uiFoundationUiButtons","_baseUiSurfacesSplitPane","_baseReactThemes","_baseUiSurfacesSplitPane2","_uiFoundationUi2","_workspaceUi","_classnames","_workspaceUi2","_useWorkspace","_workspaceOverview","_workspaceProvider","_workspaceModule","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Workspace","routeSlot","menuSlot","sidebar","workspaceUI","onSidebarTogglerChange","isMinimal","useWorkspaceMode","reactions","useComponentNotifications","workspace","useWorkspace","theme","useThemePicker","currentTheme","current","isSidebarOpen","handleSidebarToggle","useReducer","x","sidebarOpenness","Layout","row","right","themeName","useEffect","window","innerWidth","createElement","className","styles","emptyContainer","setComponents","components","WorkspaceProvider","PreserveWorkspaceMode","workspaceWrapper","TopBar","classNames","topbar","Corner","minimalCorner","corner","name","icon","menu","SplitPane","main","size","layout","Pane","closed","HoverSplitter","splitter","Collapser","isOpen","onMouseDown","stopPropagation","onClick","tooltipContent","SlotRouter","slot","Route","index","element","WorkspaceOverview","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, useEffect } 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 { SlotRouter } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport type { RouteSlot } 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 { useThemePicker } from '@teambit/base-react.themes.theme-switcher';\nimport { HoverSplitter } from '@teambit/base-ui.surfaces.split-pane.hover-splitter';\nimport { TopBar } from '@teambit/ui-foundation.ui.top-bar';\nimport { PreserveWorkspaceMode } from '@teambit/workspace.ui.preserve-workspace-mode';\nimport classNames from 'classnames';\nimport { useWorkspaceMode } from '@teambit/workspace.ui.use-workspace-mode';\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 { isMinimal } = useWorkspaceMode();\n const reactions = useComponentNotifications();\n const { workspace } = useWorkspace(reactions);\n const theme = useThemePicker();\n const currentTheme = theme?.current;\n const [isSidebarOpen, handleSidebarToggle] = useReducer((x) => !x, true);\n const sidebarOpenness = isSidebarOpen ? Layout.row : Layout.right;\n const themeName = currentTheme?.themeName || 'light';\n onSidebarTogglerChange(handleSidebarToggle);\n\n useEffect(() => {\n if (!window) return;\n if (window.innerWidth <= 1024) {\n handleSidebarToggle();\n }\n }, []);\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 <PreserveWorkspaceMode>\n <div className={styles.workspaceWrapper}>\n {\n <TopBar\n className={classNames(styles.topbar, styles[themeName])}\n Corner={() => (\n <Corner\n className={classNames((isMinimal && styles.minimalCorner) || styles.corner, styles[themeName])}\n name={workspace.name}\n icon={workspace.icon}\n />\n )}\n menu={menuSlot}\n />\n }\n <SplitPane className={styles.main} size={246} layout={sidebarOpenness}>\n <Pane className={classNames(styles.sidebar, styles[themeName], !isSidebarOpen && styles.closed)}>\n {sidebar}\n </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 </PreserveWorkspaceMode>\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":";;;;;;AAAAA,OAAA;AACA,SAAAC,WAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAH,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAL,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAF,OAAA;EAAAM,eAAA,YAAAA,CAA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}
|
|
35
|
-
function _uiFoundationUi() {
|
|
36
|
-
const data = require("@teambit/ui-foundation.ui.menu");
|
|
37
|
-
_uiFoundationUi = function () {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
35
|
function _sidebar() {
|
|
43
36
|
const data = require("@teambit/sidebar");
|
|
44
37
|
_sidebar = function () {
|
|
@@ -282,7 +275,7 @@ class WorkspaceUI {
|
|
|
282
275
|
});
|
|
283
276
|
workspaceUI.registerMenuRoutes([{
|
|
284
277
|
path: '/',
|
|
285
|
-
element: /*#__PURE__*/_react().default.createElement(
|
|
278
|
+
element: /*#__PURE__*/_react().default.createElement(_ui2().WorkspaceMenu, {
|
|
286
279
|
menuItemSlot: workspaceUI.menuItemSlot,
|
|
287
280
|
widgetSlot: workspaceUI.menuWidgetSlot
|
|
288
281
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_component","data","require","_lodash","_componentTree","_harmony","_uiFoundationUi","_sidebar","_ui","_graph","_react","_interopRequireDefault","_commandBar","_designUiSurfacesMenu","_componentUiComponentFilters","_componentUiComponentFilters2","_componentUiComponentFilters3","_componentUi","_componentTree2","_ui2","_workspace","_workspaceUi","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WorkspaceUI","constructor","routeSlot","componentUi","menuSlot","menuItemSlot","sidebar","sidebarSlot","sidebarItemSlot","drawerWidgetSlot","drawerComponentsFiltersSlot","commandBarUI","menuWidgetSlot","menuItems","register","menuWidgets","routes","components","updateComponents","links","filters","widgets","category","title","keyChar","handler","run","registerRoutes","registerDrawers","drawers","registerDrawer","registerSidebarWidget","componentTreeNode","uiRoot","workspaceDrawer","treeWidgets","filtersSlot","setKeyBindHandler","addCommand","id","action","displayName","keybinding","path","element","createElement","Workspace","render","items","listSidebarItems","workspaceUI","onSidebarTogglerChange","flatten","values","compact","map","item","component","provider","ui","componentTree","graphUI","config","registerTreeNode","ComponentTreeWidget","registerComponentWidget","widget","registerDrawerComponentFilters","DeprecateFilter","EnvsFilter","ShowMainFilter","registerDrawerWidgets","FilterWidget","key","TreeToggleWidget","registerRoot","bind","registerMenuItem","registerSidebarLink","Gallery","MenuLinkItem","exact","href","icon","registerMenuRoutes","Menu","widgetSlot","routePath","getMenu","WorkspaceAspect","getComponentUI","registerMenuWidget","CommandBarButton","exports","UIAspect","ComponentAspect","SidebarAspect","ComponentTreeAspect","CommandBarAspect","GraphAspect","UIRuntime","Slot","withType","_default","addRuntime"],"sources":["workspace.ui.runtime.tsx"],"sourcesContent":["import { ComponentAspect, ComponentUI, ComponentModel } from '@teambit/component';\nimport { compact, flatten } from 'lodash';\nimport { ComponentTreeAspect, ComponentTreeUI, ComponentTreeNode } from '@teambit/component-tree';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport type { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { Menu, MenuWidgetSlot, MenuWidget } from '@teambit/ui-foundation.ui.menu';\nimport { SidebarAspect, SidebarUI, SidebarItem, SidebarItemSlot } from '@teambit/sidebar';\nimport { MenuItemSlot, MenuItem } from '@teambit/ui-foundation.ui.main-dropdown';\nimport { UIAspect, UIRootUI as UIRoot, UIRuntime, UiUI } from '@teambit/ui';\nimport { GraphAspect, GraphUI } from '@teambit/graph';\nimport React, { ReactNode } from 'react';\nimport { RouteProps } from 'react-router-dom';\nimport { CommandBarAspect, CommandBarUI, CommandHandler } from '@teambit/command-bar';\nimport { MenuLinkItem } from '@teambit/design.ui.surfaces.menu.link-item';\nimport type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';\nimport { ComponentFilters } from '@teambit/component.ui.component-filters.component-filter-context';\nimport { DeprecateFilter } from '@teambit/component.ui.component-filters.deprecate-filter';\nimport { EnvsFilter } from '@teambit/component.ui.component-filters.env-filter';\nimport { ShowMainFilter } from '@teambit/component.ui.component-filters.show-main-filter';\nimport {\n DrawerWidgetSlot,\n FilterWidget,\n TreeToggleWidget,\n ComponentFiltersSlot,\n} from '@teambit/component.ui.component-drawer';\nimport { ComponentTreeWidget } from './component-tree.widget';\nimport { Workspace } from './ui';\nimport { WorkspaceAspect } from './workspace.aspect';\nimport { workspaceDrawer } from './workspace.ui.drawer';\n\nexport type SidebarWidgetSlot = SlotRegistry<ComponentTreeNode>;\n\nexport class WorkspaceUI {\n constructor(\n /**\n * route slot.\n */\n private routeSlot: RouteSlot,\n\n /**\n * component ui extension.\n */\n private componentUi: ComponentUI,\n\n /**\n * menu slot\n */\n private menuSlot: RouteSlot,\n\n private menuItemSlot: MenuItemSlot,\n\n private sidebar: SidebarUI,\n\n private sidebarSlot: SidebarWidgetSlot,\n\n /**\n * sidebar link slot\n */\n private sidebarItemSlot: SidebarItemSlot,\n\n private drawerWidgetSlot: DrawerWidgetSlot,\n\n private drawerComponentsFiltersSlot: ComponentFiltersSlot,\n\n private commandBarUI: CommandBarUI,\n\n private menuWidgetSlot: MenuWidgetSlot\n ) {}\n\n private setKeyBindHandler: (updated: CommandHandler) => void = () => {};\n\n /**\n * register a route to the workspace.\n */\n registerRoutes(routes: RouteProps[]) {\n this.routeSlot.register(routes);\n return this;\n }\n\n registerDrawers(...drawers: DrawerType[]) {\n this.sidebar.registerDrawer(...drawers);\n return this;\n }\n\n registerSidebarWidget(componentTreeNode: ComponentTreeNode) {\n this.sidebarSlot.register(componentTreeNode);\n return this;\n }\n\n registerMenuItem = (menuItems: MenuItem[]) => {\n this.menuItemSlot.register(menuItems);\n };\n\n registerMenuWidget = (menuWidgets: MenuWidget[]) => {\n this.menuWidgetSlot.register(menuWidgets);\n };\n\n registerMenuRoutes = (routes: RouteProps[]) => {\n this.menuSlot.register(routes);\n return this;\n };\n\n setComponents = (components: ComponentModel[]) => {\n this.componentUi.updateComponents(components);\n };\n\n registerSidebarLink = (...links: SidebarItem[]) => {\n this.sidebarItemSlot.register(links);\n };\n\n /**\n * register component filters\n */\n registerDrawerComponentFilters = (filters: ComponentFilters) => {\n this.drawerComponentsFiltersSlot.register(filters);\n };\n\n registerDrawerWidgets = (widgets: ReactNode[]) => {\n this.drawerWidgetSlot.register(widgets);\n };\n\n uiRoot(): UIRoot {\n this.registerDrawers(\n workspaceDrawer({\n treeWidgets: this.sidebarSlot,\n drawerWidgetSlot: this.drawerWidgetSlot,\n filtersSlot: this.drawerComponentsFiltersSlot,\n })\n );\n\n const [setKeyBindHandler] = this.commandBarUI.addCommand({\n id: 'sidebar.toggle', // TODO - extract to a component!\n action: () => {},\n displayName: 'Toggle component list',\n keybinding: 'alt+s',\n });\n this.setKeyBindHandler = setKeyBindHandler;\n\n return {\n routes: [\n {\n path: '/*',\n element: (\n <Workspace\n menuSlot={this.menuSlot}\n routeSlot={this.routeSlot}\n sidebar={<this.sidebar.render items={this.listSidebarItems()} />}\n workspaceUI={this}\n onSidebarTogglerChange={this.setKeyBindHandler}\n />\n ),\n },\n ],\n };\n }\n\n listSidebarItems() {\n const items = flatten(this.sidebarItemSlot.values());\n return compact(\n items.map((item) => {\n return item.component;\n })\n );\n }\n\n private menuItems: MenuItem[] = [\n {\n category: 'general',\n title: 'Open command bar',\n keyChar: 'mod+k',\n handler: () => this.commandBarUI?.run('command-bar.open'),\n },\n {\n category: 'general',\n title: 'Toggle component list',\n keyChar: 'alt+s',\n handler: () => this.commandBarUI?.run('sidebar.toggle'),\n },\n ];\n\n static dependencies = [UIAspect, ComponentAspect, SidebarAspect, ComponentTreeAspect, CommandBarAspect, GraphAspect];\n\n static runtime = UIRuntime;\n\n static slots = [\n Slot.withType<RouteProps>(),\n Slot.withType<RouteProps>(),\n Slot.withType<ComponentTreeNode>(),\n Slot.withType<MenuItemSlot>(),\n Slot.withType<SidebarItemSlot>(),\n Slot.withType<DrawerWidgetSlot>(),\n Slot.withType<ComponentFiltersSlot>(),\n Slot.withType<MenuWidgetSlot>(),\n ];\n\n static async provider(\n [ui, componentUi, sidebar, componentTree, commandBarUI, graphUI]: [\n UiUI,\n ComponentUI,\n SidebarUI,\n ComponentTreeUI,\n CommandBarUI,\n GraphUI,\n ],\n config,\n [\n routeSlot,\n menuSlot,\n menuItemSlot,\n sidebarSlot,\n sidebarItemSlot,\n drawerWidgetSlot,\n drawerComponentsFiltersSlot,\n menuWidgetSlot,\n ]: [\n RouteSlot,\n RouteSlot,\n MenuItemSlot,\n SidebarWidgetSlot,\n SidebarItemSlot,\n DrawerWidgetSlot,\n ComponentFiltersSlot,\n MenuWidgetSlot,\n ]\n ) {\n componentTree.registerTreeNode(new ComponentTreeWidget());\n sidebarSlot.register(new ComponentTreeWidget());\n graphUI.registerComponentWidget(new ComponentTreeWidget().widget);\n\n const workspaceUI = new WorkspaceUI(\n routeSlot,\n componentUi,\n menuSlot,\n menuItemSlot,\n sidebar,\n sidebarSlot,\n sidebarItemSlot,\n drawerWidgetSlot,\n drawerComponentsFiltersSlot,\n commandBarUI,\n menuWidgetSlot\n );\n\n workspaceUI.registerDrawerComponentFilters([DeprecateFilter, EnvsFilter, ShowMainFilter(true)]);\n workspaceUI.registerDrawerWidgets([\n <FilterWidget key={'workspace-filter-widget'} />,\n <TreeToggleWidget key={'workspace-tree-toggle-widget'} />,\n ]);\n ui.registerRoot(workspaceUI.uiRoot.bind(workspaceUI));\n workspaceUI.registerMenuItem(workspaceUI.menuItems);\n\n workspaceUI.registerSidebarLink({\n component: function Gallery() {\n return (\n <MenuLinkItem exact href=\"/\" icon=\"comps\">\n Workspace overview\n </MenuLinkItem>\n );\n },\n });\n\n workspaceUI.registerMenuRoutes([\n {\n path: '/',\n element: <Menu menuItemSlot={workspaceUI.menuItemSlot} widgetSlot={workspaceUI.menuWidgetSlot} />,\n },\n {\n path: workspaceUI.componentUi.routePath,\n element: workspaceUI.componentUi.getMenu(WorkspaceAspect.id),\n },\n ]);\n\n workspaceUI.registerRoutes([\n {\n path: workspaceUI.componentUi.routePath,\n element: workspaceUI.componentUi.getComponentUI(WorkspaceAspect.id),\n },\n ]);\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","data","require","_lodash","_componentTree","_harmony","_sidebar","_ui","_graph","_react","_interopRequireDefault","_commandBar","_designUiSurfacesMenu","_componentUiComponentFilters","_componentUiComponentFilters2","_componentUiComponentFilters3","_componentUi","_componentTree2","_ui2","_workspace","_workspaceUi","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WorkspaceUI","constructor","routeSlot","componentUi","menuSlot","menuItemSlot","sidebar","sidebarSlot","sidebarItemSlot","drawerWidgetSlot","drawerComponentsFiltersSlot","commandBarUI","menuWidgetSlot","menuItems","register","menuWidgets","routes","components","updateComponents","links","filters","widgets","category","title","keyChar","handler","run","registerRoutes","registerDrawers","drawers","registerDrawer","registerSidebarWidget","componentTreeNode","uiRoot","workspaceDrawer","treeWidgets","filtersSlot","setKeyBindHandler","addCommand","id","action","displayName","keybinding","path","element","createElement","Workspace","render","items","listSidebarItems","workspaceUI","onSidebarTogglerChange","flatten","values","compact","map","item","component","provider","ui","componentTree","graphUI","config","registerTreeNode","ComponentTreeWidget","registerComponentWidget","widget","registerDrawerComponentFilters","DeprecateFilter","EnvsFilter","ShowMainFilter","registerDrawerWidgets","FilterWidget","key","TreeToggleWidget","registerRoot","bind","registerMenuItem","registerSidebarLink","Gallery","MenuLinkItem","exact","href","icon","registerMenuRoutes","WorkspaceMenu","widgetSlot","routePath","getMenu","WorkspaceAspect","getComponentUI","registerMenuWidget","CommandBarButton","exports","UIAspect","ComponentAspect","SidebarAspect","ComponentTreeAspect","CommandBarAspect","GraphAspect","UIRuntime","Slot","withType","_default","addRuntime"],"sources":["workspace.ui.runtime.tsx"],"sourcesContent":["import { ComponentAspect, ComponentUI, ComponentModel } from '@teambit/component';\nimport { compact, flatten } from 'lodash';\nimport { ComponentTreeAspect, ComponentTreeUI, ComponentTreeNode } from '@teambit/component-tree';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport type { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { MenuWidgetSlot, MenuWidget } from '@teambit/ui-foundation.ui.menu';\nimport { SidebarAspect, SidebarUI, SidebarItem, SidebarItemSlot } from '@teambit/sidebar';\nimport { MenuItemSlot, MenuItem } from '@teambit/ui-foundation.ui.main-dropdown';\nimport { UIAspect, UIRootUI as UIRoot, UIRuntime, UiUI } from '@teambit/ui';\nimport { GraphAspect, GraphUI } from '@teambit/graph';\nimport React, { ReactNode } from 'react';\nimport { RouteProps } from 'react-router-dom';\nimport { CommandBarAspect, CommandBarUI, CommandHandler } from '@teambit/command-bar';\nimport { MenuLinkItem } from '@teambit/design.ui.surfaces.menu.link-item';\nimport type { DrawerType } from '@teambit/ui-foundation.ui.tree.drawer';\nimport { ComponentFilters } from '@teambit/component.ui.component-filters.component-filter-context';\nimport { DeprecateFilter } from '@teambit/component.ui.component-filters.deprecate-filter';\nimport { EnvsFilter } from '@teambit/component.ui.component-filters.env-filter';\nimport { ShowMainFilter } from '@teambit/component.ui.component-filters.show-main-filter';\nimport {\n DrawerWidgetSlot,\n FilterWidget,\n TreeToggleWidget,\n ComponentFiltersSlot,\n} from '@teambit/component.ui.component-drawer';\nimport { ComponentTreeWidget } from './component-tree.widget';\nimport { Workspace, WorkspaceMenu } from './ui';\nimport { WorkspaceAspect } from './workspace.aspect';\nimport { workspaceDrawer } from './workspace.ui.drawer';\n\nexport type SidebarWidgetSlot = SlotRegistry<ComponentTreeNode>;\n\nexport class WorkspaceUI {\n constructor(\n /**\n * route slot.\n */\n private routeSlot: RouteSlot,\n\n /**\n * component ui extension.\n */\n private componentUi: ComponentUI,\n\n /**\n * menu slot\n */\n private menuSlot: RouteSlot,\n\n private menuItemSlot: MenuItemSlot,\n\n private sidebar: SidebarUI,\n\n private sidebarSlot: SidebarWidgetSlot,\n\n /**\n * sidebar link slot\n */\n private sidebarItemSlot: SidebarItemSlot,\n\n private drawerWidgetSlot: DrawerWidgetSlot,\n\n private drawerComponentsFiltersSlot: ComponentFiltersSlot,\n\n private commandBarUI: CommandBarUI,\n\n private menuWidgetSlot: MenuWidgetSlot\n ) {}\n\n private setKeyBindHandler: (updated: CommandHandler) => void = () => {};\n\n /**\n * register a route to the workspace.\n */\n registerRoutes(routes: RouteProps[]) {\n this.routeSlot.register(routes);\n return this;\n }\n\n registerDrawers(...drawers: DrawerType[]) {\n this.sidebar.registerDrawer(...drawers);\n return this;\n }\n\n registerSidebarWidget(componentTreeNode: ComponentTreeNode) {\n this.sidebarSlot.register(componentTreeNode);\n return this;\n }\n\n registerMenuItem = (menuItems: MenuItem[]) => {\n this.menuItemSlot.register(menuItems);\n };\n\n registerMenuWidget = (menuWidgets: MenuWidget[]) => {\n this.menuWidgetSlot.register(menuWidgets);\n };\n\n registerMenuRoutes = (routes: RouteProps[]) => {\n this.menuSlot.register(routes);\n return this;\n };\n\n setComponents = (components: ComponentModel[]) => {\n this.componentUi.updateComponents(components);\n };\n\n registerSidebarLink = (...links: SidebarItem[]) => {\n this.sidebarItemSlot.register(links);\n };\n\n /**\n * register component filters\n */\n registerDrawerComponentFilters = (filters: ComponentFilters) => {\n this.drawerComponentsFiltersSlot.register(filters);\n };\n\n registerDrawerWidgets = (widgets: ReactNode[]) => {\n this.drawerWidgetSlot.register(widgets);\n };\n\n uiRoot(): UIRoot {\n this.registerDrawers(\n workspaceDrawer({\n treeWidgets: this.sidebarSlot,\n drawerWidgetSlot: this.drawerWidgetSlot,\n filtersSlot: this.drawerComponentsFiltersSlot,\n })\n );\n\n const [setKeyBindHandler] = this.commandBarUI.addCommand({\n id: 'sidebar.toggle', // TODO - extract to a component!\n action: () => {},\n displayName: 'Toggle component list',\n keybinding: 'alt+s',\n });\n this.setKeyBindHandler = setKeyBindHandler;\n\n return {\n routes: [\n {\n path: '/*',\n element: (\n <Workspace\n menuSlot={this.menuSlot}\n routeSlot={this.routeSlot}\n sidebar={<this.sidebar.render items={this.listSidebarItems()} />}\n workspaceUI={this}\n onSidebarTogglerChange={this.setKeyBindHandler}\n />\n ),\n },\n ],\n };\n }\n\n listSidebarItems() {\n const items = flatten(this.sidebarItemSlot.values());\n return compact(\n items.map((item) => {\n return item.component;\n })\n );\n }\n\n private menuItems: MenuItem[] = [\n {\n category: 'general',\n title: 'Open command bar',\n keyChar: 'mod+k',\n handler: () => this.commandBarUI?.run('command-bar.open'),\n },\n {\n category: 'general',\n title: 'Toggle component list',\n keyChar: 'alt+s',\n handler: () => this.commandBarUI?.run('sidebar.toggle'),\n },\n ];\n\n static dependencies = [UIAspect, ComponentAspect, SidebarAspect, ComponentTreeAspect, CommandBarAspect, GraphAspect];\n\n static runtime = UIRuntime;\n\n static slots = [\n Slot.withType<RouteProps>(),\n Slot.withType<RouteProps>(),\n Slot.withType<ComponentTreeNode>(),\n Slot.withType<MenuItemSlot>(),\n Slot.withType<SidebarItemSlot>(),\n Slot.withType<DrawerWidgetSlot>(),\n Slot.withType<ComponentFiltersSlot>(),\n Slot.withType<MenuWidgetSlot>(),\n ];\n\n static async provider(\n [ui, componentUi, sidebar, componentTree, commandBarUI, graphUI]: [\n UiUI,\n ComponentUI,\n SidebarUI,\n ComponentTreeUI,\n CommandBarUI,\n GraphUI,\n ],\n config,\n [\n routeSlot,\n menuSlot,\n menuItemSlot,\n sidebarSlot,\n sidebarItemSlot,\n drawerWidgetSlot,\n drawerComponentsFiltersSlot,\n menuWidgetSlot,\n ]: [\n RouteSlot,\n RouteSlot,\n MenuItemSlot,\n SidebarWidgetSlot,\n SidebarItemSlot,\n DrawerWidgetSlot,\n ComponentFiltersSlot,\n MenuWidgetSlot,\n ]\n ) {\n componentTree.registerTreeNode(new ComponentTreeWidget());\n sidebarSlot.register(new ComponentTreeWidget());\n graphUI.registerComponentWidget(new ComponentTreeWidget().widget);\n\n const workspaceUI = new WorkspaceUI(\n routeSlot,\n componentUi,\n menuSlot,\n menuItemSlot,\n sidebar,\n sidebarSlot,\n sidebarItemSlot,\n drawerWidgetSlot,\n drawerComponentsFiltersSlot,\n commandBarUI,\n menuWidgetSlot\n );\n\n workspaceUI.registerDrawerComponentFilters([DeprecateFilter, EnvsFilter, ShowMainFilter(true)]);\n workspaceUI.registerDrawerWidgets([\n <FilterWidget key={'workspace-filter-widget'} />,\n <TreeToggleWidget key={'workspace-tree-toggle-widget'} />,\n ]);\n ui.registerRoot(workspaceUI.uiRoot.bind(workspaceUI));\n workspaceUI.registerMenuItem(workspaceUI.menuItems);\n\n workspaceUI.registerSidebarLink({\n component: function Gallery() {\n return (\n <MenuLinkItem exact href=\"/\" icon=\"comps\">\n Workspace overview\n </MenuLinkItem>\n );\n },\n });\n\n workspaceUI.registerMenuRoutes([\n {\n path: '/',\n element: <WorkspaceMenu menuItemSlot={workspaceUI.menuItemSlot} widgetSlot={workspaceUI.menuWidgetSlot} />,\n },\n {\n path: workspaceUI.componentUi.routePath,\n element: workspaceUI.componentUi.getMenu(WorkspaceAspect.id),\n },\n ]);\n\n workspaceUI.registerRoutes([\n {\n path: workspaceUI.componentUi.routePath,\n element: workspaceUI.componentUi.getComponentUI(WorkspaceAspect.id),\n },\n ]);\n\n workspaceUI.registerMenuWidget([commandBarUI.CommandBarButton]);\n\n return workspaceUI;\n }\n}\n\nexport default WorkspaceUI;\n\nWorkspaceAspect.addRuntime(WorkspaceUI);\n"],"mappings":";;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,eAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,cAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,Q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LoG,eAAS;AAAAtH,eAAA,CAtJfkB,WAAW,WAwJP,CACbqG,eAAI,CAACC,QAAQ,CAAa,CAAC,EAC3BD,eAAI,CAACC,QAAQ,CAAa,CAAC,EAC3BD,eAAI,CAACC,QAAQ,CAAoB,CAAC,EAClCD,eAAI,CAACC,QAAQ,CAAe,CAAC,EAC7BD,eAAI,CAACC,QAAQ,CAAkB,CAAC,EAChCD,eAAI,CAACC,QAAQ,CAAmB,CAAC,EACjCD,eAAI,CAACC,QAAQ,CAAuB,CAAC,EACrCD,eAAI,CAACC,QAAQ,CAAiB,CAAC,CAChC;AAAA,IAAAC,QAAA,GAAAV,OAAA,CAAAhH,OAAA,GA4FYmB,WAAW;AAE1ByF,4BAAe,CAACe,UAAU,CAACxG,WAAW,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/workspace",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.483",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/workspace/workspace",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.workspace",
|
|
8
8
|
"name": "workspace",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.483"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -51,59 +51,61 @@
|
|
|
51
51
|
"@teambit/explorer.ui.gallery.component-grid": "0.0.496",
|
|
52
52
|
"@teambit/scopes.scope-id": "0.0.7",
|
|
53
53
|
"@teambit/workspace.ui.empty-workspace": "0.0.508",
|
|
54
|
-
"@teambit/component": "1.0.
|
|
55
|
-
"@teambit/dependency-resolver": "1.0.
|
|
56
|
-
"@teambit/envs": "1.0.
|
|
54
|
+
"@teambit/component": "1.0.483",
|
|
55
|
+
"@teambit/dependency-resolver": "1.0.483",
|
|
56
|
+
"@teambit/envs": "1.0.483",
|
|
57
57
|
"@teambit/legacy.bit-map": "0.0.55",
|
|
58
58
|
"@teambit/toolbox.fs.last-modified": "0.0.1",
|
|
59
59
|
"@teambit/toolbox.path.path": "0.0.4",
|
|
60
|
-
"@teambit/logger": "0.0.
|
|
61
|
-
"@teambit/scope": "1.0.
|
|
62
|
-
"@teambit/graph": "1.0.
|
|
63
|
-
"@teambit/cli": "0.0.
|
|
64
|
-
"@teambit/isolator": "1.0.
|
|
65
|
-
"@teambit/component-tree": "1.0.
|
|
60
|
+
"@teambit/logger": "0.0.1153",
|
|
61
|
+
"@teambit/scope": "1.0.483",
|
|
62
|
+
"@teambit/graph": "1.0.483",
|
|
63
|
+
"@teambit/cli": "0.0.1060",
|
|
64
|
+
"@teambit/isolator": "1.0.483",
|
|
65
|
+
"@teambit/component-tree": "1.0.483",
|
|
66
66
|
"@teambit/harmony.modules.resolved-component": "0.0.498",
|
|
67
67
|
"@teambit/legacy.utils": "0.0.7",
|
|
68
|
-
"@teambit/watcher": "1.0.
|
|
69
|
-
"@teambit/aspect-loader": "1.0.
|
|
70
|
-
"@teambit/config": "0.0.
|
|
71
|
-
"@teambit/global-config": "0.0.
|
|
68
|
+
"@teambit/watcher": "1.0.483",
|
|
69
|
+
"@teambit/aspect-loader": "1.0.483",
|
|
70
|
+
"@teambit/config": "0.0.1234",
|
|
71
|
+
"@teambit/global-config": "0.0.1063",
|
|
72
72
|
"@teambit/harmony.modules.requireable-component": "0.0.498",
|
|
73
73
|
"@teambit/toolbox.modules.module-resolver": "0.0.7",
|
|
74
74
|
"@teambit/workspace.modules.node-modules-linker": "0.0.226",
|
|
75
|
-
"@teambit/graphql": "1.0.
|
|
76
|
-
"@teambit/bundler": "1.0.
|
|
77
|
-
"@teambit/pubsub": "1.0.
|
|
78
|
-
"@teambit/ui": "1.0.
|
|
79
|
-
"@teambit/variants": "0.0.
|
|
75
|
+
"@teambit/graphql": "1.0.483",
|
|
76
|
+
"@teambit/bundler": "1.0.483",
|
|
77
|
+
"@teambit/pubsub": "1.0.483",
|
|
78
|
+
"@teambit/ui": "1.0.483",
|
|
79
|
+
"@teambit/variants": "0.0.1327",
|
|
80
80
|
"@teambit/component-issues": "0.0.151",
|
|
81
81
|
"@teambit/component.sources": "0.0.50",
|
|
82
82
|
"@teambit/harmony.modules.in-memory-cache": "0.0.2",
|
|
83
83
|
"@teambit/legacy.component-list": "0.0.52",
|
|
84
|
-
"@teambit/legacy.scope-api": "0.0.
|
|
84
|
+
"@teambit/legacy.scope-api": "0.0.53",
|
|
85
85
|
"@teambit/toolbox.path.is-path-inside": "0.0.496",
|
|
86
86
|
"@teambit/workspace.modules.match-pattern": "0.0.505",
|
|
87
|
-
"@teambit/component.ui.component-drawer": "0.0.
|
|
87
|
+
"@teambit/component.ui.component-drawer": "0.0.421",
|
|
88
88
|
"@teambit/lanes.hooks.use-lane-components": "0.0.271",
|
|
89
89
|
"@teambit/lanes.hooks.use-lanes": "0.0.274",
|
|
90
|
-
"@teambit/ui-foundation.ui.side-bar": "0.0.
|
|
91
|
-
"@teambit/command-bar": "1.0.
|
|
90
|
+
"@teambit/ui-foundation.ui.side-bar": "0.0.889",
|
|
91
|
+
"@teambit/command-bar": "1.0.483",
|
|
92
92
|
"@teambit/component.ui.component-filters.component-filter-context": "0.0.230",
|
|
93
93
|
"@teambit/component.ui.component-filters.deprecate-filter": "0.0.228",
|
|
94
94
|
"@teambit/component.ui.component-filters.env-filter": "0.0.241",
|
|
95
95
|
"@teambit/component.ui.component-filters.show-main-filter": "0.0.221",
|
|
96
|
-
"@teambit/sidebar": "1.0.
|
|
96
|
+
"@teambit/sidebar": "1.0.483",
|
|
97
97
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.512",
|
|
98
98
|
"@teambit/harmony.modules.concurrency": "0.0.1",
|
|
99
99
|
"@teambit/toolbox.promise.map-pool": "0.0.1",
|
|
100
|
+
"@teambit/workspace.ui.use-workspace-mode": "0.0.1",
|
|
100
101
|
"@teambit/component-descriptor": "0.0.428",
|
|
101
|
-
"@teambit/deprecation": "1.0.
|
|
102
|
+
"@teambit/deprecation": "1.0.483",
|
|
102
103
|
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.224",
|
|
104
|
+
"@teambit/workspace.ui.preserve-workspace-mode": "0.0.1",
|
|
103
105
|
"@teambit/cloud.hooks.use-cloud-scopes": "0.0.3",
|
|
104
106
|
"@teambit/design.ui.tooltip": "0.0.371",
|
|
105
107
|
"@teambit/preview.ui.preview-placeholder": "0.0.528",
|
|
106
|
-
"@teambit/workspace.ui.workspace-component-card": "0.0.
|
|
108
|
+
"@teambit/workspace.ui.workspace-component-card": "0.0.536"
|
|
107
109
|
},
|
|
108
110
|
"devDependencies": {
|
|
109
111
|
"@types/lodash": "4.14.165",
|
package/ui/index.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Menu, MenuProps } from '@teambit/ui-foundation.ui.menu';
|
|
3
|
+
import { useWorkspaceMode } from '@teambit/workspace.ui.use-workspace-mode';
|
|
4
|
+
|
|
5
|
+
export const WorkspaceMenu = ({ menuSlot, widgetSlot, menuItemSlot, className }: MenuProps) => {
|
|
6
|
+
const { isMinimal } = useWorkspaceMode();
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<Menu
|
|
10
|
+
menuSlot={menuSlot}
|
|
11
|
+
widgetSlot={widgetSlot}
|
|
12
|
+
menuItemSlot={isMinimal ? undefined : menuItemSlot}
|
|
13
|
+
className={className}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -10,12 +10,14 @@ import { ScopeID } from '@teambit/scopes.scope-id';
|
|
|
10
10
|
import { compact } from 'lodash';
|
|
11
11
|
import { WorkspaceComponentCard } from '@teambit/workspace.ui.workspace-component-card';
|
|
12
12
|
import type { ComponentCardPluginType, PluginProps } from '@teambit/explorer.ui.component-card';
|
|
13
|
+
import { useWorkspaceMode } from '@teambit/workspace.ui.use-workspace-mode';
|
|
13
14
|
import { WorkspaceContext } from '../workspace-context';
|
|
14
15
|
import styles from './workspace-overview.module.scss';
|
|
15
16
|
import { LinkPlugin } from './link-plugin';
|
|
16
17
|
|
|
17
18
|
export function WorkspaceOverview() {
|
|
18
19
|
const workspace = useContext(WorkspaceContext);
|
|
20
|
+
const { isMinimal } = useWorkspaceMode();
|
|
19
21
|
const compModelsById = new Map(workspace.components.map((comp) => [comp.id.toString(), comp]));
|
|
20
22
|
const { components, componentDescriptors } = workspace;
|
|
21
23
|
const uniqueScopes = new Set(components.map((c) => c.id.scope));
|
|
@@ -23,7 +25,7 @@ export function WorkspaceOverview() {
|
|
|
23
25
|
const { cloudScopes = [] } = useCloudScopes(uniqueScopesArr);
|
|
24
26
|
const cloudScopesById = new Map(cloudScopes.map((scope) => [scope.id.toString(), scope]));
|
|
25
27
|
|
|
26
|
-
const plugins = useCardPlugins({ compModelsById });
|
|
28
|
+
const plugins = useCardPlugins({ compModelsById, showPreview: isMinimal });
|
|
27
29
|
|
|
28
30
|
if (!components || components.length === 0) return <EmptyWorkspace name={workspace.name} />;
|
|
29
31
|
|
|
@@ -54,6 +56,7 @@ export function WorkspaceOverview() {
|
|
|
54
56
|
component={component}
|
|
55
57
|
plugins={plugins}
|
|
56
58
|
scope={scope}
|
|
59
|
+
shouldShowPreviewState={isMinimal}
|
|
57
60
|
/>
|
|
58
61
|
);
|
|
59
62
|
})}
|
|
@@ -64,8 +67,10 @@ export function WorkspaceOverview() {
|
|
|
64
67
|
|
|
65
68
|
export function useCardPlugins({
|
|
66
69
|
compModelsById,
|
|
70
|
+
showPreview,
|
|
67
71
|
}: {
|
|
68
72
|
compModelsById: Map<string, ComponentModel>;
|
|
73
|
+
showPreview?: boolean;
|
|
69
74
|
}): ComponentCardPluginType<PluginProps>[] {
|
|
70
75
|
const plugins = React.useMemo(
|
|
71
76
|
() => [
|
|
@@ -77,7 +82,7 @@ export function useCardPlugins({
|
|
|
77
82
|
<PreviewPlaceholder
|
|
78
83
|
componentDescriptor={component}
|
|
79
84
|
component={compModel}
|
|
80
|
-
shouldShowPreview={shouldShowPreview}
|
|
85
|
+
shouldShowPreview={showPreview || shouldShowPreview}
|
|
81
86
|
/>
|
|
82
87
|
);
|
|
83
88
|
},
|
|
@@ -13,7 +13,9 @@ import { SplitPane, Pane, Layout } from '@teambit/base-ui.surfaces.split-pane.sp
|
|
|
13
13
|
import { useThemePicker } from '@teambit/base-react.themes.theme-switcher';
|
|
14
14
|
import { HoverSplitter } from '@teambit/base-ui.surfaces.split-pane.hover-splitter';
|
|
15
15
|
import { TopBar } from '@teambit/ui-foundation.ui.top-bar';
|
|
16
|
+
import { PreserveWorkspaceMode } from '@teambit/workspace.ui.preserve-workspace-mode';
|
|
16
17
|
import classNames from 'classnames';
|
|
18
|
+
import { useWorkspaceMode } from '@teambit/workspace.ui.use-workspace-mode';
|
|
17
19
|
|
|
18
20
|
import { useWorkspace } from './use-workspace';
|
|
19
21
|
import { WorkspaceOverview } from './workspace-overview';
|
|
@@ -33,6 +35,7 @@ export type WorkspaceProps = {
|
|
|
33
35
|
* main workspace component.
|
|
34
36
|
*/
|
|
35
37
|
export function Workspace({ routeSlot, menuSlot, sidebar, workspaceUI, onSidebarTogglerChange }: WorkspaceProps) {
|
|
38
|
+
const { isMinimal } = useWorkspaceMode();
|
|
36
39
|
const reactions = useComponentNotifications();
|
|
37
40
|
const { workspace } = useWorkspace(reactions);
|
|
38
41
|
const theme = useThemePicker();
|
|
@@ -57,38 +60,41 @@ export function Workspace({ routeSlot, menuSlot, sidebar, workspaceUI, onSidebar
|
|
|
57
60
|
|
|
58
61
|
return (
|
|
59
62
|
<WorkspaceProvider workspace={workspace}>
|
|
60
|
-
<
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
<PreserveWorkspaceMode>
|
|
64
|
+
<div className={styles.workspaceWrapper}>
|
|
65
|
+
{
|
|
66
|
+
<TopBar
|
|
67
|
+
className={classNames(styles.topbar, styles[themeName])}
|
|
68
|
+
Corner={() => (
|
|
69
|
+
<Corner
|
|
70
|
+
className={classNames((isMinimal && styles.minimalCorner) || styles.corner, styles[themeName])}
|
|
71
|
+
name={workspace.name}
|
|
72
|
+
icon={workspace.icon}
|
|
73
|
+
/>
|
|
74
|
+
)}
|
|
75
|
+
menu={menuSlot}
|
|
68
76
|
/>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
</SplitPane>
|
|
91
|
-
</div>
|
|
77
|
+
}
|
|
78
|
+
<SplitPane className={styles.main} size={246} layout={sidebarOpenness}>
|
|
79
|
+
<Pane className={classNames(styles.sidebar, styles[themeName], !isSidebarOpen && styles.closed)}>
|
|
80
|
+
{sidebar}
|
|
81
|
+
</Pane>
|
|
82
|
+
<HoverSplitter className={styles.splitter}>
|
|
83
|
+
<Collapser
|
|
84
|
+
isOpen={isSidebarOpen}
|
|
85
|
+
onMouseDown={(e) => e.stopPropagation()} // avoid split-pane drag
|
|
86
|
+
onClick={handleSidebarToggle}
|
|
87
|
+
tooltipContent={`${isSidebarOpen ? 'Hide' : 'Show'} side panel`}
|
|
88
|
+
/>
|
|
89
|
+
</HoverSplitter>
|
|
90
|
+
<Pane>
|
|
91
|
+
<SlotRouter slot={routeSlot}>
|
|
92
|
+
<Route index element={<WorkspaceOverview />} />
|
|
93
|
+
</SlotRouter>
|
|
94
|
+
</Pane>
|
|
95
|
+
</SplitPane>
|
|
96
|
+
</div>
|
|
97
|
+
</PreserveWorkspaceMode>
|
|
92
98
|
</WorkspaceProvider>
|
|
93
99
|
);
|
|
94
100
|
}
|
package/workspace.ui.runtime.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { compact, flatten } from 'lodash';
|
|
|
3
3
|
import { ComponentTreeAspect, ComponentTreeUI, ComponentTreeNode } from '@teambit/component-tree';
|
|
4
4
|
import { Slot, SlotRegistry } from '@teambit/harmony';
|
|
5
5
|
import type { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
6
|
-
import {
|
|
6
|
+
import { MenuWidgetSlot, MenuWidget } from '@teambit/ui-foundation.ui.menu';
|
|
7
7
|
import { SidebarAspect, SidebarUI, SidebarItem, SidebarItemSlot } from '@teambit/sidebar';
|
|
8
8
|
import { MenuItemSlot, MenuItem } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
9
9
|
import { UIAspect, UIRootUI as UIRoot, UIRuntime, UiUI } from '@teambit/ui';
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
ComponentFiltersSlot,
|
|
25
25
|
} from '@teambit/component.ui.component-drawer';
|
|
26
26
|
import { ComponentTreeWidget } from './component-tree.widget';
|
|
27
|
-
import { Workspace } from './ui';
|
|
27
|
+
import { Workspace, WorkspaceMenu } from './ui';
|
|
28
28
|
import { WorkspaceAspect } from './workspace.aspect';
|
|
29
29
|
import { workspaceDrawer } from './workspace.ui.drawer';
|
|
30
30
|
|
|
@@ -262,7 +262,7 @@ export class WorkspaceUI {
|
|
|
262
262
|
workspaceUI.registerMenuRoutes([
|
|
263
263
|
{
|
|
264
264
|
path: '/',
|
|
265
|
-
element: <
|
|
265
|
+
element: <WorkspaceMenu menuItemSlot={workspaceUI.menuItemSlot} widgetSlot={workspaceUI.menuWidgetSlot} />,
|
|
266
266
|
},
|
|
267
267
|
{
|
|
268
268
|
path: workspaceUI.componentUi.routePath,
|