2.19.1 • Published 2 years ago

pyxis-frontend v2.19.1

Weekly downloads
168
License
MIT
Repository
github
Last release
2 years ago

Pyxis plugin

This project is a plugin to be integrated in clay-kiln to manage assets along with Pyxis Backend

Requirements

The Kiln project that is going to use this plugin should set the following environment variables:

PYXIS_HOST=http://localhost:3010 // Where pyxis backend is running
PYXIS_KEY=key // Token for every request

Minimum clay-kiln version required: 8.9.0

Setup

1) Install the package as a dependency

$ npm install --save pyxis-frontend

2) Create a folder for your plugin inside the kiln folder in the services section

$ mkdir PROJECT_FOLDER/app/services/kiln/plugins/PLUGIN_NAME

3) Create an index.js file in the previous directory created, importing main components for the plugin and setting them in the specific window.kiln object.

const {
  NavButton,
  NavContent,
  Input,
  Modal
} = require('pyxis-frontend');

// Used to export components to the window element
module.exports = () => {
  window.kiln.navButtons['pyxis'] = NavButton;
  window.kiln.navContent['pyxis'] = NavContent;
  window.kiln.inputs['pyxis-picker'] = Input;
  window.kiln.modals['pyxis-picker'] = Modal;
};

NavButton: Required component to set the button into the drawer.

NavContent: Component dedicated to show the content of the plugin.

Input: Component to open the Modal for the image picker.

Modal: Component to show the image picker.

4) At app/services/kiln/index.js require the previous component created.

 require('./plugins/pyxis')();

CUSTOM CONFIGURATION

To add custom configuration for the plugin:

1) Create a global config if it doesn't exist

window.kiln.config = window.kiln.config || {};

2) Set a config object in the clay kiln window object.

IMPORTANT: Custom configuration should be set before calling the plugin.

window.kiln.config['pyxis'] = {
  promotionalBaseWidth: 200,
  displayBaseHeight: 100
};

3) Set a config file in Pyxis Backend.

OPTIONAL CONFIGURATION KEYS

displayBaseHeight: Base height required to calculate the ratio for display renditions.

promotionalBaseWidth: Base width required to calculate the ratio for promotional renditions.

Check how this value help to calculate the ratios in config file.

2.19.1-0

2 years ago

2.19.1-1

2 years ago

2.19.1

2 years ago

2.18.2-1

2 years ago

2.19.0

2 years ago

2.18.2-0

3 years ago

2.18.1

4 years ago

2.18.1-0

4 years ago

2.18.0

4 years ago

2.17.0

4 years ago

2.16.0

4 years ago

2.15.0

4 years ago

2.14.1

4 years ago

2.13.0

4 years ago

2.14.0

4 years ago

2.12.0

4 years ago

2.11.1

4 years ago

2.11.0

4 years ago

2.10.0

4 years ago

2.9.1

4 years ago

2.9.0

4 years ago

2.8.0

4 years ago

2.7.0

4 years ago

2.6.0

4 years ago

2.5.1

4 years ago

2.5.0

4 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago