@teambit/component 0.0.655 → 0.0.658
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{__preview-1645630586060.js → __preview-1645845653707.js} +1 -1
- package/dist/ui/menu/menu.js +4 -4
- package/dist/ui/menu/menu.js.map +1 -1
- package/package-tar/teambit-component-0.0.658.tgz +0 -0
- package/package.json +19 -18
- package/ui/menu/menu.tsx +1 -1
- package/package-tar/teambit-component-0.0.655.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.
|
|
1
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.658/dist/component.docs.mdx')]
|
package/dist/ui/menu/menu.js
CHANGED
|
@@ -31,10 +31,10 @@ function _componentUi() {
|
|
|
31
31
|
return data;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
function
|
|
35
|
-
const data = require("@teambit/
|
|
34
|
+
function _uiFoundationUi2() {
|
|
35
|
+
const data = require("@teambit/ui-foundation.ui.full-loader");
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
_uiFoundationUi2 = function () {
|
|
38
38
|
return data;
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -160,7 +160,7 @@ function Menu({
|
|
|
160
160
|
component
|
|
161
161
|
} = (0, _useComponent().useComponent)(host);
|
|
162
162
|
const mainMenuItems = (0, _react().useMemo)(() => (0, _lodash().groupBy)((0, _lodash().flatten)(menuItemSlot.values()), 'category'), [menuItemSlot]);
|
|
163
|
-
if (!component) return /*#__PURE__*/_react().default.createElement(
|
|
163
|
+
if (!component) return /*#__PURE__*/_react().default.createElement(_uiFoundationUi2().FullLoader, null);
|
|
164
164
|
return /*#__PURE__*/_react().default.createElement("div", {
|
|
165
165
|
className: (0, _classnames().default)(_menuModule().default.topBar, className)
|
|
166
166
|
}, /*#__PURE__*/_react().default.createElement("div", {
|
package/dist/ui/menu/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["menu.tsx"],"names":["Menu","navigationSlot","widgetSlot","className","host","menuItemSlot","consumeMethodSlot","component","mainMenuItems","values","styles","topBar","leftSide","rightSide","widgets","VersionRelatedDropdowns","consumeMethods","location","isNew","tags","isEmpty","lanesContext","currentLane","isWorkspace","versionList","tagsArray","toArray","map","tag","version","filter","x","undefined","reverse","id","wsLink","currentVersion","search","includes","methods","useConsumeMethods","length","useBox","name","latest","componentModel","method","Component","Title"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAsBA;AACA;AACA;AACO,SAASA,IAAT,CAAc;AAAEC,EAAAA,cAAF;AAAkBC,EAAAA,UAAlB;AAA8BC,EAAAA,SAA9B;AAAyCC,EAAAA,IAAzC;AAA+CC,EAAAA,YAA/C;AAA6DC,EAAAA;AAA7D,CAAd,EAA2G;AAChH,QAAM;AAAEC,IAAAA;AAAF,MAAgB,kCAAaH,IAAb,CAAtB;AACA,QAAMI,aAAa,GAAG,sBAAQ,MAAM,uBAAQ,uBAAQH,YAAY,CAACI,MAAb,EAAR,CAAR,EAAwC,UAAxC,CAAd,EAAmE,CAACJ,YAAD,CAAnE,CAAtB;AACA,MAAI,CAACE,SAAL,EAAgB,oBAAO,+BAAC,
|
|
1
|
+
{"version":3,"sources":["menu.tsx"],"names":["Menu","navigationSlot","widgetSlot","className","host","menuItemSlot","consumeMethodSlot","component","mainMenuItems","values","styles","topBar","leftSide","rightSide","widgets","VersionRelatedDropdowns","consumeMethods","location","isNew","tags","isEmpty","lanesContext","currentLane","isWorkspace","versionList","tagsArray","toArray","map","tag","version","filter","x","undefined","reverse","id","wsLink","currentVersion","search","includes","methods","useConsumeMethods","length","useBox","name","latest","componentModel","method","Component","Title"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAsBA;AACA;AACA;AACO,SAASA,IAAT,CAAc;AAAEC,EAAAA,cAAF;AAAkBC,EAAAA,UAAlB;AAA8BC,EAAAA,SA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FJ,eAQE,+BAAC,8BAAD;AAAiB,IAAA,QAAQ,EAAEnB,WAA3B;AAAwC,IAAA,cAAc,EAAEY,cAAxD;AAAwE,IAAA,aAAa,EAAE7B,SAAS,CAACqC;AAAjG,IARF,CADF;AAYD;;AAED,SAASJ,iBAAT,CACExB,cADF,EAEE6B,cAFF,EAGEvB,WAHF,EAImB;AACjB,SAAO,sBACL,MACE,uBAAQN,cAAc,CAACP,MAAf,EAAR,EACGkB,GADH,CACQmB,MAAD,IAAY;AACf,WAAOA,MAAP,aAAOA,MAAP,uBAAOA,MAAM,CAAGD,cAAH,EAAmB;AAAEvB,MAAAA;AAAF,KAAnB,CAAb;AACD,GAHH,EAIGQ,MAJH,CAIWC,CAAD,IAAO,CAAC,CAACA,CAAF,IAAOA,CAAC,CAACgB,SAAT,IAAsBhB,CAAC,CAACiB,KAJzC,CAFG,EAOL,CAAChC,cAAD,EAAiB6B,cAAjB,EAAiCvB,WAAjC,CAPK,CAAP;AASD","sourcesContent":["import { MainDropdown, MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';\nimport { VersionDropdown } from '@teambit/component.ui.version-dropdown';\nimport { FullLoader } from '@teambit/ui-foundation.ui.full-loader';\nimport type { ConsumeMethod } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { useLocation } from '@teambit/base-ui.routing.routing-provider';\nimport { compact, flatten, groupBy } from 'lodash';\nimport classnames from 'classnames';\nimport React, { useMemo } from 'react';\nimport { UseBoxDropdown } from '@teambit/ui-foundation.ui.use-box.dropdown';\nimport { Menu as ConsumeMethodsMenu } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { LaneModel, useLanesContext } from '@teambit/lanes.ui.lanes';\nimport type { ComponentModel } from '../component-model';\nimport { useComponent } from '../use-component';\nimport { MenuNav } from './menu-nav';\nimport styles from './menu.module.scss';\nimport { OrderedNavigationSlot, ConsumeMethodSlot } from './nav-plugin';\n\nexport type MenuProps = {\n className?: string;\n /**\n * slot for top bar menu nav items\n */\n navigationSlot: OrderedNavigationSlot;\n /**\n * right side menu item slot\n */\n widgetSlot: OrderedNavigationSlot;\n host: string;\n /**\n * main dropdown item slot\n */\n menuItemSlot: MenuItemSlot;\n\n consumeMethodSlot: ConsumeMethodSlot;\n};\n\n/**\n * top bar menu.\n */\nexport function Menu({ navigationSlot, widgetSlot, className, host, menuItemSlot, consumeMethodSlot }: MenuProps) {\n const { component } = useComponent(host);\n const mainMenuItems = useMemo(() => groupBy(flatten(menuItemSlot.values()), 'category'), [menuItemSlot]);\n if (!component) return <FullLoader />;\n return (\n <div className={classnames(styles.topBar, className)}>\n <div className={styles.leftSide}>\n <MenuNav navigationSlot={navigationSlot} />\n </div>\n <div className={styles.rightSide}>\n <div className={styles.widgets}>\n <MenuNav navigationSlot={widgetSlot} />\n </div>\n <VersionRelatedDropdowns component={component} consumeMethods={consumeMethodSlot} host={host} />\n <MainDropdown menuItems={mainMenuItems} />\n </div>\n </div>\n );\n}\n\nfunction VersionRelatedDropdowns({\n component,\n consumeMethods,\n host,\n}: {\n component: ComponentModel;\n consumeMethods: ConsumeMethodSlot;\n host: string;\n}) {\n const location = useLocation();\n const isNew = component.tags.isEmpty();\n const lanesContext = useLanesContext();\n const currentLane = lanesContext?.currentLane;\n\n const isWorkspace = host === 'teambit.workspace/workspace';\n const versionList = useMemo(() => {\n const tagsArray = !currentLane\n ? component.tags\n ?.toArray()\n .map((tag) => tag?.version?.version)\n .filter((x) => x !== undefined)\n .reverse()\n : [component.id.version];\n const wsLink = [isWorkspace && !isNew && !currentLane ? 'workspace' : undefined];\n\n return compact([...wsLink, ...tagsArray]);\n }, [component.tags, isWorkspace, isNew, currentLane]);\n\n const currentVersion =\n isWorkspace && !isNew && !location.search.includes('version') ? 'workspace' : component.version;\n\n const methods = useConsumeMethods(consumeMethods, component, currentLane);\n return (\n <>\n {versionList.length > 0 && (\n <UseBoxDropdown\n position=\"bottom-end\"\n className={styles.useBox}\n Menu={<ConsumeMethodsMenu methods={methods} componentName={component.id.name} />}\n />\n )}\n <VersionDropdown versions={versionList} currentVersion={currentVersion} latestVersion={component.latest} />\n </>\n );\n}\n\nfunction useConsumeMethods(\n consumeMethods: ConsumeMethodSlot,\n componentModel: ComponentModel,\n currentLane?: LaneModel\n): ConsumeMethod[] {\n return useMemo(\n () =>\n flatten(consumeMethods.values())\n .map((method) => {\n return method?.(componentModel, { currentLane });\n })\n .filter((x) => !!x && x.Component && x.Title) as ConsumeMethod[],\n [consumeMethods, componentModel, currentLane]\n );\n}\n"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.658",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/component/component",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "component",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.658"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/any-fs": "0.0.5",
|
|
@@ -29,36 +29,37 @@
|
|
|
29
29
|
"@teambit/base-ui.routing.routing-provider": "1.0.0",
|
|
30
30
|
"@teambit/component-id": "0.0.401",
|
|
31
31
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.488",
|
|
32
|
-
"@teambit/aspect-loader": "0.0.
|
|
32
|
+
"@teambit/aspect-loader": "0.0.658",
|
|
33
33
|
"@teambit/legacy-bit-id": "0.0.398",
|
|
34
34
|
"@teambit/toolbox.string.capitalize": "0.0.483",
|
|
35
|
-
"@teambit/cli": "0.0.
|
|
36
|
-
"@teambit/config": "0.0.
|
|
37
|
-
"@teambit/express": "0.0.
|
|
38
|
-
"@teambit/graphql": "0.0.
|
|
35
|
+
"@teambit/cli": "0.0.448",
|
|
36
|
+
"@teambit/config": "0.0.461",
|
|
37
|
+
"@teambit/express": "0.0.542",
|
|
38
|
+
"@teambit/graphql": "0.0.658",
|
|
39
39
|
"@teambit/bit-error": "0.0.394",
|
|
40
|
-
"@teambit/command-bar": "0.0.
|
|
41
|
-
"@teambit/preview": "0.0.
|
|
42
|
-
"@teambit/pubsub": "0.0.
|
|
40
|
+
"@teambit/command-bar": "0.0.658",
|
|
41
|
+
"@teambit/preview": "0.0.658",
|
|
42
|
+
"@teambit/pubsub": "0.0.658",
|
|
43
43
|
"@teambit/ui-foundation.ui.is-browser": "0.0.486",
|
|
44
44
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.486",
|
|
45
45
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.488",
|
|
46
46
|
"@teambit/ui-foundation.ui.use-box.menu": "0.0.111",
|
|
47
|
-
"@teambit/ui": "0.0.
|
|
47
|
+
"@teambit/ui": "0.0.658",
|
|
48
48
|
"@teambit/component-issues": "0.0.46",
|
|
49
49
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.487",
|
|
50
50
|
"@teambit/cli-table": "0.0.33",
|
|
51
|
-
"@teambit/component-descriptor": "0.0.
|
|
51
|
+
"@teambit/component-descriptor": "0.0.9",
|
|
52
52
|
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.486",
|
|
53
53
|
"@teambit/design.ui.empty-box": "0.0.353",
|
|
54
54
|
"@teambit/harmony.ui.aspect-box": "0.0.486",
|
|
55
55
|
"@teambit/design.ui.pages.not-found": "0.0.353",
|
|
56
56
|
"@teambit/design.ui.pages.server-error": "0.0.353",
|
|
57
|
-
"@teambit/compositions": "0.0.
|
|
58
|
-
"@teambit/deprecation": "0.0.
|
|
59
|
-
"@teambit/envs": "0.0.
|
|
57
|
+
"@teambit/compositions": "0.0.658",
|
|
58
|
+
"@teambit/deprecation": "0.0.658",
|
|
59
|
+
"@teambit/envs": "0.0.658",
|
|
60
60
|
"@teambit/component.ui.version-dropdown": "0.0.492",
|
|
61
|
-
"@teambit/lanes.ui.lanes": "0.0.
|
|
61
|
+
"@teambit/lanes.ui.lanes": "0.0.4",
|
|
62
|
+
"@teambit/ui-foundation.ui.full-loader": "0.0.486",
|
|
62
63
|
"@teambit/ui-foundation.ui.use-box.dropdown": "0.0.111",
|
|
63
64
|
"@teambit/ui-foundation.ui.react-router.extend-path": "0.0.486"
|
|
64
65
|
},
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|
|
81
82
|
"@apollo/client": "^3.0.0",
|
|
82
|
-
"@teambit/legacy": "1.0.
|
|
83
|
+
"@teambit/legacy": "1.0.227",
|
|
83
84
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
84
85
|
"react": "^16.8.0 || ^17.0.0"
|
|
85
86
|
},
|
|
@@ -107,7 +108,7 @@
|
|
|
107
108
|
"react": "-"
|
|
108
109
|
},
|
|
109
110
|
"peerDependencies": {
|
|
110
|
-
"@teambit/legacy": "1.0.
|
|
111
|
+
"@teambit/legacy": "1.0.227",
|
|
111
112
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
112
113
|
"react": "^16.8.0 || ^17.0.0"
|
|
113
114
|
}
|
package/ui/menu/menu.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MainDropdown, MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
2
2
|
import { VersionDropdown } from '@teambit/component.ui.version-dropdown';
|
|
3
|
-
import { FullLoader } from '@teambit/
|
|
3
|
+
import { FullLoader } from '@teambit/ui-foundation.ui.full-loader';
|
|
4
4
|
import type { ConsumeMethod } from '@teambit/ui-foundation.ui.use-box.menu';
|
|
5
5
|
import { useLocation } from '@teambit/base-ui.routing.routing-provider';
|
|
6
6
|
import { compact, flatten, groupBy } from 'lodash';
|
|
Binary file
|