@teambit/component 0.0.696 → 0.0.697
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/dist/ui/menu/menu.js +1 -1
- package/dist/ui/menu/menu.js.map +1 -1
- package/package-tar/teambit-component-0.0.697.tgz +0 -0
- package/package.json +15 -15
- package/{preview-1648783740851.js → preview-1648869766450.js} +2 -2
- package/ui/menu/menu.tsx +4 -1
- package/package-tar/teambit-component-0.0.696.tgz +0 -0
package/dist/ui/menu/menu.js
CHANGED
|
@@ -225,7 +225,7 @@ function VersionRelatedDropdowns({
|
|
|
225
225
|
const snaps = (0, _react().useMemo)(() => {
|
|
226
226
|
return (logs || []).filter(log => !log.tag).map(snap => _objectSpread(_objectSpread({}, snap), {}, {
|
|
227
227
|
version: snap.hash
|
|
228
|
-
}));
|
|
228
|
+
})).reverse();
|
|
229
229
|
}, [logs]);
|
|
230
230
|
const tags = (0, _react().useMemo)(() => {
|
|
231
231
|
var _component$tags;
|
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","viewedLane","logs","isWorkspace","snaps","filter","log","tag","map","snap","version","hash","tagLookup","Map","forEach","set","toArray","
|
|
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","viewedLane","logs","isWorkspace","snaps","filter","log","tag","map","snap","version","hash","reverse","tagLookup","Map","forEach","set","toArray","get","lanes","getLanesByComponentId","id","localVersion","currentVersion","search","includes","methods","useConsum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AEE,IAAA,SAAS,EAAExC,sBAAOyC,MAFpB;AAGE,IAAA,IAAI,eAAE,+BAAC,6BAAD;AAAoB,MAAA,OAAO,EAAEH,OAA7B;AAAsC,MAAA,aAAa,EAAEzC,SAAS,CAACoC,EAAV,CAAaS;AAAlE;AAHR,IAFJ,eAQE,+BAAC,8BAAD;AACE,IAAA,IAAI,EAAEjC,IADR;AAEE,IAAA,KAAK,EAAEO,KAFT;AAGE,IAAA,KAAK,EAAEe,KAHT;AAIE,IAAA,YAAY,EAAEG,YAJhB;AAKE,IAAA,cAAc,EAAEC,cALlB;AAME,IAAA,aAAa,EAAEtC,SAAS,CAAC8C,MAN3B;AAOE,IAAA,WAAW,EAAE/B;AAPf,IARF,CADF;AAoBD;;AAED,SAAS2B,iBAAT,CACEjC,cADF,EAEEsC,cAFF,EAGEhC,WAHF,EAImB;AACjB,SAAO,sBACL,MACE,uBAAQN,cAAc,CAACP,MAAf,EAAR,EACGqB,GADH,CACQyB,MAAD,IAAY;AACf,WAAOA,MAAP,aAAOA,MAAP,uBAAOA,MAAM,CAAGD,cAAH,EAAmB;AAAEhC,MAAAA;AAAF,KAAnB,CAAb;AACD,GAHH,EAIGK,MAJH,CAIW6B,CAAD,IAAO,CAAC,CAACA,CAAF,IAAOA,CAAC,CAACC,SAAT,IAAsBD,CAAC,CAACE,KAJzC,CAFG,EAOL,CAAC1C,cAAD,EAAiBsC,cAAjB,EAAiChC,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 { flatten, groupBy, compact } 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 { LegacyComponentLog } from '@teambit/legacy-component-log';\nimport type { ComponentModel } from '../component-model';\nimport { useComponent } from '../use-component';\nimport { MenuNav } from './menu-nav';\nimport { MobileMenuNav } from './mobile-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 <MobileMenuNav navigationSlot={navigationSlot} widgetSlot={widgetSlot} />\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?.viewedLane;\n const { logs } = component;\n const isWorkspace = host === 'teambit.workspace/workspace';\n\n const snaps = useMemo(() => {\n return (logs || [])\n .filter((log) => !log.tag)\n .map((snap) => ({ ...snap, version: snap.hash }))\n .reverse();\n }, [logs]);\n\n const tags = useMemo(() => {\n const tagLookup = new Map<string, LegacyComponentLog>();\n (logs || [])\n .filter((log) => log.tag)\n .forEach((tag) => {\n tagLookup.set(tag?.tag as string, tag);\n });\n return compact(\n component.tags\n ?.toArray()\n .reverse()\n .map((tag) => tagLookup.get(tag.version.version))\n ).map((tag) => ({ ...tag, version: tag.tag as string }));\n }, [logs]);\n\n const lanes = lanesContext?.getLanesByComponentId(component.id) || [];\n const localVersion = 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 {tags.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\n tags={tags}\n snaps={snaps}\n lanes={lanes}\n localVersion={localVersion}\n currentVersion={currentVersion}\n latestVersion={component.latest}\n currentLane={currentLane}\n />\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.697",
|
|
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.697"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/any-fs": "0.0.5",
|
|
@@ -32,41 +32,41 @@
|
|
|
32
32
|
"@teambit/design.inputs.dropdown": "0.0.7",
|
|
33
33
|
"@teambit/component-id": "0.0.402",
|
|
34
34
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.488",
|
|
35
|
-
"@teambit/aspect-loader": "0.0.
|
|
35
|
+
"@teambit/aspect-loader": "0.0.697",
|
|
36
36
|
"@teambit/legacy-bit-id": "0.0.399",
|
|
37
37
|
"@teambit/toolbox.string.capitalize": "0.0.483",
|
|
38
38
|
"@teambit/cli": "0.0.465",
|
|
39
39
|
"@teambit/config": "0.0.478",
|
|
40
40
|
"@teambit/express": "0.0.561",
|
|
41
|
-
"@teambit/graphql": "0.0.
|
|
41
|
+
"@teambit/graphql": "0.0.697",
|
|
42
42
|
"@teambit/bit-error": "0.0.394",
|
|
43
|
-
"@teambit/command-bar": "0.0.
|
|
44
|
-
"@teambit/preview": "0.0.
|
|
45
|
-
"@teambit/pubsub": "0.0.
|
|
43
|
+
"@teambit/command-bar": "0.0.697",
|
|
44
|
+
"@teambit/preview": "0.0.697",
|
|
45
|
+
"@teambit/pubsub": "0.0.697",
|
|
46
46
|
"@teambit/ui-foundation.ui.is-browser": "0.0.486",
|
|
47
47
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.486",
|
|
48
48
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.488",
|
|
49
49
|
"@teambit/ui-foundation.ui.use-box.menu": "0.0.114",
|
|
50
|
-
"@teambit/ui": "0.0.
|
|
50
|
+
"@teambit/ui": "0.0.697",
|
|
51
51
|
"@teambit/component-issues": "0.0.49",
|
|
52
52
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.487",
|
|
53
53
|
"@teambit/cli-table": "0.0.33",
|
|
54
54
|
"@teambit/component-descriptor": "0.0.29",
|
|
55
|
-
"@teambit/lanes.ui.lanes": "0.0.
|
|
55
|
+
"@teambit/lanes.ui.lanes": "0.0.31",
|
|
56
56
|
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.486",
|
|
57
57
|
"@teambit/design.ui.empty-box": "0.0.353",
|
|
58
58
|
"@teambit/harmony.ui.aspect-box": "0.0.486",
|
|
59
59
|
"@teambit/design.ui.pages.not-found": "0.0.354",
|
|
60
60
|
"@teambit/design.ui.pages.server-error": "0.0.354",
|
|
61
|
-
"@teambit/compositions": "0.0.
|
|
62
|
-
"@teambit/deprecation": "0.0.
|
|
63
|
-
"@teambit/envs": "0.0.
|
|
61
|
+
"@teambit/compositions": "0.0.697",
|
|
62
|
+
"@teambit/deprecation": "0.0.697",
|
|
63
|
+
"@teambit/envs": "0.0.697",
|
|
64
64
|
"@teambit/legacy-component-log": "0.0.392",
|
|
65
|
-
"@teambit/
|
|
65
|
+
"@teambit/ui-foundation.ui.react-router.extend-path": "0.0.486",
|
|
66
|
+
"@teambit/component.ui.version-dropdown": "0.0.516",
|
|
66
67
|
"@teambit/ui-foundation.ui.full-loader": "0.0.486",
|
|
67
68
|
"@teambit/ui-foundation.ui.use-box.dropdown": "0.0.114",
|
|
68
|
-
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.487"
|
|
69
|
-
"@teambit/ui-foundation.ui.react-router.extend-path": "0.0.486"
|
|
69
|
+
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.487"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/react": "^17.0.8",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.697/dist/component.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.697/dist/component.docs.mdx')]
|
package/ui/menu/menu.tsx
CHANGED
|
@@ -77,7 +77,10 @@ function VersionRelatedDropdowns({
|
|
|
77
77
|
const isWorkspace = host === 'teambit.workspace/workspace';
|
|
78
78
|
|
|
79
79
|
const snaps = useMemo(() => {
|
|
80
|
-
return (logs || [])
|
|
80
|
+
return (logs || [])
|
|
81
|
+
.filter((log) => !log.tag)
|
|
82
|
+
.map((snap) => ({ ...snap, version: snap.hash }))
|
|
83
|
+
.reverse();
|
|
81
84
|
}, [logs]);
|
|
82
85
|
|
|
83
86
|
const tags = useMemo(() => {
|
|
Binary file
|