@teambit/workspace 0.0.742 → 0.0.745
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/workspace/workspace.js +4 -4
- package/dist/ui/workspace/workspace.js.map +1 -1
- package/dist/workspace.js +1 -2
- package/dist/workspace.js.map +1 -1
- package/dist/workspace.ui.runtime.d.ts +1 -3
- package/dist/workspace.ui.runtime.js +5 -6
- package/dist/workspace.ui.runtime.js.map +1 -1
- package/package-tar/teambit-workspace-0.0.745.tgz +0 -0
- package/package.json +38 -39
- package/{preview-1653535588073.js → preview-1653836960096.js} +2 -2
- package/ui/workspace/workspace.tsx +3 -4
- package/workspace.ui.runtime.tsx +5 -6
- package/package-tar/teambit-workspace-0.0.742.tgz +0 -0
|
@@ -207,10 +207,10 @@ function Workspace({
|
|
|
207
207
|
tooltipContent: `${isSidebarOpen ? 'Hide' : 'Show'} side panel`
|
|
208
208
|
})), /*#__PURE__*/_react().default.createElement(_baseUiSurfacesSplitPane().Pane, null, /*#__PURE__*/_react().default.createElement(_uiFoundationUiReactRouter().SlotRouter, {
|
|
209
209
|
slot: routeSlot
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
210
|
+
}, /*#__PURE__*/_react().default.createElement(_reactRouterDom().Route, {
|
|
211
|
+
index: true,
|
|
212
|
+
element: /*#__PURE__*/_react().default.createElement(_workspaceOverview().WorkspaceOverview, null)
|
|
213
|
+
}))))));
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
function useComponentNotifications() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Workspace","routeSlot","menuSlot","sidebar","workspaceUI","onSidebarTogglerChange","reactions","useComponentNotifications","workspace","useWorkspace","isSidebarOpen","handleSidebarToggle","useReducer","x","sidebarOpenness","Layout","row","right","styles","emptyContainer","setComponents","components","workspaceWrapper","topbar","name","icon","main","splitter","e","stopPropagation","notifications","useNotifications","useMemo","onComponentAdded","comps","notificationId","log","pluralize","length","map","comp","id","toString","join","setTimeout","dismiss","onComponentRemoved","ids"],"sources":["workspace.tsx"],"sourcesContent":["import 'reset-css';\nimport pluralize from 'pluralize';\nimport React, { useReducer, useMemo } from 'react';\nimport { Route } from 'react-router-dom';\nimport type { ComponentModel } from '@teambit/component';\nimport type { ComponentID } from '@teambit/component-id';\nimport { useNotifications } from '@teambit/ui-foundation.ui.notifications.notification-context';\nimport { RouteSlot, SlotRouter } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { Corner } from '@teambit/ui-foundation.ui.corner';\nimport { Collapser } from '@teambit/ui-foundation.ui.buttons.collapser';\nimport { SplitPane, Pane, Layout } from '@teambit/base-ui.surfaces.split-pane.split-pane';\nimport { HoverSplitter } from '@teambit/base-ui.surfaces.split-pane.hover-splitter';\nimport { TopBar } from '@teambit/ui-foundation.ui.top-bar';\n\nimport { useWorkspace } from './use-workspace';\nimport { WorkspaceOverview } from './workspace-overview';\nimport { WorkspaceProvider } from './workspace-provider';\nimport styles from './workspace.module.scss';\nimport WorkspaceUI from '../../workspace.ui.runtime';\n\nexport type WorkspaceProps = {\n routeSlot: RouteSlot;\n menuSlot: RouteSlot;\n sidebar: JSX.Element;\n workspaceUI: WorkspaceUI;\n onSidebarTogglerChange: (callback: () => void) => void;\n};\n\n/**\n * main workspace component.\n */\nexport function Workspace({ routeSlot, menuSlot, sidebar, workspaceUI, onSidebarTogglerChange }: WorkspaceProps) {\n const reactions = useComponentNotifications();\n const { workspace } = useWorkspace(reactions);\n\n const [isSidebarOpen, handleSidebarToggle] = useReducer((x) => !x, true);\n const sidebarOpenness = isSidebarOpen ? Layout.row : Layout.right;\n\n onSidebarTogglerChange(handleSidebarToggle);\n\n if (!workspace) {\n return <div className={styles.emptyContainer}></div>;\n }\n\n workspaceUI.setComponents(workspace.components);\n\n return (\n <WorkspaceProvider workspace={workspace}>\n <div className={styles.workspaceWrapper}>\n <TopBar\n className={styles.topbar}\n Corner={() => <Corner name={workspace.name} icon={workspace.icon} />}\n menu={menuSlot}\n />\n\n <SplitPane className={styles.main} size={264} layout={sidebarOpenness}>\n <Pane className={styles.sidebar}>{sidebar}</Pane>\n <HoverSplitter className={styles.splitter}>\n <Collapser\n isOpen={isSidebarOpen}\n onMouseDown={(e) => e.stopPropagation()} // avoid split-pane drag\n onClick={handleSidebarToggle}\n tooltipContent={`${isSidebarOpen ? 'Hide' : 'Show'} side panel`}\n />\n </HoverSplitter>\n <Pane>\n <SlotRouter slot={routeSlot}
|
|
1
|
+
{"version":3,"names":["Workspace","routeSlot","menuSlot","sidebar","workspaceUI","onSidebarTogglerChange","reactions","useComponentNotifications","workspace","useWorkspace","isSidebarOpen","handleSidebarToggle","useReducer","x","sidebarOpenness","Layout","row","right","styles","emptyContainer","setComponents","components","workspaceWrapper","topbar","name","icon","main","splitter","e","stopPropagation","notifications","useNotifications","useMemo","onComponentAdded","comps","notificationId","log","pluralize","length","map","comp","id","toString","join","setTimeout","dismiss","onComponentRemoved","ids"],"sources":["workspace.tsx"],"sourcesContent":["import 'reset-css';\nimport pluralize from 'pluralize';\nimport React, { useReducer, useMemo } from 'react';\nimport { Route } from 'react-router-dom';\nimport type { ComponentModel } from '@teambit/component';\nimport type { ComponentID } from '@teambit/component-id';\nimport { useNotifications } from '@teambit/ui-foundation.ui.notifications.notification-context';\nimport { RouteSlot, SlotRouter } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { Corner } from '@teambit/ui-foundation.ui.corner';\nimport { Collapser } from '@teambit/ui-foundation.ui.buttons.collapser';\nimport { SplitPane, Pane, Layout } from '@teambit/base-ui.surfaces.split-pane.split-pane';\nimport { HoverSplitter } from '@teambit/base-ui.surfaces.split-pane.hover-splitter';\nimport { TopBar } from '@teambit/ui-foundation.ui.top-bar';\n\nimport { useWorkspace } from './use-workspace';\nimport { WorkspaceOverview } from './workspace-overview';\nimport { WorkspaceProvider } from './workspace-provider';\nimport styles from './workspace.module.scss';\nimport WorkspaceUI from '../../workspace.ui.runtime';\n\nexport type WorkspaceProps = {\n routeSlot: RouteSlot;\n menuSlot: RouteSlot;\n sidebar: JSX.Element;\n workspaceUI: WorkspaceUI;\n onSidebarTogglerChange: (callback: () => void) => void;\n};\n\n/**\n * main workspace component.\n */\nexport function Workspace({ routeSlot, menuSlot, sidebar, workspaceUI, onSidebarTogglerChange }: WorkspaceProps) {\n const reactions = useComponentNotifications();\n const { workspace } = useWorkspace(reactions);\n\n const [isSidebarOpen, handleSidebarToggle] = useReducer((x) => !x, true);\n const sidebarOpenness = isSidebarOpen ? Layout.row : Layout.right;\n\n onSidebarTogglerChange(handleSidebarToggle);\n\n if (!workspace) {\n return <div className={styles.emptyContainer}></div>;\n }\n\n workspaceUI.setComponents(workspace.components);\n\n return (\n <WorkspaceProvider workspace={workspace}>\n <div className={styles.workspaceWrapper}>\n <TopBar\n className={styles.topbar}\n Corner={() => <Corner name={workspace.name} icon={workspace.icon} />}\n menu={menuSlot}\n />\n\n <SplitPane className={styles.main} size={264} layout={sidebarOpenness}>\n <Pane className={styles.sidebar}>{sidebar}</Pane>\n <HoverSplitter className={styles.splitter}>\n <Collapser\n isOpen={isSidebarOpen}\n onMouseDown={(e) => e.stopPropagation()} // avoid split-pane drag\n onClick={handleSidebarToggle}\n tooltipContent={`${isSidebarOpen ? 'Hide' : 'Show'} side panel`}\n />\n </HoverSplitter>\n <Pane>\n <SlotRouter slot={routeSlot}>\n <Route index element={<WorkspaceOverview />} />\n </SlotRouter>\n </Pane>\n </SplitPane>\n </div>\n </WorkspaceProvider>\n );\n}\nfunction useComponentNotifications() {\n const notifications = useNotifications();\n\n // memo not really needed, but for peace of mind\n return useMemo(\n () => ({\n onComponentAdded: (comps: ComponentModel[]) => {\n const notificationId = notifications.log(\n `added ${pluralize('component', comps.length)}: ${comps.map((comp) => comp.id.toString()).join(', ')}`\n );\n setTimeout(() => notifications.dismiss(notificationId), 12 * 1000);\n },\n\n onComponentRemoved: (ids: ComponentID[]) => {\n const notificationId = notifications.log(\n `removed ${pluralize('component', ids.length)} ${ids.map((id) => id.toString()).join(', ')}`\n );\n setTimeout(() => notifications.dismiss(notificationId), 12 * 1000);\n },\n }),\n [notifications]\n );\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;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;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;AAWA;AACA;AACA;AACO,SAASA,SAAT,CAAmB;EAAEC,SAAF;EAAaC,QAAb;EAAuBC,OAAvB;EAAgCC,WAAhC;EAA6CC;AAA7C,CAAnB,EAA0G;EAC/G,MAAMC,SAAS,GAAGC,yBAAyB,EAA3C;EACA,MAAM;IAAEC;EAAF,IAAgB,IAAAC,4BAAA,EAAaH,SAAb,CAAtB;EAEA,MAAM,CAACI,aAAD,EAAgBC,mBAAhB,IAAuC,IAAAC,mBAAA,EAAYC,CAAD,IAAO,CAACA,CAAnB,EAAsB,IAAtB,CAA7C;EACA,MAAMC,eAAe,GAAGJ,aAAa,GAAGK,iCAAA,CAAOC,GAAV,GAAgBD,iCAAA,CAAOE,KAA5D;EAEAZ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AA,GAAtB,CADmC,CAGnC;;EACA,OAAO,IAAAC,gBAAA,EACL,OAAO;IACLC,gBAAgB,EAAGC,KAAD,IAA6B;MAC7C,MAAMC,cAAc,GAAGL,aAAa,CAACM,GAAd,CACpB,SAAQ,IAAAC,oBAAA,EAAU,WAAV,EAAuBH,KAAK,CAACI,MAA7B,CAAqC,KAAIJ,KAAK,CAACK,GAAN,CAAWC,IAAD,IAAUA,IAAI,CAACC,EAAL,CAAQC,QAAR,EAApB,EAAwCC,IAAxC,CAA6C,IAA7C,CAAmD,EADhF,CAAvB;MAGAC,UAAU,CAAC,MAAMd,aAAa,CAACe,OAAd,CAAsBV,cAAtB,CAAP,EAA8C,KAAK,IAAnD,CAAV;IACD,CANI;IAQLW,kBAAkB,EAAGC,GAAD,IAAwB;MAC1C,MAAMZ,cAAc,GAAGL,aAAa,CAACM,GAAd,CACpB,WAAU,IAAAC,oBAAA,EAAU,WAAV,EAAuBU,GAAG,CAACT,MAA3B,CAAmC,IAAGS,GAAG,CAACR,GAAJ,CAASE,EAAD,IAAQA,EAAE,CAACC,QAAH,EAAhB,EAA+BC,IAA/B,CAAoC,IAApC,CAA0C,EADtE,CAAvB;MAGAC,UAAU,CAAC,MAAMd,aAAa,CAACe,OAAd,CAAsBV,cAAtB,CAAP,EAA8C,KAAK,IAAnD,CAAV;IACD;EAbI,CAAP,CADK,EAgBL,CAACL,aAAD,CAhBK,CAAP;AAkBD"}
|
package/dist/workspace.js
CHANGED
|
@@ -2259,8 +2259,7 @@ needed-for: ${(neededFor === null || neededFor === void 0 ? void 0 : neededFor.t
|
|
|
2259
2259
|
copyPeerToRuntimeOnRoot: (_options$copyPeerToRu3 = options === null || options === void 0 ? void 0 : options.copyPeerToRuntimeOnRoot) !== null && _options$copyPeerToRu3 !== void 0 ? _options$copyPeerToRu3 : true,
|
|
2260
2260
|
copyPeerToRuntimeOnComponents: (_options$copyPeerToRu4 = options === null || options === void 0 ? void 0 : options.copyPeerToRuntimeOnComponents) !== null && _options$copyPeerToRu4 !== void 0 ? _options$copyPeerToRu4 : false,
|
|
2261
2261
|
dependencyFilterFn: depsFilterFn,
|
|
2262
|
-
overrides: this.dependencyResolver.config.overrides
|
|
2263
|
-
packageImportMethod: this.dependencyResolver.config.packageImportMethod
|
|
2262
|
+
overrides: this.dependencyResolver.config.overrides
|
|
2264
2263
|
};
|
|
2265
2264
|
await installer.install(this.path, mergedRootPolicy, compDirMap, {
|
|
2266
2265
|
installTeambitBit: false
|