@blocksuite/affine-model
Advanced tools
Comparing version 0.0.0-canary-20240911001315 to 0.0.0-canary-20240912001340
# @blocksuite/affine-model | ||
## 0.0.0-canary-20240911001315 | ||
## 0.0.0-canary-20240912001340 | ||
@@ -9,7 +9,27 @@ ### Patch Changes | ||
- Updated dependencies | ||
- @blocksuite/global@0.0.0-canary-20240911001315 | ||
- @blocksuite/block-std@0.0.0-canary-20240911001315 | ||
- @blocksuite/store@0.0.0-canary-20240911001315 | ||
- @blocksuite/inline@0.0.0-canary-20240911001315 | ||
- @blocksuite/global@0.0.0-canary-20240912001340 | ||
- @blocksuite/block-std@0.0.0-canary-20240912001340 | ||
- @blocksuite/store@0.0.0-canary-20240912001340 | ||
- @blocksuite/inline@0.0.0-canary-20240912001340 | ||
## 0.17.7 | ||
### Patch Changes | ||
- 5ab06c3: - Peek view as extension | ||
- Editor settings as extension | ||
- Edit props store as extension | ||
- Notifications as extension | ||
- Fix mini mindmap get service error | ||
- Fix generating placeholder style | ||
- Fix brush menu settings | ||
- Fix brush element line width | ||
- Fix edgeless preview pointer events | ||
- Fix latex editor focus shake | ||
- Updated dependencies [5ab06c3] | ||
- @blocksuite/block-std@0.17.7 | ||
- @blocksuite/global@0.17.7 | ||
- @blocksuite/inline@0.17.7 | ||
- @blocksuite/store@0.17.7 | ||
## 0.17.6 | ||
@@ -16,0 +36,0 @@ |
import { z } from 'zod'; | ||
export type DocMode = 'edgeless' | 'page'; | ||
export declare const DocModes: readonly ["edgeless", "page"]; | ||
export declare const ReferenceParamsSchema: z.ZodObject<{ | ||
mode: z.ZodOptional<z.ZodEnum<["edgeless", "page"]>>; | ||
blockIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
elementIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, "strip", z.ZodTypeAny, { | ||
mode?: "page" | "edgeless" | undefined; | ||
blockIds?: string[] | undefined; | ||
elementIds?: string[] | undefined; | ||
}, { | ||
mode?: "page" | "edgeless" | undefined; | ||
blockIds?: string[] | undefined; | ||
elementIds?: string[] | undefined; | ||
}>; | ||
export type ReferenceParams = z.infer<typeof ReferenceParamsSchema>; | ||
export declare const ReferenceInfoSchema: z.ZodObject<{ | ||
@@ -5,0 +19,0 @@ pageId: z.ZodString; |
import { z } from 'zod'; | ||
export const DocModes = ['edgeless', 'page']; | ||
export const ReferenceParamsSchema = z | ||
.object({ | ||
mode: z.enum(DocModes), | ||
blockIds: z.string().array(), | ||
elementIds: z.string().array(), | ||
}) | ||
.partial(); | ||
export const ReferenceInfoSchema = z.object({ | ||
pageId: z.string(), | ||
params: z | ||
.object({ | ||
mode: z.enum(DocModes), | ||
blockIds: z.string().array(), | ||
elementIds: z.string().array(), | ||
}) | ||
.partial() | ||
.optional(), | ||
params: ReferenceParamsSchema.optional(), | ||
}); | ||
//# sourceMappingURL=doc.js.map |
@@ -52,3 +52,3 @@ import { LineColor } from './line.js'; | ||
export declare enum TextResizing { | ||
AUTO_WIDTH = 0, | ||
AUTO_WIDTH_AND_HEIGHT = 0, | ||
AUTO_HEIGHT = 1 | ||
@@ -55,0 +55,0 @@ } |
@@ -49,3 +49,3 @@ import { createEnumMap } from '../utils/enum.js'; | ||
(function (TextResizing) { | ||
TextResizing[TextResizing["AUTO_WIDTH"] = 0] = "AUTO_WIDTH"; | ||
TextResizing[TextResizing["AUTO_WIDTH_AND_HEIGHT"] = 0] = "AUTO_WIDTH_AND_HEIGHT"; | ||
TextResizing[TextResizing["AUTO_HEIGHT"] = 1] = "AUTO_HEIGHT"; | ||
@@ -52,0 +52,0 @@ })(TextResizing || (TextResizing = {})); |
@@ -61,7 +61,9 @@ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { | ||
}), derive((lineWidth, instance) => { | ||
if (lineWidth === instance.lineWidth) | ||
const oldBound = instance.elementBound; | ||
if (lineWidth === instance.lineWidth || | ||
oldBound.w === 0 || | ||
oldBound.h === 0) | ||
return {}; | ||
const bound = instance.elementBound; | ||
const points = instance.points; | ||
const transformed = transformPointsToNewBound(points.map(([x, y]) => ({ x, y })), bound, lineWidth / 2, inflateBound(bound, lineWidth - instance.lineWidth), lineWidth / 2); | ||
const transformed = transformPointsToNewBound(points.map(([x, y]) => ({ x, y })), oldBound, instance.lineWidth / 2, inflateBound(oldBound, lineWidth - instance.lineWidth), lineWidth / 2); | ||
return { | ||
@@ -102,3 +104,3 @@ points: transformed.points.map((p, i) => [ | ||
const { lineWidth } = instance; | ||
const transformed = transformPointsToNewBound(instance.points.map(([x, y]) => ({ x, y })), instance, lineWidth / 2, bound, lineWidth / 2); | ||
const transformed = transformPointsToNewBound(instance.points.map(([x, y]) => ({ x, y })), instance, instance.lineWidth / 2, bound, lineWidth / 2); | ||
return { | ||
@@ -105,0 +107,0 @@ points: transformed.points.map((p, i) => [ |
{ | ||
"name": "@blocksuite/affine-model", | ||
"version": "0.0.0-canary-20240911001315", | ||
"version": "0.0.0-canary-20240912001340", | ||
"description": "Default BlockSuite editable blocks.", | ||
@@ -17,6 +17,6 @@ "type": "module", | ||
"dependencies": { | ||
"@blocksuite/block-std": "0.0.0-canary-20240911001315", | ||
"@blocksuite/global": "0.0.0-canary-20240911001315", | ||
"@blocksuite/inline": "0.0.0-canary-20240911001315", | ||
"@blocksuite/store": "0.0.0-canary-20240911001315", | ||
"@blocksuite/block-std": "0.0.0-canary-20240912001340", | ||
"@blocksuite/global": "0.0.0-canary-20240912001340", | ||
"@blocksuite/inline": "0.0.0-canary-20240912001340", | ||
"@blocksuite/store": "0.0.0-canary-20240912001340", | ||
"zod": "^3.23.8" | ||
@@ -23,0 +23,0 @@ }, |
@@ -7,14 +7,17 @@ import { z } from 'zod'; | ||
export const ReferenceParamsSchema = z | ||
.object({ | ||
mode: z.enum(DocModes), | ||
blockIds: z.string().array(), | ||
elementIds: z.string().array(), | ||
}) | ||
.partial(); | ||
export type ReferenceParams = z.infer<typeof ReferenceParamsSchema>; | ||
export const ReferenceInfoSchema = z.object({ | ||
pageId: z.string(), | ||
params: z | ||
.object({ | ||
mode: z.enum(DocModes), | ||
blockIds: z.string().array(), | ||
elementIds: z.string().array(), | ||
}) | ||
.partial() | ||
.optional(), | ||
params: ReferenceParamsSchema.optional(), | ||
}); | ||
export type ReferenceInfo = z.infer<typeof ReferenceInfoSchema>; |
@@ -66,3 +66,3 @@ import { createEnumMap } from '../utils/enum.js'; | ||
export enum TextResizing { | ||
AUTO_WIDTH, | ||
AUTO_WIDTH_AND_HEIGHT, | ||
AUTO_HEIGHT, | ||
@@ -69,0 +69,0 @@ } |
@@ -141,11 +141,17 @@ import type { | ||
@derive((lineWidth: number, instance: Instance) => { | ||
if (lineWidth === instance.lineWidth) return {}; | ||
const oldBound = instance.elementBound; | ||
const bound = instance.elementBound; | ||
if ( | ||
lineWidth === instance.lineWidth || | ||
oldBound.w === 0 || | ||
oldBound.h === 0 | ||
) | ||
return {}; | ||
const points = instance.points; | ||
const transformed = transformPointsToNewBound( | ||
points.map(([x, y]) => ({ x, y })), | ||
bound, | ||
lineWidth / 2, | ||
inflateBound(bound, lineWidth - instance.lineWidth), | ||
oldBound, | ||
instance.lineWidth / 2, | ||
inflateBound(oldBound, lineWidth - instance.lineWidth), | ||
lineWidth / 2 | ||
@@ -198,10 +204,10 @@ ); | ||
const bound = Bound.deserialize(xywh); | ||
if (bound.w === instance.w && bound.h === instance.h) return {}; | ||
const { lineWidth } = instance; | ||
const transformed = transformPointsToNewBound( | ||
instance.points.map(([x, y]) => ({ x, y })), | ||
instance, | ||
lineWidth / 2, | ||
instance.lineWidth / 2, | ||
bound, | ||
@@ -208,0 +214,0 @@ lineWidth / 2 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
561569
7975
+ Added@blocksuite/block-std@0.0.0-canary-20240912001340(transitive)
+ Added@blocksuite/global@0.0.0-canary-20240912001340(transitive)
+ Added@blocksuite/inline@0.0.0-canary-20240912001340(transitive)
+ Added@blocksuite/store@0.0.0-canary-20240912001340(transitive)
+ Added@blocksuite/sync@0.0.0-canary-20240912001340(transitive)
- Removed@blocksuite/block-std@0.0.0-canary-20240911001315(transitive)
- Removed@blocksuite/global@0.0.0-canary-20240911001315(transitive)
- Removed@blocksuite/inline@0.0.0-canary-20240911001315(transitive)
- Removed@blocksuite/store@0.0.0-canary-20240911001315(transitive)
- Removed@blocksuite/sync@0.0.0-canary-20240911001315(transitive)