New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blocksuite/affine-model

Package Overview
Dependencies
Maintainers
0
Versions
298
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blocksuite/affine-model - npm Package Compare versions

Comparing version

to
0.0.0-canary-20241129001516

10

CHANGELOG.md
# @blocksuite/affine-model
## 0.0.0-canary-20241128001518
## 0.0.0-canary-20241129001516

@@ -9,6 +9,6 @@ ### Patch Changes

- Updated dependencies
- @blocksuite/block-std@0.0.0-canary-20241128001518
- @blocksuite/global@0.0.0-canary-20241128001518
- @blocksuite/inline@0.0.0-canary-20241128001518
- @blocksuite/store@0.0.0-canary-20241128001518
- @blocksuite/block-std@0.0.0-canary-20241129001516
- @blocksuite/global@0.0.0-canary-20241129001516
- @blocksuite/inline@0.0.0-canary-20241129001516
- @blocksuite/store@0.0.0-canary-20241129001516

@@ -15,0 +15,0 @@ ## 0.18.1

@@ -1,4 +0,3 @@

import type { GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import { type EmbedCardStyle } from '../../utils/index.js';
import type { GfxCommonBlockProps, GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { EmbedCardStyle } from '../../utils/index.js';
import { AttachmentBlockTransformer } from './attachment-transformer.js';

@@ -22,7 +21,2 @@ /**

export declare const AttachmentBlockStyles: EmbedCardStyle[];
export interface AttachmentBlockEdgelessProps {
index: string;
xywh: SerializedXYWH;
rotate: number;
}
export type AttachmentBlockProps = {

@@ -42,3 +36,3 @@ name: string;

style?: (typeof AttachmentBlockStyles)[number];
} & AttachmentBlockEdgelessProps;
} & Omit<GfxCommonBlockProps, 'scale'>;
export declare const defaultAttachmentProps: AttachmentBlockProps;

@@ -45,0 +39,0 @@ export declare const AttachmentBlockSchema: {

@@ -0,3 +1,3 @@

import { GfxCompatible } from '@blocksuite/block-std/gfx';
import { BlockModel, defineBlockSchema } from '@blocksuite/store';
import { GfxCompatible } from '../../utils/index.js';
import { AttachmentBlockTransformer } from './attachment-transformer.js';

@@ -4,0 +4,0 @@ export const AttachmentBlockStyles = [

@@ -1,9 +0,3 @@

import type { GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import type { GfxCommonBlockProps, GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { EmbedCardStyle, LinkPreviewData } from '../../utils/index.js';
export interface BookmarkBlockEdgelessProps {
index: string;
xywh: SerializedXYWH;
rotate: number;
}
export declare const BookmarkStyles: EmbedCardStyle[];

@@ -14,3 +8,3 @@ export type BookmarkBlockProps = {

caption: string | null;
} & LinkPreviewData & BookmarkBlockEdgelessProps;
} & LinkPreviewData & Omit<GfxCommonBlockProps, 'scale'>;
export declare const BookmarkBlockSchema: {

@@ -17,0 +11,0 @@ version: number;

@@ -0,3 +1,3 @@

import { GfxCompatible } from '@blocksuite/block-std/gfx';
import { BlockModel, defineBlockSchema } from '@blocksuite/store';
import { GfxCompatible } from '../../utils/index.js';
export const BookmarkStyles = [

@@ -4,0 +4,0 @@ 'vertical',

@@ -1,11 +0,6 @@

import type { GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import type { GfxCommonBlockProps, GfxElementGeometry } from '@blocksuite/block-std/gfx';
import { type TextStyleProps } from '../../consts/index.js';
type EdgelessTextProps = {
xywh: SerializedXYWH;
index: string;
scale: number;
rotate: number;
hasMaxWidth: boolean;
} & Omit<TextStyleProps, 'fontSize'>;
} & Omit<TextStyleProps, 'fontSize'> & GfxCommonBlockProps;
export declare const EdgelessTextBlockSchema: {

@@ -12,0 +7,0 @@ version: number;

@@ -0,4 +1,4 @@

import { GfxCompatible } from '@blocksuite/block-std/gfx';
import { BlockModel, defineBlockSchema } from '@blocksuite/store';
import { FontFamily, FontStyle, FontWeight, TextAlign, } from '../../consts/index.js';
import { GfxCompatible } from '../../utils/index.js';
export const EdgelessTextBlockSchema = defineBlockSchema({

@@ -5,0 +5,0 @@ flavour: 'affine:edgeless-text',

@@ -17,3 +17,3 @@ import type { EmbedCardStyle } from '../../../utils/index.js';

caption: string | null;
} & EmbedFigmaBlockUrlData & import("../../../utils/gfx-compatible.js").GfxCompatibleProps>;
} & EmbedFigmaBlockUrlData & import("@blocksuite/block-std/gfx").GfxCompatibleProps>;
};

@@ -20,0 +20,0 @@ export declare class EmbedFigmaModel extends EmbedFigmaModel_base {

@@ -30,3 +30,3 @@ import type { EmbedCardStyle } from '../../../utils/index.js';

caption: string | null;
} & EmbedGithubBlockUrlData & import("../../../utils/gfx-compatible.js").GfxCompatibleProps>;
} & EmbedGithubBlockUrlData & import("@blocksuite/block-std/gfx").GfxCompatibleProps>;
};

@@ -33,0 +33,0 @@ export declare class EmbedGithubModel extends EmbedGithubModel_base {

@@ -10,3 +10,3 @@ import type { EmbedCardStyle } from '../../../utils/index.js';

declare const EmbedHtmlModel_base: {
new (): import("@blocksuite/block-std/gfx").GfxBlockElementModel<EmbedHtmlBlockProps & import("../../../utils/gfx-compatible.js").GfxCompatibleProps>;
new (): import("@blocksuite/block-std/gfx").GfxBlockElementModel<EmbedHtmlBlockProps & import("@blocksuite/block-std/gfx").GfxCompatibleProps>;
};

@@ -13,0 +13,0 @@ export declare class EmbedHtmlModel extends EmbedHtmlModel_base {

@@ -21,3 +21,3 @@ import type { ReferenceInfo } from '../../../consts/doc.js';

} | undefined;
} & import("../../../utils/gfx-compatible.js").GfxCompatibleProps>;
} & import("@blocksuite/block-std/gfx").GfxCompatibleProps>;
};

@@ -24,0 +24,0 @@ export declare class EmbedLinkedDocModel extends EmbedLinkedDocModel_base {

@@ -19,3 +19,3 @@ import type { EmbedCardStyle } from '../../../utils/index.js';

caption: string | null;
} & EmbedLoomBlockUrlData & import("../../../utils/gfx-compatible.js").GfxCompatibleProps>;
} & EmbedLoomBlockUrlData & import("@blocksuite/block-std/gfx").GfxCompatibleProps>;
};

@@ -22,0 +22,0 @@ export declare class EmbedLoomModel extends EmbedLoomModel_base {

@@ -23,3 +23,3 @@ import type { ReferenceInfo } from '../../../consts/doc.js';

} | undefined;
} & import("../../../utils/gfx-compatible.js").GfxCompatibleProps>;
} & import("@blocksuite/block-std/gfx").GfxCompatibleProps>;
};

@@ -26,0 +26,0 @@ export declare class EmbedSyncedDocModel extends EmbedSyncedDocModel_base {

@@ -22,3 +22,3 @@ import type { EmbedCardStyle } from '../../../utils/index.js';

caption: string | null;
} & EmbedYoutubeBlockUrlData & import("../../../utils/gfx-compatible.js").GfxCompatibleProps>;
} & EmbedYoutubeBlockUrlData & import("@blocksuite/block-std/gfx").GfxCompatibleProps>;
};

@@ -25,0 +25,0 @@ export declare class EmbedYoutubeModel extends EmbedYoutubeModel_base {

@@ -1,4 +0,4 @@

import type { GfxBlockElementModel, GfxElementGeometry, GfxGroupCompatibleInterface, GfxModel, PointTestOptions } from '@blocksuite/block-std/gfx';
import type { GfxBlockElementModel, GfxCompatibleProps, GfxElementGeometry, GfxGroupCompatibleInterface, GfxModel, PointTestOptions } from '@blocksuite/block-std/gfx';
import { gfxGroupCompatibleSymbol } from '@blocksuite/block-std/gfx';
import { Bound, type SerializedXYWH } from '@blocksuite/global/utils';
import { Bound } from '@blocksuite/global/utils';
import { type Text } from '@blocksuite/store';

@@ -9,6 +9,4 @@ import type { Color } from '../../consts/index.js';

background: Color;
xywh: SerializedXYWH;
index: string;
childElementIds?: Record<string, boolean>;
};
} & GfxCompatibleProps;
export declare const FrameBlockSchema: {

@@ -15,0 +13,0 @@ version: number;

var _a;
import { canSafeAddToContainer, descendantElementsImpl, gfxGroupCompatibleSymbol, hasDescendantElementImpl, } from '@blocksuite/block-std/gfx';
import { canSafeAddToContainer, descendantElementsImpl, GfxCompatible, gfxGroupCompatibleSymbol, hasDescendantElementImpl, } from '@blocksuite/block-std/gfx';
import { Bound } from '@blocksuite/global/utils';
import { BlockModel, defineBlockSchema } from '@blocksuite/store';
import { GfxCompatible } from '../../utils/index.js';
export const FrameBlockSchema = defineBlockSchema({

@@ -7,0 +6,0 @@ flavour: 'affine:frame',

@@ -1,3 +0,2 @@

import type { GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import type { GfxCommonBlockProps, GfxElementGeometry } from '@blocksuite/block-std/gfx';
import { ImageBlockTransformer } from './image-transformer.js';

@@ -9,7 +8,5 @@ export type ImageBlockProps = {

height?: number;
index: string;
xywh: SerializedXYWH;
rotate: number;
size?: number;
};
} & Omit<GfxCommonBlockProps, 'scale'>;
export declare const ImageBlockSchema: {

@@ -16,0 +13,0 @@ version: number;

@@ -0,3 +1,3 @@

import { GfxCompatible } from '@blocksuite/block-std/gfx';
import { BlockModel, defineBlockSchema } from '@blocksuite/store';
import { GfxCompatible } from '../../utils/index.js';
import { ImageBlockTransformer } from './image-transformer.js';

@@ -4,0 +4,0 @@ const defaultImageProps = {

@@ -1,10 +0,5 @@

import type { SerializedXYWH } from '@blocksuite/global/utils';
import { type GfxElementGeometry } from '@blocksuite/block-std/gfx';
import { type GfxCommonBlockProps, type GfxElementGeometry } from '@blocksuite/block-std/gfx';
export type LatexProps = {
xywh: SerializedXYWH;
index: string;
scale: number;
rotate: number;
latex: string;
};
} & GfxCommonBlockProps;
export declare const LatexBlockSchema: {

@@ -11,0 +6,0 @@ version: number;

@@ -1,3 +0,2 @@

import type { GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import type { GfxCompatibleProps, GfxElementGeometry } from '@blocksuite/block-std/gfx';
import { Bound } from '@blocksuite/global/utils';

@@ -19,5 +18,3 @@ import { type Color, NoteDisplayMode, type StrokeStyle } from '../../consts/index.js';

export type NoteProps = {
xywh: SerializedXYWH;
background: Color;
index: string;
displayMode: NoteDisplayMode;

@@ -34,3 +31,3 @@ edgeless: NoteEdgelessProps;

hidden: boolean;
};
} & GfxCompatibleProps;
export type NoteEdgelessProps = {

@@ -37,0 +34,0 @@ style: {

@@ -0,5 +1,5 @@

import { GfxCompatible } from '@blocksuite/block-std/gfx';
import { Bound } from '@blocksuite/global/utils';
import { BlockModel, defineBlockSchema } from '@blocksuite/store';
import { DEFAULT_NOTE_BACKGROUND_COLOR, DEFAULT_NOTE_BORDER_SIZE, DEFAULT_NOTE_BORDER_STYLE, DEFAULT_NOTE_CORNER, DEFAULT_NOTE_HEIGHT, DEFAULT_NOTE_SHADOW, DEFAULT_NOTE_WIDTH, NoteDisplayMode, } from '../../consts/index.js';
import { GfxCompatible } from '../../utils/index.js';
export const NoteBlockSchema = defineBlockSchema({

@@ -6,0 +6,0 @@ flavour: 'affine:note',

@@ -0,4 +1,4 @@

import type { GfxCompatibleProps } from '@blocksuite/block-std/gfx';
import type { Constructor } from '@blocksuite/global/utils';
import { type BaseBlockTransformer, type BlockModel, type InternalPrimitives } from '@blocksuite/store';
import { type GfxCompatibleProps } from './gfx-compatible.js';
export declare function defineEmbedModel<Props extends object, T extends Constructor<BlockModel<Props>> = Constructor<BlockModel<Props>>>(BlockModelSuperClass: T): {

@@ -5,0 +5,0 @@ new (): import("@blocksuite/block-std/gfx").GfxBlockElementModel<Props & GfxCompatibleProps>;

@@ -0,3 +1,3 @@

import { GfxCompatible } from '@blocksuite/block-std/gfx';
import { defineBlockSchema, } from '@blocksuite/store';
import { GfxCompatible } from './gfx-compatible.js';
export function defineEmbedModel(BlockModelSuperClass) {

@@ -4,0 +4,0 @@ return GfxCompatible(BlockModelSuperClass);

export * from './enum.js';
export * from './gfx-compatible.js';
export * from './global.js';

@@ -4,0 +3,0 @@ export * from './helper.js';

export * from './enum.js';
export * from './gfx-compatible.js';
export * from './global.js';

@@ -4,0 +3,0 @@ export * from './helper.js';

{
"name": "@blocksuite/affine-model",
"version": "0.0.0-canary-20241128001518",
"version": "0.0.0-canary-20241129001516",
"description": "Models for BlockSuite in Affine.",

@@ -22,6 +22,6 @@ "type": "module",

"dependencies": {
"@blocksuite/block-std": "0.0.0-canary-20241128001518",
"@blocksuite/global": "0.0.0-canary-20241128001518",
"@blocksuite/inline": "0.0.0-canary-20241128001518",
"@blocksuite/store": "0.0.0-canary-20241128001518",
"@blocksuite/block-std": "0.0.0-canary-20241129001516",
"@blocksuite/global": "0.0.0-canary-20241129001516",
"@blocksuite/inline": "0.0.0-canary-20241129001516",
"@blocksuite/store": "0.0.0-canary-20241129001516",
"fractional-indexing": "^3.2.0",

@@ -28,0 +28,0 @@ "zod": "^3.23.8"

@@ -1,7 +0,11 @@

import type { GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import type {
GfxCommonBlockProps,
GfxElementGeometry,
} from '@blocksuite/block-std/gfx';
import { GfxCompatible } from '@blocksuite/block-std/gfx';
import { BlockModel, defineBlockSchema } from '@blocksuite/store';
import { type EmbedCardStyle, GfxCompatible } from '../../utils/index.js';
import type { EmbedCardStyle } from '../../utils/index.js';
import { AttachmentBlockTransformer } from './attachment-transformer.js';

@@ -33,8 +37,2 @@

export interface AttachmentBlockEdgelessProps {
index: string;
xywh: SerializedXYWH;
rotate: number;
}
export type AttachmentBlockProps = {

@@ -59,3 +57,3 @@ name: string;

style?: (typeof AttachmentBlockStyles)[number];
} & AttachmentBlockEdgelessProps;
} & Omit<GfxCommonBlockProps, 'scale'>;

@@ -62,0 +60,0 @@ export const defaultAttachmentProps: AttachmentBlockProps = {

@@ -1,4 +0,7 @@

import type { GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import type {
GfxCommonBlockProps,
GfxElementGeometry,
} from '@blocksuite/block-std/gfx';
import { GfxCompatible } from '@blocksuite/block-std/gfx';
import { BlockModel, defineBlockSchema } from '@blocksuite/store';

@@ -8,10 +11,2 @@

import { GfxCompatible } from '../../utils/index.js';
export interface BookmarkBlockEdgelessProps {
index: string;
xywh: SerializedXYWH;
rotate: number;
}
export const BookmarkStyles: EmbedCardStyle[] = [

@@ -29,3 +24,3 @@ 'vertical',

} & LinkPreviewData &
BookmarkBlockEdgelessProps;
Omit<GfxCommonBlockProps, 'scale'>;

@@ -32,0 +27,0 @@ const defaultBookmarkProps: BookmarkBlockProps = {

@@ -1,4 +0,7 @@

import type { GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import type {
GfxCommonBlockProps,
GfxElementGeometry,
} from '@blocksuite/block-std/gfx';
import { GfxCompatible } from '@blocksuite/block-std/gfx';
import { BlockModel, defineBlockSchema } from '@blocksuite/store';

@@ -13,11 +16,7 @@

} from '../../consts/index.js';
import { GfxCompatible } from '../../utils/index.js';
type EdgelessTextProps = {
xywh: SerializedXYWH;
index: string;
scale: number;
rotate: number;
hasMaxWidth: boolean;
} & Omit<TextStyleProps, 'fontSize'>;
} & Omit<TextStyleProps, 'fontSize'> &
GfxCommonBlockProps;

@@ -24,0 +23,0 @@ export const EdgelessTextBlockSchema = defineBlockSchema({

import type {
GfxBlockElementModel,
GfxCompatibleProps,
GfxElementGeometry,

@@ -12,6 +13,7 @@ GfxGroupCompatibleInterface,

descendantElementsImpl,
GfxCompatible,
gfxGroupCompatibleSymbol,
hasDescendantElementImpl,
} from '@blocksuite/block-std/gfx';
import { Bound, type SerializedXYWH } from '@blocksuite/global/utils';
import { Bound } from '@blocksuite/global/utils';
import { BlockModel, defineBlockSchema, type Text } from '@blocksuite/store';

@@ -21,11 +23,7 @@

import { GfxCompatible } from '../../utils/index.js';
export type FrameBlockProps = {
title: Text;
background: Color;
xywh: SerializedXYWH;
index: string;
childElementIds?: Record<string, boolean>;
};
} & GfxCompatibleProps;

@@ -32,0 +30,0 @@ export const FrameBlockSchema = defineBlockSchema({

@@ -1,7 +0,9 @@

import type { GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import type {
GfxCommonBlockProps,
GfxElementGeometry,
} from '@blocksuite/block-std/gfx';
import { GfxCompatible } from '@blocksuite/block-std/gfx';
import { BlockModel, defineBlockSchema } from '@blocksuite/store';
import { GfxCompatible } from '../../utils/index.js';
import { ImageBlockTransformer } from './image-transformer.js';

@@ -14,7 +16,5 @@

height?: number;
index: string;
xywh: SerializedXYWH;
rotate: number;
size?: number;
};
} & Omit<GfxCommonBlockProps, 'scale'>;

@@ -21,0 +21,0 @@ const defaultImageProps: ImageBlockProps = {

@@ -1,4 +0,3 @@

import type { SerializedXYWH } from '@blocksuite/global/utils';
import {
type GfxCommonBlockProps,
GfxCompatible,

@@ -10,8 +9,4 @@ type GfxElementGeometry,

export type LatexProps = {
xywh: SerializedXYWH;
index: string;
scale: number;
rotate: number;
latex: string;
};
} & GfxCommonBlockProps;

@@ -18,0 +13,0 @@ export const LatexBlockSchema = defineBlockSchema({

@@ -1,4 +0,7 @@

import type { GfxElementGeometry } from '@blocksuite/block-std/gfx';
import type { SerializedXYWH } from '@blocksuite/global/utils';
import type {
GfxCompatibleProps,
GfxElementGeometry,
} from '@blocksuite/block-std/gfx';
import { GfxCompatible } from '@blocksuite/block-std/gfx';
import { Bound } from '@blocksuite/global/utils';

@@ -19,3 +22,2 @@ import { BlockModel, defineBlockSchema } from '@blocksuite/store';

} from '../../consts/index.js';
import { GfxCompatible } from '../../utils/index.js';

@@ -64,5 +66,3 @@ export const NoteBlockSchema = defineBlockSchema({

export type NoteProps = {
xywh: SerializedXYWH;
background: Color;
index: string;
displayMode: NoteDisplayMode;

@@ -79,3 +79,3 @@ edgeless: NoteEdgelessProps;

hidden: boolean;
};
} & GfxCompatibleProps;

@@ -82,0 +82,0 @@ export type NoteEdgelessProps = {

@@ -0,3 +1,5 @@

import type { GfxCompatibleProps } from '@blocksuite/block-std/gfx';
import type { Constructor } from '@blocksuite/global/utils';
import { GfxCompatible } from '@blocksuite/block-std/gfx';
import {

@@ -10,4 +12,2 @@ type BaseBlockTransformer,

import { GfxCompatible, type GfxCompatibleProps } from './gfx-compatible.js';
export function defineEmbedModel<

@@ -14,0 +14,0 @@ Props extends object,

export * from './enum.js';
export * from './gfx-compatible.js';
export * from './global.js';
export * from './helper.js';
export * from './types.js';

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

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

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