@aurigma/design-editor-iframe
Version:
Using this module you can embed Design Editor (a part of Customer's Canvas) to your page through the IFrame API.
687 lines • 31.9 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
return ar;
};
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
import { RuntimeConfiguration } from "./RuntimeConfiguration";
import { FullWindowHandler } from "./FullWindowHandler";
import { Product, Item } from "./ObjectModel/ObjectModel";
import { VERSION } from "./Version";
import * as Workarounds from "./Workarounds/FirefoxWorkarounds";
import { CommandManager } from "./CommandManager";
import { SerializationProvider } from "@aurigma/design-atoms/Serialization";
/**
* Represents the Design Editor.
* @public
*/
var Editor = /** @class */ (function () {
/** @internal */
function Editor(_iframe, postMessageClient, editorUrl, config) {
this._iframe = _iframe;
this._configuration = null;
this._postMessageClient = postMessageClient;
this.commandManager = new CommandManager(postMessageClient);
this._context = {
editorUrl: editorUrl,
client: postMessageClient,
config: config,
editor: this
};
new FullWindowHandler(this, this._iframe);
this._iframe.allowFullscreen = true;
}
Object.defineProperty(Editor, "version", {
get: function () {
return VERSION;
},
enumerable: true,
configurable: true
});
/**
* Renders proof images (72 DPI).
* @param options - Parameters of proof images. Note, when defining the width and height, the resulting image will be proportionally resized to fit the defined rectangle. For example, if the maximum width and height are both set to `640` pixels, then a `1280 x 960` px image will be resized to `640 x 480` px. When using _mockups_, specify the size of proof images more than or equal to the preview mockup size to avoid loss of the image quality.
* @param data - Parameters of variable data printing. You can pass either `dataSet` or `itemsData` into this method.
* @returns Returns an array of temporary links to proof images.
* @example
* ``` js
* // Getting links to proof images.
* const renderingResults = await editor.getProofImages({maxHeight: 720, maxWidth: 720, pregeneratePreviewImages: true})
* // If an error occurred while getting links to proof images.
* .catch(error => console.error("Getting proof images failed with exception: ", error));
*
* // If the links to proof images were generated successfully, get the links from the promise properties.
* proofImageUrls = renderingResults.proofImageUrls;
* ```
*/
Editor.prototype.getProofImages = function (options, data) {
//TODO check arguments
return this._postMessageClient.callProcedure("getProofImages", options, data);
};
/**
* Saves the current product state and returns links to the hi-res output.
* @param options - Parameters of the hi-res and preview images.
* @param data - Parameters of variable data printing. You can pass either `dataSet` or `itemsData` into this method.
* @returns Returns a promise with the resulting product details: the bounding rectangle, links to the hi-res output, permanent links to proof images, a return-to-edit URL, user changes, userId, and stateId.
* @example
* ``` js
* // Completing product customization.
* const productDetails = await editor.finishProductDesign()
* // If an error occurred while completing product customization.
* .catch(error => console.error("Completing product customization failed with exception: ", error));
*
* // If product customization is completed successfully, get the promise properties.
* stateId = productDetails.stateId;
* userId = productDetails.userId;
* userChanges = productDetails.userChanges;
* console.log("Text user changes: ", userChanges.texts);
* ```
*/
Editor.prototype.finishProductDesign = function (options, data) {
//TODO check arguments
return this._postMessageClient.callProcedure("finishProductDesign", options, data);
};
/**
* Saves a product current state.
* @param stateId - Specifies a state file name without an extension, up to 36 symbols length. If such a file exists, it will be overwritten. You can pass this parameter for any user except `master` and `default`. If you omit this parameter, then a new file name is generated.
* @param data - Data for personalization. You can pass either `dataSet` or `itemsData` into this method.
* @param options - Define how the personalization data should be applied.
* @returns Returns a promise with a return-to-edit URL, userId, and stateId.
* @example
* ``` js
* // Saving a product to the "t-shirt.st" file.
* const savingResults = await editor.saveProduct("t-shirt")
* // If an error occurred while saving the product.
* .catch(error => console.error("Saving product failed with exception: ", error));
*
* // If the product is saved correctly, get the promise properties.
* userId = savingResults.userId;
* stateId = savingResults.stateId;
* returnToEditUrl = savingResults.returnToEditUrl;
* console.log("User " + userId + " successfully saved state " + stateId);
* ```
*/
Editor.prototype.saveProduct = function (stateId, data, options) {
return this._postMessageClient.callProcedure("saveProduct", stateId, data, options);
};
/**
* Cancels all changes made by a user.
* @param revertToinitial - Enables reverting the user changes to the initial product state. `false` allows for reverting to the print areas which were set by `Surface.setPrintAreas()` with `updateRevertData` set to `true`. `true` allows for reverting to the initial product despite the `updateRevertData` parameter. The default value is `false`.
*/
Editor.prototype.revertProduct = function (revertToinitial) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, Workarounds.Firefox.waitReady(this._iframe)];
case 1:
_a.sent();
return [2 /*return*/, this._postMessageClient.callProcedure("revertProduct", revertToinitial)];
}
});
});
};
/**
* Reverts the last user action on the canvas.
*/
Editor.prototype.undo = function () {
return this._postMessageClient.callProcedure("undo");
};
/**
* Recovers the last user action on the canvas, which was reverted by the **Undo** command/button.
*/
Editor.prototype.redo = function () {
return this._postMessageClient.callProcedure("redo");
};
/**
* Populates a product with user data.
* @remarks Warning! This method is time-consuming. For optimization, you can populate a product template when it is loading into the editor with {@link https://customerscanvas.com/dev/editors/iframe-api/howto/user-info.html|autoLoadUserInfo} enabled.
* @param data - An object holding key-value pairs. The key is a layer name or an in-string placeholder name without markers and extra symbols. The value is a text or barcode data you want to insert into it. If you omit this parameter, then the `userInfo` passed to the editor during the initial `loadEditor` call is used.
* @param options - Options defining how the user info should be reflected in the history. You can now skip adding these changes to the history as well as replace the last snapshot.
* @example
* ``` js
* let data = {
* "Name": "Alex Smith",
* "Position": "Manager",
* "ID": {
* "BarcodeFormat": "EAN_8",
* "BarcodeValue": "1234567"
* }
* };
*
* // Load the web-to-print editor.
* let editor = await CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition, configuration);
*
* // Populate the product with user data.
* editor.loadUserInfo(data);
* ```
*/
Editor.prototype.loadUserInfo = function (data, options) {
return this._postMessageClient.callProcedure("loadUserInfo", data, options);
};
/**
* Validates the provided user info.
* @param data - An object holdsing key-value pairs. The key is a layer name or an in-string placeholder name without markers and extra symbols. The value is a text or barcode date you want to load into the editor.
* @example
* ``` js
* const data = {
* "Name": "Alex Smith",
* "Position": "Manager",
* "ID": {
* "BarcodeFormat": "EAN_8",
* "BarcodeValue": "1234567"
* }
* };
*
* // Load the web-to-print editor.
* const editor = await CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition, configuration))
* // If an error occurred while loading the editor.
* .catch(e => console.log(e));
*
* // Validate userInfo.
* const validationResults = await editor.validateUserInfo(data);
* if (validationResults.error) {
* // Output the error.
* console.error(validationResults);
* return;
* }
*
* // Populate the product with valid user data.
* editor.loadUserInfo(data);
* ```
*/
Editor.prototype.validateUserInfo = function (data) {
return this._postMessageClient.callProcedure("validateUserInfo", data);
};
/**
* Gets a list of layers that have not been personalized by the user.
* @remarks The resulting list will only contain text items and placeholders that were not changed by the user.
* @returns A list of layers that have not been personalized by the user.
* @example
* ``` js
* const unchangedItems = editor.getUnchangedItems();
*
* if (unchangedItems.items.length > 0) {
* unchangedItems.items.forEach(function (logItems) {
* console.log(logItems);
* });
* }
* else
* {
* console.log("There are no unchanged items");
* }
* ```
*/
Editor.prototype.getUnchangedItems = function () {
return this._postMessageClient.callProcedure("getUnchangedItems");
};
/**
* Links an event with a handler function.
* @remarks The `Events` object contains the supported events.
* @param event - The event to link the handler function with.
* @param handler - The handler function to link with the given event.
* @example The following snippet subscribes to the `Events.BoundsNotification` event and outputs the event arguments to the console:
* ``` js
* const editor = await CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition);
* editor.subscribe(CustomersCanvas.IframeApi.PostMessage.Events.BoundsNotification, (args) => {
* console.log("BoundsNotification was triggered.");
* console.log(JSON.stringify(args, null, 4));
* });
* editor.subscribe(CustomersCanvas.IframeApi.PostMessage.Events.PrintAreaBoundsChanged, (args) => {
* console.log("PrintAreaBoundsChanged");
* console.log(args);
* });
* ```
*/
Editor.prototype.subscribe = function (event /*RpcTypes.Events*/, handler) {
this._postMessageClient.subscribe(event, handler);
};
/**
* Returns the product currently loaded in the editor.
* @returns The product loaded in the editor.
* @example
* ``` js
* // Let us add a back side to the postcard.
* editor.getProduct()
* // When we get the product.
* .then(function(product) {
* // If postcard has no back side.
* if (product.surfaces.length < 2) {
* // Adding the back to the loaded product.
* return product.addSurface(
* {
* // Defining the template file.
* printAreas: [{ designFile: "postcard_side2"}]
* })
* // If the back side is added to the postcard.
* .then(function(newProduct) {
* // Replace the loaded product with the new one.
* product = newProduct;
* });
* }
* })
* // If an error occurred while getting the product or adding a back side to the postcard.
* .catch(function (error) {
* console.error("Adding surface failed with exception: ", error);
* });
* ```
*/
Editor.prototype.getProduct = function () {
var _this = this;
return this._postMessageClient.callProcedure("getRawProduct").then(function (rawProduct) {
return new Product(rawProduct, _this._context);
});
};
/** @internal */
Editor.prototype.replaceInterpolationPlaceholders = function () {
this._context.client.callProcedure("replaceInterpolationPlaceholders");
};
Object.defineProperty(Editor.prototype, "configuration", {
/** @internal */
get: function () {
if (!this._configuration) {
this._configuration = new RuntimeConfiguration(this._postMessageClient);
}
return this._configuration;
},
enumerable: true,
configurable: true
});
/**
* Applies a color theme to the loaded product.
* @param theme - The name of a color theme defined for the configuration or a theme definition.
* @param options - Options for managing the history of user actions.
* @example
* ``` js
* // Define a color theme.
* const productTheme = {
* "violet": {
* "C01": "rgb(102,45,145)",
* "C02": "rgb(150,67,214)",
* "C03": "rgb(190,107,255)",
* "C04": "rgb(32,18,77)"
* }
* };
*
* // Enable the violet theme.
* const editor = await CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition,
* { productThemes: productTheme, defaultProductTheme: "violet" })
* // If an error occurred while loading the editor.
* .catch(error => console.error("The editor failed to load with an exception: ", error));
*
* // If the editor has been successfully loaded, change the color theme.
* await editor.applyProductTheme({
* "C01": "rgb(241,160,175)",
* "C02": "rgb(255,200,214)",
* "C03": "rgb(255,255,255)",
* "C04": "rgb(224,102,102)"
* },
* // Don't save the theme change to the history.
* {
* addToHistory: false
* });
* ```
*/
Editor.prototype.applyProductTheme = function (theme, options) {
if (options === void 0) { options = { addToHistory: true }; }
return this._postMessageClient.callProcedure("applyProductTheme", theme, options);
};
/** @internal */
Editor.prototype.eval = function (code) {
var _a;
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
console.warn("It is highly recommended not to use the eval function!");
return typeof code === "string" ?
this._postMessageClient.callProcedure("evalCode", code)
: (_a = this._postMessageClient).callProcedure.apply(_a, __spread(["evalFunc"], __spread([code.toString()], args)));
};
/**
* Releases all resources used by the editor.
*/
Editor.prototype.dispose = function () {
this._postMessageClient.dispose();
};
/**
* Gets an array of selected design elements.
* @example
* ``` js
* const ids = (await editor.getSelectedItems()).map(item => item.id);
* if (ids.length > 0) {
*
* var product = await editor.getProduct();
* var rectangles = await product.getItemRectangles(ids);
* var message = "";
* for (let i = 0; i < rectangles.length; i++) {
* const rotatedRect = rectangles[i];
* const rect = rotatedRect.toRectangleF();
* message += "Item with " + ids[i] +
* " has: width: " + rect.width.toFixed(2) +
* ", height: " + rect.height.toFixed(2) +
* ", location: (" + rect.left.toFixed(2) + ", " + rect.top.toFixed(2) + ")" +
* ", angle: " + rotatedRect.angle.toFixed(2) + "\n";
* }
*
* console.log(message);
* }
* ```
*/
Editor.prototype.getSelectedItems = function () {
return __awaiter(this, void 0, void 0, function () {
var items;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this._context.client.callProcedure("getSelectedItems")];
case 1:
items = (_a.sent());
return [2 /*return*/, items.map(function (i) { return new Item(i); })];
}
});
});
};
/**
* Selects the specified design elements on the current surface.
* @remarks You can call {@link (Editor:class).getSelectedItems} to access the items.
* @param items - An array of objects that contain design element names.
* @example
* ``` js
* editor.selectItems([
* {
* "name": "Contact"
* },
* {
* "name": "Address"
* }
* ]);
* ```
*/
Editor.prototype.selectItems = function (items) {
return __awaiter(this, void 0, void 0, function () {
var serializer, serializedItems;
return __generator(this, function (_a) {
serializer = SerializationProvider.getProductSerializer();
serializedItems = items.map(function (i) { return serializer.serializeModelComponent(i); });
this._context.client.callProcedure("selectItems", serializedItems);
return [2 /*return*/];
});
});
};
/**
* Deselects design elements on the current surface.
* @example
* ``` js
* editor.clearSelection();
* ```
*/
Editor.prototype.clearSelection = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
this._context.client.callProcedure("clearSelection");
return [2 /*return*/];
});
});
};
/**
* Selects all design elements on the current surface.
* @remarks You can call {@link (Editor:class).getSelectedItems} to access the items.
* @example
* ``` js
* editor.selectAllItems();
* ```
*/
Editor.prototype.selectAllItems = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
this._context.client.callProcedure("selectAllItems");
return [2 /*return*/];
});
});
};
/**
* Changes Parameters of displaying the propuct on the canvas.
* @param settings - An object defining the appearance of the canvas.
* @example
* ``` js
* // Changing the zoom and scroll position.
* editor.setViewerSettings({zoom: 0.1, zoomMode: 'bestFit', scrollPosition: {x: 0, y: 0}})
* .catch(error => {
* console.error("Changing the canvas settings failed with exception: ", error);
* });
* ```
* @public
*/
Editor.prototype.setViewerSettings = function (settings) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this._context.client.callProcedure("setViewerSettings", settings)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
/**
* Opens the Asset Manager with the listed asset tabs to add a new image to the design.
* @param params - Parameters defining the appearance of the Asset Manager. In the `params.tabs` array, pass the names of the required asset sources.
* @param action - An action that should be applied to the product, either `"layout"` to change layouts or `"fillPlaceholders"` to automatically fill out image placeholders. By default, the Action Manager opens to add an image to the design.
* @example After you have defined the "My Files" and "Deposit Photos" asset sources, you can open the gallery with these tabs as follows:
* ``` js
* let editor = await CustomersCanvas.IframeApi.loadEditor(iframe, product, config);
* editor.openGallery({ tabs: ["My Files", "Deposit Photos"] });
* ```
*
* @example You can also open the Action Manager to change product layouts as follows:
* ``` js
* editor.openGallery({ tabs: ["Layouts"] }, "layout");
* ```
*/
Editor.prototype.openGallery = function (params, action) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this._context.client.callProcedure("openAssetManager", params, action)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
/**
* Opens the Asset Manager to select an image for the background layer.
* @param params - Parameters defining the appearance of the Asset Manager. In the `params.tabs` array, pass the names of the required asset sources.
* @example
* ``` js
* let editor = await CustomersCanvas.IframeApi.loadEditor(iframe, product, config);
* editor.openGalleryForBackground({ tabs: ["Backgrounds"] });
* ```
*/
Editor.prototype.openGalleryForBackground = function (params) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this._context.client.callProcedure("openAssetManagerForBg", params)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
/**
* Opens the Asset Manager to select an image for the specified item.
* @param name - The name of the image you want to change.
* @param params - Parameters defining the appearance of the Asset Manager. In the `params.tabs` array, pass the names of the required asset sources.
* @example
* ``` js
* let editor = await CustomersCanvas.IframeApi.loadEditor(iframe, product, config);
* editor.openGalleryForItem("Company Logo", { tabs: ["Logos"] });
* ```
*/
Editor.prototype.openGalleryForItem = function (name, params) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this._context.client.callProcedure("openAssetManagerForItem", name, params)];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
};
/**
* Changes a preloader image and the primary theme color.
* @param conf - Defines the primary color and a new image for the standard preloader.
* @example
* ``` js
* let editor = await CustomersCanvas.IframeApi.loadEditor(iframe, product, config);
* await editor.setThemeConfiguration({ primaryColor: "rgb(120, 24, 123)" });
* ```
*/
Editor.prototype.setThemeConfiguration = function (conf) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this._context.client.callProcedure("setThemeConfiguration", conf)];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
};
Editor.prototype.updateConfiguration = function (config) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this._context.client.callProcedure("updateConfiguration", config)];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
};
/**
* Changes the visibility of the Object Inspector. It allows for displaying or hiding the Object Inspector during the editing process.
* @example
* ```js
* let editor = await CustomersCanvas.IframeApi.loadEditor(iframe, product, config);
* await editor.toggleObjectInspector();
* ```
*/
Editor.prototype.toggleObjectInspector = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this._context.client.callProcedure("toggleObjectInspector")];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
};
Editor.prototype._checkParams = function (paramsDescription) {
var e_1, _a;
try {
for (var paramsDescription_1 = __values(paramsDescription), paramsDescription_1_1 = paramsDescription_1.next(); !paramsDescription_1_1.done; paramsDescription_1_1 = paramsDescription_1.next()) {
var paramDesc = paramsDescription_1_1.value;
if (typeof paramDesc.value !== paramDesc.type) {
if (window.console)
console.error("Wrong parameter: " + paramDesc.name);
return false;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (paramsDescription_1_1 && !paramsDescription_1_1.done && (_a = paramsDescription_1.return)) _a.call(paramsDescription_1);
}
finally { if (e_1) throw e_1.error; }
}
return true;
};
return Editor;
}());
export { Editor };
/**
* Represents the Design Editor.
* @remarks These interfaces define properties of the objects used as arguments of the methods of the Customer's Canvas IFrame API.
* @public
*/
(function (Editor) {
/** Results of preflight check. */
var ViolationState;
(function (ViolationState) {
/** The preflight check was not performed, `0`. */
ViolationState[ViolationState["None"] = 0] = "None";
/** The preflight check is successful, `1`. */
ViolationState[ViolationState["Good"] = 1] = "Good";
/** The preflight check results in a warning, `2`. */
ViolationState[ViolationState["Warning"] = 2] = "Warning";
/** The preflight check results in an error, `3`. */
ViolationState[ViolationState["Bad"] = 3] = "Bad";
})(ViolationState = Editor.ViolationState || (Editor.ViolationState = {}));
})(Editor || (Editor = {}));
//# sourceMappingURL=Editor.js.map