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AQA,EAAKkkB,KAAK,SAY/D,CAVAje,CAAAA,EAAAA,EAAAA,SAAAA,EAAU,KACJlB,GAAOif,GACTwQ,EAAiBt1B,aAAa,CAACuG,cAAc,CAACC,WAAW,CACvDX,EAAImhB,aAAa,CAACvgB,eAAe,CACjC,GAGN,EAAG,CAAC6uB,EAAiBt1B,aAAa,CAACuG,cAAc,CAAEV,EAAKif,EAAU,EAG9D0Q,GAAgB,CAAC3vB,GACZ,UAACmwB,GAAAA,YAAYA,CAAAA,CAACC,aAAY,E,GAG9BpwB,EAKH,UAACqwB,EAAAA,EAAcA,CAAAA,CAACC,MAAOtwB,EAAIswB,KAAK,C,SAC9B,UAAC3E,GAAAA,CAAAA,E,GALI,UAAC4E,EAAAA,CAAkBA,CAAAA,CAAAA,EAAK,uBAQnC,EAEaC,GAAY,KACvBC,GAAAA,EAAuBA,CAACC,KAAK,CAAC,cAE9B,IAAMC,EAASC,CAAAA,EAAAA,EAAAA,CAAAA,IACTC,EAAcjoB,CAAAA,EAAAA,EAAAA,EAAAA,EAAWkoB,EAAAA,EAAiBA,EAEhD5vB,CAAAA,EAAAA,EAAAA,SAAAA,EAAU,KACR,GAAIyvB,EAAOv2B,MAAM,CAAE,CACjB,IAAMA,EAASu2B,EAAOv2B,MAAM,CAC5B22B,aAAaC,OAAO,CAAC,eAAgB52B,GAErCy2B,EAAYI,YAAY,CAAC72B,EAC3B,CACF,EAAG,CAACu2B,EAAQE,EAAY,EAExB,IAAMz2B,EAASu2B,EAAOv2B,MAAM,CAE5B,OAAOA,EAAS,UAACo1B,GAAAA,CAAWp1B,OAAQA,C,GAAa,IACnD,C","sources":["webpack://@affine/web/../core/src/hooks/use-block-suite-workspace-page-title.ts","webpack://@affine/web/../core/src/atoms/page-history.ts","webpack://@affine/web/../core/src/components/blocksuite/block-suite-mode-switch/style.css.ts","webpack://@affine/web/../core/src/components/blocksuite/block-suite-mode-switch/index.tsx","webpack://@affine/web/../core/src/components/affine/page-history-modal/data.ts","webpack://@affine/web/../core/src/components/affine/page-history-modal/empty-history-shape.tsx","webpack://@affine/web/../core/src/components/affine/page-history-modal/styles.css.ts","webpack://@affine/web/../core/src/components/affine/page-history-modal/history-modal.tsx","webpack://@affine/web/../core/src/components/pure/trash-page-footer/styles.css.ts","webpack://@affine/web/../core/src/components/pure/trash-page-footer/index.tsx","webpack://@affine/web/../component/src/components/affine-banner/browser-warning.tsx","webpack://@affine/web/../component/src/components/affine-banner/index.css.ts","webpack://@affine/web/../component/src/components/affine-banner/local-demo-tips.tsx","webpack://@affine/web/../core/src/components/top-tip.tsx","webpack://@affine/web/../core/src/hooks/affine/use-export-page.ts","webpack://@affine/web/../core/src/components/blocksuite/block-suite-header/favorite/index.tsx","webpack://@affine/web/../core/src/components/blocksuite/block-suite-header/info/index.tsx","webpack://@affine/web/../core/src/components/blocksuite/block-suite-header/journal/date-picker.tsx","webpack://@affine/web/../core/src/components/blocksuite/block-suite-header/journal/today-button.tsx","webpack://@affine/web/../core/src/components/affine/share-page-modal/share-menu/index.css.ts","webpack://@affine/web/../core/src/hooks/affine/use-share-url.ts","webpack://@affine/web/../core/src/components/affine/share-page-modal/share-menu/share-export.tsx","webpack://@affine/web/../core/src/components/affine/share-page-modal/share-menu/share-page.tsx","webpack://@affine/web/../core/src/components/affine/share-page-modal/share-menu/share-menu.tsx","webpack://@affine/web/../core/src/pages/workspace/detail-page/use-header-responsive.ts","webpack://@affine/web/../core/src/components/pure/header-drop-down-button/index.tsx","webpack://@affine/web/../core/src/components/pure/header-drop-down-button/styles.css.ts","webpack://@affine/web/../core/src/components/blocksuite/block-suite-header/menu/index.tsx","webpack://@affine/web/../core/src/components/blocksuite/block-suite-header/present/detail-header-present-button.tsx","webpack://@affine/web/../core/src/components/affine/share-page-modal/index.tsx","webpack://@affine/web/../core/src/pages/workspace/detail-page/detail-page-header.css.ts","webpack://@affine/web/../core/src/pages/workspace/detail-page/detail-page-header.tsx","webpack://@affine/web/../core/src/hooks/affine/use-register-copy-link-commands.tsx","webpack://@affine/web/../core/src/pages/workspace/detail-page/tabs/journal.css.ts","webpack://@affine/web/../core/src/pages/workspace/detail-page/tabs/journal.tsx","webpack://@affine/web/../core/src/pages/workspace/detail-page/tabs/outline.tsx","webpack://@affine/web/../core/src/pages/workspace/detail-page/tabs/outline.css.ts","webpack://@affine/web/../core/src/pages/workspace/detail-page/detail-page.tsx","webpack://@affine/web/../core/src/hooks/affine/use-register-blocksuite-editor-commands.tsx","webpack://@affine/web/../core/src/pages/workspace/detail-page/detail-page.css.ts"],"sourcesContent":["import { assertExists } from '@blocksuite/global/utils';\nimport type { DocCollection } from '@blocksuite/store';\nimport type { Atom } from 'jotai';\nimport { atom, useAtomValue } from 'jotai';\nimport { useCallback } from 'react';\n\nimport { useJournalHelper, useJournalInfoHelper } from './use-journal';\n\nconst weakMap = new WeakMap>>();\n\nfunction getAtom(w: DocCollection, pageId: string): Atom {\n if (!weakMap.has(w)) {\n weakMap.set(w, new Map());\n }\n const map = weakMap.get(w);\n assertExists(map);\n if (!map.has(pageId)) {\n const baseAtom = atom(w.getDoc(pageId)?.meta?.title || 'Untitled');\n baseAtom.onMount = set => {\n const disposable = w.meta.docMetaUpdated.on(() => {\n const page = w.getDoc(pageId);\n set(page?.meta?.title || 'Untitled');\n });\n return () => {\n disposable.dispose();\n };\n };\n map.set(pageId, baseAtom);\n return baseAtom;\n } else {\n return map.get(pageId) as Atom;\n }\n}\n\nexport function useDocCollectionPageTitle(\n docCollection: DocCollection,\n pageId: string\n) {\n const titleAtom = getAtom(docCollection, pageId);\n assertExists(titleAtom);\n const title = useAtomValue(titleAtom);\n const { localizedJournalDate } = useJournalInfoHelper(docCollection, pageId);\n return localizedJournalDate || title;\n}\n\n// This hook is NOT reactive to the page title change\nexport function useGetDocCollectionPageTitle(docCollection: DocCollection) {\n const { getLocalizedJournalDateString } = useJournalHelper(docCollection);\n return useCallback(\n (pageId: string) => {\n return (\n getLocalizedJournalDateString(pageId) ||\n docCollection.getDoc(pageId)?.meta?.title\n );\n },\n [docCollection, getLocalizedJournalDateString]\n );\n}\n","import { atom } from 'jotai';\n\n// make page history controllable by atom to make it easier to use in CMDK\nexport const pageHistoryModalAtom = atom({\n open: false,\n pageId: '',\n});\n","import \"../core/src/components/blocksuite/block-suite-mode-switch/style.css.ts.vanilla.css!=!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/components/blocksuite/block-suite-mode-switch/style.css.ts.vanilla.css\\\",\\\"source\\\":\\\"Ll8yY3Q1ZjYwIHsKICB3aWR0aDogMjRweDsKICBoZWlnaHQ6IDI0cHg7Cn0KLl8yY3Q1ZjYwIHN2ZyBwYXRoIHsKICBzdHJva2U6IGN1cnJlbnRDb2xvcjsKfQ==\\\"}!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var switchItem = '_2ct5f60';","import { RadioGroup, type RadioItem, toast, Tooltip } from '@affine/component';\nimport { registerAffineCommand } from '@affine/core/commands';\nimport { track } from '@affine/core/mixpanel';\nimport { useI18n } from '@affine/i18n';\nimport { EdgelessIcon, PageIcon } from '@blocksuite/icons/rc';\nimport {\n type DocMode,\n DocsService,\n useLiveData,\n useService,\n} from '@toeverything/infra';\nimport { useCallback, useEffect, useMemo } from 'react';\n\nimport { switchItem } from './style.css';\nimport { EdgelessSwitchItem, PageSwitchItem } from './switch-items';\n\nexport interface EditorModeSwitchProps {\n pageId: string;\n isPublic?: boolean;\n publicMode?: DocMode;\n}\n\nconst EdgelessRadioItem: RadioItem = {\n value: 'edgeless',\n label: ,\n testId: 'switch-edgeless-mode-button',\n className: switchItem,\n};\nconst PageRadioItem: RadioItem = {\n value: 'page',\n label: ,\n testId: 'switch-page-mode-button',\n className: switchItem,\n};\n\nexport const EditorModeSwitch = ({\n pageId,\n isPublic,\n publicMode,\n}: EditorModeSwitchProps) => {\n const t = useI18n();\n const docsService = useService(DocsService);\n const doc = useLiveData(docsService.list.doc$(pageId));\n const trash = useLiveData(doc?.trash$);\n const currentMode = useLiveData(doc?.mode$);\n\n const togglePage = useCallback(() => {\n if (currentMode === 'page' || isPublic || trash) return;\n doc?.setMode('page');\n toast(t['com.arms.toastMessage.pageMode']());\n track.$.header.actions.switchPageMode({ mode: 'page' });\n }, [currentMode, doc, isPublic, t, trash]);\n\n const toggleEdgeless = useCallback(() => {\n if (currentMode === 'edgeless' || isPublic || trash) return;\n doc?.setMode('edgeless');\n toast(t['com.arms.toastMessage.edgelessMode']());\n track.$.header.actions.switchPageMode({ mode: 'edgeless' });\n }, [currentMode, doc, isPublic, t, trash]);\n\n const onModeChange = useCallback(\n (mode: DocMode) => {\n mode === 'page' ? togglePage() : toggleEdgeless();\n },\n [toggleEdgeless, togglePage]\n );\n\n const shouldHide = useCallback(\n (mode: DocMode) =>\n (trash && currentMode !== mode) || (isPublic && publicMode !== mode),\n [currentMode, isPublic, publicMode, trash]\n );\n\n useEffect(() => {\n if (trash || isPublic || currentMode === undefined) return;\n return registerAffineCommand({\n id: 'affine:doc-mode-switch',\n category: 'editor:page',\n label:\n currentMode === 'page'\n ? t['com.arms.cmdk.switch-to-edgeless']()\n : t['com.arms.cmdk.switch-to-page'](),\n icon: currentMode === 'page' ? : ,\n keyBinding: {\n binding: 'Alt+KeyS',\n capture: true,\n },\n run: () => onModeChange(currentMode === 'edgeless' ? 'page' : 'edgeless'),\n });\n }, [currentMode, isPublic, onModeChange, t, trash]);\n\n return (\n \n
\n \n
\n \n );\n};\n\nexport interface PureEditorModeSwitchProps {\n mode?: DocMode;\n setMode: (mode: DocMode) => void;\n hidePage?: boolean;\n hideEdgeless?: boolean;\n}\n\nexport const PureEditorModeSwitch = ({\n mode,\n setMode,\n hidePage,\n hideEdgeless,\n}: PureEditorModeSwitchProps) => {\n const items = useMemo(\n () => [\n ...(hidePage ? [] : [PageRadioItem]),\n ...(hideEdgeless ? [] : [EdgelessRadioItem]),\n ],\n [hideEdgeless, hidePage]\n );\n return (\n \n );\n};\n","import { useDocMetaHelper } from '@affine/core/hooks/use-block-suite-page-meta';\nimport { useDocCollectionPage } from '@affine/core/hooks/use-block-suite-workspace-page';\nimport { DebugLogger } from '@affine/debug';\nimport type { ListHistoryQuery } from '@affine/graphql';\nimport { listHistoryQuery, recoverDocMutation } from '@affine/graphql';\nimport { i18nTime } from '@affine/i18n';\nimport { assertEquals } from '@blocksuite/global/utils';\nimport { DocCollection } from '@blocksuite/store';\nimport { globalBlockSuiteSchema } from '@toeverything/infra';\nimport { useEffect, useMemo } from 'react';\nimport useSWRImmutable from 'swr/immutable';\nimport {\n applyUpdate,\n Doc as YDoc,\n encodeStateAsUpdate,\n encodeStateVector,\n UndoManager,\n} from 'yjs';\n\nimport {\n useMutateQueryResource,\n useMutation,\n} from '../../../hooks/use-mutation';\nimport { useQueryInfinite } from '../../../hooks/use-query';\nimport { CloudBlobStorage } from '../../../modules/workspace-engine/impls/engine/blob-cloud';\n\nconst logger = new DebugLogger('page-history');\n\ntype DocHistory = ListHistoryQuery['workspace']['histories'][number];\n\nexport const useDocSnapshotList = (workspaceId: string, pageDocId: string) => {\n const pageSize = 10;\n const { data, loadingMore, loadMore } = useQueryInfinite({\n query: listHistoryQuery,\n getVariables: (_, previousPageData) => {\n // use the timestamp of the last history as the cursor\n const before = previousPageData?.workspace.histories.at(-1)?.timestamp;\n const vars = {\n pageDocId: pageDocId,\n workspaceId: workspaceId,\n before: before,\n take: pageSize,\n };\n\n return vars;\n },\n });\n\n const shouldLoadMore = useMemo(() => {\n if (!data) {\n return false;\n }\n const lastPage = data.at(-1);\n if (!lastPage) {\n return false;\n }\n return lastPage.workspace.histories.length === pageSize;\n }, [data]);\n\n const histories = useMemo(() => {\n if (!data) {\n return [];\n }\n return data.flatMap(page => page.workspace.histories);\n }, [data]);\n\n return [histories, shouldLoadMore ? loadMore : false, !!loadingMore] as const;\n};\n\nconst snapshotFetcher = async (\n [workspaceId, pageDocId, ts]: [\n workspaceId: string,\n pageDocId: string,\n ts: string,\n ] // timestamp is the key to the history/snapshot\n) => {\n if (!ts) {\n return null;\n }\n const res = await fetch(\n `/api/workspaces/${workspaceId}/docs/${pageDocId}/histories/${ts}`\n );\n\n if (!res.ok) {\n throw new Error('Failed to fetch snapshot');\n }\n\n const snapshot = await res.arrayBuffer();\n if (!snapshot) {\n throw new Error('Invalid snapshot');\n }\n return snapshot;\n};\n\n// attach the Page shown in the modal to a temporary workspace\n// so that we do not need to worry about providers etc\n// TODO(@Peng): fix references to the page (the referenced page will shown as deleted)\n// if we simply clone the current workspace, it maybe time consuming right?\nconst docCollectionMap = new Map();\n\n// assume the workspace is a cloud workspace since the history feature is only enabled for cloud workspace\nconst getOrCreateShellWorkspace = (workspaceId: string) => {\n let docCollection = docCollectionMap.get(workspaceId);\n if (!docCollection) {\n const blobStorage = new CloudBlobStorage(workspaceId);\n docCollection = new DocCollection({\n id: workspaceId,\n blobSources: {\n main: blobStorage,\n },\n schema: globalBlockSuiteSchema,\n disableBacklinkIndex: true,\n disableSearchIndex: true,\n });\n docCollectionMap.set(workspaceId, docCollection);\n docCollection.doc.emit('sync', [true, docCollection.doc]);\n }\n return docCollection;\n};\n\n// workspace id + page id + timestamp -> snapshot (update binary)\nexport const usePageHistory = (\n workspaceId: string,\n pageDocId: string,\n ts?: string\n) => {\n // snapshot should be immutable. so we use swr immutable to disable revalidation\n const { data } = useSWRImmutable(\n [workspaceId, pageDocId, ts],\n {\n fetcher: snapshotFetcher,\n suspense: false,\n }\n );\n return data ?? undefined;\n};\n\n// workspace id + page id + timestamp + snapshot -> Page (to be used for rendering in blocksuite editor)\nexport const useSnapshotPage = (\n docCollection: DocCollection,\n pageDocId: string,\n ts?: string\n) => {\n const snapshot = usePageHistory(docCollection.id, pageDocId, ts);\n const page = useMemo(() => {\n if (!ts) {\n return;\n }\n const pageId = pageDocId + '-' + ts;\n const historyShellWorkspace = getOrCreateShellWorkspace(docCollection.id);\n let page = historyShellWorkspace.getDoc(pageId);\n if (!page && snapshot) {\n page = historyShellWorkspace.createDoc({\n id: pageId,\n });\n page.awarenessStore.setReadonly(page.blockCollection, true);\n const spaceDoc = page.spaceDoc;\n page.load(() => {\n applyUpdate(spaceDoc, new Uint8Array(snapshot));\n historyShellWorkspace.schema.upgradeDoc(0, {}, spaceDoc);\n }); // must load before applyUpdate\n }\n return page ?? undefined;\n }, [pageDocId, snapshot, ts, docCollection]);\n\n useEffect(() => {\n const historyShellWorkspace = getOrCreateShellWorkspace(docCollection.id);\n // apply the rootdoc's update to the current workspace\n // this makes sure the page reference links are not deleted ones in the preview\n const update = encodeStateAsUpdate(docCollection.doc);\n applyUpdate(historyShellWorkspace.doc, update);\n }, [docCollection]);\n\n return page;\n};\n\nexport const historyListGroupByDay = (histories: DocHistory[]) => {\n const map = new Map();\n for (const history of histories) {\n const day = i18nTime(history.timestamp, {\n relative: {\n max: [1, 'week'],\n accuracy: 'day',\n weekday: true,\n },\n absolute: {\n accuracy: 'day',\n noYear: true,\n },\n });\n const list = map.get(day) ?? [];\n list.push(history);\n map.set(day, list);\n }\n return [...map.entries()];\n};\n\nexport function revertUpdate(\n doc: YDoc,\n snapshotUpdate: Uint8Array,\n getMetadata: (key: string) => 'Text' | 'Map' | 'Array'\n) {\n const snapshotDoc = new YDoc();\n applyUpdate(snapshotDoc, snapshotUpdate);\n\n const currentStateVector = encodeStateVector(doc);\n const snapshotStateVector = encodeStateVector(snapshotDoc);\n\n const changesSinceSnapshotUpdate = encodeStateAsUpdate(\n doc,\n snapshotStateVector\n );\n const undoManager = new UndoManager(\n [...snapshotDoc.share.keys()].map(key => {\n const type = getMetadata(key);\n if (type === 'Text') {\n return snapshotDoc.getText(key);\n } else if (type === 'Map') {\n return snapshotDoc.getMap(key);\n } else if (type === 'Array') {\n return snapshotDoc.getArray(key);\n }\n throw new Error('Unknown type');\n })\n );\n applyUpdate(snapshotDoc, changesSinceSnapshotUpdate);\n undoManager.undo();\n const revertChangesSinceSnapshotUpdate = encodeStateAsUpdate(\n snapshotDoc,\n currentStateVector\n );\n applyUpdate(doc, revertChangesSinceSnapshotUpdate);\n}\n\nexport const useRestorePage = (\n docCollection: DocCollection,\n pageId: string\n) => {\n const page = useDocCollectionPage(docCollection, pageId);\n const mutateQueryResource = useMutateQueryResource();\n const { trigger: recover, isMutating } = useMutation({\n mutation: recoverDocMutation,\n });\n const { getDocMeta, setDocTitle } = useDocMetaHelper(docCollection);\n\n const onRestore = useMemo(() => {\n return async (version: string, update: Uint8Array) => {\n if (!page) {\n return;\n }\n const pageDocId = page.spaceDoc.guid;\n revertUpdate(page.spaceDoc, update, key => {\n assertEquals(key, 'blocks'); // only expect this value is 'blocks'\n return 'Map';\n });\n\n // should also update the page title, since it may be changed in the history\n const title = page.meta?.title ?? '';\n\n if (getDocMeta(pageId)?.title !== title) {\n setDocTitle(pageId, title);\n }\n\n await recover({\n docId: pageDocId,\n timestamp: version,\n workspaceId: docCollection.id,\n });\n\n await mutateQueryResource(listHistoryQuery, vars => {\n return (\n vars.pageDocId === pageDocId && vars.workspaceId === docCollection.id\n );\n });\n\n logger.info('Page restored', pageDocId, version);\n };\n }, [\n getDocMeta,\n mutateQueryResource,\n page,\n pageId,\n recover,\n setDocTitle,\n docCollection.id,\n ]);\n\n return {\n onRestore,\n isMutating,\n };\n};\n","export const EmptyHistoryShape = () => (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);\n","import \"../core/src/components/affine/page-history-modal/styles.css.ts.vanilla.css!=!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/components/affine/page-history-modal/styles.css.ts.vanilla.css\\\",\\\"source\\\":\\\"#H4sIAAAAAAAAA81a3Y6jNhS+36ewRlppoo6RgZAfptP3qKqqcsAk3iGYGmeS2arvXgFOwGAz4cxcdG52Y8D+zvF3/nzs/bXNdu9VtET/fEMIY/2TxCgKystzf8yP0WozGAtiFCzJ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z4WGaci5eaVhy2rqPqybyLfpr4XaPVv+NTeFL04+H6nc86JL61w7NNqKJiHCO6bOjE3ZKYiz7y3H6tdSlghJW12eipTJnBfMmmXchNHXlpv9+w8ODucKUy8AAA==\\\"}!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var collapsedIcon = '_9fbys5t';\nexport var collapsedIconContainer = '_9fbys5u';\nexport var editor = '_9fbys5c';\nexport var emptyHistoryPrompt = '_9fbys5q';\nexport var emptyHistoryPromptDescription = '_9fbys5s';\nexport var emptyHistoryPromptTitle = '_9fbys5r';\nexport var historyFooter = '_9fbys5o';\nexport var historyItem = '_9fbys5l _9fbys5d';\nexport var historyItemGap = '_9fbys5m _9fbys5d';\nexport var historyItemGroup = '_9fbys5j';\nexport var historyItemGroupTitle = '_9fbys5k';\nexport var historyItemLoadMore = '_9fbys5n _9fbys5l _9fbys5d';\nexport var historyList = '_9fbys5f';\nexport var historyListHeader = '_9fbys5i';\nexport var historyListScrollable = '_9fbys5g';\nexport var historyListScrollableInner = '_9fbys5h';\nexport var loadingContainer = '_9fbys5e';\nexport var modalContent = '_9fbys55';\nexport var planPrompt = '_9fbys5w';\nexport var planPromptTitle = '_9fbys5x';\nexport var planPromptUpdateButton = '_9fbys5y';\nexport var planPromptWrapper = '_9fbys5v';\nexport var previewContainer = '_9fbys57';\nexport var previewContent = '_9fbys58';\nexport var previewHeader = '_9fbys59';\nexport var previewHeaderTimestamp = '_9fbys5b';\nexport var previewHeaderTitle = '_9fbys5a';\nexport var previewWrapper = '_9fbys56';\nexport var root = '_9fbys54';\nexport var rowWrapper = '_9fbys5d';\nexport var spacer = '_9fbys5p';","import { Loading, Scrollable } from '@affine/component';\nimport { EditorLoading } from '@affine/component/page-detail-skeleton';\nimport { Button, IconButton } from '@affine/component/ui/button';\nimport { Modal, useConfirmModal } from '@affine/component/ui/modal';\nimport { openSettingModalAtom } from '@affine/core/atoms';\nimport { useDocCollectionPageTitle } from '@affine/core/hooks/use-block-suite-workspace-page-title';\nimport { track } from '@affine/core/mixpanel';\nimport { WorkspacePermissionService } from '@affine/core/modules/permissions';\nimport { WorkspaceQuotaService } from '@affine/core/modules/quota';\nimport { i18nTime, Trans, useI18n } from '@affine/i18n';\nimport { CloseIcon, ToggleCollapseIcon } from '@blocksuite/icons/rc';\nimport type { Doc as BlockSuiteDoc, DocCollection } from '@blocksuite/store';\nimport * as Collapsible from '@radix-ui/react-collapsible';\nimport type { DialogContentProps } from '@radix-ui/react-dialog';\nimport {\n type DocMode,\n DocService,\n useLiveData,\n useService,\n WorkspaceService,\n} from '@toeverything/infra';\nimport { atom, useAtom, useSetAtom } from 'jotai';\nimport type { PropsWithChildren } from 'react';\nimport {\n Fragment,\n Suspense,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useState,\n} from 'react';\nimport { encodeStateAsUpdate } from 'yjs';\n\nimport { pageHistoryModalAtom } from '../../../atoms/page-history';\nimport { BlockSuiteEditor } from '../../blocksuite/block-suite-editor';\nimport { PureEditorModeSwitch } from '../../blocksuite/block-suite-mode-switch';\nimport { AffineErrorBoundary } from '../affine-error-boundary';\nimport {\n historyListGroupByDay,\n useDocSnapshotList,\n useRestorePage,\n useSnapshotPage,\n} from './data';\nimport { EmptyHistoryShape } from './empty-history-shape';\nimport * as styles from './styles.css';\n\nexport interface PageHistoryModalProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n docCollection: DocCollection;\n pageId: string;\n}\n\nconst contentOptions: DialogContentProps = {\n ['data-testid' as string]: 'page-history-modal',\n onPointerDownOutside: e => {\n e.preventDefault();\n },\n style: {\n padding: 0,\n maxWidth: 944,\n backgroundColor: 'var(--affine-background-primary-color)',\n overflow: 'hidden',\n },\n};\n\nconst ModalContainer = ({\n onOpenChange,\n open,\n children,\n}: PropsWithChildren<{\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}>) => {\n return (\n \n {children}\n \n );\n};\n\ninterface HistoryEditorPreviewProps {\n ts?: string;\n historyList: HistoryList;\n snapshotPage?: BlockSuiteDoc;\n mode: DocMode;\n onModeChange: (mode: DocMode) => void;\n title: string;\n}\n\nconst HistoryEditorPreview = ({\n ts,\n historyList,\n snapshotPage,\n onModeChange,\n mode,\n title,\n}: HistoryEditorPreviewProps) => {\n const onModeChangeWithTrack = useCallback(\n (mode: DocMode) => {\n track.$.docHistory.$.switchPageMode({ mode });\n onModeChange(mode);\n },\n [onModeChange]\n );\n\n const content = useMemo(() => {\n return (\n
\n
\n \n
{title}
\n
\n {ts\n ? i18nTime(ts, {\n absolute: { accuracy: 'minute', noDate: true },\n })\n : null}\n
\n
\n\n {snapshotPage ? (\n \n \n \n \n \n \n \n \n ) : (\n
\n \n
\n )}\n
\n );\n }, [mode, onModeChangeWithTrack, snapshotPage, title, ts]);\n\n return (\n
\n {historyList.map((_item, i) => {\n const historyIndex = historyList.findIndex(h => h.timestamp === ts);\n const distance = i - historyIndex;\n const flag =\n distance > 20\n ? '> 20'\n : distance < -20\n ? '< -20'\n : distance.toString();\n return (\n
\n {historyIndex === i ? content : null}\n
\n );\n })}\n
\n );\n};\nconst planPromptClosedAtom = atom(false);\n\nconst PlanPrompt = () => {\n const workspaceQuotaService = useService(WorkspaceQuotaService);\n useEffect(() => {\n workspaceQuotaService.quota.revalidate();\n }, [workspaceQuotaService]);\n const workspaceQuota = useLiveData(workspaceQuotaService.quota.quota$);\n const isProWorkspace = useMemo(() => {\n return workspaceQuota\n ? workspaceQuota.humanReadable.name.toLowerCase() !== 'free'\n : null;\n }, [workspaceQuota]);\n const permissionService = useService(WorkspacePermissionService);\n const isOwner = useLiveData(permissionService.permission.isOwner$);\n useEffect(() => {\n // revalidate permission\n permissionService.permission.revalidate();\n }, [permissionService]);\n\n const setSettingModalAtom = useSetAtom(openSettingModalAtom);\n const [planPromptClosed, setPlanPromptClosed] = useAtom(planPromptClosedAtom);\n\n const closeFreePlanPrompt = useCallback(() => {\n setPlanPromptClosed(true);\n }, [setPlanPromptClosed]);\n\n const onClickUpgrade = useCallback(() => {\n setSettingModalAtom({\n open: true,\n activeTab: 'plans',\n scrollAnchor: 'cloudPricingPlan',\n });\n track.$.docHistory.$.viewPlans();\n }, [setSettingModalAtom]);\n\n const t = useI18n();\n\n const planTitle = useMemo(() => {\n return (\n
\n {\n isProWorkspace !== null\n ? !isProWorkspace\n ? t[\n 'com.arms.history.confirm-restore-modal.plan-prompt.limited-title'\n ]()\n : t['com.arms.history.confirm-restore-modal.plan-prompt.title']()\n : '' /* TODO(@catsjuice): loading UI */\n }\n\n \n \n \n
\n );\n }, [closeFreePlanPrompt, isProWorkspace, t]);\n\n const planDescription = useMemo(() => {\n if (!isProWorkspace) {\n return (\n <>\n \n With the workspace creator's Free account, every member can\n access up to 7 days of version history.\n \n {isOwner ? (\n \n {t[\n 'com.arms.history.confirm-restore-modal.pro-plan-prompt.upgrade'\n ]()}\n \n ) : null}\n \n );\n } else {\n return (\n \n With the workspace creator's Pro account, every member enjoys the\n privilege of accessing up to 30 days of version history.\n \n );\n }\n }, [isOwner, isProWorkspace, onClickUpgrade, t]);\n\n return !planPromptClosed ? (\n
\n
\n {planTitle}\n {planDescription}\n
\n
\n ) : null;\n};\n\ntype HistoryList = ReturnType[0];\n\nconst PageHistoryList = ({\n historyList,\n onLoadMore,\n loadingMore,\n activeVersion,\n onVersionChange,\n}: {\n activeVersion?: string;\n onVersionChange: (version: string) => void;\n historyList: HistoryList;\n onLoadMore: (() => void) | false;\n loadingMore: boolean;\n}) => {\n const t = useI18n();\n const historyListByDay = useMemo(() => {\n return historyListGroupByDay(historyList);\n }, [historyList]);\n\n const [collapsedMap, setCollapsedMap] = useState>({});\n\n useLayoutEffect(() => {\n if (historyList.length > 0 && !activeVersion) {\n onVersionChange(historyList[0].timestamp);\n }\n }, [activeVersion, historyList, onVersionChange]);\n\n return (\n
\n
\n {t['com.arms.history.version-history']()}\n
\n \n \n \n {historyListByDay.map(([day, list], i) => {\n const collapsed = collapsedMap[i];\n return (\n \n \n setCollapsedMap(prev => ({ ...prev, [i]: !collapsed }))\n }\n className={styles.historyItemGroupTitle}\n >\n \n \n
\n {day}\n \n \n {list.map((history, idx) => {\n return (\n \n {\n e.stopPropagation();\n onVersionChange(history.timestamp);\n }}\n data-active={activeVersion === history.timestamp}\n >\n \n \n {idx > list.length - 1 ? (\n
\n ) : null}\n \n );\n })}\n \n \n );\n })}\n {onLoadMore ? (\n \n {t['com.arms.history.confirm-restore-modal.load-more']()}\n \n ) : null}\n \n \n \n
\n );\n};\n\nconst EmptyHistoryPrompt = () => {\n const t = useI18n();\n\n return (\n \n \n
\n {t['com.arms.history.empty-prompt.title']()}\n
\n
\n {t['com.arms.history.empty-prompt.description']()}\n
\n \n );\n};\n\nconst PageHistoryManager = ({\n docCollection,\n pageId,\n onClose,\n}: {\n docCollection: DocCollection;\n pageId: string;\n onClose: () => void;\n}) => {\n const workspaceId = docCollection.id;\n const [activeVersion, setActiveVersion] = useState();\n\n const pageDocId = useMemo(() => {\n return docCollection.getDoc(pageId)?.spaceDoc.guid ?? pageId;\n }, [pageId, docCollection]);\n const { openConfirmModal } = useConfirmModal();\n\n const snapshotPage = useSnapshotPage(docCollection, pageDocId, activeVersion);\n\n const t = useI18n();\n\n const { onRestore, isMutating } = useRestorePage(docCollection, pageId);\n\n const handleRestore = useMemo(\n () => async () => {\n if (!activeVersion || !snapshotPage) {\n return;\n }\n const snapshot = encodeStateAsUpdate(snapshotPage.spaceDoc);\n await onRestore(activeVersion, new Uint8Array(snapshot));\n // close the modal after restore\n onClose();\n },\n [activeVersion, onClose, onRestore, snapshotPage]\n );\n\n const doc = useService(DocService).doc;\n const [mode, setMode] = useState(doc.mode$.value);\n\n const title = useDocCollectionPageTitle(docCollection, pageId);\n\n const onConfirmRestore = useCallback(() => {\n openConfirmModal({\n title: t['com.arms.history.restore-current-version'](),\n description: t['com.arms.history.confirm-restore-modal.hint'](),\n cancelText: t['Cancel'](),\n contentOptions: {\n ['data-testid' as string]: 'confirm-restore-history-modal',\n style: { padding: '20px 26px' },\n },\n confirmText: t['com.arms.history.confirm-restore-modal.restore'](),\n confirmButtonOptions: {\n variant: 'primary',\n ['data-testid' as string]: 'confirm-restore-history-button',\n },\n onConfirm: handleRestore,\n });\n }, [handleRestore, openConfirmModal, t]);\n\n const [historyList, loadMore, loadingMore] = useDocSnapshotList(\n workspaceId,\n pageDocId\n );\n\n return (\n
\n
\n \n\n \n
\n\n {!activeVersion ? (\n
\n \n
\n ) : null}\n\n
\n \n
\n \n {t['com.arms.history.restore-current-version']()}\n \n
\n
\n );\n};\n\nexport const PageHistoryModal = ({\n onOpenChange,\n open,\n pageId,\n docCollection: workspace,\n}: PageHistoryModalProps) => {\n const onClose = useCallback(() => {\n onOpenChange(false);\n }, [onOpenChange]);\n\n return (\n \n }>\n \n \n \n );\n};\n\nexport const GlobalPageHistoryModal = () => {\n const [{ open, pageId }, setState] = useAtom(pageHistoryModalAtom);\n const workspace = useService(WorkspaceService).workspace;\n const handleOpenChange = useCallback(\n (open: boolean) => {\n track.$.docHistory.$[open ? 'open' : 'close']();\n setState(prev => ({\n ...prev,\n open,\n }));\n },\n [setState]\n );\n\n return (\n \n );\n};\n","import \"../core/src/components/pure/trash-page-footer/styles.css.ts.vanilla.css!=!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/components/pure/trash-page-footer/styles.css.ts.vanilla.css\\\",\\\"source\\\":\\\"Ll8ycjBocGswIHsKICBkaXNwbGF5OiBmbGV4OwogIGdhcDogMTZweDsKICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjsKfQouXzJyMGhwazEgewogIHBvc2l0aW9uOiByZWxhdGl2ZTsKICB6LWluZGV4OiAyOwogIHBhZGRpbmc6IDE0cHggMjBweDsKICBkaXNwbGF5OiBmbGV4OwogIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjsKICBhbGlnbi1pdGVtczogY2VudGVyOwogIGZsZXgtc2hyaW5rOiAwOwogIGJvdHRvbTogMDsKICBnYXA6IDE2cHg7CiAgYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tYWZmaW5lLWJhY2tncm91bmQtcHJpbWFyeS1jb2xvcik7CiAgYm9yZGVyLXRvcDogMXB4IHNvbGlkIHZhcigtLWFmZmluZS1ib3JkZXItY29sb3IpOwp9Ci5fMnIwaHBrMiB7CiAgZm9udC1zaXplOiAxNXB4OwogIGZvbnQtd2VpZ2h0OiA1MDA7CiAgbGluZS1oZWlnaHQ6IDI0cHg7CiAgY29sb3I6IHZhcigtLWFmZmluZS10ZXh0LXNlY29uZGFyeS1jb2xvcik7CiAgd2hpdGUtc3BhY2U6IG5vd3JhcDsKICB0ZXh0LW92ZXJmbG93OiBlbGxpcHNpczsKICBvdmVyZmxvdzogaGlkZGVuOwp9Ci5fMnIwaHBrMyB7CiAgcGFkZGluZzogOHB4IDE4cHg7CiAgaGVpZ2h0OiAzNnB4Owp9Ci5fMnIwaHBrNCB7CiAgd2lkdGg6IDIwcHg7CiAgaGVpZ2h0OiAyMHB4Owp9\\\"}!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var buttonContainer = '_2r0hpk3';\nexport var deleteHintContainer = '_2r0hpk1';\nexport var deleteHintText = '_2r0hpk2';\nexport var group = '_2r0hpk0';\nexport var icon = '_2r0hpk4';","import { Button } from '@affine/component/ui/button';\nimport { ConfirmModal } from '@affine/component/ui/modal';\nimport { useI18n } from '@affine/i18n';\nimport { DeleteIcon, ResetIcon } from '@blocksuite/icons/rc';\nimport { DocService, useService, WorkspaceService } from '@toeverything/infra';\nimport { useCallback, useState } from 'react';\n\nimport { useAppSettingHelper } from '../../../hooks/affine/use-app-setting-helper';\nimport { useBlockSuiteMetaHelper } from '../../../hooks/affine/use-block-suite-meta-helper';\nimport { useNavigateHelper } from '../../../hooks/use-navigate-helper';\nimport { WorkspaceSubPath } from '../../../shared';\nimport { toast } from '../../../utils';\nimport * as styles from './styles.css';\n\nexport const TrashPageFooter = () => {\n const workspace = useService(WorkspaceService).workspace;\n const docCollection = workspace.docCollection;\n const doc = useService(DocService).doc;\n const t = useI18n();\n const { appSettings } = useAppSettingHelper();\n const { jumpToSubPath } = useNavigateHelper();\n const { restoreFromTrash } = useBlockSuiteMetaHelper(docCollection);\n const [open, setOpen] = useState(false);\n const hintText = t['com.arms.cmdk.affine.editor.trash-footer-hint']();\n\n const onRestore = useCallback(() => {\n restoreFromTrash(doc.id);\n toast(\n t['com.arms.toastMessage.restored']({\n title: doc.meta$.value.title || 'Untitled',\n })\n );\n }, [doc.id, doc.meta$.value.title, restoreFromTrash, t]);\n\n const onConfirmDelete = useCallback(() => {\n jumpToSubPath(workspace.id, WorkspaceSubPath.ALL);\n docCollection.removeDoc(doc.id);\n toast(t['com.arms.toastMessage.permanentlyDeleted']());\n }, [jumpToSubPath, workspace.id, docCollection, doc.id, t]);\n\n const onDelete = useCallback(() => {\n setOpen(true);\n }, []);\n\n return (\n \n
{hintText}
\n
\n }\n prefixClassName={styles.icon}\n />\n }\n prefixClassName={styles.icon}\n />\n
\n \n
\n );\n};\n","import { CloseIcon } from '@blocksuite/icons/rc';\nimport type { ReactNode } from 'react';\n\nimport {\n browserWarningStyle,\n closeButtonStyle,\n closeIconStyle,\n} from './index.css';\n\nexport const BrowserWarning = ({\n show,\n onClose,\n message,\n}: {\n show: boolean;\n onClose: () => void;\n message: ReactNode;\n}) => {\n if (!show) {\n return null;\n }\n return (\n
\n {message}\n
\n \n
\n
\n );\n};\n\nexport default BrowserWarning;\n","import \"../component/src/components/affine-banner/index.css.ts.vanilla.css!=!../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../component/src/components/affine-banner/index.css.ts.vanilla.css\\\",\\\"source\\\":\\\"#H4sIAAAAAAAAA6WSwU7DMAyG730KX5DgENQOCihceBOUNW5n6JwoyWgH6rujZB3rCmJDXKrasR3/X/7r5/K+Di3m8JEBLFX12jizYS0q0xon4U25SyFUXROjmBx3yjFxsyu7eswAfmr4XtWRDisJRZ5fxNAqrYkbCQ+2h+LO9jFZGw7C0zvOpu3y6zRHk7et2kqoW0xNLxsfqN6KynBADhIq5IAuHqmWGhYUcO2naWs8BTIsQS29aTcBY/ZdEGvsJRSP2ZBdj3iKhGdc/mbcc4XUrMIh/okAVYankDbOxxpraL/GaSXxQCDrP2txu/12XA9iFlMxRXksZh8fJjpsVaC3X+jc/NE86JxxJ6wzr5kZ5xyPpP9u1HWf5+fR9lZVKJYYOkT+DfneusVi4t3TpgJolJVfDfFeRYxOhK1FCcRt1BGlTRHfJsTngEpuaZzpxttS7FeO+HX2bGWa+Y3IUUP+L0YTpUP2tEZNCnzlEBkUa7hcq16MD1sucttfpY2ObTUu1Lk4K37j4GFSVo5lM4cM2fAJqnI52t0EAAA=\\\"}!../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var browserWarningStyle = '_57ftle0';\nexport var closeButtonStyle = '_57ftle1';\nexport var closeIconStyle = '_57ftle2';\nexport var tipsContainer = '_57ftle3';\nexport var tipsMessage = '_57ftle4';\nexport var tipsRightItem = '_57ftle5';","import { Button, IconButton } from '@affine/component/ui/button';\nimport { useI18n } from '@affine/i18n';\nimport { CloseIcon } from '@blocksuite/icons/rc';\nimport { cssVar } from '@toeverything/theme';\nimport { useCallback } from 'react';\n\nimport * as styles from './index.css';\n\ntype LocalDemoTipsProps = {\n isLoggedIn: boolean;\n onLogin: () => void;\n onEnableCloud: () => void;\n onClose: () => void;\n};\n\nexport const LocalDemoTips = ({\n onClose,\n isLoggedIn,\n onLogin,\n onEnableCloud,\n}: LocalDemoTipsProps) => {\n const t = useI18n();\n const buttonLabel = isLoggedIn\n ? t['Enable AFFiNE Cloud']()\n : t['Sign in and Enable']();\n\n const handleClick = useCallback(() => {\n if (isLoggedIn) {\n return onEnableCloud();\n }\n return onLogin();\n }, [isLoggedIn, onEnableCloud, onLogin]);\n\n return (\n
\n
\n {t['com.arms.banner.local-warning']()}\n
\n\n
\n \n \n \n \n
\n
\n );\n};\n\nexport default LocalDemoTips;\n","import { BrowserWarning, LocalDemoTips } from '@affine/component/affine-banner';\nimport { WorkspaceFlavour } from '@affine/env/workspace';\nimport { Trans, useI18n } from '@affine/i18n';\nimport { useLiveData, useService, type Workspace } from '@toeverything/infra';\nimport { useSetAtom } from 'jotai';\nimport { useCallback, useState } from 'react';\n\nimport { authAtom } from '../atoms';\nimport { useEnableCloud } from '../hooks/affine/use-enable-cloud';\nimport { AuthService } from '../modules/cloud';\n\nconst minimumChromeVersion = 106;\n\nconst shouldShowWarning = (() => {\n if (environment.isDesktop) {\n // even though desktop has compatibility issues,\n // we don't want to show the warning\n return false;\n }\n if (!environment.isBrowser) {\n // disable in SSR\n return false;\n }\n if (environment.isMobile) {\n return true;\n }\n if (environment.isChrome) {\n return environment.chromeVersion < minimumChromeVersion;\n }\n return false;\n})();\n\nconst OSWarningMessage = () => {\n const t = useI18n();\n const notChrome = environment.isBrowser && !environment.isChrome;\n const notGoodVersion =\n environment.isBrowser &&\n environment.isChrome &&\n environment.chromeVersion < minimumChromeVersion;\n\n // TODO(@L-Sun): remove this message when mobile version is able to edit.\n if ('isMobile' in environment && environment.isMobile) {\n return {t['com.arms.top-tip.mobile']()};\n }\n\n if (notChrome) {\n return (\n \n \n We recommend the Chrome browser for an optimal\n experience.\n \n \n );\n } else if (notGoodVersion) {\n return {t['upgradeBrowser']()};\n }\n\n return null;\n};\n\nexport const TopTip = ({\n pageId,\n workspace,\n}: {\n pageId?: string;\n workspace: Workspace;\n}) => {\n const loginStatus = useLiveData(useService(AuthService).session.status$);\n const isLoggedIn = loginStatus === 'authenticated';\n\n const [showWarning, setShowWarning] = useState(shouldShowWarning);\n const [showLocalDemoTips, setShowLocalDemoTips] = useState(true);\n const confirmEnableCloud = useEnableCloud();\n\n const setAuthModal = useSetAtom(authAtom);\n const onLogin = useCallback(() => {\n setAuthModal({ openModal: true, state: 'signIn' });\n }, [setAuthModal]);\n\n if (\n showLocalDemoTips &&\n !environment.isDesktop &&\n workspace.flavour === WorkspaceFlavour.LOCAL\n ) {\n return (\n \n confirmEnableCloud(workspace, { openPageId: pageId })\n }\n onClose={() => {\n setShowLocalDemoTips(false);\n }}\n />\n );\n }\n\n return (\n }\n onClose={() => {\n setShowWarning(false);\n }}\n />\n );\n};\n","import { notify } from '@affine/component';\nimport {\n pushGlobalLoadingEventAtom,\n resolveGlobalLoadingEventAtom,\n} from '@affine/component/global-loading';\nimport { track } from '@affine/core/mixpanel';\nimport { apis } from '@affine/electron-api';\nimport { useI18n } from '@affine/i18n';\nimport type { PageRootService, RootBlockModel } from '@blocksuite/blocks';\nimport { HtmlTransformer, MarkdownTransformer } from '@blocksuite/blocks';\nimport type { Doc } from '@blocksuite/store';\nimport { useSetAtom } from 'jotai';\nimport { nanoid } from 'nanoid';\nimport { useCallback } from 'react';\n\ntype ExportType = 'pdf' | 'html' | 'png' | 'markdown';\n\ninterface ExportHandlerOptions {\n page: Doc;\n type: ExportType;\n}\n\nasync function exportHandler({ page, type }: ExportHandlerOptions) {\n const editorRoot = document.querySelector('editor-host');\n let pageService: PageRootService | null = null;\n if (editorRoot) {\n pageService = editorRoot.spec.getService('affine:page');\n }\n track.$.sharePanel.$.export({\n type,\n });\n switch (type) {\n case 'html':\n await HtmlTransformer.exportDoc(page);\n break;\n case 'markdown':\n await MarkdownTransformer.exportDoc(page);\n break;\n case 'pdf':\n if (environment.isDesktop && page.meta?.mode === 'page') {\n await apis?.export.savePDFFileAs(\n (page.root as RootBlockModel).title.toString()\n );\n } else {\n if (!pageService) return;\n await pageService.exportManager.exportPdf();\n }\n break;\n case 'png': {\n if (!pageService) return;\n await pageService.exportManager.exportPng();\n break;\n }\n }\n}\n\nexport const useExportPage = (page: Doc) => {\n const pushGlobalLoadingEvent = useSetAtom(pushGlobalLoadingEventAtom);\n const resolveGlobalLoadingEvent = useSetAtom(resolveGlobalLoadingEventAtom);\n const t = useI18n();\n\n const onClickHandler = useCallback(\n async (type: ExportType) => {\n const globalLoadingID = nanoid();\n pushGlobalLoadingEvent({\n key: globalLoadingID,\n });\n try {\n await exportHandler({\n page,\n type,\n });\n notify.success({\n title: t['com.arms.export.success.title'](),\n message: t['com.arms.export.success.message'](),\n });\n } catch (err) {\n console.error(err);\n notify.error({\n title: t['com.arms.export.error.title'](),\n message: t['com.arms.export.error.message'](),\n });\n } finally {\n resolveGlobalLoadingEvent(globalLoadingID);\n }\n },\n [page, pushGlobalLoadingEvent, resolveGlobalLoadingEvent, t]\n );\n\n return onClickHandler;\n};\n","import { FavoriteTag } from '@affine/core/components/page-list';\nimport { track } from '@affine/core/mixpanel';\nimport { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/properties';\nimport { toast } from '@affine/core/utils';\nimport { useI18n } from '@affine/i18n';\nimport { useLiveData, useService } from '@toeverything/infra';\nimport { useCallback } from 'react';\n\nexport interface FavoriteButtonProps {\n pageId: string;\n}\n\nexport const useFavorite = (pageId: string) => {\n const t = useI18n();\n const favAdapter = useService(CompatibleFavoriteItemsAdapter);\n\n const favorite = useLiveData(favAdapter.isFavorite$(pageId, 'doc'));\n\n const toggleFavorite = useCallback(() => {\n favAdapter.toggle(pageId, 'doc');\n toast(\n favorite\n ? t['com.arms.toastMessage.removedFavorites']()\n : t['com.arms.toastMessage.addedFavorites']()\n );\n }, [favorite, pageId, t, favAdapter]);\n\n return { favorite, toggleFavorite };\n};\n\nexport const FavoriteButton = ({ pageId }: FavoriteButtonProps) => {\n const { favorite, toggleFavorite } = useFavorite(pageId);\n\n const handleFavorite = useCallback(() => {\n track.$.header.actions.toggleFavorite();\n toggleFavorite();\n }, [toggleFavorite]);\n\n return (\n \n );\n};\n","import { IconButton } from '@affine/component';\nimport { openInfoModalAtom } from '@affine/core/atoms';\nimport { track } from '@affine/core/mixpanel';\nimport { useI18n } from '@affine/i18n';\nimport { InformationIcon } from '@blocksuite/icons/rc';\nimport { useSetAtom } from 'jotai';\nimport { useCallback } from 'react';\n\nexport const InfoButton = () => {\n const setOpenInfoModal = useSetAtom(openInfoModalAtom);\n const t = useI18n();\n\n const onOpenInfoModal = useCallback(() => {\n track.$.header.actions.openDocInfo();\n setOpenInfoModal(true);\n }, [setOpenInfoModal]);\n\n return (\n \n \n \n );\n};\n","import type { WeekDatePickerHandle } from '@affine/component';\nimport { WeekDatePicker } from '@affine/component';\nimport {\n useJournalInfoHelper,\n useJournalRouteHelper,\n} from '@affine/core/hooks/use-journal';\nimport type { DocCollection } from '@affine/core/shared';\nimport type { Doc } from '@blocksuite/store';\nimport dayjs from 'dayjs';\nimport { useEffect, useRef, useState } from 'react';\n\nexport interface JournalWeekDatePickerProps {\n docCollection: DocCollection;\n page: Doc;\n}\n\nconst weekStyle = { maxWidth: 800, width: '100%' };\nexport const JournalWeekDatePicker = ({\n docCollection,\n page,\n}: JournalWeekDatePickerProps) => {\n const handleRef = useRef(null);\n const { journalDate } = useJournalInfoHelper(docCollection, page.id);\n const { openJournal } = useJournalRouteHelper(docCollection);\n const [date, setDate] = useState(\n (journalDate ?? dayjs()).format('YYYY-MM-DD')\n );\n\n useEffect(() => {\n if (!journalDate) return;\n setDate(journalDate.format('YYYY-MM-DD'));\n handleRef.current?.setCursor?.(journalDate);\n }, [journalDate]);\n\n return (\n \n );\n};\n","import { Button } from '@affine/component';\nimport { useJournalRouteHelper } from '@affine/core/hooks/use-journal';\nimport type { DocCollection } from '@affine/core/shared';\nimport { useI18n } from '@affine/i18n';\nimport { useCallback } from 'react';\n\nexport interface JournalTodayButtonProps {\n docCollection: DocCollection;\n}\n\nexport const JournalTodayButton = ({\n docCollection,\n}: JournalTodayButtonProps) => {\n const t = useI18n();\n const journalHelper = useJournalRouteHelper(docCollection);\n\n const onToday = useCallback(() => {\n journalHelper.openToday();\n }, [journalHelper]);\n\n return (\n \n {t['com.arms.today']()}\n \n );\n};\n","import \"../core/src/components/affine/share-page-modal/share-menu/index.css.ts.vanilla.css!=!../../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/components/affine/share-page-modal/share-menu/index.css.ts.vanilla.css\\\",\\\"source\\\":\\\"#H4sIAAAAAAAAA61W246bMBB9z1dYK1XaPDiChGSzrtrvqFRVlYMH4sTYyExurfbfKxvYAAsJWfUNjX1mzpy5mNnv8IJ8nS4C8ndCiJBFrviFkUTB+euEEK5kqqlEyApGYtAI1pkTo5EW8g8wcuT2mVKeJFIDLe3Z9P3OCWS6RUZWQeBsyl3aVrb5PPcxci6E1CkjAYlKS8pzVn6/TWY1w9AzPEmBW0aiMCiv1s74AU3LWVh5R8t1kRibsfJTcYQfz9Thpy3/c+//HR814BKl0YxwpUgwWxQt2KKkZaygJ+t4byzwPXWGu0qdi+lHVarEYqOM7YAQzkgLiI0W3F6ov+I9+ANfK0YUJNiRddWRMvKcM25TqSmanJFw3bmy7O8HX5nXkqGzUSEtxKU8sVGHTLuT3aFAmTiCGkFjs3NaDeU9FMgttmKv+mNXpQ+D4Mvt8J5kN6GXsrymLqYFxVEeoXVp3R95bD5Xc0vbrvyvD83adRg+MXfLB+auwZB7hv8xWsP3pj/7T3VTpyV6Cx+Pi2fNqTdYkfMY6AbwBKDvlSnsStsVVoxsMM8OtGg5q5xnUtM68WXVGBk/17b5MugEBR/0gYXSxP4UHLkbUoRvT/EW4j2Ip1+3PeZWZgP+kkEkWGtsHyRtL2ancVnk8TO0MVaApZYLeShYjd7weJ9ac9CC9hFqHPftXFeGusnXVRnurJdt8wkLo9VAEje7YSDDa2S+KYw6IJR5I5qMET+WtuQatCjJ7qSHq+H3R8ZGNxQYp34j2K73iR3zRN5fM8HN5z7yr/3An8WOfHdjrgdbU0m97+tMBxTy6ODH9GH03iPqBBYftnLd5g2Iur+XK8Ee+n1oqRs5dd/+AYt8HtEZCgAA\\\"}!../../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var actionsStyle = '_1yta8g35';\nexport var buttonStyle = '_1yta8g34';\nexport var cloudSvgContainer = '_1yta8g3h';\nexport var columnContainerStyle = '_1yta8g3b';\nexport var containerStyle = '_1yta8g36';\nexport var descriptionStyle = '_1yta8g33';\nexport var disableSharePage = '_1yta8g3f';\nexport var headerStyle = '_1yta8g30';\nexport var indicatorContainerStyle = '_1yta8g37';\nexport var inputButtonRowStyle = '_1yta8g38';\nexport var localSharePage = '_1yta8g3g';\nexport var menuItemStyle = '_1yta8g32';\nexport var menuStyle = '_1yta8g31';\nexport var radioButton = '_1yta8g3e';\nexport var radioButtonGroup = '_1yta8g3d';\nexport var rowContainerStyle = '_1yta8g3c';\nexport var shareButton = '_1yta8g3k';\nexport var shareIconStyle = '_1yta8g3i';\nexport var shareLinkStyle = '_1yta8g3j';\nexport var shortcutStyle = '_1yta8g3l';\nexport var subTitleStyle = '_1yta8g3a';\nexport var titleContainerStyle = '_1yta8g39';","import { notify } from '@affine/component';\nimport { track } from '@affine/core/mixpanel';\nimport { getAffineCloudBaseUrl } from '@affine/core/modules/cloud/services/fetch';\nimport { useI18n } from '@affine/i18n';\nimport type { Disposable } from '@blocksuite/global/utils';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { useActiveBlocksuiteEditor } from '../use-block-suite-editor';\n\ntype UrlType = 'share' | 'workspace';\n\ntype UseSharingUrl = {\n workspaceId: string;\n pageId: string;\n urlType: UrlType;\n};\n\nconst generateUrl = ({\n workspaceId,\n pageId,\n urlType,\n blockId,\n}: UseSharingUrl & { blockId?: string }) => {\n // to generate a private url like https://app.affine.app/workspace/123/456\n // or https://app.affine.app/workspace/123/456#block-123\n\n // to generate a public url like https://app.affine.app/share/123/456\n const baseUrl = getAffineCloudBaseUrl();\n if (!baseUrl) return null;\n\n try {\n return new URL(\n `${baseUrl}/${urlType}/${workspaceId}/${pageId}${urlType === 'workspace' && blockId ? `#${blockId}` : ''}`\n ).toString();\n } catch (e) {\n return null;\n }\n};\n\nexport const useSharingUrl = ({\n workspaceId,\n pageId,\n urlType,\n}: UseSharingUrl) => {\n const t = useI18n();\n const [blockId, setBlockId] = useState('');\n const [editor] = useActiveBlocksuiteEditor();\n const sharingUrl = useMemo(\n () =>\n generateUrl({\n workspaceId,\n pageId,\n urlType,\n blockId: blockId.length > 0 ? blockId : undefined,\n }),\n [workspaceId, pageId, urlType, blockId]\n );\n\n const onClickCopyLink = useCallback(() => {\n if (sharingUrl) {\n navigator.clipboard\n .writeText(sharingUrl)\n .then(() => {\n notify.success({\n title: t['Copied link to clipboard'](),\n });\n })\n .catch(err => {\n console.error(err);\n });\n track.$.sharePanel.$.copyShareLink({\n type: urlType === 'share' ? 'public' : 'private',\n });\n } else {\n notify.error({\n title: 'Network not available',\n });\n }\n }, [sharingUrl, t, urlType]);\n\n useEffect(() => {\n let disposable: Disposable | null = null;\n const selectManager = editor?.host?.selection;\n if (urlType !== 'workspace' || !selectManager) {\n return;\n }\n\n // if the block is already selected, set the blockId\n const currentBlockSelection = selectManager.find('block');\n if (currentBlockSelection) {\n setBlockId(`#${currentBlockSelection.blockId}`);\n }\n\n disposable = selectManager.slots.changed.on(selections => {\n setBlockId(prev => {\n if (selections[0] && selections[0].type === 'block') {\n return `#${selections[0].blockId}`;\n } else if (prev.length > 0) {\n return '';\n } else {\n return prev;\n }\n });\n });\n return () => {\n disposable?.dispose();\n };\n }, [editor?.host?.selection, urlType]);\n return {\n sharingUrl,\n onClickCopyLink,\n };\n};\n","import { MenuIcon, MenuItem } from '@affine/component';\nimport { Divider } from '@affine/component/ui/divider';\nimport { ExportMenuItems } from '@affine/core/components/page-list';\nimport { useExportPage } from '@affine/core/hooks/affine/use-export-page';\nimport { useSharingUrl } from '@affine/core/hooks/affine/use-share-url';\nimport { WorkspaceFlavour } from '@affine/env/workspace';\nimport { useI18n } from '@affine/i18n';\nimport { CopyIcon } from '@blocksuite/icons/rc';\nimport { DocService, useLiveData, useService } from '@toeverything/infra';\n\nimport * as styles from './index.css';\nimport type { ShareMenuProps } from './share-menu';\n\nexport const ShareExport = ({\n workspaceMetadata: workspace,\n currentPage,\n}: ShareMenuProps) => {\n const t = useI18n();\n const doc = useService(DocService).doc;\n const workspaceId = workspace.id;\n const pageId = currentPage.id;\n const { sharingUrl, onClickCopyLink } = useSharingUrl({\n workspaceId,\n pageId,\n urlType: 'workspace',\n });\n const exportHandler = useExportPage(currentPage);\n const currentMode = useLiveData(doc.mode$);\n const isMac = environment.isBrowser && environment.isMacOs;\n\n return (\n <>\n
\n {t['com.arms.share-menu.ShareViaExport']()}\n
\n
\n {t['com.arms.share-menu.ShareViaExportDescription']()}\n
\n
\n \n
\n {workspace.flavour !== WorkspaceFlavour.LOCAL ? (\n
\n \n
\n {t['com.arms.share-menu.share-privately']()}\n
\n
\n {t['com.arms.share-menu.share-privately.description']()}\n
\n
\n \n \n \n }\n endFix={\n
\n {isMac ? '⌘ + ⌥ + C' : 'Ctrl + Shift + C'}\n
\n }\n >\n {t['com.arms.share-menu.copy-private-link']()}\n \n
\n
\n ) : null}\n \n );\n};\n","import { Input, notify, RadioGroup, Skeleton, Switch } from '@affine/component';\nimport { PublicLinkDisableModal } from '@affine/component/disable-public-link';\nimport { Button } from '@affine/component/ui/button';\nimport { Menu, MenuItem, MenuTrigger } from '@affine/component/ui/menu';\nimport { useSharingUrl } from '@affine/core/hooks/affine/use-share-url';\nimport { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';\nimport { track } from '@affine/core/mixpanel';\nimport { ServerConfigService } from '@affine/core/modules/cloud';\nimport { ShareService } from '@affine/core/modules/share-doc';\nimport { WorkspaceFlavour } from '@affine/env/workspace';\nimport { PublicPageMode } from '@affine/graphql';\nimport { useI18n } from '@affine/i18n';\nimport {\n ArrowRightSmallIcon,\n SingleSelectSelectSolidIcon,\n} from '@blocksuite/icons/rc';\nimport {\n type DocMode,\n DocService,\n useLiveData,\n useService,\n} from '@toeverything/infra';\nimport { cssVar } from '@toeverything/theme';\nimport { Suspense, useEffect, useMemo, useState } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\n\nimport { CloudSvg } from '../cloud-svg';\nimport * as styles from './index.css';\nimport type { ShareMenuProps } from './share-menu';\n\nexport const LocalSharePage = (props: ShareMenuProps) => {\n const t = useI18n();\n\n return (\n
\n
\n
\n {t['com.arms.share-menu.EnableCloudDescription']()}\n
\n
\n \n {t['Enable AFFiNE Cloud']()}\n \n
\n
\n
\n \n
\n
\n );\n};\n\nexport const AffineSharePage = (props: ShareMenuProps) => {\n const {\n workspaceMetadata: { id: workspaceId },\n } = props;\n const doc = useService(DocService).doc;\n const shareService = useService(ShareService);\n const serverConfig = useService(ServerConfigService).serverConfig;\n useEffect(() => {\n shareService.share.revalidate();\n }, [shareService]);\n const isSharedPage = useLiveData(shareService.share.isShared$);\n const sharedMode = useLiveData(shareService.share.sharedMode$);\n const baseUrl = useLiveData(serverConfig.config$.map(c => c?.baseUrl));\n const isLoading =\n isSharedPage === null || sharedMode === null || baseUrl === null;\n const [showDisable, setShowDisable] = useState(false);\n\n const currentDocMode = useLiveData(doc.mode$);\n\n const mode = useMemo(() => {\n if (isSharedPage && sharedMode) {\n // if it's a shared page, use the share mode\n return sharedMode.toLowerCase() as DocMode;\n }\n // default to page mode\n return currentDocMode;\n }, [currentDocMode, isSharedPage, sharedMode]);\n\n const { sharingUrl, onClickCopyLink } = useSharingUrl({\n workspaceId,\n pageId: doc.id,\n urlType: 'share',\n });\n\n const t = useI18n();\n\n const modeOptions = useMemo(\n () => [\n { value: 'page', label: t['com.arms.pageMode.page']() },\n {\n value: 'edgeless',\n label: t['com.arms.pageMode.edgeless'](),\n },\n ],\n [t]\n );\n\n const onClickCreateLink = useAsyncCallback(async () => {\n try {\n await shareService.share.enableShare(\n mode === 'edgeless' ? PublicPageMode.Edgeless : PublicPageMode.Page\n );\n track.$.sharePanel.$.createShareLink({\n mode,\n });\n notify.success({\n title:\n t[\n 'com.arms.share-menu.create-public-link.notification.success.title'\n ](),\n message:\n t[\n 'com.arms.share-menu.create-public-link.notification.success.message'\n ](),\n style: 'normal',\n icon: ,\n });\n if (sharingUrl) {\n navigator.clipboard.writeText(sharingUrl).catch(err => {\n console.error(err);\n });\n }\n } catch (err) {\n notify.error({\n title:\n t[\n 'com.arms.share-menu.confirm-modify-mode.notification.fail.title'\n ](),\n message:\n t[\n 'com.arms.share-menu.confirm-modify-mode.notification.fail.message'\n ](),\n });\n console.error(err);\n }\n }, [mode, shareService.share, sharingUrl, t]);\n\n const onDisablePublic = useAsyncCallback(async () => {\n try {\n await shareService.share.disableShare();\n notify.error({\n title:\n t[\n 'com.arms.share-menu.disable-publish-link.notification.success.title'\n ](),\n message:\n t[\n 'com.arms.share-menu.disable-publish-link.notification.success.message'\n ](),\n });\n } catch (err) {\n notify.error({\n title:\n t[\n 'com.arms.share-menu.disable-publish-link.notification.fail.title'\n ](),\n message:\n t[\n 'com.arms.share-menu.disable-publish-link.notification.fail.message'\n ](),\n });\n console.log(err);\n }\n setShowDisable(false);\n }, [shareService, t]);\n\n const onShareModeChange = useAsyncCallback(\n async (value: DocMode) => {\n try {\n if (isSharedPage) {\n await shareService.share.changeShare(\n value === 'edgeless' ? PublicPageMode.Edgeless : PublicPageMode.Page\n );\n notify.success({\n title:\n t[\n 'com.arms.share-menu.confirm-modify-mode.notification.success.title'\n ](),\n message: t[\n 'com.arms.share-menu.confirm-modify-mode.notification.success.message'\n ]({\n preMode: value === 'edgeless' ? t['Page']() : t['Edgeless'](),\n currentMode: value === 'edgeless' ? t['Edgeless']() : t['Page'](),\n }),\n style: 'normal',\n icon: (\n \n ),\n });\n }\n } catch (err) {\n notify.error({\n title:\n t[\n 'com.arms.share-menu.confirm-modify-mode.notification.fail.title'\n ](),\n message:\n t[\n 'com.arms.share-menu.confirm-modify-mode.notification.fail.message'\n ](),\n });\n console.error(err);\n }\n },\n [isSharedPage, shareService.share, t]\n );\n\n if (isLoading) {\n // TODO(@eyhn): loading and error UI\n return (\n <>\n \n \n \n );\n }\n\n return (\n <>\n
\n {t['com.arms.share-menu.publish-to-web']()}\n
\n
\n
\n {t['com.arms.share-menu.publish-to-web.description']()}\n
\n
\n
\n \n {isSharedPage ? (\n \n {t.Copy()}\n \n ) : (\n \n {t.Create()}\n \n )}\n
\n
\n
\n {t['com.arms.share-menu.ShareMode']()}\n
\n
\n \n
\n
\n {isSharedPage ? (\n <>\n {runtimeConfig.enableEnhanceShareMode && (\n <>\n
\n
Link expires
\n
\n Never}>\n Never\n \n
\n
\n
\n
\n {'Show \"Created with AFFiNE\"'}\n
\n
\n \n
\n
\n
\n
\n Search engine indexing\n
\n
\n \n
\n
\n \n )}\n }\n block\n type=\"danger\"\n className={styles.menuItemStyle}\n onSelect={e => {\n e.preventDefault();\n setShowDisable(true);\n }}\n >\n
\n {t['Disable Public Link']()}\n
\n \n \n \n ) : null}\n \n );\n};\n\nexport const SharePage = (props: ShareMenuProps) => {\n if (props.workspaceMetadata.flavour === WorkspaceFlavour.LOCAL) {\n return ;\n } else if (\n props.workspaceMetadata.flavour === WorkspaceFlavour.AFFINE_CLOUD\n ) {\n return (\n // TODO(@eyhn): refactor this part\n \n \n \n \n \n );\n }\n throw new Error('Unreachable');\n};\n","import { Button } from '@affine/component/ui/button';\nimport { Divider } from '@affine/component/ui/divider';\nimport { Menu } from '@affine/component/ui/menu';\nimport { ShareService } from '@affine/core/modules/share-doc';\nimport { WorkspaceFlavour } from '@affine/env/workspace';\nimport { useI18n } from '@affine/i18n';\nimport { WebIcon } from '@blocksuite/icons/rc';\nimport type { Doc } from '@blocksuite/store';\nimport {\n useLiveData,\n useService,\n type WorkspaceMetadata,\n} from '@toeverything/infra';\nimport { forwardRef, type PropsWithChildren, type Ref, useEffect } from 'react';\n\nimport * as styles from './index.css';\nimport { ShareExport } from './share-export';\nimport { SharePage } from './share-page';\n\nexport interface ShareMenuProps extends PropsWithChildren {\n workspaceMetadata: WorkspaceMetadata;\n currentPage: Doc;\n onEnableAffineCloud: () => void;\n onOpenShareModal?: (open: boolean) => void;\n}\n\nexport const ShareMenuContent = (props: ShareMenuProps) => {\n const t = useI18n();\n return (\n
\n
\n
\n \n
\n {t['com.arms.share-menu.SharePage']()}\n
\n \n
\n \n
\n \n
\n );\n};\n\nconst DefaultShareButton = forwardRef(function DefaultShareButton(\n _,\n ref: Ref\n) {\n const t = useI18n();\n const shareService = useService(ShareService);\n const shared = useLiveData(shareService.share.isShared$);\n\n useEffect(() => {\n shareService.share.revalidate();\n }, [shareService]);\n\n return (\n \n );\n});\n\nconst LocalShareMenu = (props: ShareMenuProps) => {\n return (\n }\n contentOptions={{\n className: styles.menuStyle,\n ['data-testid' as string]: 'local-share-menu',\n }}\n rootOptions={{\n modal: false,\n onOpenChange: props.onOpenShareModal,\n }}\n >\n
\n {props.children || }\n
\n \n );\n};\n\nconst CloudShareMenu = (props: ShareMenuProps) => {\n return (\n }\n contentOptions={{\n className: styles.menuStyle,\n ['data-testid' as string]: 'cloud-share-menu',\n }}\n rootOptions={{\n modal: false,\n onOpenChange: props.onOpenShareModal,\n }}\n >\n
\n {props.children || }\n
\n \n );\n};\n\nexport const ShareMenu = (props: ShareMenuProps) => {\n const { workspaceMetadata } = props;\n\n if (workspaceMetadata.flavour === WorkspaceFlavour.LOCAL) {\n return ;\n }\n return ;\n};\n","import { WorkbenchService } from '@affine/core/modules/workbench';\nimport { useViewPosition } from '@affine/core/modules/workbench/view/use-view-position';\nimport { DocService, useLiveData, useService } from '@toeverything/infra';\n\nexport const useDetailPageHeaderResponsive = (availableWidth: number) => {\n const mode = useLiveData(useService(DocService).doc.mode$);\n\n const workbench = useService(WorkbenchService).workbench;\n const viewPosition = useViewPosition();\n const workbenchViewsCount = useLiveData(\n workbench.views$.map(views => views.length)\n );\n const rightSidebarOpen = useLiveData(workbench.sidebarOpen$);\n\n // share button should be hidden once split-view is enabled\n const hideShare = availableWidth < 500 || workbenchViewsCount > 1;\n const hidePresent = availableWidth < 400 || mode !== 'edgeless';\n const hideCollect = availableWidth < 300;\n const hideToday = availableWidth < 300;\n\n const showDivider =\n viewPosition.isLast &&\n !rightSidebarOpen &&\n !(hidePresent && hideShare) &&\n !environment.isDesktop;\n\n return {\n hideShare,\n hidePresent,\n hideCollect,\n hideToday,\n showDivider,\n };\n};\n","import type { IconButtonProps } from '@affine/component/ui/button';\nimport { IconButton } from '@affine/component/ui/button';\nimport { MoreHorizontalIcon } from '@blocksuite/icons/rc';\nimport { forwardRef } from 'react';\n\nimport { headerMenuTrigger } from './styles.css';\n\nexport const HeaderDropDownButton = forwardRef<\n HTMLButtonElement,\n Omit\n>((props, ref) => {\n return (\n \n \n \n );\n});\n\nHeaderDropDownButton.displayName = 'HeaderDropDownButton';\n","import \"../core/src/components/pure/header-drop-down-button/styles.css.ts.vanilla.css!=!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/components/pure/header-drop-down-button/styles.css.ts.vanilla.css\\\",\\\"source\\\":\\\"Ll8xNHV5NmExMFtkYXRhLXN0YXRlPW9wZW5dIHsKICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hZmZpbmUtaG92ZXItY29sb3IpOwp9\\\"}!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var headerMenuTrigger = '_14uy6a10';","import {\n Menu,\n MenuIcon,\n MenuItem,\n MenuSeparator,\n MenuSub,\n} from '@affine/component/ui/menu';\nimport {\n openHistoryTipsModalAtom,\n openInfoModalAtom,\n} from '@affine/core/atoms';\nimport { PageHistoryModal } from '@affine/core/components/affine/page-history-modal';\nimport { ShareMenuContent } from '@affine/core/components/affine/share-page-modal/share-menu';\nimport { Export, MoveToTrash } from '@affine/core/components/page-list';\nimport { useBlockSuiteMetaHelper } from '@affine/core/hooks/affine/use-block-suite-meta-helper';\nimport { useEnableCloud } from '@affine/core/hooks/affine/use-enable-cloud';\nimport { useExportPage } from '@affine/core/hooks/affine/use-export-page';\nimport { useTrashModalHelper } from '@affine/core/hooks/affine/use-trash-modal-helper';\nimport { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';\nimport { track } from '@affine/core/mixpanel';\nimport { WorkbenchService } from '@affine/core/modules/workbench';\nimport { ViewService } from '@affine/core/modules/workbench/services/view';\nimport { useDetailPageHeaderResponsive } from '@affine/core/pages/workspace/detail-page/use-header-responsive';\nimport { WorkspaceFlavour } from '@affine/env/workspace';\nimport { useI18n } from '@affine/i18n';\nimport {\n DuplicateIcon,\n EditIcon,\n FavoritedIcon,\n FavoriteIcon,\n FrameIcon,\n HistoryIcon,\n ImportIcon,\n InformationIcon,\n OpenInNewIcon,\n ShareIcon,\n SplitViewIcon,\n TocIcon,\n} from '@blocksuite/icons/rc';\nimport type { Doc } from '@blocksuite/store';\nimport {\n DocService,\n useLiveData,\n useService,\n WorkspaceService,\n} from '@toeverything/infra';\nimport { useSetAtom } from 'jotai';\nimport { useCallback, useState } from 'react';\n\nimport { HeaderDropDownButton } from '../../../pure/header-drop-down-button';\nimport { usePageHelper } from '../../block-suite-page-list/utils';\nimport { useFavorite } from '../favorite';\n\ntype PageMenuProps = {\n rename?: () => void;\n page: Doc;\n isJournal?: boolean;\n containerWidth: number;\n};\n// fixme: refactor this file\nexport const PageHeaderMenuButton = ({\n rename,\n page,\n isJournal,\n containerWidth,\n}: PageMenuProps) => {\n const pageId = page?.id;\n const t = useI18n();\n const { hideShare } = useDetailPageHeaderResponsive(containerWidth);\n const confirmEnableCloud = useEnableCloud();\n\n const workspace = useService(WorkspaceService).workspace;\n const docCollection = workspace.docCollection;\n\n const doc = useService(DocService).doc;\n const isInTrash = useLiveData(doc.meta$.map(m => m.trash));\n const currentMode = useLiveData(doc.mode$);\n\n const workbench = useService(WorkbenchService).workbench;\n\n const { favorite, toggleFavorite } = useFavorite(pageId);\n\n const { duplicate } = useBlockSuiteMetaHelper(docCollection);\n const { importFile } = usePageHelper(docCollection);\n const { setTrashModal } = useTrashModalHelper(docCollection);\n\n const view = useService(ViewService).view;\n\n const openSidePanel = useCallback(\n (id: string) => {\n workbench.openSidebar();\n view.activeSidebarTab(id);\n },\n [workbench, view]\n );\n\n const openAllFrames = useCallback(() => {\n openSidePanel('frame');\n }, [openSidePanel]);\n\n const openOutlinePanel = useCallback(() => {\n openSidePanel('outline');\n }, [openSidePanel]);\n\n const [historyModalOpen, setHistoryModalOpen] = useState(false);\n const setOpenHistoryTipsModal = useSetAtom(openHistoryTipsModalAtom);\n\n const openHistoryModal = useCallback(() => {\n track.$.header.history.open();\n if (workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD) {\n return setHistoryModalOpen(true);\n }\n return setOpenHistoryTipsModal(true);\n }, [setOpenHistoryTipsModal, workspace.flavour]);\n\n const setOpenInfoModal = useSetAtom(openInfoModalAtom);\n const openInfoModal = useCallback(() => {\n track.$.header.pageInfo.open();\n setOpenInfoModal(true);\n }, [setOpenInfoModal]);\n\n const handleOpenInNewTab = useCallback(() => {\n workbench.openDoc(pageId, {\n at: 'new-tab',\n });\n }, [pageId, workbench]);\n\n const handleOpenInSplitView = useCallback(() => {\n workbench.openDoc(pageId, {\n at: 'tail',\n });\n }, [pageId, workbench]);\n\n const handleOpenTrashModal = useCallback(() => {\n track.$.header.docOptions.deleteDoc();\n setTrashModal({\n open: true,\n pageIds: [pageId],\n pageTitles: [doc.meta$.value.title ?? ''],\n });\n }, [doc.meta$.value.title, pageId, setTrashModal]);\n\n const handleRename = useCallback(() => {\n rename?.();\n track.$.header.docOptions.renameDoc();\n }, [rename]);\n\n // edgeless/page 변환 버튼\n // const handleSwitchMode = useCallback(() => {\n // doc.toggleMode();\n // track.$.header.docOptions.switchPageMode({\n // mode: currentMode === 'page' ? 'edgeless' : 'page',\n // });\n // toast(\n // currentMode === 'page'\n // ? t['com.arms.toastMessage.edgelessMode']()\n // : t['com.arms.toastMessage.pageMode']()\n // );\n // }, [currentMode, doc, t]);\n const menuItemStyle = {\n padding: '4px 12px',\n transition: 'all 0.3s',\n };\n\n const handleMenuOpenChange = useCallback((open: boolean) => {\n if (open) {\n track.$.header.docOptions.open();\n }\n }, []);\n\n const exportHandler = useExportPage(doc.blockSuiteDoc);\n\n const handleDuplicate = useCallback(() => {\n duplicate(pageId);\n track.$.header.docOptions.createDoc({\n control: 'duplicate',\n });\n }, [duplicate, pageId]);\n\n const onImportFile = useAsyncCallback(async () => {\n const options = await importFile();\n track.$.header.docOptions.import();\n if (options.isWorkspaceFile) {\n track.$.header.actions.createWorkspace({\n control: 'import',\n });\n } else {\n track.$.header.actions.createDoc({\n control: 'import',\n });\n }\n }, [importFile]);\n\n const handleShareMenuOpenChange = useCallback((open: boolean) => {\n if (open) {\n track.$.sharePanel.$.open();\n }\n }, []);\n\n const handleToggleFavorite = useCallback(() => {\n track.$.header.docOptions.toggleFavorite();\n toggleFavorite();\n }, [toggleFavorite]);\n\n const showResponsiveMenu = hideShare;\n const ResponsiveMenuItems = (\n <>\n {hideShare ? (\n \n \n confirmEnableCloud(workspace, {\n openPageId: page.id,\n })\n }\n />\n \n }\n triggerOptions={{\n preFix: (\n \n \n \n ),\n }}\n subOptions={{\n onOpenChange: handleShareMenuOpenChange,\n }}\n >\n {t['com.arms.share-menu.shareButton']()}\n \n ) : null}\n \n \n );\n\n const EditMenu = (\n <>\n {showResponsiveMenu ? ResponsiveMenuItems : null}\n {!isJournal && (\n \n \n \n }\n data-testid=\"editor-option-menu-rename\"\n onSelect={handleRename}\n style={menuItemStyle}\n >\n {t['Rename']()}\n \n )}\n {/* edgeless/page 변환 버튼 \n {currentMode === 'page' ? : }\n \n }\n data-testid=\"editor-option-menu-edgeless\"\n onSelect={handleSwitchMode}\n style={menuItemStyle}\n >\n {t['Convert to ']()}\n {currentMode === 'page'\n ? t['com.arms.pageMode.edgeless']()\n : t['com.arms.pageMode.page']()}\n */}\n \n {favorite ? (\n \n ) : (\n \n )}\n \n }\n >\n {favorite\n ? t['com.arms.favoritePageOperation.remove']()\n : t['com.arms.favoritePageOperation.add']()}\n \n \n \n \n \n }\n data-testid=\"editor-option-menu-open-in-new-tab\"\n onSelect={handleOpenInNewTab}\n style={menuItemStyle}\n >\n {t['com.arms.workbench.tab.page-menu-open']()}\n \n\n {environment.isDesktop && (\n \n \n \n }\n data-testid=\"editor-option-menu-open-in-split-new\"\n onSelect={handleOpenInSplitView}\n style={menuItemStyle}\n >\n {t['com.arms.workbench.split-view.page-menu-open']()}\n \n )}\n\n \n\n {runtimeConfig.enableInfoModal && (\n \n \n \n }\n data-testid=\"editor-option-menu-info\"\n onSelect={openInfoModal}\n style={menuItemStyle}\n >\n {t['com.arms.page-properties.page-info.view']()}\n \n )}\n {currentMode === 'page' ? (\n \n \n \n }\n data-testid=\"editor-option-toc\"\n onSelect={openOutlinePanel}\n style={menuItemStyle}\n >\n {t['com.arms.header.option.view-toc']()}\n \n ) : (\n \n \n \n }\n data-testid=\"editor-option-frame\"\n onSelect={openAllFrames}\n style={menuItemStyle}\n >\n {t['com.arms.header.option.view-frame']()}\n \n )}\n \n \n \n }\n data-testid=\"editor-option-menu-history\"\n onSelect={openHistoryModal}\n style={menuItemStyle}\n >\n {t['com.arms.history.view-history-version']()}\n \n \n {!isJournal && (\n \n \n \n }\n data-testid=\"editor-option-menu-duplicate\"\n onSelect={handleDuplicate}\n style={menuItemStyle}\n >\n {t['com.arms.header.option.duplicate']()}\n \n )}\n \n \n \n }\n data-testid=\"editor-option-menu-import\"\n onSelect={onImportFile}\n style={menuItemStyle}\n >\n {t['Import']()}\n \n \n \n \n \n );\n if (isInTrash) {\n return null;\n }\n return (\n <>\n \n \n \n {workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD ? (\n \n ) : null}\n \n );\n};\n","import { IconButton } from '@affine/component';\nimport { PresentationIcon } from '@blocksuite/icons/rc';\n\nimport { usePresent } from './use-present';\n\nexport const DetailPageHeaderPresentButton = () => {\n const { isPresent, handlePresent } = usePresent();\n\n return (\n handlePresent(!isPresent)}\n >\n \n \n );\n};\n","import { useEnableCloud } from '@affine/core/hooks/affine/use-enable-cloud';\nimport { track } from '@affine/core/mixpanel';\nimport type { Doc } from '@blocksuite/store';\nimport { type Workspace } from '@toeverything/infra';\nimport { useCallback } from 'react';\n\nimport { ShareMenu } from './share-menu';\n\ntype SharePageModalProps = {\n workspace: Workspace;\n page: Doc;\n};\n\nexport const SharePageButton = ({ workspace, page }: SharePageModalProps) => {\n const confirmEnableCloud = useEnableCloud();\n const handleOpenShareModal = useCallback((open: boolean) => {\n if (open) {\n track.$.sharePanel.$.open();\n }\n }, []);\n\n return (\n \n confirmEnableCloud(workspace, {\n openPageId: page.id,\n })\n }\n onOpenShareModal={handleOpenShareModal}\n />\n );\n};\n","import \"../core/src/pages/workspace/detail-page/detail-page-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/detail-page/detail-page-header.css.ts.vanilla.css\\\",\\\"source\\\":\\\"Ll8xOThndnoxMCB7CiAgZGlzcGxheTogZmxleDsKICBoZWlnaHQ6IDEwMCU7CiAgd2lkdGg6IDEwMCU7CiAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICBnYXA6IDEycHg7Cn0KLl8xOThndnoxMSB7CiAgZmxleC1ncm93OiAxOwogIG1pbi13aWR0aDogMTJweDsKfQouXzE5OGd2ejEyIHsKICBtaW4td2lkdGg6IDEwMHB4OwogIGZsZXgtZ3JvdzogMTsKICBkaXNwbGF5OiBmbGV4OwogIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7Cn0KLl8xOThndnoxMyB7CiAgZGlzcGxheTogZmxleDsKICBhbGlnbi1pdGVtczogY2VudGVyOwogIGdhcDogMTBweDsKfQ==\\\"}!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var header = '_198gvz10';\nexport var iconButtonContainer = '_198gvz13';\nexport var journalWeekPicker = '_198gvz12';\nexport var spacer = '_198gvz11';","import {\n Divider,\n type InlineEditHandle,\n observeResize,\n} from '@affine/component';\nimport { openInfoModalAtom } from '@affine/core/atoms';\nimport { InfoModal } from '@affine/core/components/affine/page-properties';\nimport { FavoriteButton } from '@affine/core/components/blocksuite/block-suite-header/favorite';\nimport { InfoButton } from '@affine/core/components/blocksuite/block-suite-header/info';\nimport { JournalWeekDatePicker } from '@affine/core/components/blocksuite/block-suite-header/journal/date-picker';\nimport { JournalTodayButton } from '@affine/core/components/blocksuite/block-suite-header/journal/today-button';\nimport { PageHeaderMenuButton } from '@affine/core/components/blocksuite/block-suite-header/menu';\nimport { DetailPageHeaderPresentButton } from '@affine/core/components/blocksuite/block-suite-header/present/detail-header-present-button';\nimport { EditorModeSwitch } from '@affine/core/components/blocksuite/block-suite-mode-switch';\nimport { useRegisterCopyLinkCommands } from '@affine/core/hooks/affine/use-register-copy-link-commands';\nimport { useDocCollectionPageTitle } from '@affine/core/hooks/use-block-suite-workspace-page-title';\nimport { useJournalInfoHelper } from '@affine/core/hooks/use-journal';\nimport { track } from '@affine/core/mixpanel';\nimport { ViewIcon, ViewTitle } from '@affine/core/modules/workbench';\nimport type { Doc } from '@blocksuite/store';\nimport {\n DocService,\n useLiveData,\n useService,\n type Workspace,\n} from '@toeverything/infra';\nimport { useAtom, useAtomValue } from 'jotai';\nimport { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { SharePageButton } from '../../../components/affine/share-page-modal';\nimport { appSidebarFloatingAtom } from '../../../components/app-sidebar';\nimport { BlocksuiteHeaderTitle } from '../../../components/blocksuite/block-suite-header/title/index';\nimport { HeaderDivider } from '../../../components/pure/header';\nimport * as styles from './detail-page-header.css';\nimport { useDetailPageHeaderResponsive } from './use-header-responsive';\n\nconst Header = forwardRef<\n HTMLDivElement,\n {\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n }\n>(({ children, style, className }, ref) => {\n const appSidebarFloating = useAtomValue(appSidebarFloatingAtom);\n return (\n \n {children}\n \n );\n});\n\nHeader.displayName = 'forwardRef(Header)';\n\ninterface PageHeaderProps {\n page: Doc;\n workspace: Workspace;\n}\nexport function JournalPageHeader({ page, workspace }: PageHeaderProps) {\n const containerRef = useRef(null);\n const [containerWidth, setContainerWidth] = useState(0);\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n return observeResize(container, entry => {\n setContainerWidth(entry.contentRect.width);\n });\n }, []);\n\n const { hideShare, hideToday } =\n useDetailPageHeaderResponsive(containerWidth);\n const title = useDocCollectionPageTitle(workspace.docCollection, page?.id);\n return (\n
\n \n \n {/*edgeless/page 변환 버튼 */}\n
\n \n
\n {hideToday ? null : (\n \n )}\n \n \n {page && !hideShare ? (\n \n ) : null}\n
\n );\n}\n\nexport function NormalPageHeader({ page, workspace }: PageHeaderProps) {\n const titleInputHandleRef = useRef(null);\n const containerRef = useRef(null);\n const [containerWidth, setContainerWidth] = useState(0);\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n return observeResize(container, entry => {\n setContainerWidth(entry.contentRect.width);\n });\n }, []);\n\n const { hideCollect, hideShare, hidePresent, showDivider } =\n useDetailPageHeaderResponsive(containerWidth);\n\n const onRename = useCallback(() => {\n setTimeout(() => titleInputHandleRef.current?.triggerEdit());\n }, []);\n\n const title = useDocCollectionPageTitle(workspace.docCollection, page?.id);\n const doc = useService(DocService).doc;\n const currentMode = useLiveData(doc.mode$);\n const onEditSave = useCallback(() => {\n track.$.header.actions.renameDoc();\n }, []);\n\n return (\n
\n \n \n {/* edgeless/page 변환 버튼 */}\n \n
\n {hideCollect ? null : (\n <>\n \n {runtimeConfig.enableInfoModal ? : null}\n \n )}\n \n
\n\n
\n\n {!hidePresent ? : null}\n\n {page && !hideShare ? (\n \n ) : null}\n\n {showDivider ? (\n \n ) : null}\n
\n );\n}\n\nexport function DetailPageHeader(props: PageHeaderProps) {\n const { page, workspace } = props;\n const { isJournal } = useJournalInfoHelper(page.collection, page.id);\n const isInTrash = page.meta?.trash;\n const [openInfoModal, setOpenInfoModal] = useAtom(openInfoModalAtom);\n\n useRegisterCopyLinkCommands({\n workspaceMeta: workspace.meta,\n docId: page.id,\n });\n\n return (\n <>\n {isJournal && !isInTrash ? (\n \n ) : (\n \n )}\n \n \n );\n}\n","import {\n PreconditionStrategy,\n registerAffineCommand,\n} from '@affine/core/commands';\nimport { useSharingUrl } from '@affine/core/hooks/affine/use-share-url';\nimport { track } from '@affine/core/mixpanel';\nimport { useIsActiveView } from '@affine/core/modules/workbench';\nimport { WorkspaceFlavour } from '@affine/env/workspace';\nimport { type WorkspaceMetadata } from '@toeverything/infra';\nimport { useEffect } from 'react';\n\nexport function useRegisterCopyLinkCommands({\n workspaceMeta,\n docId,\n}: {\n workspaceMeta: WorkspaceMetadata;\n docId: string;\n}) {\n const isActiveView = useIsActiveView();\n const workspaceId = workspaceMeta.id;\n const isCloud = workspaceMeta.flavour === WorkspaceFlavour.AFFINE_CLOUD;\n const { onClickCopyLink } = useSharingUrl({\n workspaceId,\n pageId: docId,\n urlType: 'workspace',\n });\n\n useEffect(() => {\n const unsubs: Array<() => void> = [];\n\n unsubs.push(\n registerAffineCommand({\n id: `affine:share-private-link:${docId}`,\n category: 'affine:general',\n preconditionStrategy: PreconditionStrategy.Never,\n keyBinding: {\n binding: '$mod+Shift+c',\n },\n label: '',\n icon: null,\n run() {\n track.$.cmdk.general.copyShareLink({ type: 'private' });\n\n isActiveView && isCloud && onClickCopyLink();\n },\n })\n );\n return () => {\n unsubs.forEach(unsub => unsub());\n };\n }, [docId, isActiveView, isCloud, onClickCopyLink]);\n}\n","import \"../core/src/pages/workspace/detail-page/tabs/journal.css.ts.vanilla.css!=!../../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/pages/workspace/detail-page/tabs/journal.css.ts.vanilla.css\\\",\\\"source\\\":\\\"#H4sIAAA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b8S/u0bu0of3b+6sc41Jv49M0L8JhoxKR9EIdowYHzl76p0lz23LTqJwf+5aG6S8tRY00tporKIYSX+K8Z80zxLOPnStiOClCZ5kVmuBBpFIAJGO/jCt1Ux9XZRMOVh8vwlhuBA0zFfl/2zxAL/vrSK8QTijpLhSI6p5465jcV4nibUZmvntkqderVLvcluDaOpByb0SjgHSdye6CbevX/8B0GwAv3APAAA=\\\"}!../../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var calendar = 'uiyc491';\nexport var dailyCount = 'uiyc493';\nexport var dailyCountContainer = 'uiyc496';\nexport var dailyCountContent = 'uiyc498';\nexport var dailyCountEmpty = 'uiyc499';\nexport var dailyCountHeader = 'uiyc494';\nexport var dailyCountItem = 'uiyc497';\nexport var dailyCountNav = 'uiyc495 uiyc490';\nexport var journalConflictBlock = 'uiyc49d';\nexport var journalConflictMoreTrigger = 'uiyc49f uiyc490';\nexport var journalConflictWrapper = 'uiyc49e';\nexport var journalDateCell = 'uiyc49g uiyc490';\nexport var journalDateCellDot = 'uiyc49h';\nexport var journalPanel = 'uiyc492';\nexport var pageItem = 'uiyc49a uiyc490';\nexport var pageItemIcon = 'uiyc49b';\nexport var pageItemLabel = 'uiyc49c';","import type { DateCell } from '@affine/component';\nimport { DatePicker, IconButton, Menu, Scrollable } from '@affine/component';\nimport { MoveToTrash } from '@affine/core/components/page-list';\nimport { useTrashModalHelper } from '@affine/core/hooks/affine/use-trash-modal-helper';\nimport { useDocCollectionPageTitle } from '@affine/core/hooks/use-block-suite-workspace-page-title';\nimport {\n useJournalHelper,\n useJournalInfoHelper,\n useJournalRouteHelper,\n} from '@affine/core/hooks/use-journal';\nimport { WorkbenchLink } from '@affine/core/modules/workbench';\nimport { useI18n } from '@affine/i18n';\nimport {\n EdgelessIcon,\n MoreHorizontalIcon,\n PageIcon,\n TodayIcon,\n} from '@blocksuite/icons/rc';\nimport type { DocRecord } from '@toeverything/infra';\nimport {\n DocService,\n DocsService,\n useLiveData,\n useService,\n WorkspaceService,\n} from '@toeverything/infra';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport clsx from 'clsx';\nimport dayjs from 'dayjs';\nimport type { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport * as styles from './journal.css';\n\n/**\n * @internal\n */\nconst CountDisplay = ({\n count,\n max = 99,\n ...attrs\n}: { count: number; max?: number } & HTMLAttributes) => {\n return {count > max ? `${max}+` : count};\n};\ninterface PageItemProps\n extends Omit, 'onClick'> {\n docRecord: DocRecord;\n right?: ReactNode;\n}\nconst PageItem = ({ docRecord, right, className, ...attrs }: PageItemProps) => {\n const mode = useLiveData(docRecord.mode$);\n const workspace = useService(WorkspaceService).workspace;\n const title = useDocCollectionPageTitle(\n workspace.docCollection,\n docRecord.id\n );\n const { isJournal } = useJournalInfoHelper(\n workspace.docCollection,\n docRecord.id\n );\n\n const Icon = isJournal\n ? TodayIcon\n : mode === 'edgeless'\n ? EdgelessIcon\n : PageIcon;\n return (\n \n
\n \n
\n {title}\n {right}\n \n );\n};\n\ntype NavItemName = 'createdToday' | 'updatedToday';\ninterface NavItem {\n name: NavItemName;\n label: string;\n count: number;\n}\ninterface JournalBlockProps {\n date: dayjs.Dayjs;\n}\n\nexport const EditorJournalPanel = () => {\n const t = useI18n();\n const doc = useService(DocService).doc;\n const workspace = useService(WorkspaceService).workspace;\n const { journalDate, isJournal } = useJournalInfoHelper(\n workspace.docCollection,\n doc.id\n );\n const { openJournal } = useJournalRouteHelper(workspace.docCollection);\n const [date, setDate] = useState(dayjs().format('YYYY-MM-DD'));\n\n useEffect(() => {\n journalDate && setDate(journalDate.format('YYYY-MM-DD'));\n }, [journalDate]);\n\n const onDateSelect = useCallback(\n (date: string) => {\n if (journalDate && dayjs(date).isSame(dayjs(journalDate))) return;\n openJournal(date);\n },\n [journalDate, openJournal]\n );\n\n const customDayRenderer = useCallback(\n (cell: DateCell) => {\n // TODO(@catsjuice): add a dot to indicate journal\n // has performance issue for now, better to calculate it in advance\n // const hasJournal = !!getJournalsByDate(cell.date.format('YYYY-MM-DD'))?.length;\n const hasJournal = false;\n return (\n \n {cell.label}\n {hasJournal && !cell.selected ? (\n
\n ) : null}\n \n );\n },\n [isJournal]\n );\n\n return (\n
\n
\n \n
\n \n \n
\n );\n};\n\nconst sortPagesByDate = (\n docs: DocRecord[],\n field: 'updatedDate' | 'createDate',\n order: 'asc' | 'desc' = 'desc'\n) => {\n return [...docs].sort((a, b) => {\n return (\n (order === 'asc' ? 1 : -1) *\n dayjs(b.meta$.value[field]).diff(dayjs(a.meta$.value[field]))\n );\n });\n};\n\nconst DailyCountEmptyFallback = ({ name }: { name: NavItemName }) => {\n const t = useI18n();\n\n return (\n
\n {name === 'createdToday'\n ? t['com.arms.journal.daily-count-created-empty-tips']()\n : t['com.arms.journal.daily-count-updated-empty-tips']()}\n
\n );\n};\nconst JournalDailyCountBlock = ({ date }: JournalBlockProps) => {\n const nodeRef = useRef(null);\n const t = useI18n();\n const [activeItem, setActiveItem] = useState('createdToday');\n const docRecords = useLiveData(useService(DocsService).list.docs$);\n\n const getTodaysPages = useCallback(\n (field: 'createDate' | 'updatedDate') => {\n return sortPagesByDate(\n docRecords.filter(docRecord => {\n const meta = docRecord.meta$.value;\n if (meta.trash) return false;\n return meta[field] && dayjs(meta[field]).isSame(date, 'day');\n }),\n field\n );\n },\n [date, docRecords]\n );\n\n const createdToday = useMemo(\n () => getTodaysPages('createDate'),\n [getTodaysPages]\n );\n const updatedToday = useMemo(\n () => getTodaysPages('updatedDate'),\n [getTodaysPages]\n );\n\n const headerItems = useMemo(\n () => [\n {\n name: 'createdToday',\n label: t['com.arms.journal.created-today'](),\n count: createdToday.length,\n },\n {\n name: 'updatedToday',\n label: t['com.arms.journal.updated-today'](),\n count: updatedToday.length,\n },\n ],\n [createdToday.length, t, updatedToday.length]\n );\n\n const activeIndex = headerItems.findIndex(({ name }) => name === activeItem);\n\n const vars = assignInlineVars({\n '--active-index': String(activeIndex),\n '--item-count': String(headerItems.length),\n });\n\n return (\n
\n
\n {headerItems.map(({ label, count, name }, index) => {\n return (\n setActiveItem(name)}\n aria-selected={activeItem === name}\n className={styles.dailyCountNav}\n key={index}\n >\n {label}\n  \n \n \n );\n })}\n
\n\n
\n {headerItems.map(({ name }) => {\n const renderList =\n name === 'createdToday' ? createdToday : updatedToday;\n if (renderList.length === 0)\n return (\n
\n \n
\n );\n return (\n \n \n \n
\n {renderList.map((pageRecord, index) => (\n \n ))}\n
\n
\n
\n );\n })}\n
\n
\n );\n};\n\nconst MAX_CONFLICT_COUNT = 5;\ninterface ConflictListProps\n extends PropsWithChildren,\n HTMLAttributes {\n docRecords: DocRecord[];\n}\nconst ConflictList = ({\n docRecords,\n children,\n className,\n ...attrs\n}: ConflictListProps) => {\n const workspace = useService(WorkspaceService).workspace;\n const currentDoc = useService(DocService).doc;\n const { setTrashModal } = useTrashModalHelper(workspace.docCollection);\n\n const handleOpenTrashModal = useCallback(\n (docRecord: DocRecord) => {\n setTrashModal({\n open: true,\n pageIds: [docRecord.id],\n pageTitles: [docRecord.title$.value],\n });\n },\n [setTrashModal]\n );\n\n return (\n
\n {docRecords.map(docRecord => {\n const isCurrent = docRecord.id === currentDoc.id;\n return (\n handleOpenTrashModal(docRecord)}\n />\n }\n >\n \n \n \n \n }\n />\n );\n })}\n {children}\n
\n );\n};\nconst JournalConflictBlock = ({ date }: JournalBlockProps) => {\n const t = useI18n();\n const workspace = useService(WorkspaceService).workspace;\n const docRecordList = useService(DocsService).list;\n const journalHelper = useJournalHelper(workspace.docCollection);\n const docs = journalHelper.getJournalsByDate(date.format('YYYY-MM-DD'));\n const docRecords = useLiveData(\n docRecordList.docs$.map(records =>\n records.filter(v => {\n return docs.some(doc => doc.id === v.id);\n })\n )\n );\n\n if (docs.length <= 1) return null;\n\n return (\n \n {docs.length > MAX_CONFLICT_COUNT ? (\n \n }\n >\n
\n {t['com.arms.journal.conflict-show-more']({\n count: (docRecords.length - MAX_CONFLICT_COUNT).toFixed(0),\n })}\n
\n \n ) : null}\n \n );\n};\n","import type { AffineEditorContainer } from '@blocksuite/presets';\nimport { OutlinePanel } from '@blocksuite/presets';\nimport { useCallback, useRef } from 'react';\n\nimport * as styles from './outline.css';\n\n// A wrapper for TOCNotesPanel\nexport const EditorOutlinePanel = ({\n editor,\n}: {\n editor: AffineEditorContainer | null;\n}) => {\n const outlinePanelRef = useRef(null);\n\n const onRefChange = useCallback((container: HTMLDivElement | null) => {\n if (container) {\n if (outlinePanelRef.current === null) {\n console.error('outline panel should be initialized');\n return;\n }\n container.append(outlinePanelRef.current);\n }\n }, []);\n\n if (!editor) {\n return;\n }\n\n if (!outlinePanelRef.current) {\n outlinePanelRef.current = new OutlinePanel();\n }\n\n if (editor !== outlinePanelRef.current?.editor) {\n (outlinePanelRef.current as OutlinePanel).editor = editor;\n (outlinePanelRef.current as OutlinePanel).fitPadding = [20, 20, 20, 20];\n }\n\n return
;\n};\n","import \"../core/src/pages/workspace/detail-page/tabs/outline.css.ts.vanilla.css!=!../../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/pages/workspace/detail-page/tabs/outline.css.ts.vanilla.css\\\",\\\"source\\\":\\\"Ll8xamU3bHAyMCB7CiAgZGlzcGxheTogZmxleDsKICBoZWlnaHQ6IDEwMCU7CiAgd2lkdGg6IDEwMCU7Cn0=\\\"}!../../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var root = '_1je7lp20';","import { Scrollable, useHasScrollTop } from '@affine/component';\nimport { PageDetailSkeleton } from '@affine/component/page-detail-skeleton';\n//import type { ChatPanel } from '@affine/core/blocksuite/presets/ai'; 24-10-02 삭제\nimport { AIProvider } from '@affine/core/blocksuite/presets/ai';\n// import { PageAIOnboarding } from '@affine/core/components/affine/ai-onboarding'; 24-10-02 삭제\nimport { EditorOutlineViewer } from '@affine/core/components/blocksuite/outline-viewer';\nimport { useAppSettingHelper } from '@affine/core/hooks/affine/use-app-setting-helper';\nimport { useDocMetaHelper } from '@affine/core/hooks/use-block-suite-page-meta';\nimport { RecentDocsService } from '@affine/core/modules/quicksearch';\nimport { ViewService } from '@affine/core/modules/workbench/services/view';\nimport type { PageRootService } from '@blocksuite/blocks';\nimport {\n BookmarkBlockService,\n customImageProxyMiddleware,\n EmbedGithubBlockService,\n EmbedLoomBlockService,\n EmbedYoutubeBlockService,\n ImageBlockService,\n} from '@blocksuite/blocks';\nimport { DisposableGroup } from '@blocksuite/global/utils';\nimport { FrameIcon, TocIcon, TodayIcon } from '@blocksuite/icons/rc';\nimport { type AffineEditorContainer } from '@blocksuite/presets';\nimport type { Doc as BlockSuiteDoc } from '@blocksuite/store';\nimport type { Doc } from '@toeverything/infra';\nimport {\n DocService,\n DocsService,\n FrameworkScope,\n globalBlockSuiteSchema,\n GlobalContextService,\n useLiveData,\n useService,\n WorkspaceService,\n} from '@toeverything/infra';\nimport clsx from 'clsx';\nimport type { ReactElement } from 'react';\nimport {\n memo,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { useParams } from 'react-router-dom';\nimport type { Map as YMap } from 'yjs';\n\nimport { AffineErrorBoundary } from '../../../components/affine/affine-error-boundary';\nimport { GlobalPageHistoryModal } from '../../../components/affine/page-history-modal';\nimport { PageDetailEditor } from '../../../components/page-detail-editor';\nimport { TrashPageFooter } from '../../../components/pure/trash-page-footer';\nimport { TopTip } from '../../../components/top-tip';\nimport { useRegisterBlocksuiteEditorCommands } from '../../../hooks/affine/use-register-blocksuite-editor-commands';\nimport { useActiveBlocksuiteEditor } from '../../../hooks/use-block-suite-editor';\nimport { usePageDocumentTitle } from '../../../hooks/use-global-state';\nimport { useNavigateHelper } from '../../../hooks/use-navigate-helper';\nimport {\n useIsActiveView,\n ViewBody,\n ViewHeader,\n ViewSidebarTab,\n WorkbenchService,\n} from '../../../modules/workbench';\nimport { performanceRenderLogger } from '../../../shared';\nimport { PageNotFound } from '../../404';\nimport * as styles from './detail-page.css';\nimport { DetailPageHeader } from './detail-page-header';\n//import { EditorChatPanel } from './tabs/chat'; 24-10-02 삭제\n//import { EditorFramePanel } from './tabs/frame';\nimport { EditorJournalPanel } from './tabs/journal';\nimport { EditorOutlinePanel } from './tabs/outline';\n\nconst DetailPageImpl = memo(function DetailPageImpl() {\n const workbench = useService(WorkbenchService).workbench;\n const view = useService(ViewService).view;\n const activeSidebarTab = useLiveData(view.activeSidebarTab$);\n\n const doc = useService(DocService).doc;\n const isInTrash = useLiveData(doc.meta$.map(meta => meta.trash));\n const { openPage, jumpToPageBlock, jumpToTag } = useNavigateHelper();\n const [editor, setEditor] = useState(null);\n const workspace = useService(WorkspaceService).workspace;\n const globalContext = useService(GlobalContextService).globalContext;\n const docCollection = workspace.docCollection;\n const mode = useLiveData(doc.mode$);\n const isSideBarOpen = useLiveData(workbench.sidebarOpen$);\n const { appSettings } = useAppSettingHelper();\n //const chatPanelRef = useRef(null);\n const { setDocReadonly } = useDocMetaHelper(workspace.docCollection);\n\n const isActiveView = useIsActiveView();\n // TODO(@eyhn): remove jotai here\n const [_, setActiveBlockSuiteEditor] = useActiveBlocksuiteEditor();\n\n useEffect(() => {\n if (isActiveView) {\n setActiveBlockSuiteEditor(editor);\n }\n }, [editor, isActiveView, setActiveBlockSuiteEditor]);\n\n useEffect(() => {\n const disposable = AIProvider.slots.requestOpenWithChat.on(() => {\n workbench.openSidebar();\n view.activeSidebarTab('journal');\n });\n return () => disposable.dispose();\n }, [activeSidebarTab, view, workbench]);\n\n useEffect(() => {\n if (isActiveView) {\n globalContext.docId.set(doc.id);\n globalContext.isDoc.set(true);\n\n return () => {\n globalContext.docId.set(null);\n globalContext.isDoc.set(false);\n };\n }\n return;\n }, [doc, globalContext, isActiveView]);\n\n useEffect(() => {\n if (isActiveView) {\n globalContext.docMode.set(mode);\n\n return () => {\n globalContext.docMode.set(null);\n };\n }\n return;\n }, [doc, globalContext, isActiveView, mode]);\n\n useEffect(() => {\n if ('isMobile' in environment && environment.isMobile) {\n setDocReadonly(doc.id, true);\n }\n }, [doc.id, setDocReadonly]);\n\n useEffect(() => {\n if (isActiveView) {\n globalContext.isTrashDoc.set(!!isInTrash);\n\n return () => {\n globalContext.isTrashDoc.set(null);\n };\n }\n return;\n }, [globalContext, isActiveView, isInTrash]);\n\n useRegisterBlocksuiteEditorCommands();\n const title = useLiveData(doc.title$);\n usePageDocumentTitle(title);\n\n const onLoad = useCallback(\n (bsPage: BlockSuiteDoc, editor: AffineEditorContainer) => {\n try {\n // todo(joooye34): improve the following migration code\n const surfaceBlock = bsPage.getBlockByFlavour('affine:surface')[0];\n // hotfix for old page\n if (\n surfaceBlock &&\n (surfaceBlock.yBlock.get('prop:elements') as YMap).get(\n 'type'\n ) !== '$blocksuite:internal:native$'\n ) {\n globalBlockSuiteSchema.upgradeDoc(\n 0,\n {\n 'affine:surface': 3,\n },\n bsPage.spaceDoc\n );\n }\n } catch {}\n\n // blocksuite editor host\n const editorHost = editor.host;\n\n // provide image proxy endpoint to blocksuite\n editorHost?.std.clipboard.use(\n customImageProxyMiddleware(runtimeConfig.imageProxyUrl)\n );\n ImageBlockService.setImageProxyURL(runtimeConfig.imageProxyUrl);\n\n // provide link preview endpoint to blocksuite\n BookmarkBlockService.setLinkPreviewEndpoint(runtimeConfig.linkPreviewUrl);\n EmbedGithubBlockService.setLinkPreviewEndpoint(\n runtimeConfig.linkPreviewUrl\n );\n EmbedYoutubeBlockService.setLinkPreviewEndpoint(\n runtimeConfig.linkPreviewUrl\n );\n EmbedLoomBlockService.setLinkPreviewEndpoint(\n runtimeConfig.linkPreviewUrl\n );\n\n // provide page mode and updated date to blocksuite\n const pageService =\n editorHost?.std.spec.getService('affine:page');\n const disposable = new DisposableGroup();\n if (pageService) {\n disposable.add(\n pageService.slots.docLinkClicked.on(({ docId, blockId }) => {\n return blockId\n ? jumpToPageBlock(docCollection.id, docId, blockId)\n : openPage(docCollection.id, docId);\n })\n );\n disposable.add(\n pageService.slots.tagClicked.on(({ tagId }) => {\n jumpToTag(workspace.id, tagId);\n })\n );\n }\n\n setEditor(editor);\n\n return () => {\n disposable.dispose();\n };\n },\n [jumpToPageBlock, docCollection.id, openPage, jumpToTag, workspace.id]\n );\n\n const [refCallback, hasScrollTop] = useHasScrollTop();\n const dynamicTopBorder = environment.isDesktop;\n\n const openOutlinePanel = useCallback(() => {\n workbench.openSidebar();\n view.activeSidebarTab('outline');\n }, [workbench, view]);\n\n return (\n <>\n \n \n \n \n \n {/* Add a key to force rerender when page changed, to avoid error boundary persisting. */}\n \n \n \n \n \n \n \n \n \n \n {isInTrash ? : null}\n
\n \n\n {/* } unmountOnInactive={false}>\n \n 24-10-02 */}\n\n }>\n \n \n\n }>\n \n \n\n {/* }>\n \n */}\n\n \n {/* 24-10-02 삭제*/}\n \n );\n});\n\nexport const DetailPage = ({ pageId }: { pageId: string }): ReactElement => {\n const currentWorkspace = useService(WorkspaceService).workspace;\n const docsService = useService(DocsService);\n const docRecordList = docsService.list;\n const docListReady = useLiveData(docRecordList.isReady$);\n const docRecord = useLiveData(docRecordList.doc$(pageId));\n\n const [doc, setDoc] = useState(null);\n\n useLayoutEffect(() => {\n if (!docRecord) {\n return;\n }\n const { doc: opened, release } = docsService.open(pageId);\n setDoc(opened);\n return () => {\n release();\n };\n }, [docRecord, docsService, pageId]);\n\n // set sync engine priority target\n useEffect(() => {\n currentWorkspace.engine.doc.setPriority(pageId, 10);\n return () => {\n currentWorkspace.engine.doc.setPriority(pageId, 5);\n };\n }, [currentWorkspace, pageId]);\n\n const isInTrash = useLiveData(doc?.meta$.map(meta => meta.trash));\n\n useEffect(() => {\n if (doc && isInTrash) {\n currentWorkspace.docCollection.awarenessStore.setReadonly(\n doc.blockSuiteDoc.blockCollection,\n true\n );\n }\n }, [currentWorkspace.docCollection.awarenessStore, doc, isInTrash]);\n\n // if sync engine has been synced and the page is null, show 404 page.\n if (docListReady && !doc) {\n return ;\n }\n\n if (!doc) {\n return ;\n }\n\n return (\n \n \n \n );\n};\n\nexport const Component = () => {\n performanceRenderLogger.debug('DetailPage');\n\n const params = useParams();\n const recentPages = useService(RecentDocsService);\n\n useEffect(() => {\n if (params.pageId) {\n const pageId = params.pageId;\n localStorage.setItem('last_page_id', pageId);\n\n recentPages.addRecentDoc(pageId);\n }\n }, [params, recentPages]);\n\n const pageId = params.pageId;\n\n return pageId ? : null;\n};\n","import { toast } from '@affine/component';\nimport { openInfoModalAtom } from '@affine/core/atoms';\nimport {\n PreconditionStrategy,\n registerAffineCommand,\n} from '@affine/core/commands';\nimport { track } from '@affine/core/mixpanel';\nimport { CompatibleFavoriteItemsAdapter } from '@affine/core/modules/properties';\nimport { WorkspaceFlavour } from '@affine/env/workspace';\nimport { useI18n } from '@affine/i18n';\nimport { EdgelessIcon, HistoryIcon, PageIcon } from '@blocksuite/icons/rc';\nimport {\n DocService,\n useLiveData,\n useService,\n WorkspaceService,\n} from '@toeverything/infra';\nimport { useSetAtom } from 'jotai';\nimport { useCallback, useEffect } from 'react';\n\nimport { pageHistoryModalAtom } from '../../atoms/page-history';\nimport { useBlockSuiteMetaHelper } from './use-block-suite-meta-helper';\nimport { useExportPage } from './use-export-page';\nimport { useTrashModalHelper } from './use-trash-modal-helper';\n\nexport function useRegisterBlocksuiteEditorCommands() {\n const doc = useService(DocService).doc;\n const docId = doc.id;\n const mode = useLiveData(doc.mode$);\n const t = useI18n();\n const workspace = useService(WorkspaceService).workspace;\n const docCollection = workspace.docCollection;\n\n const favAdapter = useService(CompatibleFavoriteItemsAdapter);\n const favorite = useLiveData(favAdapter.isFavorite$(docId, 'doc'));\n const trash = useLiveData(doc.trash$);\n\n const setPageHistoryModalState = useSetAtom(pageHistoryModalAtom);\n const setInfoModalState = useSetAtom(openInfoModalAtom);\n\n const openHistoryModal = useCallback(() => {\n setPageHistoryModalState(() => ({\n pageId: docId,\n open: true,\n }));\n }, [docId, setPageHistoryModalState]);\n\n const openInfoModal = useCallback(() => {\n setInfoModalState(true);\n }, [setInfoModalState]);\n\n const { duplicate } = useBlockSuiteMetaHelper(docCollection);\n const exportHandler = useExportPage(doc.blockSuiteDoc);\n const { setTrashModal } = useTrashModalHelper(docCollection);\n const onClickDelete = useCallback(\n (title: string) => {\n setTrashModal({\n open: true,\n pageIds: [docId],\n pageTitles: [title],\n });\n },\n [docId, setTrashModal]\n );\n\n const isCloudWorkspace = workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD;\n\n useEffect(() => {\n const unsubs: Array<() => void> = [];\n const preconditionStrategy = () =>\n PreconditionStrategy.InPaperOrEdgeless && !trash;\n\n // TODO(@Peng): add back when edgeless presentation is ready\n\n // this is pretty hack and easy to break. need a better way to communicate with blocksuite editor\n // unsubs.push(\n // registerAffineCommand({\n // id: 'editor:edgeless-presentation-start',\n // preconditionStrategy: () => PreconditionStrategy.InEdgeless && !trash,\n // category: 'editor:edgeless',\n // icon: ,\n // label: t['com.arms.cmdk.affine.editor.edgeless.presentation-start'](),\n // run() {\n // document\n // .querySelector('edgeless-toolbar')\n // ?.shadowRoot?.querySelector(\n // '.edgeless-toolbar-left-part > edgeless-tool-icon-button:last-child'\n // )\n // ?.click();\n // },\n // })\n // );\n\n unsubs.push(\n registerAffineCommand({\n id: `editor:${mode}-view-info`,\n preconditionStrategy: () =>\n PreconditionStrategy.InPaperOrEdgeless &&\n !trash &&\n runtimeConfig.enableInfoModal,\n category: `editor:${mode}`,\n icon: mode === 'page' ? : ,\n label: t['com.arms.page-properties.page-info.view'](),\n run() {\n track.$.cmdk.docInfo.open();\n\n openInfoModal();\n },\n })\n );\n\n unsubs.push(\n registerAffineCommand({\n id: `editor:${mode}-${favorite ? 'remove-from' : 'add-to'}-favourites`,\n preconditionStrategy,\n category: `editor:${mode}`,\n icon: mode === 'page' ? : ,\n label: favorite\n ? t['com.arms.favoritePageOperation.remove']()\n : t['com.arms.favoritePageOperation.add'](),\n run() {\n favAdapter.toggle(docId, 'doc');\n track.$.cmdk.editor.toggleFavorite();\n\n toast(\n favorite\n ? t['com.arms.cmdk.affine.editor.remove-from-favourites']()\n : t['com.arms.cmdk.affine.editor.add-to-favourites']()\n );\n },\n })\n );\n\n unsubs.push(\n registerAffineCommand({\n id: `editor:${mode}-convert-to-${\n mode === 'page' ? 'edgeless' : 'page'\n }`,\n preconditionStrategy,\n category: `editor:${mode}`,\n icon: mode === 'page' ? : ,\n label: `${t['Convert to ']()}${\n mode === 'page'\n ? t['com.arms.pageMode.edgeless']()\n : t['com.arms.pageMode.page']()\n }`,\n run() {\n track.$.cmdk.editor.switchPageMode({\n mode: mode === 'page' ? 'edgeless' : 'page',\n });\n\n doc.toggleMode();\n toast(\n mode === 'page'\n ? t['com.arms.toastMessage.edgelessMode']()\n : t['com.arms.toastMessage.pageMode']()\n );\n },\n })\n );\n\n // TODO(@Peng): should not show duplicate for journal\n unsubs.push(\n registerAffineCommand({\n id: `editor:${mode}-duplicate`,\n preconditionStrategy,\n category: `editor:${mode}`,\n icon: mode === 'page' ? : ,\n label: t['com.arms.header.option.duplicate'](),\n run() {\n duplicate(docId);\n track.$.cmdk.editor.createDoc({\n control: 'duplicate',\n });\n },\n })\n );\n\n unsubs.push(\n registerAffineCommand({\n id: `editor:${mode}-export-to-pdf`,\n preconditionStrategy: () => mode === 'page' && !trash,\n category: `editor:${mode}`,\n icon: mode === 'page' ? : ,\n label: t['Export to PDF'](),\n async run() {\n track.$.cmdk.editor.export({\n type: 'pdf',\n });\n\n await exportHandler('pdf');\n },\n })\n );\n\n unsubs.push(\n registerAffineCommand({\n id: `editor:${mode}-export-to-html`,\n preconditionStrategy,\n category: `editor:${mode}`,\n icon: mode === 'page' ? : ,\n label: t['Export to HTML'](),\n async run() {\n track.$.cmdk.editor.export({\n type: 'html',\n });\n\n await exportHandler('html');\n },\n })\n );\n\n unsubs.push(\n registerAffineCommand({\n id: `editor:${mode}-export-to-png`,\n preconditionStrategy: () => mode === 'page' && !trash,\n category: `editor:${mode}`,\n icon: mode === 'page' ? : ,\n label: t['Export to PNG'](),\n async run() {\n track.$.cmdk.editor.export({\n type: 'png',\n });\n\n await exportHandler('png');\n },\n })\n );\n\n unsubs.push(\n registerAffineCommand({\n id: `editor:${mode}-export-to-markdown`,\n preconditionStrategy,\n category: `editor:${mode}`,\n icon: mode === 'page' ? : ,\n label: t['Export to Markdown'](),\n async run() {\n track.$.cmdk.editor.export({\n type: 'markdown',\n });\n\n await exportHandler('markdown');\n },\n })\n );\n\n unsubs.push(\n registerAffineCommand({\n id: `editor:${mode}-move-to-trash`,\n preconditionStrategy,\n category: `editor:${mode}`,\n icon: mode === 'page' ? : ,\n label: t['com.arms.moveToTrash.title'](),\n run() {\n track.$.cmdk.editor.deleteDoc();\n\n onClickDelete(doc.title$.value);\n },\n })\n );\n\n unsubs.push(\n registerAffineCommand({\n id: `editor:${mode}-restore-from-trash`,\n preconditionStrategy: () =>\n PreconditionStrategy.InPaperOrEdgeless && trash,\n category: `editor:${mode}`,\n icon: mode === 'page' ? : ,\n label: t['com.arms.cmdk.affine.editor.restore-from-trash'](),\n run() {\n track.$.cmdk.editor.restoreDoc();\n\n doc.restoreFromTrash();\n },\n })\n );\n\n if (isCloudWorkspace) {\n unsubs.push(\n registerAffineCommand({\n id: `editor:${mode}-page-history`,\n category: `editor:${mode}`,\n icon: ,\n label: t['com.arms.cmdk.affine.editor.reveal-page-history-modal'](),\n run() {\n track.$.cmdk.docHistory.open();\n\n openHistoryModal();\n },\n })\n );\n }\n\n unsubs.push(\n registerAffineCommand({\n id: 'alert-ctrl-s',\n category: 'affine:general',\n preconditionStrategy: PreconditionStrategy.Never,\n keyBinding: {\n binding: '$mod+s',\n },\n label: '',\n icon: null,\n run() {\n toast(t['Save']());\n },\n })\n );\n\n return () => {\n unsubs.forEach(unsub => unsub());\n };\n }, [\n favorite,\n mode,\n onClickDelete,\n exportHandler,\n t,\n trash,\n isCloudWorkspace,\n openHistoryModal,\n duplicate,\n favAdapter,\n docId,\n doc,\n openInfoModal,\n ]);\n}\n","import \"../core/src/pages/workspace/detail-page/detail-page.css.ts.vanilla.css!=!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/pages/workspace/detail-page/detail-page.css.ts.vanilla.css\\\",\\\"source\\\":\\\"LmlnaTl3NTAgewogIGNvbnRhaW5lci10eXBlOiBpbmxpbmUtc2l6ZTsKICBkaXNwbGF5OiBmbGV4OwogIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47CiAgZmxleDogMTsKICBvdmVyZmxvdzogaGlkZGVuOwogIGJvcmRlci10b3A6IDAuNXB4IHNvbGlkIHRyYW5zcGFyZW50OwogIHRyYW5zaXRpb246IGJvcmRlci1jb2xvciAwLjJzOwp9Ci5pZ2k5dzUwW2RhdGEtZHluYW1pYy10b3AtYm9yZGVyPSJmYWxzZSJdIHsKICBib3JkZXItY29sb3I6IHZhcigtLWFmZmluZS1ib3JkZXItY29sb3IpOwp9Ci5pZ2k5dzUwW2RhdGEtaGFzLXNjcm9sbC10b3A9InRydWUiXSB7CiAgYm9yZGVyLWNvbG9yOiB2YXIoLS1hZmZpbmUtYm9yZGVyLWNvbG9yKTsKfQouaWdpOXc1MSB7CiAgcG9zaXRpb246IHJlbGF0aXZlOwogIGRpc3BsYXk6IGZsZXg7CiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjsKICBmbGV4OiAxOwogIHotaW5kZXg6IDA7Cn0KLmlnaTl3NTIgewogIGRpc3BsYXk6IGZsZXg7CiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjsKICBjb250YWluZXItbmFtZTogdmlld3BvcnQ7CiAgY29udGFpbmVyLXR5cGU6IGlubGluZS1zaXplOwogIGJhY2tncm91bmQ6IHZhcigtLWFmZmluZS1iYWNrZ3JvdW5kLXByaW1hcnktY29sb3IpOwp9Ci5pZ2k5dzUzIHsKICBtYXJnaW4tcmlnaHQ6IDRweDsKfQpAbWVkaWEgcHJpbnQgewogIC5pZ2k5dzUyIHsKICAgIGRpc3BsYXk6IG5vbmU7CiAgICB6LWluZGV4OiAtMTsKICB9Cn0=\\\"}!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var affineDocViewport = 'igi9w52';\nexport var editorContainer = 'igi9w51';\nexport var mainContainer = 'igi9w50';\nexport var scrollbar = 'igi9w53';"],"names":["weakMap","WeakMap","useDocCollectionPageTitle","docCollection","pageId","titleAtom","getAtom","w","has","set","Map","map","get","assertExists","baseAtom","atom","getDoc","meta","title","onMount","disposable","docMetaUpdated","on","page","dispose","useAtomValue","localizedJournalDate","useJournalInfoHelper","pageHistoryModalAtom","open","switchItem","EdgelessRadioItem","value","label","EdgelessSwitchItem","testId","className","PageRadioItem","PageSwitchItem","PureEditorModeSwitch","mode","setMode","hidePage","hideEdgeless","items","useMemo","RadioGroup","iconMode","itemHeight","borderRadius","padding","gap","onChange","logger","DebugLogger","useDocSnapshotList","workspaceId","pageDocId","data","loadingMore","loadMore","useQueryInfinite","query","listHistoryQuery","getVariables","_","previousPageData","before","workspace","histories","at","timestamp","take","shouldLoadMore","lastPage","length","flatMap","snapshotFetcher","ts","res","fetch","ok","snapshot","arrayBuffer","docCollectionMap","getOrCreateShellWorkspace","blobStorage","CloudBlobStorage","DocCollection","id","blobSources","main","schema","globalBlockSuiteSchema","disableBacklinkIndex","disableSearchIndex","doc","emit","usePageHistory","useSWRImmutable","fetcher","suspense","undefined","useSnapshotPage","historyShellWorkspace","createDoc","awarenessStore","setReadonly","blockCollection","spaceDoc","load","applyUpdate","Uint8Array","upgradeDoc","useEffect","update","encodeStateAsUpdate","historyListGroupByDay","history","day","i18nTime","relative","max","accuracy","weekday","absolute","noYear","list","push","entries","useRestorePage","useDocCollectionPage","mutateQueryResource","useMutateQueryResource","trigger","recover","isMutating","useMutation","mutation","recoverDocMutation","getDocMeta","setDocTitle","useDocMetaHelper","onRestore","version","guid","revertUpdate","snapshotUpdate","getMetadata","snapshotDoc","YDoc","currentStateVector","encodeStateVector","snapshotStateVector","changesSinceSnapshotUpdate","undoManager","UndoManager","share","keys","key","type","getText","getMap","getArray","undo","revertChangesSinceSnapshotUpdate","assertEquals","docId","vars","info","EmptyHistoryShape","svg","width","height","viewBox","fill","xmlns","rect","x","y","stroke","path","d","ellipse","cx","cy","rx","ry","transform","modalContent","contentOptions","onPointerDownOutside","e","preventDefault","style","maxWidth","backgroundColor","overflow","ModalContainer","onOpenChange","children","Modal","withoutCloseButton","HistoryEditorPreview","historyList","snapshotPage","onModeChange","onModeChangeWithTrack","useCallback","track","$","docHistory","switchPageMode","content","div","noDate","AffineErrorBoundary","Scrollable","Root","Viewport","BlockSuiteEditor","Scrollbar","Loading","size","_item","i","historyIndex","findIndex","h","distance","flag","toString","data-distance","planPromptClosedAtom","PlanPrompt","workspaceQuotaService","useService","WorkspaceQuotaService","quota","revalidate","workspaceQuota","useLiveData","quota$","isProWorkspace","humanReadable","name","toLowerCase","permissionService","WorkspacePermissionService","isOwner","permission","isOwner$","setSettingModalAtom","useSetAtom","openSettingModalAtom","planPromptClosed","setPlanPromptClosed","useAtom","closeFreePlanPrompt","onClickUpgrade","activeTab","scrollAnchor","viewPlans","t","useI18n","planTitle","IconButton","onClick","CloseIcon","planDescription","Trans","i18nKey","b","span","PageHistoryList","onLoadMore","activeVersion","onVersionChange","historyListByDay","collapsedMap","setCollapsedMap","useState","useLayoutEffect","collapsed","Collapsible","role","prev","data-testid","ToggleCollapseIcon","data-collapsed","idx","Fragment","stopPropagation","data-active","button","Button","variant","loading","disabled","EmptyHistoryPrompt","PageHistoryManager","onClose","setActiveVersion","openConfirmModal","useConfirmModal","handleRestore","DocService","mode$","onConfirmRestore","description","cancelText","confirmText","confirmButtonOptions","onConfirm","styles","data-empty","PageHistoryModal","Suspense","fallback","EditorLoading","GlobalPageHistoryModal","setState","WorkspaceService","handleOpenChange","buttonContainer","icon","TrashPageFooter","appSettings","useAppSettingHelper","jumpToSubPath","useNavigateHelper","restoreFromTrash","useBlockSuiteMetaHelper","setOpen","hintText","toast","meta$","onConfirmDelete","WorkspaceSubPath","ALL","removeDoc","onDelete","data-has-background","clientBorder","tooltip","prefix","ResetIcon","prefixClassName","DeleteIcon","ConfirmModal","BrowserWarning","show","message","LocalDemoTips","isLoggedIn","onLogin","onEnableCloud","buttonLabel","handleClick","background","cssVar","shouldShowWarning","environment","isDesktop","isBrowser","isMobile","isChrome","chromeVersion","OSWarningMessage","notChrome","notGoodVersion","strong","TopTip","loginStatus","AuthService","session","status$","showWarning","setShowWarning","showLocalDemoTips","setShowLocalDemoTips","confirmEnableCloud","useEnableCloud","setAuthModal","authAtom","openModal","state","flavour","WorkspaceFlavour","LOCAL","openPageId","exportHandler","editorRoot","document","querySelector","pageService","spec","getService","sharePanel","export","HtmlTransformer","exportDoc","MarkdownTransformer","apis","savePDFFileAs","root","exportManager","exportPdf","exportPng","useExportPage","pushGlobalLoadingEvent","pushGlobalLoadingEventAtom","resolveGlobalLoadingEvent","resolveGlobalLoadingEventAtom","globalLoadingID","nanoid","notify","success","err","console","error","useFavorite","favAdapter","CompatibleFavoriteItemsAdapter","favorite","isFavorite$","toggleFavorite","toggle","FavoriteButton","handleFavorite","header","actions","FavoriteTag","active","InfoButton","setOpenInfoModal","openInfoModalAtom","onOpenInfoModal","openDocInfo","InformationIcon","weekStyle","JournalWeekDatePicker","handleRef","useRef","journalDate","openJournal","useJournalRouteHelper","date","setDate","dayjs","format","current","setCursor","WeekDatePicker","JournalTodayButton","journalHelper","onToday","openToday","columnContainerStyle","descriptionStyle","menuItemStyle","menuStyle","rowContainerStyle","titleContainerStyle","generateUrl","urlType","blockId","baseUrl","getAffineCloudBaseUrl","URL","useSharingUrl","setBlockId","editor","useActiveBlocksuiteEditor","sharingUrl","onClickCopyLink","navigator","clipboard","writeText","then","catch","copyShareLink","selectManager","host","selection","currentBlockSelection","find","slots","changed","selections","ShareExport","workspaceMetadata","currentPage","currentMode","isMac","isMacOs","ExportMenuItems","pageMode","Divider","MenuItem","onSelect","block","preFix","MenuIcon","CopyIcon","fontSize","endFix","LocalSharePage","props","onEnableAffineCloud","CloudSvg","AffineSharePage","shareService","ShareService","serverConfig","ServerConfigService","isSharedPage","isShared$","sharedMode","sharedMode$","config$","c","isLoading","showDisable","setShowDisable","currentDocMode","modeOptions","onClickCreateLink","useAsyncCallback","enableShare","PublicPageMode","Edgeless","Page","createShareLink","SingleSelectSelectSolidIcon","color","onDisablePublic","disableShare","log","onShareModeChange","changeShare","preMode","Skeleton","Input","inputStyle","lineHeight","readOnly","whiteSpace","Copy","Create","runtimeConfig","ArrowRightSmallIcon","PublicLinkDisableModal","SharePage","AFFINE_CLOUD","ErrorBoundary","ShareMenuContent","WebIcon","DefaultShareButton","forwardRef","ref","shared","LocalShareMenu","Menu","rootOptions","modal","onOpenShareModal","CloudShareMenu","ShareMenu","useDetailPageHeaderResponsive","workbench","WorkbenchService","viewPosition","useViewPosition","workbenchViewsCount","views$","views","rightSidebarOpen","sidebarOpen$","hideShare","availableWidth","hidePresent","showDivider","isLast","hideCollect","hideToday","HeaderDropDownButton","MoreHorizontalIcon","displayName","PageHeaderMenuButton","rename","isJournal","containerWidth","isInTrash","m","trash","duplicate","importFile","usePageHelper","setTrashModal","useTrashModalHelper","view","ViewService","openSidePanel","openSidebar","activeSidebarTab","openAllFrames","openOutlinePanel","historyModalOpen","setHistoryModalOpen","setOpenHistoryTipsModal","openHistoryTipsModalAtom","openHistoryModal","openInfoModal","pageInfo","handleOpenInNewTab","openDoc","handleOpenInSplitView","handleOpenTrashModal","docOptions","deleteDoc","pageIds","pageTitles","handleRename","renameDoc","transition","handleMenuOpenChange","blockSuiteDoc","handleDuplicate","control","onImportFile","options","import","isWorkspaceFile","createWorkspace","handleShareMenuOpenChange","handleToggleFavorite","ResponsiveMenuItems","MenuSub","subContentOptions","sideOffset","alignOffset","triggerOptions","ShareIcon","subOptions","MenuSeparator","EditMenu","showResponsiveMenu","EditIcon","FavoritedIcon","FavoriteIcon","OpenInNewIcon","SplitViewIcon","TocIcon","FrameIcon","HistoryIcon","DuplicateIcon","ImportIcon","Export","MoveToTrash","align","DetailPageHeaderPresentButton","isPresent","handlePresent","usePresent","flexShrink","PresentationIcon","SharePageButton","handleOpenShareModal","Header","appSidebarFloating","appSidebarFloatingAtom","data-sidebar-floating","JournalPageHeader","containerRef","setContainerWidth","container","observeResize","entry","contentRect","ViewTitle","ViewIcon","HeaderDivider","NormalPageHeader","titleInputHandleRef","onRename","setTimeout","triggerEdit","onEditSave","BlocksuiteHeaderTitle","inputHandleRef","orientation","marginLeft","DetailPageHeader","collection","useRegisterCopyLinkCommands","workspaceMeta","isActiveView","useIsActiveView","isCloud","unsubs","registerAffineCommand","category","preconditionStrategy","PreconditionStrategy","Never","keyBinding","binding","run","cmdk","general","forEach","unsub","InfoModal","dailyCountItem","CountDisplay","count","attrs","PageItem","docRecord","right","Icon","TodayIcon","EdgelessIcon","PageIcon","WorkbenchLink","aria-label","to","clsx","EditorJournalPanel","onDateSelect","isSame","customDayRenderer","data-is-date-cell","tabIndex","cell","focused","data-is-today","isToday","data-not-current-month","notCurrentMonth","data-selected","selected","data-is-journal","data-has-journal","DatePicker","weekDays","monthNames","todayLabel","JournalConflictBlock","JournalDailyCountBlock","sortPagesByDate","docs","field","order","sort","a","diff","DailyCountEmptyFallback","nodeRef","activeItem","setActiveItem","docRecords","DocsService","docs$","getTodaysPages","filter","createdToday","updatedToday","headerItems","activeIndex","assignInlineVars","String","index","aria-selected","renderList","pageRecord","ConflictList","currentDoc","title$","isCurrent","docRecordList","useJournalHelper","getJournalsByDate","records","v","some","slice","toFixed","EditorOutlinePanel","outlinePanelRef","onRefChange","append","OutlinePanel","fitPadding","DetailPageImpl","memo","activeSidebarTab$","openPage","jumpToPageBlock","jumpToTag","setEditor","globalContext","GlobalContextService","isSideBarOpen","setDocReadonly","setActiveBlockSuiteEditor","AIProvider","requestOpenWithChat","isDoc","docMode","isTrashDoc","useRegisterBlocksuiteEditorCommands","trash$","setPageHistoryModalState","setInfoModalState","onClickDelete","isCloudWorkspace","InPaperOrEdgeless","docInfo","toggleMode","restoreDoc","usePageDocumentTitle","onLoad","bsPage","surfaceBlock","getBlockByFlavour","yBlock","editorHost","std","use","customImageProxyMiddleware","ImageBlockService","setImageProxyURL","BookmarkBlockService","setLinkPreviewEndpoint","EmbedGithubBlockService","EmbedYoutubeBlockService","EmbedLoomBlockService","DisposableGroup","add","docLinkClicked","tagClicked","tagId","refCallback","hasScrollTop","useHasScrollTop","dynamicTopBorder","ViewHeader","ViewBody","data-dynamic-top-border","data-has-scroll-top","PageDetailEditor","EditorOutlineViewer","ViewSidebarTab","tabId","DetailPage","currentWorkspace","docsService","docListReady","isReady$","doc$","setDoc","opened","release","engine","setPriority","PageNotFound","noPermission","FrameworkScope","scope","PageDetailSkeleton","Component","performanceRenderLogger","debug","params","useParams","recentPages","RecentDocsService","localStorage","setItem","addRecentDoc"],"sourceRoot":""}