@teambit/compositions 1.0.161 → 1.0.162
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 +54 -54
- package/compositions.tsx +8 -13
- package/dist/compositions.js +7 -14
- package/dist/compositions.js.map +1 -1
- package/dist/{preview-1707362166593.js → preview-1707535034490.js} +2 -2
- package/dist/ui/compositions-panel/compositions-panel.js +15 -2
- package/dist/ui/compositions-panel/compositions-panel.js.map +1 -1
- package/package.json +12 -12
- package/ui/compositions-panel/compositions-panel.tsx +9 -2
|
@@ -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.162" 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={45964:(e,o,t)=>{var n={id:"teambit.compositions/aspect-docs/compositions@0.0.167",homepage:"https://bit.cloud/teambit/compositions/aspect-docs/compositions",exported:!0};Object.defineProperty(o,"__esModule",{value:!0}),o.default=f,a(t(6376));var i=t(50762),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,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)t=s[n],o.indexOf(t)>=0||(i[t]=e[t]);return i}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},37144:(e,o,t)=>{Object.defineProperty(o,"c",{enumerable:!0,get:function(){return n.default}});var n=i(t(45964));function i(e){return e&&e.__esModule?e:{default:e}}i.__bit_component={id:"teambit.compositions/aspect-docs/compositions@0.0.167",homepage:"https://bit.cloud/teambit/compositions/aspect-docs/compositions",exported:!0}},59968:(e,o,t)=>{var n={id:"teambit.compositions/compositions@1.0.161",homepage:"https://bit.cloud/teambit/compositions/compositions",exported:!0};function i(){const e=s(t(6376));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},50762:e=>{e.exports=MdxJsReact},6376: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(59968),i=(t(6376),t(50762));const s=TeambitMdxUiMdxScopeContext;var a=t(37144),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,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)t=s[n],o.indexOf(t)>=0||(i[t]=e[t]);return i}(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.c},mdxType:"MDXScopeProvider"},(0,i.mdx)(a.c,{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={45964:(e,o,t)=>{var n={id:"teambit.compositions/aspect-docs/compositions@0.0.167",homepage:"https://bit.cloud/teambit/compositions/aspect-docs/compositions",exported:!0};Object.defineProperty(o,"__esModule",{value:!0}),o.default=f,a(t(6376));var i=t(50762),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,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)t=s[n],o.indexOf(t)>=0||(i[t]=e[t]);return i}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},37144:(e,o,t)=>{Object.defineProperty(o,"c",{enumerable:!0,get:function(){return n.default}});var n=i(t(45964));function i(e){return e&&e.__esModule?e:{default:e}}i.__bit_component={id:"teambit.compositions/aspect-docs/compositions@0.0.167",homepage:"https://bit.cloud/teambit/compositions/aspect-docs/compositions",exported:!0}},60456:(e,o,t)=>{var n={id:"teambit.compositions/compositions@1.0.162",homepage:"https://bit.cloud/teambit/compositions/compositions",exported:!0};function i(){const e=s(t(6376));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},50762:e=>{e.exports=MdxJsReact},6376: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(60456),i=(t(6376),t(50762));const s=TeambitMdxUiMdxScopeContext;var a=t(37144),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,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)t=s[n],o.indexOf(t)>=0||(i[t]=e[t]);return i}(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.c},mdxType:"MDXScopeProvider"},(0,i.mdx)(a.c,{mdxType:"Compositions"})))}l.isMDXComponent=!0;const d=[o],u=[e],h={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),n})()));
|
package/artifacts/schema.json
CHANGED
|
@@ -1618,7 +1618,7 @@
|
|
|
1618
1618
|
"__schema": "TypeSchema",
|
|
1619
1619
|
"location": {
|
|
1620
1620
|
"filePath": "compositions.tsx",
|
|
1621
|
-
"line":
|
|
1621
|
+
"line": 155,
|
|
1622
1622
|
"character": 1
|
|
1623
1623
|
},
|
|
1624
1624
|
"signature": "type CompositionContentProps = {\n component: ComponentModel;\n selected?: Composition | undefined;\n queryParams?: string | string[] | undefined;\n emptyState?: EmptyStateSlot | undefined;\n} & {\n composition?: Composition | undefined;\n} & ComponentPreviewProps",
|
|
@@ -1627,7 +1627,7 @@
|
|
|
1627
1627
|
"__schema": "TypeIntersectionSchema",
|
|
1628
1628
|
"location": {
|
|
1629
1629
|
"filePath": "compositions.tsx",
|
|
1630
|
-
"line":
|
|
1630
|
+
"line": 155,
|
|
1631
1631
|
"character": 39
|
|
1632
1632
|
},
|
|
1633
1633
|
"types": [
|
|
@@ -1635,7 +1635,7 @@
|
|
|
1635
1635
|
"__schema": "TypeLiteralSchema",
|
|
1636
1636
|
"location": {
|
|
1637
1637
|
"filePath": "compositions.tsx",
|
|
1638
|
-
"line":
|
|
1638
|
+
"line": 155,
|
|
1639
1639
|
"character": 39
|
|
1640
1640
|
},
|
|
1641
1641
|
"members": [
|
|
@@ -1643,7 +1643,7 @@
|
|
|
1643
1643
|
"__schema": "VariableLikeSchema",
|
|
1644
1644
|
"location": {
|
|
1645
1645
|
"filePath": "compositions.tsx",
|
|
1646
|
-
"line":
|
|
1646
|
+
"line": 156,
|
|
1647
1647
|
"character": 3
|
|
1648
1648
|
},
|
|
1649
1649
|
"signature": "(property) component: ComponentModel",
|
|
@@ -1652,7 +1652,7 @@
|
|
|
1652
1652
|
"__schema": "TypeRefSchema",
|
|
1653
1653
|
"location": {
|
|
1654
1654
|
"filePath": "compositions.tsx",
|
|
1655
|
-
"line":
|
|
1655
|
+
"line": 156,
|
|
1656
1656
|
"character": 3
|
|
1657
1657
|
},
|
|
1658
1658
|
"name": "ComponentModel",
|
|
@@ -1667,7 +1667,7 @@
|
|
|
1667
1667
|
"__schema": "VariableLikeSchema",
|
|
1668
1668
|
"location": {
|
|
1669
1669
|
"filePath": "compositions.tsx",
|
|
1670
|
-
"line":
|
|
1670
|
+
"line": 157,
|
|
1671
1671
|
"character": 3
|
|
1672
1672
|
},
|
|
1673
1673
|
"signature": "(property) selected?: Composition | undefined",
|
|
@@ -1676,7 +1676,7 @@
|
|
|
1676
1676
|
"__schema": "TypeRefSchema",
|
|
1677
1677
|
"location": {
|
|
1678
1678
|
"filePath": "compositions.tsx",
|
|
1679
|
-
"line":
|
|
1679
|
+
"line": 157,
|
|
1680
1680
|
"character": 14
|
|
1681
1681
|
},
|
|
1682
1682
|
"name": "Composition"
|
|
@@ -1687,7 +1687,7 @@
|
|
|
1687
1687
|
"__schema": "VariableLikeSchema",
|
|
1688
1688
|
"location": {
|
|
1689
1689
|
"filePath": "compositions.tsx",
|
|
1690
|
-
"line":
|
|
1690
|
+
"line": 158,
|
|
1691
1691
|
"character": 3
|
|
1692
1692
|
},
|
|
1693
1693
|
"signature": "(property) queryParams?: string | string[] | undefined",
|
|
@@ -1696,7 +1696,7 @@
|
|
|
1696
1696
|
"__schema": "TypeUnionSchema",
|
|
1697
1697
|
"location": {
|
|
1698
1698
|
"filePath": "compositions.tsx",
|
|
1699
|
-
"line":
|
|
1699
|
+
"line": 158,
|
|
1700
1700
|
"character": 17
|
|
1701
1701
|
},
|
|
1702
1702
|
"types": [
|
|
@@ -1704,7 +1704,7 @@
|
|
|
1704
1704
|
"__schema": "KeywordTypeSchema",
|
|
1705
1705
|
"location": {
|
|
1706
1706
|
"filePath": "compositions.tsx",
|
|
1707
|
-
"line":
|
|
1707
|
+
"line": 158,
|
|
1708
1708
|
"character": 17
|
|
1709
1709
|
},
|
|
1710
1710
|
"name": "string"
|
|
@@ -1713,14 +1713,14 @@
|
|
|
1713
1713
|
"__schema": "TypeArraySchema",
|
|
1714
1714
|
"location": {
|
|
1715
1715
|
"filePath": "compositions.tsx",
|
|
1716
|
-
"line":
|
|
1716
|
+
"line": 158,
|
|
1717
1717
|
"character": 26
|
|
1718
1718
|
},
|
|
1719
1719
|
"type": {
|
|
1720
1720
|
"__schema": "KeywordTypeSchema",
|
|
1721
1721
|
"location": {
|
|
1722
1722
|
"filePath": "compositions.tsx",
|
|
1723
|
-
"line":
|
|
1723
|
+
"line": 158,
|
|
1724
1724
|
"character": 26
|
|
1725
1725
|
},
|
|
1726
1726
|
"name": "string"
|
|
@@ -1734,7 +1734,7 @@
|
|
|
1734
1734
|
"__schema": "VariableLikeSchema",
|
|
1735
1735
|
"location": {
|
|
1736
1736
|
"filePath": "compositions.tsx",
|
|
1737
|
-
"line":
|
|
1737
|
+
"line": 159,
|
|
1738
1738
|
"character": 3
|
|
1739
1739
|
},
|
|
1740
1740
|
"signature": "(property) emptyState?: EmptyStateSlot | undefined",
|
|
@@ -1743,7 +1743,7 @@
|
|
|
1743
1743
|
"__schema": "TypeRefSchema",
|
|
1744
1744
|
"location": {
|
|
1745
1745
|
"filePath": "compositions.tsx",
|
|
1746
|
-
"line":
|
|
1746
|
+
"line": 159,
|
|
1747
1747
|
"character": 16
|
|
1748
1748
|
},
|
|
1749
1749
|
"name": "EmptyStateSlot"
|
|
@@ -1756,7 +1756,7 @@
|
|
|
1756
1756
|
"__schema": "TypeRefSchema",
|
|
1757
1757
|
"location": {
|
|
1758
1758
|
"filePath": "compositions.tsx",
|
|
1759
|
-
"line":
|
|
1759
|
+
"line": 160,
|
|
1760
1760
|
"character": 5
|
|
1761
1761
|
},
|
|
1762
1762
|
"name": "ComponentCompositionProps"
|
|
@@ -1768,7 +1768,7 @@
|
|
|
1768
1768
|
"__schema": "ReactSchema",
|
|
1769
1769
|
"location": {
|
|
1770
1770
|
"filePath": "compositions.tsx",
|
|
1771
|
-
"line":
|
|
1771
|
+
"line": 162,
|
|
1772
1772
|
"character": 1
|
|
1773
1773
|
},
|
|
1774
1774
|
"signature": "function CompositionContent({ component, selected, queryParams, emptyState, ...componentCompositionProps }: CompositionContentProps): React.JSX.Element",
|
|
@@ -1777,7 +1777,7 @@
|
|
|
1777
1777
|
"__schema": "ParameterSchema",
|
|
1778
1778
|
"location": {
|
|
1779
1779
|
"filePath": "compositions.tsx",
|
|
1780
|
-
"line":
|
|
1780
|
+
"line": 162,
|
|
1781
1781
|
"character": 36
|
|
1782
1782
|
},
|
|
1783
1783
|
"name": "{ component, selected, queryParams, emptyState, ...componentCompositionProps }",
|
|
@@ -1785,7 +1785,7 @@
|
|
|
1785
1785
|
"__schema": "TypeRefSchema",
|
|
1786
1786
|
"location": {
|
|
1787
1787
|
"filePath": "compositions.tsx",
|
|
1788
|
-
"line":
|
|
1788
|
+
"line": 168,
|
|
1789
1789
|
"character": 4
|
|
1790
1790
|
},
|
|
1791
1791
|
"name": "CompositionContentProps"
|
|
@@ -1796,7 +1796,7 @@
|
|
|
1796
1796
|
"__schema": "InferenceTypeSchema",
|
|
1797
1797
|
"location": {
|
|
1798
1798
|
"filePath": "compositions.tsx",
|
|
1799
|
-
"line":
|
|
1799
|
+
"line": 163,
|
|
1800
1800
|
"character": 3
|
|
1801
1801
|
},
|
|
1802
1802
|
"name": "component",
|
|
@@ -1807,7 +1807,7 @@
|
|
|
1807
1807
|
"__schema": "InferenceTypeSchema",
|
|
1808
1808
|
"location": {
|
|
1809
1809
|
"filePath": "compositions.tsx",
|
|
1810
|
-
"line":
|
|
1810
|
+
"line": 164,
|
|
1811
1811
|
"character": 3
|
|
1812
1812
|
},
|
|
1813
1813
|
"name": "selected",
|
|
@@ -1818,7 +1818,7 @@
|
|
|
1818
1818
|
"__schema": "InferenceTypeSchema",
|
|
1819
1819
|
"location": {
|
|
1820
1820
|
"filePath": "compositions.tsx",
|
|
1821
|
-
"line":
|
|
1821
|
+
"line": 165,
|
|
1822
1822
|
"character": 3
|
|
1823
1823
|
},
|
|
1824
1824
|
"name": "queryParams",
|
|
@@ -1829,7 +1829,7 @@
|
|
|
1829
1829
|
"__schema": "InferenceTypeSchema",
|
|
1830
1830
|
"location": {
|
|
1831
1831
|
"filePath": "compositions.tsx",
|
|
1832
|
-
"line":
|
|
1832
|
+
"line": 166,
|
|
1833
1833
|
"character": 3
|
|
1834
1834
|
},
|
|
1835
1835
|
"name": "emptyState",
|
|
@@ -1840,11 +1840,11 @@
|
|
|
1840
1840
|
"__schema": "InferenceTypeSchema",
|
|
1841
1841
|
"location": {
|
|
1842
1842
|
"filePath": "compositions.tsx",
|
|
1843
|
-
"line":
|
|
1843
|
+
"line": 167,
|
|
1844
1844
|
"character": 6
|
|
1845
1845
|
},
|
|
1846
1846
|
"name": "componentCompositionProps",
|
|
1847
|
-
"type": "{\n composition?: Composition | undefined;\n previewName?: string | undefined;\n innerBottomPadding?: number | undefined;\n onLoad?: ((event?: any, props?: OnPreviewLoadProps | undefined) => void) | undefined;\n ... 278 more ...;\n
|
|
1847
|
+
"type": "{\n composition?: Composition | undefined;\n previewName?: string | undefined;\n innerBottomPadding?: number | undefined;\n onLoad?: ((event?: any, props?: OnPreviewLoadProps | undefined) => void) | undefined;\n ... 278 more ...;\n srcDoc?: string | undefined;\n}",
|
|
1848
1848
|
"isSpread": true
|
|
1849
1849
|
}
|
|
1850
1850
|
],
|
|
@@ -1854,7 +1854,7 @@
|
|
|
1854
1854
|
"__schema": "TypeRefSchema",
|
|
1855
1855
|
"location": {
|
|
1856
1856
|
"filePath": "compositions.tsx",
|
|
1857
|
-
"line":
|
|
1857
|
+
"line": 162,
|
|
1858
1858
|
"character": 1
|
|
1859
1859
|
},
|
|
1860
1860
|
"name": "React.JSX.Element",
|
|
@@ -2362,7 +2362,7 @@
|
|
|
2362
2362
|
"character": 85
|
|
2363
2363
|
},
|
|
2364
2364
|
"name": "rest",
|
|
2365
|
-
"type": "{\n previewName?: string | undefined;\n innerBottomPadding?: number | undefined;\n onLoad?: ((event?: any, props?: OnPreviewLoadProps | undefined) => void) | undefined;\n ... 278 more ...;\n
|
|
2365
|
+
"type": "{\n previewName?: string | undefined;\n innerBottomPadding?: number | undefined;\n onLoad?: ((event?: any, props?: OnPreviewLoadProps | undefined) => void) | undefined;\n ... 278 more ...;\n srcDoc?: string | undefined;\n}",
|
|
2366
2366
|
"isSpread": true
|
|
2367
2367
|
}
|
|
2368
2368
|
],
|
|
@@ -4343,7 +4343,7 @@
|
|
|
4343
4343
|
"line": 34,
|
|
4344
4344
|
"character": 3
|
|
4345
4345
|
},
|
|
4346
|
-
"signature": "(property) location: \"
|
|
4346
|
+
"signature": "(property) location: \"start\" | \"end\"",
|
|
4347
4347
|
"name": "location",
|
|
4348
4348
|
"type": {
|
|
4349
4349
|
"__schema": "TypeUnionSchema",
|
|
@@ -4529,7 +4529,7 @@
|
|
|
4529
4529
|
"__schema": "TypeSchema",
|
|
4530
4530
|
"location": {
|
|
4531
4531
|
"filePath": "compositions.tsx",
|
|
4532
|
-
"line":
|
|
4532
|
+
"line": 155,
|
|
4533
4533
|
"character": 1
|
|
4534
4534
|
},
|
|
4535
4535
|
"signature": "type CompositionContentProps = {\n component: ComponentModel;\n selected?: Composition | undefined;\n queryParams?: string | string[] | undefined;\n emptyState?: EmptyStateSlot | undefined;\n} & {\n composition?: Composition | undefined;\n} & ComponentPreviewProps",
|
|
@@ -4538,7 +4538,7 @@
|
|
|
4538
4538
|
"__schema": "TypeIntersectionSchema",
|
|
4539
4539
|
"location": {
|
|
4540
4540
|
"filePath": "compositions.tsx",
|
|
4541
|
-
"line":
|
|
4541
|
+
"line": 155,
|
|
4542
4542
|
"character": 39
|
|
4543
4543
|
},
|
|
4544
4544
|
"types": [
|
|
@@ -4546,7 +4546,7 @@
|
|
|
4546
4546
|
"__schema": "TypeLiteralSchema",
|
|
4547
4547
|
"location": {
|
|
4548
4548
|
"filePath": "compositions.tsx",
|
|
4549
|
-
"line":
|
|
4549
|
+
"line": 155,
|
|
4550
4550
|
"character": 39
|
|
4551
4551
|
},
|
|
4552
4552
|
"members": [
|
|
@@ -4554,7 +4554,7 @@
|
|
|
4554
4554
|
"__schema": "VariableLikeSchema",
|
|
4555
4555
|
"location": {
|
|
4556
4556
|
"filePath": "compositions.tsx",
|
|
4557
|
-
"line":
|
|
4557
|
+
"line": 156,
|
|
4558
4558
|
"character": 3
|
|
4559
4559
|
},
|
|
4560
4560
|
"signature": "(property) component: ComponentModel",
|
|
@@ -4563,7 +4563,7 @@
|
|
|
4563
4563
|
"__schema": "TypeRefSchema",
|
|
4564
4564
|
"location": {
|
|
4565
4565
|
"filePath": "compositions.tsx",
|
|
4566
|
-
"line":
|
|
4566
|
+
"line": 156,
|
|
4567
4567
|
"character": 3
|
|
4568
4568
|
},
|
|
4569
4569
|
"name": "ComponentModel",
|
|
@@ -4578,7 +4578,7 @@
|
|
|
4578
4578
|
"__schema": "VariableLikeSchema",
|
|
4579
4579
|
"location": {
|
|
4580
4580
|
"filePath": "compositions.tsx",
|
|
4581
|
-
"line":
|
|
4581
|
+
"line": 157,
|
|
4582
4582
|
"character": 3
|
|
4583
4583
|
},
|
|
4584
4584
|
"signature": "(property) selected?: Composition | undefined",
|
|
@@ -4587,7 +4587,7 @@
|
|
|
4587
4587
|
"__schema": "TypeRefSchema",
|
|
4588
4588
|
"location": {
|
|
4589
4589
|
"filePath": "compositions.tsx",
|
|
4590
|
-
"line":
|
|
4590
|
+
"line": 157,
|
|
4591
4591
|
"character": 14
|
|
4592
4592
|
},
|
|
4593
4593
|
"name": "Composition"
|
|
@@ -4598,7 +4598,7 @@
|
|
|
4598
4598
|
"__schema": "VariableLikeSchema",
|
|
4599
4599
|
"location": {
|
|
4600
4600
|
"filePath": "compositions.tsx",
|
|
4601
|
-
"line":
|
|
4601
|
+
"line": 158,
|
|
4602
4602
|
"character": 3
|
|
4603
4603
|
},
|
|
4604
4604
|
"signature": "(property) queryParams?: string | string[] | undefined",
|
|
@@ -4607,7 +4607,7 @@
|
|
|
4607
4607
|
"__schema": "TypeUnionSchema",
|
|
4608
4608
|
"location": {
|
|
4609
4609
|
"filePath": "compositions.tsx",
|
|
4610
|
-
"line":
|
|
4610
|
+
"line": 158,
|
|
4611
4611
|
"character": 17
|
|
4612
4612
|
},
|
|
4613
4613
|
"types": [
|
|
@@ -4615,7 +4615,7 @@
|
|
|
4615
4615
|
"__schema": "KeywordTypeSchema",
|
|
4616
4616
|
"location": {
|
|
4617
4617
|
"filePath": "compositions.tsx",
|
|
4618
|
-
"line":
|
|
4618
|
+
"line": 158,
|
|
4619
4619
|
"character": 17
|
|
4620
4620
|
},
|
|
4621
4621
|
"name": "string"
|
|
@@ -4624,14 +4624,14 @@
|
|
|
4624
4624
|
"__schema": "TypeArraySchema",
|
|
4625
4625
|
"location": {
|
|
4626
4626
|
"filePath": "compositions.tsx",
|
|
4627
|
-
"line":
|
|
4627
|
+
"line": 158,
|
|
4628
4628
|
"character": 26
|
|
4629
4629
|
},
|
|
4630
4630
|
"type": {
|
|
4631
4631
|
"__schema": "KeywordTypeSchema",
|
|
4632
4632
|
"location": {
|
|
4633
4633
|
"filePath": "compositions.tsx",
|
|
4634
|
-
"line":
|
|
4634
|
+
"line": 158,
|
|
4635
4635
|
"character": 26
|
|
4636
4636
|
},
|
|
4637
4637
|
"name": "string"
|
|
@@ -4645,7 +4645,7 @@
|
|
|
4645
4645
|
"__schema": "VariableLikeSchema",
|
|
4646
4646
|
"location": {
|
|
4647
4647
|
"filePath": "compositions.tsx",
|
|
4648
|
-
"line":
|
|
4648
|
+
"line": 159,
|
|
4649
4649
|
"character": 3
|
|
4650
4650
|
},
|
|
4651
4651
|
"signature": "(property) emptyState?: EmptyStateSlot | undefined",
|
|
@@ -4654,7 +4654,7 @@
|
|
|
4654
4654
|
"__schema": "TypeRefSchema",
|
|
4655
4655
|
"location": {
|
|
4656
4656
|
"filePath": "compositions.tsx",
|
|
4657
|
-
"line":
|
|
4657
|
+
"line": 159,
|
|
4658
4658
|
"character": 16
|
|
4659
4659
|
},
|
|
4660
4660
|
"name": "EmptyStateSlot"
|
|
@@ -4667,7 +4667,7 @@
|
|
|
4667
4667
|
"__schema": "TypeRefSchema",
|
|
4668
4668
|
"location": {
|
|
4669
4669
|
"filePath": "compositions.tsx",
|
|
4670
|
-
"line":
|
|
4670
|
+
"line": 160,
|
|
4671
4671
|
"character": 5
|
|
4672
4672
|
},
|
|
4673
4673
|
"name": "ComponentCompositionProps"
|
|
@@ -4679,7 +4679,7 @@
|
|
|
4679
4679
|
"__schema": "ReactSchema",
|
|
4680
4680
|
"location": {
|
|
4681
4681
|
"filePath": "compositions.tsx",
|
|
4682
|
-
"line":
|
|
4682
|
+
"line": 162,
|
|
4683
4683
|
"character": 1
|
|
4684
4684
|
},
|
|
4685
4685
|
"signature": "function CompositionContent({ component, selected, queryParams, emptyState, ...componentCompositionProps }: CompositionContentProps): React.JSX.Element",
|
|
@@ -4688,7 +4688,7 @@
|
|
|
4688
4688
|
"__schema": "ParameterSchema",
|
|
4689
4689
|
"location": {
|
|
4690
4690
|
"filePath": "compositions.tsx",
|
|
4691
|
-
"line":
|
|
4691
|
+
"line": 162,
|
|
4692
4692
|
"character": 36
|
|
4693
4693
|
},
|
|
4694
4694
|
"name": "{ component, selected, queryParams, emptyState, ...componentCompositionProps }",
|
|
@@ -4696,7 +4696,7 @@
|
|
|
4696
4696
|
"__schema": "TypeRefSchema",
|
|
4697
4697
|
"location": {
|
|
4698
4698
|
"filePath": "compositions.tsx",
|
|
4699
|
-
"line":
|
|
4699
|
+
"line": 168,
|
|
4700
4700
|
"character": 4
|
|
4701
4701
|
},
|
|
4702
4702
|
"name": "CompositionContentProps"
|
|
@@ -4707,7 +4707,7 @@
|
|
|
4707
4707
|
"__schema": "InferenceTypeSchema",
|
|
4708
4708
|
"location": {
|
|
4709
4709
|
"filePath": "compositions.tsx",
|
|
4710
|
-
"line":
|
|
4710
|
+
"line": 163,
|
|
4711
4711
|
"character": 3
|
|
4712
4712
|
},
|
|
4713
4713
|
"name": "component",
|
|
@@ -4718,7 +4718,7 @@
|
|
|
4718
4718
|
"__schema": "InferenceTypeSchema",
|
|
4719
4719
|
"location": {
|
|
4720
4720
|
"filePath": "compositions.tsx",
|
|
4721
|
-
"line":
|
|
4721
|
+
"line": 164,
|
|
4722
4722
|
"character": 3
|
|
4723
4723
|
},
|
|
4724
4724
|
"name": "selected",
|
|
@@ -4729,7 +4729,7 @@
|
|
|
4729
4729
|
"__schema": "InferenceTypeSchema",
|
|
4730
4730
|
"location": {
|
|
4731
4731
|
"filePath": "compositions.tsx",
|
|
4732
|
-
"line":
|
|
4732
|
+
"line": 165,
|
|
4733
4733
|
"character": 3
|
|
4734
4734
|
},
|
|
4735
4735
|
"name": "queryParams",
|
|
@@ -4740,7 +4740,7 @@
|
|
|
4740
4740
|
"__schema": "InferenceTypeSchema",
|
|
4741
4741
|
"location": {
|
|
4742
4742
|
"filePath": "compositions.tsx",
|
|
4743
|
-
"line":
|
|
4743
|
+
"line": 166,
|
|
4744
4744
|
"character": 3
|
|
4745
4745
|
},
|
|
4746
4746
|
"name": "emptyState",
|
|
@@ -4751,11 +4751,11 @@
|
|
|
4751
4751
|
"__schema": "InferenceTypeSchema",
|
|
4752
4752
|
"location": {
|
|
4753
4753
|
"filePath": "compositions.tsx",
|
|
4754
|
-
"line":
|
|
4754
|
+
"line": 167,
|
|
4755
4755
|
"character": 6
|
|
4756
4756
|
},
|
|
4757
4757
|
"name": "componentCompositionProps",
|
|
4758
|
-
"type": "{\n composition?: Composition | undefined;\n previewName?: string | undefined;\n innerBottomPadding?: number | undefined;\n onLoad?: ((event?: any, props?: OnPreviewLoadProps | undefined) => void) | undefined;\n ... 278 more ...;\n
|
|
4758
|
+
"type": "{\n composition?: Composition | undefined;\n previewName?: string | undefined;\n innerBottomPadding?: number | undefined;\n onLoad?: ((event?: any, props?: OnPreviewLoadProps | undefined) => void) | undefined;\n ... 278 more ...;\n srcDoc?: string | undefined;\n}",
|
|
4759
4759
|
"isSpread": true
|
|
4760
4760
|
}
|
|
4761
4761
|
],
|
|
@@ -4765,7 +4765,7 @@
|
|
|
4765
4765
|
"__schema": "TypeRefSchema",
|
|
4766
4766
|
"location": {
|
|
4767
4767
|
"filePath": "compositions.tsx",
|
|
4768
|
-
"line":
|
|
4768
|
+
"line": 162,
|
|
4769
4769
|
"character": 1
|
|
4770
4770
|
},
|
|
4771
4771
|
"name": "React.JSX.Element",
|
|
@@ -5375,7 +5375,7 @@
|
|
|
5375
5375
|
"character": 85
|
|
5376
5376
|
},
|
|
5377
5377
|
"name": "rest",
|
|
5378
|
-
"type": "{\n previewName?: string | undefined;\n innerBottomPadding?: number | undefined;\n onLoad?: ((event?: any, props?: OnPreviewLoadProps | undefined) => void) | undefined;\n ... 278 more ...;\n
|
|
5378
|
+
"type": "{\n previewName?: string | undefined;\n innerBottomPadding?: number | undefined;\n onLoad?: ((event?: any, props?: OnPreviewLoadProps | undefined) => void) | undefined;\n ... 278 more ...;\n srcDoc?: string | undefined;\n}",
|
|
5379
5379
|
"isSpread": true
|
|
5380
5380
|
}
|
|
5381
5381
|
],
|
|
@@ -5402,7 +5402,7 @@
|
|
|
5402
5402
|
"componentId": {
|
|
5403
5403
|
"scope": "teambit.compositions",
|
|
5404
5404
|
"name": "compositions",
|
|
5405
|
-
"version": "1.0.
|
|
5405
|
+
"version": "1.0.162"
|
|
5406
5406
|
},
|
|
5407
5407
|
"taggedModuleExports": []
|
|
5408
5408
|
}
|
package/compositions.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useState, useMemo, useRef, ReactNode } from 'react';
|
|
2
|
-
import { useParams } from 'react-router-dom';
|
|
2
|
+
import { useParams, useSearchParams } from 'react-router-dom';
|
|
3
3
|
import head from 'lodash.head';
|
|
4
4
|
import queryString from 'query-string';
|
|
5
5
|
import { ThemeContext } from '@teambit/documenter.theme.theme-context';
|
|
@@ -38,30 +38,21 @@ export type CompositionsProp = { menuBarWidgets?: CompositionsMenuSlot; emptySta
|
|
|
38
38
|
|
|
39
39
|
export function Compositions({ menuBarWidgets, emptyState }: CompositionsProp) {
|
|
40
40
|
const component = useContext(ComponentContext);
|
|
41
|
-
|
|
41
|
+
const [searchParams] = useSearchParams();
|
|
42
42
|
const params = useParams();
|
|
43
|
+
const versionFromQueryParams = searchParams.get('version');
|
|
43
44
|
const navigate = useNavigate();
|
|
44
45
|
const location = useLocation();
|
|
45
46
|
const currentCompositionName = params['*'];
|
|
46
|
-
// console.log(routes);
|
|
47
47
|
const currentComposition =
|
|
48
48
|
component.compositions.find((composition) => composition.identifier.toLowerCase() === currentCompositionName) ||
|
|
49
49
|
head(component.compositions);
|
|
50
50
|
|
|
51
|
-
// const [selected, selectComposition] = useState(head(component.compositions));
|
|
52
51
|
const selectedRef = useRef(currentComposition);
|
|
53
52
|
selectedRef.current = currentComposition;
|
|
54
53
|
|
|
55
54
|
const properties = useDocs(component.id);
|
|
56
55
|
|
|
57
|
-
// reset selected composition when component changes.
|
|
58
|
-
// this does trigger renderer, but perf seems to be ok
|
|
59
|
-
// useEffect(() => {
|
|
60
|
-
// const prevId = selectedRef.current?.identifier;
|
|
61
|
-
// const next = component.compositions.find((c) => c.identifier === prevId) || component.compositions[0];
|
|
62
|
-
|
|
63
|
-
// navigate(next.displayName.toLowerCase().replaceAll(' ', '-'));
|
|
64
|
-
// }, [component]);
|
|
65
56
|
const isMobile = useIsMobile();
|
|
66
57
|
const showSidebar = !isMobile && component.compositions.length > 0;
|
|
67
58
|
const [isSidebarOpen, setSidebarOpenness] = useState(showSidebar);
|
|
@@ -138,8 +129,12 @@ export function Compositions({ menuBarWidgets, emptyState }: CompositionsProp) {
|
|
|
138
129
|
pathSegments[pathSegments.length - 1] = composition.identifier.toLowerCase();
|
|
139
130
|
}
|
|
140
131
|
|
|
132
|
+
const urlParams = new URLSearchParams();
|
|
133
|
+
if (versionFromQueryParams) {
|
|
134
|
+
urlParams.set('version', versionFromQueryParams);
|
|
135
|
+
}
|
|
141
136
|
const newPath = pathSegments.join('/');
|
|
142
|
-
navigate(`/${newPath}`);
|
|
137
|
+
navigate(`/${newPath}?${urlParams.toString()}`);
|
|
143
138
|
}}
|
|
144
139
|
url={compositionUrl}
|
|
145
140
|
compositions={component.compositions}
|
package/dist/compositions.js
CHANGED
|
@@ -206,27 +206,16 @@ function Compositions({
|
|
|
206
206
|
emptyState
|
|
207
207
|
}) {
|
|
208
208
|
const component = (0, _react().useContext)(_component().ComponentContext);
|
|
209
|
-
|
|
209
|
+
const [searchParams] = (0, _reactRouterDom().useSearchParams)();
|
|
210
210
|
const params = (0, _reactRouterDom().useParams)();
|
|
211
|
+
const versionFromQueryParams = searchParams.get('version');
|
|
211
212
|
const navigate = (0, _baseReactNavigation().useNavigate)();
|
|
212
213
|
const location = (0, _baseReactNavigation().useLocation)();
|
|
213
214
|
const currentCompositionName = params['*'];
|
|
214
|
-
// console.log(routes);
|
|
215
215
|
const currentComposition = component.compositions.find(composition => composition.identifier.toLowerCase() === currentCompositionName) || (0, _lodash().default)(component.compositions);
|
|
216
|
-
|
|
217
|
-
// const [selected, selectComposition] = useState(head(component.compositions));
|
|
218
216
|
const selectedRef = (0, _react().useRef)(currentComposition);
|
|
219
217
|
selectedRef.current = currentComposition;
|
|
220
218
|
const properties = (0, _docsUiQueries().useDocs)(component.id);
|
|
221
|
-
|
|
222
|
-
// reset selected composition when component changes.
|
|
223
|
-
// this does trigger renderer, but perf seems to be ok
|
|
224
|
-
// useEffect(() => {
|
|
225
|
-
// const prevId = selectedRef.current?.identifier;
|
|
226
|
-
// const next = component.compositions.find((c) => c.identifier === prevId) || component.compositions[0];
|
|
227
|
-
|
|
228
|
-
// navigate(next.displayName.toLowerCase().replaceAll(' ', '-'));
|
|
229
|
-
// }, [component]);
|
|
230
219
|
const isMobile = (0, _uiFoundationUiHooks().useIsMobile)();
|
|
231
220
|
const showSidebar = !isMobile && component.compositions.length > 0;
|
|
232
221
|
const [isSidebarOpen, setSidebarOpenness] = (0, _react().useState)(showSidebar);
|
|
@@ -299,8 +288,12 @@ function Compositions({
|
|
|
299
288
|
} else {
|
|
300
289
|
pathSegments[pathSegments.length - 1] = composition.identifier.toLowerCase();
|
|
301
290
|
}
|
|
291
|
+
const urlParams = new URLSearchParams();
|
|
292
|
+
if (versionFromQueryParams) {
|
|
293
|
+
urlParams.set('version', versionFromQueryParams);
|
|
294
|
+
}
|
|
302
295
|
const newPath = pathSegments.join('/');
|
|
303
|
-
navigate(`/${newPath}`);
|
|
296
|
+
navigate(`/${newPath}?${urlParams.toString()}`);
|
|
304
297
|
},
|
|
305
298
|
url: compositionUrl,
|
|
306
299
|
compositions: component.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","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","Compositions","menuBarWidgets","emptyState","component","useContext","ComponentContext","params","useParams","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","Link","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","newPath","join","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 } 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, 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\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, setSearchParams] = useSearchParams();\n const params = useParams();\n const navigate = useNavigate();\n const location = useLocation();\n const currentCompositionName = params['*'];\n // console.log(routes);\n const currentComposition =\n component.compositions.find((composition) => composition.identifier.toLowerCase() === currentCompositionName) ||\n head(component.compositions);\n\n // const [selected, selectComposition] = useState(head(component.compositions));\n const selectedRef = useRef(currentComposition);\n selectedRef.current = currentComposition;\n\n const properties = useDocs(component.id);\n\n // reset selected composition when component changes.\n // this does trigger renderer, but perf seems to be ok\n // useEffect(() => {\n // const prevId = selectedRef.current?.identifier;\n // const next = component.compositions.find((c) => c.identifier === prevId) || component.compositions[0];\n\n // navigate(next.displayName.toLowerCase().replaceAll(' ', '-'));\n // }, [component]);\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 newPath = pathSegments.join('/');\n navigate(`/${newPath}`);\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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,6BAAM,CAACwE;IAClB;IAAA;IACAC,QAAQ,EAAE,IAAK;IACflI,SAAS,EAAEA,SAAU;IACrBmI,WAAW,EAAC,MAAM;IAClBtH,WAAW,EAAEyD,QAAS;IACtB8D,iBAAiB;IACjBC,MAAM,EAAE,IAAK;IACbxF,WAAW,EAAEA;EAAY,GACrB8D,yBAAyB,CAC9B,CAAC;AAEN"}
|
|
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","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","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","Link","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, 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\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 force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ACV,KAAK,EAAC;EAA2B,GAAC,2BAE5F,CAAC;EAExB,IAAIxH,SAAS,EAAE+H,WAAW,KAAK,QAAQ,IAAI/H,SAAS,EAAEqH,IAAI,KAAK,qBAAqB,EAClF,oBACEhM,MAAA,GAAAkC,OAAA,CAAA8F,aAAA,CAACrG,iBAAA,GAAAgL,iBAAiB;IAChBrE,SAAS,EAAEC,6BAAM,CAACqE,kBAAmB;IACrCC,MAAM,EAAC,SAAS;IAChBV,KAAK,EAAC;EAAkC,CACtB,CAAC;;EAGzB;EACA,IAAIxH,SAAS,CAACc,YAAY,CAAC9B,MAAM,KAAK,CAAC,EAAE;IACvC,oBACE3D,MAAA,GAAAkC,OAAA,CAAA8F,aAAA,CAAChH,SAAA,GAAA8L,QAAQ;MACPX,KAAK,EAAC,+CAA+C;MACrDY,QAAQ,EAAC,kCAAkC;MAC3CC,IAAI,EAAG;IAAoF,CAC5F,CAAC;EAEN;EAEA,oBACEhN,MAAA,GAAAkC,OAAA,CAAA8F,aAAA,CAACnG,GAAA,GAAAoL,oBAAoB,EAAA3J,QAAA;IACnBgF,SAAS,EAAEC,6BAAM,CAAC2E;IAClB;IAAA;IACAC,QAAQ,EAAE,IAAK;IACfxI,SAAS,EAAEA,SAAU;IACrByI,WAAW,EAAC,MAAM;IAClBzH,WAAW,EAAEyD,QAAS;IACtBiE,iBAAiB;IACjBC,MAAM,EAAE,IAAK;IACb3F,WAAW,EAAEA;EAAY,GACrBiE,yBAAyB,CAC9B,CAAC;AAEN"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compositions_compositions@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compositions_compositions@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compositions_compositions@1.0.162/dist/compositions.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.compositions_compositions@1.0.162/dist/compositions.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -18,6 +18,13 @@ function _classnames() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
+
function _reactRouterDom() {
|
|
22
|
+
const data = require("react-router-dom");
|
|
23
|
+
_reactRouterDom = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
21
28
|
function _react() {
|
|
22
29
|
const data = _interopRequireWildcard(require("react"));
|
|
23
30
|
_react = function () {
|
|
@@ -70,12 +77,18 @@ function CompositionsPanel(_ref) {
|
|
|
70
77
|
onSelect && onSelect(selected);
|
|
71
78
|
}, [onSelect]);
|
|
72
79
|
const location = (0, _baseReactNavigation().useLocation)();
|
|
80
|
+
const [searchParams] = (0, _reactRouterDom().useSearchParams)();
|
|
81
|
+
const versionFromQueryParams = searchParams.get('version');
|
|
73
82
|
const navigate = (0, _baseReactNavigation().useNavigate)();
|
|
74
83
|
const onCompositionCodeClicked = (0, _react().useCallback)(composition => e => {
|
|
75
84
|
e.preventDefault();
|
|
85
|
+
const queryParams = new URLSearchParams();
|
|
86
|
+
if (versionFromQueryParams) {
|
|
87
|
+
queryParams.set('version', versionFromQueryParams);
|
|
88
|
+
}
|
|
76
89
|
const basePath = location?.pathname.split('/~compositions')[0];
|
|
77
|
-
navigate(`${basePath}/~code/${composition.filepath}#search=${composition.identifier}`);
|
|
78
|
-
}, [location?.pathname]);
|
|
90
|
+
navigate(`${basePath}/~code/${composition.filepath}?${queryParams.toString()}#search=${composition.identifier}`);
|
|
91
|
+
}, [location?.pathname, versionFromQueryParams]);
|
|
79
92
|
return /*#__PURE__*/_react().default.createElement("ul", _extends({}, rest, {
|
|
80
93
|
className: (0, _classnames().default)(className)
|
|
81
94
|
}), compositions.map(composition => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_evangelistElements","data","require","_classnames","_interopRequireDefault","_react","_interopRequireWildcard","_uiFoundationUi","_baseReactNavigation","_compositionsPanelModule","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_extends","assign","bind","target","arguments","length","source","key","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","CompositionsPanel","_ref","url","compositions","isScaling","onSelectComposition","onSelect","active","includesEnvTemplate","useNameParam","className","rest","shouldAddNameParam","handleSelect","useCallback","selected","location","useLocation","navigate","useNavigate","onCompositionCodeClicked","composition","preventDefault","basePath","pathname","split","filepath","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 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 navigate = useNavigate();\n\n const onCompositionCodeClicked = useCallback(\n (composition: Composition) => (e: React.MouseEvent<HTMLDivElement>) => {\n e.preventDefault();\n const basePath = location?.pathname.split('/~compositions')[0];\n navigate(`${basePath}/~code/${composition.filepath}#search=${composition.identifier}`);\n },\n [location?.pathname]\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,IA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AA;MAAMlB,SAAS,EAAEsB,kCAAM,CAACK;IAAK,GAAEhB,WAAW,CAACiB,WAAkB,CAC5D,CAAC,eACJpF,MAAA,GAAAY,OAAA,CAAA8D,aAAA;MAAKlB,SAAS,EAAEsB,kCAAM,CAACO;IAAM,gBAC3BrF,MAAA,GAAAY,OAAA,CAAA8D,aAAA,CAACxE,eAAA,GAAAoF,cAAc;MACb9B,SAAS,EAAEsB,kCAAM,CAACS,QAAS;MAC3BC,IAAI,EAAC,MAAM;MACXC,cAAc,EAAC,MAAM;MACrBR,OAAO,EAAEf,wBAAwB,CAACC,WAAW;IAAE,CAChD,CAAC,eACFnE,MAAA,GAAAY,OAAA,CAAA8D,aAAA;MAAGlB,SAAS,EAAEsB,kCAAM,CAACE,SAAU;MAACjD,MAAM,EAAC,QAAQ;MAAC2D,GAAG,EAAC,qBAAqB;MAACb,IAAI,EAAEA;IAAK,gBACnF7E,MAAA,GAAAY,OAAA,CAAA8D,aAAA,CAAC/E,mBAAA,GAAAgG,IAAI;MAACnC,SAAS,EAAEsB,kCAAM,CAACU,IAAK;MAACI,EAAE,EAAC;IAAU,CAAE,CAC5C,CACA,CACH,CAAC;EAET,CAAC,CACC,CAAC;AAET"}
|
|
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","prototype","hasOwnProperty","call","i","set","obj","_extends","assign","bind","target","arguments","length","source","key","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","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,I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AACI;IAAI,CAAO,CAAC,eACpCxF,MAAA,GAAAY,OAAA,CAAAoE,aAAA;MAAMxB,SAAS,EAAE4B,kCAAM,CAACK;IAAK,GAAEnB,WAAW,CAACoB,WAAkB,CAC5D,CAAC,eACJ1F,MAAA,GAAAY,OAAA,CAAAoE,aAAA;MAAKxB,SAAS,EAAE4B,kCAAM,CAACO;IAAM,gBAC3B3F,MAAA,GAAAY,OAAA,CAAAoE,aAAA,CAAC9E,eAAA,GAAA0F,cAAc;MACbpC,SAAS,EAAE4B,kCAAM,CAACS,QAAS;MAC3BC,IAAI,EAAC,MAAM;MACXC,cAAc,EAAC,MAAM;MACrBR,OAAO,EAAElB,wBAAwB,CAACC,WAAW;IAAE,CAChD,CAAC,eACFtE,MAAA,GAAAY,OAAA,CAAAoE,aAAA;MAAGxB,SAAS,EAAE4B,kCAAM,CAACE,SAAU;MAACvD,MAAM,EAAC,QAAQ;MAACiE,GAAG,EAAC,qBAAqB;MAACb,IAAI,EAAEA;IAAK,gBACnFnF,MAAA,GAAAY,OAAA,CAAAoE,aAAA,CAACtF,mBAAA,GAAAuG,IAAI;MAACzC,SAAS,EAAE4B,kCAAM,CAACU,IAAK;MAACI,EAAE,EAAC;IAAU,CAAE,CAC5C,CACA,CACH,CAAC;EAET,CAAC,CACC,CAAC;AAET"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/compositions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.162",
|
|
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.162"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"graphql-tag": "2.12.1",
|
|
@@ -35,23 +35,23 @@
|
|
|
35
35
|
"@teambit/compositions.ui.composition-compare": "0.0.255",
|
|
36
36
|
"@teambit/evangelist.elements.icon": "1.0.2",
|
|
37
37
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.502",
|
|
38
|
-
"@teambit/component": "1.0.
|
|
38
|
+
"@teambit/component": "1.0.162",
|
|
39
39
|
"@teambit/compositions.model.composition-id": "0.0.502",
|
|
40
|
-
"@teambit/graphql": "1.0.
|
|
40
|
+
"@teambit/graphql": "1.0.162",
|
|
41
41
|
"@teambit/cli": "0.0.851",
|
|
42
|
-
"@teambit/dev-files": "1.0.
|
|
43
|
-
"@teambit/envs": "1.0.
|
|
44
|
-
"@teambit/preview": "1.0.
|
|
45
|
-
"@teambit/schema": "1.0.
|
|
46
|
-
"@teambit/scope": "1.0.
|
|
42
|
+
"@teambit/dev-files": "1.0.162",
|
|
43
|
+
"@teambit/envs": "1.0.162",
|
|
44
|
+
"@teambit/preview": "1.0.162",
|
|
45
|
+
"@teambit/schema": "1.0.162",
|
|
46
|
+
"@teambit/scope": "1.0.162",
|
|
47
47
|
"@teambit/toolbox.path.match-patterns": "0.0.15",
|
|
48
|
-
"@teambit/workspace": "1.0.
|
|
48
|
+
"@teambit/workspace": "1.0.162",
|
|
49
49
|
"@teambit/docs.ui.queries.get-docs": "0.0.508",
|
|
50
50
|
"@teambit/panels": "0.0.853",
|
|
51
51
|
"@teambit/preview.ui.component-preview": "1.0.5",
|
|
52
52
|
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.217",
|
|
53
|
-
"@teambit/component-compare": "1.0.
|
|
54
|
-
"@teambit/ui": "1.0.
|
|
53
|
+
"@teambit/component-compare": "1.0.162",
|
|
54
|
+
"@teambit/ui": "1.0.162"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/lodash": "4.14.165",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Icon } from '@teambit/evangelist.elements.icon';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
+
import { useSearchParams } from 'react-router-dom';
|
|
3
4
|
import React, { useCallback } from 'react';
|
|
4
5
|
import { MenuWidgetIcon } from '@teambit/ui-foundation.ui.menu-widget-icon';
|
|
5
6
|
import { useNavigate, useLocation } from '@teambit/base-react.navigation.link';
|
|
@@ -54,15 +55,21 @@ export function CompositionsPanel({
|
|
|
54
55
|
);
|
|
55
56
|
|
|
56
57
|
const location = useLocation();
|
|
58
|
+
const [searchParams] = useSearchParams();
|
|
59
|
+
const versionFromQueryParams = searchParams.get('version');
|
|
57
60
|
const navigate = useNavigate();
|
|
58
61
|
|
|
59
62
|
const onCompositionCodeClicked = useCallback(
|
|
60
63
|
(composition: Composition) => (e: React.MouseEvent<HTMLDivElement>) => {
|
|
61
64
|
e.preventDefault();
|
|
65
|
+
const queryParams = new URLSearchParams();
|
|
66
|
+
if (versionFromQueryParams) {
|
|
67
|
+
queryParams.set('version', versionFromQueryParams);
|
|
68
|
+
}
|
|
62
69
|
const basePath = location?.pathname.split('/~compositions')[0];
|
|
63
|
-
navigate(`${basePath}/~code/${composition.filepath}#search=${composition.identifier}`);
|
|
70
|
+
navigate(`${basePath}/~code/${composition.filepath}?${queryParams.toString()}#search=${composition.identifier}`);
|
|
64
71
|
},
|
|
65
|
-
[location?.pathname]
|
|
72
|
+
[location?.pathname, versionFromQueryParams]
|
|
66
73
|
);
|
|
67
74
|
|
|
68
75
|
return (
|