@teambit/compositions 1.0.282 → 1.0.284
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_compositions_compositions-preview.js +1 -1
- package/artifacts/schema.json +1 -1
- package/dist/composition.section.js +2 -2
- package/dist/composition.section.js.map +1 -1
- package/dist/compositions.composition.js +1 -1
- package/dist/compositions.composition.js.map +1 -1
- package/dist/compositions.graphql.js.map +1 -1
- package/dist/compositions.js +4 -4
- package/dist/compositions.js.map +1 -1
- package/dist/compositions.main.runtime.js +1 -1
- package/dist/compositions.main.runtime.js.map +1 -1
- package/dist/compositions.preview-definition.js +1 -1
- package/dist/compositions.preview-definition.js.map +1 -1
- package/dist/compositions.preview.runtime.js +2 -2
- package/dist/compositions.preview.runtime.js.map +1 -1
- package/dist/compositions.ui.runtime.js +3 -3
- package/dist/compositions.ui.runtime.js.map +1 -1
- package/dist/{preview-1716520879631.js → preview-1716693760271.js} +2 -2
- package/dist/ui/composition-preview.js +3 -3
- package/dist/ui/composition-preview.js.map +1 -1
- package/dist/ui/compositions-panel/compositions-panel.js +4 -4
- package/dist/ui/compositions-panel/compositions-panel.js.map +1 -1
- package/dist/ui/compositions-panel-node/compositions-panel-node.js +3 -3
- package/dist/ui/compositions-panel-node/compositions-panel-node.js.map +1 -1
- package/package.json +12 -12
|
@@ -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.
|
|
3
|
+
<testsuite name="teambit.compositions/compositions@1.0.284" 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={65749:(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(41594));var i=t(5016),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)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},r.apply(this,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.indexOf(t)>=0||Object.prototype.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(Object.prototype.hasOwnProperty.call(e,n)){if(o.indexOf(n)>=0)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},46747:(e,o,t)=>{Object.defineProperty(o,"s",{enumerable:!0,get:function(){return n.default}});var n=i(t(65749));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}},83943:(e,o,t)=>{var n={id:"teambit.compositions/compositions@1.0.282",homepage:"https://bit.cloud/teambit/compositions/compositions",exported:!0};function i(){const e=s(t(41594));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},5016:e=>{e.exports=MdxJsReact},41594: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={};return(()=>{t.r(n),t.d(n,{compositions:()=>d,compositions_metadata:()=>h,overview:()=>u});var e={};t.r(e),t.d(e,{default:()=>l});var o=t(83943),i=(t(41594),t(5016));const s=TeambitMdxUiMdxScopeContext;var a=t(46747),r=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},p.apply(this,arguments)}var m={},c="wrapper";function l(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(Object.prototype.hasOwnProperty.call(e,n)){if(o.indexOf(n)>=0)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.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,r);return(0,i.mdx)(c,p({},m,t,{components:o,mdxType:"MDXLayout"}),(0,i.mdx)(s.MDXScopeProvider,{components:{Compositions:a.s},mdxType:"MDXScopeProvider"},(0,i.mdx)(a.s,{mdxType:"Compositions"})))}l.isMDXComponent=!0;const d=[o],u=[e],h={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),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={65749:(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(41594));var i=t(5016),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)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},r.apply(this,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.indexOf(t)>=0||Object.prototype.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(Object.prototype.hasOwnProperty.call(e,n)){if(o.indexOf(n)>=0)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},46747:(e,o,t)=>{Object.defineProperty(o,"s",{enumerable:!0,get:function(){return n.default}});var n=i(t(65749));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}},61461:(e,o,t)=>{var n={id:"teambit.compositions/compositions@1.0.284",homepage:"https://bit.cloud/teambit/compositions/compositions",exported:!0};function i(){const e=s(t(41594));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},5016:e=>{e.exports=MdxJsReact},41594: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={};return(()=>{t.r(n),t.d(n,{compositions:()=>d,compositions_metadata:()=>h,overview:()=>u});var e={};t.r(e),t.d(e,{default:()=>l});var o=t(61461),i=(t(41594),t(5016));const s=TeambitMdxUiMdxScopeContext;var a=t(46747),r=["components"];function p(){return p=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},p.apply(null,arguments)}var m={},c="wrapper";function l(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.indexOf(n)>=0)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.indexOf(t)>=0||{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,r);return(0,i.mdx)(c,p({},m,t,{components:o,mdxType:"MDXLayout"}),(0,i.mdx)(s.MDXScopeProvider,{components:{Compositions:a.s},mdxType:"MDXScopeProvider"},(0,i.mdx)(a.s,{mdxType:"Compositions"})))}l.isMDXComponent=!0;const d=[o],u=[e],h={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -18,8 +18,8 @@ function _compositions() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
function _interopRequireDefault(
|
|
22
|
-
function _defineProperty(
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
23
23
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
24
24
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
25
25
|
class CompositionsSection {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_compositions","
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_compositions","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompositionsSection","constructor","compositions","options","emptyStateSlot","href","children","path","element","createElement","Compositions","menuBarWidgets","menuBarWidgetSlot","emptyState","exports"],"sources":["composition.section.tsx"],"sourcesContent":["import { Section } from '@teambit/component';\nimport React from 'react';\nimport { Compositions } from './compositions';\nimport type { CompositionsUI, CompositionsMenuSlot, EmptyStateSlot } from './compositions.ui.runtime';\n\ntype Options = { menuBarWidgetSlot: CompositionsMenuSlot };\n\nexport class CompositionsSection implements Section {\n constructor(\n /**\n * simulations ui extension.\n */\n private compositions: CompositionsUI,\n private options: Options,\n private emptyStateSlot: EmptyStateSlot\n ) {}\n\n navigationLink = {\n href: '~compositions',\n children: 'Preview',\n };\n\n route = {\n path: '~compositions/*',\n element: <Compositions menuBarWidgets={this.options.menuBarWidgetSlot} emptyState={this.emptyStateSlot} />,\n };\n\n order = 20;\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CA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,GAA9BA,cAA8B;IAAAtB,eAAA,yBAGvB;MACfuB,IAAI,EAAE,eAAe;MACrBC,QAAQ,EAAE;IACZ,CAAC;IAAAxB,eAAA,gBAEO;MACNyB,IAAI,EAAE,iBAAiB;MACvBC,OAAO,eAAElC,MAAA,GAAAO,OAAA,CAAA4B,aAAA,CAAC/B,aAAA,GAAAgC,YAAY;QAACC,cAAc,EAAE,IAAI,CAACR,OAAO,CAACS,iBAAkB;QAACC,UAAU,EAAE,IAAI,CAACT;MAAe,CAAE;IAC3G,CAAC;IAAAtB,eAAA,gBAEO,EAAE;EAZP;AAaL;AAACgC,OAAA,CAAAd,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ function _react() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
|
16
16
|
style: {
|
|
17
17
|
height: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","e","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["compositions.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/compositions.svg\" />\n </div>\n);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAA0D,CAAE,CACxF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_graphqlTag","data","require","compositionsSchema","compositions","typeDefs","gql","resolvers","Component","component","getCompositions"],"sources":["compositions.graphql.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { Schema } from '@teambit/graphql';\nimport { gql } from 'graphql-tag';\n\nimport { CompositionsMain } from './compositions.main.runtime';\n\nexport function compositionsSchema(compositions: CompositionsMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n compositions: [Composition]\n }\n\n type Subscription {\n compositionAdded: Composition\n }\n\n type Composition {\n filepath: String\n identifier: String\n displayName: String\n }\n `,\n resolvers: {\n Component: {\n compositions: (component: Component) => {\n return compositions.getCompositions(component);\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,SAASE,kBAAkBA,CAACC,YAA8B,EAAU;EACzE,OAAO;IACLC,QAAQ,EAAE,IAAAC,iBAAG
|
|
1
|
+
{"version":3,"names":["_graphqlTag","data","require","compositionsSchema","compositions","typeDefs","gql","resolvers","Component","component","getCompositions"],"sources":["compositions.graphql.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { Schema } from '@teambit/graphql';\nimport { gql } from 'graphql-tag';\n\nimport { CompositionsMain } from './compositions.main.runtime';\n\nexport function compositionsSchema(compositions: CompositionsMain): Schema {\n return {\n typeDefs: gql`\n extend type Component {\n compositions: [Composition]\n }\n\n type Subscription {\n compositionAdded: Composition\n }\n\n type Composition {\n filepath: String\n identifier: String\n displayName: String\n }\n `,\n resolvers: {\n Component: {\n compositions: (component: Component) => {\n return compositions.getCompositions(component);\n },\n },\n },\n };\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,SAASE,kBAAkBA,CAACC,YAA8B,EAAU;EACzE,OAAO;IACLC,QAAQ,EAAE,IAAAC,iBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IACDC,SAAS,EAAE;MACTC,SAAS,EAAE;QACTJ,YAAY,EAAGK,SAAoB,IAAK;UACtC,OAAOL,YAAY,CAACM,eAAe,CAACD,SAAS,CAAC;QAChD;MACF;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
package/dist/compositions.js
CHANGED
|
@@ -195,12 +195,12 @@ function _compositionsPanel() {
|
|
|
195
195
|
return data;
|
|
196
196
|
}
|
|
197
197
|
const _excluded = ["component", "selected", "queryParams", "emptyState"];
|
|
198
|
-
function _interopRequireDefault(
|
|
198
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
199
199
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
200
200
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
201
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
202
|
-
function _objectWithoutProperties(
|
|
203
|
-
function _objectWithoutPropertiesLoose(
|
|
201
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
202
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
203
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
204
204
|
// @todo - this will be fixed as part of the @teambit/base-react.navigation.link upgrade to latest
|
|
205
205
|
const Link = _baseReactNavigation().Link;
|
|
206
206
|
function Compositions({
|
package/dist/compositions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_reactRouterDom","_lodash","_interopRequireDefault","_queryString","_documenterTheme","_baseUiSurfacesSplitPane","_baseUiSurfacesSplitPane2","_component","_documenterUi","_panels","_docsUiQueries","_uiFoundationUiButtons","_designUi","_previewUi","_uiFoundationUiHooks","_compositionsUi","_compositionsUiHooks","_mdxUi","_designUi2","_documenterUi2","_designUi3","_baseReactNavigation","_designUiInput","_designUiSurfaces","_compositionsModule","_ui","_compositionsPanel","_excluded","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","prototype","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","Link","BaseLink","Compositions","menuBarWidgets","emptyState","component","useContext","ComponentContext","searchParams","useSearchParams","params","useParams","versionFromQueryParams","navigate","useNavigate","location","useLocation","currentCompositionName","currentComposition","compositions","find","composition","identifier","toLowerCase","head","selectedRef","useRef","current","properties","useDocs","id","isMobile","useIsMobile","showSidebar","isSidebarOpen","setSidebarOpenness","useState","sidebarOpenness","Layout","row","left","compositionUrl","toPreviewUrl","isScaling","preview","includesEnvTemplates","includesEnvTemplate","useNameParam","compositionIdentifierParam","currentCompositionFullUrl","compositionParams","setCompositionParams","fullscreen","queryParams","useMemo","queryString","stringify","useEffect","createElement","CompositionContextProvider","setQueryParams","SplitPane","layout","size","className","styles","compositionsPage","Pane","CompositionsMenuBar","menuBar","external","href","openInNewTab","OptionButton","icon","CompositionContent","compositionPanel","selected","HoverSplitter","splitter","Collapser","placement","isOpen","onMouseDown","stopPropagation","onClick","x","tooltipContent","collapser","right","ThemeContext","TabContainer","tabsContainer","TabList","tabs","Tab","TabPanel","tabContent","CompositionsPanel","onSelectComposition","selectedCompositionFromUrl","pathSegments","pathname","split","filter","push","urlParams","URLSearchParams","newPath","join","toString","url","active","PropTable","rows","showListView","_ref","componentCompositionProps","env","environment","EmptyStateTemplate","host","noCompositionsPage","H1","title","Separator","isPresentational","separator","AlertCard","level","MDXLayout","buildStatus","StatusMessageCard","buildStatusMessage","status","EmptyBox","linkText","link","ComponentComposition","compositionsIframe","viewport","forceHeight","fullContentHeight","pubsub"],"sources":["compositions.tsx"],"sourcesContent":["import React, { useContext, useEffect, useState, useMemo, useRef, ReactNode } from 'react';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport head from 'lodash.head';\nimport queryString from 'query-string';\nimport { ThemeContext } from '@teambit/documenter.theme.theme-context';\nimport { SplitPane, Pane, Layout } from '@teambit/base-ui.surfaces.split-pane.split-pane';\nimport { HoverSplitter } from '@teambit/base-ui.surfaces.split-pane.hover-splitter';\nimport { ComponentContext, ComponentModel } from '@teambit/component';\nimport { PropTable } from '@teambit/documenter.ui.property-table';\nimport { Tab, TabContainer, TabList, TabPanel } from '@teambit/panels';\nimport { useDocs } from '@teambit/docs.ui.queries.get-docs';\nimport { Collapser } from '@teambit/ui-foundation.ui.buttons.collapser';\nimport { EmptyBox } from '@teambit/design.ui.empty-box';\nimport { toPreviewUrl } from '@teambit/preview.ui.component-preview';\nimport { useIsMobile } from '@teambit/ui-foundation.ui.hooks.use-is-mobile';\nimport { CompositionsMenuBar } from '@teambit/compositions.ui.compositions-menu-bar';\nimport { CompositionContextProvider } from '@teambit/compositions.ui.hooks.use-composition';\nimport { MDXLayout } from '@teambit/mdx.ui.mdx-layout';\nimport { Separator } from '@teambit/design.ui.separator';\nimport { H1 } from '@teambit/documenter.ui.heading';\nimport { AlertCard } from '@teambit/design.ui.alert-card';\nimport { Link as BaseLink, useNavigate, useLocation } from '@teambit/base-react.navigation.link';\nimport { OptionButton } from '@teambit/design.ui.input.option-button';\nimport { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';\nimport { EmptyStateSlot } from './compositions.ui.runtime';\nimport { Composition } from './composition';\nimport styles from './compositions.module.scss';\nimport { ComponentComposition } from './ui';\nimport { CompositionsPanel } from './ui/compositions-panel/compositions-panel';\nimport type { CompositionsMenuSlot } from './compositions.ui.runtime';\nimport { ComponentCompositionProps } from './ui/composition-preview';\n\n// @todo - this will be fixed as part of the @teambit/base-react.navigation.link upgrade to latest\nconst Link = BaseLink as any;\n\nexport type MenuBarWidget = {\n location: 'start' | 'end';\n content: ReactNode;\n};\nexport type CompositionsProp = { menuBarWidgets?: CompositionsMenuSlot; emptyState?: EmptyStateSlot };\n\nexport function Compositions({ menuBarWidgets, emptyState }: CompositionsProp) {\n const component = useContext(ComponentContext);\n const [searchParams] = useSearchParams();\n const params = useParams();\n const versionFromQueryParams = searchParams.get('version');\n const navigate = useNavigate();\n const location = useLocation();\n const currentCompositionName = params['*'];\n const currentComposition =\n component.compositions.find((composition) => composition.identifier.toLowerCase() === currentCompositionName) ||\n head(component.compositions);\n\n const selectedRef = useRef(currentComposition);\n selectedRef.current = currentComposition;\n\n const properties = useDocs(component.id);\n\n const isMobile = useIsMobile();\n const showSidebar = !isMobile && component.compositions.length > 0;\n const [isSidebarOpen, setSidebarOpenness] = useState(showSidebar);\n\n const sidebarOpenness = isSidebarOpen ? Layout.row : Layout.left;\n\n const compositionUrl = toPreviewUrl(component, 'compositions');\n const isScaling = component?.preview?.isScaling;\n const includesEnvTemplates = component?.preview?.includesEnvTemplate;\n const useNameParam = component?.preview?.useNameParam;\n const compositionIdentifierParam =\n useNameParam || (isScaling && includesEnvTemplates === false)\n ? `name=${currentComposition?.identifier}`\n : currentComposition?.identifier;\n\n const currentCompositionFullUrl = toPreviewUrl(component, 'compositions', compositionIdentifierParam);\n\n const [compositionParams, setCompositionParams] = useState<Record<string, any>>({\n fullscreen: true,\n });\n\n const queryParams = useMemo(() => queryString.stringify(compositionParams), [compositionParams]);\n\n // collapse sidebar when empty, reopen when not\n useEffect(() => setSidebarOpenness(showSidebar), [showSidebar]);\n return (\n <CompositionContextProvider queryParams={compositionParams} setQueryParams={setCompositionParams}>\n <SplitPane layout={sidebarOpenness} size=\"85%\" className={styles.compositionsPage}>\n <Pane className={styles.left}>\n <CompositionsMenuBar menuBarWidgets={menuBarWidgets} className={styles.menuBar}>\n <Link external href={currentCompositionFullUrl} className={styles.openInNewTab}>\n <OptionButton icon=\"open-tab\" />\n </Link>\n </CompositionsMenuBar>\n <CompositionContent\n className={styles.compositionPanel}\n emptyState={emptyState}\n component={component}\n selected={currentComposition}\n queryParams={queryParams}\n />\n </Pane>\n <HoverSplitter className={styles.splitter}>\n <Collapser\n placement=\"left\"\n isOpen={isSidebarOpen}\n onMouseDown={(e) => e.stopPropagation()} // avoid split-pane drag\n onClick={() => setSidebarOpenness((x) => !x)}\n tooltipContent={`${isSidebarOpen ? 'Hide' : 'Show'} side compositions`}\n className={styles.collapser}\n />\n </HoverSplitter>\n <Pane className={styles.right}>\n <ThemeContext>\n <TabContainer className={styles.tabsContainer}>\n <TabList className={styles.tabs}>\n <Tab>compositions</Tab>\n <Tab>properties</Tab>\n </TabList>\n <TabPanel className={styles.tabContent}>\n <CompositionsPanel\n isScaling={isScaling}\n useNameParam={useNameParam}\n includesEnvTemplate={component.preview?.includesEnvTemplate}\n onSelectComposition={(composition) => {\n if (!currentComposition || !location) return;\n const selectedCompositionFromUrl = params['*'];\n\n const pathSegments = location.pathname.split('/').filter((x) => x);\n\n if (!selectedCompositionFromUrl) {\n pathSegments.push(composition.identifier.toLowerCase());\n } else {\n pathSegments[pathSegments.length - 1] = composition.identifier.toLowerCase();\n }\n\n const urlParams = new URLSearchParams();\n if (versionFromQueryParams) {\n urlParams.set('version', versionFromQueryParams);\n }\n const newPath = pathSegments.join('/');\n navigate(`/${newPath}?${urlParams.toString()}`);\n }}\n url={compositionUrl}\n compositions={component.compositions}\n active={currentComposition}\n />\n </TabPanel>\n <TabPanel className={styles.tabContent}>\n {properties && properties.length > 0 ? <PropTable rows={properties} showListView /> : <div />}\n </TabPanel>\n </TabContainer>\n </ThemeContext>\n </Pane>\n </SplitPane>\n </CompositionContextProvider>\n );\n}\n\nexport type CompositionContentProps = {\n component: ComponentModel;\n selected?: Composition;\n queryParams?: string | string[];\n emptyState?: EmptyStateSlot;\n} & ComponentCompositionProps;\n\nexport function CompositionContent({\n component,\n selected,\n queryParams,\n emptyState,\n ...componentCompositionProps\n}: CompositionContentProps) {\n const env = component.environment?.id;\n const EmptyStateTemplate = emptyState?.get(env || ''); // || defaultTemplate;\n\n if (component.compositions.length === 0 && component.host === 'teambit.workspace/workspace' && EmptyStateTemplate) {\n return (\n <div className={styles.noCompositionsPage}>\n <div>\n <H1 className={styles.title}>Compositions</H1>\n <Separator isPresentational className={styles.separator} />\n <AlertCard\n level=\"info\"\n title=\"There are no\n compositions for this Component. Learn how to add compositions:\"\n >\n <MDXLayout>\n <EmptyStateTemplate />\n </MDXLayout>\n </AlertCard>\n </div>\n </div>\n );\n }\n\n if (component?.buildStatus === 'pending' && component?.host === 'teambit.scope/scope')\n return (\n <StatusMessageCard className={styles.buildStatusMessage} status=\"PROCESSING\" title=\"component preview pending\">\n this might take some time\n </StatusMessageCard>\n );\n if (component?.buildStatus === 'failed' && component?.host === 'teambit.scope/scope')\n return (\n <StatusMessageCard\n className={styles.buildStatusMessage}\n status=\"FAILURE\"\n title=\"failed to get component preview \"\n ></StatusMessageCard>\n );\n\n // TODO: get the docs domain from the community aspect and pass it here as a prop\n if (component.compositions.length === 0) {\n return (\n <EmptyBox\n title=\"There are no compositions for this component.\"\n linkText=\"Learn how to create compositions\"\n link={`https://bit.dev/reference/dev-services-overview/compositions/compositions-overview`}\n />\n );\n }\n\n return (\n <ComponentComposition\n className={styles.compositionsIframe}\n // TODO: Oded to add control for viewport.\n viewport={null}\n component={component}\n forceHeight=\"100%\"\n composition={selected}\n fullContentHeight\n pubsub={true}\n queryParams={queryParams}\n {...componentCompositionProps}\n />\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAH,O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CAAkC;MAC3CC,IAAI,EAAG;IAAoF,CAC5F,CAAC;EAEN;EAEA,oBACE/M,MAAA,GAAAkC,OAAA,CAAA8F,aAAA,CAACnG,GAAA,GAAAmL,oBAAoB,EAAA3J,QAAA;IACnBiF,SAAS,EAAEC,6BAAM,CAAC0E;IAClB;IAAA;IACAC,QAAQ,EAAE,IAAK;IACfvI,SAAS,EAAEA,SAAU;IACrBwI,WAAW,EAAC,MAAM;IAClBxH,WAAW,EAAEwD,QAAS;IACtBiE,iBAAiB;IACjBC,MAAM,EAAE,IAAK;IACb1F,WAAW,EAAEA;EAAY,GACrBgE,yBAAyB,CAC9B,CAAC;AAEN","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_reactRouterDom","_lodash","_interopRequireDefault","_queryString","_documenterTheme","_baseUiSurfacesSplitPane","_baseUiSurfacesSplitPane2","_component","_documenterUi","_panels","_docsUiQueries","_uiFoundationUiButtons","_designUi","_previewUi","_uiFoundationUiHooks","_compositionsUi","_compositionsUiHooks","_mdxUi","_designUi2","_documenterUi2","_designUi3","_baseReactNavigation","_designUiInput","_designUiSurfaces","_compositionsModule","_ui","_compositionsPanel","_excluded","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","Link","BaseLink","Compositions","menuBarWidgets","emptyState","component","useContext","ComponentContext","searchParams","useSearchParams","params","useParams","versionFromQueryParams","navigate","useNavigate","location","useLocation","currentCompositionName","currentComposition","compositions","find","composition","identifier","toLowerCase","head","selectedRef","useRef","current","properties","useDocs","id","isMobile","useIsMobile","showSidebar","isSidebarOpen","setSidebarOpenness","useState","sidebarOpenness","Layout","row","left","compositionUrl","toPreviewUrl","isScaling","preview","includesEnvTemplates","includesEnvTemplate","useNameParam","compositionIdentifierParam","currentCompositionFullUrl","compositionParams","setCompositionParams","fullscreen","queryParams","useMemo","queryString","stringify","useEffect","createElement","CompositionContextProvider","setQueryParams","SplitPane","layout","size","className","styles","compositionsPage","Pane","CompositionsMenuBar","menuBar","external","href","openInNewTab","OptionButton","icon","CompositionContent","compositionPanel","selected","HoverSplitter","splitter","Collapser","placement","isOpen","onMouseDown","stopPropagation","onClick","x","tooltipContent","collapser","right","ThemeContext","TabContainer","tabsContainer","TabList","tabs","Tab","TabPanel","tabContent","CompositionsPanel","onSelectComposition","selectedCompositionFromUrl","pathSegments","pathname","split","filter","push","urlParams","URLSearchParams","newPath","join","toString","url","active","PropTable","rows","showListView","_ref","componentCompositionProps","env","environment","EmptyStateTemplate","host","noCompositionsPage","H1","title","Separator","isPresentational","separator","AlertCard","level","MDXLayout","buildStatus","StatusMessageCard","buildStatusMessage","status","EmptyBox","linkText","link","ComponentComposition","compositionsIframe","viewport","forceHeight","fullContentHeight","pubsub"],"sources":["compositions.tsx"],"sourcesContent":["import React, { useContext, useEffect, useState, useMemo, useRef, ReactNode } from 'react';\nimport { useParams, useSearchParams } from 'react-router-dom';\nimport head from 'lodash.head';\nimport queryString from 'query-string';\nimport { ThemeContext } from '@teambit/documenter.theme.theme-context';\nimport { SplitPane, Pane, Layout } from '@teambit/base-ui.surfaces.split-pane.split-pane';\nimport { HoverSplitter } from '@teambit/base-ui.surfaces.split-pane.hover-splitter';\nimport { ComponentContext, ComponentModel } from '@teambit/component';\nimport { PropTable } from '@teambit/documenter.ui.property-table';\nimport { Tab, TabContainer, TabList, TabPanel } from '@teambit/panels';\nimport { useDocs } from '@teambit/docs.ui.queries.get-docs';\nimport { Collapser } from '@teambit/ui-foundation.ui.buttons.collapser';\nimport { EmptyBox } from '@teambit/design.ui.empty-box';\nimport { toPreviewUrl } from '@teambit/preview.ui.component-preview';\nimport { useIsMobile } from '@teambit/ui-foundation.ui.hooks.use-is-mobile';\nimport { CompositionsMenuBar } from '@teambit/compositions.ui.compositions-menu-bar';\nimport { CompositionContextProvider } from '@teambit/compositions.ui.hooks.use-composition';\nimport { MDXLayout } from '@teambit/mdx.ui.mdx-layout';\nimport { Separator } from '@teambit/design.ui.separator';\nimport { H1 } from '@teambit/documenter.ui.heading';\nimport { AlertCard } from '@teambit/design.ui.alert-card';\nimport { Link as BaseLink, useNavigate, useLocation } from '@teambit/base-react.navigation.link';\nimport { OptionButton } from '@teambit/design.ui.input.option-button';\nimport { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';\nimport { EmptyStateSlot } from './compositions.ui.runtime';\nimport { Composition } from './composition';\nimport styles from './compositions.module.scss';\nimport { ComponentComposition } from './ui';\nimport { CompositionsPanel } from './ui/compositions-panel/compositions-panel';\nimport type { CompositionsMenuSlot } from './compositions.ui.runtime';\nimport { ComponentCompositionProps } from './ui/composition-preview';\n\n// @todo - this will be fixed as part of the @teambit/base-react.navigation.link upgrade to latest\nconst Link = BaseLink as any;\n\nexport type MenuBarWidget = {\n location: 'start' | 'end';\n content: ReactNode;\n};\nexport type CompositionsProp = { menuBarWidgets?: CompositionsMenuSlot; emptyState?: EmptyStateSlot };\n\nexport function Compositions({ menuBarWidgets, emptyState }: CompositionsProp) {\n const component = useContext(ComponentContext);\n const [searchParams] = useSearchParams();\n const params = useParams();\n const versionFromQueryParams = searchParams.get('version');\n const navigate = useNavigate();\n const location = useLocation();\n const currentCompositionName = params['*'];\n const currentComposition =\n component.compositions.find((composition) => composition.identifier.toLowerCase() === currentCompositionName) ||\n head(component.compositions);\n\n const selectedRef = useRef(currentComposition);\n selectedRef.current = currentComposition;\n\n const properties = useDocs(component.id);\n\n const isMobile = useIsMobile();\n const showSidebar = !isMobile && component.compositions.length > 0;\n const [isSidebarOpen, setSidebarOpenness] = useState(showSidebar);\n\n const sidebarOpenness = isSidebarOpen ? Layout.row : Layout.left;\n\n const compositionUrl = toPreviewUrl(component, 'compositions');\n const isScaling = component?.preview?.isScaling;\n const includesEnvTemplates = component?.preview?.includesEnvTemplate;\n const useNameParam = component?.preview?.useNameParam;\n const compositionIdentifierParam =\n useNameParam || (isScaling && includesEnvTemplates === false)\n ? `name=${currentComposition?.identifier}`\n : currentComposition?.identifier;\n\n const currentCompositionFullUrl = toPreviewUrl(component, 'compositions', compositionIdentifierParam);\n\n const [compositionParams, setCompositionParams] = useState<Record<string, any>>({\n fullscreen: true,\n });\n\n const queryParams = useMemo(() => queryString.stringify(compositionParams), [compositionParams]);\n\n // collapse sidebar when empty, reopen when not\n useEffect(() => setSidebarOpenness(showSidebar), [showSidebar]);\n return (\n <CompositionContextProvider queryParams={compositionParams} setQueryParams={setCompositionParams}>\n <SplitPane layout={sidebarOpenness} size=\"85%\" className={styles.compositionsPage}>\n <Pane className={styles.left}>\n <CompositionsMenuBar menuBarWidgets={menuBarWidgets} className={styles.menuBar}>\n <Link external href={currentCompositionFullUrl} className={styles.openInNewTab}>\n <OptionButton icon=\"open-tab\" />\n </Link>\n </CompositionsMenuBar>\n <CompositionContent\n className={styles.compositionPanel}\n emptyState={emptyState}\n component={component}\n selected={currentComposition}\n queryParams={queryParams}\n />\n </Pane>\n <HoverSplitter className={styles.splitter}>\n <Collapser\n placement=\"left\"\n isOpen={isSidebarOpen}\n onMouseDown={(e) => e.stopPropagation()} // avoid split-pane drag\n onClick={() => setSidebarOpenness((x) => !x)}\n tooltipContent={`${isSidebarOpen ? 'Hide' : 'Show'} side compositions`}\n className={styles.collapser}\n />\n </HoverSplitter>\n <Pane className={styles.right}>\n <ThemeContext>\n <TabContainer className={styles.tabsContainer}>\n <TabList className={styles.tabs}>\n <Tab>compositions</Tab>\n <Tab>properties</Tab>\n </TabList>\n <TabPanel className={styles.tabContent}>\n <CompositionsPanel\n isScaling={isScaling}\n useNameParam={useNameParam}\n includesEnvTemplate={component.preview?.includesEnvTemplate}\n onSelectComposition={(composition) => {\n if (!currentComposition || !location) return;\n const selectedCompositionFromUrl = params['*'];\n\n const pathSegments = location.pathname.split('/').filter((x) => x);\n\n if (!selectedCompositionFromUrl) {\n pathSegments.push(composition.identifier.toLowerCase());\n } else {\n pathSegments[pathSegments.length - 1] = composition.identifier.toLowerCase();\n }\n\n const urlParams = new URLSearchParams();\n if (versionFromQueryParams) {\n urlParams.set('version', versionFromQueryParams);\n }\n const newPath = pathSegments.join('/');\n navigate(`/${newPath}?${urlParams.toString()}`);\n }}\n url={compositionUrl}\n compositions={component.compositions}\n active={currentComposition}\n />\n </TabPanel>\n <TabPanel className={styles.tabContent}>\n {properties && properties.length > 0 ? <PropTable rows={properties} showListView /> : <div />}\n </TabPanel>\n </TabContainer>\n </ThemeContext>\n </Pane>\n </SplitPane>\n </CompositionContextProvider>\n );\n}\n\nexport type CompositionContentProps = {\n component: ComponentModel;\n selected?: Composition;\n queryParams?: string | string[];\n emptyState?: EmptyStateSlot;\n} & ComponentCompositionProps;\n\nexport function CompositionContent({\n component,\n selected,\n queryParams,\n emptyState,\n ...componentCompositionProps\n}: CompositionContentProps) {\n const env = component.environment?.id;\n const EmptyStateTemplate = emptyState?.get(env || ''); // || defaultTemplate;\n\n if (component.compositions.length === 0 && component.host === 'teambit.workspace/workspace' && EmptyStateTemplate) {\n return (\n <div className={styles.noCompositionsPage}>\n <div>\n <H1 className={styles.title}>Compositions</H1>\n <Separator isPresentational className={styles.separator} />\n <AlertCard\n level=\"info\"\n title=\"There are no\n compositions for this Component. Learn how to add compositions:\"\n >\n <MDXLayout>\n <EmptyStateTemplate />\n </MDXLayout>\n </AlertCard>\n </div>\n </div>\n );\n }\n\n if (component?.buildStatus === 'pending' && component?.host === 'teambit.scope/scope')\n return (\n <StatusMessageCard className={styles.buildStatusMessage} status=\"PROCESSING\" title=\"component preview pending\">\n this might take some time\n </StatusMessageCard>\n );\n if (component?.buildStatus === 'failed' && component?.host === 'teambit.scope/scope')\n return (\n <StatusMessageCard\n className={styles.buildStatusMessage}\n status=\"FAILURE\"\n title=\"failed to get component preview \"\n ></StatusMessageCard>\n );\n\n // TODO: get the docs domain from the community aspect and pass it here as a prop\n if (component.compositions.length === 0) {\n return (\n <EmptyBox\n title=\"There are no compositions for this component.\"\n linkText=\"Learn how to create compositions\"\n link={`https://bit.dev/reference/dev-services-overview/compositions/compositions-overview`}\n />\n );\n }\n\n return (\n <ComponentComposition\n className={styles.compositionsIframe}\n // TODO: Oded to add control for viewport.\n viewport={null}\n component={component}\n forceHeight=\"100%\"\n composition={selected}\n fullContentHeight\n pubsub={true}\n queryParams={queryParams}\n {...componentCompositionProps}\n />\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAH,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAK,sBAAA,CAAAH,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,iBAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,gBAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,yBAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,wBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,0BAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAAAO,yBAAA,YAAAA,CAAA;IAAA,OAAAT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AAS,EAAEC,6BAAM,CAACoE,kBAAmB;IAACC,MAAM,EAAC,YAAY;IAACV,KAAK,EAAC;EAA2B,GAAC,2BAE5F,CAAC;EAExB,IAAIvH,SAAS,EAAE8H,WAAW,KAAK,QAAQ,IAAI9H,SAAS,EAAEoH,IAAI,KAAK,qBAAqB,EAClF,oBACEzL,MAAA,GAAAkC,OAAA,CAAAwF,aAAA,CAAC/F,iBAAA,GAAAyK,iBAAiB;IAChBpE,SAAS,EAAEC,6BAAM,CAACoE,kBAAmB;IACrCC,MAAM,EAAC,SAAS;IAChBV,KAAK,EAAC;EAAkC,CACtB,CAAC;;EAGzB;EACA,IAAIvH,SAAS,CAACc,YAAY,CAAC3B,MAAM,KAAK,CAAC,EAAE;IACvC,oBACExD,MAAA,GAAAkC,OAAA,CAAAwF,aAAA,CAAC1G,SAAA,GAAAuL,QAAQ;MACPX,KAAK,EAAC,+CAA+C;MACrDY,QAAQ,EAAC,kCAAkC;MAC3CC,IAAI,EAAE;IAAqF,CAC5F,CAAC;EAEN;EAEA,oBACEzM,MAAA,GAAAkC,OAAA,CAAAwF,aAAA,CAAC7F,GAAA,GAAA6K,oBAAoB,EAAAtJ,QAAA;IACnB4E,SAAS,EAAEC,6BAAM,CAAC0E;IAClB;IAAA;IACAC,QAAQ,EAAE,IAAK;IACfvI,SAAS,EAAEA,SAAU;IACrBwI,WAAW,EAAC,MAAM;IAClBxH,WAAW,EAAEwD,QAAS;IACtBiE,iBAAiB;IACjBC,MAAM,EAAE,IAAK;IACb1F,WAAW,EAAEA;EAAY,GACrBgE,yBAAyB,CAC9B,CAAC;AAEN","ignoreList":[]}
|
|
@@ -109,7 +109,7 @@ function _compositions3() {
|
|
|
109
109
|
};
|
|
110
110
|
return data;
|
|
111
111
|
}
|
|
112
|
-
function _defineProperty(
|
|
112
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
113
113
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
114
114
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
115
115
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_component","_scope","_devFiles","_envs","_graphql","_preview","_schema","_toolboxPath","_workspace","_path","_composition","_compositions","_compositions2","_compositions3","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","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/legacy/dist/consumer/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,IAA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ACpB6F,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/dist/consumer/component/component-loader';\nimport { AbstractVinyl } from '@teambit/legacy/dist/consumer/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,IA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G,gBAAgB,CAAC","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ function _lodash() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function _defineProperty(
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
16
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
class CompositionPreviewDefinition {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lodash","data","require","_defineProperty","
|
|
1
|
+
{"version":3,"names":["_lodash","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompositionPreviewDefinition","constructor","compositions","renderTemplatePath","context","renderTemplatePathByEnv","env","getMounter","isFunction","undefined","getModuleMap","components","map","getPreviewFiles","getMetadata","component","getCompositions","composition","displayName","identifier","exports"],"sources":["compositions.preview-definition.ts"],"sourcesContent":["import { Component, ComponentMap } from '@teambit/component';\nimport type { ExecutionContext, Environment } from '@teambit/envs';\nimport { PreviewDefinition } from '@teambit/preview';\nimport { isFunction } from 'lodash';\nimport { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\n\nimport { CompositionsMain } from './compositions.main.runtime';\nimport { CompositionBrowserMetadataObject } from './composition';\n\nexport class CompositionPreviewDefinition implements PreviewDefinition {\n readonly prefix = 'compositions';\n readonly includePeers = true;\n\n constructor(private compositions: CompositionsMain) {}\n\n async renderTemplatePath(context: ExecutionContext): Promise<string | undefined> {\n return this.renderTemplatePathByEnv(context.env);\n }\n\n async renderTemplatePathByEnv(env: Environment): Promise<string | undefined> {\n if (env.getMounter && isFunction(env.getMounter)) {\n return env.getMounter();\n }\n return undefined;\n }\n\n async getModuleMap(components: Component[]): Promise<ComponentMap<AbstractVinyl[]>> {\n const map = this.compositions.getPreviewFiles(components);\n return map;\n }\n\n async getMetadata(component: Component): Promise<CompositionBrowserMetadataObject> {\n const compositions = this.compositions\n .getCompositions(component)\n .map((composition) => ({ displayName: composition.displayName, identifier: composition.identifier }));\n return {\n compositions,\n };\n }\n}\n"],"mappings":";;;;;;AAGA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAoC,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAM7B,MAAMgB,4BAA4B,CAA8B;EAIrEC,WAAWA,CAASC,YAA8B,EAAE;IAAA,KAAhCA,YAA8B,GAA9BA,YAA8B;IAAArB,eAAA,iBAHhC,cAAc;IAAAA,eAAA,uBACR,IAAI;EAEyB;EAErD,MAAMsB,kBAAkBA,CAACC,OAAyB,EAA+B;IAC/E,OAAO,IAAI,CAACC,uBAAuB,CAACD,OAAO,CAACE,GAAG,CAAC;EAClD;EAEA,MAAMD,uBAAuBA,CAACC,GAAgB,EAA+B;IAC3E,IAAIA,GAAG,CAACC,UAAU,IAAI,IAAAC,oBAAU,EAACF,GAAG,CAACC,UAAU,CAAC,EAAE;MAChD,OAAOD,GAAG,CAACC,UAAU,CAAC,CAAC;IACzB;IACA,OAAOE,SAAS;EAClB;EAEA,MAAMC,YAAYA,CAACC,UAAuB,EAA0C;IAClF,MAAMC,GAAG,GAAG,IAAI,CAACV,YAAY,CAACW,eAAe,CAACF,UAAU,CAAC;IACzD,OAAOC,GAAG;EACZ;EAEA,MAAME,WAAWA,CAACC,SAAoB,EAA6C;IACjF,MAAMb,YAAY,GAAG,IAAI,CAACA,YAAY,CACnCc,eAAe,CAACD,SAAS,CAAC,CAC1BH,GAAG,CAAEK,WAAW,KAAM;MAAEC,WAAW,EAAED,WAAW,CAACC,WAAW;MAAEC,UAAU,EAAEF,WAAW,CAACE;IAAW,CAAC,CAAC,CAAC;IACvG,OAAO;MACLjB;IACF,CAAC;EACH;AACF;AAACkB,OAAA,CAAApB,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -25,8 +25,8 @@ function _compositions() {
|
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
-
function _interopRequireDefault(
|
|
29
|
-
function _defineProperty(
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
30
30
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
31
31
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
32
32
|
class CompositionsPreview {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_preview","data","require","_lodash","_interopRequireDefault","_compositions","
|
|
1
|
+
{"version":3,"names":["_preview","data","require","_lodash","_interopRequireDefault","_compositions","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompositionsPreview","constructor","preview","render","componentId","envId","modules","otherPreviewDefs","context","componentMap","fullName","compositions","selectPreviewModel","metadata","getMetadata","active","getActiveComposition","mainModule","modulesMap","defaultExports","componentFullName","previewModule","files","combined","assign","componentMapMetadata","undefined","module","firstQueryParam","window","location","hash","split","query","getQuery","compositionId","getParam","first","head","firstId","identifier","values","provider","compPreview","registerPreview","name","bind","exports","PreviewRuntime","PreviewAspect","CompositionsAspect","addRuntime"],"sources":["compositions.preview.runtime.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component-id';\nimport {\n PreviewAspect,\n PreviewPreview,\n RenderingContext,\n PreviewRuntime,\n PreviewModule,\n ModuleFile,\n} from '@teambit/preview';\nimport head from 'lodash.head';\nimport { CompositionBrowserMetadataObject } from './composition';\n\nimport { CompositionsAspect } from './compositions.aspect';\n\nexport class CompositionsPreview {\n constructor(\n /**\n * preview extension.\n */\n private preview: PreviewPreview\n ) {}\n\n render(componentId: ComponentID, envId: string, modules: PreviewModule, otherPreviewDefs, context: RenderingContext) {\n if (!modules.componentMap[componentId.fullName]) return;\n\n const compositions = this.selectPreviewModel(componentId.fullName, modules);\n const metadata = this.getMetadata(componentId.fullName, modules);\n const active = this.getActiveComposition(compositions, metadata);\n\n const mainModule = modules.modulesMap[envId] || modules.modulesMap.default;\n let defaultExports = mainModule.default;\n // Sometime when using ESM (package.json with type:\"module\") the default export is nested under \"default\"\n if (typeof defaultExports !== 'function' && defaultExports.default) {\n defaultExports = defaultExports.default;\n }\n\n // @ts-ignore Gilad - to fix.\n defaultExports(active, context);\n }\n\n /** gets relevant information for this preview to render */\n selectPreviewModel(componentFullName: string, previewModule: PreviewModule) {\n const files = previewModule.componentMap[componentFullName] || [];\n\n // allow compositions to come from many files. It is assumed they will have unique named\n const combined = Object.assign({}, ...files);\n return combined;\n }\n\n getMetadata(componentFullName: string, previewModule: PreviewModule): CompositionBrowserMetadataObject | undefined {\n const metadata = previewModule?.componentMapMetadata\n ? previewModule.componentMapMetadata[componentFullName]\n : undefined;\n if (metadata) {\n return metadata as CompositionBrowserMetadataObject;\n }\n return undefined;\n }\n\n private getActiveComposition(module: ModuleFile, metadata?: CompositionBrowserMetadataObject) {\n const firstQueryParam = window.location.hash.split('&')[1];\n const query = this.preview.getQuery();\n const compositionId = this.preview.getParam(query, 'name') || firstQueryParam;\n\n if (compositionId && module[compositionId]) {\n return module[compositionId];\n }\n\n if (metadata && metadata.compositions) {\n const first = head(metadata.compositions);\n const firstId = first?.identifier;\n if (firstId && module[firstId]) {\n return module[firstId];\n }\n }\n\n const first = head(Object.values(module));\n return first;\n }\n\n static runtime = PreviewRuntime;\n\n static dependencies = [PreviewAspect];\n\n static async provider([preview]: [PreviewPreview]) {\n const compPreview = new CompositionsPreview(preview);\n preview.registerPreview({\n name: 'compositions',\n render: compPreview.render.bind(compPreview),\n selectPreviewModel: compPreview.selectPreviewModel.bind(compPreview),\n default: true,\n });\n\n return compPreview;\n }\n}\n\nCompositionsAspect.addRuntime(CompositionsPreview);\n"],"mappings":";;;;;;AACA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAA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MACpE9D,OAAO,EAAE;IACX,CAAC,CAAC;IAEF,OAAO8D,WAAW;EACpB;AACF;AAACI,OAAA,CAAA/C,mBAAA,GAAAA,mBAAA;AAAAlB,eAAA,CAjFYkB,mBAAmB,aAkEbgD,yBAAc;AAAAlE,eAAA,CAlEpBkB,mBAAmB,kBAoER,CAACiD,wBAAa,CAAC;AAevCC,kCAAkB,CAACC,UAAU,CAACnD,mBAAmB,CAAC","ignoreList":[]}
|
|
@@ -74,9 +74,9 @@ function _compositions2() {
|
|
|
74
74
|
};
|
|
75
75
|
return data;
|
|
76
76
|
}
|
|
77
|
-
function _interopRequireDefault(
|
|
78
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
79
|
-
function _defineProperty(
|
|
77
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
78
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
79
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
80
80
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
81
81
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
82
82
|
class CompositionsUI {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireDefault","require","_harmony","_component","_ui","_compositionsUi","_compositionsUi2","_componentCompare","_composition","_compositions","_compositions2","
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireDefault","require","_harmony","_component","_ui","_compositionsUi","_compositionsUi2","_componentCompare","_composition","_compositions","_compositions2","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_defineProperty","_toPropertyKey","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","CompositionsUI","constructor","menuBarWidgetSlot","emptyStateSlot","createElement","CompositionCompare","emptyState","PreviewView","compositionProps","CompositionContent","fullContentHeight","forceHeight","registerEmptyState","emptyStateComponent","register","registerMenuWidget","widget","provider","component","componentCompare","config","compositionMenuSlot","compositions","section","CompositionsSection","compositionCompare","CompositionCompareSection","registerRoute","route","registerNavigation","navigationLink","order","registerRoutes","exports","ComponentAspect","ComponentCompareAspect","UIRuntime","Slot","withType","_default","CompositionsAspect","addRuntime"],"sources":["compositions.ui.runtime.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport React, { ComponentType } from 'react';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { ComponentAspect, ComponentUI } from '@teambit/component';\nimport { UIRuntime } from '@teambit/ui';\nimport { CompositionCompareSection } from '@teambit/compositions.ui.composition-compare-section';\nimport { CompositionCompare } from '@teambit/compositions.ui.composition-compare';\nimport { ComponentCompareUI, ComponentCompareAspect } from '@teambit/component-compare';\nimport { CompositionsSection } from './composition.section';\nimport { CompositionsAspect } from './compositions.aspect';\nimport { CompositionContent, MenuBarWidget } from './compositions';\n\nexport type CompositionsMenuSlot = SlotRegistry<MenuBarWidget[]>;\nexport type EmptyStateSlot = SlotRegistry<ComponentType>;\n\nexport class CompositionsUI {\n constructor(private menuBarWidgetSlot: CompositionsMenuSlot, private emptyStateSlot: EmptyStateSlot) {}\n /**\n * register a new tester empty state. this allows to register a different empty state from each environment for example.\n */\n registerEmptyState(emptyStateComponent: ComponentType) {\n this.emptyStateSlot.register(emptyStateComponent);\n return this;\n }\n\n registerMenuWidget(...widget: MenuBarWidget[]) {\n this.menuBarWidgetSlot.register(widget);\n }\n\n getCompositionsCompare = () => {\n return (\n <CompositionCompare\n emptyState={this.emptyStateSlot}\n PreviewView={(compositionProps) => {\n return <CompositionContent {...compositionProps} fullContentHeight forceHeight={'100%'} />;\n }}\n />\n );\n };\n\n static dependencies = [ComponentAspect, ComponentCompareAspect];\n static runtime = UIRuntime;\n static slots = [Slot.withType<ReactNode>(), Slot.withType<ComponentType>()];\n\n static async provider(\n [component, componentCompare]: [ComponentUI, ComponentCompareUI],\n config: {},\n [compositionMenuSlot, emptyStateSlot]: [CompositionsMenuSlot, EmptyStateSlot]\n ) {\n const compositions = new CompositionsUI(compositionMenuSlot, emptyStateSlot);\n const section = new CompositionsSection(\n compositions,\n { menuBarWidgetSlot: compositions.menuBarWidgetSlot },\n emptyStateSlot\n );\n const compositionCompare = new CompositionCompareSection(compositions);\n component.registerRoute(section.route);\n component.registerNavigation(section.navigationLink, section.order);\n componentCompare.registerNavigation(compositionCompare);\n componentCompare.registerRoutes([compositionCompare.route]);\n return compositions;\n }\n}\n\nexport default CompositionsUI;\n\nCompositionsAspect.addRuntime(CompositionsUI);\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,IAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,GAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAA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AAI,CAACC,QAAQ,CAAgB,CAAC,CAAC;AAAA,IAAAC,QAAA,GAAAN,OAAA,CAAA5D,OAAA,GAsB9D2B,cAAc;AAE7BwC,kCAAkB,CAACC,UAAU,CAACzC,cAAc,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compositions_compositions@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compositions_compositions@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compositions_compositions@1.0.284/dist/compositions.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.compositions_compositions@1.0.284/dist/compositions.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -21,9 +21,9 @@ function _previewUi() {
|
|
|
21
21
|
const _excluded = ["composition", "component", "queryParams"];
|
|
22
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
23
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
25
|
-
function _objectWithoutProperties(
|
|
26
|
-
function _objectWithoutPropertiesLoose(
|
|
24
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
25
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
26
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
27
27
|
function ComponentComposition(_ref) {
|
|
28
28
|
let {
|
|
29
29
|
composition,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_previewUi","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","
|
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_previewUi","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","ComponentComposition","_ref","composition","component","queryParams","rest","includesEnvTemplate","preview","isScaling","shouldAddNameParam","useNameParam","compositionParams","useMemo","identifier","concat","createElement","ComponentPreview","style","width","height","previewName"],"sources":["composition-preview.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { ComponentPreview, ComponentPreviewProps } from '@teambit/preview.ui.component-preview';\n\nimport { Composition } from '../composition';\n\nexport type ComponentCompositionProps = {\n /**\n * composition to use for component rendering.\n */\n composition?: Composition;\n} & ComponentPreviewProps;\n\nexport function ComponentComposition({ composition, component, queryParams = [], ...rest }: ComponentCompositionProps) {\n const includesEnvTemplate = component.preview?.includesEnvTemplate;\n const isScaling = component.preview?.isScaling;\n const shouldAddNameParam = component.preview?.useNameParam || (isScaling && includesEnvTemplate === false);\n\n const compositionParams = useMemo(\n () =>\n (composition ? [shouldAddNameParam ? `name=${composition.identifier}` : composition.identifier] : []).concat(\n queryParams\n ),\n [composition?.identifier, queryParams]\n );\n\n return (\n <ComponentPreview\n {...rest}\n component={component}\n style={{ width: '100%', height: '100%' }}\n previewName=\"compositions\"\n queryParams={compositionParams}\n />\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgG,MAAAI,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAA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WAAW,CACvC,CAAC;EAED,oBACE1C,MAAA,GAAAY,OAAA,CAAAyC,aAAA,CAACjD,UAAA,GAAAkD,gBAAgB,EAAA5B,QAAA,KACXiB,IAAI;IACRF,SAAS,EAAEA,SAAU;IACrBc,KAAK,EAAE;MAAEC,KAAK,EAAE,MAAM;MAAEC,MAAM,EAAE;IAAO,CAAE;IACzCC,WAAW,EAAC,cAAc;IAC1BhB,WAAW,EAAEO;EAAkB,EAChC,CAAC;AAEN","ignoreList":[]}
|
|
@@ -56,10 +56,10 @@ function _compositionsPanelModule() {
|
|
|
56
56
|
const _excluded = ["url", "compositions", "isScaling", "onSelectComposition", "active", "includesEnvTemplate", "useNameParam", "className"];
|
|
57
57
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
58
58
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
59
|
-
function _interopRequireDefault(
|
|
60
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
61
|
-
function _objectWithoutProperties(
|
|
62
|
-
function _objectWithoutPropertiesLoose(
|
|
59
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
60
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
61
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
62
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
63
63
|
function CompositionsPanel(_ref) {
|
|
64
64
|
let {
|
|
65
65
|
url,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_evangelistElements","data","require","_classnames","_interopRequireDefault","_reactRouterDom","_react","_interopRequireWildcard","_uiFoundationUi","_baseReactNavigation","_compositionsPanelModule","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","obj","_extends","assign","bind","target","arguments","length","source","key","prototype","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","CompositionsPanel","_ref","url","compositions","isScaling","onSelectComposition","onSelect","active","includesEnvTemplate","useNameParam","className","rest","shouldAddNameParam","handleSelect","useCallback","selected","location","useLocation","searchParams","useSearchParams","versionFromQueryParams","navigate","useNavigate","onCompositionCodeClicked","composition","preventDefault","queryParams","URLSearchParams","basePath","pathname","split","filepath","toString","identifier","createElement","classNames","map","href","styles","linkWrapper","panelLink","onClick","box","name","displayName","right","MenuWidgetIcon","codeLink","icon","tooltipContent","rel","Icon","of"],"sources":["compositions-panel.tsx"],"sourcesContent":["import { Icon } from '@teambit/evangelist.elements.icon';\nimport classNames from 'classnames';\nimport { useSearchParams } from 'react-router-dom';\nimport React, { useCallback } from 'react';\nimport { MenuWidgetIcon } from '@teambit/ui-foundation.ui.menu-widget-icon';\nimport { useNavigate, useLocation } from '@teambit/base-react.navigation.link';\nimport { Composition } from '../../composition';\nimport styles from './compositions-panel.module.scss';\n\nexport type CompositionsPanelProps = {\n /**\n * list of compositions\n */\n compositions: Composition[];\n /**\n * select composition to display\n */\n onSelectComposition: (composition: Composition) => void;\n /**\n * the currently active composition\n */\n active?: Composition;\n /**\n * the url to the base composition. doesntc contain the current composition params\n */\n url: string;\n /**\n * checks if a component is using the new preview api. if false, doesnt scale to support new preview\n */\n isScaling?: boolean;\n\n includesEnvTemplate?: boolean;\n\n useNameParam?: boolean;\n} & React.HTMLAttributes<HTMLUListElement>;\n\nexport function CompositionsPanel({\n url,\n compositions,\n isScaling,\n onSelectComposition: onSelect,\n active,\n includesEnvTemplate,\n useNameParam,\n className,\n ...rest\n}: CompositionsPanelProps) {\n const shouldAddNameParam = useNameParam || (isScaling && includesEnvTemplate === false);\n\n const handleSelect = useCallback(\n (selected: Composition) => {\n onSelect && onSelect(selected);\n },\n [onSelect]\n );\n\n const location = useLocation();\n const [searchParams] = useSearchParams();\n const versionFromQueryParams = searchParams.get('version');\n const navigate = useNavigate();\n\n const onCompositionCodeClicked = useCallback(\n (composition: Composition) => (e: React.MouseEvent<HTMLDivElement>) => {\n e.preventDefault();\n const queryParams = new URLSearchParams();\n if (versionFromQueryParams) {\n queryParams.set('version', versionFromQueryParams);\n }\n const basePath = location?.pathname.split('/~compositions')[0];\n navigate(`${basePath}/~code/${composition.filepath}?${queryParams.toString()}#search=${composition.identifier}`);\n },\n [location?.pathname, versionFromQueryParams]\n );\n\n return (\n <ul {...rest} className={classNames(className)}>\n {compositions.map((composition) => {\n const href = shouldAddNameParam ? `${url}&name=${composition.identifier}` : `${url}&${composition.identifier}`;\n return (\n <li\n key={composition.identifier}\n className={classNames(styles.linkWrapper, composition === active && styles.active)}\n >\n <a className={styles.panelLink} onClick={() => handleSelect(composition)}>\n <span className={styles.box}></span>\n <span className={styles.name}>{composition.displayName}</span>\n </a>\n <div className={styles.right}>\n <MenuWidgetIcon\n className={styles.codeLink}\n icon=\"Code\"\n tooltipContent=\"Code\"\n onClick={onCompositionCodeClicked(composition)}\n />\n <a className={styles.panelLink} target=\"_blank\" rel=\"noopener noreferrer\" href={href}>\n <Icon className={styles.icon} of=\"open-tab\" />\n </a>\n </div>\n </li>\n );\n })}\n </ul>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,oBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,mBAAA,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;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,eAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAM,uBAAA,CAAAL,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAL,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;AACA,SAAAQ,qBAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,oBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAS,yBAAA;EAAA,MAAAT,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAQ,wBAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsD,MAAAU,SAAA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CAChD,CAAC,eACFpE,MAAA,GAAAY,OAAA,CAAAkE,aAAA;MAAGxB,SAAS,EAAE4B,kCAAM,CAACE,SAAU;MAACtD,MAAM,EAAC,QAAQ;MAACgE,GAAG,EAAC,qBAAqB;MAACb,IAAI,EAAEA;IAAK,gBACnFjF,MAAA,GAAAY,OAAA,CAAAkE,aAAA,CAACpF,mBAAA,GAAAqG,IAAI;MAACzC,SAAS,EAAE4B,kCAAM,CAACU,IAAK;MAACI,EAAE,EAAC;IAAU,CAAE,CAC5C,CACA,CACH,CAAC;EAET,CAAC,CACC,CAAC;AAET","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_evangelistElements","data","require","_classnames","_interopRequireDefault","_reactRouterDom","_react","_interopRequireWildcard","_uiFoundationUi","_baseReactNavigation","_compositionsPanelModule","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","CompositionsPanel","_ref","url","compositions","isScaling","onSelectComposition","onSelect","active","includesEnvTemplate","useNameParam","className","rest","shouldAddNameParam","handleSelect","useCallback","selected","location","useLocation","searchParams","useSearchParams","versionFromQueryParams","navigate","useNavigate","onCompositionCodeClicked","composition","preventDefault","queryParams","URLSearchParams","basePath","pathname","split","filepath","toString","identifier","createElement","classNames","map","href","key","styles","linkWrapper","panelLink","onClick","box","name","displayName","right","MenuWidgetIcon","codeLink","icon","tooltipContent","target","rel","Icon","of"],"sources":["compositions-panel.tsx"],"sourcesContent":["import { Icon } from '@teambit/evangelist.elements.icon';\nimport classNames from 'classnames';\nimport { useSearchParams } from 'react-router-dom';\nimport React, { useCallback } from 'react';\nimport { MenuWidgetIcon } from '@teambit/ui-foundation.ui.menu-widget-icon';\nimport { useNavigate, useLocation } from '@teambit/base-react.navigation.link';\nimport { Composition } from '../../composition';\nimport styles from './compositions-panel.module.scss';\n\nexport type CompositionsPanelProps = {\n /**\n * list of compositions\n */\n compositions: Composition[];\n /**\n * select composition to display\n */\n onSelectComposition: (composition: Composition) => void;\n /**\n * the currently active composition\n */\n active?: Composition;\n /**\n * the url to the base composition. doesntc contain the current composition params\n */\n url: string;\n /**\n * checks if a component is using the new preview api. if false, doesnt scale to support new preview\n */\n isScaling?: boolean;\n\n includesEnvTemplate?: boolean;\n\n useNameParam?: boolean;\n} & React.HTMLAttributes<HTMLUListElement>;\n\nexport function CompositionsPanel({\n url,\n compositions,\n isScaling,\n onSelectComposition: onSelect,\n active,\n includesEnvTemplate,\n useNameParam,\n className,\n ...rest\n}: CompositionsPanelProps) {\n const shouldAddNameParam = useNameParam || (isScaling && includesEnvTemplate === false);\n\n const handleSelect = useCallback(\n (selected: Composition) => {\n onSelect && onSelect(selected);\n },\n [onSelect]\n );\n\n const location = useLocation();\n const [searchParams] = useSearchParams();\n const versionFromQueryParams = searchParams.get('version');\n const navigate = useNavigate();\n\n const onCompositionCodeClicked = useCallback(\n (composition: Composition) => (e: React.MouseEvent<HTMLDivElement>) => {\n e.preventDefault();\n const queryParams = new URLSearchParams();\n if (versionFromQueryParams) {\n queryParams.set('version', versionFromQueryParams);\n }\n const basePath = location?.pathname.split('/~compositions')[0];\n navigate(`${basePath}/~code/${composition.filepath}?${queryParams.toString()}#search=${composition.identifier}`);\n },\n [location?.pathname, versionFromQueryParams]\n );\n\n return (\n <ul {...rest} className={classNames(className)}>\n {compositions.map((composition) => {\n const href = shouldAddNameParam ? `${url}&name=${composition.identifier}` : `${url}&${composition.identifier}`;\n return (\n <li\n key={composition.identifier}\n className={classNames(styles.linkWrapper, composition === active && styles.active)}\n >\n <a className={styles.panelLink} onClick={() => handleSelect(composition)}>\n <span className={styles.box}></span>\n <span className={styles.name}>{composition.displayName}</span>\n </a>\n <div className={styles.right}>\n <MenuWidgetIcon\n className={styles.codeLink}\n icon=\"Code\"\n tooltipContent=\"Code\"\n onClick={onCompositionCodeClicked(composition)}\n />\n <a className={styles.panelLink} target=\"_blank\" rel=\"noopener noreferrer\" href={href}>\n <Icon className={styles.icon} of=\"open-tab\" />\n </a>\n </div>\n </li>\n );\n })}\n </ul>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,oBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,mBAAA,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;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,eAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAM,uBAAA,CAAAL,OAAA;EAAAI,MAAA,YAAAA,CAAA;IAAA,OAAAL,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;AACA,SAAAQ,qBAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,oBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAS,yBAAA;EAAA,MAAAT,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAQ,wBAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsD,MAAAU,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,C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EAAEA;IAAK,gBACnF3E,MAAA,GAAAY,OAAA,CAAA4D,aAAA,CAAC9E,mBAAA,GAAAiG,IAAI;MAAC3C,SAAS,EAAE6B,kCAAM,CAACU,IAAK;MAACK,EAAE,EAAC;IAAU,CAAE,CAC5C,CACA,CACH,CAAC;EAET,CAAC,CACC,CAAC;AAET","ignoreList":[]}
|
|
@@ -26,9 +26,9 @@ function _compositionsPanelNodeModule() {
|
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
28
|
const _excluded = ["name", "onClick", "isActive"];
|
|
29
|
-
function _interopRequireDefault(
|
|
30
|
-
function _objectWithoutProperties(
|
|
31
|
-
function _objectWithoutPropertiesLoose(
|
|
29
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
31
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
32
32
|
function CompositionsPanelNode(_ref) {
|
|
33
33
|
let {
|
|
34
34
|
name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","data","_interopRequireDefault","require","_react","_compositionsPanelNodeModule","_excluded","
|
|
1
|
+
{"version":3,"names":["_classnames","data","_interopRequireDefault","require","_react","_compositionsPanelNodeModule","_excluded","e","__esModule","default","_objectWithoutProperties","t","o","r","i","_objectWithoutPropertiesLoose","Object","getOwnPropertySymbols","n","length","indexOf","propertyIsEnumerable","call","hasOwnProperty","CompositionsPanelNode","_ref","name","onClick","isActive","rest","createElement","className","classNames","styles","linkWrapper","active","panelLink"],"sources":["compositions-panel-node.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport React from 'react';\n\nimport styles from './compositions-panel-node.module.scss';\n\nexport type CompositionsPanelNodeProps = {\n name: string;\n onClick: (event: React.MouseEvent<HTMLAnchorElement>) => void;\n isActive: boolean;\n} & React.HTMLAttributes<HTMLLIElement>;\n\nexport function CompositionsPanelNode({ name, onClick, isActive, ...rest }: CompositionsPanelNodeProps) {\n return (\n <li {...rest}>\n <div className={classNames(styles.linkWrapper, { [styles.active]: isActive })}>\n <a className={styles.panelLink} onClick={onClick}>\n {name}\n </a>\n </div>\n </li>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,6BAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,4BAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2D,MAAAK,SAAA;AAAA,SAAAJ,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,EAAAI,CAAA,gBAAAJ,CAAA,iBAAAK,CAAA,EAAAC,CAAA,EAAAC,CAAA,GAAAC,6BAAA,CAAAR,CAAA,EAAAI,CAAA,OAAAK,MAAA,CAAAC,qBAAA,QAAAC,CAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAV,CAAA,QAAAM,CAAA,MAAAA,CAAA,GAAAK,CAAA,CAAAC,MAAA,EAAAN,CAAA,IAAAD,CAAA,GAAAM,CAAA,CAAAL,CAAA,GAAAF,CAAA,CAAAS,OAAA,CAAAR,CAAA,aAAAS,oBAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAK,CAAA,MAAAE,CAAA,CAAAF,CAAA,IAAAL,CAAA,CAAAK,CAAA,aAAAE,CAAA;AAAA,SAAAC,8BAAAF,CAAA,EAAAN,CAAA,gBAAAM,CAAA,iBAAAF,CAAA,gBAAAO,CAAA,IAAAL,CAAA,SAAAU,cAAA,CAAAD,IAAA,CAAAT,CAAA,EAAAK,CAAA,SAAAX,CAAA,CAAAa,OAAA,CAAAF,CAAA,kBAAAP,CAAA,CAAAO,CAAA,IAAAL,CAAA,CAAAK,CAAA,YAAAP,CAAA;AAQpD,SAASa,qBAAqBA,CAAAC,IAAA,EAAmE;EAAA,IAAlE;MAAEC,IAAI;MAAEC,OAAO;MAAEC;IAA8C,CAAC,GAAAH,IAAA;IAAlCI,IAAI,GAAAnB,wBAAA,CAAAe,IAAA,EAAAnB,SAAA;EACtE,oBACEF,MAAA,GAAAK,OAAA,CAAAqB,aAAA,OAAQD,IAAI,eACVzB,MAAA,GAAAK,OAAA,CAAAqB,aAAA;IAAKC,SAAS,EAAE,IAAAC,qBAAU,EAACC,sCAAM,CAACC,WAAW,EAAE;MAAE,CAACD,sCAAM,CAACE,MAAM,GAAGP;IAAS,CAAC;EAAE,gBAC5ExB,MAAA,GAAAK,OAAA,CAAAqB,aAAA;IAAGC,SAAS,EAAEE,sCAAM,CAACG,SAAU;IAACT,OAAO,EAAEA;EAAQ,GAC9CD,IACA,CACA,CACH,CAAC;AAET","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/compositions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.284",
|
|
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.
|
|
9
|
+
"version": "1.0.284"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphql-tag": "2.12.1",
|
|
@@ -34,23 +34,23 @@
|
|
|
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.
|
|
37
|
+
"@teambit/component": "1.0.284",
|
|
38
38
|
"@teambit/compositions.model.composition-id": "0.0.502",
|
|
39
|
-
"@teambit/graphql": "1.0.
|
|
39
|
+
"@teambit/graphql": "1.0.284",
|
|
40
40
|
"@teambit/cli": "0.0.865",
|
|
41
|
-
"@teambit/dev-files": "1.0.
|
|
42
|
-
"@teambit/envs": "1.0.
|
|
43
|
-
"@teambit/preview": "1.0.
|
|
44
|
-
"@teambit/schema": "1.0.
|
|
45
|
-
"@teambit/scope": "1.0.
|
|
41
|
+
"@teambit/dev-files": "1.0.284",
|
|
42
|
+
"@teambit/envs": "1.0.284",
|
|
43
|
+
"@teambit/preview": "1.0.284",
|
|
44
|
+
"@teambit/schema": "1.0.284",
|
|
45
|
+
"@teambit/scope": "1.0.284",
|
|
46
46
|
"@teambit/toolbox.path.match-patterns": "0.0.15",
|
|
47
|
-
"@teambit/workspace": "1.0.
|
|
47
|
+
"@teambit/workspace": "1.0.284",
|
|
48
48
|
"@teambit/docs.ui.queries.get-docs": "0.0.508",
|
|
49
49
|
"@teambit/panels": "0.0.867",
|
|
50
50
|
"@teambit/preview.ui.component-preview": "1.0.12",
|
|
51
51
|
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.222",
|
|
52
|
-
"@teambit/component-compare": "1.0.
|
|
53
|
-
"@teambit/ui": "1.0.
|
|
52
|
+
"@teambit/component-compare": "1.0.284",
|
|
53
|
+
"@teambit/ui": "1.0.284"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/lodash": "4.14.165",
|