@blocksuite/affine-shared
Advanced tools
Comparing version 0.0.0-canary-20240910001314 to 0.0.0-canary-20240910102005
@@ -1,2 +0,2 @@ | ||
import { ConnectorMode, DEFAULT_CONNECTOR_COLOR, DEFAULT_FRONT_END_POINT_STYLE, DEFAULT_NOTE_BACKGROUND_COLOR, DEFAULT_NOTE_BORDER_SIZE, DEFAULT_NOTE_BORDER_STYLE, DEFAULT_NOTE_CORNER, DEFAULT_NOTE_SHADOW, DEFAULT_REAR_END_POINT_STYLE, DEFAULT_ROUGHNESS, DEFAULT_SHAPE_FILL_COLOR, DEFAULT_SHAPE_STROKE_COLOR, DEFAULT_SHAPE_TEXT_COLOR, DEFAULT_TEXT_COLOR, FillColorsSchema, FontFamily, FontStyle, FontWeight, LayoutType, LineColor, LineColorsSchema, LineWidth, MindmapStyle, NoteBackgroundColorsSchema, NoteDisplayMode, NoteShadowsSchema, PointStyle, ShapeStyle, StrokeColorsSchema, StrokeStyle, TextAlign, TextVerticalAlign, } from '@blocksuite/affine-model'; | ||
import { ConnectorMode, DEFAULT_CONNECTOR_COLOR, DEFAULT_CONNECTOR_TEXT_COLOR, DEFAULT_FRONT_END_POINT_STYLE, DEFAULT_NOTE_BACKGROUND_COLOR, DEFAULT_NOTE_BORDER_SIZE, DEFAULT_NOTE_BORDER_STYLE, DEFAULT_NOTE_CORNER, DEFAULT_NOTE_SHADOW, DEFAULT_REAR_END_POINT_STYLE, DEFAULT_ROUGHNESS, DEFAULT_SHAPE_FILL_COLOR, DEFAULT_SHAPE_STROKE_COLOR, DEFAULT_SHAPE_TEXT_COLOR, DEFAULT_TEXT_COLOR, FillColorsSchema, FontFamily, FontStyle, FontWeight, FrameBackgroundColorsSchema, LayoutType, LineColor, LineColorsSchema, LineWidth, MindmapStyle, NoteBackgroundColorsSchema, NoteDisplayMode, NoteShadowsSchema, PointStyle, ShapeStyle, StrokeColorsSchema, StrokeStyle, TextAlign, TextVerticalAlign, } from '@blocksuite/affine-model'; | ||
import { z } from 'zod'; | ||
@@ -33,2 +33,6 @@ const ConnectorEndpointSchema = z.nativeEnum(PointStyle); | ||
]); | ||
const FrameBackgroundColorSchema = z.union([ | ||
FrameBackgroundColorsSchema, | ||
ColorSchema, | ||
]); | ||
export const ConnectorSchema = z | ||
@@ -43,2 +47,10 @@ .object({ | ||
mode: ConnectorModeSchema, | ||
labelStyle: z.object({ | ||
color: LineColorSchema, | ||
fontSize: z.number(), | ||
fontFamily: FontFamilySchema, | ||
fontWeight: FontWeightSchema, | ||
fontStyle: FontStyleSchema, | ||
textAlign: TextAlignSchema, | ||
}), | ||
}) | ||
@@ -53,2 +65,10 @@ .default({ | ||
mode: ConnectorMode.Curve, | ||
labelStyle: { | ||
color: DEFAULT_CONNECTOR_TEXT_COLOR, | ||
fontSize: 16, | ||
fontFamily: FontFamily.Inter, | ||
fontWeight: FontWeight.Regular, | ||
fontStyle: FontStyle.Normal, | ||
textAlign: TextAlign.Center, | ||
}, | ||
}); | ||
@@ -108,15 +128,15 @@ export const BrushSchema = z | ||
color: TextColorSchema, | ||
fontSize: z.number(), | ||
fontFamily: FontFamilySchema, | ||
textAlign: TextAlignSchema, | ||
fontWeight: FontWeightSchema, | ||
fontStyle: FontStyleSchema, | ||
fontSize: z.number(), | ||
textAlign: TextAlignSchema, | ||
}) | ||
.default({ | ||
color: DEFAULT_TEXT_COLOR, | ||
fontSize: 24, | ||
fontFamily: FontFamily.Inter, | ||
textAlign: TextAlign.Left, | ||
fontWeight: FontWeight.Regular, | ||
fontStyle: FontStyle.Normal, | ||
fontSize: 24, | ||
textAlign: TextAlign.Left, | ||
}); | ||
@@ -127,5 +147,5 @@ export const EdgelessTextSchema = z | ||
fontFamily: FontFamilySchema, | ||
textAlign: TextAlignSchema, | ||
fontWeight: FontWeightSchema, | ||
fontStyle: FontStyleSchema, | ||
textAlign: TextAlignSchema, | ||
}) | ||
@@ -135,5 +155,5 @@ .default({ | ||
fontFamily: FontFamily.Inter, | ||
textAlign: TextAlign.Left, | ||
fontWeight: FontWeight.Regular, | ||
fontStyle: FontStyle.Normal, | ||
textAlign: TextAlign.Left, | ||
}); | ||
@@ -174,2 +194,7 @@ export const NoteSchema = z | ||
}); | ||
export const FrameSchema = z | ||
.object({ | ||
background: FrameBackgroundColorSchema.optional(), | ||
}) | ||
.default({}); | ||
export const NodePropsSchema = z.object({ | ||
@@ -182,2 +207,3 @@ connector: ConnectorSchema, | ||
'affine:note': NoteSchema, | ||
'affine:frame': FrameSchema, | ||
// shapes | ||
@@ -184,0 +210,0 @@ 'shape:diamond': ShapeSchema, |
{ | ||
"name": "@blocksuite/affine-shared", | ||
"version": "0.0.0-canary-20240910001314", | ||
"version": "0.0.0-canary-20240910102005", | ||
"description": "Default BlockSuite editable blocks.", | ||
"type": "module", | ||
"repository": "toeverything/blocksuite", | ||
"scripts": { | ||
"build": "tsc", | ||
"test:unit": "nx vite:test --run", | ||
"test:unit:coverage": "nx vite:test --run --coverage", | ||
"test:e2e": "playwright test" | ||
}, | ||
"keywords": [], | ||
@@ -11,2 +17,7 @@ "author": "toeverything", | ||
"dependencies": { | ||
"@blocksuite/affine-model": "0.0.0-canary-20240910102005", | ||
"@blocksuite/block-std": "0.0.0-canary-20240910102005", | ||
"@blocksuite/global": "0.0.0-canary-20240910102005", | ||
"@blocksuite/inline": "0.0.0-canary-20240910102005", | ||
"@blocksuite/store": "0.0.0-canary-20240910102005", | ||
"@floating-ui/dom": "^1.6.10", | ||
@@ -18,8 +29,3 @@ "@lit-labs/preact-signals": "^1.0.2", | ||
"minimatch": "^10.0.1", | ||
"zod": "^3.23.8", | ||
"@blocksuite/affine-model": "0.0.0-canary-20240910001314", | ||
"@blocksuite/block-std": "0.0.0-canary-20240910001314", | ||
"@blocksuite/global": "0.0.0-canary-20240910001314", | ||
"@blocksuite/inline": "0.0.0-canary-20240910001314", | ||
"@blocksuite/store": "0.0.0-canary-20240910001314" | ||
"zod": "^3.23.8" | ||
}, | ||
@@ -69,3 +75,47 @@ "exports": { | ||
"publishConfig": { | ||
"access": "public" | ||
"access": "public", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"./selection": { | ||
"types": "./dist/selection/index.d.ts", | ||
"import": "./dist/selection/index.js" | ||
}, | ||
"./utils": { | ||
"types": "./dist/utils/index.d.ts", | ||
"import": "./dist/utils/index.js" | ||
}, | ||
"./consts": { | ||
"types": "./dist/consts/index.d.ts", | ||
"import": "./dist/consts/index.js" | ||
}, | ||
"./types": { | ||
"types": "./dist/types/index.d.ts", | ||
"import": "./dist/types/index.js" | ||
}, | ||
"./commands": { | ||
"types": "./dist/commands/index.d.ts", | ||
"import": "./dist/commands/index.js" | ||
}, | ||
"./mixins": { | ||
"types": "./dist/mixins/index.d.ts", | ||
"import": "./dist/mixins/index.js" | ||
}, | ||
"./theme": { | ||
"types": "./dist/theme/index.d.ts", | ||
"import": "./dist/theme/index.js" | ||
}, | ||
"./styles": { | ||
"types": "./dist/styles/index.d.ts", | ||
"import": "./dist/styles/index.js" | ||
}, | ||
"./services": { | ||
"types": "./dist/services/index.d.ts", | ||
"import": "./dist/services/index.js" | ||
} | ||
} | ||
}, | ||
@@ -78,10 +128,4 @@ "files": [ | ||
], | ||
"scripts": { | ||
"build": "tsc", | ||
"test:unit": "nx vite:test --run", | ||
"test:unit:coverage": "nx vite:test --run --coverage", | ||
"test:e2e": "playwright test" | ||
}, | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts" | ||
} |
import { | ||
ConnectorMode, | ||
DEFAULT_CONNECTOR_COLOR, | ||
DEFAULT_CONNECTOR_TEXT_COLOR, | ||
DEFAULT_FRONT_END_POINT_STYLE, | ||
@@ -20,2 +21,3 @@ DEFAULT_NOTE_BACKGROUND_COLOR, | ||
FontWeight, | ||
FrameBackgroundColorsSchema, | ||
LayoutType, | ||
@@ -69,2 +71,6 @@ LineColor, | ||
]); | ||
const FrameBackgroundColorSchema = z.union([ | ||
FrameBackgroundColorsSchema, | ||
ColorSchema, | ||
]); | ||
@@ -80,2 +86,10 @@ export const ConnectorSchema = z | ||
mode: ConnectorModeSchema, | ||
labelStyle: z.object({ | ||
color: LineColorSchema, | ||
fontSize: z.number(), | ||
fontFamily: FontFamilySchema, | ||
fontWeight: FontWeightSchema, | ||
fontStyle: FontStyleSchema, | ||
textAlign: TextAlignSchema, | ||
}), | ||
}) | ||
@@ -90,2 +104,10 @@ .default({ | ||
mode: ConnectorMode.Curve, | ||
labelStyle: { | ||
color: DEFAULT_CONNECTOR_TEXT_COLOR, | ||
fontSize: 16, | ||
fontFamily: FontFamily.Inter, | ||
fontWeight: FontWeight.Regular, | ||
fontStyle: FontStyle.Normal, | ||
textAlign: TextAlign.Center, | ||
}, | ||
}); | ||
@@ -151,15 +173,15 @@ | ||
color: TextColorSchema, | ||
fontSize: z.number(), | ||
fontFamily: FontFamilySchema, | ||
textAlign: TextAlignSchema, | ||
fontWeight: FontWeightSchema, | ||
fontStyle: FontStyleSchema, | ||
fontSize: z.number(), | ||
textAlign: TextAlignSchema, | ||
}) | ||
.default({ | ||
color: DEFAULT_TEXT_COLOR, | ||
fontSize: 24, | ||
fontFamily: FontFamily.Inter, | ||
textAlign: TextAlign.Left, | ||
fontWeight: FontWeight.Regular, | ||
fontStyle: FontStyle.Normal, | ||
fontSize: 24, | ||
textAlign: TextAlign.Left, | ||
}); | ||
@@ -171,5 +193,5 @@ | ||
fontFamily: FontFamilySchema, | ||
textAlign: TextAlignSchema, | ||
fontWeight: FontWeightSchema, | ||
fontStyle: FontStyleSchema, | ||
textAlign: TextAlignSchema, | ||
}) | ||
@@ -179,5 +201,5 @@ .default({ | ||
fontFamily: FontFamily.Inter, | ||
textAlign: TextAlign.Left, | ||
fontWeight: FontWeight.Regular, | ||
fontStyle: FontStyle.Normal, | ||
textAlign: TextAlign.Left, | ||
}); | ||
@@ -221,2 +243,8 @@ | ||
export const FrameSchema = z | ||
.object({ | ||
background: FrameBackgroundColorSchema.optional(), | ||
}) | ||
.default({}); | ||
export const NodePropsSchema = z.object({ | ||
@@ -229,2 +257,3 @@ connector: ConnectorSchema, | ||
'affine:note': NoteSchema, | ||
'affine:frame': FrameSchema, | ||
// shapes | ||
@@ -231,0 +260,0 @@ 'shape:diamond': ShapeSchema, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
10030
569004
+ Added@blocksuite/affine-model@0.0.0-canary-20240910102005(transitive)
+ Added@blocksuite/block-std@0.0.0-canary-20240910102005(transitive)
+ Added@blocksuite/global@0.0.0-canary-20240910102005(transitive)
+ Added@blocksuite/inline@0.0.0-canary-20240910102005(transitive)
+ Added@blocksuite/store@0.0.0-canary-20240910102005(transitive)
+ Added@blocksuite/sync@0.0.0-canary-20240910102005(transitive)
- Removed@blocksuite/affine-model@0.0.0-canary-20240910001314(transitive)
- Removed@blocksuite/block-std@0.0.0-canary-20240910001314(transitive)
- Removed@blocksuite/global@0.0.0-canary-20240910001314(transitive)
- Removed@blocksuite/inline@0.0.0-canary-20240910001314(transitive)
- Removed@blocksuite/store@0.0.0-canary-20240910001314(transitive)
- Removed@blocksuite/sync@0.0.0-canary-20240910001314(transitive)