@tencentcloud/roomkit-electron-vue3
Version:
<h1 align="center"> TUIRoomKit</h1> Conference (TUIRoomKit) is a product suitable for multi-person audio and video conversation scenarios such as business meetings, webinars, and online education. By integrating this product, you can add room management,
166 lines (165 loc) • 6.86 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const index = require("../../../../locales/index.js");
const type = require("../../type.js");
const IconButton = require("../../../common/base/IconButton.vue.js");
const vClickOutside = require("../../../../directives/vClickOutside.js");
;/* empty css */
const PencilIcon = require("../Icon/PencilIcon.vue.js");
const SizeSmall = require("../Image/SizeSmall.svg.js");
const SizeMid = require("../Image/SizeMid.svg.js");
const SizeBig = require("../Image/SizeBig.svg.js");
const SizeLarge = require("../Image/SizeLarge.svg.js");
const BlueIcon = require("../Image/BlueIcon.svg.js");
const PurpleIcon = require("../Image/PurpleIcon.svg.js");
const YellowIcon = require("../Image/YellowIcon.svg.js");
const OrangeIcon = require("../Image/OrangeIcon.svg.js");
const RedIcon = require("../Image/RedIcon.svg.js");
const GreenIcon = require("../Image/GreenIcon.svg.js");
const DeepBlueIcon = require("../Image/DeepBlueIcon.svg.js");
const BlackIcon = require("../Image/BlackIcon.svg.js");
const DarkGrayIcon = require("../Image/DarkGrayIcon.svg.js");
const GrayIcon = require("../Image/GrayIcon.svg.js");
const LightGrayIcon = require("../Image/LightGrayIcon.svg.js");
const WhiteIcon = require("../Image/WhiteIcon.svg.js");
const _hoisted_1 = {
key: 0,
class: "pen-tool-setting whiteboard-tool-setting"
};
const _hoisted_2 = { class: "size-setting-title setting-title" };
const _hoisted_3 = { class: "size-setting-section setting-section" };
const _hoisted_4 = ["onClick"];
const _hoisted_5 = ["src"];
const _hoisted_6 = { class: "color-setting-title setting-title" };
const _hoisted_7 = { class: "color-setting-section setting-section" };
const _hoisted_8 = ["onClick"];
const _hoisted_9 = ["src"];
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
__name: "index",
props: {
activeTool: String,
changeTool: String
},
emits: ["click"],
setup(__props, { emit: __emit }) {
const { t } = index.useI18n();
const lineSizes = [
{ icon: SizeSmall.default, size: 1 },
{ icon: SizeMid.default, size: 2 },
{ icon: SizeBig.default, size: 5 },
{ icon: SizeLarge.default, size: 10 }
];
const lineColors = [
{ color: "#4791FF", icon: BlueIcon.default },
{ color: "#5940D7", icon: PurpleIcon.default },
{ color: "#F5C342", icon: YellowIcon.default },
{ color: "#E05734", icon: OrangeIcon.default },
{ color: "#DC3859", icon: RedIcon.default },
{ color: "#1AD32C", icon: GreenIcon.default },
{ color: "#104683", icon: DeepBlueIcon.default },
{ color: "#22262E", icon: BlackIcon.default },
{ color: "#86909A", icon: DarkGrayIcon.default },
{ color: "#B5BBC3", icon: GrayIcon.default },
{ color: "#DBDDE2", icon: LightGrayIcon.default },
{ color: "#EAEEF3", icon: WhiteIcon.default }
];
function handleHideButtonSetting() {
if (props.activeTool === type.DrawingTool.Pencil) {
showSettings.value = false;
}
}
const showSettings = Vue.ref(false);
const props = __props;
const toolSetting = Vue.reactive({
drawingTool: type.DrawingTool.Pencil,
shapeOptions: {
strokeWidth: 5,
stroke: "#22262E"
}
});
const emit = __emit;
Vue.watch(
() => props.activeTool,
() => {
showSettings.value = false;
}
);
Vue.watch(
() => props.changeTool,
() => {
if (props.changeTool === type.DrawingTool.Pencil) {
emit("click", toolSetting);
}
}
);
const onClick = () => {
showSettings.value = !showSettings.value;
emit("click", toolSetting);
};
const handleSizeClick = (size) => {
var _a;
if (size === ((_a = toolSetting.shapeOptions) == null ? void 0 : _a.strokeWidth)) {
return;
}
toolSetting.shapeOptions.strokeWidth = size;
emit("click", toolSetting);
};
const handleColorClick = (color) => {
if (toolSetting.shapeOptions.stroke !== color) {
toolSetting.shapeOptions.stroke = color;
emit("click", toolSetting);
}
};
return (_ctx, _cache) => {
return Vue.withDirectives((Vue.openBlock(), Vue.createBlock(IconButton.default, {
class: "tool-button",
onClickIcon: onClick
}, {
default: Vue.withCtx(() => [
Vue.createVNode(PencilIcon.default, {
class: Vue.normalizeClass({ "whiteboard-icon-active": __props.activeTool === Vue.unref(type.DrawingTool).Pencil })
}, null, 8, ["class"]),
showSettings.value && __props.activeTool === Vue.unref(type.DrawingTool).Pencil ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
Vue.createElementVNode("div", _hoisted_2, Vue.toDisplayString(Vue.unref(t)("Line Size")), 1),
Vue.createElementVNode("div", _hoisted_3, [
(Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(lineSizes, (lineSize) => {
return Vue.createElementVNode("button", {
key: lineSize.size,
class: Vue.normalizeClass(["size-button setting-option-button", {
"button-active": lineSize.size === toolSetting.shapeOptions.strokeWidth
}]),
onClick: Vue.withModifiers(($event) => handleSizeClick(lineSize.size), ["stop"])
}, [
Vue.createElementVNode("img", {
src: lineSize.icon
}, null, 8, _hoisted_5)
], 10, _hoisted_4);
}), 64))
]),
Vue.createElementVNode("div", _hoisted_6, Vue.toDisplayString(Vue.unref(t)("Line Color")), 1),
Vue.createElementVNode("div", _hoisted_7, [
(Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(lineColors, (lineColor) => {
return Vue.createElementVNode("button", {
key: lineColor.color,
class: Vue.normalizeClass(["color-button setting-option-button", {
"button-active": lineColor.color === toolSetting.shapeOptions.stroke
}]),
onClick: Vue.withModifiers(($event) => handleColorClick(lineColor.color), ["stop"])
}, [
Vue.createElementVNode("img", {
src: lineColor.icon
}, null, 8, _hoisted_9)
], 10, _hoisted_8);
}), 64))
])
])) : Vue.createCommentVNode("", true)
]),
_: 1
})), [
[Vue.unref(vClickOutside.default), handleHideButtonSetting]
]);
};
}
});
exports.default = _sfc_main;