API

Register components and control name collisions

Exports

Import registerRalma to install the components. Import componentNames when you need the complete tag list, and hrefAwareComponentNames to inspect which tags sanitize links.

registerRalma(Ractive, options?)

Adds Ralma's component constructors to Ractive.components. Re-running registration leaves existing matching components in place.

registerRalma(Ractive, {
  overwrite: false,
  warnOnCollision: true,
});

Options

  • overwrite: replace existing component names when true
  • warnOnCollision: log warnings when a name is already registered

Link Safety

Link-capable components reject unsafe schemes such as javascript:, data:, and vbscript:. Components that can render as buttons use button mode instead.

componentNames

Use the exported list to render component indexes, validate templates, or assert that registration completed.

hrefAwareComponentNames

Use the exported set to inspect which components sanitize their href value before rendering a link.