npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@metztheolab/tei-component-suite

v0.3.0

Published

Lorraine University TEI Component Suite (LU-TCS)

Downloads

68

Readme

Lorraine University TEI Component Suite (LU-TCS)

Description

This project is a web component library that provide a main component TcsEditor to edit XML TEI files. It is designed to be used in the Scribes app.

Usage

NPM Package

https://www.npmjs.com/package/@metztheolab/tei-component-suite

Installation

Whatever the framework you are using, you can install the package with npm:

npm install @metztheolab/tei-component-suite

Without framework

In the head of your HTML file, include the following:

<head>
  <script type="module">
    import { defineCustomElements } from '[package-url-or-cdn]/loader/index.es2017.js';
    defineCustomElements();
  </script>
  <script>
    globalThis.TcsConfig = {
      // This is used to set the path to the symbols.svg file which contains the icons used in the editor.
      symbolsPath: '[url]/symbols.svg',
    }
  </script>
</head>

Use components in your HTML file:

<body>
  <Tcs-editor></Tcs-editor>
</body>

Vue 3

Create a setup-component-library.sh file in the root of your project, this will copy the necessary files to the location of your choice:

#!/bin/bash

set -e

# Removes the existing component-library folder
rm -rf src/lib/component-library
# Create folders
mkdir -p src/lib/component-library
mkdir -p public/assets
# Copies the necessary files to the src/lib/component-library folder
cp -r node_modules/@metztheolab/tei-component-suite/dist/vue/ src/lib/component-library/
# Copies the symbols.svg file to the public/assets folder
cp node_modules/@metztheolab/tei-component-suite/dist/collection/symbols.svg public/assets/symbols.svg

In the package.json file, add postinstall script:

// ...
  "scripts": {
    // ...
    "postinstall": "bash setup-component-library.sh"
  }
// ...

Re-run the installation to trigger the postinstall script:

npm install

Configure Vite to accept JSX :

// ...
export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          // treat all tags with a dash as custom elements
          isCustomElement: (tag) => tag.includes('-'),
        },
      },
    }),
    // Import the plugin
    vueJsx(),
  ]
  // ...
})

Use the Vue Plugin in your main.ts file:

import './assets/main.css'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { ComponentLibrary } from './lib/component-library'

const app = createApp(App)

app
  .use(router)
  // Import the plugin
  .use(ComponentLibrary).mount('#app')

Define the symbols path in your Vue app (wherever you want, in App.vue for example):

// ...
globalThis.TcsConfig = {
  symbolsPath: '/assets/symbols.svg',
}

Use components in your Vue app:

<template>
  <!-- ... -->
  <Tcs-editor />
  <!-- ... -->
</template>

React

Create a setup-component-library.sh file in the root of your project, this will copy the necessary files to the location of your choice:

#!/bin/bash

set -e

# Removes the existing component-library folder
rm -rf src/lib/component-library
# Create folders
mkdir -p src/lib/component-library
mkdir -p public/assets
# Copies the necessary files to the src/lib/component-library folder
cp -r node_modules/@metztheolab/tei-component-suite/dist/react/ src/lib/component-library/
# Copies the symbols.svg file to the public/assets folder
cp node_modules/@metztheolab/tei-component-suite/dist/collection/symbols.svg public/assets/symbols.svg

In the package.json file, add postinstall script:

// ...
  "scripts": {
    // ...
    "postinstall": "bash setup-component-library.sh"
  }
// ...

Re-run the installation to trigger the postinstall script:

npm install

Configure the TypeScript compiler, especially module resolution, to allow the import of the components:

{
  "compilerOptions": {
    // ...
    "module": "esnext",
    "moduleResolution": "bundler",
  }
}

Define the symbols path in your React app (wherever you want, in app.tsx for example):

// ...
globalThis.TcsConfig = {
  symbolsPath: '/assets/symbols.svg',
}

Use components in your React app:

import React from 'react';
import './App.css';
import TcsEditor from './lib/component-library/TcsEditor';

function App() {
  return (
    <div className="App">
      <TcsEditor />
    </div>
  );
}

export default App;

Angular

⚠️ Standalone Angular components are not supported, you need to use the Angular directives provided by the library. So, do not initialize your project as a standalone Angular application, but as a regular Angular application.

Create a setup-component-library.sh file in the root of your project, this will copy the necessary files to the location of your choice:

#!/bin/bash

set -e

# Removes the existing library if already exists
rm -rf src/lib/component-library
# Create folders
mkdir -p src/lib/component-library
mkdir -p public/assets
# Copies the necessary files to the src/lib/component-library folder
cp -r node_modules/@metztheolab/tei-component-suite/dist/ng/ src/lib/component-library/
# Copies the symbols.svg file to the public/assets folder
cp node_modules/@metztheolab/tei-component-suite/dist/collection/symbols.svg public/assets/symbols.svg

In the package.json file, add postinstall script:

// ...
  "scripts": {
    // ...
    "postinstall": "bash setup-component-library.sh"
  }
// ...

Re-run the installation to trigger the postinstall script:

npm install

Import the components (built as directives) in your app.module.ts:

import { NgModule, APP_INITIALIZER } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { DIRECTIVES as TcsEditorComponents } from '../lib/component-library';
import { defineCustomElements } from '@metztheolab/tei-component-suite';

@NgModule({
  declarations: [
    AppComponent,
    ...TcsEditorComponents
  ],
  exports: [
    ...TcsEditorComponents
  ],
  imports: [
    BrowserModule,
    AppRoutingModule
  ],
  providers: [
    {
      provide: APP_INITIALIZER,
      useFactory: () => defineCustomElements,
      multi: true
    }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Define the symbols path in your Angular app (wherever you want, in main.ts for example):

// ...
globalThis.TcsConfig = {
  symbolsPath: '/assets/symbols.svg',
}

Use components in your Angular template files:

<!-- ... -->
<Tcs-editor></Tcs-editor>

Main component usage

<body>
  <!-- You can use attributes such as toolbarConfig or settings, see the appropriate readme for more information -->
  <Tcs-editor id="editor"></Tcs-editor>
  <script>
    const editor = document.querySelector('#editor');
    // Get the current formatted TEI content
    // {transcribe: '{XML TEI string}', translate: '{XML TEI string}', comment_line: '{XML TEI string}', comment_verse: '{XML TEI string}'}
    editor.getFormattedTEI();

    // Set the TEI content
    editor.setFormattedTEI({
      transcribe: '{XML TEI string}'
      translate: '{XML TEI string}'
      comment_line: '{XML TEI string}'
      comment_verse: '{XML TEI string}'
    });

    // Lock the editor
    editor.lock();

    // Unlock the editor
    editor.unlock();
  </script>
</body>

Develop

This project rely on the following tools:

Quick start

  • Copy .docker/.env.example to .docker/.env and adjust the values to your needs
  • Run make up (once installed you can use make start to start the docker compose)
  • Run make install to install the dependencies
  • Run make dev to start the development

Publish the package

  • Set the NPM_TOKEN in the .docker/.env file (ask the maintainer for the token)

Useful commands

| Command | Description | | --- | --- | | make up | Start the docker compose services | | make down | Stop the docker compose services | | make start | Start the docker compose services | | make stop | Stop the docker compose services | | make install | Install the dependencies | | make dev | Start the development | | make build | Build the project | | make stencil | Use stencil CLI | | make logs | Show the logs | | make npm | Run npm commands | | make shell | Open a shell in the container | | make publish | Publish the package |