mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 18:02:47 +08:00
feat(core): track web-clipper import (#12599)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added tracking for document creation when importing with the clipper tool. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
|||||||
WorkspacesService,
|
WorkspacesService,
|
||||||
} from '@affine/core/modules/workspace';
|
} from '@affine/core/modules/workspace';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
|
import track from '@affine/track';
|
||||||
import { AllDocsIcon } from '@blocksuite/icons/rc';
|
import { AllDocsIcon } from '@blocksuite/icons/rc';
|
||||||
import { LiveData, useLiveData, useService } from '@toeverything/infra';
|
import { LiveData, useLiveData, useService } from '@toeverything/infra';
|
||||||
import { cssVar } from '@toeverything/theme';
|
import { cssVar } from '@toeverything/theme';
|
||||||
@@ -98,6 +99,7 @@ export const Component = () => {
|
|||||||
const handleSuccess = useCallback(() => {
|
const handleSuccess = useCallback(() => {
|
||||||
const arg = { type: 'affine-clipper:import:success' };
|
const arg = { type: 'affine-clipper:import:success' };
|
||||||
const port = port$.value;
|
const port = port$.value;
|
||||||
|
track.clipper.$.$.createDoc();
|
||||||
if (port) {
|
if (port) {
|
||||||
port.postMessage(arg);
|
port.postMessage(arg);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -544,6 +544,11 @@ interface PageEvents extends PageDivision {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
clipper: {
|
||||||
|
$: {
|
||||||
|
$: ['createDoc'];
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
type OrganizeItemType = 'doc' | 'folder' | 'collection' | 'tag' | 'favorite';
|
type OrganizeItemType = 'doc' | 'folder' | 'collection' | 'tag' | 'favorite';
|
||||||
|
|||||||
Reference in New Issue
Block a user