
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@teipublisher/pb-components
Advanced tools
This repository contains the web components used by TEI Publisher and apps generated by it.
Distributing the components in a separate package has several benefits:
While TEI Publisher 5 used Polymer as the framework for webcomponents, components now use the LitElement library, which adds only a thin layer on top of native web components.
Clone the repository, call npm install once and run npm start. This creates a simple webserver which you can access in a browser to see the documentation and demos.
All components talk to an endpoint, which will either be a TEI Publisher instance or an application generated from TEI Publisher. Docs and demos in this repo currently expect the endpoint to be available on http://localhost:8080/exist. TEI Publisher version 6 is required for all features to work correctly.
To include components into your own application, you can load them from a CDN:
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@teipublisher/pb-components/dist/pb-components-bundle.js"></script>
For most use case, including pb-components-bundle.js is enough. However, we ship additional bundles as described below:
| File | Description |
|---|---|
dist/pb-components-bundle.js | (required) the base components, including text views and all core functionality |
dist/pb-leaflet-map.js | (optional) support for displaying maps |
dist/pb-odd-editor.js | implements the visual ODD editor |
dist/pb-component-docs.js | components to view the API documentation of this package |
dist/pb-tify.js | IIIF presentation API viewer |
Bundles build on each other, so you always need to at least include pb-components-bundle.js in your HTML page.
For some examples of how to embed components into plain HTML, see the sample collection on codepen.
Install @teipublisher/pb-components into your project:
npm install --save @teipublisher/pb-components
If you wish to extend the library with your own components, there's a template project available, which you may fork.
Run npm run build:production to generate the set of bundle files in dist, containing all components and their dependencies.
For development, run npm start as described above. It will start a development server (on port 8000 by default), open a browser window and watch for file changes. Every component should have a demo to show its functionality.
You can configure TEI Publisher (or an app generated from it) to load components from the development server. This allows you to directly test changes you made to components within the full TEI Publisher environment.
In TEI Publisher, open modules/config.xqm and change variable $config:webcomponents to the value dev. Below, the variable $config:webcomponents-cdn should be set to http://localhost:8000:
declare variable $config:webcomponents := "dev";
declare variable $config:webcomponents-cdn := "http://localhost:8000";
After reloading TEI Publisher in the browser, components should be loaded from your local development server.
To regenerate the API documentation, run npm run docs.
FAQs
Collection of webcomponents underlying TEI Publisher
The npm package @teipublisher/pb-components receives a total of 1,896 weekly downloads. As such, @teipublisher/pb-components popularity was classified as popular.
We found that @teipublisher/pb-components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

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.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.