@teambit/docs 1.0.498 → 1.0.500

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.
@@ -61,6 +61,13 @@ function _baseReactThemes() {
61
61
  };
62
62
  return data;
63
63
  }
64
+ function _workspaceUi() {
65
+ const data = require("@teambit/workspace.ui.use-workspace-mode");
66
+ _workspaceUi = function () {
67
+ return data;
68
+ };
69
+ return data;
70
+ }
64
71
  function _readmeSkeleton() {
65
72
  const data = require("./readme-skeleton");
66
73
  _readmeSkeleton = function () {
@@ -75,7 +82,9 @@ function _overviewModule() {
75
82
  };
76
83
  return data;
77
84
  }
78
- const _excluded = ["onLoad", "style"]; // import { Icon } from '@teambit/design.elements.icon';
85
+ const _excluded = ["onLoad", "style"];
86
+ /* eslint-disable complexity */
87
+ // import { Icon } from '@teambit/design.elements.icon';
79
88
  // import { LinkedHeading } from '@teambit/documenter.ui.linked-heading';
80
89
  // import { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';
81
90
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -111,6 +120,9 @@ function Overview({
111
120
  const defaultLoadingState = _react().default.useMemo(() => {
112
121
  return isScaling && !includesEnvTemplate;
113
122
  }, [isScaling, includesEnvTemplate]);
123
+ const {
124
+ isMinimal
125
+ } = (0, _workspaceUi().useWorkspaceMode)();
114
126
  const [isLoading, setLoading] = (0, _react().useState)(defaultLoadingState);
115
127
  const iframeQueryParams = `onlyOverview=${component.preview?.onlyOverview || 'false'}&skipIncludes=${component.preview?.skipIncludes || component.preview?.onlyOverview}`;
116
128
  const overviewPropsValues = overviewProps && overviewProps();
@@ -148,7 +160,7 @@ function Overview({
148
160
  className: _overviewModule().default.readme
149
161
  }, isLoading && /*#__PURE__*/_react().default.createElement(_readmeSkeleton().ReadmeSkeleton, null, /*#__PURE__*/_react().default.createElement(_compositionsPanels().CompositionGallerySkeleton, {
150
162
  compositionsLength: Math.min(component.compositions.length, 3)
151
- })), /*#__PURE__*/_react().default.createElement(_previewUi().ComponentPreview, _extends({
163
+ })), !isMinimal ? /*#__PURE__*/_react().default.createElement(_react().default.Fragment, null, /*#__PURE__*/_react().default.createElement(_previewUi().ComponentPreview, _extends({
152
164
  onLoad: onPreviewLoad,
153
165
  previewName: "overview",
154
166
  pubsub: true,
@@ -165,7 +177,24 @@ function Overview({
165
177
  }
166
178
  })), component.preview?.onlyOverview && !isLoading && /*#__PURE__*/_react().default.createElement(_compositionsPanels().CompositionGallery, {
167
179
  component: component
168
- }), component.preview?.onlyOverview && !isLoading && TaggedAPI && /*#__PURE__*/_react().default.createElement(TaggedAPI, {
180
+ })) : /*#__PURE__*/_react().default.createElement(_react().default.Fragment, null, component.preview?.onlyOverview && !isLoading && /*#__PURE__*/_react().default.createElement(_compositionsPanels().CompositionGallery, {
181
+ component: component
182
+ }), /*#__PURE__*/_react().default.createElement(_previewUi().ComponentPreview, _extends({
183
+ onLoad: onPreviewLoad,
184
+ previewName: "overview",
185
+ pubsub: true,
186
+ queryParams: [iframeQueryParams, themeParams, overviewPropsValues?.queryParams || ''],
187
+ viewport: null,
188
+ fullContentHeight: true,
189
+ disableScroll: true
190
+ }, rest, {
191
+ component: component,
192
+ style: {
193
+ width: '100%',
194
+ height: '100%',
195
+ minHeight: !isScaling ? 500 : undefined
196
+ }
197
+ }))), component.preview?.onlyOverview && !isLoading && TaggedAPI && /*#__PURE__*/_react().default.createElement(TaggedAPI, {
169
198
  componentId: component.id.toString()
170
199
  })), buildFailed && EmptyState && /*#__PURE__*/_react().default.createElement(EmptyState, null));
171
200
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_react","data","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_lodash","_component","_previewUi","_componentUi","_compositionsPanels","_baseReactThemes","_readmeSkeleton","_overviewModule","_excluded","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","s","includes","propertyIsEnumerable","BadgePosition","exports","Overview","titleBadges","overviewOptions","previewProps","getEmptyState","TaggedAPI","component","useContext","ComponentContext","componentDescriptor","useComponentDescriptor","theme","useThemePicker","currentTheme","current","overviewProps","flatten","values","showHeader","preview","legacyHeader","EmptyState","buildFailed","buildStatus","toLowerCase","host","isScaling","Boolean","includesEnvTemplate","defaultLoadingState","React","useMemo","isLoading","setLoading","useState","iframeQueryParams","onlyOverview","skipIncludes","overviewPropsValues","themeParams","themeName","_ref","onLoad","style","rest","onPreviewLoad","useCallback","props","useEffect","id","toString","createElement","className","classNames","styles","overviewWrapper","noOverflow","key","ComponentOverview","componentOverviewBlock","legacyPreview","displayName","version","abstract","description","labels","packageName","readme","ReadmeSkeleton","CompositionGallerySkeleton","compositionsLength","Math","min","compositions","ComponentPreview","previewName","pubsub","queryParams","viewport","fullContentHeight","disableScroll","width","height","minHeight","undefined","CompositionGallery","componentId"],"sources":["overview.tsx"],"sourcesContent":["import React, { useContext, ComponentType, useState } from 'react';\nimport classNames from 'classnames';\nimport { flatten } from 'lodash';\n// import { Icon } from '@teambit/design.elements.icon';\n// import { LinkedHeading } from '@teambit/documenter.ui.linked-heading';\nimport { ComponentContext, useComponentDescriptor } from '@teambit/component';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { ComponentPreview, ComponentPreviewProps } from '@teambit/preview.ui.component-preview';\n// import { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';\nimport { ComponentOverview } from '@teambit/component.ui.component-meta';\nimport { CompositionGallery, CompositionGallerySkeleton } from '@teambit/compositions.panels.composition-gallery';\nimport { useThemePicker } from '@teambit/base-react.themes.theme-switcher';\nimport { ReadmeSkeleton } from './readme-skeleton';\nimport styles from './overview.module.scss';\n\nexport enum BadgePosition {\n Title,\n SubTitle,\n Labels,\n Package,\n}\n\nexport type TitleBadge = {\n component: ComponentType<any>;\n weight?: number;\n position?: BadgePosition;\n};\n\nexport type TitleBadgeSlot = SlotRegistry<TitleBadge[]>;\n\nexport type OverviewOptions = () => { queryParams?: string };\n\nexport type OverviewOptionsSlot = SlotRegistry<OverviewOptions>;\n\nexport type OverviewProps = {\n titleBadges: TitleBadgeSlot;\n overviewOptions: OverviewOptionsSlot;\n previewProps?: Partial<ComponentPreviewProps>;\n getEmptyState?: () => ComponentType | undefined;\n TaggedAPI?: React.ComponentType<{ componentId: string }>;\n};\n\nexport function Overview({ titleBadges, overviewOptions, previewProps, getEmptyState, TaggedAPI }: OverviewProps) {\n const component = useContext(ComponentContext);\n const componentDescriptor = useComponentDescriptor();\n const theme = useThemePicker();\n const currentTheme = theme?.current;\n const overviewProps = flatten(overviewOptions.values())[0];\n const showHeader = !component.preview?.legacyHeader;\n const EmptyState = getEmptyState && getEmptyState();\n const buildFailed = component.buildStatus?.toLowerCase() !== 'succeed' && component?.host === 'teambit.scope/scope';\n const isScaling = Boolean(component.preview?.isScaling);\n const includesEnvTemplate = Boolean(component.preview?.includesEnvTemplate);\n const defaultLoadingState = React.useMemo(() => {\n return isScaling && !includesEnvTemplate;\n }, [isScaling, includesEnvTemplate]);\n\n const [isLoading, setLoading] = useState(defaultLoadingState);\n\n const iframeQueryParams = `onlyOverview=${component.preview?.onlyOverview || 'false'}&skipIncludes=${\n component.preview?.skipIncludes || component.preview?.onlyOverview\n }`;\n\n const overviewPropsValues = overviewProps && overviewProps();\n\n const themeParams = currentTheme?.themeName ? `theme=${currentTheme?.themeName}` : '';\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onLoad, style, ...rest } = previewProps || {};\n\n const onPreviewLoad = React.useCallback(\n (e, props) => {\n setLoading(false);\n onLoad?.(e, props);\n },\n [onLoad]\n );\n\n React.useEffect(() => {\n if (!isLoading && defaultLoadingState) setLoading(true);\n if (isLoading && !defaultLoadingState) setLoading(false);\n }, [component.id.toString(), defaultLoadingState]);\n\n return (\n <div\n className={classNames(styles.overviewWrapper, isLoading && styles.noOverflow)}\n key={`${component.id.toString()}`}\n >\n {showHeader && (\n <ComponentOverview\n className={classNames(styles.componentOverviewBlock, !isScaling && styles.legacyPreview)}\n displayName={component.displayName}\n version={component.version}\n abstract={component.description}\n labels={component.labels}\n packageName={component.packageName}\n titleBadges={flatten(titleBadges.values())}\n componentDescriptor={componentDescriptor}\n component={component}\n />\n )}\n {!buildFailed && (\n <div className={styles.readme}>\n {isLoading && (\n <ReadmeSkeleton>\n <CompositionGallerySkeleton compositionsLength={Math.min(component.compositions.length, 3)} />\n </ReadmeSkeleton>\n )}\n <ComponentPreview\n onLoad={onPreviewLoad}\n previewName=\"overview\"\n pubsub={true}\n queryParams={[iframeQueryParams, themeParams, overviewPropsValues?.queryParams || '']}\n viewport={null}\n fullContentHeight\n disableScroll={true}\n {...rest}\n component={component}\n style={{ width: '100%', height: '100%', minHeight: !isScaling ? 500 : undefined }}\n />\n {component.preview?.onlyOverview && !isLoading && <CompositionGallery component={component} />}\n {component.preview?.onlyOverview && !isLoading && TaggedAPI && (\n <TaggedAPI componentId={component.id.toString()} />\n )}\n </div>\n )}\n {buildFailed && EmptyState && <EmptyState />}\n </div>\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,YAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,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CAAC,EAC7FA,SAAS,CAACa,OAAO,EAAEiB,YAAY,IAAI,CAACJ,SAAS,IAAI3B,SAAS,iBACzDvD,MAAA,GAAAiB,OAAA,CAAAoF,aAAA,CAAC9C,SAAS;IAACiF,WAAW,EAAEhF,SAAS,CAAC2C,EAAE,CAACC,QAAQ,CAAC;EAAE,CAAE,CAEjD,CACN,EACA5B,WAAW,IAAID,UAAU,iBAAIvE,MAAA,GAAAiB,OAAA,CAAAoF,aAAA,CAAC9B,UAAU,MAAE,CACxC,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"names":["_react","data","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_lodash","_component","_previewUi","_componentUi","_compositionsPanels","_baseReactThemes","_workspaceUi","_readmeSkeleton","_overviewModule","_excluded","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","s","includes","propertyIsEnumerable","BadgePosition","exports","Overview","titleBadges","overviewOptions","previewProps","getEmptyState","TaggedAPI","component","useContext","ComponentContext","componentDescriptor","useComponentDescriptor","theme","useThemePicker","currentTheme","current","overviewProps","flatten","values","showHeader","preview","legacyHeader","EmptyState","buildFailed","buildStatus","toLowerCase","host","isScaling","Boolean","includesEnvTemplate","defaultLoadingState","React","useMemo","isMinimal","useWorkspaceMode","isLoading","setLoading","useState","iframeQueryParams","onlyOverview","skipIncludes","overviewPropsValues","themeParams","themeName","_ref","onLoad","style","rest","onPreviewLoad","useCallback","props","useEffect","id","toString","createElement","className","classNames","styles","overviewWrapper","noOverflow","key","ComponentOverview","componentOverviewBlock","legacyPreview","displayName","version","abstract","description","labels","packageName","readme","ReadmeSkeleton","CompositionGallerySkeleton","compositionsLength","Math","min","compositions","Fragment","ComponentPreview","previewName","pubsub","queryParams","viewport","fullContentHeight","disableScroll","width","height","minHeight","undefined","CompositionGallery","componentId"],"sources":["overview.tsx"],"sourcesContent":["/* eslint-disable complexity */\nimport React, { useContext, ComponentType, useState } from 'react';\nimport classNames from 'classnames';\nimport { flatten } from 'lodash';\n// import { Icon } from '@teambit/design.elements.icon';\n// import { LinkedHeading } from '@teambit/documenter.ui.linked-heading';\nimport { ComponentContext, useComponentDescriptor } from '@teambit/component';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { ComponentPreview, ComponentPreviewProps } from '@teambit/preview.ui.component-preview';\n// import { StatusMessageCard } from '@teambit/design.ui.surfaces.status-message-card';\nimport { ComponentOverview } from '@teambit/component.ui.component-meta';\nimport { CompositionGallery, CompositionGallerySkeleton } from '@teambit/compositions.panels.composition-gallery';\nimport { useThemePicker } from '@teambit/base-react.themes.theme-switcher';\nimport { useWorkspaceMode } from '@teambit/workspace.ui.use-workspace-mode';\nimport { ReadmeSkeleton } from './readme-skeleton';\nimport styles from './overview.module.scss';\n\nexport enum BadgePosition {\n Title,\n SubTitle,\n Labels,\n Package,\n}\n\nexport type TitleBadge = {\n component: ComponentType<any>;\n weight?: number;\n position?: BadgePosition;\n};\n\nexport type TitleBadgeSlot = SlotRegistry<TitleBadge[]>;\n\nexport type OverviewOptions = () => { queryParams?: string };\n\nexport type OverviewOptionsSlot = SlotRegistry<OverviewOptions>;\n\nexport type OverviewProps = {\n titleBadges: TitleBadgeSlot;\n overviewOptions: OverviewOptionsSlot;\n previewProps?: Partial<ComponentPreviewProps>;\n getEmptyState?: () => ComponentType | undefined;\n TaggedAPI?: React.ComponentType<{ componentId: string }>;\n};\n\nexport function Overview({ titleBadges, overviewOptions, previewProps, getEmptyState, TaggedAPI }: OverviewProps) {\n const component = useContext(ComponentContext);\n const componentDescriptor = useComponentDescriptor();\n const theme = useThemePicker();\n const currentTheme = theme?.current;\n const overviewProps = flatten(overviewOptions.values())[0];\n const showHeader = !component.preview?.legacyHeader;\n const EmptyState = getEmptyState && getEmptyState();\n const buildFailed = component.buildStatus?.toLowerCase() !== 'succeed' && component?.host === 'teambit.scope/scope';\n const isScaling = Boolean(component.preview?.isScaling);\n const includesEnvTemplate = Boolean(component.preview?.includesEnvTemplate);\n const defaultLoadingState = React.useMemo(() => {\n return isScaling && !includesEnvTemplate;\n }, [isScaling, includesEnvTemplate]);\n const { isMinimal } = useWorkspaceMode();\n const [isLoading, setLoading] = useState(defaultLoadingState);\n\n const iframeQueryParams = `onlyOverview=${component.preview?.onlyOverview || 'false'}&skipIncludes=${\n component.preview?.skipIncludes || component.preview?.onlyOverview\n }`;\n\n const overviewPropsValues = overviewProps && overviewProps();\n\n const themeParams = currentTheme?.themeName ? `theme=${currentTheme?.themeName}` : '';\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onLoad, style, ...rest } = previewProps || {};\n\n const onPreviewLoad = React.useCallback(\n (e, props) => {\n setLoading(false);\n onLoad?.(e, props);\n },\n [onLoad]\n );\n\n React.useEffect(() => {\n if (!isLoading && defaultLoadingState) setLoading(true);\n if (isLoading && !defaultLoadingState) setLoading(false);\n }, [component.id.toString(), defaultLoadingState]);\n\n return (\n <div\n className={classNames(styles.overviewWrapper, isLoading && styles.noOverflow)}\n key={`${component.id.toString()}`}\n >\n {showHeader && (\n <ComponentOverview\n className={classNames(styles.componentOverviewBlock, !isScaling && styles.legacyPreview)}\n displayName={component.displayName}\n version={component.version}\n abstract={component.description}\n labels={component.labels}\n packageName={component.packageName}\n titleBadges={flatten(titleBadges.values())}\n componentDescriptor={componentDescriptor}\n component={component}\n />\n )}\n {!buildFailed && (\n <div className={styles.readme}>\n {isLoading && (\n <ReadmeSkeleton>\n <CompositionGallerySkeleton compositionsLength={Math.min(component.compositions.length, 3)} />\n </ReadmeSkeleton>\n )}\n {!isMinimal ? (\n <>\n <ComponentPreview\n onLoad={onPreviewLoad}\n previewName=\"overview\"\n pubsub={true}\n queryParams={[iframeQueryParams, themeParams, overviewPropsValues?.queryParams || '']}\n viewport={null}\n fullContentHeight\n disableScroll={true}\n {...rest}\n component={component}\n style={{ width: '100%', height: '100%', minHeight: !isScaling ? 500 : undefined }}\n />\n {component.preview?.onlyOverview && !isLoading && <CompositionGallery component={component} />}\n </>\n ) : (\n <>\n {component.preview?.onlyOverview && !isLoading && <CompositionGallery component={component} />}\n <ComponentPreview\n onLoad={onPreviewLoad}\n previewName=\"overview\"\n pubsub={true}\n queryParams={[iframeQueryParams, themeParams, overviewPropsValues?.queryParams || '']}\n viewport={null}\n fullContentHeight\n disableScroll={true}\n {...rest}\n component={component}\n style={{ width: '100%', height: '100%', minHeight: !isScaling ? 500 : undefined }}\n />\n </>\n )}\n {component.preview?.onlyOverview && !isLoading && TaggedAPI && (\n <TaggedAPI componentId={component.id.toString()} />\n )}\n </div>\n )}\n {buildFailed && EmptyState && <EmptyState />}\n </div>\n );\n}\n"],"mappings":";;;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,UAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,aAAA;EAAA,MAAAR,IAAA,GAAAE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 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.498/dist/docs.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.498/dist/docs.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.500/dist/docs.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.docs_docs@1.0.500/dist/docs.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -1,3 +1,4 @@
1
+ /* eslint-disable complexity */
1
2
  import React, { useContext, ComponentType, useState } from 'react';
2
3
  import classNames from 'classnames';
3
4
  import { flatten } from 'lodash';
@@ -10,6 +11,7 @@ import { ComponentPreview, ComponentPreviewProps } from '@teambit/preview.ui.com
10
11
  import { ComponentOverview } from '@teambit/component.ui.component-meta';
11
12
  import { CompositionGallery, CompositionGallerySkeleton } from '@teambit/compositions.panels.composition-gallery';
12
13
  import { useThemePicker } from '@teambit/base-react.themes.theme-switcher';
14
+ import { useWorkspaceMode } from '@teambit/workspace.ui.use-workspace-mode';
13
15
  import { ReadmeSkeleton } from './readme-skeleton';
14
16
  import styles from './overview.module.scss';
15
17
 
@@ -54,7 +56,7 @@ export function Overview({ titleBadges, overviewOptions, previewProps, getEmptyS
54
56
  const defaultLoadingState = React.useMemo(() => {
55
57
  return isScaling && !includesEnvTemplate;
56
58
  }, [isScaling, includesEnvTemplate]);
57
-
59
+ const { isMinimal } = useWorkspaceMode();
58
60
  const [isLoading, setLoading] = useState(defaultLoadingState);
59
61
 
60
62
  const iframeQueryParams = `onlyOverview=${component.preview?.onlyOverview || 'false'}&skipIncludes=${
@@ -106,19 +108,39 @@ export function Overview({ titleBadges, overviewOptions, previewProps, getEmptyS
106
108
  <CompositionGallerySkeleton compositionsLength={Math.min(component.compositions.length, 3)} />
107
109
  </ReadmeSkeleton>
108
110
  )}
109
- <ComponentPreview
110
- onLoad={onPreviewLoad}
111
- previewName="overview"
112
- pubsub={true}
113
- queryParams={[iframeQueryParams, themeParams, overviewPropsValues?.queryParams || '']}
114
- viewport={null}
115
- fullContentHeight
116
- disableScroll={true}
117
- {...rest}
118
- component={component}
119
- style={{ width: '100%', height: '100%', minHeight: !isScaling ? 500 : undefined }}
120
- />
121
- {component.preview?.onlyOverview && !isLoading && <CompositionGallery component={component} />}
111
+ {!isMinimal ? (
112
+ <>
113
+ <ComponentPreview
114
+ onLoad={onPreviewLoad}
115
+ previewName="overview"
116
+ pubsub={true}
117
+ queryParams={[iframeQueryParams, themeParams, overviewPropsValues?.queryParams || '']}
118
+ viewport={null}
119
+ fullContentHeight
120
+ disableScroll={true}
121
+ {...rest}
122
+ component={component}
123
+ style={{ width: '100%', height: '100%', minHeight: !isScaling ? 500 : undefined }}
124
+ />
125
+ {component.preview?.onlyOverview && !isLoading && <CompositionGallery component={component} />}
126
+ </>
127
+ ) : (
128
+ <>
129
+ {component.preview?.onlyOverview && !isLoading && <CompositionGallery component={component} />}
130
+ <ComponentPreview
131
+ onLoad={onPreviewLoad}
132
+ previewName="overview"
133
+ pubsub={true}
134
+ queryParams={[iframeQueryParams, themeParams, overviewPropsValues?.queryParams || '']}
135
+ viewport={null}
136
+ fullContentHeight
137
+ disableScroll={true}
138
+ {...rest}
139
+ component={component}
140
+ style={{ width: '100%', height: '100%', minHeight: !isScaling ? 500 : undefined }}
141
+ />
142
+ </>
143
+ )}
122
144
  {component.preview?.onlyOverview && !isLoading && TaggedAPI && (
123
145
  <TaggedAPI componentId={component.id.toString()} />
124
146
  )}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/docs",
3
- "version": "1.0.498",
3
+ "version": "1.0.500",
4
4
  "homepage": "https://bit.cloud/teambit/docs/docs",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.docs",
8
8
  "name": "docs",
9
- "version": "1.0.498"
9
+ "version": "1.0.500"
10
10
  },
11
11
  "dependencies": {
12
12
  "graphql-tag": "2.12.1",
@@ -19,25 +19,26 @@
19
19
  "@teambit/base-react.themes.theme-switcher": "1.1.2",
20
20
  "@teambit/component.ui.component-meta": "0.0.364",
21
21
  "@teambit/base-ui.loaders.skeleton": "1.0.1",
22
- "@teambit/compiler": "1.0.498",
23
- "@teambit/component": "1.0.498",
24
- "@teambit/pkg": "1.0.498",
25
- "@teambit/workspace": "1.0.498",
26
- "@teambit/cli": "0.0.1075",
27
- "@teambit/component.sources": "0.0.61",
28
- "@teambit/dev-files": "1.0.498",
29
- "@teambit/envs": "1.0.498",
30
- "@teambit/graphql": "1.0.498",
31
- "@teambit/legacy.consumer-component": "0.0.10",
32
- "@teambit/logger": "0.0.1168",
33
- "@teambit/preview": "1.0.498",
34
- "@teambit/scope": "1.0.498",
35
- "@teambit/api-reference": "1.0.498",
36
- "@teambit/component-compare": "1.0.498",
37
- "@teambit/ui": "1.0.498",
22
+ "@teambit/compiler": "1.0.500",
23
+ "@teambit/component": "1.0.500",
24
+ "@teambit/pkg": "1.0.500",
25
+ "@teambit/workspace": "1.0.500",
26
+ "@teambit/cli": "0.0.1077",
27
+ "@teambit/component.sources": "0.0.62",
28
+ "@teambit/dev-files": "1.0.500",
29
+ "@teambit/envs": "1.0.500",
30
+ "@teambit/graphql": "1.0.500",
31
+ "@teambit/legacy.consumer-component": "0.0.11",
32
+ "@teambit/logger": "0.0.1170",
33
+ "@teambit/preview": "1.0.500",
34
+ "@teambit/scope": "1.0.500",
35
+ "@teambit/api-reference": "1.0.500",
36
+ "@teambit/component-compare": "1.0.500",
37
+ "@teambit/ui": "1.0.500",
38
38
  "@teambit/compositions.panels.composition-gallery": "0.0.216",
39
39
  "@teambit/preview.ui.component-preview": "1.0.19",
40
- "@teambit/pubsub": "1.0.498"
40
+ "@teambit/workspace.ui.use-workspace-mode": "0.0.2",
41
+ "@teambit/pubsub": "1.0.500"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@types/lodash": "4.14.165",