- 新增商城基础信息配置界面支持店铺名称、Logo、描述、电话、地址和开关配置 - 实现图片选择和删除功能,支持Logo的上传回显 - 集成表单校验和保存接口调用,提供保存状态反馈 - 优化响应式布局适配不同屏幕尺寸 fix(cms): 防止文章编辑内容的XSS攻击 - 在文章编辑组件中对动态HTML内容添加DOMPurify消毒 - 替换 v-html 渲染为安全消毒后的内容展现 - 确保富文本内容安全,防止跨站脚本漏洞 refactor(system-setting): 优化系统设置基本信息组件逻辑 - 替换ico文件上传组件,改用SelectFile实现图片选择和删除功能 - 简化图标上传流程,移除上传接口调用相关代码 - 统一表单数据处理,增强设置数据解析和回显兼容性 - 调整保存逻辑,支持根据是否存在主键调用新增或更新接口 - 改进watch数据响应逻辑,支持多种数据结构兼容 fix(system-setting): 修正清理设置组件数据重置逻辑 - 统一清理设置组件的 settingKey 值为 clear,避免混淆 - 优化数据监听回调,支持不同数据结构和空数据重置表单 - 确保组件初始化状态正确,避免遗留数据影响展示 fix(store): 修正 chat store 定义方式 - 按 pinia 官方规范简化 store 定义参数 - 修复 store id 错误传递问题,确保正确注册和使用
99 lines
2.8 KiB
JavaScript
99 lines
2.8 KiB
JavaScript
/**
|
|
* TinyMCE version 6.8.6 (TBD)
|
|
*/
|
|
|
|
(function () {
|
|
'use strict';
|
|
|
|
const Cell = initial => {
|
|
let value = initial;
|
|
const get = () => {
|
|
return value;
|
|
};
|
|
const set = v => {
|
|
value = v;
|
|
};
|
|
return {
|
|
get,
|
|
set
|
|
};
|
|
};
|
|
|
|
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
|
|
const fireVisualBlocks = (editor, state) => {
|
|
editor.dispatch('VisualBlocks', { state });
|
|
};
|
|
|
|
const toggleVisualBlocks = (editor, pluginUrl, enabledState) => {
|
|
const dom = editor.dom;
|
|
dom.toggleClass(editor.getBody(), 'mce-visualblocks');
|
|
enabledState.set(!enabledState.get());
|
|
fireVisualBlocks(editor, enabledState.get());
|
|
};
|
|
|
|
const register$2 = (editor, pluginUrl, enabledState) => {
|
|
editor.addCommand('mceVisualBlocks', () => {
|
|
toggleVisualBlocks(editor, pluginUrl, enabledState);
|
|
});
|
|
};
|
|
|
|
const option = name => editor => editor.options.get(name);
|
|
const register$1 = editor => {
|
|
const registerOption = editor.options.register;
|
|
registerOption('visualblocks_default_state', {
|
|
processor: 'boolean',
|
|
default: false
|
|
});
|
|
};
|
|
const isEnabledByDefault = option('visualblocks_default_state');
|
|
|
|
const setup = (editor, pluginUrl, enabledState) => {
|
|
editor.on('PreviewFormats AfterPreviewFormats', e => {
|
|
if (enabledState.get()) {
|
|
editor.dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type === 'afterpreviewformats');
|
|
}
|
|
});
|
|
editor.on('init', () => {
|
|
if (isEnabledByDefault(editor)) {
|
|
toggleVisualBlocks(editor, pluginUrl, enabledState);
|
|
}
|
|
});
|
|
};
|
|
|
|
const toggleActiveState = (editor, enabledState) => api => {
|
|
api.setActive(enabledState.get());
|
|
const editorEventCallback = e => api.setActive(e.state);
|
|
editor.on('VisualBlocks', editorEventCallback);
|
|
return () => editor.off('VisualBlocks', editorEventCallback);
|
|
};
|
|
const register = (editor, enabledState) => {
|
|
const onAction = () => editor.execCommand('mceVisualBlocks');
|
|
editor.ui.registry.addToggleButton('visualblocks', {
|
|
icon: 'visualblocks',
|
|
tooltip: 'Show blocks',
|
|
onAction,
|
|
onSetup: toggleActiveState(editor, enabledState)
|
|
});
|
|
editor.ui.registry.addToggleMenuItem('visualblocks', {
|
|
text: 'Show blocks',
|
|
icon: 'visualblocks',
|
|
onAction,
|
|
onSetup: toggleActiveState(editor, enabledState)
|
|
});
|
|
};
|
|
|
|
var Plugin = () => {
|
|
global.add('visualblocks', (editor, pluginUrl) => {
|
|
register$1(editor);
|
|
const enabledState = Cell(false);
|
|
register$2(editor, pluginUrl, enabledState);
|
|
register(editor, enabledState);
|
|
setup(editor, pluginUrl, enabledState);
|
|
});
|
|
};
|
|
|
|
Plugin();
|
|
|
|
})();
|