@lvce-editor/renderer-process 15.5.0 → 15.6.0
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/rendererProcessMain.js +19 -8
- package/package.json +1 -1
|
@@ -286,7 +286,10 @@ const Option = 64;
|
|
|
286
286
|
const Code$2 = 65;
|
|
287
287
|
const Label = 66;
|
|
288
288
|
const Dt = 67;
|
|
289
|
-
const
|
|
289
|
+
const VirtualDomElements = {
|
|
290
|
+
__proto__: null,
|
|
291
|
+
Text: Text$1};
|
|
292
|
+
const getElementTag$1 = type => {
|
|
290
293
|
switch (type) {
|
|
291
294
|
case Audio$2:
|
|
292
295
|
return Audio$1$1;
|
|
@@ -400,6 +403,13 @@ const getElementTag = type => {
|
|
|
400
403
|
throw new Error(`element tag not found ${type}`);
|
|
401
404
|
}
|
|
402
405
|
};
|
|
406
|
+
const ElementTagMap = {
|
|
407
|
+
__proto__: null,
|
|
408
|
+
getElementTag: getElementTag$1
|
|
409
|
+
};
|
|
410
|
+
const {
|
|
411
|
+
getElementTag
|
|
412
|
+
} = ElementTagMap;
|
|
403
413
|
const getEventListenerOptions$1 = (eventName, value) => {
|
|
404
414
|
if (value.passive) {
|
|
405
415
|
return {
|
|
@@ -618,6 +628,9 @@ const setProps = ($Element, props, eventMap, newEventMap) => {
|
|
|
618
628
|
setProp($Element, key, props[key], eventMap, newEventMap);
|
|
619
629
|
}
|
|
620
630
|
};
|
|
631
|
+
const {
|
|
632
|
+
Text: Text$2
|
|
633
|
+
} = VirtualDomElements;
|
|
621
634
|
const renderDomTextNode = element => {
|
|
622
635
|
return document.createTextNode(element.text);
|
|
623
636
|
};
|
|
@@ -629,7 +642,7 @@ const renderDomElement = (element, eventMap, newEventMap) => {
|
|
|
629
642
|
};
|
|
630
643
|
const render$1 = (element, eventMap, newEventMap) => {
|
|
631
644
|
switch (element.type) {
|
|
632
|
-
case Text$
|
|
645
|
+
case Text$2:
|
|
633
646
|
return renderDomTextNode(element);
|
|
634
647
|
default:
|
|
635
648
|
return renderDomElement(element, eventMap, newEventMap);
|
|
@@ -2713,8 +2726,10 @@ const measureTextBlockHeight = (text, fontSize, fontFamily, lineHeight, width) =
|
|
|
2713
2726
|
$Measure.style.left = '-9999px';
|
|
2714
2727
|
$Measure.style.fontSize = `${fontSize}px`;
|
|
2715
2728
|
$Measure.style.lineHeight = lineHeight;
|
|
2729
|
+
$Measure.style.whiteSpace = 'pre';
|
|
2716
2730
|
$Measure.textContent = text;
|
|
2717
|
-
|
|
2731
|
+
const height = getElementHeight($Measure);
|
|
2732
|
+
return height;
|
|
2718
2733
|
};
|
|
2719
2734
|
|
|
2720
2735
|
const measureTextHeight = (text, fontSize, fontFamily) => {
|
|
@@ -8168,11 +8183,7 @@ const setFocused = (state, isFocused) => {
|
|
|
8168
8183
|
const {
|
|
8169
8184
|
$Viewlet
|
|
8170
8185
|
} = state;
|
|
8171
|
-
|
|
8172
|
-
$Viewlet.classList.add(activeClassName);
|
|
8173
|
-
} else {
|
|
8174
|
-
$Viewlet.classList.remove(activeClassName);
|
|
8175
|
-
}
|
|
8186
|
+
$Viewlet.classList.toggle(activeClassName, isFocused);
|
|
8176
8187
|
};
|
|
8177
8188
|
|
|
8178
8189
|
const ViewletTitleBar = {
|