Merge remote-tracking branch 'origin/master' into payment-system

This commit is contained in:
Joooye_34
2023-10-27 16:04:48 +08:00
87 changed files with 1004 additions and 581 deletions
+1 -1
View File
@@ -8,5 +8,5 @@
"react": "18.2.0",
"react-dom": "18.2.0"
},
"version": "0.10.0-canary.2"
"version": "0.10.0-canary.3"
}
+1 -1
View File
@@ -9,5 +9,5 @@
"@types/debug": "^4.1.9",
"vitest": "0.34.6"
},
"version": "0.10.0-canary.2"
"version": "0.10.0-canary.3"
}
+3 -3
View File
@@ -3,8 +3,8 @@
"private": true,
"type": "module",
"devDependencies": {
"@blocksuite/global": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/store": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/global": "0.0.0-20231024064721-2aee7119-nightly",
"@blocksuite/store": "0.0.0-20231024064721-2aee7119-nightly",
"react": "18.2.0",
"react-dom": "18.2.0",
"vitest": "0.34.6",
@@ -27,5 +27,5 @@
"dependencies": {
"lit": "^2.8.0"
},
"version": "0.10.0-canary.2"
"version": "0.10.0-canary.3"
}
+6 -6
View File
@@ -55,9 +55,9 @@
},
"dependencies": {
"@affine/sdk": "workspace:*",
"@blocksuite/blocks": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/global": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/store": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/blocks": "0.0.0-20231024064721-2aee7119-nightly",
"@blocksuite/global": "0.0.0-20231024064721-2aee7119-nightly",
"@blocksuite/store": "0.0.0-20231024064721-2aee7119-nightly",
"jotai": "^2.4.3",
"jotai-effect": "^0.1.0",
"tinykeys": "^2.1.0",
@@ -66,8 +66,8 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine/templates": "workspace:*",
"@blocksuite/editor": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/lit": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/editor": "0.0.0-20231024064721-2aee7119-nightly",
"@blocksuite/lit": "0.0.0-20231024064721-2aee7119-nightly",
"@testing-library/react": "^14.0.0",
"async-call-rpc": "^6.3.1",
"electron": "link:../../frontend/electron/node_modules/electron",
@@ -111,5 +111,5 @@
"optional": true
}
},
"version": "0.10.0-canary.2"
"version": "0.10.0-canary.3"
}
+26 -6
View File
@@ -40,8 +40,18 @@ export interface AffineCommandOptions {
preconditionStrategy?: PreconditionStrategy | (() => boolean);
// main text on the left..
// make text a function so that we can do i18n and interpolation when we need to
label?: string | (() => string) | ReactNode | (() => ReactNode);
icon: React.ReactNode; // todo: need a mapping from string -> React element/SVG
label:
| string
| (() => string)
| {
title: string;
subTitle?: string;
}
| (() => {
title: string;
subTitle?: string;
});
icon: ReactNode; // todo: need a mapping from string -> React element/SVG
category?: CommandCategory;
// we use https://github.com/jamiebuilds/tinykeys so that we can use the same keybinding definition
// for both mac and windows
@@ -53,8 +63,11 @@ export interface AffineCommandOptions {
export interface AffineCommand {
readonly id: string;
readonly preconditionStrategy: PreconditionStrategy | (() => boolean);
readonly label?: ReactNode | string;
readonly icon?: React.ReactNode; // icon name
readonly label: {
title: string;
subTitle?: string;
};
readonly icon?: ReactNode; // icon name
readonly category: CommandCategory;
readonly keyBinding?: KeybindingOptions;
run(): void | Promise<void>;
@@ -71,8 +84,15 @@ export function createAffineCommand(
options.preconditionStrategy ?? PreconditionStrategy.Always,
category: options.category ?? 'affine:general',
get label() {
const label = options.label;
return typeof label === 'function' ? label?.() : label;
let label = options.label;
label = typeof label === 'function' ? label?.() : label;
label =
typeof label === 'string'
? {
title: label,
}
: label;
return label;
},
keyBinding:
typeof options.keyBinding === 'string'
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@affine/sdk",
"version": "0.10.0-canary.2",
"version": "0.10.0-canary.3",
"type": "module",
"scripts": {
"build": "vite build",
@@ -22,11 +22,11 @@
"dist"
],
"dependencies": {
"@blocksuite/block-std": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/blocks": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/editor": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/global": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/store": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/block-std": "0.0.0-20231024064721-2aee7119-nightly",
"@blocksuite/blocks": "0.0.0-20231024064721-2aee7119-nightly",
"@blocksuite/editor": "0.0.0-20231024064721-2aee7119-nightly",
"@blocksuite/global": "0.0.0-20231024064721-2aee7119-nightly",
"@blocksuite/store": "0.0.0-20231024064721-2aee7119-nightly",
"jotai": "^2.4.3",
"zod": "^3.22.4"
},
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "@toeverything/y-indexeddb",
"type": "module",
"version": "0.10.0-canary.2",
"version": "0.10.0-canary.3",
"description": "IndexedDB database adapter for Yjs",
"repository": "toeverything/AFFiNE",
"author": "toeverything",
@@ -37,8 +37,8 @@
"y-provider": "workspace:*"
},
"devDependencies": {
"@blocksuite/blocks": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/store": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/blocks": "0.0.0-20231024064721-2aee7119-nightly",
"@blocksuite/store": "0.0.0-20231024064721-2aee7119-nightly",
"fake-indexeddb": "^5.0.0",
"vite": "^4.4.11",
"vite-plugin-dts": "3.6.0",
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "y-provider",
"type": "module",
"version": "0.10.0-canary.2",
"version": "0.10.0-canary.3",
"description": "Yjs provider protocol for multi document support",
"exports": {
".": "./src/index.ts"
@@ -24,7 +24,7 @@
"build": "vite build"
},
"devDependencies": {
"@blocksuite/store": "0.0.0-20231018100009-361737d3-nightly",
"@blocksuite/store": "0.0.0-20231024064721-2aee7119-nightly",
"vite": "^4.4.11",
"vite-plugin-dts": "3.6.0",
"vitest": "0.34.6",