UNPKG

@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,

153 lines (152 loc) 6.53 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const Vue = require("vue"); const type = require("../../type.js"); const index = require("../../../../locales/index.js"); const IconButton = require("../../../common/base/IconButton.vue.js"); const vClickOutside = require("../../../../directives/vClickOutside.js"); ;/* empty css */ const TextIcon = require("../Icon/TextIcon.vue.js"); const H1 = require("../Image/H1.svg.js"); const H2 = require("../Image/H2.svg.js"); const H3 = require("../Image/H3.svg.js"); const H4 = require("../Image/H4.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: "text-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 }, emits: ["click"], setup(__props, { emit: __emit }) { const { t } = index.useI18n(); const textSizes = [ { icon: H1.default, size: 32 }, { icon: H2.default, size: 24 }, { icon: H3.default, size: 18.72 }, { icon: H4.default, size: 16 } ]; const textColors = [ { 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 } ]; const showSettings = Vue.ref(false); const props = __props; function handleHideButtonSetting() { if (props.activeTool === type.DrawingTool.Text) { showSettings.value = false; } } const toolSetting = Vue.reactive({ drawingTool: type.DrawingTool.Text, shapeOptions: { strokeWidth: 18.72, stroke: "#22262E" } }); const emit = __emit; Vue.watch( () => props.activeTool, () => { showSettings.value = false; } ); const onClick = () => { showSettings.value = !showSettings.value; emit("click", toolSetting); }; const handleSizeClick = (size) => { if (size === toolSetting.shapeOptions.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, Vue.mergeProps({ class: "tool-button" }, _ctx.$attrs, { onClickIcon: onClick }), { default: Vue.withCtx(() => [ Vue.createVNode(TextIcon.default, { class: Vue.normalizeClass({ "whiteboard-icon-active": __props.activeTool === Vue.unref(type.DrawingTool).Text }) }, null, 8, ["class"]), showSettings.value && __props.activeTool === "Text" ? (Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [ Vue.createElementVNode("div", _hoisted_2, Vue.toDisplayString(Vue.unref(t)("Text Size")), 1), Vue.createElementVNode("div", _hoisted_3, [ (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(textSizes, (textSize) => { return Vue.createElementVNode("button", { key: textSize.size, class: Vue.normalizeClass(["size-button setting-option-button", { "button-active": textSize.size === toolSetting.shapeOptions.strokeWidth }]), onClick: Vue.withModifiers(($event) => handleSizeClick(textSize.size), ["stop"]) }, [ Vue.createElementVNode("img", { src: textSize.icon }, null, 8, _hoisted_5) ], 10, _hoisted_4); }), 64)) ]), Vue.createElementVNode("div", _hoisted_6, Vue.toDisplayString(Vue.unref(t)("Text Color")), 1), Vue.createElementVNode("div", _hoisted_7, [ (Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(textColors, (textColor) => { return Vue.createElementVNode("button", { key: textColor.color, class: Vue.normalizeClass(["color-button setting-option-button", { "button-active": textColor.color === toolSetting.shapeOptions.stroke }]), onClick: Vue.withModifiers(($event) => handleColorClick(textColor.color), ["stop"]) }, [ Vue.createElementVNode("img", { src: textColor.icon }, null, 8, _hoisted_9) ], 10, _hoisted_8); }), 64)) ]) ])) : Vue.createCommentVNode("", true) ]), _: 1 }, 16)), [ [Vue.unref(vClickOutside.default), handleHideButtonSetting] ]); }; } }); exports.default = _sfc_main;