@teambit/compositions 1.0.486 → 1.0.488

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.compositions/compositions@1.0.486" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.compositions/compositions@1.0.488" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports["teambit.compositions/compositions-preview"]=o():e["teambit.compositions/compositions-preview"]=o()}(self,(()=>(()=>{"use strict";var e={706:(e,o,t)=>{var n={id:"teambit.compositions/aspect-docs/compositions@0.0.168",homepage:"https://bit.cloud/teambit/compositions/aspect-docs/compositions",exported:!0};Object.defineProperty(o,"__esModule",{value:!0}),o.default=f,a(t(594));var i=t(16),s=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},r.apply(null,arguments)}function p(e,o){if(null==e)return{};var t,n,i=m(e,o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)t=s[n],o.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function m(e,o){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(o.includes(n))continue;t[n]=e[n]}return t}a.__bit_component=n,r.__bit_component=n,p.__bit_component=n,m.__bit_component=n;var c=function(e){return function(o){return console.warn("Component "+e+" was not imported, exported, or provided by MDXProvider as global scope"),(0,i.mdx)("div",o)}};c.__bit_component=n;var l=c("CompositionCard"),d=c("Button"),u={},h="wrapper";function f(e){var o=e.components,t=p(e,s);return(0,i.mdx)(h,r({},u,t,{components:o,mdxType:"MDXLayout"}),(0,i.mdx)("p",null,"The Compositions aspect renders component 'compositions' in isolation and displays them in the Workspace UI and Scope UI.\n'Compositions' are, essentially, small apps that exhibit and test a component in different contexts and variations."),(0,i.mdx)("p",null,'The Compositions aspect is an essential tool to authoring independent components as it renders component instances in "controlled environments", isolated and un-affected by code that was not purposefully included.\nThis sterile environment provides an accurate understanding of their look and behavior, for manual and automated testings.'),(0,i.mdx)("p",null,"Moreover, a component's composition is a way to demonstrate the component for other developers looking to use it, and non-developers, such as designers and product managers, looking to inspect it."),(0,i.mdx)("h4",null,"Features"),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"Create component examples with zero configuration:")," Write your compositions the same way you write your components.\nPlace your examples in the component's ",(0,i.mdx)("inlineCode",{parentName:"p"},"*.compositions.*")," file to have them rendered in the Workspace UI with no additional configurations."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"See your components render in all relevant contexts:")," - Render components in the visual context of related and dependant components to learn how changes impact other components during development."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"Hot-reloading in workspace UI:")," - See various instances of a component render live to reflect most recent changes. Get immediate feedbacks to changes in your component's code."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"Compositions as visual documentation:")," - Compositions play an essential part in a component documentation. They demonstrate potential behaviors and use cases for that component. Compositions are another step in promoting components' discoverability, both in your local workspace and in remote scopes."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"Compositions as test samples for your CI")," - Use your compositions as samples for automated integration and unit tests, to track and view the impact of changes on all affected components in your different scopes."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"Developer-Designers collaboration")," - Make visual compositions accessible to designers (and everyone else) to include them in the development and release process of web applications, in a visual way."),(0,i.mdx)("h2",null,"Quickstart & configurations"),(0,i.mdx)("p",null,"Compositions require no configuration. Any ",(0,i.mdx)("inlineCode",{parentName:"p"},"*.compositions.*")," or ",(0,i.mdx)("inlineCode",{parentName:"p"},"*.composition.*")," file will be loaded and displayed in the workspace UI.\nAny tagged version of a component will have its composition included in its build artifacts, to be used as part of the component's preview."),(0,i.mdx)("p",null,"To add your own file pattern for compositions (to be automatically loaded and displayed by the Compositions aspect):"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-json"},'// In the workspace configuration file\n{\n "teambit.compositions/compositions": {\n "compositionFilePattern": ["**.my-pattern.tsx", "**.my-pattern-2.jsx"]\n }\n}\n')),(0,i.mdx)("h2",null,"Creating compositions"),(0,i.mdx)("blockquote",null,(0,i.mdx)("p",{parentName:"blockquote"},"This document uses React code as snippets.")),(0,i.mdx)("p",null,"Writing a composition does not require any configuration. Import the component to the component's ",(0,i.mdx)("inlineCode",{parentName:"p"},"*.compositions.tsx")," file, use it to build a composition and export the new component (a.k.a, the composition) with a named export."),(0,i.mdx)("p",null,"The name of the export will be converted from PascalCase/camelCase and used for the composition name (e.g, ",(0,i.mdx)("inlineCode",{parentName:"p"},'"CompositionName" --\x3e "Composition name"'),")."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"For example"),", we'll create two compositions, 'Primary button' and 'Secondary button', each of which demonstrates a different variant or usage of that component.\nBoth compositions will be in themed (i.e, displayed in a specific context)."),(0,i.mdx)("p",null,"First, we'll create a new composition file in the component's directory:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"},"touch path/to/component/directory/<component-name>.compositions.tsx\n")),(0,i.mdx)("p",null,"Then, we'll import the component and use it to create the compositions:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-jsx{}[button.compositions.jsx]"},"import React from 'react';\nimport { IrisTheme } from '@my-organization/design-system/iris-theme';\nimport { Button } from './button';\n\nexport const PrimaryButton = () => {\n return (\n <IrisTheme>\n <Button importance=\"cta\" style={{ width: 120 }}>\n Primary\n </Button>\n </IrisTheme>\n );\n};\n\nexport const SecondaryButton = () => {\n return (\n <IrisTheme>\n <Button importance=\"ghost\" style={{ width: 120 }}>\n Secondary\n </Button>\n </IrisTheme>\n );\n};\n")),(0,i.mdx)("div",{style:{width:450,display:"flex",justifyContent:"space-between"}},(0,i.mdx)(l,{Composition:function(){return(0,i.mdx)(d,{importance:"cta",style:{width:120},mdxType:"Button"},"Primary")},name:"Primary",mdxType:"CompositionCard"}),(0,i.mdx)(l,{Composition:function(){return(0,i.mdx)(d,{importance:"ghost",style:{width:120},mdxType:"Button"},"Secondary")},name:"Secondary",mdxType:"CompositionCard"})),(0,i.mdx)("h2",null,"Loading compositions"),(0,i.mdx)("p",null,"The Environment in use will automatically detect the composition file for each component and use it to load its compositions to the workspace UI."),(0,i.mdx)("h2",null,"Viewing component compositions"),(0,i.mdx)("p",null,"To explore compositions in your Workspace UI, start the local development server for your workspace (",(0,i.mdx)("inlineCode",{parentName:"p"},"bit start"),"),\nbrowse to a specific component and select the ",(0,i.mdx)("strong",{parentName:"p"},"compositions")," tab.\nThere, you will see the full list of compositions available for that component, along with additional component meta-data."),(0,i.mdx)("h2",null,"Using compositions for automated testings"),(0,i.mdx)("p",null,"Component compositions can be used in automated testing as well as manual examinations. To do that, simply import the compositions in your test file to run the appropriate tests."),(0,i.mdx)("p",null,"For example, the below snapshot test checks the 'Button' component when the 'variant' prop is set to 'primary'.\nIn addition to simple unit tests, compositions play an important role in integration test as they provide feedback as to how a change to the component may affect potential usages."),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-jsx"},"import React from 'react';\nimport testRenderer from 'react-test-renderer';\nimport { PrimaryButton } from './button.compositions.tsx';\n\ndescribe('Button', () => {\n it('renders correctly as \"primary\"', () => {\n const component = testRenderer.create(<PrimaryButton>test primary variant</PrimaryButton>);\n const tree = component.toJSON();\n expect(tree).toMatchSnapshot();\n });\n});\n")),(0,i.mdx)("h2",null,"Setting providers for all your compositions"),(0,i.mdx)("p",null,"Extend the React environment to customize its list of providers with your own composition providers.\nThe extended environment will then wrap every composition with these providers to make sure your themes or mock data are accessible to all of them,\nwithout you having to repeat that task ever again."),(0,i.mdx)("h2",null,"Compositions and storybook"),(0,i.mdx)("p",null,"Storybook displays individual components in different states and variations.\nIt is designed to help in authoring and displaying standalone components, each of which is usually part of a design system.\nIn contrast, 'Compositions' is mainly about examining how an independent component looks and behaves when used with other components.\nThese component integrations serve as a way to examine compositions that are likely to be part of real applications, using manual and automated testing."),(0,i.mdx)("p",null,"If you're looking for a Storybook-like solution, you can find that either in the Storybook extension (currently in development) or by using 'Compositions' for that use-case as well."))}f.__bit_component=n,f.isMDXComponent=!0},986:(e,o,t)=>{Object.defineProperty(o,"s",{enumerable:!0,get:function(){return n.default}});var n=i(t(706));function i(e){return e&&e.__esModule?e:{default:e}}i.__bit_component={id:"teambit.compositions/aspect-docs/compositions@0.0.168",homepage:"https://bit.cloud/teambit/compositions/aspect-docs/compositions",exported:!0}},530:(e,o,t)=>{var n={id:"teambit.compositions/compositions@1.0.486",homepage:"https://bit.cloud/teambit/compositions/compositions",exported:!0};function i(){const e=s(t(594));return i=function(){return e},e}function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(o,"__esModule",{value:!0}),o.Logo=void 0,i.__bit_component=n,s.__bit_component=n;const a=()=>i().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},i().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/compositions.svg"}));a.__bit_component=n,o.Logo=a},16:e=>{e.exports=MdxJsReact},594:e=>{e.exports=React}},o={};function t(n){var i=o[n];if(void 0!==i)return i.exports;var s=o[n]={exports:{}};return e[n](s,s.exports,t),s.exports}t.d=(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};t.r(n),t.d(n,{compositions:()=>h,compositions_metadata:()=>y,overview:()=>f});var i={};t.r(i),t.d(i,{default:()=>u});var s=t(530),a=(t(594),t(16));const r=TeambitMdxUiMdxScopeContext;var p=t(986),m=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},c.apply(null,arguments)}var l={},d="wrapper";function u(e){var o=e.components,t=function(e,o){if(null==e)return{};var t,n,i=function(e,o){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(o.includes(n))continue;t[n]=e[n]}return t}(e,o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)t=s[n],o.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,m);return(0,a.mdx)(d,c({},l,t,{components:o,mdxType:"MDXLayout"}),(0,a.mdx)(r.MDXScopeProvider,{components:{Compositions:p.s},mdxType:"MDXScopeProvider"},(0,a.mdx)(p.s,{mdxType:"Compositions"})))}u.isMDXComponent=!0;const h=[s],f=[i],y={compositions:[{displayName:"Logo",identifier:"Logo"}]};return n})()));
1
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports["teambit.compositions/compositions-preview"]=o():e["teambit.compositions/compositions-preview"]=o()}(self,(()=>(()=>{"use strict";var e={299:(e,o,t)=>{var n={id:"teambit.compositions/aspect-docs/compositions@0.0.168",homepage:"https://bit.cloud/teambit/compositions/aspect-docs/compositions",exported:!0};Object.defineProperty(o,"__esModule",{value:!0}),o.default=f,a(t(594));var i=t(16),s=["components"];function a(e){return e&&e.__esModule?e:{default:e}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},r.apply(null,arguments)}function p(e,o){if(null==e)return{};var t,n,i=m(e,o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)t=s[n],o.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function m(e,o){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(o.includes(n))continue;t[n]=e[n]}return t}a.__bit_component=n,r.__bit_component=n,p.__bit_component=n,m.__bit_component=n;var c=function(e){return function(o){return console.warn("Component "+e+" was not imported, exported, or provided by MDXProvider as global scope"),(0,i.mdx)("div",o)}};c.__bit_component=n;var l=c("CompositionCard"),d=c("Button"),u={},h="wrapper";function f(e){var o=e.components,t=p(e,s);return(0,i.mdx)(h,r({},u,t,{components:o,mdxType:"MDXLayout"}),(0,i.mdx)("p",null,"The Compositions aspect renders component 'compositions' in isolation and displays them in the Workspace UI and Scope UI.\n'Compositions' are, essentially, small apps that exhibit and test a component in different contexts and variations."),(0,i.mdx)("p",null,'The Compositions aspect is an essential tool to authoring independent components as it renders component instances in "controlled environments", isolated and un-affected by code that was not purposefully included.\nThis sterile environment provides an accurate understanding of their look and behavior, for manual and automated testings.'),(0,i.mdx)("p",null,"Moreover, a component's composition is a way to demonstrate the component for other developers looking to use it, and non-developers, such as designers and product managers, looking to inspect it."),(0,i.mdx)("h4",null,"Features"),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"Create component examples with zero configuration:")," Write your compositions the same way you write your components.\nPlace your examples in the component's ",(0,i.mdx)("inlineCode",{parentName:"p"},"*.compositions.*")," file to have them rendered in the Workspace UI with no additional configurations."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"See your components render in all relevant contexts:")," - Render components in the visual context of related and dependant components to learn how changes impact other components during development."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"Hot-reloading in workspace UI:")," - See various instances of a component render live to reflect most recent changes. Get immediate feedbacks to changes in your component's code."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"Compositions as visual documentation:")," - Compositions play an essential part in a component documentation. They demonstrate potential behaviors and use cases for that component. Compositions are another step in promoting components' discoverability, both in your local workspace and in remote scopes."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"Compositions as test samples for your CI")," - Use your compositions as samples for automated integration and unit tests, to track and view the impact of changes on all affected components in your different scopes."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"Developer-Designers collaboration")," - Make visual compositions accessible to designers (and everyone else) to include them in the development and release process of web applications, in a visual way."),(0,i.mdx)("h2",null,"Quickstart & configurations"),(0,i.mdx)("p",null,"Compositions require no configuration. Any ",(0,i.mdx)("inlineCode",{parentName:"p"},"*.compositions.*")," or ",(0,i.mdx)("inlineCode",{parentName:"p"},"*.composition.*")," file will be loaded and displayed in the workspace UI.\nAny tagged version of a component will have its composition included in its build artifacts, to be used as part of the component's preview."),(0,i.mdx)("p",null,"To add your own file pattern for compositions (to be automatically loaded and displayed by the Compositions aspect):"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-json"},'// In the workspace configuration file\n{\n "teambit.compositions/compositions": {\n "compositionFilePattern": ["**.my-pattern.tsx", "**.my-pattern-2.jsx"]\n }\n}\n')),(0,i.mdx)("h2",null,"Creating compositions"),(0,i.mdx)("blockquote",null,(0,i.mdx)("p",{parentName:"blockquote"},"This document uses React code as snippets.")),(0,i.mdx)("p",null,"Writing a composition does not require any configuration. Import the component to the component's ",(0,i.mdx)("inlineCode",{parentName:"p"},"*.compositions.tsx")," file, use it to build a composition and export the new component (a.k.a, the composition) with a named export."),(0,i.mdx)("p",null,"The name of the export will be converted from PascalCase/camelCase and used for the composition name (e.g, ",(0,i.mdx)("inlineCode",{parentName:"p"},'"CompositionName" --\x3e "Composition name"'),")."),(0,i.mdx)("p",null,(0,i.mdx)("strong",{parentName:"p"},"For example"),", we'll create two compositions, 'Primary button' and 'Secondary button', each of which demonstrates a different variant or usage of that component.\nBoth compositions will be in themed (i.e, displayed in a specific context)."),(0,i.mdx)("p",null,"First, we'll create a new composition file in the component's directory:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-bash"},"touch path/to/component/directory/<component-name>.compositions.tsx\n")),(0,i.mdx)("p",null,"Then, we'll import the component and use it to create the compositions:"),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-jsx{}[button.compositions.jsx]"},"import React from 'react';\nimport { IrisTheme } from '@my-organization/design-system/iris-theme';\nimport { Button } from './button';\n\nexport const PrimaryButton = () => {\n return (\n <IrisTheme>\n <Button importance=\"cta\" style={{ width: 120 }}>\n Primary\n </Button>\n </IrisTheme>\n );\n};\n\nexport const SecondaryButton = () => {\n return (\n <IrisTheme>\n <Button importance=\"ghost\" style={{ width: 120 }}>\n Secondary\n </Button>\n </IrisTheme>\n );\n};\n")),(0,i.mdx)("div",{style:{width:450,display:"flex",justifyContent:"space-between"}},(0,i.mdx)(l,{Composition:function(){return(0,i.mdx)(d,{importance:"cta",style:{width:120},mdxType:"Button"},"Primary")},name:"Primary",mdxType:"CompositionCard"}),(0,i.mdx)(l,{Composition:function(){return(0,i.mdx)(d,{importance:"ghost",style:{width:120},mdxType:"Button"},"Secondary")},name:"Secondary",mdxType:"CompositionCard"})),(0,i.mdx)("h2",null,"Loading compositions"),(0,i.mdx)("p",null,"The Environment in use will automatically detect the composition file for each component and use it to load its compositions to the workspace UI."),(0,i.mdx)("h2",null,"Viewing component compositions"),(0,i.mdx)("p",null,"To explore compositions in your Workspace UI, start the local development server for your workspace (",(0,i.mdx)("inlineCode",{parentName:"p"},"bit start"),"),\nbrowse to a specific component and select the ",(0,i.mdx)("strong",{parentName:"p"},"compositions")," tab.\nThere, you will see the full list of compositions available for that component, along with additional component meta-data."),(0,i.mdx)("h2",null,"Using compositions for automated testings"),(0,i.mdx)("p",null,"Component compositions can be used in automated testing as well as manual examinations. To do that, simply import the compositions in your test file to run the appropriate tests."),(0,i.mdx)("p",null,"For example, the below snapshot test checks the 'Button' component when the 'variant' prop is set to 'primary'.\nIn addition to simple unit tests, compositions play an important role in integration test as they provide feedback as to how a change to the component may affect potential usages."),(0,i.mdx)("pre",null,(0,i.mdx)("code",{parentName:"pre",className:"language-jsx"},"import React from 'react';\nimport testRenderer from 'react-test-renderer';\nimport { PrimaryButton } from './button.compositions.tsx';\n\ndescribe('Button', () => {\n it('renders correctly as \"primary\"', () => {\n const component = testRenderer.create(<PrimaryButton>test primary variant</PrimaryButton>);\n const tree = component.toJSON();\n expect(tree).toMatchSnapshot();\n });\n});\n")),(0,i.mdx)("h2",null,"Setting providers for all your compositions"),(0,i.mdx)("p",null,"Extend the React environment to customize its list of providers with your own composition providers.\nThe extended environment will then wrap every composition with these providers to make sure your themes or mock data are accessible to all of them,\nwithout you having to repeat that task ever again."),(0,i.mdx)("h2",null,"Compositions and storybook"),(0,i.mdx)("p",null,"Storybook displays individual components in different states and variations.\nIt is designed to help in authoring and displaying standalone components, each of which is usually part of a design system.\nIn contrast, 'Compositions' is mainly about examining how an independent component looks and behaves when used with other components.\nThese component integrations serve as a way to examine compositions that are likely to be part of real applications, using manual and automated testing."),(0,i.mdx)("p",null,"If you're looking for a Storybook-like solution, you can find that either in the Storybook extension (currently in development) or by using 'Compositions' for that use-case as well."))}f.__bit_component=n,f.isMDXComponent=!0},249:(e,o,t)=>{Object.defineProperty(o,"s",{enumerable:!0,get:function(){return n.default}});var n=i(t(299));function i(e){return e&&e.__esModule?e:{default:e}}i.__bit_component={id:"teambit.compositions/aspect-docs/compositions@0.0.168",homepage:"https://bit.cloud/teambit/compositions/aspect-docs/compositions",exported:!0}},5:(e,o,t)=>{var n={id:"teambit.compositions/compositions@1.0.488",homepage:"https://bit.cloud/teambit/compositions/compositions",exported:!0};function i(){const e=s(t(594));return i=function(){return e},e}function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(o,"__esModule",{value:!0}),o.Logo=void 0,i.__bit_component=n,s.__bit_component=n;const a=()=>i().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},i().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/compositions.svg"}));a.__bit_component=n,o.Logo=a},16:e=>{e.exports=MdxJsReact},594:e=>{e.exports=React}},o={};function t(n){var i=o[n];if(void 0!==i)return i.exports;var s=o[n]={exports:{}};return e[n](s,s.exports,t),s.exports}t.d=(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};t.r(n),t.d(n,{compositions:()=>h,compositions_metadata:()=>y,overview:()=>f});var i={};t.r(i),t.d(i,{default:()=>u});var s=t(5),a=(t(594),t(16));const r=TeambitMdxUiMdxScopeContext;var p=t(249),m=["components"];function c(){return c=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},c.apply(null,arguments)}var l={},d="wrapper";function u(e){var o=e.components,t=function(e,o){if(null==e)return{};var t,n,i=function(e,o){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(o.includes(n))continue;t[n]=e[n]}return t}(e,o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)t=s[n],o.includes(t)||{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,m);return(0,a.mdx)(d,c({},l,t,{components:o,mdxType:"MDXLayout"}),(0,a.mdx)(r.MDXScopeProvider,{components:{Compositions:p.s},mdxType:"MDXScopeProvider"},(0,a.mdx)(p.s,{mdxType:"Compositions"})))}u.isMDXComponent=!0;const h=[s],f=[i],y={compositions:[{displayName:"Logo",identifier:"Logo"}]};return n})()));
@@ -4466,7 +4466,7 @@
4466
4466
  "line": 38,
4467
4467
  "character": 3
4468
4468
  },
4469
- "signature": "(property) location: \"end\" | \"start\"",
4469
+ "signature": "(property) location: \"start\" | \"end\"",
4470
4470
  "name": "location",
4471
4471
  "type": {
4472
4472
  "__schema": "TypeUnionSchema",
@@ -5560,7 +5560,7 @@
5560
5560
  "componentId": {
5561
5561
  "scope": "teambit.compositions",
5562
5562
  "name": "compositions",
5563
- "version": "1.0.486"
5563
+ "version": "1.0.488"
5564
5564
  },
5565
5565
  "taggedModuleExports": []
5566
5566
  }
@@ -3,7 +3,7 @@ import { ScopeMain } from '@teambit/scope';
3
3
  import { DevFilesMain } from '@teambit/dev-files';
4
4
  import { EnvsMain } from '@teambit/envs';
5
5
  import { GraphqlMain } from '@teambit/graphql';
6
- import { ComponentLoadOptions } from '@teambit/legacy/dist/consumer/component/component-loader';
6
+ import { ComponentLoadOptions } from '@teambit/legacy.consumer-component';
7
7
  import { AbstractVinyl } from '@teambit/component.sources';
8
8
  import { PreviewMain } from '@teambit/preview';
9
9
  import { SchemaMain } from '@teambit/schema';
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_component","_scope","_devFiles","_envs","_graphql","_preview","_schema","_toolboxPath","_workspace","_path","_composition","_compositions","_compositions2","_compositions3","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompositionsMain","constructor","compositionFilePattern","previewFilePattern","preview","workspace","schema","devFiles","envs","getPreviewFiles","components","ComponentMap","as","component","compositionFiles","state","filesystem","byGlob","previewFiles","Set","map","file","relative","files","filter","has","isCompositionFile","filePath","includePatterns","excludePatterns","splitPatterns","matchPatterns","getCompositions","entry","get","CompositionsAspect","id","compositions","Composition","fromArray","readCompositions","maybeFiles","byComponent","computeCompositions","flat","getCompositionFilePattern","getComponentDevPatterns","env","calculateEnv","skipWarnings","inInstallContext","componentEnvCompositionsDevPatterns","getCompositionsDevPatterns","componentPatterns","concat","name","pattern","getDevPatternToRegister","bind","onComponentLoad","loadOpts","loadCompositions","undefined","composition","toObject","pathArray","path","split","length","modulePath","join","componentDir","exports","parseModule","contents","toString","exportModel","displayName","staticProperties","identifier","provider","graphql","scope","config","compositionPreviewFilePattern","registerDevPattern","register","compositionsSchema","registerDefinition","CompositionPreviewDefinition","registerOnComponentLoad","registerOnCompAspectReCalc","MainRuntime","PreviewAspect","GraphqlAspect","WorkspaceAspect","SchemaAspect","DevFilesAspect","EnvsAspect","ScopeAspect","addRuntime"],"sources":["compositions.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { AspectData, Component, ComponentMap, IComponent } from '@teambit/component';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { DevFilesAspect, DevFilesMain } from '@teambit/dev-files';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { ComponentLoadOptions } from '@teambit/legacy/dist/consumer/component/component-loader';\nimport { AbstractVinyl } from '@teambit/component.sources';\nimport { PreviewAspect, PreviewMain } from '@teambit/preview';\nimport { SchemaAspect, SchemaMain } from '@teambit/schema';\nimport { matchPatterns, splitPatterns } from '@teambit/toolbox.path.match-patterns';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { join } from 'path';\nimport { Composition } from './composition';\nimport { CompositionsAspect } from './compositions.aspect';\nimport { compositionsSchema } from './compositions.graphql';\nimport { CompositionPreviewDefinition } from './compositions.preview-definition';\n\nexport type CompositionsConfig = {\n /**\n * glob pattern to detect composition files. This includes all related files, like styles and jsons.\n * @example ['/*.composition?(s).*']\n */\n compositionFilePattern: string[];\n /**\n * glob pattern to select Preview files. this will only include files matched by compositionFilePattern.\n * @example ['*.{t,j}s', '*.{t,j}sx']\n */\n compositionPreviewFilePattern: string[];\n};\n\n/**\n * the component documentation extension.\n */\nexport class CompositionsMain {\n constructor(\n /**\n * Glob pattern to select all composition files\n */\n private compositionFilePattern: string[],\n\n /**\n * Glob pattern to select composition preview files\n */\n private previewFilePattern: string[],\n\n /**\n * envs extension.\n */\n private preview: PreviewMain,\n\n /**\n * workspace extension.\n */\n private workspace: Workspace,\n\n /**\n * schema extension.\n */\n private schema: SchemaMain,\n\n private devFiles: DevFilesMain,\n\n private envs: EnvsMain\n ) {}\n\n /**\n * returns an array of doc file paths for a set of components.\n */\n getPreviewFiles(components: Component[]): ComponentMap<AbstractVinyl[]> {\n return ComponentMap.as<AbstractVinyl[]>(components, (component) => {\n // this includes non executables, like `button.compositions.module.scss` or `presets.compositions.json`\n const compositionFiles = component.state.filesystem.byGlob(this.compositionFilePattern);\n\n // select only relevant preview files (.tsx, etc)\n const previewFiles = new Set(\n component.state.filesystem.byGlob(this.previewFilePattern).map((file) => file.relative)\n );\n const files = compositionFiles.filter((file) => previewFiles.has(file.relative));\n\n return files;\n });\n }\n\n /**\n * checks if a file matches the composition file pattern.\n */\n isCompositionFile(filePath: string): boolean {\n const { includePatterns, excludePatterns } = splitPatterns(this.compositionFilePattern);\n return matchPatterns(filePath, includePatterns, excludePatterns);\n }\n\n /**\n * get component compositions.\n */\n getCompositions(component: IComponent): Composition[] {\n const entry = component.get(CompositionsAspect.id);\n if (!entry) return [];\n const compositions = entry.data.compositions;\n if (!compositions) return [];\n\n return Composition.fromArray(compositions);\n }\n\n /**\n * read composition from the component source code.\n */\n readCompositions(component: Component): Composition[] {\n const maybeFiles = this.getPreviewFiles([component]).byComponent(component);\n\n if (!maybeFiles) return [];\n const [, files] = maybeFiles;\n return files.map((file) => this.computeCompositions(component, file)).flat();\n }\n\n getCompositionFilePattern() {\n return this.compositionFilePattern;\n }\n\n getComponentDevPatterns(component: Component) {\n const env = this.envs.calculateEnv(component, { skipWarnings: !!this.workspace?.inInstallContext }).env;\n const componentEnvCompositionsDevPatterns: string[] = env.getCompositionsDevPatterns\n ? env.getCompositionsDevPatterns(component)\n : [];\n const componentPatterns = componentEnvCompositionsDevPatterns.concat(this.getCompositionFilePattern());\n return { name: 'compositions', pattern: componentPatterns };\n }\n\n getDevPatternToRegister() {\n return this.getComponentDevPatterns.bind(this);\n }\n\n async onComponentLoad(component: Component, loadOpts?: ComponentLoadOptions): Promise<AspectData | undefined> {\n if (loadOpts?.loadCompositions === false) return undefined;\n const compositions = this.readCompositions(component);\n return {\n compositions: compositions.map((composition) => composition.toObject()),\n };\n }\n\n private computeCompositions(component: Component, file: AbstractVinyl): Composition[] {\n // :TODO hacked for a specific file extension now until david will take care in the compiler.\n const pathArray = file.path.split('.');\n pathArray[pathArray.length - 1] = 'js';\n\n const modulePath = this.workspace ? join(this.workspace.componentDir(component.id), file.relative) : file.relative;\n const exports = this.schema.parseModule(modulePath, file.contents.toString());\n return exports.map((exportModel) => {\n const displayName = exportModel.staticProperties?.get('compositionName');\n\n return new Composition(\n exportModel.identifier,\n file.relative,\n typeof displayName === 'string' ? displayName : undefined\n );\n });\n }\n\n static defaultConfig: CompositionsConfig = {\n compositionFilePattern: ['**/*.composition?(s).*'],\n compositionPreviewFilePattern: ['**/*.{t,j}s?(x)'],\n };\n\n static runtime = MainRuntime;\n static dependencies = [\n PreviewAspect,\n GraphqlAspect,\n WorkspaceAspect,\n SchemaAspect,\n DevFilesAspect,\n EnvsAspect,\n ScopeAspect,\n ];\n\n static async provider(\n [preview, graphql, workspace, schema, devFiles, envs, scope]: [\n PreviewMain,\n GraphqlMain,\n Workspace,\n SchemaMain,\n DevFilesMain,\n EnvsMain,\n ScopeMain,\n ],\n config: CompositionsConfig\n ) {\n const compositions = new CompositionsMain(\n config.compositionFilePattern,\n config.compositionPreviewFilePattern,\n preview,\n workspace,\n schema,\n devFiles,\n envs\n );\n\n // TODO: use the docs implementation to allow component specific pattern\n devFiles.registerDevPattern(compositions.getDevPatternToRegister());\n\n graphql.register(compositionsSchema(compositions));\n preview.registerDefinition(new CompositionPreviewDefinition(compositions));\n\n if (workspace) {\n workspace.registerOnComponentLoad(compositions.onComponentLoad.bind(compositions));\n }\n if (scope) {\n scope.registerOnCompAspectReCalc(compositions.onComponentLoad.bind(compositions));\n }\n\n return compositions;\n }\n}\n\nCompositionsAspect.addRuntime(CompositionsMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,QAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,OAAA,YAAAA,CAAA;IAAA,OAAAR,IAA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CAACsB,eAAe,CAACD,IAAI,CAACrB,YAAY,CAAC,CAAC;IACpF;IACA,IAAI6C,KAAK,EAAE;MACTA,KAAK,CAACS,0BAA0B,CAACtD,YAAY,CAACsB,eAAe,CAACD,IAAI,CAACrB,YAAY,CAAC,CAAC;IACnF;IAEA,OAAOA,YAAY;EACrB;AACF;AAACmC,OAAA,CAAAxE,gBAAA,GAAAA,gBAAA;AAAAnB,eAAA,CAjLYmB,gBAAgB,mBA4HgB;EACzCE,sBAAsB,EAAE,CAAC,wBAAwB,CAAC;EAClDkF,6BAA6B,EAAE,CAAC,iBAAiB;AACnD,CAAC;AAAAvG,eAAA,CA/HUmB,gBAAgB,aAiIV4F,kBAAW;AAAA/G,eAAA,CAjIjBmB,gBAAgB,kBAkIL,CACpB6F,wBAAa,EACbC,wBAAa,EACbC,4BAAe,EACfC,sBAAY,EACZC,0BAAc,EACdC,kBAAU,EACVC,oBAAW,CACZ;AAyCHhE,kCAAkB,CAACiE,UAAU,CAACpG,gBAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_component","_scope","_devFiles","_envs","_graphql","_preview","_schema","_toolboxPath","_workspace","_path","_composition","_compositions","_compositions2","_compositions3","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompositionsMain","constructor","compositionFilePattern","previewFilePattern","preview","workspace","schema","devFiles","envs","getPreviewFiles","components","ComponentMap","as","component","compositionFiles","state","filesystem","byGlob","previewFiles","Set","map","file","relative","files","filter","has","isCompositionFile","filePath","includePatterns","excludePatterns","splitPatterns","matchPatterns","getCompositions","entry","get","CompositionsAspect","id","compositions","Composition","fromArray","readCompositions","maybeFiles","byComponent","computeCompositions","flat","getCompositionFilePattern","getComponentDevPatterns","env","calculateEnv","skipWarnings","inInstallContext","componentEnvCompositionsDevPatterns","getCompositionsDevPatterns","componentPatterns","concat","name","pattern","getDevPatternToRegister","bind","onComponentLoad","loadOpts","loadCompositions","undefined","composition","toObject","pathArray","path","split","length","modulePath","join","componentDir","exports","parseModule","contents","toString","exportModel","displayName","staticProperties","identifier","provider","graphql","scope","config","compositionPreviewFilePattern","registerDevPattern","register","compositionsSchema","registerDefinition","CompositionPreviewDefinition","registerOnComponentLoad","registerOnCompAspectReCalc","MainRuntime","PreviewAspect","GraphqlAspect","WorkspaceAspect","SchemaAspect","DevFilesAspect","EnvsAspect","ScopeAspect","addRuntime"],"sources":["compositions.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { AspectData, Component, ComponentMap, IComponent } from '@teambit/component';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { DevFilesAspect, DevFilesMain } from '@teambit/dev-files';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { ComponentLoadOptions } from '@teambit/legacy.consumer-component';\nimport { AbstractVinyl } from '@teambit/component.sources';\nimport { PreviewAspect, PreviewMain } from '@teambit/preview';\nimport { SchemaAspect, SchemaMain } from '@teambit/schema';\nimport { matchPatterns, splitPatterns } from '@teambit/toolbox.path.match-patterns';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { join } from 'path';\nimport { Composition } from './composition';\nimport { CompositionsAspect } from './compositions.aspect';\nimport { compositionsSchema } from './compositions.graphql';\nimport { CompositionPreviewDefinition } from './compositions.preview-definition';\n\nexport type CompositionsConfig = {\n /**\n * glob pattern to detect composition files. This includes all related files, like styles and jsons.\n * @example ['/*.composition?(s).*']\n */\n compositionFilePattern: string[];\n /**\n * glob pattern to select Preview files. this will only include files matched by compositionFilePattern.\n * @example ['*.{t,j}s', '*.{t,j}sx']\n */\n compositionPreviewFilePattern: string[];\n};\n\n/**\n * the component documentation extension.\n */\nexport class CompositionsMain {\n constructor(\n /**\n * Glob pattern to select all composition files\n */\n private compositionFilePattern: string[],\n\n /**\n * Glob pattern to select composition preview files\n */\n private previewFilePattern: string[],\n\n /**\n * envs extension.\n */\n private preview: PreviewMain,\n\n /**\n * workspace extension.\n */\n private workspace: Workspace,\n\n /**\n * schema extension.\n */\n private schema: SchemaMain,\n\n private devFiles: DevFilesMain,\n\n private envs: EnvsMain\n ) {}\n\n /**\n * returns an array of doc file paths for a set of components.\n */\n getPreviewFiles(components: Component[]): ComponentMap<AbstractVinyl[]> {\n return ComponentMap.as<AbstractVinyl[]>(components, (component) => {\n // this includes non executables, like `button.compositions.module.scss` or `presets.compositions.json`\n const compositionFiles = component.state.filesystem.byGlob(this.compositionFilePattern);\n\n // select only relevant preview files (.tsx, etc)\n const previewFiles = new Set(\n component.state.filesystem.byGlob(this.previewFilePattern).map((file) => file.relative)\n );\n const files = compositionFiles.filter((file) => previewFiles.has(file.relative));\n\n return files;\n });\n }\n\n /**\n * checks if a file matches the composition file pattern.\n */\n isCompositionFile(filePath: string): boolean {\n const { includePatterns, excludePatterns } = splitPatterns(this.compositionFilePattern);\n return matchPatterns(filePath, includePatterns, excludePatterns);\n }\n\n /**\n * get component compositions.\n */\n getCompositions(component: IComponent): Composition[] {\n const entry = component.get(CompositionsAspect.id);\n if (!entry) return [];\n const compositions = entry.data.compositions;\n if (!compositions) return [];\n\n return Composition.fromArray(compositions);\n }\n\n /**\n * read composition from the component source code.\n */\n readCompositions(component: Component): Composition[] {\n const maybeFiles = this.getPreviewFiles([component]).byComponent(component);\n\n if (!maybeFiles) return [];\n const [, files] = maybeFiles;\n return files.map((file) => this.computeCompositions(component, file)).flat();\n }\n\n getCompositionFilePattern() {\n return this.compositionFilePattern;\n }\n\n getComponentDevPatterns(component: Component) {\n const env = this.envs.calculateEnv(component, { skipWarnings: !!this.workspace?.inInstallContext }).env;\n const componentEnvCompositionsDevPatterns: string[] = env.getCompositionsDevPatterns\n ? env.getCompositionsDevPatterns(component)\n : [];\n const componentPatterns = componentEnvCompositionsDevPatterns.concat(this.getCompositionFilePattern());\n return { name: 'compositions', pattern: componentPatterns };\n }\n\n getDevPatternToRegister() {\n return this.getComponentDevPatterns.bind(this);\n }\n\n async onComponentLoad(component: Component, loadOpts?: ComponentLoadOptions): Promise<AspectData | undefined> {\n if (loadOpts?.loadCompositions === false) return undefined;\n const compositions = this.readCompositions(component);\n return {\n compositions: compositions.map((composition) => composition.toObject()),\n };\n }\n\n private computeCompositions(component: Component, file: AbstractVinyl): Composition[] {\n // :TODO hacked for a specific file extension now until david will take care in the compiler.\n const pathArray = file.path.split('.');\n pathArray[pathArray.length - 1] = 'js';\n\n const modulePath = this.workspace ? join(this.workspace.componentDir(component.id), file.relative) : file.relative;\n const exports = this.schema.parseModule(modulePath, file.contents.toString());\n return exports.map((exportModel) => {\n const displayName = exportModel.staticProperties?.get('compositionName');\n\n return new Composition(\n exportModel.identifier,\n file.relative,\n typeof displayName === 'string' ? displayName : undefined\n );\n });\n }\n\n static defaultConfig: CompositionsConfig = {\n compositionFilePattern: ['**/*.composition?(s).*'],\n compositionPreviewFilePattern: ['**/*.{t,j}s?(x)'],\n };\n\n static runtime = MainRuntime;\n static dependencies = [\n PreviewAspect,\n GraphqlAspect,\n WorkspaceAspect,\n SchemaAspect,\n DevFilesAspect,\n EnvsAspect,\n ScopeAspect,\n ];\n\n static async provider(\n [preview, graphql, workspace, schema, devFiles, envs, scope]: [\n PreviewMain,\n GraphqlMain,\n Workspace,\n SchemaMain,\n DevFilesMain,\n EnvsMain,\n ScopeMain,\n ],\n config: CompositionsConfig\n ) {\n const compositions = new CompositionsMain(\n config.compositionFilePattern,\n config.compositionPreviewFilePattern,\n preview,\n workspace,\n schema,\n devFiles,\n envs\n );\n\n // TODO: use the docs implementation to allow component specific pattern\n devFiles.registerDevPattern(compositions.getDevPatternToRegister());\n\n graphql.register(compositionsSchema(compositions));\n preview.registerDefinition(new CompositionPreviewDefinition(compositions));\n\n if (workspace) {\n workspace.registerOnComponentLoad(compositions.onComponentLoad.bind(compositions));\n }\n if (scope) {\n scope.registerOnCompAspectReCalc(compositions.onComponentLoad.bind(composit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,CAAC;IACnF;IAEA,OAAOA,YAAY;EACrB;AACF;AAACmC,OAAA,CAAAxE,gBAAA,GAAAA,gBAAA;AAAAnB,eAAA,CAjLYmB,gBAAgB,mBA4HgB;EACzCE,sBAAsB,EAAE,CAAC,wBAAwB,CAAC;EAClDkF,6BAA6B,EAAE,CAAC,iBAAiB;AACnD,CAAC;AAAAvG,eAAA,CA/HUmB,gBAAgB,aAiIV4F,kBAAW;AAAA/G,eAAA,CAjIjBmB,gBAAgB,kBAkIL,CACpB6F,wBAAa,EACbC,wBAAa,EACbC,4BAAe,EACfC,sBAAY,EACZC,0BAAc,EACdC,kBAAU,EACVC,oBAAW,CACZ;AAyCHhE,kCAAkB,CAACiE,UAAU,CAACpG,gBAAgB,CAAC","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import * as compositions_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec3/teambit.compositions_compositions@1.0.488/dist/compositions.composition.js';
2
+ import * as overview_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec3/teambit.compositions_compositions@1.0.488/dist/compositions.docs.mdx';
3
+
4
+ export const compositions = [compositions_0];
5
+ export const overview = [overview_0];
6
+
7
+ export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/compositions",
3
- "version": "1.0.486",
3
+ "version": "1.0.488",
4
4
  "homepage": "https://bit.cloud/teambit/compositions/compositions",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.compositions",
8
8
  "name": "compositions",
9
- "version": "1.0.486"
9
+ "version": "1.0.488"
10
10
  },
11
11
  "dependencies": {
12
12
  "graphql-tag": "2.12.1",
@@ -34,25 +34,26 @@
34
34
  "@teambit/compositions.ui.composition-compare": "0.0.255",
35
35
  "@teambit/evangelist.elements.icon": "1.0.2",
36
36
  "@teambit/ui-foundation.ui.menu-widget-icon": "0.0.502",
37
- "@teambit/component": "1.0.486",
37
+ "@teambit/component": "1.0.488",
38
38
  "@teambit/compositions.model.composition-id": "0.0.502",
39
- "@teambit/graphql": "1.0.486",
40
- "@teambit/cli": "0.0.1063",
41
- "@teambit/component.sources": "0.0.52",
42
- "@teambit/dev-files": "1.0.486",
43
- "@teambit/envs": "1.0.486",
44
- "@teambit/preview": "1.0.486",
45
- "@teambit/schema": "1.0.486",
46
- "@teambit/scope": "1.0.486",
39
+ "@teambit/graphql": "1.0.488",
40
+ "@teambit/cli": "0.0.1065",
41
+ "@teambit/component.sources": "0.0.53",
42
+ "@teambit/dev-files": "1.0.488",
43
+ "@teambit/envs": "1.0.488",
44
+ "@teambit/legacy.consumer-component": "0.0.2",
45
+ "@teambit/preview": "1.0.488",
46
+ "@teambit/schema": "1.0.488",
47
+ "@teambit/scope": "1.0.488",
47
48
  "@teambit/toolbox.path.match-patterns": "0.0.15",
48
- "@teambit/workspace": "1.0.486",
49
- "@teambit/design.ui.tooltip": "0.0.371",
49
+ "@teambit/workspace": "1.0.488",
50
50
  "@teambit/docs.ui.queries.get-docs": "0.0.508",
51
- "@teambit/panels": "0.0.1065",
51
+ "@teambit/panels": "0.0.1067",
52
52
  "@teambit/preview.ui.component-preview": "1.0.16",
53
53
  "@teambit/ui-foundation.ui.buttons.collapser": "0.0.224",
54
- "@teambit/component-compare": "1.0.486",
55
- "@teambit/ui": "1.0.486"
54
+ "@teambit/design.ui.tooltip": "0.0.371",
55
+ "@teambit/component-compare": "1.0.488",
56
+ "@teambit/ui": "1.0.488"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@types/lodash": "4.14.165",
@@ -1,7 +0,0 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compositions_compositions@1.0.486/dist/compositions.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compositions_compositions@1.0.486/dist/compositions.docs.mdx';
3
-
4
- export const compositions = [compositions_0];
5
- export const overview = [overview_0];
6
-
7
- export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};