@teambit/scope 1.0.397 → 1.0.399

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,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.scope/scope@1.0.397" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.scope/scope@1.0.399" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see teambit_scope_scope-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.scope/scope-preview"]=t():e["teambit.scope/scope-preview"]=t()}(self,(()=>(()=>{var e={88443:(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 i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)&&n.length){var a=r.apply(null,n);a&&e.push(a)}else if("object"===i)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)}()},69685:(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 i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=r.apply(null,n);a&&e.push(a)}}else if("object"===i)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)}()},78552:()=>{!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)})}}()},41486:(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},97364:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(41594);t.default=function(e){o.useEffect(e,[])}},7654:(e,t,n)=>{"use strict";var o=n(41594),r=n(41486),i=r.isBrowser?window:null,a=function(e){return!!e.addEventListener},s=function(e){return!!e.on};t.A=function(e,t,n,c){void 0===n&&(n=i),o.useEffect((function(){if(t&&n)return a(n)?r.on(n,e,t,c):s(n)&&n.on(e,t,c),function(){a(n)?r.off(n,e,t,c):s(n)&&n.off(e,t,c)}}),[e,t,n,JSON.stringify(c)])}},32818:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(48184),r=n(41594),i=o.__importDefault(n(47542));t.default=function(e){var t=r.useRef(0),n=r.useState(e),o=n[0],a=n[1],s=r.useCallback((function(e){cancelAnimationFrame(t.current),t.current=requestAnimationFrame((function(){a(e)}))}),[]);return i.default((function(){cancelAnimationFrame(t.current)})),[o,s]}},47542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(48184),r=n(41594),i=o.__importDefault(n(97364));t.default=function(e){var t=r.useRef(e);t.current=e,i.default((function(){return function(){return t.current()}}))}},99801:(e,t,n)=>{"use strict";var o=n(48184),r=n(41594),i=o.__importDefault(n(32818)),a=n(41486);t.A=function(e,t){void 0===e&&(e=1/0),void 0===t&&(t=1/0);var n=i.default({width:a.isBrowser?window.innerWidth:e,height:a.isBrowser?window.innerHeight:t}),o=n[0],s=n[1];return r.useEffect((function(){if(a.isBrowser){var e=function(){s({width:window.innerWidth,height:window.innerHeight})};return a.on(window,"resize",e),function(){a.off(window,"resize",e)}}}),[]),o}},64410: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 i=r(n(41594)),a=r(n(88443)),s=r(n(88579));function c(e){var{alt:t,className:n,fullWidth:r}=e,c=o(e,["alt","className","fullWidth"]);return i.default.createElement("img",Object.assign({"data-bit-id":"teambit.base-ui/elements/image",alt:t},c,{className:a.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},37855: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(64410),t)},77608:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Image:()=>y});var o=n(41594),r=n.n(o),i=n(69685),a=n.n(i);n(78552);const s=ReactDom;var c=n(7654),l=n(99801),u=n(48184),p=function(e){return e+"ms"},f={getBoundingClientRect:function(){return{height:0,left:0,top:0,width:0}},style:{transform:null}},d=(0,o.memo)((function(e){var t=e.children,n=e.closeText,i=void 0===n?"Unzoom Image":n,a=e.onUnload,d=e.onLoad,m=e.overlayBgColorEnd,h=void 0===m?"rgba(255, 255, 255, 0.95)":m,y=e.overlayBgColorStart,v=void 0===y?"rgba(255, 255, 255, 0)":y,b=e.parentRef,g=e.portalEl,_=void 0===g?document.body:g,w=e.scrollableEl,x=void 0===w?window:w,O=e.transitionDuration,j=void 0===O?300:O,S=e.zoomMargin,P=void 0===S?0:S,E=e.zoomZindex,T=void 0===E?2147483647:E,k=(0,o.useRef)(null),M=(0,o.useState)(0)[1],D=(0,o.useState)(!1),I=D[0],C=D[1],A=(0,o.useState)(!1),z=A[0],B=A[1],N=(0,l.A)(),L=N.width,R=N.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(){M((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(){C(!0),d(),k.current&&k.current.focus({preventScroll:!0})}),[d]),(0,o.useEffect)((function(){var e=z?setTimeout(a,j):null;return function(){e&&clearTimeout(e)}}),[z,a,j]);var X=b.current||f,U=X.getBoundingClientRect(),G=U.height,Z=U.left,$=U.top,J=U.width,V=function(e){var t=e.isLoaded,n=e.isUnloading,o=e.overlayBgColorEnd,r=e.zoomZindex,i={backgroundColor:e.overlayBgColorStart,transitionDuration:p(e.transitionDuration),zIndex:r};return t&&!n&&(i.backgroundColor=o),i}({isLoaded:I,isUnloading:z,overlayBgColorEnd:h,overlayBgColorStart:v,transitionDuration:j,zoomZindex:T}),Y=function(e){var t=e.height,n=e.innerHeight,o=e.innerWidth,r=e.isLoaded,i=e.isUnloading,a=e.left,s=e.originalTransform,c=e.top,l=e.transitionDuration,f=e.width,d=e.zoomMargin,m=p(l);if(!r||i){var h=(0,u.__spreadArrays)(["scale(1)","translate(0, 0)"],s?[s]:[]).join(" ");return{height:t,left:a,top:c,transform:h,WebkitTransform:h,transitionDuration:m,width:f}}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:f,zoomMargin:d}),v=(o/2-(a+f/2))/y,b=(n/2-(c+t/2))/y,g=(0,u.__spreadArrays)(["scale("+y+")","translate("+v+"px, "+b+"px)"],s?[s]:[]).join(" ");return{height:t,left:a,top:c,transform:g,WebkitTransform:g,transitionDuration:m,width:f}}({height:G,isLoaded:I,innerHeight:R,innerWidth:L,isUnloading:z,left:Z,originalTransform:X.style.transform,top:$,transitionDuration:j,width:J,zoomMargin:P});return(0,s.createPortal)(r().createElement("div",{"aria-modal":!0,"data-rmiz-overlay":!0,role:"dialog",style:V},r().createElement("div",{"data-rmiz-modal-content":!0,style:Y},t),r().createElement("button",{"aria-label":i,"data-rmiz-btn-close":!0,onClick:W,ref:k})),_)}));const m=(0,o.memo)((function(e){var t=e.children,n=e.closeText,i=void 0===n?"Unzoom image":n,a=e.overlayBgColorEnd,s=void 0===a?"rgba(255, 255, 255, 0.95)":a,c=e.overlayBgColorStart,l=void 0===c?"rgba(255, 255, 255, 0)":c,u=e.portalEl,p=e.openText,f=void 0===p?"Zoom image":p,m=e.scrollableEl,h=e.transitionDuration,y=void 0===h?300:h,v=e.wrapElement,b=void 0===v?"div":v,g=e.wrapStyle,_=e.zoomMargin,w=void 0===_?0:_,x=e.zoomZindex,O=void 0===x?2147483647:x,j=(0,o.useState)(!1),S=j[0],P=j[1],E=(0,o.useState)(!1),T=E[0],k=E[1],M=(0,o.useRef)(null),D=(0,o.useRef)(null),I=(0,o.useCallback)((function(e){S||(e.preventDefault(),P(!0))}),[S]),C=(0,o.useCallback)((function(){k(!0)}),[]),A=(0,o.useCallback)((function(){P(!1),k(!1),D.current&&D.current.focus({preventScroll:!0})}),[]),z=S&&T?"hidden":"visible";return r().createElement(o.StrictMode,null,r().createElement(b,{"data-rmiz-wrap":z,ref:M,style:g},t,r().createElement("button",{"aria-label":f,"data-rmiz-btn-open":!0,onClick:I,ref:D}),"undefined"!=typeof window&&S&&r().createElement(d,{closeText:i,onLoad:C,onUnload:A,overlayBgColorEnd:s,overlayBgColorStart:l,parentRef:M,portalEl:u,scrollableEl:m,transitionDuration:y,zoomMargin:w,zoomZindex:O},t)))}));var h=n(37855);const y=e=>{var{center:t=!0,width:n,alt:o,src:i,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:a()(t&&"image_center__6-xCb",s)},r().createElement(m,null,r().createElement(h.BaseImage,Object.assign({fullWidth:!0,alt:o,src:i},c))))};y.__bit_component={id:"teambit.docs/ui/zoomable-image@1.95.0",homepage:"https://bit.dev/teambit/docs/ui/zoomable-image",exported:!0}},56303:(e,t,n)=>{"use strict";Object.defineProperty(t,"Ay",{enumerable:!0,get:function(){return o.default}});var o=r(n(36010));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.scope/content/scope-overview@1.95.0",homepage:"https://bit.dev/teambit/scope/content/scope-overview",exported:!0}},36010:(e,t,n)=>{"use strict";var o={id:"teambit.scope/content/scope-overview@1.95.0",homepage:"https://bit.dev/teambit/scope/content/scope-overview",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=v,p(n(41594));var r=n(5016),i=n(65682),a=p(n(78199)),s=p(n(37080)),c=p(n(50758)),l=n(77608),u=["components"];function p(e){return e&&e.__esModule?e:{default:e}}function f(){return f=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},f.apply(this,arguments)}function d(e,t){if(null==e)return{};var n,o,r=m(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}p.__bit_component=o,f.__bit_component=o,d.__bit_component=o,m.__bit_component=o;var h={},y="wrapper";function v(e){var t=e.components,n=d(e,u);return(0,r.mdx)(y,f({},h,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{scopeImage:a.default,scopeGraph:s.default,componentTypes:c.default,Image:l.Image},mdxType:"MDXScopeProvider"},(0,r.mdx)("h1",null,"Scope Overview"),(0,r.mdx)("p",null,"Scope is a server for hosting components. Scopes help teams to share and use each other's components as by preserving team autonomy through versioning, forking, storing dependencies, and collaborate on changes of independent components.\nScopes defines ownership on components, as a single team owns the components exported to scope."),(0,r.mdx)(l.Image,{width:"70%",src:a.default,mdxType:"Image"}),(0,r.mdx)("h2",null,"Full stack of functionality"),(0,r.mdx)("p",null,"Scopes host components of any kind, from React, Angular and Node modules, all the way to a frontend apps or microservices. For a scope they are all Bit Components.",(0,r.mdx)("br",{parentName:"p"}),"\n","For example, the ",(0,r.mdx)("a",{parentName:"p",href:"https://bit.dev/teambit/mdx"},"MDX scope"),' contains all components relevant to handling MDX functionality in Bit. It exposes various types of components (or "APIs") to achieve this: Webpack loader, Node modules, React components and even a ',(0,r.mdx)("a",{parentName:"p",href:"/"},"Bit Aspect"),". This makes it easy for other teams to take leverage of MDX, not just as a feature but also as an API for their features."),(0,r.mdx)("p",null,"Scopes support various methods for using components, from adding as dependencies to runtime integrations, allowing the consumer to decide how whats the best solution for their use case."),(0,r.mdx)(l.Image,{width:"70%",src:c.default,mdxType:"Image"}),(0,r.mdx)("h2",null,"Team collaboration using components"),(0,r.mdx)("p",null,"Scopes provides visibility to components built by other teams, this is the first step towards better collaboration. Developers can find, use and depend on components by other teams. Instead of reinventing the wheel and rebuilding the same functionality, component visibility drives for collaboration. It is similar to how teams build with microservices and build team communication and collaboration by using each-other's APIs.",(0,r.mdx)("br",{parentName:"p"}),"\n","Moreover, developers can use ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit import")," and access to any component's source code and contribute change to collaborate on components."),(0,r.mdx)("p",null,"Bit keeps track on all these dependencies and flows, making team collaboration visible, easy to extend and optimize."),(0,r.mdx)(l.Image,{width:"70%",src:s.default,mdxType:"Image"}),(0,r.mdx)("h2",null,"Distributed and autonomous"),(0,r.mdx)("p",null,"Hosted scopes form a distributed network, where each scope is connected to the other scopes according to component dependencies. Each scope stores not only the components it hosts, but also the dependencies of those components.",(0,r.mdx)("br",{parentName:"p"}),"\n","When you export a component, the scope then does network calls to fetch the dependencies of the component from their respective scopes. This means that each scope becomes autonomous, as it contains all the dependencies needed to its components to run. In turn this makes teams more autonomous, as they can now build and use their components without having to worry about the dependencies."),(0,r.mdx)("p",null,"Scopes use standard HTTP for inner-scope communication, however, when building a network of scopes, you need to ensure scopes are able to connect to one another to fetch dependencies."),(0,r.mdx)("h2",null,"Source of truth"),(0,r.mdx)("p",null,"Scopes become the source of truth for components. Allowing different stakeholders to collaborate and work together from the same, or from different Workspaces.\nComponents can be maintained from multiple Workspaces in parallel, while Scopes are keeping them in sync, merging changes for all ends."),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"bit import")," can be used to fetch component updates. Using ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit import")," is similar to using ",(0,r.mdx)("inlineCode",{parentName:"p"},"git fetch")," where new objects are being fetched but not checked out in your workspace. "),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"$ bit import\n⡃⢐ fetching 143 components from 18 remotes. delta-only: 143, all-history: 0.\n- up to date teambit.community/ui/hero \n- up to date teambit.community/ui/homepage/sections/distribution \n- updated teambit.design/ui/layouts/sections/left-right \n- updated teambit.design/ui/layouts/sections/section-group \n- updated teambit.design/ui/layouts/sections/top-down \n")),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"bit export")," is used to share component changes with others. It pushes new objects from a local Workspace to a remote Scope, allowing others to keep in sync with the latest\ncomponent changes."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"$ bit export\nexported 8 components successfully to remote scope `community`\n"))))}v.__bit_component=o,v.isMDXComponent=!0},57598:(e,t,n)=>{"use strict";var o={id:"teambit.scope/scope@1.0.397",homepage:"https://bit.cloud/teambit/scope/scope",exported:!0};function r(){const e=i(n(41594));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=o,i.__bit_component=o;const a=()=>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/scope.svg"}));a.__bit_component=o,t.Logo=a},88579:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={fullWidth:"image_fullWidth__sELLz"}},50758:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/3a1072c009accd203fa8.png"},37080:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/ccf5ea377e3a1a72829d.png"},78199:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/aef2176d16de53259dad.png"},5016:e=>{"use strict";e.exports=MdxJsReact},41594:e=>{"use strict";e.exports=React},65682:e=>{"use strict";e.exports=TeambitMdxUiMdxScopeContext},48184:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>A,__assign:()=>i,__asyncDelegator:()=>S,__asyncGenerator:()=>j,__asyncValues:()=>P,__await:()=>O,__awaiter:()=>m,__classPrivateFieldGet:()=>D,__classPrivateFieldIn:()=>C,__classPrivateFieldSet:()=>I,__createBinding:()=>y,__decorate:()=>s,__disposeResources:()=>B,__esDecorate:()=>l,__exportStar:()=>v,__extends:()=>r,__generator:()=>h,__importDefault:()=>M,__importStar:()=>k,__makeTemplateObject:()=>E,__metadata:()=>d,__param:()=>c,__propKey:()=>p,__read:()=>g,__rest:()=>a,__runInitializers:()=>u,__setFunctionName:()=>f,__spread:()=>_,__spreadArray:()=>x,__spreadArrays:()=>w,__values:()=>b,default:()=>N});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 i=function(){return i=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},i.apply(this,arguments)};function a(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,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function c(e,t){return function(n,o){t(n,o,e)}}function l(e,t,n,o,r,i){function a(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",u=!t&&e?o.static?e:e.prototype:null,p=t||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),f=!1,d=n.length-1;d>=0;d--){var m={};for(var h in o)m[h]="access"===h?{}:o[h];for(var h in o.access)m.access[h]=o.access[h];m.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var y=(0,n[d])("accessor"===c?{get:p.get,set:p.set}:p[l],m);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=a(y.get))&&(p.get=s),(s=a(y.set))&&(p.set=s),(s=a(y.init))&&r.unshift(s)}else(s=a(y))&&("field"===c?r.unshift(s):p[l]=s)}u&&Object.defineProperty(u,o.name,p),f=!0}function u(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 p(e){return"symbol"==typeof e?e:"".concat(e)}function f(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 d(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function m(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(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(a,s)}c((o=o.apply(e,t||[])).next())}))}function h(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)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 i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((r=(r=i.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}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 b(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 g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function _(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function w(){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 i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o}function x(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;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 j(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),i=[];return o=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,l)}})),o[Symbol.asyncIterator]=function(){return this},o;function a(e,t){r[e]&&(o[e]=function(t){return new Promise((function(n,o){i.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):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function S(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 P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=b(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 E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var T=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function k(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&y(t,e,n);return T(t,e),t}function M(e){return e&&e.__esModule?e:{default:e}}function D(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 I(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 C(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 A(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 z="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 B(e){function t(t){e.error=e.hasError?new z(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 i=n.dispose.call(n.value);if(n.async)return o|=2,Promise.resolve(i).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}()}const N={__extends:r,__assign:i,__rest:a,__decorate:s,__param:c,__metadata:d,__awaiter:m,__generator:h,__createBinding:y,__exportStar:v,__values:b,__read:g,__spread:_,__spreadArrays:w,__spreadArray:x,__await:O,__asyncGenerator:j,__asyncDelegator:S,__asyncValues:P,__makeTemplateObject:E,__importStar:k,__importDefault:M,__classPrivateFieldGet:D,__classPrivateFieldSet:I,__classPrivateFieldIn:C,__addDisposableResource:A,__disposeResources:B}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.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&&(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:()=>f,compositions_metadata:()=>m,overview:()=>d});var e={};n.r(e),n.d(e,{default:()=>p});var t=n(57598),r=(n(41594),n(5016)),i=n(65682),a=n(56303),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={},u="wrapper";function p(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 i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,s);return(0,r.mdx)(u,c({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{ScopeOverview:a.Ay},mdxType:"MDXScopeProvider"},(0,r.mdx)(a.Ay,{mdxType:"ScopeOverview"})))}p.isMDXComponent=!0;const f=[t],d=[e],m={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.scope/scope-preview"]=t():e["teambit.scope/scope-preview"]=t()}(self,(()=>(()=>{var e={88443:(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 i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)&&n.length){var a=r.apply(null,n);a&&e.push(a)}else if("object"===i)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)}()},69685:(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 i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=r.apply(null,n);a&&e.push(a)}}else if("object"===i)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)}()},78552:()=>{!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)})}}()},41486:(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},97364:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(41594);t.default=function(e){o.useEffect(e,[])}},7654:(e,t,n)=>{"use strict";var o=n(41594),r=n(41486),i=r.isBrowser?window:null,a=function(e){return!!e.addEventListener},s=function(e){return!!e.on};t.A=function(e,t,n,c){void 0===n&&(n=i),o.useEffect((function(){if(t&&n)return a(n)?r.on(n,e,t,c):s(n)&&n.on(e,t,c),function(){a(n)?r.off(n,e,t,c):s(n)&&n.off(e,t,c)}}),[e,t,n,JSON.stringify(c)])}},32818:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(48184),r=n(41594),i=o.__importDefault(n(47542));t.default=function(e){var t=r.useRef(0),n=r.useState(e),o=n[0],a=n[1],s=r.useCallback((function(e){cancelAnimationFrame(t.current),t.current=requestAnimationFrame((function(){a(e)}))}),[]);return i.default((function(){cancelAnimationFrame(t.current)})),[o,s]}},47542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(48184),r=n(41594),i=o.__importDefault(n(97364));t.default=function(e){var t=r.useRef(e);t.current=e,i.default((function(){return function(){return t.current()}}))}},99801:(e,t,n)=>{"use strict";var o=n(48184),r=n(41594),i=o.__importDefault(n(32818)),a=n(41486);t.A=function(e,t){void 0===e&&(e=1/0),void 0===t&&(t=1/0);var n=i.default({width:a.isBrowser?window.innerWidth:e,height:a.isBrowser?window.innerHeight:t}),o=n[0],s=n[1];return r.useEffect((function(){if(a.isBrowser){var e=function(){s({width:window.innerWidth,height:window.innerHeight})};return a.on(window,"resize",e),function(){a.off(window,"resize",e)}}}),[]),o}},48485: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 i=r(n(41594)),a=r(n(88443)),s=r(n(58712));function c(e){var{alt:t,className:n,fullWidth:r}=e,c=o(e,["alt","className","fullWidth"]);return i.default.createElement("img",Object.assign({"data-bit-id":"teambit.base-ui/elements/image",alt:t},c,{className:a.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},64520: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(48485),t)},30265:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Image:()=>y});var o=n(41594),r=n.n(o),i=n(69685),a=n.n(i);n(78552);const s=ReactDom;var c=n(7654),l=n(99801),u=n(48184),p=function(e){return e+"ms"},f={getBoundingClientRect:function(){return{height:0,left:0,top:0,width:0}},style:{transform:null}},d=(0,o.memo)((function(e){var t=e.children,n=e.closeText,i=void 0===n?"Unzoom Image":n,a=e.onUnload,d=e.onLoad,m=e.overlayBgColorEnd,h=void 0===m?"rgba(255, 255, 255, 0.95)":m,y=e.overlayBgColorStart,v=void 0===y?"rgba(255, 255, 255, 0)":y,b=e.parentRef,g=e.portalEl,_=void 0===g?document.body:g,w=e.scrollableEl,x=void 0===w?window:w,O=e.transitionDuration,j=void 0===O?300:O,S=e.zoomMargin,P=void 0===S?0:S,E=e.zoomZindex,T=void 0===E?2147483647:E,k=(0,o.useRef)(null),M=(0,o.useState)(0)[1],D=(0,o.useState)(!1),I=D[0],C=D[1],A=(0,o.useState)(!1),z=A[0],B=A[1],N=(0,l.A)(),L=N.width,R=N.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(){M((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(){C(!0),d(),k.current&&k.current.focus({preventScroll:!0})}),[d]),(0,o.useEffect)((function(){var e=z?setTimeout(a,j):null;return function(){e&&clearTimeout(e)}}),[z,a,j]);var X=b.current||f,U=X.getBoundingClientRect(),G=U.height,Z=U.left,$=U.top,J=U.width,V=function(e){var t=e.isLoaded,n=e.isUnloading,o=e.overlayBgColorEnd,r=e.zoomZindex,i={backgroundColor:e.overlayBgColorStart,transitionDuration:p(e.transitionDuration),zIndex:r};return t&&!n&&(i.backgroundColor=o),i}({isLoaded:I,isUnloading:z,overlayBgColorEnd:h,overlayBgColorStart:v,transitionDuration:j,zoomZindex:T}),Y=function(e){var t=e.height,n=e.innerHeight,o=e.innerWidth,r=e.isLoaded,i=e.isUnloading,a=e.left,s=e.originalTransform,c=e.top,l=e.transitionDuration,f=e.width,d=e.zoomMargin,m=p(l);if(!r||i){var h=(0,u.__spreadArrays)(["scale(1)","translate(0, 0)"],s?[s]:[]).join(" ");return{height:t,left:a,top:c,transform:h,WebkitTransform:h,transitionDuration:m,width:f}}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:f,zoomMargin:d}),v=(o/2-(a+f/2))/y,b=(n/2-(c+t/2))/y,g=(0,u.__spreadArrays)(["scale("+y+")","translate("+v+"px, "+b+"px)"],s?[s]:[]).join(" ");return{height:t,left:a,top:c,transform:g,WebkitTransform:g,transitionDuration:m,width:f}}({height:G,isLoaded:I,innerHeight:R,innerWidth:L,isUnloading:z,left:Z,originalTransform:X.style.transform,top:$,transitionDuration:j,width:J,zoomMargin:P});return(0,s.createPortal)(r().createElement("div",{"aria-modal":!0,"data-rmiz-overlay":!0,role:"dialog",style:V},r().createElement("div",{"data-rmiz-modal-content":!0,style:Y},t),r().createElement("button",{"aria-label":i,"data-rmiz-btn-close":!0,onClick:W,ref:k})),_)}));const m=(0,o.memo)((function(e){var t=e.children,n=e.closeText,i=void 0===n?"Unzoom image":n,a=e.overlayBgColorEnd,s=void 0===a?"rgba(255, 255, 255, 0.95)":a,c=e.overlayBgColorStart,l=void 0===c?"rgba(255, 255, 255, 0)":c,u=e.portalEl,p=e.openText,f=void 0===p?"Zoom image":p,m=e.scrollableEl,h=e.transitionDuration,y=void 0===h?300:h,v=e.wrapElement,b=void 0===v?"div":v,g=e.wrapStyle,_=e.zoomMargin,w=void 0===_?0:_,x=e.zoomZindex,O=void 0===x?2147483647:x,j=(0,o.useState)(!1),S=j[0],P=j[1],E=(0,o.useState)(!1),T=E[0],k=E[1],M=(0,o.useRef)(null),D=(0,o.useRef)(null),I=(0,o.useCallback)((function(e){S||(e.preventDefault(),P(!0))}),[S]),C=(0,o.useCallback)((function(){k(!0)}),[]),A=(0,o.useCallback)((function(){P(!1),k(!1),D.current&&D.current.focus({preventScroll:!0})}),[]),z=S&&T?"hidden":"visible";return r().createElement(o.StrictMode,null,r().createElement(b,{"data-rmiz-wrap":z,ref:M,style:g},t,r().createElement("button",{"aria-label":f,"data-rmiz-btn-open":!0,onClick:I,ref:D}),"undefined"!=typeof window&&S&&r().createElement(d,{closeText:i,onLoad:C,onUnload:A,overlayBgColorEnd:s,overlayBgColorStart:l,parentRef:M,portalEl:u,scrollableEl:m,transitionDuration:y,zoomMargin:w,zoomZindex:O},t)))}));var h=n(64520);const y=e=>{var{center:t=!0,width:n,alt:o,src:i,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:a()(t&&"image_center__6-xCb",s)},r().createElement(m,null,r().createElement(h.BaseImage,Object.assign({fullWidth:!0,alt:o,src:i},c))))};y.__bit_component={id:"teambit.docs/ui/zoomable-image@1.95.0",homepage:"https://bit.dev/teambit/docs/ui/zoomable-image",exported:!0}},22882:(e,t,n)=>{"use strict";Object.defineProperty(t,"Ay",{enumerable:!0,get:function(){return o.default}});var o=r(n(7969));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.scope/content/scope-overview@1.95.0",homepage:"https://bit.dev/teambit/scope/content/scope-overview",exported:!0}},7969:(e,t,n)=>{"use strict";var o={id:"teambit.scope/content/scope-overview@1.95.0",homepage:"https://bit.dev/teambit/scope/content/scope-overview",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=v,p(n(41594));var r=n(5016),i=n(65682),a=p(n(78199)),s=p(n(37080)),c=p(n(50758)),l=n(30265),u=["components"];function p(e){return e&&e.__esModule?e:{default:e}}function f(){return f=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},f.apply(this,arguments)}function d(e,t){if(null==e)return{};var n,o,r=m(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}p.__bit_component=o,f.__bit_component=o,d.__bit_component=o,m.__bit_component=o;var h={},y="wrapper";function v(e){var t=e.components,n=d(e,u);return(0,r.mdx)(y,f({},h,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{scopeImage:a.default,scopeGraph:s.default,componentTypes:c.default,Image:l.Image},mdxType:"MDXScopeProvider"},(0,r.mdx)("h1",null,"Scope Overview"),(0,r.mdx)("p",null,"Scope is a server for hosting components. Scopes help teams to share and use each other's components as by preserving team autonomy through versioning, forking, storing dependencies, and collaborate on changes of independent components.\nScopes defines ownership on components, as a single team owns the components exported to scope."),(0,r.mdx)(l.Image,{width:"70%",src:a.default,mdxType:"Image"}),(0,r.mdx)("h2",null,"Full stack of functionality"),(0,r.mdx)("p",null,"Scopes host components of any kind, from React, Angular and Node modules, all the way to a frontend apps or microservices. For a scope they are all Bit Components.",(0,r.mdx)("br",{parentName:"p"}),"\n","For example, the ",(0,r.mdx)("a",{parentName:"p",href:"https://bit.dev/teambit/mdx"},"MDX scope"),' contains all components relevant to handling MDX functionality in Bit. It exposes various types of components (or "APIs") to achieve this: Webpack loader, Node modules, React components and even a ',(0,r.mdx)("a",{parentName:"p",href:"/"},"Bit Aspect"),". This makes it easy for other teams to take leverage of MDX, not just as a feature but also as an API for their features."),(0,r.mdx)("p",null,"Scopes support various methods for using components, from adding as dependencies to runtime integrations, allowing the consumer to decide how whats the best solution for their use case."),(0,r.mdx)(l.Image,{width:"70%",src:c.default,mdxType:"Image"}),(0,r.mdx)("h2",null,"Team collaboration using components"),(0,r.mdx)("p",null,"Scopes provides visibility to components built by other teams, this is the first step towards better collaboration. Developers can find, use and depend on components by other teams. Instead of reinventing the wheel and rebuilding the same functionality, component visibility drives for collaboration. It is similar to how teams build with microservices and build team communication and collaboration by using each-other's APIs.",(0,r.mdx)("br",{parentName:"p"}),"\n","Moreover, developers can use ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit import")," and access to any component's source code and contribute change to collaborate on components."),(0,r.mdx)("p",null,"Bit keeps track on all these dependencies and flows, making team collaboration visible, easy to extend and optimize."),(0,r.mdx)(l.Image,{width:"70%",src:s.default,mdxType:"Image"}),(0,r.mdx)("h2",null,"Distributed and autonomous"),(0,r.mdx)("p",null,"Hosted scopes form a distributed network, where each scope is connected to the other scopes according to component dependencies. Each scope stores not only the components it hosts, but also the dependencies of those components.",(0,r.mdx)("br",{parentName:"p"}),"\n","When you export a component, the scope then does network calls to fetch the dependencies of the component from their respective scopes. This means that each scope becomes autonomous, as it contains all the dependencies needed to its components to run. In turn this makes teams more autonomous, as they can now build and use their components without having to worry about the dependencies."),(0,r.mdx)("p",null,"Scopes use standard HTTP for inner-scope communication, however, when building a network of scopes, you need to ensure scopes are able to connect to one another to fetch dependencies."),(0,r.mdx)("h2",null,"Source of truth"),(0,r.mdx)("p",null,"Scopes become the source of truth for components. Allowing different stakeholders to collaborate and work together from the same, or from different Workspaces.\nComponents can be maintained from multiple Workspaces in parallel, while Scopes are keeping them in sync, merging changes for all ends."),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"bit import")," can be used to fetch component updates. Using ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit import")," is similar to using ",(0,r.mdx)("inlineCode",{parentName:"p"},"git fetch")," where new objects are being fetched but not checked out in your workspace. "),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"$ bit import\n⡃⢐ fetching 143 components from 18 remotes. delta-only: 143, all-history: 0.\n- up to date teambit.community/ui/hero \n- up to date teambit.community/ui/homepage/sections/distribution \n- updated teambit.design/ui/layouts/sections/left-right \n- updated teambit.design/ui/layouts/sections/section-group \n- updated teambit.design/ui/layouts/sections/top-down \n")),(0,r.mdx)("p",null,(0,r.mdx)("inlineCode",{parentName:"p"},"bit export")," is used to share component changes with others. It pushes new objects from a local Workspace to a remote Scope, allowing others to keep in sync with the latest\ncomponent changes."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"$ bit export\nexported 8 components successfully to remote scope `community`\n"))))}v.__bit_component=o,v.isMDXComponent=!0},40331:(e,t,n)=>{"use strict";var o={id:"teambit.scope/scope@1.0.399",homepage:"https://bit.cloud/teambit/scope/scope",exported:!0};function r(){const e=i(n(41594));return r=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=o,i.__bit_component=o;const a=()=>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/scope.svg"}));a.__bit_component=o,t.Logo=a},58712:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});const o={fullWidth:"image_fullWidth__sELLz"}},50758:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/3a1072c009accd203fa8.png"},37080:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/ccf5ea377e3a1a72829d.png"},78199:(e,t,n)=>{"use strict";e.exports=n.p+"static/images/aef2176d16de53259dad.png"},5016:e=>{"use strict";e.exports=MdxJsReact},41594:e=>{"use strict";e.exports=React},65682:e=>{"use strict";e.exports=TeambitMdxUiMdxScopeContext},48184:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>A,__assign:()=>i,__asyncDelegator:()=>S,__asyncGenerator:()=>j,__asyncValues:()=>P,__await:()=>O,__awaiter:()=>m,__classPrivateFieldGet:()=>D,__classPrivateFieldIn:()=>C,__classPrivateFieldSet:()=>I,__createBinding:()=>y,__decorate:()=>s,__disposeResources:()=>B,__esDecorate:()=>l,__exportStar:()=>v,__extends:()=>r,__generator:()=>h,__importDefault:()=>M,__importStar:()=>k,__makeTemplateObject:()=>E,__metadata:()=>d,__param:()=>c,__propKey:()=>p,__read:()=>g,__rest:()=>a,__runInitializers:()=>u,__setFunctionName:()=>f,__spread:()=>_,__spreadArray:()=>x,__spreadArrays:()=>w,__values:()=>b,default:()=>N});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 i=function(){return i=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},i.apply(this,arguments)};function a(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,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function c(e,t){return function(n,o){t(n,o,e)}}function l(e,t,n,o,r,i){function a(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",u=!t&&e?o.static?e:e.prototype:null,p=t||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),f=!1,d=n.length-1;d>=0;d--){var m={};for(var h in o)m[h]="access"===h?{}:o[h];for(var h in o.access)m.access[h]=o.access[h];m.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var y=(0,n[d])("accessor"===c?{get:p.get,set:p.set}:p[l],m);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=a(y.get))&&(p.get=s),(s=a(y.set))&&(p.set=s),(s=a(y.init))&&r.unshift(s)}else(s=a(y))&&("field"===c?r.unshift(s):p[l]=s)}u&&Object.defineProperty(u,o.name,p),f=!0}function u(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 p(e){return"symbol"==typeof e?e:"".concat(e)}function f(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 d(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function m(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(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(a,s)}c((o=o.apply(e,t||[])).next())}))}function h(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)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 i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((r=(r=i.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}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 b(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 g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function _(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function w(){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 i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o}function x(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;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 j(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),i=[];return o=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,l)}})),o[Symbol.asyncIterator]=function(){return this},o;function a(e,t){r[e]&&(o[e]=function(t){return new Promise((function(n,o){i.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):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function c(e){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function S(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 P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=b(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 E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var T=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function k(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&y(t,e,n);return T(t,e),t}function M(e){return e&&e.__esModule?e:{default:e}}function D(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 I(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 C(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 A(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 z="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 B(e){function t(t){e.error=e.hasError?new z(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 i=n.dispose.call(n.value);if(n.async)return o|=2,Promise.resolve(i).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}()}const N={__extends:r,__assign:i,__rest:a,__decorate:s,__param:c,__metadata:d,__awaiter:m,__generator:h,__createBinding:y,__exportStar:v,__values:b,__read:g,__spread:_,__spreadArrays:w,__spreadArray:x,__await:O,__asyncGenerator:j,__asyncDelegator:S,__asyncValues:P,__makeTemplateObject:E,__importStar:k,__importDefault:M,__classPrivateFieldGet:D,__classPrivateFieldSet:I,__classPrivateFieldIn:C,__addDisposableResource:A,__disposeResources:B}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.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:()=>f,compositions_metadata:()=>m,overview:()=>d});var e={};n.r(e),n.d(e,{default:()=>p});var t=n(40331),r=(n(41594),n(5016)),i=n(65682),a=n(22882),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={},u="wrapper";function p(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 i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,s);return(0,r.mdx)(u,c({},l,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)(i.MDXScopeProvider,{components:{ScopeOverview:a.Ay},mdxType:"MDXScopeProvider"},(0,r.mdx)(a.Ay,{mdxType:"ScopeOverview"})))}p.isMDXComponent=!0;const f=[t],d=[e],m={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),o})()));
@@ -96,7 +96,7 @@
96
96
  "_legacy": {
97
97
  "scope": "teambit.scope",
98
98
  "name": "scope",
99
- "version": "1.0.397"
99
+ "version": "1.0.399"
100
100
  },
101
101
  "_scope": "teambit.scope"
102
102
  }
@@ -189,7 +189,7 @@
189
189
  "_legacy": {
190
190
  "scope": "teambit.scope",
191
191
  "name": "scope",
192
- "version": "1.0.397"
192
+ "version": "1.0.399"
193
193
  },
194
194
  "_scope": "teambit.scope"
195
195
  }
@@ -7712,7 +7712,7 @@
7712
7712
  "_legacy": {
7713
7713
  "scope": "teambit.scope",
7714
7714
  "name": "scope",
7715
- "version": "1.0.397"
7715
+ "version": "1.0.399"
7716
7716
  },
7717
7717
  "_scope": "teambit.scope"
7718
7718
  }
@@ -10413,7 +10413,7 @@
10413
10413
  "_legacy": {
10414
10414
  "scope": "teambit.scope",
10415
10415
  "name": "scope",
10416
- "version": "1.0.397"
10416
+ "version": "1.0.399"
10417
10417
  },
10418
10418
  "_scope": "teambit.scope"
10419
10419
  }
@@ -18992,7 +18992,7 @@
18992
18992
  "_legacy": {
18993
18993
  "scope": "teambit.scope",
18994
18994
  "name": "scope",
18995
- "version": "1.0.397"
18995
+ "version": "1.0.399"
18996
18996
  },
18997
18997
  "_scope": "teambit.scope"
18998
18998
  }
@@ -19384,7 +19384,7 @@
19384
19384
  "componentId": {
19385
19385
  "scope": "teambit.legacy",
19386
19386
  "name": "scope-api",
19387
- "version": "0.0.26"
19387
+ "version": "0.0.27"
19388
19388
  }
19389
19389
  },
19390
19390
  "isOptional": false
@@ -22724,7 +22724,7 @@
22724
22724
  "componentId": {
22725
22725
  "scope": "teambit.scope",
22726
22726
  "name": "scope",
22727
- "version": "1.0.397"
22727
+ "version": "1.0.399"
22728
22728
  },
22729
22729
  "taggedModuleExports": []
22730
22730
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_scope@1.0.397/dist/scope.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_scope@1.0.397/dist/scope.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_scope@1.0.399/dist/scope.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.scope_scope@1.0.399/dist/scope.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -39,6 +39,13 @@ function _modelComponent() {
39
39
  };
40
40
  return data;
41
41
  }
42
+ function _bitError() {
43
+ const data = require("@teambit/bit-error");
44
+ _bitError = function () {
45
+ return data;
46
+ };
47
+ return data;
48
+ }
42
49
  function _harmonyModules() {
43
50
  const data = require("@teambit/harmony.modules.in-memory-cache");
44
51
  _harmonyModules = function () {
@@ -91,6 +98,10 @@ class ScopeComponentLoader {
91
98
  if (versionStr === _modelComponent().VERSION_ZERO) return undefined;
92
99
  const newId = id.changeVersion(versionStr);
93
100
  const version = await modelComponent.loadVersion(versionStr, this.scope.legacyScope.objects);
101
+ const versionOriginId = version.originId;
102
+ if (versionOriginId && !versionOriginId.isEqualWithoutVersion(id)) {
103
+ throw new (_bitError().BitError)(`version "${versionStr}" seem to be originated from "${versionOriginId.toString()}", not from "${id.toStringWithoutVersion()}"`);
104
+ }
94
105
  const snap = await this.getHeadSnap(modelComponent);
95
106
  const state = await this.createStateFromVersion(id, version);
96
107
  const tagMap = this.getTagMap(modelComponent);
@@ -1 +1 @@
1
- {"version":3,"names":["_component","data","require","_pMapSeries","_interopRequireDefault","_semver","_objects","_modelComponent","_harmonyModules","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ScopeComponentLoader","constructor","scope","logger","componentsCache","createInMemoryCache","maxSize","getMaxSizeForComponents","importedComponentsCache","maxAge","get","id","importIfMissing","useCache","fromCache","getFromCache","idStr","toString","debug","legacyId","modelComponent","legacyScope","getModelComponentIfExist","isExported","import","reason","set","changeScope","name","undefined","versionStr","hasVersion","version","getHeadRegardlessOfLaneAsTagOrHash","VERSION_ZERO","newId","changeVersion","loadVersion","objects","snap","getHeadSnap","state","createStateFromVersion","tagMap","getTagMap","component","Component","getFromConsumerComponent","consumerComponent","getModelComponent","pendingVersion","getRemoteComponent","compImport","scopeImporter","objectList","getAll","forEach","obj","setCache","getConsumerComponent","getManyRemoteComponents","ids","legacyIds","map","pMapSeries","getState","hash","load","Ref","getSnap","getVersionObject","err","code","errMsg","error","Error","createSnapFromVersion","clearCache","deleteAll","isEqual","TagMap","allVersions","versionsIncludeOrphaned","keys","tag","Tag","SemVer","head","getHeadRegardlessOfLane","Snap","Date","parseInt","log","date","parents","p","displayName","username","email","message","State","Config","componentExtension","createAspectListFromLegacy","extensions","ComponentFS","fromVinyls","files","dependencies","exports"],"sources":["scope-component-loader.ts"],"sourcesContent":["import { Component, ComponentFS, ComponentID, Config, Snap, State, Tag, TagMap } from '@teambit/component';\nimport pMapSeries from 'p-map-series';\nimport { Logger } from '@teambit/logger';\nimport { SemVer } from 'semver';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { VERSION_ZERO } from '@teambit/legacy/dist/scope/models/model-component';\nimport { getMaxSizeForComponents, InMemoryCache, createInMemoryCache } from '@teambit/harmony.modules.in-memory-cache';\nimport type { ScopeMain } from './scope.main.runtime';\n\nexport class ScopeComponentLoader {\n private componentsCache: InMemoryCache<Component>; // cache loaded components\n private importedComponentsCache: InMemoryCache<boolean>;\n constructor(private scope: ScopeMain, private logger: Logger) {\n this.componentsCache = createInMemoryCache({ maxSize: getMaxSizeForComponents() });\n this.importedComponentsCache = createInMemoryCache({ maxAge: 1000 * 60 * 30 }); // 30 min\n }\n\n async get(id: ComponentID, importIfMissing = true, useCache = true): Promise<Component | undefined> {\n const fromCache = this.getFromCache(id);\n if (fromCache && useCache) {\n return fromCache;\n }\n const idStr = id.toString();\n this.logger.debug(`ScopeComponentLoader.get, loading ${idStr}`);\n const legacyId = id;\n let modelComponent = await this.scope.legacyScope.getModelComponentIfExist(id);\n // import if missing\n if (\n !modelComponent &&\n importIfMissing &&\n this.scope.isExported(id) &&\n !this.importedComponentsCache.get(id.toString())\n ) {\n await this.scope.import([id], { reason: `${id.toString()} because it's missing from the local scope` });\n this.importedComponentsCache.set(id.toString(), true);\n modelComponent = await this.scope.legacyScope.getModelComponentIfExist(id);\n }\n // Search with scope name for bare scopes\n if (!modelComponent && !legacyId.scope) {\n id = id.changeScope(this.scope.name);\n modelComponent = await this.scope.legacyScope.getModelComponentIfExist(id);\n }\n if (!modelComponent) return undefined;\n\n const versionStr = id.hasVersion()\n ? (id.version as string)\n : modelComponent.getHeadRegardlessOfLaneAsTagOrHash(true);\n\n if (versionStr === VERSION_ZERO) return undefined;\n const newId = id.changeVersion(versionStr);\n const version = await modelComponent.loadVersion(versionStr, this.scope.legacyScope.objects);\n const snap = await this.getHeadSnap(modelComponent);\n const state = await this.createStateFromVersion(id, version);\n const tagMap = this.getTagMap(modelComponent);\n\n const component = new Component(newId, snap, state, tagMap, this.scope);\n this.componentsCache.set(idStr, component);\n return component;\n }\n\n async getFromConsumerComponent(consumerComponent: ConsumerComponent): Promise<Component> {\n const id = consumerComponent.id;\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n // :TODO move to head snap once we have it merged, for now using `latest`.\n const version =\n consumerComponent.pendingVersion ||\n (await modelComponent.loadVersion(id.version as string, this.scope.legacyScope.objects));\n const snap = await this.getHeadSnap(modelComponent);\n const state = await this.createStateFromVersion(id, version, consumerComponent);\n const tagMap = this.getTagMap(modelComponent);\n\n return new Component(id, snap, state, tagMap, this.scope);\n }\n\n /**\n * get a component from a remote without importing it\n */\n async getRemoteComponent(id: ComponentID): Promise<Component> {\n const compImport = this.scope.legacyScope.scopeImporter;\n const objectList = await compImport.getRemoteComponent(id);\n // it's crucial to add all objects to the Repository cache. otherwise, later, when it asks\n // for the consumerComponent from the legacyScope, it won't work.\n objectList?.getAll().forEach((obj) => this.scope.legacyScope.objects.setCache(obj));\n const consumerComponent = await this.scope.legacyScope.getConsumerComponent(id);\n return this.getFromConsumerComponent(consumerComponent);\n }\n\n /**\n * get components from a remote without importing it\n */\n async getManyRemoteComponents(ids: ComponentID[]): Promise<Component[]> {\n const compImport = this.scope.legacyScope.scopeImporter;\n const legacyIds = ids.map((id) => id);\n const objectList = await compImport.getManyRemoteComponents(legacyIds);\n // it's crucial to add all objects to the Repository cache. otherwise, later, when it asks\n // for the consumerComponent from the legacyScope, it won't work.\n objectList?.getAll().forEach((obj) => this.scope.legacyScope.objects.setCache(obj));\n return pMapSeries(legacyIds, async (legacyId) => {\n const consumerComponent = await this.scope.legacyScope.getConsumerComponent(legacyId);\n return this.getFromConsumerComponent(consumerComponent);\n });\n }\n\n async getState(id: ComponentID, hash: string): Promise<State> {\n const version = (await this.scope.legacyScope.objects.load(new Ref(hash))) as Version;\n return this.createStateFromVersion(id, version);\n }\n\n async getSnap(id: ComponentID, hash: string): Promise<Snap> {\n const getVersionObject = async (): Promise<Version> => {\n try {\n const snap = await this.scope.legacyScope.objects.load(new Ref(hash), true);\n return snap as Version;\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n const errMsg = `fatal: snap \"${hash}\" file for component \"${id.toString()}\" was not found in the filesystem`;\n this.logger.error(errMsg, err);\n throw new Error(errMsg);\n } else {\n throw err;\n }\n }\n };\n const version = await getVersionObject();\n return this.createSnapFromVersion(version);\n }\n\n clearCache() {\n this.componentsCache.deleteAll();\n }\n\n /**\n * make sure that not only the id-str match, but also the legacy-id.\n * this is needed because the ComponentID.toString() is the same whether or not the legacy-id has\n * scope-name, as it includes the defaultScope if the scope is empty.\n * as a result, when out-of-sync is happening and the id is changed to include scope-name in the\n * legacy-id, the component is the cache has the old id.\n */\n private getFromCache(id: ComponentID): Component | undefined {\n const idStr = id.toString();\n const fromCache = this.componentsCache.get(idStr);\n if (fromCache && fromCache.id.isEqual(id)) {\n return fromCache;\n }\n return undefined;\n }\n\n private getTagMap(modelComponent: ModelComponent): TagMap {\n const tagMap = new TagMap();\n const allVersions = modelComponent.versionsIncludeOrphaned;\n Object.keys(allVersions).forEach((versionStr: string) => {\n const tag = new Tag(allVersions[versionStr].toString(), new SemVer(versionStr));\n tagMap.set(tag.version, tag);\n });\n return tagMap;\n }\n\n private async getHeadSnap(modelComponent: ModelComponent): Promise<Snap | null> {\n const head = modelComponent.getHeadRegardlessOfLane();\n if (!head) {\n // happens for example when on main and merging a lane.\n return null;\n }\n const version = await modelComponent.loadVersion(head.toString(), this.scope.legacyScope.objects, false);\n if (!version) {\n // might happen when the component is just a dependency and a previous version was needed.\n return null;\n }\n return this.createSnapFromVersion(version);\n }\n\n private createSnapFromVersion(version: Version): Snap {\n return new Snap(\n version.hash().toString(),\n new Date(parseInt(version.log.date)),\n version.parents.map((p) => p.toString()),\n {\n displayName: version.log.username || 'unknown',\n email: version.log.email || 'unknown@anywhere',\n },\n version.log.message\n );\n }\n\n private async createStateFromVersion(\n id: ComponentID,\n version: Version,\n consumerComponent?: ConsumerComponent\n ): Promise<State> {\n consumerComponent = consumerComponent || (await this.scope.legacyScope.getConsumerComponent(id));\n const state = new State(\n // We use here the consumerComponent.extensions instead of version.extensions\n // because as part of the conversion to consumer component the artifacts are initialized as Artifact instances\n new Config(consumerComponent),\n // todo: see the comment of this \"createAspectListFromLegacy\" method. the aspect ids may be incorrect.\n // find a better way to get the ids correctly.\n this.scope.componentExtension.createAspectListFromLegacy(consumerComponent.extensions),\n ComponentFS.fromVinyls(consumerComponent.files),\n version.dependencies,\n consumerComponent\n );\n return state;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,eAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,gBAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,eAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuH,SAAAG,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE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ACF,CAAC;IACD,OAAOP,KAAK;EACd;AACF;AAACoE,OAAA,CAAA7G,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_component","data","require","_pMapSeries","_interopRequireDefault","_semver","_objects","_modelComponent","_bitError","_harmonyModules","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ScopeComponentLoader","constructor","scope","logger","componentsCache","createInMemoryCache","maxSize","getMaxSizeForComponents","importedComponentsCache","maxAge","get","id","importIfMissing","useCache","fromCache","getFromCache","idStr","toString","debug","legacyId","modelComponent","legacyScope","getModelComponentIfExist","isExported","import","reason","set","changeScope","name","undefined","versionStr","hasVersion","version","getHeadRegardlessOfLaneAsTagOrHash","VERSION_ZERO","newId","changeVersion","loadVersion","objects","versionOriginId","originId","isEqualWithoutVersion","BitError","toStringWithoutVersion","snap","getHeadSnap","state","createStateFromVersion","tagMap","getTagMap","component","Component","getFromConsumerComponent","consumerComponent","getModelComponent","pendingVersion","getRemoteComponent","compImport","scopeImporter","objectList","getAll","forEach","obj","setCache","getConsumerComponent","getManyRemoteComponents","ids","legacyIds","map","pMapSeries","getState","hash","load","Ref","getSnap","getVersionObject","err","code","errMsg","error","Error","createSnapFromVersion","clearCache","deleteAll","isEqual","TagMap","allVersions","versionsIncludeOrphaned","keys","tag","Tag","SemVer","head","getHeadRegardlessOfLane","Snap","Date","parseInt","log","date","parents","p","displayName","username","email","message","State","Config","componentExtension","createAspectListFromLegacy","extensions","ComponentFS","fromVinyls","files","dependencies","exports"],"sources":["scope-component-loader.ts"],"sourcesContent":["import { Component, ComponentFS, ComponentID, Config, Snap, State, Tag, TagMap } from '@teambit/component';\nimport pMapSeries from 'p-map-series';\nimport { Logger } from '@teambit/logger';\nimport { SemVer } from 'semver';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { VERSION_ZERO } from '@teambit/legacy/dist/scope/models/model-component';\nimport { BitError } from '@teambit/bit-error';\nimport { getMaxSizeForComponents, InMemoryCache, createInMemoryCache } from '@teambit/harmony.modules.in-memory-cache';\nimport type { ScopeMain } from './scope.main.runtime';\n\nexport class ScopeComponentLoader {\n private componentsCache: InMemoryCache<Component>; // cache loaded components\n private importedComponentsCache: InMemoryCache<boolean>;\n constructor(private scope: ScopeMain, private logger: Logger) {\n this.componentsCache = createInMemoryCache({ maxSize: getMaxSizeForComponents() });\n this.importedComponentsCache = createInMemoryCache({ maxAge: 1000 * 60 * 30 }); // 30 min\n }\n\n async get(id: ComponentID, importIfMissing = true, useCache = true): Promise<Component | undefined> {\n const fromCache = this.getFromCache(id);\n if (fromCache && useCache) {\n return fromCache;\n }\n const idStr = id.toString();\n this.logger.debug(`ScopeComponentLoader.get, loading ${idStr}`);\n const legacyId = id;\n let modelComponent = await this.scope.legacyScope.getModelComponentIfExist(id);\n // import if missing\n if (\n !modelComponent &&\n importIfMissing &&\n this.scope.isExported(id) &&\n !this.importedComponentsCache.get(id.toString())\n ) {\n await this.scope.import([id], { reason: `${id.toString()} because it's missing from the local scope` });\n this.importedComponentsCache.set(id.toString(), true);\n modelComponent = await this.scope.legacyScope.getModelComponentIfExist(id);\n }\n // Search with scope name for bare scopes\n if (!modelComponent && !legacyId.scope) {\n id = id.changeScope(this.scope.name);\n modelComponent = await this.scope.legacyScope.getModelComponentIfExist(id);\n }\n if (!modelComponent) return undefined;\n\n const versionStr = id.hasVersion()\n ? (id.version as string)\n : modelComponent.getHeadRegardlessOfLaneAsTagOrHash(true);\n\n if (versionStr === VERSION_ZERO) return undefined;\n const newId = id.changeVersion(versionStr);\n const version = await modelComponent.loadVersion(versionStr, this.scope.legacyScope.objects);\n const versionOriginId = version.originId;\n if (versionOriginId && !versionOriginId.isEqualWithoutVersion(id)) {\n throw new BitError(\n `version \"${versionStr}\" seem to be originated from \"${versionOriginId.toString()}\", not from \"${id.toStringWithoutVersion()}\"`\n );\n }\n const snap = await this.getHeadSnap(modelComponent);\n const state = await this.createStateFromVersion(id, version);\n const tagMap = this.getTagMap(modelComponent);\n\n const component = new Component(newId, snap, state, tagMap, this.scope);\n this.componentsCache.set(idStr, component);\n return component;\n }\n\n async getFromConsumerComponent(consumerComponent: ConsumerComponent): Promise<Component> {\n const id = consumerComponent.id;\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n // :TODO move to head snap once we have it merged, for now using `latest`.\n const version =\n consumerComponent.pendingVersion ||\n (await modelComponent.loadVersion(id.version as string, this.scope.legacyScope.objects));\n const snap = await this.getHeadSnap(modelComponent);\n const state = await this.createStateFromVersion(id, version, consumerComponent);\n const tagMap = this.getTagMap(modelComponent);\n\n return new Component(id, snap, state, tagMap, this.scope);\n }\n\n /**\n * get a component from a remote without importing it\n */\n async getRemoteComponent(id: ComponentID): Promise<Component> {\n const compImport = this.scope.legacyScope.scopeImporter;\n const objectList = await compImport.getRemoteComponent(id);\n // it's crucial to add all objects to the Repository cache. otherwise, later, when it asks\n // for the consumerComponent from the legacyScope, it won't work.\n objectList?.getAll().forEach((obj) => this.scope.legacyScope.objects.setCache(obj));\n const consumerComponent = await this.scope.legacyScope.getConsumerComponent(id);\n return this.getFromConsumerComponent(consumerComponent);\n }\n\n /**\n * get components from a remote without importing it\n */\n async getManyRemoteComponents(ids: ComponentID[]): Promise<Component[]> {\n const compImport = this.scope.legacyScope.scopeImporter;\n const legacyIds = ids.map((id) => id);\n const objectList = await compImport.getManyRemoteComponents(legacyIds);\n // it's crucial to add all objects to the Repository cache. otherwise, later, when it asks\n // for the consumerComponent from the legacyScope, it won't work.\n objectList?.getAll().forEach((obj) => this.scope.legacyScope.objects.setCache(obj));\n return pMapSeries(legacyIds, async (legacyId) => {\n const consumerComponent = await this.scope.legacyScope.getConsumerComponent(legacyId);\n return this.getFromConsumerComponent(consumerComponent);\n });\n }\n\n async getState(id: ComponentID, hash: string): Promise<State> {\n const version = (await this.scope.legacyScope.objects.load(new Ref(hash))) as Version;\n return this.createStateFromVersion(id, version);\n }\n\n async getSnap(id: ComponentID, hash: string): Promise<Snap> {\n const getVersionObject = async (): Promise<Version> => {\n try {\n const snap = await this.scope.legacyScope.objects.load(new Ref(hash), true);\n return snap as Version;\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n const errMsg = `fatal: snap \"${hash}\" file for component \"${id.toString()}\" was not found in the filesystem`;\n this.logger.error(errMsg, err);\n throw new Error(errMsg);\n } else {\n throw err;\n }\n }\n };\n const version = await getVersionObject();\n return this.createSnapFromVersion(version);\n }\n\n clearCache() {\n this.componentsCache.deleteAll();\n }\n\n /**\n * make sure that not only the id-str match, but also the legacy-id.\n * this is needed because the ComponentID.toString() is the same whether or not the legacy-id has\n * scope-name, as it includes the defaultScope if the scope is empty.\n * as a result, when out-of-sync is happening and the id is changed to include scope-name in the\n * legacy-id, the component is the cache has the old id.\n */\n private getFromCache(id: ComponentID): Component | undefined {\n const idStr = id.toString();\n const fromCache = this.componentsCache.get(idStr);\n if (fromCache && fromCache.id.isEqual(id)) {\n return fromCache;\n }\n return undefined;\n }\n\n private getTagMap(modelComponent: ModelComponent): TagMap {\n const tagMap = new TagMap();\n const allVersions = modelComponent.versionsIncludeOrphaned;\n Object.keys(allVersions).forEach((versionStr: string) => {\n const tag = new Tag(allVersions[versionStr].toString(), new SemVer(versionStr));\n tagMap.set(tag.version, tag);\n });\n return tagMap;\n }\n\n private async getHeadSnap(modelComponent: ModelComponent): Promise<Snap | null> {\n const head = modelComponent.getHeadRegardlessOfLane();\n if (!head) {\n // happens for example when on main and merging a lane.\n return null;\n }\n const version = await modelComponent.loadVersion(head.toString(), this.scope.legacyScope.objects, false);\n if (!version) {\n // might happen when the component is just a dependency and a previous version was needed.\n return null;\n }\n return this.createSnapFromVersion(version);\n }\n\n private createSnapFromVersion(version: Version): Snap {\n return new Snap(\n version.hash().toString(),\n new Date(parseInt(version.log.date)),\n version.parents.map((p) => p.toString()),\n {\n displayName: version.log.username || 'unknown',\n email: version.log.email || 'unknown@anywhere',\n },\n version.log.message\n );\n }\n\n private async createStateFromVersion(\n id: ComponentID,\n version: Version,\n consumerComponent?: ConsumerComponent\n ): Promise<State> {\n consumerComponent = consumerComponent || (await this.scope.legacyScope.getConsumerComponent(id));\n const state = new State(\n // We use here the consumerComponent.extensions instead of version.extensions\n // because as part of the conversion to consumer component the artifacts are initialized as Artifact instances\n new Config(consumerComponent),\n // todo: see the comment of this \"createAspectListFromLegacy\" method. the aspect ids may be incorrect.\n // find a better way to get the ids correctly.\n this.scope.componentExtension.createAspectListFromLegacy(consumerComponent.extensions),\n ComponentFS.fromVinyls(consumerComponent.files),\n version.dependencies,\n consumerComponent\n );\n return state;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,eAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,SAAA,YAAAA,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,CAAC,EACDvE,OAAO,CAACiE,GAAG,CAACO,OACd,CAAC;EACH;EAEA,MAAczD,sBAAsBA,CAClCpC,EAAe,EACfqB,OAAgB,EAChBqB,iBAAqC,EACrB;IAChBA,iBAAiB,GAAGA,iBAAiB,KAAK,MAAM,IAAI,CAACnD,KAAK,CAACmB,WAAW,CAAC2C,oBAAoB,CAACrD,EAAE,CAAC,CAAC;IAChG,MAAMmC,KAAK,GAAG,KAAI2D,kBAAK;IACrB;IACA;IACA,KAAIC,mBAAM,EAACrD,iBAAiB,CAAC;IAC7B;IACA;IACA,IAAI,CAACnD,KAAK,CAACyG,kBAAkB,CAACC,0BAA0B,CAACvD,iBAAiB,CAACwD,UAAU,CAAC,EACtFC,wBAAW,CAACC,UAAU,CAAC1D,iBAAiB,CAAC2D,KAAK,CAAC,EAC/ChF,OAAO,CAACiF,YAAY,EACpB5D,iBACF,CAAC;IACD,OAAOP,KAAK;EACd;AACF;AAACoE,OAAA,CAAAlH,oBAAA,GAAAA,oBAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/scope",
3
- "version": "1.0.397",
3
+ "version": "1.0.399",
4
4
  "homepage": "https://bit.cloud/teambit/scope/scope",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.scope",
8
8
  "name": "scope",
9
- "version": "1.0.397"
9
+ "version": "1.0.399"
10
10
  },
11
11
  "dependencies": {
12
12
  "fs-extra": "10.0.0",
@@ -52,40 +52,40 @@
52
52
  "@teambit/component.modules.component-url": "0.0.167",
53
53
  "@teambit/scope.models.scope-model": "0.0.512",
54
54
  "@teambit/scope.ui.hooks.scope-context": "0.0.506",
55
- "@teambit/aspect-loader": "1.0.397",
56
- "@teambit/cli": "0.0.974",
57
- "@teambit/compiler": "1.0.397",
58
- "@teambit/component": "1.0.397",
59
- "@teambit/dependency-resolver": "1.0.397",
60
- "@teambit/envs": "1.0.397",
61
- "@teambit/global-config": "0.0.977",
55
+ "@teambit/aspect-loader": "1.0.399",
56
+ "@teambit/cli": "0.0.976",
57
+ "@teambit/compiler": "1.0.399",
58
+ "@teambit/component": "1.0.399",
59
+ "@teambit/dependency-resolver": "1.0.399",
60
+ "@teambit/envs": "1.0.399",
61
+ "@teambit/global-config": "0.0.979",
62
62
  "@teambit/harmony.modules.requireable-component": "0.0.497",
63
- "@teambit/isolator": "1.0.397",
64
- "@teambit/logger": "0.0.1067",
63
+ "@teambit/isolator": "1.0.399",
64
+ "@teambit/logger": "0.0.1069",
65
65
  "@teambit/harmony.modules.in-memory-cache": "0.0.1",
66
66
  "@teambit/bit.get-bit-version": "0.0.1",
67
67
  "@teambit/legacy-component-log": "0.0.403",
68
- "@teambit/legacy.scope-api": "0.0.26",
69
- "@teambit/builder": "1.0.397",
70
- "@teambit/express": "0.0.1073",
71
- "@teambit/graph": "1.0.397",
72
- "@teambit/graphql": "1.0.397",
73
- "@teambit/ui": "1.0.397",
68
+ "@teambit/legacy.scope-api": "0.0.27",
69
+ "@teambit/builder": "1.0.399",
70
+ "@teambit/express": "0.0.1075",
71
+ "@teambit/graph": "1.0.399",
72
+ "@teambit/graphql": "1.0.399",
73
+ "@teambit/ui": "1.0.399",
74
74
  "@teambit/workspace.modules.match-pattern": "0.0.505",
75
75
  "@teambit/component.ui.component-drawer": "0.0.410",
76
76
  "@teambit/lanes.hooks.use-lane-components": "0.0.266",
77
77
  "@teambit/lanes.hooks.use-lanes": "0.0.273",
78
- "@teambit/command-bar": "1.0.397",
79
- "@teambit/component-tree": "1.0.397",
78
+ "@teambit/command-bar": "1.0.399",
79
+ "@teambit/component-tree": "1.0.399",
80
80
  "@teambit/component.ui.component-filters.component-filter-context": "0.0.227",
81
81
  "@teambit/component.ui.component-filters.deprecate-filter": "0.0.225",
82
- "@teambit/component.ui.component-filters.env-filter": "0.0.235",
82
+ "@teambit/component.ui.component-filters.env-filter": "0.0.236",
83
83
  "@teambit/component.ui.component-filters.show-main-filter": "0.0.218",
84
- "@teambit/sidebar": "1.0.397",
84
+ "@teambit/sidebar": "1.0.399",
85
85
  "@teambit/ui-foundation.ui.react-router.slot-router": "0.0.509",
86
- "@teambit/ui-foundation.ui.buttons.collapser": "0.0.222",
86
+ "@teambit/ui-foundation.ui.buttons.collapser": "0.0.223",
87
87
  "@teambit/component-descriptor": "0.0.423",
88
- "@teambit/design.ui.tooltip": "0.0.369",
88
+ "@teambit/design.ui.tooltip": "0.0.371",
89
89
  "@teambit/preview.ui.preview-placeholder": "0.0.523"
90
90
  },
91
91
  "devDependencies": {