@teambit/mdx 0.0.860 → 0.0.862

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.
Files changed (56) hide show
  1. package/artifacts/__bit_junit.xml +2 -2
  2. package/artifacts/env-template/public/{770.8cc321d531369e25ec1c.js → 700.fcb0085dcdf160cc65c9.js} +18 -20
  3. package/artifacts/env-template/public/assets-manifest.json +16 -16
  4. package/artifacts/env-template/public/{compositions.cdcf1f7754935f37b727.js → compositions.bf42c117f02ed86faae6.js} +1 -1
  5. package/artifacts/env-template/public/compositions.html +1 -1
  6. package/artifacts/env-template/public/{overview.2ce275480ec23e2b5e6b.js → overview.c9a46cc5fa6e34c16fc4.js} +1 -1
  7. package/artifacts/env-template/public/overview.html +1 -1
  8. package/artifacts/env-template/public/{peers.974025d0f97e009cef32.js → peers.ecff7e9e7e9f4d417d65.js} +1 -1
  9. package/artifacts/env-template/public/{preview-root.48c79384da92a8a7a512.js → preview-root.a829360e0cc95e341dfd.js} +1 -1
  10. package/artifacts/env-template/public/static/css/700.bd8655a5.css +1 -0
  11. package/artifacts/env-template/public/static/css/compositions.e163efe5.css +1 -0
  12. package/artifacts/env-template/public/static/css/{overview.367aeb5b.css → overview.18adf1ee.css} +1 -1
  13. package/artifacts/preview/static/css/teambit.mdx/mdx-preview.a9fb1873.css +1 -0
  14. package/artifacts/preview/teambit_mdx_mdx-preview.js +1 -1
  15. package/{compositions-1666312873430.js → compositions-1666496165706.js} +0 -0
  16. package/dist/babel/babel.config.js.map +1 -1
  17. package/dist/index.js +0 -8
  18. package/dist/index.js.map +1 -1
  19. package/dist/mdx.aspect.js +0 -5
  20. package/dist/mdx.aspect.js.map +1 -1
  21. package/dist/mdx.compiler.js +4 -44
  22. package/dist/mdx.compiler.js.map +1 -1
  23. package/dist/mdx.composition.js +0 -6
  24. package/dist/mdx.composition.js.map +1 -1
  25. package/dist/mdx.detector.js +0 -8
  26. package/dist/mdx.detector.js.map +1 -1
  27. package/dist/mdx.detector.spec.js +0 -7
  28. package/dist/mdx.detector.spec.js.map +1 -1
  29. package/dist/mdx.doc-reader.js +0 -14
  30. package/dist/mdx.doc-reader.js.map +1 -1
  31. package/dist/mdx.env.js +2 -3
  32. package/dist/mdx.env.js.map +1 -1
  33. package/dist/mdx.main.runtime.js +3 -64
  34. package/dist/mdx.main.runtime.js.map +1 -1
  35. package/dist/mdx.templates.js +0 -4
  36. package/dist/mdx.templates.js.map +1 -1
  37. package/dist/mdx.ui.runtime.js +4 -31
  38. package/dist/mdx.ui.runtime.js.map +1 -1
  39. package/dist/templates/mdx-component/files/component.js +0 -4
  40. package/dist/templates/mdx-component/files/component.js.map +1 -1
  41. package/dist/templates/mdx-component/files/composition.js +0 -2
  42. package/dist/templates/mdx-component/files/composition.js.map +1 -1
  43. package/dist/templates/mdx-component/files/docs.js +0 -2
  44. package/dist/templates/mdx-component/files/docs.js.map +1 -1
  45. package/dist/templates/mdx-component/files/test.js +0 -2
  46. package/dist/templates/mdx-component/files/test.js.map +1 -1
  47. package/dist/templates/mdx-component/index.js +1 -10
  48. package/dist/templates/mdx-component/index.js.map +1 -1
  49. package/{overview-1666312873430.js → overview-1666496165706.js} +0 -0
  50. package/package-tar/teambit-mdx-0.0.862.tgz +0 -0
  51. package/package.json +16 -16
  52. package/{preview-1666312873430.js → preview-1666496165706.js} +2 -2
  53. package/artifacts/env-template/public/static/css/770.a0238c25.css +0 -1
  54. package/artifacts/env-template/public/static/css/compositions.6d8c7702.css +0 -1
  55. package/artifacts/preview/static/css/teambit.mdx/mdx-preview.ed66eed1.css +0 -1
  56. package/package-tar/teambit-mdx-0.0.860.tgz +0 -0
@@ -1 +1 @@
1
- .circular-font_circularFont__2U4VL{font-family:"CircularXX","Gill Sans","Gill Sans MT","Helvetica Neue",Helvetica,Arial,sans-serif}@font-face{font-family:"CircularXX";src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Regular.woff2)}@font-face{font-family:"CircularXX";font-weight:700;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Bold.woff2)}@font-face{font-family:"CircularXX";font-weight:800;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Black.woff2)}@font-face{font-family:"CircularXX";font-style:italic;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Italic.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:700;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-BoldItalic.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:800;src:url(https://static.bit.dev/circular-xx/CirculrXXWeb-BlackItalic.woff2)}@font-face{font-family:"CircularXX";font-weight:300;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-light.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:300;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-lightItalic.woff2)}@font-face{font-family:"CircularXX";font-weight:500;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Medium.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:500;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-MediumItalic.woff2)}.base-theme_theme__20K5p{background:var(--background-color);color:var(--on-background-color);min-height:100%}.theme-toggler_toggler__10ZbF{background:#fff;background:var(--surface-color,#fff);border-radius:8px;cursor:pointer;padding:.5em;transition:color .18s,background-color .18s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-toggler_toggler__10ZbF:hover{background:#edebfc;background:var(--surface-hover-color,#edebfc)}.theme-toggler_toggler__10ZbF:active{background:#dcd8f9;background:var(--surface-active-color,#dcd8f9)}.docs-app_compositionSection__2rAWY{margin-top:40px}.docs-app_compositionCard__2BFqj{max-height:500px;max-width:100%;overflow:hidden}.docs-app_docsMainBlock__1Vyyg{box-sizing:border-box;margin:0 0 150px;max-width:1440px;padding:20px 40px 10px;width:100%}.docs-app_docsMainBlock__1Vyyg .docs-app_heading__25cfc{margin-bottom:unset}.docs-app_mdx__WbON7{font-size:16px}.heading-sizes_xxs__sqY6F{font-size:16px;font-size:var(--bit-h-xxs,16px)}.heading-sizes_xs__2vIO-{font-size:18px;font-size:var(--bit-h-xs,18px)}.heading-sizes_sm__SWCg7{font-size:24px;font-size:var(--bit-h-sm,24px)}.heading-sizes_md__1VfRy{font-size:26px;font-size:var(--bit-h-md,26px)}.heading-sizes_lg__12r2v{font-size:36px;font-size:var(--bit-h-lg,36px)}.heading-sizes_xl__18vfm{font-size:40px;font-size:var(--bit-h-xl,40px)}.heading-sizes_xxl__1XBq0{font-size:50px;font-size:var(--bit-h-xxl,50px)}.heading_h1__18YHt,.heading_h2__1ja7_,.heading_h3__3SLRc,.heading_h4__uSuLS,.heading_h5__30dq2,.heading_h6__2CGfq{font-weight:700;margin:0}.heading_h1__18YHt{margin-bottom:20px}.anchor_anchor__3Kymc{align-items:center;display:flex;text-decoration:none}.anchor_anchorIcon__osznX{color:var(--bit-text-color-light);font-size:18px}.linked-heading_linkedHeading__1exDt{align-items:center;display:flex;margin-bottom:16px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.linked-heading_linkedHeading__1exDt:hover .linked-heading_anchor__3xkqo{opacity:1;visibility:unset}.linked-heading_heading__28Zmh{margin-bottom:0;margin-right:8px}.linked-heading_anchor__3xkqo{opacity:0;transform:translateY(4px);transition:visibility .3s,opacity .3s ease-in-out;visibility:hidden}.error_error__Aedkj{color:#e62e5c;color:var(--bit-error-color,#e62e5c)}.react-playground_error__1zi13{background-color:var(--bit-bg-color);border:1px solid var(--bit-error-color);border-bottom-right-radius:6px;border-left:none;border-top-right-radius:6px;bottom:0;box-sizing:border-box;color:var(--bit-error-color);font-family:Roboto mono;font-size:11px;left:0;overflow:auto;padding:8px;position:absolute;right:0;top:0;transition:all 1s ease-in-out;width:100%}.react-playground_error__1zi13.react-playground_column__1Kovw{border:1px solid var(--bit-error-color);border-bottom:none;border-bottom-right-radius:0;border-top-left-radius:6px}.react-playground_editorWrapper__1wY8s{max-height:450px;overflow:auto!important}.react-playground_codePane__19Xda{background-color:#282c34;max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;max-width:90%;min-width:150px}.react-playground_codePane__19Xda.react-playground_column__1Kovw,.react-playground_codePane__19Xda.react-playground_column__1Kovw .react-playground_editorWrapper__1wY8s{height:220px;max-width:100%}.react-playground_editor__1LFjB{border-bottom-left-radius:6px;border-top-left-radius:6px;box-sizing:border-box;font-family:Roboto mono!important;font-size:11px;min-height:100px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.react-playground_editor__1LFjB>textarea{outline:none;white-space:pre!important;width:100%!important}.react-playground_editor__1LFjB>pre{white-space:pre!important;width:-webkit-fit-content!important;width:-moz-fit-content!important;width:fit-content!important}.react-playground_splitter__R480r{background-color:#282c34}.react-playground_splitter__R480r>div{border:none;border-radius:0}.react-playground_previewPane__1Rkn-{border:1px solid var(--bit-border-color-lightest);border-bottom-right-radius:6px;border-left:none;border-top-right-radius:6px;min-height:100px;overflow:auto;position:relative}.react-playground_previewPane__1Rkn-.react-playground_column__1Kovw{border:1px solid var(--bit-border-color-lightest);border-bottom:none;border-bottom-right-radius:0;border-top-left-radius:6px;min-height:220px}.react-playground_previewPane__1Rkn-.react-playground_column__1Kovw .react-playground_editorWrapper__1wY8s{max-height:220px}.react-playground_previewBox__1quIl{bottom:0;left:0;position:absolute;right:0;top:0}.react-playground_preview__1LvFd{border-left:none;box-sizing:border-box;height:100%;width:100%}.react-playground_playground__1mVdr{border-radius:6px;display:flex;max-height:450px;overflow:hidden;width:100%}.react-playground_playground__1mVdr>div{width:100%}.examples-overview_exampleSection__1OdhX>:not(:last-child){margin-bottom:8px}
1
+ .circular-font_circularFont__2U4VL{font-family:"CircularXX","Gill Sans","Gill Sans MT","Helvetica Neue",Helvetica,Arial,sans-serif}@font-face{font-family:"CircularXX";src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Regular.woff2)}@font-face{font-family:"CircularXX";font-weight:700;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Bold.woff2)}@font-face{font-family:"CircularXX";font-weight:800;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Black.woff2)}@font-face{font-family:"CircularXX";font-style:italic;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Italic.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:700;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-BoldItalic.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:800;src:url(https://static.bit.dev/circular-xx/CirculrXXWeb-BlackItalic.woff2)}@font-face{font-family:"CircularXX";font-weight:300;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-light.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:300;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-lightItalic.woff2)}@font-face{font-family:"CircularXX";font-weight:500;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-Medium.woff2)}@font-face{font-family:"CircularXX";font-style:italic;font-weight:500;src:url(https://static.bit.dev/circular-xx/CircularXXWeb-MediumItalic.woff2)}.base-theme_theme__20K5p{background:var(--background-color);color:var(--on-background-color);min-height:100%}.theme-toggler_toggler__10ZbF{background:#fff;background:var(--surface-color,#fff);border-radius:8px;cursor:pointer;padding:.5em;transition:color .18s,background-color .18s;-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-toggler_toggler__10ZbF:hover{background:#edebfc;background:var(--surface-hover-color,#edebfc)}.theme-toggler_toggler__10ZbF:active{background:#dcd8f9;background:var(--surface-active-color,#dcd8f9)}.docs-app_compositionSection__2rAWY{margin-top:40px}.docs-app_compositionCard__2BFqj{max-height:500px;max-width:100%;overflow:hidden}.docs-app_docsMainBlock__1Vyyg{box-sizing:border-box;margin:0 0 150px;max-width:1440px;padding:20px 40px 10px;width:100%}.docs-app_docsMainBlock__1Vyyg .docs-app_heading__25cfc{margin-bottom:unset}.docs-app_mdx__WbON7{font-size:16px}.heading-sizes_xxs__sqY6F{font-size:16px;font-size:var(--bit-h-xxs,16px)}.heading-sizes_xs__2vIO-{font-size:18px;font-size:var(--bit-h-xs,18px)}.heading-sizes_sm__SWCg7{font-size:24px;font-size:var(--bit-h-sm,24px)}.heading-sizes_md__1VfRy{font-size:26px;font-size:var(--bit-h-md,26px)}.heading-sizes_lg__12r2v{font-size:36px;font-size:var(--bit-h-lg,36px)}.heading-sizes_xl__18vfm{font-size:40px;font-size:var(--bit-h-xl,40px)}.heading-sizes_xxl__1XBq0{font-size:50px;font-size:var(--bit-h-xxl,50px)}.heading_h1__18YHt,.heading_h2__1ja7_,.heading_h3__3SLRc,.heading_h4__uSuLS,.heading_h5__30dq2,.heading_h6__2CGfq{font-weight:700;margin:0}.heading_h1__18YHt{margin-bottom:20px}.anchor_anchor__3Kymc{align-items:center;display:flex;text-decoration:none}.anchor_anchorIcon__osznX{color:var(--bit-text-color-light);font-size:18px}.linked-heading_linkedHeading__1exDt{align-items:center;display:flex;margin-bottom:16px;width:-moz-fit-content;width:fit-content}.linked-heading_linkedHeading__1exDt:hover .linked-heading_anchor__3xkqo{opacity:1;visibility:unset}.linked-heading_heading__28Zmh{margin-bottom:0;margin-right:8px}.linked-heading_anchor__3xkqo{opacity:0;transform:translateY(4px);transition:visibility .3s,opacity .3s ease-in-out;visibility:hidden}.error_error__Aedkj{color:#e62e5c;color:var(--bit-error-color,#e62e5c)}.react-playground_error__1zi13{background-color:var(--bit-bg-color);border:1px solid var(--bit-error-color);border-bottom-right-radius:6px;border-left:none;border-top-right-radius:6px;bottom:0;box-sizing:border-box;color:var(--bit-error-color);font-family:Roboto mono;font-size:11px;left:0;overflow:auto;padding:8px;position:absolute;right:0;top:0;transition:all 1s ease-in-out;width:100%}.react-playground_error__1zi13.react-playground_column__1Kovw{border:1px solid var(--bit-error-color);border-bottom:none;border-bottom-right-radius:0;border-top-left-radius:6px}.react-playground_editorWrapper__1wY8s{max-height:450px;overflow:auto!important}.react-playground_codePane__19Xda{background-color:#282c34;max-width:-moz-fit-content;max-width:fit-content;max-width:90%;min-width:150px}.react-playground_codePane__19Xda.react-playground_column__1Kovw,.react-playground_codePane__19Xda.react-playground_column__1Kovw .react-playground_editorWrapper__1wY8s{height:220px;max-width:100%}.react-playground_editor__1LFjB{border-bottom-left-radius:6px;border-top-left-radius:6px;box-sizing:border-box;font-family:Roboto mono!important;font-size:11px;min-height:100px;width:-moz-fit-content;width:fit-content}.react-playground_editor__1LFjB>textarea{outline:none;white-space:pre!important;width:100%!important}.react-playground_editor__1LFjB>pre{white-space:pre!important;width:-moz-fit-content!important;width:fit-content!important}.react-playground_splitter__R480r{background-color:#282c34}.react-playground_splitter__R480r>div{border:none;border-radius:0}.react-playground_previewPane__1Rkn-{border:1px solid var(--bit-border-color-lightest);border-bottom-right-radius:6px;border-left:none;border-top-right-radius:6px;min-height:100px;overflow:auto;position:relative}.react-playground_previewPane__1Rkn-.react-playground_column__1Kovw{border:1px solid var(--bit-border-color-lightest);border-bottom:none;border-bottom-right-radius:0;border-top-left-radius:6px;min-height:220px}.react-playground_previewPane__1Rkn-.react-playground_column__1Kovw .react-playground_editorWrapper__1wY8s{max-height:220px}.react-playground_previewBox__1quIl{bottom:0;left:0;position:absolute;right:0;top:0}.react-playground_preview__1LvFd{border-left:none;box-sizing:border-box;height:100%;width:100%}.react-playground_playground__1mVdr{border-radius:6px;display:flex;max-height:450px;overflow:hidden;width:100%}.react-playground_playground__1mVdr>div{width:100%}.examples-overview_exampleSection__1OdhX>:not(:last-child){margin-bottom:8px}
@@ -0,0 +1 @@
1
+ .button_vanillaButton__G9HSU{cursor:pointer;font:inherit;transition:all .18s ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none}.dots-loader_dotsLoader__4vr-t{letter-spacing:.6em;text-indent:.6em}.dots-loader_dotsLoader__4vr-t>*{animation:1.27s ease-in-out infinite both;animation-name:dots-loader_scale-down__3m6Iy;display:inline-block}.dots-loader_dotsLoader__4vr-t>:first-child{animation-delay:-.37s}.dots-loader_dotsLoader__4vr-t>:nth-child(2){animation-delay:-185ms}@keyframes dots-loader_scale-down__3m6Iy{0%,20%,to{transform:scale(0)}60%{transform:scale(1)}}.button_Button__1481h{border-radius:5px;font-family:inherit;font-size:inherit;height:46px;height:var(--primary-button-height,46px);outline:none;text-align:center;transition:all .3s}.button_Button__1481h:disabled{cursor:auto;filter:saturate(.38)}.button_Button__1481h[data-variation=normal]{background-color:#fff;background-color:var(--bit-bg-color,#fff);border:1px solid #fff;border:1px solid var(--bit-bg-color,#fff);color:#6c5ce7;color:var(--bit-accent-color,#6c5ce7)}.button_Button__1481h[data-variation=normal]:hover:not(:disabled){background-color:#fff;background-color:var(--bit-bg-heavy,#fff);border:1px solid #fff;border:1px solid var(--bit-bg-heavy,#fff);color:#5d4aec;color:var(--bit-accent-heavy,#5d4aec)}.button_Button__1481h[data-variation=ghost]{background-color:#fff;background-color:var(--bit-bg-color,#fff);border:1px solid #6c5ce7;border:1px solid var(--bit-accent-color,#6c5ce7);color:#6c5ce7;color:var(--bit-accent-color,#6c5ce7)}.button_Button__1481h[data-variation=ghost]:hover:not(:disabled){background-color:#fff;background-color:var(--bit-bg-heavy,#fff);border:1px solid #5d4aec;border:1px solid var(--bit-accent-heavy,#5d4aec);color:#5d4aec;color:var(--bit-accent-heavy,#5d4aec)}.button_Button__1481h[data-variation=cta]{background-color:#6c5ce7;background-color:var(--bit-accent-color,#6c5ce7);border:1px solid #6c5ce7;border:1px solid var(--bit-accent-color,#6c5ce7);color:#fff;color:var(--bit-text-on-accent,#fff)}.button_Button__1481h[data-variation=cta]:hover:not(:disabled){background-color:#5d4aec;background-color:var(--bit-accent-heavy,#5d4aec);border:1px solid #5d4aec;border:1px solid var(--bit-accent-heavy,#5d4aec)}.elevations_low__2Tgzq{box-shadow:none;box-shadow:var(--bit-shadow-hover-low,initial)}.elevations_low__2Tgzq:active:not(:disabled){box-shadow:none;box-shadow:var(--bit-shadow-resting,initial);transform:translateY(2px)}.elevations_medium__L2g-Q{box-shadow:none;box-shadow:var(--bit-shadow-hover-medium,initial)}.elevations_medium__L2g-Q:active:not(:disabled){box-shadow:none;box-shadow:var(--bit-shadow-resting,initial);transform:translateY(2px)}.elevations_high__2ME70{box-shadow:none;box-shadow:var(--bit-shadow-hover-high,initial)}.elevations_high__2ME70:active:not(:disabled){box-shadow:none;box-shadow:var(--bit-shadow-resting,initial);transform:translateY(11px)}
@@ -129,4 +129,4 @@ then it makes more sense to have that external text integrated into your docs (b
129
129
 
130
130
  <Button style={{ width: 120 }}>Normal</Button>
131
131
  </>
132
- `)))}MDXContent.__bit_component=__bit_component,MDXContent.isMDXComponent=!0},932:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __bit_component={id:"teambit.mdx/mdx@0.0.860",homepage:"https://bit.dev/teambit/mdx/mdx",exported:!0},_interopRequireDefault=__webpack_require__2(244);Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.Logo=void 0;function _react(){const data=_interopRequireDefault(__webpack_require__2(804));return _react=function(){return data},data}_react.__bit_component=__bit_component;const Logo=()=>_react().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},_react().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/brands/logo-mdx.svg"}));Logo.__bit_component=__bit_component,exports2.Logo=Logo},253:(__unused_webpack_module,__webpack_exports__2,__webpack_require__2)=>{"use strict";__webpack_require__2.r(__webpack_exports__2),__webpack_require__2.d(__webpack_exports__2,{default:()=>__WEBPACK_DEFAULT_EXPORT__});const __WEBPACK_DEFAULT_EXPORT__={dotsLoader:"dots-loader_dotsLoader__4vr-t","scale-down":"dots-loader_scale-down__3m6Iy"}},37:(__unused_webpack_module,__webpack_exports__2,__webpack_require__2)=>{"use strict";__webpack_require__2.r(__webpack_exports__2),__webpack_require__2.d(__webpack_exports__2,{default:()=>__WEBPACK_DEFAULT_EXPORT__});const __WEBPACK_DEFAULT_EXPORT__={vanillaButton:"button_vanillaButton__G9HSU"}},945:(__unused_webpack_module,__webpack_exports__2,__webpack_require__2)=>{"use strict";__webpack_require__2.r(__webpack_exports__2),__webpack_require__2.d(__webpack_exports__2,{default:()=>__WEBPACK_DEFAULT_EXPORT__});const __WEBPACK_DEFAULT_EXPORT__={Button:"button_Button__1481h"}},454:(__unused_webpack_module,__webpack_exports__2,__webpack_require__2)=>{"use strict";__webpack_require__2.r(__webpack_exports__2),__webpack_require__2.d(__webpack_exports__2,{default:()=>__WEBPACK_DEFAULT_EXPORT__});const __WEBPACK_DEFAULT_EXPORT__={low:"elevations_low__2Tgzq",medium:"elevations_medium__L2g-Q",high:"elevations_high__2ME70"}},57:module2=>{"use strict";module2.exports=MdxJsReact},804:module2=>{"use strict";module2.exports=React}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==void 0)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module2.exports,module2,module2.exports,__webpack_require__),module2.loaded=!0,module2.exports}__webpack_require__.d=(exports2,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports2,key)&&Object.defineProperty(exports2,key,{enumerable:!0,get:definition[key]})},__webpack_require__.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports2=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports2,"__esModule",{value:!0})},__webpack_require__.nmd=module2=>(module2.paths=[],module2.children||(module2.children=[]),module2);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{compositions:()=>compositions,compositions_metadata:()=>compositions_metadata,overview:()=>overview});var mdx_docs_namespaceObject={};__webpack_require__.r(mdx_docs_namespaceObject),__webpack_require__.d(mdx_docs_namespaceObject,{default:()=>MDXContent});var mdx_composition=__webpack_require__(932),external_React_=__webpack_require__(804),external_MdxJsReact_=__webpack_require__(57);const external_TeambitMdxUiMdxScopeContext_namespaceObject=TeambitMdxUiMdxScopeContext;var dist=__webpack_require__(408),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded),key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&(!Object.prototype.propertyIsEnumerable.call(source,key)||(target[key]=source[key]))}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}var layoutProps={},MDXLayout="wrapper";function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,external_MdxJsReact_.mdx)(MDXLayout,_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,external_MdxJsReact_.mdx)(external_TeambitMdxUiMdxScopeContext_namespaceObject.MDXScopeProvider,{components:{Mdx:dist.i},mdxType:"MDXScopeProvider"},(0,external_MdxJsReact_.mdx)(dist.i,{mdxType:"Mdx"})))}MDXContent.isMDXComponent=!0;const compositions=[mdx_composition],overview=[mdx_docs_namespaceObject],compositions_metadata={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),__webpack_exports__})()});
132
+ `)))}MDXContent.__bit_component=__bit_component,MDXContent.isMDXComponent=!0},597:(__unused_webpack_module,exports2,__webpack_require__2)=>{"use strict";var __bit_component={id:"teambit.mdx/mdx@0.0.862",homepage:"https://bit.dev/teambit/mdx/mdx",exported:!0},_interopRequireDefault=__webpack_require__2(244);Object.defineProperty(exports2,"__esModule",{value:!0}),exports2.Logo=void 0;function _react(){const data=_interopRequireDefault(__webpack_require__2(804));return _react=function(){return data},data}_react.__bit_component=__bit_component;const Logo=()=>_react().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},_react().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/brands/logo-mdx.svg"}));Logo.__bit_component=__bit_component,exports2.Logo=Logo},253:(__unused_webpack_module,__webpack_exports__2,__webpack_require__2)=>{"use strict";__webpack_require__2.r(__webpack_exports__2),__webpack_require__2.d(__webpack_exports__2,{default:()=>__WEBPACK_DEFAULT_EXPORT__});const __WEBPACK_DEFAULT_EXPORT__={dotsLoader:"dots-loader_dotsLoader__4vr-t","scale-down":"dots-loader_scale-down__3m6Iy"}},37:(__unused_webpack_module,__webpack_exports__2,__webpack_require__2)=>{"use strict";__webpack_require__2.r(__webpack_exports__2),__webpack_require__2.d(__webpack_exports__2,{default:()=>__WEBPACK_DEFAULT_EXPORT__});const __WEBPACK_DEFAULT_EXPORT__={vanillaButton:"button_vanillaButton__G9HSU"}},945:(__unused_webpack_module,__webpack_exports__2,__webpack_require__2)=>{"use strict";__webpack_require__2.r(__webpack_exports__2),__webpack_require__2.d(__webpack_exports__2,{default:()=>__WEBPACK_DEFAULT_EXPORT__});const __WEBPACK_DEFAULT_EXPORT__={Button:"button_Button__1481h"}},454:(__unused_webpack_module,__webpack_exports__2,__webpack_require__2)=>{"use strict";__webpack_require__2.r(__webpack_exports__2),__webpack_require__2.d(__webpack_exports__2,{default:()=>__WEBPACK_DEFAULT_EXPORT__});const __WEBPACK_DEFAULT_EXPORT__={low:"elevations_low__2Tgzq",medium:"elevations_medium__L2g-Q",high:"elevations_high__2ME70"}},57:module2=>{"use strict";module2.exports=MdxJsReact},804:module2=>{"use strict";module2.exports=React}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==void 0)return cachedModule.exports;var module2=__webpack_module_cache__[moduleId]={id:moduleId,loaded:!1,exports:{}};return __webpack_modules__[moduleId].call(module2.exports,module2,module2.exports,__webpack_require__),module2.loaded=!0,module2.exports}__webpack_require__.d=(exports2,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports2,key)&&Object.defineProperty(exports2,key,{enumerable:!0,get:definition[key]})},__webpack_require__.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop),__webpack_require__.r=exports2=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports2,"__esModule",{value:!0})},__webpack_require__.nmd=module2=>(module2.paths=[],module2.children||(module2.children=[]),module2);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{compositions:()=>compositions,compositions_metadata:()=>compositions_metadata,overview:()=>overview});var mdx_docs_namespaceObject={};__webpack_require__.r(mdx_docs_namespaceObject),__webpack_require__.d(mdx_docs_namespaceObject,{default:()=>MDXContent});var mdx_composition=__webpack_require__(597),external_React_=__webpack_require__(804),external_MdxJsReact_=__webpack_require__(57);const external_TeambitMdxUiMdxScopeContext_namespaceObject=TeambitMdxUiMdxScopeContext;var dist=__webpack_require__(408),_excluded=["components"];function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded),key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&(!Object.prototype.propertyIsEnumerable.call(source,key)||(target[key]=source[key]))}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={},sourceKeys=Object.keys(source),key,i;for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],!(excluded.indexOf(key)>=0)&&(target[key]=source[key]);return target}var layoutProps={},MDXLayout="wrapper";function MDXContent(_ref){var components=_ref.components,props=_objectWithoutProperties(_ref,_excluded);return(0,external_MdxJsReact_.mdx)(MDXLayout,_extends({},layoutProps,props,{components,mdxType:"MDXLayout"}),(0,external_MdxJsReact_.mdx)(external_TeambitMdxUiMdxScopeContext_namespaceObject.MDXScopeProvider,{components:{Mdx:dist.i},mdxType:"MDXScopeProvider"},(0,external_MdxJsReact_.mdx)(dist.i,{mdxType:"Mdx"})))}MDXContent.isMDXComponent=!0;const compositions=[mdx_composition],overview=[mdx_docs_namespaceObject],compositions_metadata={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),__webpack_exports__})()});
@@ -1 +1 @@
1
- {"version":3,"names":["presets","require","resolve","plugins","babelConfig","sourceMaps"],"sources":["babel.config.ts"],"sourcesContent":["const presets = [\n require.resolve('@babel/preset-env'),\n require.resolve('@babel/preset-react'),\n require.resolve('@babel/preset-typescript'),\n];\nconst plugins = [require.resolve('@babel/plugin-proposal-class-properties')];\n\nexport const babelConfig = {\n presets,\n plugins,\n sourceMaps: true,\n};\n"],"mappings":";;;;;;AAAA,MAAMA,OAAO,GAAG,CACdC,OAAO,CAACC,OAAR,CAAgB,mBAAhB,CADc,EAEdD,OAAO,CAACC,OAAR,CAAgB,qBAAhB,CAFc,EAGdD,OAAO,CAACC,OAAR,CAAgB,0BAAhB,CAHc,CAAhB;AAKA,MAAMC,OAAO,GAAG,CAACF,OAAO,CAACC,OAAR,CAAgB,yCAAhB,CAAD,CAAhB;AAEO,MAAME,WAAW,GAAG;EACzBJ,OADyB;EAEzBG,OAFyB;EAGzBE,UAAU,EAAE;AAHa,CAApB"}
1
+ {"version":3,"names":["presets","require","resolve","plugins","babelConfig","sourceMaps"],"sources":["babel.config.ts"],"sourcesContent":["const presets = [\n require.resolve('@babel/preset-env'),\n require.resolve('@babel/preset-react'),\n require.resolve('@babel/preset-typescript'),\n];\nconst plugins = [require.resolve('@babel/plugin-proposal-class-properties')];\n\nexport const babelConfig = {\n presets,\n plugins,\n sourceMaps: true,\n};\n"],"mappings":";;;;;;AAAA,MAAMA,OAAO,GAAG,CACdC,OAAO,CAACC,OAAO,CAAC,mBAAmB,CAAC,EACpCD,OAAO,CAACC,OAAO,CAAC,qBAAqB,CAAC,EACtCD,OAAO,CAACC,OAAO,CAAC,0BAA0B,CAAC,CAC5C;AACD,MAAMC,OAAO,GAAG,CAACF,OAAO,CAACC,OAAO,CAAC,yCAAyC,CAAC,CAAC;AAErE,MAAME,WAAW,GAAG;EACzBJ,OAAO;EACPG,OAAO;EACPE,UAAU,EAAE;AACd,CAAC;AAAC"}
package/dist/index.js CHANGED
@@ -16,29 +16,21 @@ Object.defineProperty(exports, "MdxEnv", {
16
16
  }
17
17
  });
18
18
  exports.default = void 0;
19
-
20
19
  function _mdx() {
21
20
  const data = require("./mdx.aspect");
22
-
23
21
  _mdx = function () {
24
22
  return data;
25
23
  };
26
-
27
24
  return data;
28
25
  }
29
-
30
26
  function _mdx2() {
31
27
  const data = require("./mdx.env");
32
-
33
28
  _mdx2 = function () {
34
29
  return data;
35
30
  };
36
-
37
31
  return data;
38
32
  }
39
-
40
33
  var _default = _mdx().MDXAspect;
41
-
42
34
  exports.default = _default;
43
35
 
44
36
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["MDXAspect"],"sources":["index.ts"],"sourcesContent":["import { MDXAspect } from './mdx.aspect';\n\nexport default MDXAspect;\nexport type { MDXMain } from './mdx.main.runtime';\nexport type { MDXCompilerOpts } from './mdx.compiler';\nexport { MdxEnv } from './mdx.env';\n\nexport { MDXAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;eAHeA,gB"}
1
+ {"version":3,"names":["MDXAspect"],"sources":["index.ts"],"sourcesContent":["import { MDXAspect } from './mdx.aspect';\n\nexport default MDXAspect;\nexport type { MDXMain } from './mdx.main.runtime';\nexport type { MDXCompilerOpts } from './mdx.compiler';\nexport { MdxEnv } from './mdx.env';\n\nexport { MDXAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAmC,eAHpBA,gBAAS;AAAA"}
@@ -4,21 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.MDXAspect = void 0;
7
-
8
7
  function _harmony() {
9
8
  const data = require("@teambit/harmony");
10
-
11
9
  _harmony = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  const MDXAspect = _harmony().Aspect.create({
19
15
  id: 'teambit.mdx/mdx'
20
16
  });
21
-
22
17
  exports.MDXAspect = MDXAspect;
23
18
 
24
19
  //# sourceMappingURL=mdx.aspect.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MDXAspect","Aspect","create","id"],"sources":["mdx.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const MDXAspect = Aspect.create({\n id: 'teambit.mdx/mdx',\n});\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,SAAS,GAAGC,iBAAA,CAAOC,MAAP,CAAc;EACrCC,EAAE,EAAE;AADiC,CAAd,CAAlB"}
1
+ {"version":3,"names":["MDXAspect","Aspect","create","id"],"sources":["mdx.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const MDXAspect = Aspect.create({\n id: 'teambit.mdx/mdx',\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,SAAS,GAAGC,iBAAM,CAACC,MAAM,CAAC;EACrCC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC"}
@@ -1,78 +1,55 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.promise.js");
6
-
7
5
  require("core-js/modules/es.regexp.exec.js");
8
-
9
6
  require("core-js/modules/es.string.replace.js");
10
-
11
7
  Object.defineProperty(exports, "__esModule", {
12
8
  value: true
13
9
  });
14
10
  exports.MDXCompiler = void 0;
15
-
16
11
  function _defineProperty2() {
17
12
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
-
19
13
  _defineProperty2 = function () {
20
14
  return data;
21
15
  };
22
-
23
16
  return data;
24
17
  }
25
-
26
18
  function _path() {
27
19
  const data = require("path");
28
-
29
20
  _path = function () {
30
21
  return data;
31
22
  };
32
-
33
23
  return data;
34
24
  }
35
-
36
25
  function _fsExtra() {
37
26
  const data = require("fs-extra");
38
-
39
27
  _fsExtra = function () {
40
28
  return data;
41
29
  };
42
-
43
30
  return data;
44
31
  }
45
-
46
32
  function _mdxModules() {
47
33
  const data = require("@teambit/mdx.modules.mdx-compiler");
48
-
49
34
  _mdxModules = function () {
50
35
  return data;
51
36
  };
52
-
53
37
  return data;
54
38
  }
55
-
56
39
  function _minimatch() {
57
40
  const data = _interopRequireDefault(require("minimatch"));
58
-
59
41
  _minimatch = function () {
60
42
  return data;
61
43
  };
62
-
63
44
  return data;
64
45
  }
65
-
66
46
  function _compilationModules() {
67
47
  const data = require("@teambit/compilation.modules.babel-compiler");
68
-
69
48
  _compilationModules = function () {
70
49
  return data;
71
50
  };
72
-
73
51
  return data;
74
52
  }
75
-
76
53
  class MDXCompiler {
77
54
  constructor(id, config) {
78
55
  this.id = id;
@@ -81,15 +58,12 @@ class MDXCompiler {
81
58
  (0, _defineProperty2().default)(this, "shouldCopyNonSupportedFiles", true);
82
59
  (0, _defineProperty2().default)(this, "distDir", 'dist');
83
60
  }
84
-
85
61
  displayConfig() {
86
62
  return JSON.stringify(this.config, null, 2);
87
63
  }
88
-
89
64
  getDistDir() {
90
65
  return this.distDir;
91
66
  }
92
-
93
67
  transpileFile(fileContent, options) {
94
68
  const afterMdxCompile = (0, _mdxModules().compileSync)(fileContent, {
95
69
  filepath: options.filePath,
@@ -103,12 +77,11 @@ class MDXCompiler {
103
77
  }, this.config.babelTransformOptions || {});
104
78
  return afterBabelCompile;
105
79
  }
80
+
106
81
  /**
107
82
  * compile components inside isolated capsules. this being used during tag for the release.
108
83
  * meaning, the final package of the component has the dists generated by this method.
109
84
  */
110
-
111
-
112
85
  async build(context) {
113
86
  const capsules = context.capsuleNetwork.seedersCapsules;
114
87
  const componentsResults = capsules.map(capsule => {
@@ -121,17 +94,13 @@ class MDXCompiler {
121
94
  filePath: this.replaceFileExtToJs(srcFile.relative),
122
95
  componentDir: capsule.path
123
96
  });
124
-
125
97
  if (!transpiled) {
126
98
  return undefined;
127
99
  }
128
-
129
100
  (0, _fsExtra().outputFileSync)((0, _path().join)(capsule.path, this.getDistPathBySrcPath(transpiled[0].outputPath)), transpiled[0].outputText);
130
-
131
101
  if (transpiled.length > 1) {
132
102
  (0, _fsExtra().outputFileSync)((0, _path().join)(capsule.path, this.distDir, transpiled[1].outputPath), transpiled[1].outputText);
133
103
  }
134
-
135
104
  return undefined;
136
105
  } catch (err) {
137
106
  return err;
@@ -150,51 +119,42 @@ class MDXCompiler {
150
119
  }]
151
120
  };
152
121
  }
122
+
153
123
  /**
154
124
  * given a source file, return its parallel in the dists. e.g. "index.ts" => "dist/index.js"
155
125
  * both, the return path and the given path are relative paths.
156
126
  */
157
-
158
-
159
127
  getDistPathBySrcPath(srcPath) {
160
128
  const fileWithNewExt = this.replaceFileExtToJs(srcPath);
161
129
  return (0, _path().join)(this.distDir, fileWithNewExt);
162
130
  }
163
-
164
131
  replaceFileExtToJs(srcPath) {
165
132
  let fileWithNewExt = srcPath;
166
-
167
133
  if (this.isFileSupported(srcPath)) {
168
134
  fileWithNewExt = srcPath.replace('.mdx', '.mdx.js');
169
135
  }
170
-
171
136
  return fileWithNewExt;
172
137
  }
138
+
173
139
  /**
174
140
  * only supported files matching get compiled. others, are copied to the dist dir.
175
141
  */
176
-
177
-
178
142
  isFileSupported(filePath) {
179
143
  var _this$config$ignoredE, _this$config$ignoredP;
180
-
181
144
  const ignoredExtensions = (_this$config$ignoredE = this.config.ignoredExtensions) !== null && _this$config$ignoredE !== void 0 ? _this$config$ignoredE : [];
182
145
  const ignoredExt = ignoredExtensions.find(ext => filePath.endsWith(ext));
183
146
  const ignoredPatterns = (_this$config$ignoredP = this.config.ignoredPatterns) !== null && _this$config$ignoredP !== void 0 ? _this$config$ignoredP : [];
184
147
  const ignoredPattern = ignoredPatterns.find(pattern => (0, _minimatch().default)(filePath, pattern));
185
148
  return !ignoredExt && !ignoredPattern && (filePath.endsWith('.mdx') || filePath.endsWith('.md'));
186
149
  }
150
+
187
151
  /**
188
152
  * returns the version of the current compiler instance (e.g. '4.0.1').
189
153
  */
190
-
191
-
192
154
  version() {
193
155
  return '';
194
156
  }
195
-
196
157
  }
197
-
198
158
  exports.MDXCompiler = MDXCompiler;
199
159
 
200
160
  //# sourceMappingURL=mdx.compiler.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MDXCompiler","constructor","id","config","displayConfig","JSON","stringify","getDistDir","distDir","transpileFile","fileContent","options","afterMdxCompile","mdxCompileSync","filepath","filePath","bitFlavour","filePathAfterMdxCompile","replaceFileExtToJs","afterBabelCompile","babelTranspileFileContent","contents","rootDir","componentDir","babelTransformOptions","build","context","capsules","capsuleNetwork","seedersCapsules","componentsResults","map","capsule","srcFiles","component","filesystem","files","filter","file","isFileSupported","relative","errors","srcFile","transpiled","toString","path","undefined","outputFileSync","join","getDistPathBySrcPath","outputPath","outputText","length","err","artifacts","name","globPatterns","srcPath","fileWithNewExt","replace","ignoredExtensions","ignoredExt","find","ext","endsWith","ignoredPatterns","ignoredPattern","pattern","minimatch","version"],"sources":["mdx.compiler.ts"],"sourcesContent":["import { join } from 'path';\nimport { outputFileSync } from 'fs-extra';\nimport { Compiler, TranspileFileOutput, TranspileFileParams } from '@teambit/compiler';\nimport { BuiltTaskResult, BuildContext } from '@teambit/builder';\nimport { compileSync as mdxCompileSync } from '@teambit/mdx.modules.mdx-compiler';\nimport minimatch from 'minimatch';\nimport { transpileFileContent as babelTranspileFileContent } from '@teambit/compilation.modules.babel-compiler';\nimport type { TransformOptions } from '@babel/core';\n\nexport type MDXCompilerOpts = {\n ignoredExtensions?: string[];\n ignoredPatterns?: string[];\n babelTransformOptions?: TransformOptions;\n};\nexport class MDXCompiler implements Compiler {\n displayName = 'MDX';\n\n shouldCopyNonSupportedFiles = true;\n\n distDir = 'dist';\n\n constructor(readonly id: string, readonly config: MDXCompilerOpts) {}\n\n displayConfig() {\n return JSON.stringify(this.config, null, 2);\n }\n\n getDistDir() {\n return this.distDir;\n }\n\n transpileFile(fileContent: string, options: TranspileFileParams): TranspileFileOutput {\n const afterMdxCompile = mdxCompileSync(fileContent, {\n filepath: options.filePath,\n // this compiler is not indented to compile according to the bit flavour.\n bitFlavour: false,\n });\n const filePathAfterMdxCompile = this.replaceFileExtToJs(options.filePath);\n const afterBabelCompile = babelTranspileFileContent(\n afterMdxCompile.contents,\n {\n rootDir: options.componentDir,\n filePath: filePathAfterMdxCompile,\n },\n this.config.babelTransformOptions || {}\n );\n\n return afterBabelCompile;\n }\n\n /**\n * compile components inside isolated capsules. this being used during tag for the release.\n * meaning, the final package of the component has the dists generated by this method.\n */\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const capsules = context.capsuleNetwork.seedersCapsules;\n const componentsResults = capsules.map((capsule) => {\n const srcFiles = capsule.component.filesystem.files.filter((file) => {\n return this.isFileSupported(file.relative);\n });\n\n const errors = srcFiles.map((srcFile) => {\n try {\n const transpiled = this.transpileFile(srcFile.contents.toString('utf-8'), {\n filePath: this.replaceFileExtToJs(srcFile.relative),\n componentDir: capsule.path,\n });\n\n if (!transpiled) {\n return undefined;\n }\n\n outputFileSync(\n join(capsule.path, this.getDistPathBySrcPath(transpiled[0].outputPath)),\n transpiled[0].outputText\n );\n if (transpiled.length > 1) {\n outputFileSync(join(capsule.path, this.distDir, transpiled[1].outputPath), transpiled[1].outputText);\n }\n return undefined;\n } catch (err: any) {\n return err;\n }\n });\n\n return {\n errors: errors.filter((err) => !!err),\n component: capsule.component,\n };\n });\n\n return {\n componentsResults,\n artifacts: [\n {\n name: 'dist',\n globPatterns: [`${this.distDir}/**`],\n },\n ],\n };\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. \"index.ts\" => \"dist/index.js\"\n * both, the return path and the given path are relative paths.\n */\n getDistPathBySrcPath(srcPath: string): string {\n const fileWithNewExt = this.replaceFileExtToJs(srcPath);\n return join(this.distDir, fileWithNewExt);\n }\n\n private replaceFileExtToJs(srcPath: string): string {\n let fileWithNewExt = srcPath;\n if (this.isFileSupported(srcPath)) {\n fileWithNewExt = srcPath.replace('.mdx', '.mdx.js');\n }\n return fileWithNewExt;\n }\n\n /**\n * only supported files matching get compiled. others, are copied to the dist dir.\n */\n isFileSupported(filePath: string): boolean {\n const ignoredExtensions = this.config.ignoredExtensions ?? [];\n const ignoredExt = ignoredExtensions.find((ext) => filePath.endsWith(ext));\n const ignoredPatterns = this.config.ignoredPatterns ?? [];\n const ignoredPattern = ignoredPatterns.find((pattern) => minimatch(filePath, pattern));\n return !ignoredExt && !ignoredPattern && (filePath.endsWith('.mdx') || filePath.endsWith('.md'));\n }\n\n /**\n * returns the version of the current compiler instance (e.g. '4.0.1').\n */\n version(): string {\n return '';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;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1
+ {"version":3,"names":["MDXCompiler","constructor","id","config","displayConfig","JSON","stringify","getDistDir","distDir","transpileFile","fileContent","options","afterMdxCompile","mdxCompileSync","filepath","filePath","bitFlavour","filePathAfterMdxCompile","replaceFileExtToJs","afterBabelCompile","babelTranspileFileContent","contents","rootDir","componentDir","babelTransformOptions","build","context","capsules","capsuleNetwork","seedersCapsules","componentsResults","map","capsule","srcFiles","component","filesystem","files","filter","file","isFileSupported","relative","errors","srcFile","transpiled","toString","path","undefined","outputFileSync","join","getDistPathBySrcPath","outputPath","outputText","length","err","artifacts","name","globPatterns","srcPath","fileWithNewExt","replace","ignoredExtensions","ignoredExt","find","ext","endsWith","ignoredPatterns","ignoredPattern","pattern","minimatch","version"],"sources":["mdx.compiler.ts"],"sourcesContent":["import { join } from 'path';\nimport { outputFileSync } from 'fs-extra';\nimport { Compiler, TranspileFileOutput, TranspileFileParams } from '@teambit/compiler';\nimport { BuiltTaskResult, BuildContext } from '@teambit/builder';\nimport { compileSync as mdxCompileSync } from '@teambit/mdx.modules.mdx-compiler';\nimport minimatch from 'minimatch';\nimport { transpileFileContent as babelTranspileFileContent } from '@teambit/compilation.modules.babel-compiler';\nimport type { TransformOptions } from '@babel/core';\n\nexport type MDXCompilerOpts = {\n ignoredExtensions?: string[];\n ignoredPatterns?: string[];\n babelTransformOptions?: TransformOptions;\n};\nexport class MDXCompiler implements Compiler {\n displayName = 'MDX';\n\n shouldCopyNonSupportedFiles = true;\n\n distDir = 'dist';\n\n constructor(readonly id: string, readonly config: MDXCompilerOpts) {}\n\n displayConfig() {\n return JSON.stringify(this.config, null, 2);\n }\n\n getDistDir() {\n return this.distDir;\n }\n\n transpileFile(fileContent: string, options: TranspileFileParams): TranspileFileOutput {\n const afterMdxCompile = mdxCompileSync(fileContent, {\n filepath: options.filePath,\n // this compiler is not indented to compile according to the bit flavour.\n bitFlavour: false,\n });\n const filePathAfterMdxCompile = this.replaceFileExtToJs(options.filePath);\n const afterBabelCompile = babelTranspileFileContent(\n afterMdxCompile.contents,\n {\n rootDir: options.componentDir,\n filePath: filePathAfterMdxCompile,\n },\n this.config.babelTransformOptions || {}\n );\n\n return afterBabelCompile;\n }\n\n /**\n * compile components inside isolated capsules. this being used during tag for the release.\n * meaning, the final package of the component has the dists generated by this method.\n */\n async build(context: BuildContext): Promise<BuiltTaskResult> {\n const capsules = context.capsuleNetwork.seedersCapsules;\n const componentsResults = capsules.map((capsule) => {\n const srcFiles = capsule.component.filesystem.files.filter((file) => {\n return this.isFileSupported(file.relative);\n });\n\n const errors = srcFiles.map((srcFile) => {\n try {\n const transpiled = this.transpileFile(srcFile.contents.toString('utf-8'), {\n filePath: this.replaceFileExtToJs(srcFile.relative),\n componentDir: capsule.path,\n });\n\n if (!transpiled) {\n return undefined;\n }\n\n outputFileSync(\n join(capsule.path, this.getDistPathBySrcPath(transpiled[0].outputPath)),\n transpiled[0].outputText\n );\n if (transpiled.length > 1) {\n outputFileSync(join(capsule.path, this.distDir, transpiled[1].outputPath), transpiled[1].outputText);\n }\n return undefined;\n } catch (err: any) {\n return err;\n }\n });\n\n return {\n errors: errors.filter((err) => !!err),\n component: capsule.component,\n };\n });\n\n return {\n componentsResults,\n artifacts: [\n {\n name: 'dist',\n globPatterns: [`${this.distDir}/**`],\n },\n ],\n };\n }\n\n /**\n * given a source file, return its parallel in the dists. e.g. \"index.ts\" => \"dist/index.js\"\n * both, the return path and the given path are relative paths.\n */\n getDistPathBySrcPath(srcPath: string): string {\n const fileWithNewExt = this.replaceFileExtToJs(srcPath);\n return join(this.distDir, fileWithNewExt);\n }\n\n private replaceFileExtToJs(srcPath: string): string {\n let fileWithNewExt = srcPath;\n if (this.isFileSupported(srcPath)) {\n fileWithNewExt = srcPath.replace('.mdx', '.mdx.js');\n }\n return fileWithNewExt;\n }\n\n /**\n * only supported files matching get compiled. others, are copied to the dist dir.\n */\n isFileSupported(filePath: string): boolean {\n const ignoredExtensions = this.config.ignoredExtensions ?? [];\n const ignoredExt = ignoredExtensions.find((ext) => filePath.endsWith(ext));\n const ignoredPatterns = this.config.ignoredPatterns ?? [];\n const ignoredPattern = ignoredPatterns.find((pattern) => minimatch(filePath, pattern));\n return !ignoredExt && !ignoredPattern && (filePath.endsWith('.mdx') || filePath.endsWith('.md'));\n }\n\n /**\n * returns the version of the current compiler instance (e.g. '4.0.1').\n */\n version(): string {\n return '';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAQO,MAAMA,WAAW,CAAqB;EAO3CC,WAAW,CAAUC,EAAU,EAAWC,MAAuB,EAAE;IAAA,KAA9CD,EAAU,GAAVA,EAAU;IAAA,KAAWC,MAAuB,GAAvBA,MAAuB;IAAA,qDANnD,KAAK;IAAA,qEAEW,IAAI;IAAA,iDAExB,MAAM;EAEoD;EAEpEC,aAAa,GAAG;IACd,OAAOC,IAAI,CAACC,SAAS,CAAC,IAAI,CAACH,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;EAC7C;EAEAI,UAAU,GAAG;IACX,OAAO,IAAI,CAACC,OAAO;EACrB;EAEAC,aAAa,CAACC,WAAmB,EAAEC,OAA4B,EAAuB;IACpF,MAAMC,eAAe,GAAG,IAAAC,yBAAc,EAACH,WAAW,EAAE;MAClDI,QAAQ,EAAEH,OAAO,CAACI,QAAQ;MAC1B;MACAC,UAAU,EAAE;IACd,CAAC,CAAC;IACF,MAAMC,uBAAuB,GAAG,IAAI,CAACC,kBAAkB,CAACP,OAAO,CAACI,QAAQ,CAAC;IACzE,MAAMI,iBAAiB,GAAG,IAAAC,0CAAyB,EACjDR,eAAe,CAACS,QAAQ,EACxB;MACEC,OAAO,EAAEX,OAAO,CAACY,YAAY;MAC7BR,QAA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D,MAAMC,cAAc,GAAGD,eAAe,CAACH,IAAI,CAAEK,OAAO,IAAK,IAAAC,oBAAS,EAACrD,QAAQ,EAAEoD,OAAO,CAAC,CAAC;IACtF,OAAO,CAACN,UAAU,IAAI,CAACK,cAAc,KAAKnD,QAAQ,CAACiD,QAAQ,CAAC,MAAM,CAAC,IAAIjD,QAAQ,CAACiD,QAAQ,CAAC,KAAK,CAAC,CAAC;EAClG;;EAEA;AACF;AACA;EACEK,OAAO,GAAW;IAChB,OAAO,EAAE;EACX;AACF;AAAC"}
@@ -1,22 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.Logo = void 0;
9
-
10
8
  function _react() {
11
9
  const data = _interopRequireDefault(require("react"));
12
-
13
10
  _react = function () {
14
11
  return data;
15
12
  };
16
-
17
13
  return data;
18
14
  }
19
-
20
15
  const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
21
16
  style: {
22
17
  height: '100%',
@@ -29,7 +24,6 @@ const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
29
24
  },
30
25
  src: "https://static.bit.dev/brands/logo-mdx.svg"
31
26
  }));
32
-
33
27
  exports.Logo = Logo;
34
28
 
35
29
  //# sourceMappingURL=mdx.composition.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["mdx.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/brands/logo-mdx.svg\" />\n </div>\n);\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAV;IAAkBC,OAAO,EAAE,MAA3B;IAAmCC,cAAc,EAAE;EAAnD;AAAZ,gBACE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAT,CAAZ;EAA2B,GAAG,EAAC;AAA/B,EADF,CADK"}
1
+ {"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["mdx.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/brands/logo-mdx.svg\" />\n </div>\n);\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAG,CAAE;EAAC,GAAG,EAAC;AAA4C,EAAG,CAEjF;AAAC"}
@@ -4,26 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.MDXDependencyDetector = void 0;
7
-
8
7
  function _mdxModules() {
9
8
  const data = require("@teambit/mdx.modules.mdx-compiler");
10
-
11
9
  _mdxModules = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  class MDXDependencyDetector {
19
15
  constructor(supportedExtensions) {
20
16
  this.supportedExtensions = supportedExtensions;
21
17
  }
22
-
23
18
  isSupported(context) {
24
19
  return this.supportedExtensions.includes(context.ext);
25
20
  }
26
-
27
21
  detect(source) {
28
22
  const output = (0, _mdxModules().compileSync)(source);
29
23
  const imports = output.getImportSpecifiers();
@@ -33,9 +27,7 @@ class MDXDependencyDetector {
33
27
  });
34
28
  return files;
35
29
  }
36
-
37
30
  }
38
-
39
31
  exports.MDXDependencyDetector = MDXDependencyDetector;
40
32
 
41
33
  //# sourceMappingURL=mdx.detector.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MDXDependencyDetector","constructor","supportedExtensions","isSupported","context","includes","ext","detect","source","output","compileSync","imports","getImportSpecifiers","files","map","importSpec","fromModule"],"sources":["mdx.detector.ts"],"sourcesContent":["import { DependencyDetector, FileContext } from '@teambit/dependency-resolver';\nimport { compileSync } from '@teambit/mdx.modules.mdx-compiler';\n\nexport class MDXDependencyDetector implements DependencyDetector {\n constructor(private supportedExtensions: string[]) {}\n\n isSupported(context: FileContext): boolean {\n return this.supportedExtensions.includes(context.ext);\n }\n\n detect(source: string): string[] {\n const output = compileSync(source);\n const imports = output.getImportSpecifiers();\n if (!imports) return [];\n const files: string[] = imports.map((importSpec) => {\n return importSpec.fromModule;\n });\n\n return files;\n }\n}\n"],"mappings":";;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,qBAAN,CAA0D;EAC/DC,WAAW,CAASC,mBAAT,EAAwC;IAAA,KAA/BA,mBAA+B,GAA/BA,mBAA+B;EAAE;;EAErDC,WAAW,CAACC,OAAD,EAAgC;IACzC,OAAO,KAAKF,mBAAL,CAAyBG,QAAzB,CAAkCD,OAAO,CAACE,GAA1C,CAAP;EACD;;EAEDC,MAAM,CAACC,MAAD,EAA2B;IAC/B,MAAMC,MAAM,GAAG,IAAAC,yBAAA,EAAYF,MAAZ,CAAf;IACA,MAAMG,OAAO,GAAGF,MAAM,CAACG,mBAAP,EAAhB;IACA,IAAI,CAACD,OAAL,EAAc,OAAO,EAAP;IACd,MAAME,KAAe,GAAGF,OAAO,CAACG,GAAR,CAAaC,UAAD,IAAgB;MAClD,OAAOA,UAAU,CAACC,UAAlB;IACD,CAFuB,CAAxB;IAIA,OAAOH,KAAP;EACD;;AAhB8D"}
1
+ {"version":3,"names":["MDXDependencyDetector","constructor","supportedExtensions","isSupported","context","includes","ext","detect","source","output","compileSync","imports","getImportSpecifiers","files","map","importSpec","fromModule"],"sources":["mdx.detector.ts"],"sourcesContent":["import { DependencyDetector, FileContext } from '@teambit/dependency-resolver';\nimport { compileSync } from '@teambit/mdx.modules.mdx-compiler';\n\nexport class MDXDependencyDetector implements DependencyDetector {\n constructor(private supportedExtensions: string[]) {}\n\n isSupported(context: FileContext): boolean {\n return this.supportedExtensions.includes(context.ext);\n }\n\n detect(source: string): string[] {\n const output = compileSync(source);\n const imports = output.getImportSpecifiers();\n if (!imports) return [];\n const files: string[] = imports.map((importSpec) => {\n return importSpec.fromModule;\n });\n\n return files;\n }\n}\n"],"mappings":";;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,qBAAqB,CAA+B;EAC/DC,WAAW,CAASC,mBAA6B,EAAE;IAAA,KAA/BA,mBAA6B,GAA7BA,mBAA6B;EAAG;EAEpDC,WAAW,CAACC,OAAoB,EAAW;IACzC,OAAO,IAAI,CAACF,mBAAmB,CAACG,QAAQ,CAACD,OAAO,CAACE,GAAG,CAAC;EACvD;EAEAC,MAAM,CAACC,MAAc,EAAY;IAC/B,MAAMC,MAAM,GAAG,IAAAC,yBAAW,EAACF,MAAM,CAAC;IAClC,MAAMG,OAAO,GAAGF,MAAM,CAACG,mBAAmB,EAAE;IAC5C,IAAI,CAACD,OAAO,EAAE,OAAO,EAAE;IACvB,MAAME,KAAe,GAAGF,OAAO,CAACG,GAAG,CAAEC,UAAU,IAAK;MAClD,OAAOA,UAAU,CAACC,UAAU;IAC9B,CAAC,CAAC;IAEF,OAAOH,KAAK;EACd;AACF;AAAC"}
@@ -2,29 +2,22 @@
2
2
 
3
3
  function _chai() {
4
4
  const data = require("chai");
5
-
6
5
  _chai = function () {
7
6
  return data;
8
7
  };
9
-
10
8
  return data;
11
9
  }
12
-
13
10
  function _mdx() {
14
11
  const data = require("./mdx.detector");
15
-
16
12
  _mdx = function () {
17
13
  return data;
18
14
  };
19
-
20
15
  return data;
21
16
  }
22
-
23
17
  describe('MDXDependencyDetector', () => {
24
18
  function expectDependencies(src, expectedDeps) {
25
19
  (0, _chai().expect)(new (_mdx().MDXDependencyDetector)(['mdx']).detect(src)).to.deep.equal(expectedDeps);
26
20
  }
27
-
28
21
  describe('detect', () => {
29
22
  it('should correctly detect default import', () => {
30
23
  const src = 'import x from "y";';
@@ -1 +1 @@
1
- {"version":3,"names":["describe","expectDependencies","src","expectedDeps","expect","MDXDependencyDetector","detect","to","deep","equal","it"],"sources":["mdx.detector.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { MDXDependencyDetector } from './mdx.detector';\n\ndescribe('MDXDependencyDetector', () => {\n function expectDependencies(src: string, expectedDeps: string[]) {\n expect(new MDXDependencyDetector(['mdx']).detect(src)).to.deep.equal(expectedDeps);\n }\n describe('detect', () => {\n it('should correctly detect default import', () => {\n const src = 'import x from \"y\";';\n expectDependencies(src, ['y']);\n });\n it('should correctly detect star import', () => {\n const src = 'import * as y from \"y\";';\n expectDependencies(src, ['y']);\n });\n it('should correctly detect named import', () => {\n const src = 'import { x } from \"y\";';\n expectDependencies(src, ['y']);\n });\n it('should correctly detect import with no identifier', () => {\n const src = 'import \"y\";';\n expectDependencies(src, ['y']);\n });\n });\n});\n"],"mappings":";;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEAA,QAAQ,CAAC,uBAAD,EAA0B,MAAM;EACtC,SAASC,kBAAT,CAA4BC,GAA5B,EAAyCC,YAAzC,EAAiE;IAC/D,IAAAC,cAAA,EAAO,KAAIC,4BAAJ,EAA0B,CAAC,KAAD,CAA1B,EAAmCC,MAAnC,CAA0CJ,GAA1C,CAAP,EAAuDK,EAAvD,CAA0DC,IAA1D,CAA+DC,KAA/D,CAAqEN,YAArE;EACD;;EACDH,QAAQ,CAAC,QAAD,EAAW,MAAM;IACvBU,EAAE,CAAC,wCAAD,EAA2C,MAAM;MACjD,MAAMR,GAAG,GAAG,oBAAZ;MACAD,kBAAkB,CAACC,GAAD,EAAM,CAAC,GAAD,CAAN,CAAlB;IACD,CAHC,CAAF;IAIAQ,EAAE,CAAC,qCAAD,EAAwC,MAAM;MAC9C,MAAMR,GAAG,GAAG,yBAAZ;MACAD,kBAAkB,CAACC,GAAD,EAAM,CAAC,GAAD,CAAN,CAAlB;IACD,CAHC,CAAF;IAIAQ,EAAE,CAAC,sCAAD,EAAyC,MAAM;MAC/C,MAAMR,GAAG,GAAG,wBAAZ;MACAD,kBAAkB,CAACC,GAAD,EAAM,CAAC,GAAD,CAAN,CAAlB;IACD,CAHC,CAAF;IAIAQ,EAAE,CAAC,mDAAD,EAAsD,MAAM;MAC5D,MAAMR,GAAG,GAAG,aAAZ;MACAD,kBAAkB,CAACC,GAAD,EAAM,CAAC,GAAD,CAAN,CAAlB;IACD,CAHC,CAAF;EAID,CAjBO,CAAR;AAkBD,CAtBO,CAAR"}
1
+ {"version":3,"names":["describe","expectDependencies","src","expectedDeps","expect","MDXDependencyDetector","detect","to","deep","equal","it"],"sources":["mdx.detector.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { MDXDependencyDetector } from './mdx.detector';\n\ndescribe('MDXDependencyDetector', () => {\n function expectDependencies(src: string, expectedDeps: string[]) {\n expect(new MDXDependencyDetector(['mdx']).detect(src)).to.deep.equal(expectedDeps);\n }\n describe('detect', () => {\n it('should correctly detect default import', () => {\n const src = 'import x from \"y\";';\n expectDependencies(src, ['y']);\n });\n it('should correctly detect star import', () => {\n const src = 'import * as y from \"y\";';\n expectDependencies(src, ['y']);\n });\n it('should correctly detect named import', () => {\n const src = 'import { x } from \"y\";';\n expectDependencies(src, ['y']);\n });\n it('should correctly detect import with no identifier', () => {\n const src = 'import \"y\";';\n expectDependencies(src, ['y']);\n });\n });\n});\n"],"mappings":";;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEAA,QAAQ,CAAC,uBAAuB,EAAE,MAAM;EACtC,SAASC,kBAAkB,CAACC,GAAW,EAAEC,YAAsB,EAAE;IAC/D,IAAAC,cAAM,EAAC,KAAIC,4BAAqB,EAAC,CAAC,KAAK,CAAC,CAAC,CAACC,MAAM,CAACJ,GAAG,CAAC,CAAC,CAACK,EAAE,CAACC,IAAI,CAACC,KAAK,CAACN,YAAY,CAAC;EACpF;EACAH,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACvBU,EAAE,CAAC,wCAAwC,EAAE,MAAM;MACjD,MAAMR,GAAG,GAAG,oBAAoB;MAChCD,kBAAkB,CAACC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC,CAAC;IACFQ,EAAE,CAAC,qCAAqC,EAAE,MAAM;MAC9C,MAAMR,GAAG,GAAG,yBAAyB;MACrCD,kBAAkB,CAACC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC,CAAC;IACFQ,EAAE,CAAC,sCAAsC,EAAE,MAAM;MAC/C,MAAMR,GAAG,GAAG,wBAAwB;MACpCD,kBAAkB,CAACC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC,CAAC;IACFQ,EAAE,CAAC,mDAAmD,EAAE,MAAM;MAC5D,MAAMR,GAAG,GAAG,aAAa;MACzBD,kBAAkB,CAACC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -1,54 +1,40 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.promise.js");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.MDXDocReader = void 0;
9
-
10
8
  function _docs() {
11
9
  const data = require("@teambit/docs");
12
-
13
10
  _docs = function () {
14
11
  return data;
15
12
  };
16
-
17
13
  return data;
18
14
  }
19
-
20
15
  function _mdxModules() {
21
16
  const data = require("@teambit/mdx.modules.mdx-compiler");
22
-
23
17
  _mdxModules = function () {
24
18
  return data;
25
19
  };
26
-
27
20
  return data;
28
21
  }
29
-
30
22
  class MDXDocReader {
31
23
  constructor(extensions) {
32
24
  this.extensions = extensions;
33
25
  }
34
-
35
26
  async read(path, contents) {
36
27
  const output = await (0, _mdxModules().compile)(contents.toString('utf-8'), {
37
28
  filepath: path
38
29
  });
39
30
  const metadata = output.getMetadata();
40
-
41
31
  const doc = _docs().Doc.from(path, metadata);
42
-
43
32
  return doc;
44
33
  }
45
-
46
34
  isFormatSupported(format) {
47
35
  return this.extensions.includes(format);
48
36
  }
49
-
50
37
  }
51
-
52
38
  exports.MDXDocReader = MDXDocReader;
53
39
 
54
40
  //# sourceMappingURL=mdx.doc-reader.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MDXDocReader","constructor","extensions","read","path","contents","output","compile","toString","filepath","metadata","getMetadata","doc","Doc","from","isFormatSupported","format","includes"],"sources":["mdx.doc-reader.ts"],"sourcesContent":["import { DocReader, Doc } from '@teambit/docs';\nimport { compile } from '@teambit/mdx.modules.mdx-compiler';\n\nexport class MDXDocReader implements DocReader {\n constructor(private extensions: string[]) {}\n\n async read(path: string, contents: Buffer) {\n const output = await compile(contents.toString('utf-8'), { filepath: path });\n const metadata = output.getMetadata();\n\n const doc = Doc.from(path, metadata);\n return doc;\n }\n\n isFormatSupported(format: string) {\n return this.extensions.includes(format);\n }\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,YAAN,CAAwC;EAC7CC,WAAW,CAASC,UAAT,EAA+B;IAAA,KAAtBA,UAAsB,GAAtBA,UAAsB;EAAE;;EAElC,MAAJC,IAAI,CAACC,IAAD,EAAeC,QAAf,EAAiC;IACzC,MAAMC,MAAM,GAAG,MAAM,IAAAC,qBAAA,EAAQF,QAAQ,CAACG,QAAT,CAAkB,OAAlB,CAAR,EAAoC;MAAEC,QAAQ,EAAEL;IAAZ,CAApC,CAArB;IACA,MAAMM,QAAQ,GAAGJ,MAAM,CAACK,WAAP,EAAjB;;IAEA,MAAMC,GAAG,GAAGC,WAAA,CAAIC,IAAJ,CAASV,IAAT,EAAeM,QAAf,CAAZ;;IACA,OAAOE,GAAP;EACD;;EAEDG,iBAAiB,CAACC,MAAD,EAAiB;IAChC,OAAO,KAAKd,UAAL,CAAgBe,QAAhB,CAAyBD,MAAzB,CAAP;EACD;;AAb4C"}
1
+ {"version":3,"names":["MDXDocReader","constructor","extensions","read","path","contents","output","compile","toString","filepath","metadata","getMetadata","doc","Doc","from","isFormatSupported","format","includes"],"sources":["mdx.doc-reader.ts"],"sourcesContent":["import { DocReader, Doc } from '@teambit/docs';\nimport { compile } from '@teambit/mdx.modules.mdx-compiler';\n\nexport class MDXDocReader implements DocReader {\n constructor(private extensions: string[]) {}\n\n async read(path: string, contents: Buffer) {\n const output = await compile(contents.toString('utf-8'), { filepath: path });\n const metadata = output.getMetadata();\n\n const doc = Doc.from(path, metadata);\n return doc;\n }\n\n isFormatSupported(format: string) {\n return this.extensions.includes(format);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,YAAY,CAAsB;EAC7CC,WAAW,CAASC,UAAoB,EAAE;IAAA,KAAtBA,UAAoB,GAApBA,UAAoB;EAAG;EAE3C,MAAMC,IAAI,CAACC,IAAY,EAAEC,QAAgB,EAAE;IACzC,MAAMC,MAAM,GAAG,MAAM,IAAAC,qBAAO,EAACF,QAAQ,CAACG,QAAQ,CAAC,OAAO,CAAC,EAAE;MAAEC,QAAQ,EAAEL;IAAK,CAAC,CAAC;IAC5E,MAAMM,QAAQ,GAAGJ,MAAM,CAACK,WAAW,EAAE;IAErC,MAAMC,GAAG,GAAGC,WAAG,CAACC,IAAI,CAACV,IAAI,EAAEM,QAAQ,CAAC;IACpC,OAAOE,GAAG;EACZ;EAEAG,iBAAiB,CAACC,MAAc,EAAE;IAChC,OAAO,IAAI,CAACd,UAAU,CAACe,QAAQ,CAACD,MAAM,CAAC;EACzC;AACF;AAAC"}
package/dist/mdx.env.js CHANGED
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.MdxEnvType = exports.MdxEnv = void 0;
7
7
  const MdxEnvType = 'mdx';
8
8
  exports.MdxEnvType = MdxEnvType;
9
-
10
- class MdxEnv {// TODO: add the env here properly.
9
+ class MdxEnv {
10
+ // TODO: add the env here properly.
11
11
  }
12
-
13
12
  exports.MdxEnv = MdxEnv;
14
13
 
15
14
  //# sourceMappingURL=mdx.env.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MdxEnvType","MdxEnv"],"sources":["mdx.env.ts"],"sourcesContent":["import { Environment } from '@teambit/envs';\n\nexport const MdxEnvType = 'mdx';\n\nexport class MdxEnv implements Environment {\n // TODO: add the env here properly.\n}\n"],"mappings":";;;;;;AAEO,MAAMA,UAAU,GAAG,KAAnB;;;AAEA,MAAMC,MAAN,CAAoC,CACzC;AADyC"}
1
+ {"version":3,"names":["MdxEnvType","MdxEnv"],"sources":["mdx.env.ts"],"sourcesContent":["import { Environment } from '@teambit/envs';\n\nexport const MdxEnvType = 'mdx';\n\nexport class MdxEnv implements Environment {\n // TODO: add the env here properly.\n}\n"],"mappings":";;;;;;AAEO,MAAMA,UAAU,GAAG,KAAK;AAAC;AAEzB,MAAMC,MAAM,CAAwB;EACzC;AAAA;AACD"}