Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

768 B
Raw Blame
import { type SchemaType, schema } from '@loro-mirror/core';

const markdownNodeSchema = schema.LoroMap({
  $: schema.LoroMap({} as any, {
    required: false,
  }),
  text: schema.LoroText({
    required: false,
  }),
  ids: schema.LoroList(schema.String(), (idStr) => idStr, {
    required: false,
  }),
  children: schema.LoroMovableList(
    {} as SchemaType,
    (item) => {
      const id = item?.$?.id;
      if (!id) {
        console.error('no id for item', item);
      }
      return id;
    },
    {
      required: false,
    }
  ),
});

markdownNodeSchema.definition.children.itemSchema = markdownNodeSchema;

export const MARKDOWN_LORO_SCHEMA = schema({
  root: markdownNodeSchema,
});

export type MarkdownLoroSchemaType = typeof MARKDOWN_LORO_SCHEMA;