app/assets/build/coco/app.js in coveragebook_components-0.5.7 vs app/assets/build/coco/app.js in coveragebook_components-0.6.0
- old
+ new
@@ -14602,11 +14602,11 @@
// ../../../package.json
var package_default = {
name: "coveragebook-components",
type: "module",
- version: "0.5.7",
+ version: "0.6.0",
main: "index.js",
repository: "git@github.com:coveragebook/coco.git",
author: "Mark Perkins <mark@coveragebook.com>",
license: "NO LICENSE",
browserslist: [
@@ -29274,11 +29274,12 @@
isCollapsed: false,
approving: false,
confirmed: true,
lastState: null,
stateTooltips: data2.tooltips || {},
- tooltipText: null
+ tooltipText: null,
+ dropdown: null
}, data2.props || {}), {
init() {
this.lastState = this.state;
this.$nextTick(() => {
if (this.$options.confirm) {
@@ -29314,10 +29315,21 @@
return this.$options.disabled === true;
},
set disabled(value) {
this.$options.disabled = value;
},
+ /* dropdown */
+ hideDropdown() {
+ if (this.dropdown) {
+ this.dropdown.hide();
+ }
+ },
+ showDropdown() {
+ if (this.dropdown) {
+ this.dropdown.show();
+ }
+ },
/* confirmation */
checkConfirmation(event) {
if (!this.confirmed) {
this.approving = true;
event.preventDefault();
@@ -29663,15 +29675,24 @@
var slide_editor_default = CocoComponent("appSlideEditor", (data2) => {
const initialData = {
layout: data2.layout,
title: data2.title,
text1: data2.text1,
+ text2: data2.text2,
bgColor: data2.bgColor,
textColor: data2.textColor,
bgImage: {
name: data2.bgImage,
data: data2.bgImage
+ },
+ image1: {
+ name: data2.image1,
+ data: data2.image1
+ },
+ image2: {
+ name: data2.image2,
+ data: data2.image2
}
};
return __spreadProps(__spreadValues({
use: [withUndo()]
}, initialData), {
@@ -29682,10 +29703,13 @@
errors: [],
thumbnailFile: null,
get bgImagePicker() {
return getData(this.$root.querySelector("[data-role='bg-image-picker']"));
},
+ get layoutPicker() {
+ return getData(this.$root.querySelector("[data-role='layout-picker']"));
+ },
init() {
this.$watch("errors", (errors) => {
errors.forEach((error2) => console.error(error2.message));
});
this.$nextTick(() => {
@@ -29710,10 +29734,13 @@
const inputs = this.$root.querySelectorAll(
"[data-component='app-seamless-textarea']"
);
Array.from(inputs).forEach((el) => getData(el).onResize());
},
+ setLayout(layout) {
+ this.layout = layout;
+ },
handleImageDrop(event) {
this.dragging = false;
if (this.bgImagePicker) {
this.bgImagePicker.handleExternalDrop(event);
} else {
@@ -29780,10 +29807,16 @@
input.files = dataTransfer.files;
},
get hasBgImage() {
return !!(this.bgImage && this.bgImage.data);
},
+ get hasImage1() {
+ return !!(this.image1 && this.image1.data);
+ },
+ get hasImage2() {
+ return !!(this.image2 && this.image2.data);
+ },
get bgColorHex() {
return this.bgColor.replace("#", "");
},
get textColorHex() {
return this.textColor.replace("#", "");
@@ -29816,20 +29849,26 @@
[":class"]() {
return {
"slide-bg-dark": this.isDarkBg,
"slide-bg-light": !this.isDarkBg
};
- }
+ },
+ [":data-layout"]: "layout"
},
input: {
- layout: { "x-model.fill": "layout" },
+ layout: { "x-model.fill": "layout.replace(/-/g,'_')" },
title: { "x-model.fill": "title" },
text1: { "x-model.fill": "text1" },
+ text2: { "x-model.fill": "text2" },
bgColor: { "x-model.fill": "bgColorHex" },
textColor: { "x-model.fill": "textColorHex" },
bgImage: { "x-effect": "syncFileInput($el, bgImage.file)" },
bgImagePurge: { ":checked": "!hasBgImage" },
+ image1: { "x-effect": "syncFileInput($el, image1.file)" },
+ image1Purge: { ":checked": "!hasImage1" },
+ image2: { "x-effect": "syncFileInput($el, image2.file)" },
+ image2Purge: { ":checked": "!hasImage2" },
thumbnailImage: { "x-effect": "syncFileInput($el, thumbnailFile)" }
}
});
});
@@ -31881,10 +31920,14 @@
getPicker() {
return getData(
this.$root.querySelector("[data-role='layout-picker']").firstElementChild
);
},
- onDropdownMount() {
+ getButton() {
+ return getData(this.$root.querySelector(".layout-picker-trigger"));
+ },
+ init() {
+ this.$watch("selectedLayout", () => this.getButton().hideDropdown());
}
};
});
// ../../components/coco/app/elements/menu_button/menu_button.js