@omicronenergy/oscd-scl-dialogs 0.0.9 → 0.0.11
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/CHANGELOG.md +20 -0
- package/custom-elements.json +449 -6
- package/dist/OscdTextEditor.d.ts +7 -14
- package/dist/OscdTextEditor.js +33 -33
- package/dist/OscdTextEditor.js.map +1 -1
- package/dist/ace-editor/AceEditor.d.ts +65 -0
- package/dist/ace-editor/AceEditor.js +205 -0
- package/dist/ace-editor/AceEditor.js.map +1 -0
- package/dist/ace-editor/debounce.d.ts +24 -0
- package/dist/ace-editor/debounce.js +41 -0
- package/dist/ace-editor/debounce.js.map +1 -0
- package/dist/ace-editor/property-decorators.d.ts +66 -0
- package/dist/ace-editor/property-decorators.js +171 -0
- package/dist/ace-editor/property-decorators.js.map +1 -0
- package/dist/wizards/dotype.js +1 -1
- package/dist/wizards/dotype.js.map +1 -1
- package/dist/wizards/function.js +2 -2
- package/dist/wizards/function.js.map +1 -1
- package/dist/wizards/generalEquipment.js +1 -1
- package/dist/wizards/generalEquipment.js.map +1 -1
- package/dist/wizards/ldevice.js +7 -5
- package/dist/wizards/ldevice.js.map +1 -1
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.11](https://github.com/OMICRONEnergyOSS/oscd-scl-dialogs/compare/oscd-scl-dialogs-v0.0.10...oscd-scl-dialogs-v0.0.11) (2026-03-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* for nullable fields prefer value over maybeValue ([d6caf79](https://github.com/OMICRONEnergyOSS/oscd-scl-dialogs/commit/d6caf79197e6936bcce7f07ab826968db9374452))
|
|
9
|
+
|
|
10
|
+
## [0.0.10](https://github.com/OMICRONEnergyOSS/oscd-scl-dialogs/compare/oscd-scl-dialogs-v0.0.9...oscd-scl-dialogs-v0.0.10) (2026-02-16)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* copy in ace-custom-element to avoid scoping torture ([5b9b757](https://github.com/OMICRONEnergyOSS/oscd-scl-dialogs/commit/5b9b7575f7b0db00175f52ce8f5b53adc4691329))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* bundling ace-editor should not cause component scope issues ([769def5](https://github.com/OMICRONEnergyOSS/oscd-scl-dialogs/commit/769def5eac0c75956e3f20bcb4fb06a379349db9))
|
|
21
|
+
* ldevice updates should only update ldName when correctly set ([042ef2f](https://github.com/OMICRONEnergyOSS/oscd-scl-dialogs/commit/042ef2f3f1da41f5464e0f1ab26da34faf7550bf))
|
|
22
|
+
|
|
3
23
|
## [0.0.9](https://github.com/OMICRONEnergyOSS/oscd-scl-dialogs/compare/oscd-scl-dialogs-v0.0.8...oscd-scl-dialogs-v0.0.9) (2026-02-16)
|
|
4
24
|
|
|
5
25
|
|
package/custom-elements.json
CHANGED
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
"text": "object"
|
|
329
329
|
},
|
|
330
330
|
"static": true,
|
|
331
|
-
"default": "{ // Left here for clarity sake. We need to dyn-import this so we have a chance of overriding the customElements.define to prevent // ace-editor from being registered globally and causing issues with other instances of ace-editor in the same document.
|
|
331
|
+
"default": "{ // Left here for clarity sake. We need to dyn-import this so we have a chance of overriding the customElements.define to prevent // ace-editor from being registered globally and causing issues with other instances of ace-editor in the same document. 'ace-editor': AceEditor, }"
|
|
332
332
|
},
|
|
333
333
|
{
|
|
334
334
|
"kind": "field",
|
|
@@ -367,6 +367,29 @@
|
|
|
367
367
|
}
|
|
368
368
|
]
|
|
369
369
|
},
|
|
370
|
+
{
|
|
371
|
+
"kind": "method",
|
|
372
|
+
"name": "firstUpdated",
|
|
373
|
+
"privacy": "protected",
|
|
374
|
+
"return": {
|
|
375
|
+
"type": {
|
|
376
|
+
"text": "void"
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"parameters": [
|
|
380
|
+
{
|
|
381
|
+
"name": "_changedProperties",
|
|
382
|
+
"type": {
|
|
383
|
+
"text": "PropertyValues"
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"kind": "method",
|
|
390
|
+
"name": "clearSelection",
|
|
391
|
+
"privacy": "private"
|
|
392
|
+
},
|
|
370
393
|
{
|
|
371
394
|
"kind": "method",
|
|
372
395
|
"name": "updated",
|
|
@@ -394,10 +417,6 @@
|
|
|
394
417
|
"name": "styles",
|
|
395
418
|
"static": true,
|
|
396
419
|
"default": "css` :host { height: 100%; width: 100%; overflow: auto; } ace-editor { height: 100%; width: 100%; } `"
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
"kind": "field",
|
|
400
|
-
"name": "define"
|
|
401
420
|
}
|
|
402
421
|
],
|
|
403
422
|
"events": [
|
|
@@ -903,6 +922,403 @@
|
|
|
903
922
|
}
|
|
904
923
|
]
|
|
905
924
|
},
|
|
925
|
+
{
|
|
926
|
+
"kind": "javascript-module",
|
|
927
|
+
"path": "ace-editor/AceEditor.ts",
|
|
928
|
+
"declarations": [
|
|
929
|
+
{
|
|
930
|
+
"kind": "class",
|
|
931
|
+
"description": "Custom element Ace code editor",
|
|
932
|
+
"name": "AceEditor",
|
|
933
|
+
"members": [
|
|
934
|
+
{
|
|
935
|
+
"kind": "field",
|
|
936
|
+
"name": "_observedAttributes",
|
|
937
|
+
"type": {
|
|
938
|
+
"text": "string[]"
|
|
939
|
+
},
|
|
940
|
+
"privacy": "private",
|
|
941
|
+
"static": true,
|
|
942
|
+
"default": "[]"
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
"kind": "field",
|
|
946
|
+
"name": "_editor",
|
|
947
|
+
"type": {
|
|
948
|
+
"text": "Ace.Editor | undefined"
|
|
949
|
+
},
|
|
950
|
+
"privacy": "private"
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
"kind": "field",
|
|
954
|
+
"name": "editor",
|
|
955
|
+
"type": {
|
|
956
|
+
"text": "Ace.Editor | undefined"
|
|
957
|
+
},
|
|
958
|
+
"readonly": true
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
"kind": "field",
|
|
962
|
+
"name": "version",
|
|
963
|
+
"type": {
|
|
964
|
+
"text": "{ [key: string]: string }"
|
|
965
|
+
},
|
|
966
|
+
"readonly": true
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
"kind": "field",
|
|
970
|
+
"name": "value",
|
|
971
|
+
"type": {
|
|
972
|
+
"text": "string | undefined"
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
"kind": "field",
|
|
977
|
+
"name": "mode",
|
|
978
|
+
"type": {
|
|
979
|
+
"text": "string | undefined"
|
|
980
|
+
}
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"kind": "field",
|
|
984
|
+
"name": "theme",
|
|
985
|
+
"type": {
|
|
986
|
+
"text": "string | undefined"
|
|
987
|
+
}
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
"kind": "field",
|
|
991
|
+
"name": "tabSize",
|
|
992
|
+
"type": {
|
|
993
|
+
"text": "number | undefined"
|
|
994
|
+
}
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
"kind": "field",
|
|
998
|
+
"name": "readonly",
|
|
999
|
+
"type": {
|
|
1000
|
+
"text": "boolean | undefined"
|
|
1001
|
+
}
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
"kind": "field",
|
|
1005
|
+
"name": "softTabs",
|
|
1006
|
+
"type": {
|
|
1007
|
+
"text": "boolean | undefined"
|
|
1008
|
+
}
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
"kind": "field",
|
|
1012
|
+
"name": "wrap",
|
|
1013
|
+
"type": {
|
|
1014
|
+
"text": "boolean | undefined"
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
"kind": "field",
|
|
1019
|
+
"name": "valueUpdateMode",
|
|
1020
|
+
"type": {
|
|
1021
|
+
"text": "ValueUpdateMode | undefined"
|
|
1022
|
+
}
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
"kind": "field",
|
|
1026
|
+
"name": "hideActiveLineHighlight",
|
|
1027
|
+
"type": {
|
|
1028
|
+
"text": "boolean | undefined"
|
|
1029
|
+
}
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
"kind": "field",
|
|
1033
|
+
"name": "hideGutter",
|
|
1034
|
+
"type": {
|
|
1035
|
+
"text": "boolean | undefined"
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
"kind": "field",
|
|
1040
|
+
"name": "hideGutterLineHighlight",
|
|
1041
|
+
"type": {
|
|
1042
|
+
"text": "boolean | undefined"
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
"kind": "field",
|
|
1047
|
+
"name": "hidePrintMargin",
|
|
1048
|
+
"type": {
|
|
1049
|
+
"text": "boolean | undefined"
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
"kind": "field",
|
|
1054
|
+
"name": "basePath",
|
|
1055
|
+
"type": {
|
|
1056
|
+
"text": "string | undefined"
|
|
1057
|
+
}
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
"kind": "method",
|
|
1061
|
+
"name": "dispatch",
|
|
1062
|
+
"privacy": "private",
|
|
1063
|
+
"return": {
|
|
1064
|
+
"type": {
|
|
1065
|
+
"text": "void"
|
|
1066
|
+
}
|
|
1067
|
+
},
|
|
1068
|
+
"parameters": [
|
|
1069
|
+
{
|
|
1070
|
+
"name": "type",
|
|
1071
|
+
"type": {
|
|
1072
|
+
"text": "string"
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
"name": "detail",
|
|
1077
|
+
"type": {
|
|
1078
|
+
"text": "T"
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
]
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
"kind": "field",
|
|
1085
|
+
"name": "initializeEditor",
|
|
1086
|
+
"privacy": "private"
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"kind": "method",
|
|
1090
|
+
"name": "appendStyles",
|
|
1091
|
+
"privacy": "private"
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
"kind": "method",
|
|
1095
|
+
"name": "notifyPropertyChanged",
|
|
1096
|
+
"return": {
|
|
1097
|
+
"type": {
|
|
1098
|
+
"text": "void"
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
"parameters": [
|
|
1102
|
+
{
|
|
1103
|
+
"name": "name",
|
|
1104
|
+
"type": {
|
|
1105
|
+
"text": "string"
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
]
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
"kind": "method",
|
|
1112
|
+
"name": "resize",
|
|
1113
|
+
"return": {
|
|
1114
|
+
"type": {
|
|
1115
|
+
"text": "void"
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
"kind": "field",
|
|
1121
|
+
"name": "handleChange",
|
|
1122
|
+
"privacy": "private"
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
"kind": "field",
|
|
1126
|
+
"name": "handleBlur",
|
|
1127
|
+
"privacy": "private"
|
|
1128
|
+
}
|
|
1129
|
+
],
|
|
1130
|
+
"events": [
|
|
1131
|
+
{
|
|
1132
|
+
"name": "type",
|
|
1133
|
+
"type": {
|
|
1134
|
+
"text": "CustomEvent"
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
],
|
|
1138
|
+
"superclass": {
|
|
1139
|
+
"name": "HTMLElement"
|
|
1140
|
+
},
|
|
1141
|
+
"customElement": true
|
|
1142
|
+
}
|
|
1143
|
+
],
|
|
1144
|
+
"exports": [
|
|
1145
|
+
{
|
|
1146
|
+
"kind": "js",
|
|
1147
|
+
"name": "default",
|
|
1148
|
+
"declaration": {
|
|
1149
|
+
"name": "AceEditor",
|
|
1150
|
+
"module": "ace-editor/AceEditor.ts"
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
]
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
"kind": "javascript-module",
|
|
1157
|
+
"path": "ace-editor/debounce.ts",
|
|
1158
|
+
"declarations": [
|
|
1159
|
+
{
|
|
1160
|
+
"kind": "function",
|
|
1161
|
+
"name": "debounce",
|
|
1162
|
+
"return": {
|
|
1163
|
+
"type": {
|
|
1164
|
+
"text": "() => Promise<T>"
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1167
|
+
"parameters": [
|
|
1168
|
+
{
|
|
1169
|
+
"name": "func",
|
|
1170
|
+
"type": {
|
|
1171
|
+
"text": "(...params: any[]) => T"
|
|
1172
|
+
},
|
|
1173
|
+
"description": "The function to invoke."
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"name": "wait",
|
|
1177
|
+
"default": "0",
|
|
1178
|
+
"description": "The time in milliseconds to wait for idle invocations."
|
|
1179
|
+
}
|
|
1180
|
+
],
|
|
1181
|
+
"description": "Returns a new function that delays invocations to the original function\nwithin a specified wait period. The last invocation within this time period\ngets invoked. All earlier invocations are ignore."
|
|
1182
|
+
}
|
|
1183
|
+
],
|
|
1184
|
+
"exports": [
|
|
1185
|
+
{
|
|
1186
|
+
"kind": "js",
|
|
1187
|
+
"name": "debounce",
|
|
1188
|
+
"declaration": {
|
|
1189
|
+
"name": "debounce",
|
|
1190
|
+
"module": "ace-editor/debounce.ts"
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
]
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
"kind": "javascript-module",
|
|
1197
|
+
"path": "ace-editor/property-decorators.ts",
|
|
1198
|
+
"declarations": [
|
|
1199
|
+
{
|
|
1200
|
+
"kind": "function",
|
|
1201
|
+
"name": "NotifyAttribute",
|
|
1202
|
+
"parameters": [
|
|
1203
|
+
{
|
|
1204
|
+
"name": "attribute",
|
|
1205
|
+
"optional": true,
|
|
1206
|
+
"type": {
|
|
1207
|
+
"text": "string"
|
|
1208
|
+
},
|
|
1209
|
+
"description": "Override the attribute name to use. If ommitted, the\nproperty name is used (coverted from camelCase, to kebab-case)."
|
|
1210
|
+
}
|
|
1211
|
+
],
|
|
1212
|
+
"description": "Defines that the target property should be exposed as an attribute, and\nthat changes to the attribute should trigger a `notifyPropertyChanged`\ncallback."
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
"kind": "function",
|
|
1216
|
+
"name": "NotifyBooleanAttribute",
|
|
1217
|
+
"parameters": [
|
|
1218
|
+
{
|
|
1219
|
+
"name": "attribute",
|
|
1220
|
+
"optional": true,
|
|
1221
|
+
"type": {
|
|
1222
|
+
"text": "string"
|
|
1223
|
+
},
|
|
1224
|
+
"description": "Override the attribute name to use. If ommitted, the\nproperty name is used (coverted from camelCase, to snake-case)."
|
|
1225
|
+
}
|
|
1226
|
+
],
|
|
1227
|
+
"description": "Defines that the target property should be exposed as boolean attribute, and\nthat changes to the attribute should trigger a `notifyPropertyChanged`\ncallback."
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
"kind": "function",
|
|
1231
|
+
"name": "NotifyNumericAttribute",
|
|
1232
|
+
"parameters": [
|
|
1233
|
+
{
|
|
1234
|
+
"name": "attribute",
|
|
1235
|
+
"optional": true,
|
|
1236
|
+
"type": {
|
|
1237
|
+
"text": "string"
|
|
1238
|
+
},
|
|
1239
|
+
"description": "Override the attribute name to use. If ommitted, the\nproperty name is used (coverted from camelCase, to snake-case)."
|
|
1240
|
+
}
|
|
1241
|
+
],
|
|
1242
|
+
"description": "Defines that the target property should be exposed as numeric attribute, and\nthat changes to the attribute should trigger a `notifyPropertyChanged`\ncallback."
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
"kind": "function",
|
|
1246
|
+
"name": "Notify",
|
|
1247
|
+
"return": {
|
|
1248
|
+
"type": {
|
|
1249
|
+
"text": "(target: NotifyTarget & HTMLElement, key: string) => void"
|
|
1250
|
+
}
|
|
1251
|
+
},
|
|
1252
|
+
"parameters": [
|
|
1253
|
+
{
|
|
1254
|
+
"name": "attribute",
|
|
1255
|
+
"optional": true,
|
|
1256
|
+
"type": {
|
|
1257
|
+
"text": "string"
|
|
1258
|
+
},
|
|
1259
|
+
"description": "Expose the property as an attribute. Note that when\nattribute is specified, this method has the same behavior as\n`NotifyAttribute`."
|
|
1260
|
+
}
|
|
1261
|
+
],
|
|
1262
|
+
"description": "Defines that the target property should trigger a `notifyPropertyChanged`\ncallback when the property changes."
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
"kind": "function",
|
|
1266
|
+
"name": "Alias",
|
|
1267
|
+
"parameters": [
|
|
1268
|
+
{
|
|
1269
|
+
"name": "alias",
|
|
1270
|
+
"type": {
|
|
1271
|
+
"text": "string"
|
|
1272
|
+
},
|
|
1273
|
+
"description": "Name of the alias."
|
|
1274
|
+
}
|
|
1275
|
+
],
|
|
1276
|
+
"description": "Creates an alias for the given property with a getter and a setter."
|
|
1277
|
+
}
|
|
1278
|
+
],
|
|
1279
|
+
"exports": [
|
|
1280
|
+
{
|
|
1281
|
+
"kind": "js",
|
|
1282
|
+
"name": "NotifyAttribute",
|
|
1283
|
+
"declaration": {
|
|
1284
|
+
"name": "NotifyAttribute",
|
|
1285
|
+
"module": "ace-editor/property-decorators.ts"
|
|
1286
|
+
}
|
|
1287
|
+
},
|
|
1288
|
+
{
|
|
1289
|
+
"kind": "js",
|
|
1290
|
+
"name": "NotifyBooleanAttribute",
|
|
1291
|
+
"declaration": {
|
|
1292
|
+
"name": "NotifyBooleanAttribute",
|
|
1293
|
+
"module": "ace-editor/property-decorators.ts"
|
|
1294
|
+
}
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
"kind": "js",
|
|
1298
|
+
"name": "NotifyNumericAttribute",
|
|
1299
|
+
"declaration": {
|
|
1300
|
+
"name": "NotifyNumericAttribute",
|
|
1301
|
+
"module": "ace-editor/property-decorators.ts"
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
"kind": "js",
|
|
1306
|
+
"name": "Notify",
|
|
1307
|
+
"declaration": {
|
|
1308
|
+
"name": "Notify",
|
|
1309
|
+
"module": "ace-editor/property-decorators.ts"
|
|
1310
|
+
}
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
"kind": "js",
|
|
1314
|
+
"name": "Alias",
|
|
1315
|
+
"declaration": {
|
|
1316
|
+
"name": "Alias",
|
|
1317
|
+
"module": "ace-editor/property-decorators.ts"
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
]
|
|
1321
|
+
},
|
|
906
1322
|
{
|
|
907
1323
|
"kind": "javascript-module",
|
|
908
1324
|
"path": "demo/demo-editor-plugin.js",
|
|
@@ -921,6 +1337,15 @@
|
|
|
921
1337
|
"static": true,
|
|
922
1338
|
"default": "{ 'oscd-text-editor': OscdTextEditor, 'oscd-scl-dialogs': OscdSclDialogs, }"
|
|
923
1339
|
},
|
|
1340
|
+
{
|
|
1341
|
+
"kind": "field",
|
|
1342
|
+
"name": "storageKeys",
|
|
1343
|
+
"type": {
|
|
1344
|
+
"text": "object"
|
|
1345
|
+
},
|
|
1346
|
+
"static": true,
|
|
1347
|
+
"default": "{ parentSelector: 'demo-editor-parent-selector', newTagName: 'demo-editor-new-tag-name', tagSelector: 'demo-editor-tag-selector', }"
|
|
1348
|
+
},
|
|
924
1349
|
{
|
|
925
1350
|
"kind": "field",
|
|
926
1351
|
"name": "properties",
|
|
@@ -928,7 +1353,7 @@
|
|
|
928
1353
|
"text": "object"
|
|
929
1354
|
},
|
|
930
1355
|
"static": true,
|
|
931
|
-
"default": "{ doc: { type: Object }, docVersion: { type: Number }, editor: { type: Object }, docsState: { type: Object }, editedText: { state: true }, editorDirty: { state: true }, }"
|
|
1356
|
+
"default": "{ doc: { type: Object }, docVersion: { type: Number }, editor: { type: Object }, docsState: { type: Object }, editedText: { state: true }, editorDirty: { state: true }, parentSelectorValue: { state: true }, newTagNameValue: { state: true }, tagSelectorValue: { state: true }, }"
|
|
932
1357
|
},
|
|
933
1358
|
{
|
|
934
1359
|
"kind": "method",
|
|
@@ -1025,6 +1450,18 @@
|
|
|
1025
1450
|
"text": "boolean"
|
|
1026
1451
|
},
|
|
1027
1452
|
"default": "false"
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
"kind": "field",
|
|
1456
|
+
"name": "parentSelectorValue"
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
"kind": "field",
|
|
1460
|
+
"name": "newTagNameValue"
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
"kind": "field",
|
|
1464
|
+
"name": "tagSelectorValue"
|
|
1028
1465
|
}
|
|
1029
1466
|
],
|
|
1030
1467
|
"mixins": [
|
|
@@ -1059,6 +1496,12 @@
|
|
|
1059
1496
|
}
|
|
1060
1497
|
]
|
|
1061
1498
|
},
|
|
1499
|
+
{
|
|
1500
|
+
"kind": "javascript-module",
|
|
1501
|
+
"path": "demo/index.js",
|
|
1502
|
+
"declarations": [],
|
|
1503
|
+
"exports": []
|
|
1504
|
+
},
|
|
1062
1505
|
{
|
|
1063
1506
|
"kind": "javascript-module",
|
|
1064
1507
|
"path": "scripts/update-readme.ts",
|
package/dist/OscdTextEditor.d.ts
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import { LitElement, type PropertyValueMap } from 'lit';
|
|
2
|
-
import
|
|
3
|
-
import 'ace-builds/src-noconflict/ace.js';
|
|
4
|
-
import 'ace-builds/src-noconflict/theme-sqlserver.js';
|
|
5
|
-
import 'ace-builds/src-noconflict/mode-xml.js';
|
|
6
|
-
import 'ace-builds/src-noconflict/ext-searchbox.js';
|
|
7
|
-
import type AceEditor from 'ace-custom-element';
|
|
1
|
+
import { LitElement, type PropertyValueMap, PropertyValues } from 'lit';
|
|
2
|
+
import AceEditor from './ace-editor/AceEditor.js';
|
|
8
3
|
import { EditV2 } from '@openscd/oscd-api';
|
|
9
|
-
declare global {
|
|
10
|
-
interface Window {
|
|
11
|
-
ace: typeof AceGlobal;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
4
|
export declare function parseXml(xml: string): XMLDocument;
|
|
15
5
|
export declare function serializeXml(xml: XMLDocument | Element): string;
|
|
16
6
|
export declare function formatXml(rawXml: string | undefined, initialIndent?: string): string;
|
|
@@ -25,14 +15,17 @@ declare class BaseElement extends BaseElement_base {
|
|
|
25
15
|
* Intent is to keep this generic so it can be migrated to oscd-ui.
|
|
26
16
|
*/
|
|
27
17
|
export default class OscdTextEditor extends BaseElement {
|
|
28
|
-
static scopedElements: {
|
|
29
|
-
|
|
18
|
+
static scopedElements: {
|
|
19
|
+
'ace-editor': typeof AceEditor;
|
|
20
|
+
};
|
|
30
21
|
value: string | undefined;
|
|
31
22
|
aceEditor: AceEditor;
|
|
32
23
|
format(): void;
|
|
33
24
|
connectedCallback(): void;
|
|
34
25
|
disconnectedCallback(): void;
|
|
35
26
|
private handleAceChange;
|
|
27
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
28
|
+
private clearSelection;
|
|
36
29
|
protected updated(changedProps: PropertyValueMap<OscdTextEditor>): void;
|
|
37
30
|
render(): import("lit-html").TemplateResult<1>;
|
|
38
31
|
static styles: import("lit").CSSResult;
|
package/dist/OscdTextEditor.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { LitElement, html, css, } from 'lit';
|
|
3
3
|
import { property, query } from 'lit/decorators.js';
|
|
4
4
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements/lit-element.js';
|
|
5
|
-
import 'ace-
|
|
6
|
-
import 'ace-builds/src-noconflict/theme-sqlserver.js';
|
|
7
|
-
import 'ace-builds/src-noconflict/mode-xml.js';
|
|
8
|
-
import 'ace-builds/src-noconflict/ext-searchbox.js';
|
|
5
|
+
import AceEditor from './ace-editor/AceEditor.js';
|
|
9
6
|
const serializer = new XMLSerializer();
|
|
10
7
|
const parser = new DOMParser();
|
|
11
8
|
const ACE_DEFAULT_OPTIONS = {
|
|
@@ -132,24 +129,11 @@ class BaseElement extends ScopedElementsMixin(LitElement) {
|
|
|
132
129
|
* Intent is to keep this generic so it can be migrated to oscd-ui.
|
|
133
130
|
*/
|
|
134
131
|
class OscdTextEditor extends BaseElement {
|
|
135
|
-
constructor() {
|
|
136
|
-
super();
|
|
137
|
-
// Special handling to prevent ace-editor from being registered globally, which would cause issues with multiple instances in the same document.
|
|
138
|
-
// This will all go away once the oscd-ui version is implemented and this project is migrated to oscd-ui
|
|
139
|
-
const customElementsDefineFn = window.customElements.define;
|
|
140
|
-
window.customElements.define = (name, constructor) => {
|
|
141
|
-
if (name !== 'ace-editor') {
|
|
142
|
-
return customElementsDefineFn(name, constructor);
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
import('ace-custom-element').then(AceEditor => {
|
|
146
|
-
if (!this.registry?.get('ace-editor')) {
|
|
147
|
-
this.registry?.define('ace-editor', AceEditor.default);
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
132
|
format() {
|
|
152
|
-
const rawXml = this.aceEditor?.editor?.getSelectedText() ||
|
|
133
|
+
const rawXml = this.aceEditor?.editor?.getSelectedText() ||
|
|
134
|
+
this.aceEditor.editor?.getValue() ||
|
|
135
|
+
this.value ||
|
|
136
|
+
'';
|
|
153
137
|
let initialIndent = '';
|
|
154
138
|
if (this.aceEditor?.editor?.getSelectedText()) {
|
|
155
139
|
const range = this.aceEditor.editor.getSelectionRange();
|
|
@@ -186,16 +170,32 @@ class OscdTextEditor extends BaseElement {
|
|
|
186
170
|
}));
|
|
187
171
|
}
|
|
188
172
|
}
|
|
173
|
+
firstUpdated(_changedProperties) {
|
|
174
|
+
this.clearSelection();
|
|
175
|
+
}
|
|
176
|
+
clearSelection() {
|
|
177
|
+
// Clear selection when content updates
|
|
178
|
+
setTimeout(() => {
|
|
179
|
+
/* For reasons unknown the ace editor initially selects all code, so we need to clear that*/
|
|
180
|
+
const editor = this.aceEditor.editor;
|
|
181
|
+
if (editor) {
|
|
182
|
+
editor.selection.clearSelection();
|
|
183
|
+
editor.moveCursorTo(0, 0);
|
|
184
|
+
}
|
|
185
|
+
}, 100);
|
|
186
|
+
}
|
|
189
187
|
updated(changedProps) {
|
|
190
188
|
if (changedProps.has('value')) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
189
|
+
const editor = this.aceEditor.editor;
|
|
190
|
+
if (!editor) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// Only update if content actually changed (prevents cursor jump)
|
|
194
|
+
// if (editor.getValue() !== this.value) {
|
|
195
|
+
// editor.setValue(this.value ?? '');
|
|
196
|
+
// }
|
|
197
|
+
editor.selection.clearSelection();
|
|
198
|
+
editor.moveCursorTo(0, 0);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
render() {
|
|
@@ -213,9 +213,9 @@ class OscdTextEditor extends BaseElement {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
OscdTextEditor.scopedElements = {
|
|
216
|
-
// Left here for clarity sake. We need to dyn-import this so we have a chance of overriding the customElements.define to prevent
|
|
217
|
-
// ace-editor from being registered globally and causing issues with other instances of ace-editor in the same document.
|
|
218
|
-
|
|
216
|
+
// Left here for clarity sake. We need to dyn-import this so we have a chance of overriding the customElements.define to prevent
|
|
217
|
+
// ace-editor from being registered globally and causing issues with other instances of ace-editor in the same document.
|
|
218
|
+
'ace-editor': AceEditor,
|
|
219
219
|
};
|
|
220
220
|
OscdTextEditor.styles = css `
|
|
221
221
|
:host {
|