
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@aurigma/ui-framework
Advanced tools
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
The ordering and personalization process can be organized on a step-by-step basis. For example, your users may:
Even more complicated workflows may exist.
UI-framework allows you to implement such a step sequence by composing your application from widgets like from building blocks in a configuration file. That allows for the flexible Customer's Canvas even by non-programmers, no matter if you need a simple editor or a multi-step wizard.
To download the UI Framework, just run:
npm install @aurigma/ui-framework
The package is already compiled and bundled, there is no need to re-build it.
If you don't want to install it locally, you can use Azure CDN:
https://staticjs-aurigma.azureedge.net/ui-framework/latest
Starting with UI Framework 4.0, you should load the editor to the page as follows:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"
integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<style>
.editor-container {
padding-top: 16px;
height: 90vh;
}
</style>
<title>UI Framework Sample</title>
</head>
<body>
<div class="container-fluid">
<div id="editor-container" class="editor-container"></div>
<script type="module">
const uiFrameworkBaseUrl = "https://staticjs-aurigma.azureedge.net/ui-framework/latest";
import moduleLoader from "https://staticjs-aurigma.azureedge.net/ui-framework/latest/moduleLoader.js";
document.addEventListener('DOMContentLoaded', async () => {
// See https://customerscanvas.com/dev/editors/ui-framework/ecommerce-driver.html
// for more details.
const prodRequest = await fetch('./sample/product.json');
const product = await prodRequest.json();
// See https://customerscanvas.com/dev/editors/ui-framework/overview.html for
// the syntax explanation and widget reference.
const confRequest = await fetch('./sample/config.json')
const config = await confRequest.json();
let driver = (await moduleLoader.dynamicImport("ecommerceDriver", `${uiFrameworkBaseUrl}/drivers/default-driver.js`)).ecommerceDriver;
let editor = (await moduleLoader.dynamicImportDefault("editor", `${uiFrameworkBaseUrl}/editor.js`)).editor;
// Don't forget to specify actual link to your instance of Customer's Canvas as a value of customersCanvasBaseUrl
let ecommerce = await driver.init(product, editor, config, /* settings */ { customersCanvasBaseUrl: "" }, /* restore data */ null, /*quantity*/ 1, /* user info*/ { id: 'test-user' });
ecommerce.products.current.renderEditor(document.getElementById("editor-container"));
// How to receive data from the editor after the user finishes editing it
ecommerce.cart.onSubmitted.subscribe(function (data) {
console.log("submitted");
data.lineItems.forEach(function (order) {
console.log(order);
})
});
});
</script>
</body>
</html>
A few comments on this:
uiFrameworkBaseUrl
variable. Since the import
keyword in JavaScript supports only string literals, you have to duplicate the URL there as well.driver.init(...)
method where you pass product, config, and some other data. After that you are using the renderEditor
method where you pass the container element you created on the step 1.onSubmitted
event handler. Other events also exist.FAQs
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
We found that @aurigma/ui-framework demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.