šŸš€ Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more →
Sign In

@ixo/editor

Package Overview
Dependencies
Maintainers
2
Versions
192
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ixo/editor

A custom BlockNote editor wrapper for IXO team

latest
Source
npmnpm
Version
5.34.0
Version published
Weekly downloads
1.1K
-13.61%
Maintainers
2
Weekly downloads
Ā 
Created
Source

IXO Editor

A custom BlockNote editor wrapper built specifically for the IXO team's needs. This package provides a highly customized rich text editing experience built on top of BlockNote with support for both Shadcn UI and Mantine UI.

Note: This package is designed for internal IXO team use and is not intended for public consumption, though it is hosted publicly.

Features

  • šŸŽØ Multi-UI Support: Choose between Shadcn UI or Mantine UI components.
  • šŸ”§ Simplified API: Wrapped BlockNote functionality with sensible defaults
  • šŸ“ Rich Text Editing: Full support for headings, lists, code blocks, tables, and more
  • šŸ”— Custom Blocks: Built-in custom blocks including dynamic List block for DID data
  • šŸ–¼ļø Media Support: Image and file upload handling
  • šŸŽÆ TypeScript: Full TypeScript support with exported types
  • šŸ¤ Collaboration Ready: Built-in Matrix-based collaborative editing with real-time synchronization
  • šŸ“± Responsive: Mobile-friendly editor experience
  • šŸ’Ž Complete CSS Bundles: Self-contained CSS with all dependencies included

Installation

npm install @ixo/editor
# or
yarn add @ixo/editor
# or
pnpm add @ixo/editor

Quick Start

Shadcn UI Version (Default)

import React from 'react';
import { useCreateIxoEditor, IxoEditor } from '@ixo/editor/shadcn';
import '@ixo/editor/style-shadcn.css'; // Complete CSS bundle - no other imports needed!

function MyEditor() {
  const editor = useCreateIxoEditor({
    theme: 'light',
    initialContent: [
      {
        type: 'heading',
        content: 'Welcome to IXO Editor',
        props: { level: 1 },
      },
      {
        type: 'paragraph',
        content: 'Start typing to create amazing content!',
      },
    ],
  });

  return <IxoEditor editor={editor} onChange={() => console.log('Content changed')} />;
}

Mantine UI Version

import React from 'react';
import { MantineProvider } from '@mantine/core';
import { useCreateIxoEditor, IxoEditor } from '@ixo/editor/mantine';
import '@ixo/editor/style-mantine.css'; // Complete CSS bundle - no other imports needed!

function MyEditor() {
  const editor = useCreateIxoEditor({
    theme: 'light',
    initialContent: [
      {
        type: 'heading',
        content: 'Welcome to IXO Editor',
        props: { level: 1 },
      },
    ],
  });

  return (
    <MantineProvider>
      <IxoEditor editor={editor} onChange={() => console.log('Content changed')} />
    </MantineProvider>
  );
}

Import Options

The package provides flexible import patterns to suit your needs:

// Shadcn version with complete CSS bundle
import { IxoEditor, useCreateIxoEditor } from '@ixo/editor/shadcn';
import '@ixo/editor/style-shadcn.css';

// Mantine version with complete CSS bundle
import { IxoEditor, useCreateIxoEditor } from '@ixo/editor/mantine';
import '@ixo/editor/style-mantine.css';

Option 2: Default Import (Shadcn)

// Uses Shadcn version by default for backward compatibility
import { IxoEditor, useCreateIxoEditor } from '@ixo/editor';
import '@ixo/editor/style.css';

CSS Bundle Options

  • @ixo/editor/style-shadcn.css - Complete bundle: Inter fonts + Shadcn + IXO styles
  • @ixo/editor/style-mantine.css - Complete bundle: Inter fonts + Mantine + IXO styles
  • @ixo/editor/style.css - Default bundle (same as shadcn)
  • @ixo/editor/style-core.css - Only IXO custom styles (for advanced users)

API Reference

useCreateIxoEditor

The main hook for creating an IXO editor instance. Available in both UI versions.

const editor = useCreateIxoEditor(options?: IxoEditorOptions);

Options

OptionTypeDefaultDescription
theme'light' | 'dark''light'Editor color theme
uploadFile(file: File) => Promise<string>Data URL converterFile upload handler
initialContentPartialBlock[]undefinedInitial editor content
editablebooleantrueWhether editor is editable
sideMenubooleantrueShow side menu (drag handle, plus button)
slashMenubooleantrueEnable slash commands menu
formattingToolbarbooleantrueShow formatting toolbar
linkToolbarbooleantrueShow link toolbar
filePanelbooleantrueShow file panel
tableHandlesbooleantrueShow table manipulation handles

IxoEditor Component

The main editor component. Available in both UI versions with identical APIs.

<IxoEditor editor={editor} className="my-custom-class" onChange={() => {}} onSelectionChange={() => {}} />

Props

PropTypeDescription
editorBlockNoteEditor | undefinedEditor instance from useCreateIxoEditor
classNamestringAdditional CSS classes
onChange() => voidCallback when content changes
onSelectionChange() => voidCallback when selection changes
childrenReact.ReactNodeCustom child components

Advanced Usage

Custom File Upload

const editor = useCreateIxoEditor({
  uploadFile: async (file: File) => {
    const formData = new FormData();
    formData.append('file', file);

    const response = await fetch('/api/upload', {
      method: 'POST',
      body: formData,
    });

    const { url } = await response.json();
    return url;
  },
});

Collaborative Editing

For real-time collaborative editing, use the useCreateCollaborativeIxoEditor hook with Matrix protocol:

import { useCreateCollaborativeIxoEditor, IxoEditor } from '@ixo/editor/shadcn';

function CollaborativeEditor() {
  const { editor, connectionStatus } = useCreateCollaborativeIxoEditor({
    theme: 'light',
    user: {
      id: 'user-123',
      name: 'John Doe',
      color: '#FF5733',
      accessToken: 'your-matrix-access-token',
      address: 'your-user-address',
    },
    matrixClient: matrixClient,
    roomId: '!roomId:matrix.org',
  });

  return (
    <div>
      <div>Connection: {connectionStatus}</div>
      <IxoEditor editor={editor} />
    </div>
  );
}

Dark Theme

const editor = useCreateIxoEditor({
  theme: 'dark',
});

Read-Only Mode

const editor = useCreateIxoEditor({
  editable: false,
  sideMenu: false,
  slashMenu: false,
  formattingToolbar: false,
});

Custom Blocks

The IXO Editor includes custom blocks for working with IXO ecosystem data, available in both UI versions:

List Block

The List block displays dynamic data from DID and fragment identifiers, perfect for displaying data from your GraphQL API.

Overview Block

The Overview block provides a comprehensive view of entity data from DID identifiers.

Usage

Both blocks can be inserted using the slash menu:

List Block:

  • Type /list in the editor
  • Or type / and search for "List", "data", or "dynamic"
  • Configure the DID and fragment identifier in the settings

Overview Block:

  • Type /overview in the editor
  • Or type / and search for "Overview", "overview-block", or "data-overview"
  • Configure the DID in the settings

Programmatic Usage

// Insert a list block programmatically
editor.insertBlocks(
  [
    {
      type: 'list',
      props: {
        title: 'My Data List',
        did: 'did:ixo:entity123',
        fragmentIdentifier: 'claims-data',
      },
    },
  ],
  editor.getTextCursorPosition().block,
  'after'
);

// Insert an overview block programmatically
editor.insertBlocks(
  [
    {
      type: 'overview',
      props: {
        did: 'did:ixo:entity123',
      },
    },
  ],
  editor.getTextCursorPosition().block,
  'after'
);

UI Library Comparison

FeatureShadcn UIMantine UI
Bundle Size~46KB CSS~173KB CSS
Custom BlocksFull-featuredMinimal (expandable)
ThemingTailwind-basedCSS-in-JS
DependenciesRadix UI primitivesMantine ecosystem
CustomizationHigh (CSS variables)High (theme provider)

When to Choose Shadcn UI

  • āœ… You're already using Tailwind CSS
  • āœ… You prefer smaller bundle sizes
  • āœ… You want the full-featured custom blocks
  • āœ… You like CSS variable-based theming

When to Choose Mantine UI

  • āœ… You're already using Mantine in your app
  • āœ… You prefer component-based theming
  • āœ… You want consistent Mantine design language
  • āœ… You plan to enhance the minimal blocks with Mantine components

Development

Project Structure

ixo-editor/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ core/            # Shared infrastructure
│   │   ā”œā”€ā”€ types.ts     # Shared types
│   │   ā”œā”€ā”€ hooks/       # Matrix provider
│   │   └── lib/         # GraphQL client & utilities
│   ā”œā”€ā”€ shadcn/          # Shadcn UI implementation
│   │   ā”œā”€ā”€ IxoEditor.tsx
│   │   ā”œā”€ā”€ blocks/      # Full-featured custom blocks
│   │   ā”œā”€ā”€ components/  # Shadcn UI components
│   │   ā”œā”€ā”€ hooks/       # Editor hooks
│   │   └── index.ts     # Shadcn exports
│   ā”œā”€ā”€ mantine/         # Mantine UI implementation
│   │   ā”œā”€ā”€ IxoEditor.tsx
│   │   ā”œā”€ā”€ blocks/      # Minimal custom blocks
│   │   ā”œā”€ā”€ hooks/       # Editor hooks
│   │   └── index.ts     # Mantine exports
│   ā”œā”€ā”€ styles/          # Source CSS
│   │   └── ixo-editor.css
│   └── index.ts         # Main entry (defaults to shadcn)
ā”œā”€ā”€ fonts/               # Inter font files
ā”œā”€ā”€ dist/                # Built JavaScript
│   ā”œā”€ā”€ index.js         # Main bundle
│   ā”œā”€ā”€ shadcn/          # Shadcn bundle
│   └── mantine/         # Mantine bundle
ā”œā”€ā”€ style*.css           # CSS bundles
└── package.json

Building the Package

# Install dependencies
pnpm install

# Build the package (creates all bundles)
pnpm build

# Watch for changes during development
pnpm run dev

# Type checking
pnpm run type-check

Requirements

  • React 18.0.0 or higher
  • React DOM 18.0.0 or higher
  • Modern browser with ES2020 support
  • For collaborative editing: Matrix server access

Additional Requirements by UI Library

For Mantine version:

  • @mantine/core ^8.0.0 (peer dependency)
  • @mantine/hooks ^8.0.0 (peer dependency)

For Shadcn version:

  • Works with existing Tailwind CSS setup
  • No additional peer dependencies

Migration Guide

From v1.x to v2.x (Multi-UI)

Before (v1.x):

import { IxoEditor } from '@ixo/editor';
import '@blocknote/shadcn/style.css';
import '@ixo/editor/style.css';

After (v2.x) - Recommended:

// Explicit shadcn version with complete CSS bundle
import { IxoEditor } from '@ixo/editor/shadcn';
import '@ixo/editor/style-shadcn.css'; // Single import!

After (v2.x) - Backward compatible:

// Still works! (defaults to shadcn)
import { IxoEditor } from '@ixo/editor';
import '@ixo/editor/style.css'; // Now includes all dependencies

License

MIT Ā© IXO Team

Internal Notes

This package is maintained by the IXO development team. For questions or issues, please contact the team directly through internal channels.

Version Management

Follow semantic versioning:

  • Patch releases (0.0.x): Bug fixes and minor updates
  • Minor releases (0.x.0): New features that are backward compatible
  • Major releases (x.0.0): Breaking changes (like the multi-UI restructure)

Contributing

This is an internal package. All contributions should go through the standard IXO development workflow and review process.

Keywords

editor

FAQs

Package last updated on 24 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts