@lvce-editor/virtual-dom 1.9.0 → 1.10.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/index.js +4 -3
- package/package.json +1 -1
- package/src/parts/ElementTagMap/ElementTagMap.ts +2 -0
- package/src/parts/ElementTags/ElementTags.ts +1 -0
- package/src/parts/PatchFunctions/PatchFunctions.ts +0 -3
- package/src/parts/RemoveAttributePatch/RemoveAttributePatch.ts +0 -1
- package/src/parts/VirtualDomElements/VirtualDomElements.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -50,6 +50,7 @@ var Video = "video";
|
|
|
50
50
|
var TextArea = "textarea";
|
|
51
51
|
var Select = "select";
|
|
52
52
|
var Option = "option";
|
|
53
|
+
var Code = "code";
|
|
53
54
|
|
|
54
55
|
// src/parts/VirtualDomElements/VirtualDomElements.ts
|
|
55
56
|
var Audio2 = 0;
|
|
@@ -104,6 +105,7 @@ var Video2 = 61;
|
|
|
104
105
|
var TextArea2 = 62;
|
|
105
106
|
var Select2 = 63;
|
|
106
107
|
var Option2 = 64;
|
|
108
|
+
var Code2 = 65;
|
|
107
109
|
|
|
108
110
|
// src/parts/ElementTagMap/ElementTagMap.ts
|
|
109
111
|
var getElementTag = (type) => {
|
|
@@ -210,6 +212,8 @@ var getElementTag = (type) => {
|
|
|
210
212
|
return Select;
|
|
211
213
|
case Option2:
|
|
212
214
|
return Option;
|
|
215
|
+
case Code2:
|
|
216
|
+
return Code;
|
|
213
217
|
default:
|
|
214
218
|
throw new Error(`element tag not found ${type}`);
|
|
215
219
|
}
|
|
@@ -472,9 +476,6 @@ var setText = ($Element, value) => {
|
|
|
472
476
|
$Element.nodeValue = value;
|
|
473
477
|
};
|
|
474
478
|
var removeChild = ($Element, index) => {
|
|
475
|
-
console.log("el", $Element.className);
|
|
476
|
-
console.log("index", index);
|
|
477
|
-
console.log("ch", $Element.children.length);
|
|
478
479
|
const $Child = $Element.children[index];
|
|
479
480
|
$Child.remove();
|
|
480
481
|
};
|
package/package.json
CHANGED
|
@@ -105,6 +105,8 @@ export const getElementTag = (type) => {
|
|
|
105
105
|
return ElementTag.Select
|
|
106
106
|
case VirtualDomElements.Option:
|
|
107
107
|
return ElementTag.Option
|
|
108
|
+
case VirtualDomElements.Code:
|
|
109
|
+
return ElementTag.Code
|
|
108
110
|
default:
|
|
109
111
|
throw new Error(`element tag not found ${type}`)
|
|
110
112
|
}
|
|
@@ -18,9 +18,6 @@ export const setText = ($Element: Text, value: string): void => {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export const removeChild = ($Element: HTMLElement, index: number): void => {
|
|
21
|
-
console.log('el', $Element.className)
|
|
22
|
-
console.log('index', index)
|
|
23
|
-
console.log('ch', $Element.children.length)
|
|
24
21
|
const $Child = $Element.children[index]
|
|
25
22
|
$Child.remove()
|
|
26
23
|
}
|