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EAAkBsB,aAAa,CAACC,CAAAA,EAAAA,EAAAA,EAAAA,EAAsBH,EAAI,CAAEV,KAAAA,CAAK,IACjEC,EAAea,gBAAgB,CAAC/B,EAAiB2B,EAAE,CAAEA,EACvD,GACCK,KAAK,CAACC,IACLC,QAAQC,KAAK,CAACF,EAChB,EACJ,EAAG,CAAC1B,EAAmBP,EAAkBkB,EAAgBE,EAAK,EAE9D,MACE,uB,UACE,UAACgB,EAAAA,CAASA,CAAAA,CAACpB,MAAOlB,EAAE,WAAc,E,GAClC,UAACuC,EAAAA,CAAQA,CAAAA,CAAChD,KAAK,Y,GACf,UAACiD,EAAAA,EAAUA,CAAAA,C,SACT,UAACxD,EAAmBA,CAClBC,cAAe,CAACqB,EAChBpB,mBAAoBwC,C,KAGxB,UAACe,EAAAA,EAAQA,CAAAA,C,SACP,UAACC,MAAAA,CAAIhD,UCrEK,U,SDsEPoB,EAAgB6B,MAAM,CAAG,EACxB,UAACC,EAAAA,EAAyBA,CAAAA,CACxBjC,YAAaA,EACbG,gBAAiBA,EACjB+B,iCAAkCtC,EAClCgB,KAAMA,EACNG,uBAAwBA,C,GAG1B,UAACoB,EAAAA,EAAmBA,CAAAA,CAClBC,QACE,UAACC,EAAAA,EAAoBA,CAAAA,CACnBzB,KAAMA,EACN0B,SAAUvB,C,WAS5B,EAEawB,EAAY,IAChB,UAACnD,EAAAA,CAAAA,E","sources":["webpack://@affine/web/../core/src/pages/workspace/all-collection/header.tsx","webpack://@affine/web/../core/src/pages/workspace/all-collection/header.css.ts","webpack://@affine/web/../core/src/pages/workspace/all-collection/index.tsx","webpack://@affine/web/../core/src/pages/workspace/all-collection/index.css.ts"],"sourcesContent":["import { IconButton } from '@affine/component';\nimport { Header } from '@affine/core/components/pure/header';\nimport { WorkspaceModeFilterTab } from '@affine/core/components/pure/workspace-mode-filter-tab';\nimport { PlusIcon } from '@blocksuite/icons/rc';\nimport clsx from 'clsx';\n\nimport * as styles from './header.css';\n\nexport const AllCollectionHeader = ({\n showCreateNew,\n onCreateCollection,\n}: {\n showCreateNew: boolean;\n onCreateCollection?: () => void;\n}) => {\n return (\n }\n onClick={onCreateCollection}\n className={clsx(\n styles.headerCreateNewCollectionIconButton,\n !showCreateNew && styles.headerCreateNewButtonHidden\n )}\n />\n }\n center={}\n />\n );\n};\n","import \"../core/src/pages/workspace/all-collection/header.css.ts.vanilla.css!=!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/pages/workspace/all-collection/header.css.ts.vanilla.css\\\",\\\"source\\\":\\\"Ll8zc2psamowIHsKICB3aWR0aDogMzJweDsKICBoZWlnaHQ6IDMycHg7CiAgYm9yZGVyLXJhZGl1czogOHB4OwogIHRyYW5zaXRpb246IGFsbCAwLjFzIGVhc2UtaW4tb3V0Owp9Ci5fM3NqbGpqMSB7CiAgb3BhY2l0eTogMDsKICBwb2ludGVyLWV2ZW50czogbm9uZTsKfQ==\\\"}!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var headerCreateNewButtonHidden = '_3sjljj1';\nexport var headerCreateNewCollectionIconButton = '_3sjljj0';","import type { CollectionMeta } from '@affine/core/components/page-list';\nimport {\n CollectionListHeader,\n createEmptyCollection,\n useEditCollectionName,\n VirtualizedCollectionList,\n} from '@affine/core/components/page-list';\nimport { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';\nimport {\n ViewIcon,\n ViewTitle,\n} from '@affine/core/modules/workbench/view/view-meta';\nimport { useI18n } from '@affine/i18n';\nimport { useLiveData, useService, WorkspaceService } from '@toeverything/infra';\nimport { nanoid } from 'nanoid';\nimport { useCallback, useMemo, useState } from 'react';\n\nimport { CollectionService } from '../../../modules/collection';\nimport { ViewBody, ViewHeader } from '../../../modules/workbench';\nimport { EmptyCollectionList } from '../page-list-empty';\nimport { AllCollectionHeader } from './header';\nimport * as styles from './index.css';\n\nexport const AllCollection = () => {\n const t = useI18n();\n const currentWorkspace = useService(WorkspaceService).workspace;\n const [hideHeaderCreateNew, setHideHeaderCreateNew] = useState(true);\n\n const collectionService = useService(CollectionService);\n const collections = useLiveData(collectionService.collections$);\n\n const collectionMetas = useMemo(() => {\n const collectionsList: CollectionMeta[] = collections.map(collection => {\n return {\n ...collection,\n title: collection.name,\n };\n });\n return collectionsList;\n }, [collections]);\n\n const navigateHelper = useNavigateHelper();\n const { open, node } = useEditCollectionName({\n title: t['com.arms.editCollection.createCollection'](),\n showTips: true,\n });\n\n const handleCreateCollection = useCallback(() => {\n open('')\n .then(name => {\n const id = nanoid();\n collectionService.addCollection(createEmptyCollection(id, { name }));\n navigateHelper.jumpToCollection(currentWorkspace.id, id);\n })\n .catch(err => {\n console.error(err);\n });\n }, [collectionService, currentWorkspace, navigateHelper, open]);\n\n return (\n <>\n \n \n \n \n \n \n
\n {collectionMetas.length > 0 ? (\n \n ) : (\n \n }\n />\n )}\n
\n
\n \n );\n};\n\nexport const Component = () => {\n return ;\n};\n","import \"../core/src/pages/workspace/all-collection/index.css.ts.vanilla.css!=!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/pages/workspace/all-collection/index.css.ts.vanilla.css\\\",\\\"source\\\":\\\"LnRqOGoydDAgewogIGRpc3BsYXk6IGZsZXg7CiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjsKICBmbGV4OiAxOwogIGhlaWdodDogMTAwJTsKICB3aWR0aDogMTAwJTsKfQ==\\\"}!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var body = 'tj8j2t0';"],"names":["AllCollectionHeader","showCreateNew","onCreateCollection","Header","right","IconButton","size","icon","PlusIcon","onClick","className","clsx","center","WorkspaceModeFilterTab","activeFilter","AllCollection","t","useI18n","currentWorkspace","useService","WorkspaceService","workspace","hideHeaderCreateNew","setHideHeaderCreateNew","useState","collectionService","CollectionService","collections","useLiveData","collections$","collectionMetas","useMemo","map","collection","title","name","navigateHelper","useNavigateHelper","open","node","useEditCollectionName","showTips","handleCreateCollection","useCallback","then","id","nanoid","addCollection","createEmptyCollection","jumpToCollection","catch","err","console","error","ViewTitle","ViewIcon","ViewHeader","ViewBody","div","length","VirtualizedCollectionList","setHideHeaderCreateNewCollection","EmptyCollectionList","heading","CollectionListHeader","onCreate","Component"],"sourceRoot":""}