Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(editor): missing export (#10893)

Saul-Mirone2f5e80109795
diff --git a/blocksuite/affine/all/package.json b/blocksuite/affine/all/package.json
index 83691a1342..7eff18a93e 100644
--- a/blocksuite/affine/all/package.json
+++ b/blocksuite/affine/all/package.json
@@ -146,7 +146,6 @@
"./shared/theme": "./src/shared/theme.ts",
"./shared/types": "./src/shared/types.ts",
"./shared/utils": "./src/shared/utils.ts",
- "./shared/viewport-renderer": "./src/shared/viewport-renderer.ts",
"./schemas": "./src/schemas.ts",
"./model": "./src/model/index.ts",
"./sync": "./src/sync/index.ts",
diff --git a/blocksuite/tests-legacy/e2e/slash-menu.spec.ts b/blocksuite/tests-legacy/e2e/slash-menu.spec.ts
index ad55906dff..512ea680aa 100644
--- a/blocksuite/tests-legacy/e2e/slash-menu.spec.ts
+++ b/blocksuite/tests-legacy/e2e/slash-menu.spec.ts
@@ -36,6 +36,14 @@ import {
} from './utils/asserts.js';
import { test } from './utils/playwright.js';
+function formatWithTimezone(date: Date, timeZone: string = 'Asia/Tokyo') {
+ const tokyoDate = date.toLocaleString('en-US', { timeZone });
+ const year = tokyoDate.split(',')[0].split('/')[2];
+ const month = tokyoDate.split(',')[0].split('/')[0].padStart(2, '0');
+ const day = tokyoDate.split(',')[0].split('/')[1];
+ return `${year}-${month}-${day}`;
+}
+
test.describe('slash menu should show and hide correctly', () => {
test.beforeEach(async ({ page }) => {
await enterPlaygroundRoom(page);
@@ -681,9 +689,8 @@ test.describe('slash menu with date & time', () => {
await expect(slashMenu).toBeHidden();
const date = new Date();
- const strTime = date.toISOString().split('T')[0];
-
- await assertRichTexts(page, [strTime]);
+ const formattedDate = formatWithTimezone(date);
+ await assertRichTexts(page, [formattedDate]);
});
test("should create Tomorrow's time string", async ({ page }) => {
@@ -701,9 +708,9 @@ test.describe('slash menu with date & time', () => {
const date = new Date();
date.setDate(date.getDate() + 1);
- const strTime = date.toISOString().split('T')[0];
+ const formattedDate = formatWithTimezone(date);
- await assertRichTexts(page, [strTime]);
+ await assertRichTexts(page, [formattedDate]);
});
test("should insert Yesterday's time string", async ({ page }) => {
@@ -721,9 +728,9 @@ test.describe('slash menu with date & time', () => {
const date = new Date();
date.setDate(date.getDate() - 1);
- const strTime = date.toISOString().split('T')[0];
+ const formattedDate = formatWithTimezone(date);
- await assertRichTexts(page, [strTime]);
+ await assertRichTexts(page, [formattedDate]);
});
});