Cristal Integration - WebJar

Last modified by Admin on 2026/04/01 00:23

cogDeployable Cristal build for XWiki
Typewebjar-node
CategoryWebJar
Developed by

Pierre Jeanjean

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

Since v1.4.0 requires XWiki 18.1.0

Description

This extension provides a Cristal build that can be embedded in XWiki templates.

Usage

To embed Cristal in a template, you first need to import it as well as its dependencies:

<script type="importmap">
  {"imports":{"vue":"[your xwiki domain]\/xwiki\/webjars\/wiki%3Axwiki\/vue\/[vue version]\/dist\/vue.runtime.esm-browser.prod.js","vue-i18n":"[your xwiki domain]\/xwiki\/webjars\/wiki%3Axwiki\/vue-i18n\/[vue-i18n version]\/dist\/vue-i18n.esm-browser.prod.js"}}
</script>
<script type="module" src="[your xwiki domain]/xwiki/webjars/wiki%3Axwiki/cristal-integration-webjar/[Cristal Integration version]/index.es.js"></script>

When possible, it's recommended to use the webjars service instead to handle resolutions:

<script type="importmap">
  $jsontool.serialize({
      'imports': {
          'vue': $services.webjars.url('org.webjars.npm:vue', 'dist/vue.runtime.esm-browser.prod.js'),
          'vue-i18n': $services.webjars.url('org.webjars.npm:vue-i18n', 'dist/vue-i18n.esm-browser.prod.js')
      }
  })
</script>
<script type="module" src="$escapetool.xml($services.webjars.url('org.xwiki.contrib.cristal.integration:cristal-integration-webjar', 'index.es.js'))"></script>

Your Cristal instance will then attempt to mount itself in a container of id "xwCristalApp", so add a div to your template:

<div id="xwCristalApp" class="xw-cristal"></div>

Versions

Dependencies

Dependencies for this extension (org.xwiki.contrib.cristal.integration:cristal-integration-webjar 1.5.0):

  • org.webjars:requirejs 2.3.7
  • org.webjars:jquery 4.0.0
  • org.webjars.npm:vue 3.5.30
  • org.webjars.npm:vue-i18n 11.2.8

Get Connected