Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/@liexp/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"src/**/*.(ts|tsx|js|jsx)": "eslint --fix"
},
"dependencies": {
"@blocknote/core": "^0.37.0",
"@blocknote/server-util": "^0.37.0",
"@blocknote/core": "^0.39.1",
"@blocknote/server-util": "^0.39.1",
"@liexp/core": "workspace:*",
"@ts-endpoint/core": "file:patches/ts-endpoint-core-0.1.0.tgz",
"@ts-endpoint/react-admin": "file:patches/ts-endpoint-react-admin-0.1.0.tgz",
Expand Down
22 changes: 12 additions & 10 deletions packages/@liexp/shared/src/providers/blocknote/EventBlock.specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ import { EventType } from "../../io/http/Events/index.js";
const DEFAULT_ID = "missing-id";
const DEFAULT_TYPE = "missing-type";

const propSchema = {
id: {
default: DEFAULT_ID,
},
type: {
default: DEFAULT_TYPE as EventType | typeof DEFAULT_TYPE,
values: [...EventType.members.map((v) => v.literals[0]), DEFAULT_TYPE],
},
};

export const eventBlockSpecs = {
type: "event",
propSchema: {
id: {
default: DEFAULT_ID,
},
type: {
default: DEFAULT_TYPE as EventType | typeof DEFAULT_TYPE,
values: [...EventType.members.map((v) => v.literals[0]), DEFAULT_TYPE],
},
},
propSchema,
content: "inline",
} satisfies CustomBlockConfig;
} satisfies CustomBlockConfig<string, typeof propSchema, "inline">;

export type EventBlockSpecs = typeof eventBlockSpecs;
23 changes: 5 additions & 18 deletions packages/@liexp/shared/src/providers/blocknote/type.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import {
type defaultStyleSpecs,
type BlockNoteSchema,
type BlockSchema,
type BlockSchemaFromSpecs,
type BlockSpec,
type InlineContentSchema,
type defaultBlockSpecs,
type defaultInlineContentSpecs,
type defaultStyleSpecs,
type InlineContentSchemaFromSpecs,
type InlineContentSpec,
type StyleSchema,
type StyleSchemaFromSpecs,
type defaultBlockSpecs,
type defaultInlineContentSpecs,
} from "@blocknote/core";
import { type EventBlockSpecs } from "./EventBlock.specs";
import { type MediaBlockSpecs } from "./MediaBlock.specs";
Expand All @@ -23,18 +20,8 @@ import { type RelationInlineSpec } from "./relationInline.specs";
export type RealBlockNoteSchema = BlockNoteSchema<
BlockSchemaFromSpecs<
Omit<typeof defaultBlockSpecs, "image"> & {
media: BlockSpec<
MediaBlockSpecs,
BlockSchema,
InlineContentSchema,
StyleSchema
>;
event: BlockSpec<
EventBlockSpecs,
BlockSchema,
InlineContentSchema,
StyleSchema
>;
media: BlockSpec<string, MediaBlockSpecs["propSchema"], "inline">;
event: BlockSpec<string, EventBlockSpecs["propSchema"], "inline">;
}
>,
InlineContentSchemaFromSpecs<
Expand Down
6 changes: 3 additions & 3 deletions packages/@liexp/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"src/**/*.(ts|tsx|js|jsx)": "eslint --fix"
},
"dependencies": {
"@blocknote/core": "^0.37.0",
"@blocknote/mantine": "^0.37.0",
"@blocknote/react": "^0.37.0",
"@blocknote/core": "^0.39.1",
"@blocknote/mantine": "^0.39.1",
"@blocknote/react": "^0.39.1",
"@emotion/cache": "^11.14.0",
"@emotion/css": "^11.13.5",
"@emotion/react": "^11.14.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export const schema = BlockNoteSchema.create({
},
blockSpecs: {
...otherBlockSpecs,
media: mediaBlock,
event: eventBlock,
[LINK_BLOCK_PLUGIN_TYPE]: linkBlock,
media: mediaBlock(),
event: eventBlock(),
[LINK_BLOCK_PLUGIN_TYPE]: linkBlock(),
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const toBNDocument = async (
const editor = BlockNoteEditor.create({ schema });

if (typeof v === "string") {
const result = await editor.tryParseHTMLToBlocks(v);
const result = editor.tryParseHTMLToBlocks(v);
return result as unknown as BlockNoteDocument;
} else {
const initialValue = toInitialValue(v);
Expand Down
Loading
Loading