mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-22 00:37:05 +08:00
Compare commits
89 Commits
v0.26.3-be
...
v0.11.10
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24dc3f95ff | ||
|
|
5e9739eb3a | ||
|
|
0a89b7f528 | ||
|
|
0a0ee37ac2 | ||
|
|
a143379161 | ||
|
|
8e7dedfe82 | ||
|
|
d25a8547d0 | ||
|
|
4d16229fea | ||
|
|
99371be7e8 | ||
|
|
34ed8dd7a5 | ||
|
|
39b7b671b1 | ||
|
|
207b56d5af | ||
|
|
9e94e7195b | ||
|
|
de951c8779 | ||
|
|
fd37026ca5 | ||
|
|
4fd5812a89 | ||
|
|
d01e987ecc | ||
|
|
d87c218c0b | ||
|
|
a5bf5cc244 | ||
|
|
16bcd6e76b | ||
|
|
2e2ace8472 | ||
|
|
37cff8fe8d | ||
|
|
70ab3b4916 | ||
|
|
f42ba54578 | ||
|
|
a67c8181fc | ||
|
|
613efbded9 | ||
|
|
549419d102 | ||
|
|
21c42f8771 | ||
|
|
9012adda7a | ||
|
|
fb442e9055 | ||
|
|
a231474dd2 | ||
|
|
833b42000b | ||
|
|
7690c48710 | ||
|
|
579828a700 | ||
|
|
746db2ccfc | ||
|
|
eff344a9c1 | ||
|
|
c89ebab596 | ||
|
|
62f4421b7c | ||
|
|
42383dbd29 | ||
|
|
120e7397ba | ||
|
|
24123ad01c | ||
|
|
ad50320391 | ||
|
|
eb21a60dda | ||
|
|
c0e3be2d40 | ||
|
|
09d3b72358 | ||
|
|
246e16c6c0 | ||
|
|
dc279d062b | ||
|
|
47d5f9e1c2 | ||
|
|
a226eb8d5f | ||
|
|
908c4e1a6f | ||
|
|
1d0bcc80a0 | ||
|
|
50010bd824 | ||
|
|
c0ede1326d | ||
|
|
89197bacef | ||
|
|
f97d323ab5 | ||
|
|
2acb219dcc | ||
|
|
992ed89a89 | ||
|
|
d272d7922d | ||
|
|
c1cd1713b9 | ||
|
|
b20e91bee0 | ||
|
|
9a4e5ec8c3 | ||
|
|
2019838ae7 | ||
|
|
30ff25f400 | ||
|
|
e766208c18 | ||
|
|
8742f28148 | ||
|
|
cd291bb60e | ||
|
|
62c0efcfd1 | ||
|
|
87248b3337 | ||
|
|
00c940f7df | ||
|
|
931b459fbd | ||
|
|
51e71f4a0a | ||
|
|
9b631f2328 | ||
|
|
01f481a9b6 | ||
|
|
0177ab5c87 | ||
|
|
4db35d341c | ||
|
|
3c4a803c97 | ||
|
|
05154dc7ca | ||
|
|
c90b477f60 | ||
|
|
6f18ddbe85 | ||
|
|
dde779a71d | ||
|
|
bd9f66fbc7 | ||
|
|
92f1f40bfa | ||
|
|
48dc1049b3 | ||
|
|
9add530370 | ||
|
|
b77460d871 | ||
|
|
42db41776b | ||
|
|
075439c74f | ||
|
|
fc6c553ece | ||
|
|
59cb3d5df1 |
202
.yarn/patches/cmdk-npm-0.2.0-302237a911.patch
Normal file
202
.yarn/patches/cmdk-npm-0.2.0-302237a911.patch
Normal file
File diff suppressed because one or more lines are too long
@@ -172,6 +172,7 @@
|
|||||||
"next-auth@^4.24.5": "patch:next-auth@npm%3A4.24.5#~/.yarn/patches/next-auth-npm-4.24.5-8428e11927.patch",
|
"next-auth@^4.24.5": "patch:next-auth@npm%3A4.24.5#~/.yarn/patches/next-auth-npm-4.24.5-8428e11927.patch",
|
||||||
"@reforged/maker-appimage/@electron-forge/maker-base": "7.2.0",
|
"@reforged/maker-appimage/@electron-forge/maker-base": "7.2.0",
|
||||||
"macos-alias": "npm:macos-alias-building@latest",
|
"macos-alias": "npm:macos-alias-building@latest",
|
||||||
"fs-xattr": "npm:@napi-rs/xattr@latest"
|
"fs-xattr": "npm:@napi-rs/xattr@latest",
|
||||||
|
"@radix-ui/react-dialog": "npm:@radix-ui/react-dialog@latest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/server": "^4.9.5",
|
"@apollo/server": "^4.9.5",
|
||||||
"@auth/prisma-adapter": "^1.0.7",
|
"@auth/prisma-adapter": "^1.0.7",
|
||||||
"@aws-sdk/client-s3": "^3.454.0",
|
"@aws-sdk/client-s3": "^3.499.0",
|
||||||
"@google-cloud/opentelemetry-cloud-monitoring-exporter": "^0.17.0",
|
"@google-cloud/opentelemetry-cloud-monitoring-exporter": "^0.17.0",
|
||||||
"@google-cloud/opentelemetry-cloud-trace-exporter": "^2.1.0",
|
"@google-cloud/opentelemetry-cloud-trace-exporter": "^2.1.0",
|
||||||
"@keyv/redis": "^2.8.0",
|
"@keyv/redis": "^2.8.0",
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
OnModuleDestroy,
|
OnModuleDestroy,
|
||||||
OnModuleInit,
|
OnModuleInit,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
|
import { Cron, CronExpression } from '@nestjs/schedule';
|
||||||
import { Snapshot, Update } from '@prisma/client';
|
import { Snapshot, Update } from '@prisma/client';
|
||||||
import { chunk } from 'lodash-es';
|
import { chunk } from 'lodash-es';
|
||||||
import { defer, retry } from 'rxjs';
|
import { defer, retry } from 'rxjs';
|
||||||
@@ -79,6 +80,7 @@ export function isEmptyBuffer(buf: Buffer): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const MAX_SEQ_NUM = 0x3fffffff; // u31
|
const MAX_SEQ_NUM = 0x3fffffff; // u31
|
||||||
|
const UPDATES_QUEUE_CACHE_KEY = 'doc:manager:updates';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Since we can't directly save all client updates into database, in which way the database will overload,
|
* Since we can't directly save all client updates into database, in which way the database will overload,
|
||||||
@@ -663,26 +665,44 @@ export class DocManager implements OnModuleInit, OnModuleDestroy {
|
|||||||
count: number
|
count: number
|
||||||
) {
|
) {
|
||||||
const result = await this.cache.mapIncrease(
|
const result = await this.cache.mapIncrease(
|
||||||
`doc:manager:updates`,
|
UPDATES_QUEUE_CACHE_KEY,
|
||||||
`${workspaceId}::${guid}`,
|
`${workspaceId}::${guid}`,
|
||||||
count
|
count
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result <= 0) {
|
if (result <= 0) {
|
||||||
await this.cache.mapDelete(
|
await this.cache.mapDelete(
|
||||||
`doc:manager:updates`,
|
UPDATES_QUEUE_CACHE_KEY,
|
||||||
`${workspaceId}::${guid}`
|
`${workspaceId}::${guid}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getAutoSquashCandidateFromCache() {
|
private async getAutoSquashCandidateFromCache() {
|
||||||
const key = await this.cache.mapRandomKey('doc:manager:updates');
|
const key = await this.cache.mapRandomKey(UPDATES_QUEUE_CACHE_KEY);
|
||||||
|
|
||||||
if (key) {
|
if (key) {
|
||||||
const count = await this.cache.mapGet<number>('doc:manager:updates', key);
|
const cachedCount = await this.cache.mapIncrease(
|
||||||
if (typeof count === 'number' && count > 0) {
|
UPDATES_QUEUE_CACHE_KEY,
|
||||||
|
key,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
if (cachedCount > 0) {
|
||||||
const [workspaceId, id] = key.split('::');
|
const [workspaceId, id] = key.split('::');
|
||||||
|
const count = await this.db.update.count({
|
||||||
|
where: {
|
||||||
|
workspaceId,
|
||||||
|
id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// FIXME(@forehalo): somehow the update count in cache is not accurate
|
||||||
|
if (count === 0) {
|
||||||
|
await this.cache.mapDelete(UPDATES_QUEUE_CACHE_KEY, key);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return { id, workspaceId };
|
return { id, workspaceId };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -690,22 +710,38 @@ export class DocManager implements OnModuleInit, OnModuleDestroy {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async doWithLock<T>(lock: string, job: () => Promise<T>) {
|
private async doWithLock<T>(
|
||||||
|
lockScope: string,
|
||||||
|
lockResource: string,
|
||||||
|
job: () => Promise<T>
|
||||||
|
) {
|
||||||
|
const lock = `lock:${lockScope}:${lockResource}`;
|
||||||
const acquired = await this.cache.setnx(lock, 1, {
|
const acquired = await this.cache.setnx(lock, 1, {
|
||||||
ttl: 60 * 1000,
|
ttl: 60 * 1000,
|
||||||
});
|
});
|
||||||
|
metrics.doc.counter('lock').add(1, { scope: lockScope });
|
||||||
|
|
||||||
if (!acquired) {
|
if (!acquired) {
|
||||||
|
metrics.doc.counter('lock_failed').add(1, { scope: lockScope });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
metrics.doc.counter('lock_required').add(1, { scope: lockScope });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await job();
|
return await job();
|
||||||
} finally {
|
} finally {
|
||||||
await this.cache.delete(lock).catch(e => {
|
await this.cache
|
||||||
// safe, the lock will be expired when ttl ends
|
.delete(lock)
|
||||||
this.logger.error(`Failed to release lock ${lock}`, e);
|
.then(() => {
|
||||||
});
|
metrics.doc.counter('lock_released').add(1, { scope: lockScope });
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
metrics.doc
|
||||||
|
.counter('lock_release_failed')
|
||||||
|
.add(1, { scope: lockScope });
|
||||||
|
// safe, the lock will be expired when ttl ends
|
||||||
|
this.logger.error(`Failed to release lock ${lock}`, e);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -715,7 +751,8 @@ export class DocManager implements OnModuleInit, OnModuleDestroy {
|
|||||||
job: () => Promise<T>
|
job: () => Promise<T>
|
||||||
) {
|
) {
|
||||||
return this.doWithLock(
|
return this.doWithLock(
|
||||||
`doc:manager:updates-lock:${workspaceId}::${guid}`,
|
'doc:manager:updates',
|
||||||
|
`${workspaceId}::${guid}`,
|
||||||
job
|
job
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -726,8 +763,16 @@ export class DocManager implements OnModuleInit, OnModuleDestroy {
|
|||||||
job: () => Promise<T>
|
job: () => Promise<T>
|
||||||
) {
|
) {
|
||||||
return this.doWithLock(
|
return this.doWithLock(
|
||||||
`doc:manager:snapshot-lock:${workspaceId}::${guid}`,
|
'doc:manager:snapshot',
|
||||||
|
`${workspaceId}::${guid}`,
|
||||||
job
|
job
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Cron(CronExpression.EVERY_MINUTE)
|
||||||
|
async reportUpdatesQueueCount() {
|
||||||
|
metrics.doc
|
||||||
|
.gauge('updates_queue_count')
|
||||||
|
.record(await this.db.update.count());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,22 +48,26 @@ export class FeatureManagementService {
|
|||||||
return this.feature.listFeatureUsers(FeatureType.EarlyAccess);
|
return this.feature.listFeatureUsers(FeatureType.EarlyAccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async isEarlyAccessUser(email: string) {
|
||||||
|
const user = await this.prisma.user.findFirst({
|
||||||
|
where: {
|
||||||
|
email,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (user) {
|
||||||
|
const canEarlyAccess = await this.feature
|
||||||
|
.hasUserFeature(user.id, FeatureType.EarlyAccess)
|
||||||
|
.catch(() => false);
|
||||||
|
|
||||||
|
return canEarlyAccess;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// check early access by email
|
/// check early access by email
|
||||||
async canEarlyAccess(email: string) {
|
async canEarlyAccess(email: string) {
|
||||||
if (this.config.featureFlags.earlyAccessPreview && !this.isStaff(email)) {
|
if (this.config.featureFlags.earlyAccessPreview && !this.isStaff(email)) {
|
||||||
const user = await this.prisma.user.findFirst({
|
return this.isEarlyAccessUser(email);
|
||||||
where: {
|
|
||||||
email,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
if (user) {
|
|
||||||
const canEarlyAccess = await this.feature
|
|
||||||
.hasUserFeature(user.id, FeatureType.EarlyAccess)
|
|
||||||
.catch(() => false);
|
|
||||||
|
|
||||||
return canEarlyAccess;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -680,7 +680,7 @@ export class SubscriptionService {
|
|||||||
user: User,
|
user: User,
|
||||||
couponType: CouponType
|
couponType: CouponType
|
||||||
): Promise<string | null> {
|
): Promise<string | null> {
|
||||||
const earlyAccess = await this.features.canEarlyAccess(user.email);
|
const earlyAccess = await this.features.isEarlyAccessUser(user.email);
|
||||||
if (earlyAccess) {
|
if (earlyAccess) {
|
||||||
try {
|
try {
|
||||||
const coupon = await this.stripe.coupons.retrieve(couponType);
|
const coupon = await this.stripe.coupons.retrieve(couponType);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export class R2StorageProvider extends S3StorageProvider {
|
|||||||
super(
|
super(
|
||||||
{
|
{
|
||||||
...config,
|
...config,
|
||||||
|
forcePathStyle: true,
|
||||||
endpoint: `https://${config.accountId}.r2.cloudflarestorage.com`,
|
endpoint: `https://${config.accountId}.r2.cloudflarestorage.com`,
|
||||||
},
|
},
|
||||||
bucket
|
bucket
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export class S3StorageProvider implements StorageProvider {
|
|||||||
new PutObjectCommand({
|
new PutObjectCommand({
|
||||||
Bucket: this.bucket,
|
Bucket: this.bucket,
|
||||||
Key: key,
|
Key: key,
|
||||||
Body: body,
|
Body: blob,
|
||||||
|
|
||||||
// metadata
|
// metadata
|
||||||
ContentType: metadata.contentType,
|
ContentType: metadata.contentType,
|
||||||
|
|||||||
@@ -109,6 +109,9 @@ export class UserResolver {
|
|||||||
const user = await this.users.findUserByEmail(email);
|
const user = await this.users.findUserByEmail(email);
|
||||||
if (currentUser) return user;
|
if (currentUser) return user;
|
||||||
|
|
||||||
|
// return empty response when user not exists
|
||||||
|
if (!user) return null;
|
||||||
|
|
||||||
// only return limited info when not logged in
|
// only return limited info when not logged in
|
||||||
return {
|
return {
|
||||||
email: user?.email,
|
email: user?.email,
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 Paco Coursey
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# copied directly from https://github.com/pacocoursey/cmdk
|
|
||||||
|
|
||||||
will remove after a new CMDK version is published to npm
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@affine/cmdk",
|
|
||||||
"private": true,
|
|
||||||
"type": "module",
|
|
||||||
"main": "./src/index.tsx",
|
|
||||||
"module": "./src/index.tsx",
|
|
||||||
"devDependencies": {
|
|
||||||
"react": "18.2.0",
|
|
||||||
"react-dom": "18.2.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@radix-ui/react-dialog": "^1.0.5"
|
|
||||||
},
|
|
||||||
"version": "0.11.0"
|
|
||||||
}
|
|
||||||
@@ -1,179 +0,0 @@
|
|||||||
/* eslint-disable */
|
|
||||||
// @ts-nocheck
|
|
||||||
|
|
||||||
// The scores are arranged so that a continuous match of characters will
|
|
||||||
// result in a total score of 1.
|
|
||||||
//
|
|
||||||
// The best case, this character is a match, and either this is the start
|
|
||||||
// of the string, or the previous character was also a match.
|
|
||||||
var SCORE_CONTINUE_MATCH = 1,
|
|
||||||
// A new match at the start of a word scores better than a new match
|
|
||||||
// elsewhere as it's more likely that the user will type the starts
|
|
||||||
// of fragments.
|
|
||||||
// NOTE: We score word jumps between spaces slightly higher than slashes, brackets
|
|
||||||
// hyphens, etc.
|
|
||||||
SCORE_SPACE_WORD_JUMP = 0.9,
|
|
||||||
SCORE_NON_SPACE_WORD_JUMP = 0.8,
|
|
||||||
// Any other match isn't ideal, but we include it for completeness.
|
|
||||||
SCORE_CHARACTER_JUMP = 0.17,
|
|
||||||
// If the user transposed two letters, it should be significantly penalized.
|
|
||||||
//
|
|
||||||
// i.e. "ouch" is more likely than "curtain" when "uc" is typed.
|
|
||||||
SCORE_TRANSPOSITION = 0.1,
|
|
||||||
// The goodness of a match should decay slightly with each missing
|
|
||||||
// character.
|
|
||||||
//
|
|
||||||
// i.e. "bad" is more likely than "bard" when "bd" is typed.
|
|
||||||
//
|
|
||||||
// This will not change the order of suggestions based on SCORE_* until
|
|
||||||
// 100 characters are inserted between matches.
|
|
||||||
PENALTY_SKIPPED = 0.999,
|
|
||||||
// The goodness of an exact-case match should be higher than a
|
|
||||||
// case-insensitive match by a small amount.
|
|
||||||
//
|
|
||||||
// i.e. "HTML" is more likely than "haml" when "HM" is typed.
|
|
||||||
//
|
|
||||||
// This will not change the order of suggestions based on SCORE_* until
|
|
||||||
// 1000 characters are inserted between matches.
|
|
||||||
PENALTY_CASE_MISMATCH = 0.9999,
|
|
||||||
// Match higher for letters closer to the beginning of the word
|
|
||||||
PENALTY_DISTANCE_FROM_START = 0.9,
|
|
||||||
// If the word has more characters than the user typed, it should
|
|
||||||
// be penalised slightly.
|
|
||||||
//
|
|
||||||
// i.e. "html" is more likely than "html5" if I type "html".
|
|
||||||
//
|
|
||||||
// However, it may well be the case that there's a sensible secondary
|
|
||||||
// ordering (like alphabetical) that it makes sense to rely on when
|
|
||||||
// there are many prefix matches, so we don't make the penalty increase
|
|
||||||
// with the number of tokens.
|
|
||||||
PENALTY_NOT_COMPLETE = 0.99;
|
|
||||||
|
|
||||||
var IS_GAP_REGEXP = /[\\\/_+.#"@\[\(\{&]/,
|
|
||||||
COUNT_GAPS_REGEXP = /[\\\/_+.#"@\[\(\{&]/g,
|
|
||||||
IS_SPACE_REGEXP = /[\s-]/,
|
|
||||||
COUNT_SPACE_REGEXP = /[\s-]/g;
|
|
||||||
|
|
||||||
function commandScoreInner(
|
|
||||||
string,
|
|
||||||
abbreviation,
|
|
||||||
lowerString,
|
|
||||||
lowerAbbreviation,
|
|
||||||
stringIndex,
|
|
||||||
abbreviationIndex,
|
|
||||||
memoizedResults
|
|
||||||
) {
|
|
||||||
if (abbreviationIndex === abbreviation.length) {
|
|
||||||
if (stringIndex === string.length) {
|
|
||||||
return SCORE_CONTINUE_MATCH;
|
|
||||||
}
|
|
||||||
return PENALTY_NOT_COMPLETE;
|
|
||||||
}
|
|
||||||
|
|
||||||
var memoizeKey = `${stringIndex},${abbreviationIndex}`;
|
|
||||||
if (memoizedResults[memoizeKey] !== undefined) {
|
|
||||||
return memoizedResults[memoizeKey];
|
|
||||||
}
|
|
||||||
|
|
||||||
var abbreviationChar = lowerAbbreviation.charAt(abbreviationIndex);
|
|
||||||
var index = lowerString.indexOf(abbreviationChar, stringIndex);
|
|
||||||
var highScore = 0;
|
|
||||||
|
|
||||||
var score, transposedScore, wordBreaks, spaceBreaks;
|
|
||||||
|
|
||||||
while (index >= 0) {
|
|
||||||
score = commandScoreInner(
|
|
||||||
string,
|
|
||||||
abbreviation,
|
|
||||||
lowerString,
|
|
||||||
lowerAbbreviation,
|
|
||||||
index + 1,
|
|
||||||
abbreviationIndex + 1,
|
|
||||||
memoizedResults
|
|
||||||
);
|
|
||||||
if (score > highScore) {
|
|
||||||
if (index === stringIndex) {
|
|
||||||
score *= SCORE_CONTINUE_MATCH;
|
|
||||||
} else if (IS_GAP_REGEXP.test(string.charAt(index - 1))) {
|
|
||||||
score *= SCORE_NON_SPACE_WORD_JUMP;
|
|
||||||
wordBreaks = string
|
|
||||||
.slice(stringIndex, index - 1)
|
|
||||||
.match(COUNT_GAPS_REGEXP);
|
|
||||||
if (wordBreaks && stringIndex > 0) {
|
|
||||||
score *= Math.pow(PENALTY_SKIPPED, wordBreaks.length);
|
|
||||||
}
|
|
||||||
} else if (IS_SPACE_REGEXP.test(string.charAt(index - 1))) {
|
|
||||||
score *= SCORE_SPACE_WORD_JUMP;
|
|
||||||
spaceBreaks = string
|
|
||||||
.slice(stringIndex, index - 1)
|
|
||||||
.match(COUNT_SPACE_REGEXP);
|
|
||||||
if (spaceBreaks && stringIndex > 0) {
|
|
||||||
score *= Math.pow(PENALTY_SKIPPED, spaceBreaks.length);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
score *= SCORE_CHARACTER_JUMP;
|
|
||||||
if (stringIndex > 0) {
|
|
||||||
score *= Math.pow(PENALTY_SKIPPED, index - stringIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.charAt(index) !== abbreviation.charAt(abbreviationIndex)) {
|
|
||||||
score *= PENALTY_CASE_MISMATCH;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
(score < SCORE_TRANSPOSITION &&
|
|
||||||
lowerString.charAt(index - 1) ===
|
|
||||||
lowerAbbreviation.charAt(abbreviationIndex + 1)) ||
|
|
||||||
(lowerAbbreviation.charAt(abbreviationIndex + 1) ===
|
|
||||||
lowerAbbreviation.charAt(abbreviationIndex) && // allow duplicate letters. Ref #7428
|
|
||||||
lowerString.charAt(index - 1) !==
|
|
||||||
lowerAbbreviation.charAt(abbreviationIndex))
|
|
||||||
) {
|
|
||||||
transposedScore = commandScoreInner(
|
|
||||||
string,
|
|
||||||
abbreviation,
|
|
||||||
lowerString,
|
|
||||||
lowerAbbreviation,
|
|
||||||
index + 1,
|
|
||||||
abbreviationIndex + 2,
|
|
||||||
memoizedResults
|
|
||||||
);
|
|
||||||
|
|
||||||
if (transposedScore * SCORE_TRANSPOSITION > score) {
|
|
||||||
score = transposedScore * SCORE_TRANSPOSITION;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (score > highScore) {
|
|
||||||
highScore = score;
|
|
||||||
}
|
|
||||||
|
|
||||||
index = lowerString.indexOf(abbreviationChar, index + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
memoizedResults[memoizeKey] = highScore;
|
|
||||||
return highScore;
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatInput(string) {
|
|
||||||
// convert all valid space characters to space so they match each other
|
|
||||||
return string.toLowerCase().replace(COUNT_SPACE_REGEXP, ' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
export function commandScore(string: string, abbreviation: string): number {
|
|
||||||
/* NOTE:
|
|
||||||
* in the original, we used to do the lower-casing on each recursive call, but this meant that toLowerCase()
|
|
||||||
* was the dominating cost in the algorithm, passing both is a little ugly, but considerably faster.
|
|
||||||
*/
|
|
||||||
return commandScoreInner(
|
|
||||||
string,
|
|
||||||
abbreviation,
|
|
||||||
formatInput(string),
|
|
||||||
formatInput(abbreviation),
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../../tsconfig.json",
|
|
||||||
"include": ["./src"],
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
"noEmit": false,
|
|
||||||
"outDir": "lib"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
4
packages/common/env/package.json
vendored
4
packages/common/env/package.json
vendored
@@ -3,8 +3,8 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@blocksuite/global": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/global": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/store": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/store": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-dom": "18.2.0",
|
"react-dom": "18.2.0",
|
||||||
"vitest": "1.1.3"
|
"vitest": "1.1.3"
|
||||||
|
|||||||
@@ -13,9 +13,9 @@
|
|||||||
"@affine/debug": "workspace:*",
|
"@affine/debug": "workspace:*",
|
||||||
"@affine/env": "workspace:*",
|
"@affine/env": "workspace:*",
|
||||||
"@affine/templates": "workspace:*",
|
"@affine/templates": "workspace:*",
|
||||||
"@blocksuite/blocks": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/blocks": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/global": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/global": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/store": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/store": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"jotai": "^2.5.1",
|
"jotai": "^2.5.1",
|
||||||
"jotai-effect": "^0.2.3",
|
"jotai-effect": "^0.2.3",
|
||||||
"nanoid": "^5.0.3",
|
"nanoid": "^5.0.3",
|
||||||
@@ -26,8 +26,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@affine-test/fixtures": "workspace:*",
|
"@affine-test/fixtures": "workspace:*",
|
||||||
"@affine/templates": "workspace:*",
|
"@affine/templates": "workspace:*",
|
||||||
"@blocksuite/lit": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/lit": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/presets": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/presets": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"async-call-rpc": "^6.3.1",
|
"async-call-rpc": "^6.3.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
|
|||||||
@@ -32,14 +32,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@blocksuite/global": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/global": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"idb": "^8.0.0",
|
"idb": "^8.0.0",
|
||||||
"nanoid": "^5.0.3",
|
"nanoid": "^5.0.3",
|
||||||
"y-provider": "workspace:*"
|
"y-provider": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@blocksuite/blocks": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/blocks": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/store": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/store": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"fake-indexeddb": "^5.0.0",
|
"fake-indexeddb": "^5.0.0",
|
||||||
"vite": "^5.0.6",
|
"vite": "^5.0.6",
|
||||||
"vite-plugin-dts": "3.7.0",
|
"vite-plugin-dts": "3.7.0",
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
"build": "vite build"
|
"build": "vite build"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@blocksuite/store": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/store": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"vite": "^5.0.6",
|
"vite": "^5.0.6",
|
||||||
"vite-plugin-dts": "3.7.0",
|
"vite-plugin-dts": "3.7.0",
|
||||||
"vitest": "1.1.3",
|
"vitest": "1.1.3",
|
||||||
|
|||||||
@@ -71,12 +71,12 @@
|
|||||||
"uuid": "^9.0.1"
|
"uuid": "^9.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@blocksuite/blocks": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/blocks": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/global": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/global": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/icons": "2.1.40",
|
"@blocksuite/icons": "2.1.40",
|
||||||
"@blocksuite/lit": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/lit": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/presets": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/presets": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/store": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/store": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@storybook/addon-actions": "^7.5.3",
|
"@storybook/addon-actions": "^7.5.3",
|
||||||
"@storybook/addon-essentials": "^7.5.3",
|
"@storybook/addon-essentials": "^7.5.3",
|
||||||
"@storybook/addon-interactions": "^7.5.3",
|
"@storybook/addon-interactions": "^7.5.3",
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { type PropsWithChildren, useRef } from 'react';
|
|||||||
import * as styles from './index.css';
|
import * as styles from './index.css';
|
||||||
import { useHasScrollTop } from './use-has-scroll-top';
|
import { useHasScrollTop } from './use-has-scroll-top';
|
||||||
|
|
||||||
|
export { useHasScrollTop } from './use-has-scroll-top';
|
||||||
|
|
||||||
export function SidebarContainer({ children }: PropsWithChildren) {
|
export function SidebarContainer({ children }: PropsWithChildren) {
|
||||||
return <div className={clsx([styles.baseContainer])}>{children}</div>;
|
return <div className={clsx([styles.baseContainer])}>{children}</div>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
import { ContentParser } from '@blocksuite/blocks/content-parser';
|
|
||||||
import type { Page } from '@blocksuite/store';
|
|
||||||
|
|
||||||
const contentParserWeakMap = new WeakMap<Page, ContentParser>();
|
|
||||||
|
|
||||||
export function getContentParser(page: Page) {
|
|
||||||
if (!contentParserWeakMap.has(page)) {
|
|
||||||
contentParserWeakMap.set(
|
|
||||||
page,
|
|
||||||
new ContentParser(page, {
|
|
||||||
imageProxyEndpoint: !environment.isDesktop
|
|
||||||
? runtimeConfig.imageProxyUrl
|
|
||||||
: undefined,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return contentParserWeakMap.get(page) as ContentParser;
|
|
||||||
}
|
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@affine-test/fixtures": "workspace:*",
|
"@affine-test/fixtures": "workspace:*",
|
||||||
"@affine/cmdk": "workspace:*",
|
|
||||||
"@affine/component": "workspace:*",
|
"@affine/component": "workspace:*",
|
||||||
"@affine/debug": "workspace:*",
|
"@affine/debug": "workspace:*",
|
||||||
"@affine/electron-api": "workspace:*",
|
"@affine/electron-api": "workspace:*",
|
||||||
@@ -27,14 +26,14 @@
|
|||||||
"@affine/templates": "workspace:*",
|
"@affine/templates": "workspace:*",
|
||||||
"@affine/workspace": "workspace:*",
|
"@affine/workspace": "workspace:*",
|
||||||
"@affine/workspace-impl": "workspace:*",
|
"@affine/workspace-impl": "workspace:*",
|
||||||
"@blocksuite/block-std": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/block-std": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/blocks": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/blocks": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/global": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/global": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/icons": "2.1.40",
|
"@blocksuite/icons": "2.1.40",
|
||||||
"@blocksuite/inline": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/inline": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/lit": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/lit": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/presets": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/presets": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@blocksuite/store": "0.11.0-nightly-202401020419-752a5b8",
|
"@blocksuite/store": "0.12.0-nightly-202401120404-4219e86",
|
||||||
"@dnd-kit/core": "^6.0.8",
|
"@dnd-kit/core": "^6.0.8",
|
||||||
"@dnd-kit/sortable": "^8.0.0",
|
"@dnd-kit/sortable": "^8.0.0",
|
||||||
"@emotion/cache": "^11.11.0",
|
"@emotion/cache": "^11.11.0",
|
||||||
@@ -44,8 +43,10 @@
|
|||||||
"@marsidev/react-turnstile": "^0.4.0",
|
"@marsidev/react-turnstile": "^0.4.0",
|
||||||
"@radix-ui/react-collapsible": "^1.0.3",
|
"@radix-ui/react-collapsible": "^1.0.3",
|
||||||
"@radix-ui/react-dialog": "^1.0.4",
|
"@radix-ui/react-dialog": "^1.0.4",
|
||||||
|
"@radix-ui/react-popover": "^1.0.7",
|
||||||
"@radix-ui/react-scroll-area": "^1.0.5",
|
"@radix-ui/react-scroll-area": "^1.0.5",
|
||||||
"@radix-ui/react-select": "^2.0.0",
|
"@radix-ui/react-select": "^2.0.0",
|
||||||
|
"@radix-ui/react-toolbar": "^1.0.4",
|
||||||
"@react-hookz/web": "^24.0.0",
|
"@react-hookz/web": "^24.0.0",
|
||||||
"@sentry/integrations": "^7.83.0",
|
"@sentry/integrations": "^7.83.0",
|
||||||
"@sentry/react": "^7.83.0",
|
"@sentry/react": "^7.83.0",
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
"async-call-rpc": "^6.3.1",
|
"async-call-rpc": "^6.3.1",
|
||||||
"bytes": "^3.1.2",
|
"bytes": "^3.1.2",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
|
"cmdk": "patch:cmdk@npm%3A0.2.0#~/.yarn/patches/cmdk-npm-0.2.0-302237a911.patch",
|
||||||
"css-spring": "^4.1.0",
|
"css-spring": "^4.1.0",
|
||||||
"cssnano": "^6.0.1",
|
"cssnano": "^6.0.1",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
@@ -66,8 +68,10 @@
|
|||||||
"jotai": "^2.5.1",
|
"jotai": "^2.5.1",
|
||||||
"jotai-devtools": "^0.7.0",
|
"jotai-devtools": "^0.7.0",
|
||||||
"jotai-effect": "^0.2.3",
|
"jotai-effect": "^0.2.3",
|
||||||
|
"jotai-scope": "^0.4.1",
|
||||||
"lit": "^3.0.2",
|
"lit": "^3.0.2",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
|
"lottie-react": "^2.4.0",
|
||||||
"lottie-web": "^5.12.2",
|
"lottie-web": "^5.12.2",
|
||||||
"mini-css-extract-plugin": "^2.7.6",
|
"mini-css-extract-plugin": "^2.7.6",
|
||||||
"nanoid": "^5.0.3",
|
"nanoid": "^5.0.3",
|
||||||
@@ -79,6 +83,7 @@
|
|||||||
"react-error-boundary": "^4.0.11",
|
"react-error-boundary": "^4.0.11",
|
||||||
"react-is": "18.2.0",
|
"react-is": "18.2.0",
|
||||||
"react-router-dom": "^6.16.0",
|
"react-router-dom": "^6.16.0",
|
||||||
|
"react-virtuoso": "^4.6.2",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
"ses": "^1.0.0",
|
"ses": "^1.0.0",
|
||||||
"swr": "2.2.4",
|
"swr": "2.2.4",
|
||||||
@@ -89,8 +94,8 @@
|
|||||||
"zod": "^3.22.4"
|
"zod": "^3.22.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@aws-sdk/client-s3": "3.485.0",
|
"@aws-sdk/client-s3": "3.499.0",
|
||||||
"@perfsee/webpack": "^1.8.4",
|
"@perfsee/webpack": "^1.10.0",
|
||||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
|
||||||
"@sentry/webpack-plugin": "^2.8.0",
|
"@sentry/webpack-plugin": "^2.8.0",
|
||||||
"@swc/core": "^1.3.93",
|
"@swc/core": "^1.3.93",
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
import type {
|
|
||||||
CollectionsCRUD,
|
|
||||||
CollectionsCRUDAtom,
|
|
||||||
} from '@affine/component/page-list';
|
|
||||||
import {
|
import {
|
||||||
currentWorkspaceAtom,
|
currentWorkspaceAtom,
|
||||||
waitForCurrentWorkspaceAtom,
|
waitForCurrentWorkspaceAtom,
|
||||||
@@ -14,6 +10,10 @@ import { atom } from 'jotai';
|
|||||||
import { atomWithObservable } from 'jotai/utils';
|
import { atomWithObservable } from 'jotai/utils';
|
||||||
import { Observable, of } from 'rxjs';
|
import { Observable, of } from 'rxjs';
|
||||||
|
|
||||||
|
import type {
|
||||||
|
CollectionsCRUD,
|
||||||
|
CollectionsCRUDAtom,
|
||||||
|
} from '../components/page-list';
|
||||||
import { getUserSetting } from '../utils/user-setting';
|
import { getUserSetting } from '../utils/user-setting';
|
||||||
import { getWorkspaceSetting } from '../utils/workspace-setting';
|
import { getWorkspaceSetting } from '../utils/workspace-setting';
|
||||||
import { sessionAtom } from './cloud-user';
|
import { sessionAtom } from './cloud-user';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { SignUpPage } from '@affine/component/auth-components';
|
import { SignUpPage } from '@affine/component/auth-components';
|
||||||
import { AffineShapeIcon } from '@affine/component/page-list';
|
|
||||||
import { Button } from '@affine/component/ui/button';
|
import { Button } from '@affine/component/ui/button';
|
||||||
import { Loading } from '@affine/component/ui/loading';
|
import { Loading } from '@affine/component/ui/loading';
|
||||||
|
import { AffineShapeIcon } from '@affine/core/components/page-list';
|
||||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||||
import type { SubscriptionRecurring } from '@affine/graphql';
|
import type { SubscriptionRecurring } from '@affine/graphql';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -121,6 +121,9 @@ export const CreateWorkspaceModal = ({
|
|||||||
const result = await apis.dialog.loadDBFile();
|
const result = await apis.dialog.loadDBFile();
|
||||||
if (result.workspaceId && !canceled) {
|
if (result.workspaceId && !canceled) {
|
||||||
_addLocalWorkspace(result.workspaceId);
|
_addLocalWorkspace(result.workspaceId);
|
||||||
|
workspaceManager.list.revalidate().catch(err => {
|
||||||
|
logger.error("can't revalidate workspace list", err);
|
||||||
|
});
|
||||||
onCreate(result.workspaceId);
|
onCreate(result.workspaceId);
|
||||||
} else if (result.error || result.canceled) {
|
} else if (result.error || result.canceled) {
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ExportMenuItems } from '@affine/component/page-list';
|
|
||||||
import { Button } from '@affine/component/ui/button';
|
import { Button } from '@affine/component/ui/button';
|
||||||
import { Divider } from '@affine/component/ui/divider';
|
import { Divider } from '@affine/component/ui/divider';
|
||||||
|
import { ExportMenuItems } from '@affine/core/components/page-list';
|
||||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { LinkIcon } from '@blocksuite/icons';
|
import { LinkIcon } from '@blocksuite/icons';
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
import { Export, FavoriteTag, MoveToTrash } from '@affine/component/page-list';
|
|
||||||
import {
|
import {
|
||||||
Menu,
|
Menu,
|
||||||
MenuIcon,
|
MenuIcon,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
MenuSeparator,
|
MenuSeparator,
|
||||||
} from '@affine/component/ui/menu';
|
} from '@affine/component/ui/menu';
|
||||||
|
import {
|
||||||
|
Export,
|
||||||
|
FavoriteTag,
|
||||||
|
MoveToTrash,
|
||||||
|
} from '@affine/core/components/page-list';
|
||||||
import { useBlockSuitePageMeta } from '@affine/core/hooks/use-block-suite-page-meta';
|
import { useBlockSuitePageMeta } from '@affine/core/hooks/use-block-suite-page-meta';
|
||||||
import { waitForCurrentWorkspaceAtom } from '@affine/core/modules/workspace';
|
import { waitForCurrentWorkspaceAtom } from '@affine/core/modules/workspace';
|
||||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
import { IconButton, type IconButtonProps } from '@affine/component';
|
||||||
|
import { Tooltip } from '@affine/component';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { FavoritedIcon, FavoriteIcon } from '@blocksuite/icons';
|
import { FavoritedIcon, FavoriteIcon } from '@blocksuite/icons';
|
||||||
import Lottie from 'lottie-react';
|
import Lottie from 'lottie-react';
|
||||||
import { forwardRef, useCallback, useState } from 'react';
|
import { forwardRef, useCallback, useState } from 'react';
|
||||||
|
|
||||||
import { IconButton, type IconButtonProps } from '../../../ui/button';
|
|
||||||
import { Tooltip } from '../../../ui/tooltip';
|
|
||||||
import favoritedAnimation from './favorited-animation/data.json';
|
import favoritedAnimation from './favorited-animation/data.json';
|
||||||
|
|
||||||
export const FavoriteTag = forwardRef<
|
export const FavoriteTag = forwardRef<
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
|
import { DropdownButton, Menu } from '@affine/component';
|
||||||
|
import { BlockCard } from '@affine/component/card/block-card';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { EdgelessIcon, ImportIcon, PageIcon } from '@blocksuite/icons';
|
import { EdgelessIcon, ImportIcon, PageIcon } from '@blocksuite/icons';
|
||||||
import { type PropsWithChildren, useCallback, useState } from 'react';
|
import { type PropsWithChildren, useCallback, useState } from 'react';
|
||||||
|
|
||||||
import { DropdownButton } from '../../../ui/button';
|
|
||||||
import { Menu } from '../../../ui/menu';
|
|
||||||
import { BlockCard } from '../../card/block-card';
|
|
||||||
import { menuContent } from './new-page-button.css';
|
import { menuContent } from './new-page-button.css';
|
||||||
|
|
||||||
type NewPageButtonProps = {
|
type NewPageButtonProps = {
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
|
import { Menu, MenuItem } from '@affine/component';
|
||||||
import type { Filter, Literal } from '@affine/env/filter';
|
import type { Filter, Literal } from '@affine/env/filter';
|
||||||
import type { PropertiesMeta } from '@affine/env/filter';
|
import type { PropertiesMeta } from '@affine/env/filter';
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
import { Menu, MenuItem } from '../../../ui/menu';
|
|
||||||
import { FilterTag } from './filter-tag-translation';
|
import { FilterTag } from './filter-tag-translation';
|
||||||
import * as styles from './index.css';
|
import * as styles from './index.css';
|
||||||
import { literalMatcher } from './literal-matcher';
|
import { literalMatcher } from './literal-matcher';
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
|
import { Button, IconButton, Menu } from '@affine/component';
|
||||||
import type { Filter } from '@affine/env/filter';
|
import type { Filter } from '@affine/env/filter';
|
||||||
import type { PropertiesMeta } from '@affine/env/filter';
|
import type { PropertiesMeta } from '@affine/env/filter';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { CloseIcon, PlusIcon } from '@blocksuite/icons';
|
import { CloseIcon, PlusIcon } from '@blocksuite/icons';
|
||||||
|
|
||||||
import { Button } from '../../../ui/button';
|
|
||||||
import { IconButton } from '../../../ui/button';
|
|
||||||
import { Menu } from '../../../ui/menu';
|
|
||||||
import { Condition } from './condition';
|
import { Condition } from './condition';
|
||||||
import * as styles from './index.css';
|
import * as styles from './index.css';
|
||||||
import { CreateFilterMenu } from './vars';
|
import { CreateFilterMenu } from './vars';
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
|
import { Input, Menu, MenuItem } from '@affine/component';
|
||||||
|
import { AFFiNEDatePicker } from '@affine/component/date-picker';
|
||||||
import type { LiteralValue, Tag } from '@affine/env/filter';
|
import type { LiteralValue, Tag } from '@affine/env/filter';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { type ReactNode } from 'react';
|
import { type ReactNode } from 'react';
|
||||||
|
|
||||||
import Input from '../../../ui/input';
|
|
||||||
import { Menu, MenuItem } from '../../../ui/menu';
|
|
||||||
import { AFFiNEDatePicker } from '../../date-picker';
|
|
||||||
import { FilterTag } from './filter-tag-translation';
|
import { FilterTag } from './filter-tag-translation';
|
||||||
import { inputStyle } from './index.css';
|
import { inputStyle } from './index.css';
|
||||||
import { tBoolean, tDate, tDateRange, tTag } from './logical/custom-type';
|
import { tBoolean, tDate, tDateRange, tTag } from './logical/custom-type';
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
|
import { Menu, MenuItem } from '@affine/component';
|
||||||
import type { MouseEvent } from 'react';
|
import type { MouseEvent } from 'react';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
import { Menu, MenuItem } from '../../../ui/menu';
|
|
||||||
import * as styles from './multi-select.css';
|
import * as styles from './multi-select.css';
|
||||||
|
|
||||||
export const MultiSelect = ({
|
export const MultiSelect = ({
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { MenuIcon, MenuItem, MenuSeparator } from '@affine/component';
|
||||||
import type {
|
import type {
|
||||||
Filter,
|
Filter,
|
||||||
LiteralValue,
|
LiteralValue,
|
||||||
@@ -8,7 +9,6 @@ import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
|||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
|
|
||||||
import { MenuIcon, MenuItem, MenuSeparator } from '../../../ui/menu';
|
|
||||||
import { FilterTag } from './filter-tag-translation';
|
import { FilterTag } from './filter-tag-translation';
|
||||||
import * as styles from './index.css';
|
import * as styles from './index.css';
|
||||||
import { tBoolean, tDate, tDateRange, tTag } from './logical/custom-type';
|
import { tBoolean, tDate, tDateRange, tTag } from './logical/custom-type';
|
||||||
@@ -1,3 +1,11 @@
|
|||||||
|
import {
|
||||||
|
ConfirmModal,
|
||||||
|
IconButton,
|
||||||
|
Menu,
|
||||||
|
MenuIcon,
|
||||||
|
MenuItem,
|
||||||
|
Tooltip,
|
||||||
|
} from '@affine/component';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import {
|
import {
|
||||||
DeletePermanentlyIcon,
|
DeletePermanentlyIcon,
|
||||||
@@ -10,10 +18,6 @@ import {
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import { IconButton } from '../../ui/button';
|
|
||||||
import { Menu, MenuIcon, MenuItem } from '../../ui/menu';
|
|
||||||
import { ConfirmModal } from '../../ui/modal';
|
|
||||||
import { Tooltip } from '../../ui/tooltip';
|
|
||||||
import { FavoriteTag } from './components/favorite-tag';
|
import { FavoriteTag } from './components/favorite-tag';
|
||||||
import { DisablePublicSharing, MoveToTrash } from './operation-menu-items';
|
import { DisablePublicSharing, MoveToTrash } from './operation-menu-items';
|
||||||
import * as styles from './page-list.css';
|
import * as styles from './page-list.css';
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
|
import { MenuIcon, MenuItem, type MenuItemProps } from '@affine/component';
|
||||||
|
import { PublicLinkDisableModal } from '@affine/component/disable-public-link';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { ShareIcon } from '@blocksuite/icons';
|
import { ShareIcon } from '@blocksuite/icons';
|
||||||
|
|
||||||
import { MenuIcon, MenuItem, type MenuItemProps } from '../../../ui/menu';
|
|
||||||
import { PublicLinkDisableModal } from '../../disable-public-link';
|
|
||||||
|
|
||||||
export const DisablePublicSharing = (props: MenuItemProps) => {
|
export const DisablePublicSharing = (props: MenuItemProps) => {
|
||||||
const t = useAFFiNEI18N();
|
const t = useAFFiNEI18N();
|
||||||
return (
|
return (
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { MenuIcon, MenuItem, MenuSub } from '@affine/component';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import {
|
import {
|
||||||
ExportIcon,
|
ExportIcon,
|
||||||
@@ -8,7 +9,6 @@ import {
|
|||||||
} from '@blocksuite/icons';
|
} from '@blocksuite/icons';
|
||||||
import { type ReactNode, useMemo } from 'react';
|
import { type ReactNode, useMemo } from 'react';
|
||||||
|
|
||||||
import { MenuIcon, MenuItem, MenuSub } from '../../../ui/menu';
|
|
||||||
import { transitionStyle } from './index.css';
|
import { transitionStyle } from './index.css';
|
||||||
|
|
||||||
interface ExportMenuItemProps<T> {
|
interface ExportMenuItemProps<T> {
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
|
import {
|
||||||
|
ConfirmModal,
|
||||||
|
type ConfirmModalProps,
|
||||||
|
MenuIcon,
|
||||||
|
MenuItem,
|
||||||
|
type MenuItemProps,
|
||||||
|
} from '@affine/component';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { DeleteIcon } from '@blocksuite/icons';
|
import { DeleteIcon } from '@blocksuite/icons';
|
||||||
|
|
||||||
import { MenuIcon, MenuItem, type MenuItemProps } from '../../../ui/menu';
|
|
||||||
import { ConfirmModal, type ConfirmModalProps } from '../../../ui/modal';
|
|
||||||
|
|
||||||
export const MoveToTrash = (props: MenuItemProps) => {
|
export const MoveToTrash = (props: MenuItemProps) => {
|
||||||
const t = useAFFiNEI18N();
|
const t = useAFFiNEI18N();
|
||||||
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { Checkbox, type CheckboxProps } from '@affine/component';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { MultiSelectIcon, SortDownIcon, SortUpIcon } from '@blocksuite/icons';
|
import { MultiSelectIcon, SortDownIcon, SortUpIcon } from '@blocksuite/icons';
|
||||||
import type { PageMeta } from '@blocksuite/store';
|
import type { PageMeta } from '@blocksuite/store';
|
||||||
@@ -10,7 +11,6 @@ import {
|
|||||||
useMemo,
|
useMemo,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
|
||||||
import { Checkbox, type CheckboxProps } from '../../ui/checkbox';
|
|
||||||
import * as styles from './page-list.css';
|
import * as styles from './page-list.css';
|
||||||
import {
|
import {
|
||||||
pageListHandlersAtom,
|
pageListHandlersAtom,
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
|
import { Checkbox } from '@affine/component';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { useDraggable } from '@dnd-kit/core';
|
import { useDraggable } from '@dnd-kit/core';
|
||||||
import { type PropsWithChildren, useCallback, useMemo } from 'react';
|
import { type PropsWithChildren, useCallback, useMemo } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import { Checkbox } from '../../ui/checkbox';
|
|
||||||
import * as styles from './page-list-item.css';
|
import * as styles from './page-list-item.css';
|
||||||
import { PageTags } from './page-tags';
|
import { PageTags } from './page-tags';
|
||||||
import type { DraggableTitleCellData, PageListItemProps } from './types';
|
import type { DraggableTitleCellData, PageListItemProps } from './types';
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { Scrollable } from '@affine/component';
|
||||||
|
import { useHasScrollTop } from '@affine/component/app-sidebar';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {
|
import {
|
||||||
type ForwardedRef,
|
type ForwardedRef,
|
||||||
@@ -10,8 +12,6 @@ import {
|
|||||||
useRef,
|
useRef,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
|
||||||
import { Scrollable } from '../../ui/scrollbar';
|
|
||||||
import { useHasScrollTop } from '../app-sidebar/sidebar-containers/use-has-scroll-top';
|
|
||||||
import { PageGroup } from './page-group';
|
import { PageGroup } from './page-group';
|
||||||
import { PageListTableHeader } from './page-header';
|
import { PageListTableHeader } from './page-header';
|
||||||
import * as styles from './page-list.css';
|
import * as styles from './page-list.css';
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
|
import { Menu } from '@affine/component';
|
||||||
import type { Tag } from '@affine/env/filter';
|
import type { Tag } from '@affine/env/filter';
|
||||||
import { MoreHorizontalIcon } from '@blocksuite/icons';
|
import { MoreHorizontalIcon } from '@blocksuite/icons';
|
||||||
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
import { Menu } from '../../ui/menu';
|
|
||||||
import * as styles from './page-tags.css';
|
import * as styles from './page-tags.css';
|
||||||
import { stopPropagation } from './utils';
|
import { stopPropagation } from './utils';
|
||||||
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { Button, Tooltip } from '@affine/component';
|
||||||
import type { DeleteCollectionInfo, PropertiesMeta } from '@affine/env/filter';
|
import type { DeleteCollectionInfo, PropertiesMeta } from '@affine/env/filter';
|
||||||
import type { GetPageInfoById } from '@affine/env/page-info';
|
import type { GetPageInfoById } from '@affine/env/page-info';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
@@ -5,8 +6,6 @@ import { ViewLayersIcon } from '@blocksuite/icons';
|
|||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
|
||||||
import { Button } from '../../../ui/button';
|
|
||||||
import { Tooltip } from '../../../ui/tooltip';
|
|
||||||
import {
|
import {
|
||||||
type CollectionsCRUDAtom,
|
type CollectionsCRUDAtom,
|
||||||
useCollectionManager,
|
useCollectionManager,
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
import { Button } from '@affine/component';
|
||||||
|
import { FlexWrapper } from '@affine/component';
|
||||||
|
import { Menu } from '@affine/component';
|
||||||
import type {
|
import type {
|
||||||
Collection,
|
Collection,
|
||||||
DeleteCollectionInfo,
|
DeleteCollectionInfo,
|
||||||
@@ -8,9 +11,6 @@ import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
|||||||
import { FilterIcon } from '@blocksuite/icons';
|
import { FilterIcon } from '@blocksuite/icons';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import { Button } from '../../../ui/button';
|
|
||||||
import { FlexWrapper } from '../../../ui/layout';
|
|
||||||
import { Menu } from '../../../ui/menu';
|
|
||||||
import { CreateFilterMenu } from '../filter/vars';
|
import { CreateFilterMenu } from '../filter/vars';
|
||||||
import type { useCollectionManager } from '../use-collection-manager';
|
import type { useCollectionManager } from '../use-collection-manager';
|
||||||
import * as styles from './collection-list.css';
|
import * as styles from './collection-list.css';
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
import {
|
||||||
|
Menu,
|
||||||
|
MenuIcon,
|
||||||
|
MenuItem,
|
||||||
|
type MenuItemProps,
|
||||||
|
} from '@affine/component';
|
||||||
import type { Collection, DeleteCollectionInfo } from '@affine/env/filter';
|
import type { Collection, DeleteCollectionInfo } from '@affine/env/filter';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { DeleteIcon, EditIcon, FilterIcon } from '@blocksuite/icons';
|
import { DeleteIcon, EditIcon, FilterIcon } from '@blocksuite/icons';
|
||||||
@@ -8,7 +14,6 @@ import {
|
|||||||
useMemo,
|
useMemo,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
|
||||||
import { Menu, MenuIcon, MenuItem, type MenuItemProps } from '../../../ui/menu';
|
|
||||||
import type { useCollectionManager } from '../use-collection-manager';
|
import type { useCollectionManager } from '../use-collection-manager';
|
||||||
import type { AllPageListConfig } from '.';
|
import type { AllPageListConfig } from '.';
|
||||||
import * as styles from './collection-operations.css';
|
import * as styles from './collection-operations.css';
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
|
import { Button, Input, Modal } from '@affine/component';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { useCallback, useMemo, useState } from 'react';
|
import { useCallback, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import { Button } from '../../../ui/button';
|
|
||||||
import Input from '../../../ui/input';
|
|
||||||
import { Modal } from '../../../ui/modal';
|
|
||||||
import * as styles from './create-collection.css';
|
import * as styles from './create-collection.css';
|
||||||
|
|
||||||
export interface CreateCollectionModalProps {
|
export interface CreateCollectionModalProps {
|
||||||
@@ -1,12 +1,15 @@
|
|||||||
|
import {
|
||||||
|
Button,
|
||||||
|
Modal,
|
||||||
|
RadioButton,
|
||||||
|
RadioButtonGroup,
|
||||||
|
} from '@affine/component';
|
||||||
import type { Collection } from '@affine/env/filter';
|
import type { Collection } from '@affine/env/filter';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import type { PageMeta, Workspace } from '@blocksuite/store';
|
import type { PageMeta, Workspace } from '@blocksuite/store';
|
||||||
import type { DialogContentProps } from '@radix-ui/react-dialog';
|
import type { DialogContentProps } from '@radix-ui/react-dialog';
|
||||||
import { type ReactNode, useCallback, useMemo, useState } from 'react';
|
import { type ReactNode, useCallback, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import { RadioButton, RadioButtonGroup } from '../../../../index';
|
|
||||||
import { Button } from '../../../../ui/button';
|
|
||||||
import { Modal } from '../../../../ui/modal';
|
|
||||||
import * as styles from './edit-collection.css';
|
import * as styles from './edit-collection.css';
|
||||||
import { PagesMode } from './pages-mode';
|
import { PagesMode } from './pages-mode';
|
||||||
import { RulesMode } from './rules-mode';
|
import { RulesMode } from './rules-mode';
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import { Modal } from '@affine/component';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import { Modal } from '../../../../ui/modal';
|
|
||||||
import type { AllPageListConfig } from './edit-collection';
|
import type { AllPageListConfig } from './edit-collection';
|
||||||
import { SelectPage } from './select-page';
|
import { SelectPage } from './select-page';
|
||||||
export const useSelectPage = ({
|
export const useSelectPage = ({
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { Menu } from '@affine/component';
|
||||||
import type { Collection } from '@affine/env/filter';
|
import type { Collection } from '@affine/env/filter';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { FilterIcon } from '@blocksuite/icons';
|
import { FilterIcon } from '@blocksuite/icons';
|
||||||
@@ -5,7 +6,6 @@ import type { PageMeta } from '@blocksuite/store';
|
|||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { type ReactNode, useCallback } from 'react';
|
import { type ReactNode, useCallback } from 'react';
|
||||||
|
|
||||||
import { Menu } from '../../../../ui/menu';
|
|
||||||
import { FilterList } from '../../filter/filter-list';
|
import { FilterList } from '../../filter/filter-list';
|
||||||
import { VariableSelect } from '../../filter/vars';
|
import { VariableSelect } from '../../filter/vars';
|
||||||
import { VirtualizedPageList } from '../../virtualized-page-list';
|
import { VirtualizedPageList } from '../../virtualized-page-list';
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
|
import { Button, Menu } from '@affine/component';
|
||||||
import { Trans } from '@affine/i18n';
|
import { Trans } from '@affine/i18n';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { FilterIcon } from '@blocksuite/icons';
|
import { FilterIcon } from '@blocksuite/icons';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import { Button } from '../../../../ui/button';
|
|
||||||
import { Menu } from '../../../../ui/menu';
|
|
||||||
import { FilterList } from '../../filter';
|
import { FilterList } from '../../filter';
|
||||||
import { VariableSelect } from '../../filter/vars';
|
import { VariableSelect } from '../../filter/vars';
|
||||||
import { VirtualizedPageList } from '../../virtualized-page-list';
|
import { VirtualizedPageList } from '../../virtualized-page-list';
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
|
import { Button } from '@affine/component';
|
||||||
import type { Collection } from '@affine/env/filter';
|
import type { Collection } from '@affine/env/filter';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { SaveIcon } from '@blocksuite/icons';
|
import { SaveIcon } from '@blocksuite/icons';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
import { Button } from '../../../ui/button';
|
|
||||||
import { createEmptyCollection } from '../use-collection-manager';
|
import { createEmptyCollection } from '../use-collection-manager';
|
||||||
import { useEditCollectionName } from './use-edit-collection';
|
import { useEditCollectionName } from './use-edit-collection';
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user