@ibiz-template/vue3-components 0.5.7-alpha.0 → 0.5.7-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ibiz-markdown-editor-aOoL8-48.js → ibiz-markdown-editor-RaswfMqH.js} +1 -1
- package/dist/index-I2x-n5Oy.js +2 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/wang-editor-5l8qks2j.js +1 -0
- package/dist/{xlsx-util-ohTMZYHr.js → xlsx-util-6wbyBRUE.js} +1 -1
- package/es/editor/html/wang-editor/wang-editor.mjs +23 -16
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +3 -0
- package/es/panel-component/user-message/user-message.mjs +1 -1
- package/lib/editor/html/wang-editor/wang-editor.cjs +21 -14
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +3 -0
- package/lib/panel-component/user-message/user-message.cjs +1 -1
- package/package.json +4 -4
- package/dist/index-dfn6FnHv.js +0 -2
- package/dist/wang-editor-jrOHJc0e.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ref, shallowRef, watch, onBeforeUnmount, onMounted, createTextVNode, createVNode, nextTick, resolveComponent, defineComponent } from 'vue';
|
|
1
|
+
import { ref, shallowRef, watch, onBeforeUnmount, onMounted, createTextVNode, createVNode, nextTick, onUnmounted, resolveComponent, defineComponent } from 'vue';
|
|
2
2
|
import { Toolbar, Editor } from '@wangeditor/editor-for-vue';
|
|
3
3
|
import { getCookie } from 'qx-util';
|
|
4
4
|
import { isNil } from 'ramda';
|
|
5
5
|
import { getHtmlProps, getEditorEmits, useNamespace } from '@ibiz-template/vue3-util';
|
|
6
|
-
import { CoreConst } from '@ibiz-template/core';
|
|
6
|
+
import { CoreConst, awaitTimeout } from '@ibiz-template/core';
|
|
7
7
|
import { ElMessageBox } from 'element-plus';
|
|
8
8
|
import './wang-editor.css';
|
|
9
9
|
|
|
@@ -214,20 +214,22 @@ const IBizHtml = /* @__PURE__ */ defineComponent({
|
|
|
214
214
|
});
|
|
215
215
|
});
|
|
216
216
|
const calcHtmlStyle = () => {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
217
|
+
awaitTimeout(0, () => {
|
|
218
|
+
if (htmlContent.value && toolbarRef.value) {
|
|
219
|
+
const htmlContentHeight = htmlContent.value.offsetHeight;
|
|
220
|
+
resizeObserver = new ResizeObserver((entries) => {
|
|
221
|
+
const height = entries[0].contentRect.height;
|
|
222
|
+
if (height !== lastToolbarHeight) {
|
|
223
|
+
const tempCssVars = {
|
|
224
|
+
height: "".concat(htmlContentHeight - entries[0].contentRect.height, "px")
|
|
225
|
+
};
|
|
226
|
+
cssVars.value = ns.cssVarBlock(tempCssVars);
|
|
227
|
+
lastToolbarHeight = height;
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
resizeObserver.observe(toolbarRef.value.selector);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
231
233
|
};
|
|
232
234
|
const moveToLastStr = () => {
|
|
233
235
|
var _a, _b;
|
|
@@ -372,6 +374,11 @@ const IBizHtml = /* @__PURE__ */ defineComponent({
|
|
|
372
374
|
onMounted(() => {
|
|
373
375
|
calcHtmlStyle();
|
|
374
376
|
});
|
|
377
|
+
onUnmounted(() => {
|
|
378
|
+
if (resizeObserver) {
|
|
379
|
+
resizeObserver.disconnect();
|
|
380
|
+
}
|
|
381
|
+
});
|
|
375
382
|
return {
|
|
376
383
|
ns,
|
|
377
384
|
editorRef,
|
|
@@ -218,20 +218,22 @@ const IBizHtml = /* @__PURE__ */ vue.defineComponent({
|
|
|
218
218
|
});
|
|
219
219
|
});
|
|
220
220
|
const calcHtmlStyle = () => {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
221
|
+
core.awaitTimeout(0, () => {
|
|
222
|
+
if (htmlContent.value && toolbarRef.value) {
|
|
223
|
+
const htmlContentHeight = htmlContent.value.offsetHeight;
|
|
224
|
+
resizeObserver = new ResizeObserver((entries) => {
|
|
225
|
+
const height = entries[0].contentRect.height;
|
|
226
|
+
if (height !== lastToolbarHeight) {
|
|
227
|
+
const tempCssVars = {
|
|
228
|
+
height: "".concat(htmlContentHeight - entries[0].contentRect.height, "px")
|
|
229
|
+
};
|
|
230
|
+
cssVars.value = ns.cssVarBlock(tempCssVars);
|
|
231
|
+
lastToolbarHeight = height;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
resizeObserver.observe(toolbarRef.value.selector);
|
|
235
|
+
}
|
|
236
|
+
});
|
|
235
237
|
};
|
|
236
238
|
const moveToLastStr = () => {
|
|
237
239
|
var _a, _b;
|
|
@@ -376,6 +378,11 @@ const IBizHtml = /* @__PURE__ */ vue.defineComponent({
|
|
|
376
378
|
vue.onMounted(() => {
|
|
377
379
|
calcHtmlStyle();
|
|
378
380
|
});
|
|
381
|
+
vue.onUnmounted(() => {
|
|
382
|
+
if (resizeObserver) {
|
|
383
|
+
resizeObserver.disconnect();
|
|
384
|
+
}
|
|
385
|
+
});
|
|
379
386
|
return {
|
|
380
387
|
ns,
|
|
381
388
|
editorRef,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-components",
|
|
3
|
-
"version": "0.5.7-alpha.
|
|
3
|
+
"version": "0.5.7-alpha.1",
|
|
4
4
|
"description": "使用 rollup 编译 vue 组件或者 jsx",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"@ibiz-template-plugin/ai-chat": "^0.0.1",
|
|
29
29
|
"@ibiz-template-plugin/gantt": "0.1.1",
|
|
30
30
|
"@ibiz-template/core": "^0.5.7-alpha.0",
|
|
31
|
-
"@ibiz-template/model-helper": "^0.5.7-alpha.
|
|
32
|
-
"@ibiz-template/runtime": "^0.5.7-alpha.
|
|
31
|
+
"@ibiz-template/model-helper": "^0.5.7-alpha.1",
|
|
32
|
+
"@ibiz-template/runtime": "^0.5.7-alpha.1",
|
|
33
33
|
"@ibiz-template/theme": "^0.5.0",
|
|
34
|
-
"@ibiz-template/vue3-util": "^0.5.7-alpha.
|
|
34
|
+
"@ibiz-template/vue3-util": "^0.5.7-alpha.1",
|
|
35
35
|
"@ibiz/model-core": "^0.1.6",
|
|
36
36
|
"@imengyu/vue3-context-menu": "^1.3.5",
|
|
37
37
|
"@monaco-editor/loader": "^1.4.0",
|