seisei_tagflow 0.1.0-dev.0 copy "seisei_tagflow: ^0.1.0-dev.0" to clipboard
seisei_tagflow: ^0.1.0-dev.0 copied to clipboard

Experimental optional adapter from seisei_ui blocks to Tagflow documents.

seisei_tagflow #

Experimental optional adapter from seisei_ui blocks to Tagflow runtime documents.

This package depends directly on tagflow and Flutter, but core Seisei packages do not. The adapter returns TagflowDocument values so apps can choose their own Tagflow.document(...) rendering, registries, and view options.

Status #

Experimental. The current implementation targets Tagflow 1.0.0-alpha.1 and a small content-oriented block vocabulary only.

Supported Blocks #

  • root
  • document
  • container
  • paragraph
  • heading
  • text
  • link
  • list
  • listItem
  • blockquote
  • codeBlock
  • inlineCode
  • image
  • horizontalRule

Actions are not supported. The adapter fails before render when a block tree contains unsupported block types, unsupported actions, duplicate block IDs, or invalid required props.

Usage #

import 'package:seisei_tagflow/seisei_tagflow.dart';
import 'package:seisei_ui/seisei_ui.dart';
import 'package:tagflow/tagflow.dart';

const adapter = SeiseiTagflowAdapter();

final document = adapter.render(
  const SeiseiBlock(
    id: 'article',
    type: 'root',
    children: [
      SeiseiBlock(
        id: 'article.title',
        type: 'heading',
        props: {'level': 1},
        children: [
          SeiseiBlock(
            id: 'article.title.text',
            type: 'text',
            props: {'value': 'Hello from Seisei'},
          ),
        ],
      ),
    ],
  ),
  const SeiseiBlockRenderContext(),
);

Tagflow.document(document);

Set SeiseiTagflowAdapter.documentIdMetadataKey in SeiseiBlockRenderContext.metadata when the output document ID should differ from the root block ID.

0
likes
150
points
5
downloads

Documentation

API reference

Publisher

verified publisherjha.sh

Weekly Downloads

Experimental optional adapter from seisei_ui blocks to Tagflow documents.

Repository (GitHub)
View/report issues

Topics

#ai #flutter #renderer #tagflow #ui

License

MIT (license)

Dependencies

flutter, seisei_ui, tagflow

More

Packages that depend on seisei_tagflow