@jinntec/fore 1.5.0 → 1.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/fore-dev.js +2 -36
- package/dist/fore-dev.js.map +1 -1
- package/dist/fore.js +2 -30
- package/dist/fore.js.map +1 -1
- package/index.js +12 -0
- package/package.json +9 -5
- package/resources/fore.css +178 -92
- package/src/DependencyNotifyingDomFacade.js +1 -2
- package/src/ForeElementMixin.js +31 -5
- package/src/actions/abstract-action.js +379 -297
- package/src/actions/fx-action.js +0 -1
- package/src/actions/fx-append.js +1 -2
- package/src/actions/fx-confirm.js +12 -0
- package/src/actions/fx-copy.js +0 -1
- package/src/actions/fx-delete.js +31 -9
- package/src/actions/fx-dispatch.js +19 -5
- package/src/actions/fx-hide.js +19 -0
- package/src/actions/fx-insert.js +72 -8
- package/src/actions/fx-load.js +253 -0
- package/src/actions/fx-message.js +22 -7
- package/src/actions/fx-refresh.js +11 -1
- package/src/actions/fx-reload.js +12 -2
- package/src/actions/fx-replace.js +5 -4
- package/src/actions/fx-reset.js +48 -0
- package/src/actions/fx-return.js +0 -1
- package/src/actions/fx-send.js +40 -2
- package/src/actions/fx-setfocus.js +25 -7
- package/src/actions/fx-setvalue.js +32 -4
- package/src/actions/fx-show.js +14 -2
- package/src/actions/fx-toggle.js +0 -1
- package/src/actions/fx-update.js +9 -0
- package/src/events.js +0 -1
- package/src/fore.js +118 -63
- package/src/functions/common-function.js +28 -0
- package/src/fx-bind.js +7 -7
- package/src/fx-fore.js +152 -55
- package/src/fx-instance.js +55 -17
- package/src/fx-model.js +31 -33
- package/src/fx-submission.js +50 -47
- package/src/getInScopeContext.js +8 -10
- package/src/lab/fore-component.js +90 -0
- package/src/lab/instance-inspector.js +56 -0
- package/src/lab/template.html +16 -0
- package/src/relevance.js +27 -1
- package/src/tools/adi.js +1056 -0
- package/src/tools/fx-action-log.js +662 -0
- package/src/tools/fx-devtools.js +444 -0
- package/src/tools/fx-dom-inspector.js +609 -0
- package/src/tools/fx-json-instance.js +435 -0
- package/src/tools/fx-log-item.js +133 -0
- package/src/tools/fx-log-settings.js +474 -0
- package/src/tools/fx-minimap.js +194 -0
- package/src/tools/helpers.js +132 -0
- package/src/ui/abstract-control.js +41 -3
- package/src/ui/fx-action-log.js +358 -0
- package/src/ui/fx-alert.js +0 -1
- package/src/ui/fx-container.js +14 -3
- package/src/ui/fx-control.js +553 -474
- package/src/ui/fx-dialog.js +2 -0
- package/src/ui/fx-dom-inspector.js +1255 -0
- package/src/ui/fx-group.js +3 -4
- package/src/ui/fx-hint.js +2 -4
- package/src/ui/fx-inspector.js +5 -6
- package/src/ui/fx-items.js +55 -14
- package/src/ui/fx-output.js +36 -17
- package/src/ui/fx-repeat-attributes.js +10 -43
- package/src/ui/fx-repeat.js +5 -7
- package/src/ui/fx-switch.js +14 -3
- package/src/ui/fx-trigger.js +13 -1
- package/src/xpath-evaluation.js +109 -26
- package/src/xpath-util.js +55 -1
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
import ADI from './adi.js';
|
|
2
|
+
|
|
3
|
+
export class FxDomInspector extends HTMLElement {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.attachShadow({mode: 'open'});
|
|
7
|
+
this.instanceName = null;
|
|
8
|
+
this.instance = null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
connectedCallback() {
|
|
12
|
+
this.render();
|
|
13
|
+
if (this.instance) {
|
|
14
|
+
this.shadowRoot.querySelector('#focus-button').style = 'display: none';
|
|
15
|
+
} else {
|
|
16
|
+
this.setupFocusButton();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
setInstance(instance) {
|
|
21
|
+
this.instance = instance;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
disconnectedCallback(){
|
|
25
|
+
this.adiInstance = null;
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
setupFocusButton () {
|
|
30
|
+
let styleBackup = '';
|
|
31
|
+
let focusedElement = null;
|
|
32
|
+
const removeFocus = () => {
|
|
33
|
+
if (styleBackup === '') {
|
|
34
|
+
focusedElement.removeAttribute('style');
|
|
35
|
+
} else {
|
|
36
|
+
focusedElement.setAttribute('style', styleBackup);
|
|
37
|
+
}
|
|
38
|
+
focusedElement = null;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const onHover = (event) => {
|
|
42
|
+
const {target} = event;
|
|
43
|
+
if (event.type === 'mouseover') {
|
|
44
|
+
styleBackup = target.getAttribute('style') || '';
|
|
45
|
+
target.setAttribute('style', `outline: 2px solid blue; ${styleBackup}`);
|
|
46
|
+
focusedElement = target;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (focusedElement) {
|
|
50
|
+
removeFocus();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const focusButton = this.shadowRoot.querySelector('#focus-button');
|
|
55
|
+
let isFocussing = false;
|
|
56
|
+
const styleElement = window.document.head.appendChild(document.createElement('style'));
|
|
57
|
+
const stopFocussing = () => {
|
|
58
|
+
isFocussing = false;
|
|
59
|
+
window.document.body.removeEventListener('click', listener);
|
|
60
|
+
focusButton.classList.remove('selected-btn');
|
|
61
|
+
styleElement.innerHTML = '';
|
|
62
|
+
document.body.style.cursor = 'auto';
|
|
63
|
+
|
|
64
|
+
window.document.body.removeEventListener('mouseover', onHover);
|
|
65
|
+
window.document.body.removeEventListener('mouseout', onHover);
|
|
66
|
+
if (focusedElement) {
|
|
67
|
+
removeFocus();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const listener = (event) => {
|
|
71
|
+
stopFocussing();
|
|
72
|
+
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
event.stopPropagation();
|
|
75
|
+
if (event.target !== focusButton) {
|
|
76
|
+
// Do not 'click on the focusbutton. It's a cancel.
|
|
77
|
+
// console.log('done', event.target);
|
|
78
|
+
window.document.dispatchEvent(new CustomEvent('log-active-element', {detail: {target: event.target}}));
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const startFocussing = () => {
|
|
82
|
+
isFocussing = true;
|
|
83
|
+
focusButton.classList.add('selected-btn');
|
|
84
|
+
document.body.style.cursor = 'crosshair';
|
|
85
|
+
|
|
86
|
+
window.document.body.removeEventListener('click', listener);
|
|
87
|
+
styleElement.innerHTML = 'fx-fore::before { color:blue; content: "Sub fore!" } fx-fore {border: solid 1px blue}';
|
|
88
|
+
window.document.body.addEventListener('click', listener);
|
|
89
|
+
|
|
90
|
+
window.document.body.addEventListener('mouseover', onHover);
|
|
91
|
+
window.document.body.addEventListener('mouseout', onHover);
|
|
92
|
+
};
|
|
93
|
+
window.document.addEventListener('keyup', (event) => {
|
|
94
|
+
if (isFocussing && event.code === 'Escape') {
|
|
95
|
+
stopFocussing();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (!isFocussing && event.code === 'KeyI' && event.ctrlKey) {
|
|
99
|
+
startFocussing();
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
focusButton.addEventListener('click', (clickEvent) => {
|
|
103
|
+
if (isFocussing) {
|
|
104
|
+
stopFocussing();
|
|
105
|
+
} else {
|
|
106
|
+
startFocussing();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
clickEvent.preventDefault();
|
|
110
|
+
clickEvent.stopPropagation();
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
render() {
|
|
115
|
+
const style = `
|
|
116
|
+
@import '../../resources/fore.css';
|
|
117
|
+
|
|
118
|
+
:host {
|
|
119
|
+
display:block;
|
|
120
|
+
background:transparent;
|
|
121
|
+
}
|
|
122
|
+
body {
|
|
123
|
+
-webkit-animation: bugfix infinite 1s;
|
|
124
|
+
font-size:1rem;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@-webkit-keyframes bugfix {
|
|
128
|
+
from {
|
|
129
|
+
padding: 0
|
|
130
|
+
}
|
|
131
|
+
to {
|
|
132
|
+
padding: 0
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
.adi-content {
|
|
136
|
+
position: relative;
|
|
137
|
+
overflow: auto;
|
|
138
|
+
box-sizing: border-box;
|
|
139
|
+
-moz-box-sizing: border-box;
|
|
140
|
+
height: 100% !important;
|
|
141
|
+
padding:0;
|
|
142
|
+
font-size:0.8em;
|
|
143
|
+
}
|
|
144
|
+
.adi-content header{
|
|
145
|
+
padding:0.5rem;
|
|
146
|
+
// background:rgba(255, 255, 255, 0.2);
|
|
147
|
+
border-bottom:2px solid #ddd;
|
|
148
|
+
border-collapse:collapse;
|
|
149
|
+
}
|
|
150
|
+
.adi-content > * {
|
|
151
|
+
padding:0 0.25em;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
#adi-wrapper {
|
|
155
|
+
top: 0;
|
|
156
|
+
font-family: "Segoe UI", Arial;
|
|
157
|
+
font-size: 1.1rem;
|
|
158
|
+
-webkit-user-select: none;
|
|
159
|
+
-moz-user-select: none;
|
|
160
|
+
-ms-user-select: none;
|
|
161
|
+
user-select: none;
|
|
162
|
+
position:relative;
|
|
163
|
+
height:calc(100% - 8rem);
|
|
164
|
+
display:flex;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
#adi-wrapper.left {
|
|
168
|
+
left: 0
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
#adi-wrapper.right {
|
|
172
|
+
right: 0
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
#adi-wrapper.transparent {
|
|
176
|
+
background: rgba(250, 250, 250, 0.9)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
#adi-panel {
|
|
180
|
+
position:fixed;
|
|
181
|
+
top:0;
|
|
182
|
+
/*bottom: 0;*/
|
|
183
|
+
right: 0;
|
|
184
|
+
height: 24px;
|
|
185
|
+
background: #d4d4d4;
|
|
186
|
+
border-top: 1px solid #bbc5c9
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
#adi-panel .adi-path-wrap {
|
|
190
|
+
position:absolute;
|
|
191
|
+
bottom: 0;
|
|
192
|
+
left: 0;
|
|
193
|
+
width: 80%;
|
|
194
|
+
height: 24px;
|
|
195
|
+
padding: 0 13px 0 18px;
|
|
196
|
+
line-height: 24px;
|
|
197
|
+
overflow: hidden;
|
|
198
|
+
box-sizing: border-box;
|
|
199
|
+
-moz-box-sizing: border-box
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
#adi-panel .adi-path-wrap.adi-overflowing .adi-path-left,
|
|
203
|
+
#adi-panel .adi-path-wrap.adi-overflowing .adi-path-right {
|
|
204
|
+
display: block
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
#adi-panel .adi-path {
|
|
208
|
+
height: 24px;
|
|
209
|
+
overflow: hidden;
|
|
210
|
+
white-space: nowrap
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
#adi-panel .adi-path-left, #adi-panel .adi-path-right {
|
|
214
|
+
display: none;
|
|
215
|
+
position: absolute;
|
|
216
|
+
top: 0;
|
|
217
|
+
width: 8px;
|
|
218
|
+
height: 24px;
|
|
219
|
+
background-repeat: no-repeat;
|
|
220
|
+
background-position: center center;
|
|
221
|
+
opacity: .7
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
#adi-panel .adi-path-left:hover, #adi-panel .adi-path-right:hover {
|
|
225
|
+
opacity: 1
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
#adi-panel .adi-path-left {
|
|
229
|
+
left: 7px;
|
|
230
|
+
background-image: url('img/left_shift.png')
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
#adi-panel .adi-path-right {
|
|
234
|
+
position:absolute;
|
|
235
|
+
right: 2px;
|
|
236
|
+
background-image: url('/resources/scripts/dom-inspector/img/right_shift.png')
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
#adi-panel .adi-menu-wrap {
|
|
240
|
+
bottom: 0;
|
|
241
|
+
right: 24px;
|
|
242
|
+
width: 50px;
|
|
243
|
+
height: 24px
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
#adi-panel .adi-menu-lookup, #adi-panel .adi-menu-config {
|
|
247
|
+
display: block;
|
|
248
|
+
float: left;
|
|
249
|
+
width: 24px;
|
|
250
|
+
height: 24px;
|
|
251
|
+
border-left: 1px solid #bbc5c9;
|
|
252
|
+
background-position: center center;
|
|
253
|
+
background-repeat: no-repeat;
|
|
254
|
+
opacity: .7;
|
|
255
|
+
border-radius: 0
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
#adi-panel .adi-menu-lookup:hover, #adi-panel .adi-menu-config:hover {
|
|
259
|
+
background-color: #c5d9d8;
|
|
260
|
+
opacity: 1
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
#adi-panel .adi-menu-lookup.adi-active, #adi-panel .adi-menu-config.adi-active {
|
|
264
|
+
background-color: #fafafa;
|
|
265
|
+
opacity: 1
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
#adi-panel .adi-menu-lookup {
|
|
269
|
+
background-image: url('/resources/scripts/dom-inspector/img/lookup.png')
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
#adi-panel .adi-menu-config {
|
|
273
|
+
background-image: url('/resources/scripts/dom-inspector/img/config.png')
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
#adi-vert-split {
|
|
279
|
+
position: fixed;
|
|
280
|
+
top: 0;
|
|
281
|
+
width: 4px;
|
|
282
|
+
height: 100%;
|
|
283
|
+
cursor: e-resize;
|
|
284
|
+
border-width: 0 1px 0 0;
|
|
285
|
+
background: #bbc5c9;
|
|
286
|
+
border-color: #768285;
|
|
287
|
+
border-style: solid;
|
|
288
|
+
-webkit-user-select: none;
|
|
289
|
+
-moz-user-select: none;
|
|
290
|
+
-ms-user-select: none;
|
|
291
|
+
user-select: none;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
#adi-vert-split:hover {
|
|
295
|
+
background: #c5d9d8;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
#adi-dom-view {
|
|
300
|
+
border-right:2px solid #ddd;
|
|
301
|
+
overflow:auto;
|
|
302
|
+
flex-grow:3;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
#adi-dom-view ul {
|
|
306
|
+
margin: 0;
|
|
307
|
+
padding: 0;
|
|
308
|
+
list-style: none
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
#adi-dom-view ul[data-open=true] {
|
|
312
|
+
display: block
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
#adi-dom-view ul[data-open=false] {
|
|
316
|
+
display: none
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
#adi-dom-view ul ul {
|
|
320
|
+
margin: 4px 0
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
#adi-dom-view ul li {
|
|
324
|
+
padding-left: 1em;
|
|
325
|
+
padding-bottom: 0.125em;
|
|
326
|
+
margin: 0;
|
|
327
|
+
padding-top: 0.125em;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
#adi-dom-view .adi-normal-node,
|
|
337
|
+
#adi-dom-view .adi-end-node {
|
|
338
|
+
margin-right: 5px;
|
|
339
|
+
padding: 0 6px 0px;
|
|
340
|
+
background: #d2e8ff;
|
|
341
|
+
border-radius: 8px;
|
|
342
|
+
cursor: default;
|
|
343
|
+
font-size:0.8rem;
|
|
344
|
+
}
|
|
345
|
+
#adi-dom-view .adi-text-node:after, #adi-dom-view .adi-comment-node:after {
|
|
346
|
+
content: '"'
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
#adi-dom-view .adi-text-node:before, #adi-dom-view .adi-comment-node:before {
|
|
350
|
+
content: '"'
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
#adi-dom-view .adi-comment-node {
|
|
354
|
+
color: #999;
|
|
355
|
+
font-style: italic
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
#adi-dom-view .adi-text-node, #adi-dom-view .adi-comment-node {
|
|
359
|
+
display: block;
|
|
360
|
+
padding: 3px 8px;
|
|
361
|
+
color: #444;
|
|
362
|
+
background: #fff;
|
|
363
|
+
border-radius: 8px
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
#adi-dom-view .adi-normal-node:hover,
|
|
367
|
+
#adi-dom-view .adi-normal-node.hover,
|
|
368
|
+
#adi-dom-view .adi-end-node:hover,
|
|
369
|
+
#adi-dom-view .adi-end-node.hover {
|
|
370
|
+
background: var(--paper-grey-700);
|
|
371
|
+
color:white;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
#adi-dom-view .adi-normal-node:hover ~ span,
|
|
375
|
+
#adi-dom-view .adi-normal-node.hover ~ span,
|
|
376
|
+
#adi-dom-view .adi-end-node:hover ~ span,
|
|
377
|
+
#adi-dom-view .adi-end-node.hover ~ span {
|
|
378
|
+
background: var(--paper-grey-700);
|
|
379
|
+
color:white;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
#adi-dom-view .adi-normal-node.adi-active-node,
|
|
383
|
+
#adi-dom-view .adi-end-node.adi-active-node {
|
|
384
|
+
background: var(--paper-grey-700);
|
|
385
|
+
color:white;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
#adi-dom-view .adi-normal-node.adi-active-node ~ span,
|
|
389
|
+
#adi-dom-view .adi-end-node.adi-active-node ~ span {
|
|
390
|
+
background: var(--paper-grey-700);
|
|
391
|
+
color:white;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
#adi-dom-view .adi-trigger {
|
|
400
|
+
display: inline-block;
|
|
401
|
+
width: 10px;
|
|
402
|
+
height: 10px;
|
|
403
|
+
margin: 0 5px 0 -13px;
|
|
404
|
+
opacity: .7
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
#adi-dom-view .adi-trigger.closed {
|
|
408
|
+
// background: url('/resources/scripts/dom-inspector/img/node_closed.png') no-repeat;
|
|
409
|
+
}
|
|
410
|
+
#adi-dom-view .adi-trigger.closed::before {
|
|
411
|
+
content:'\\25B8';
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
#adi-dom-view .adi-trigger.opened {
|
|
415
|
+
// background: url('/resources/scripts/dom-inspector/img/node_opened.png') no-repeat
|
|
416
|
+
}
|
|
417
|
+
#adi-dom-view .adi-trigger.opened::before{
|
|
418
|
+
content:'\\25BE';
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
#adi-dom-view .adi-trigger:hover {
|
|
422
|
+
opacity: 1
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
#adi-opts-view {
|
|
426
|
+
position: relative;
|
|
427
|
+
height: 100%;
|
|
428
|
+
padding: 0 15px;
|
|
429
|
+
background: #fff
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
#adi-opts-view.adi-hidden {
|
|
433
|
+
display: none
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
#adi-opts-view .adi-opt-heading, #adi-opts-view .adi-opt {
|
|
437
|
+
display: block;
|
|
438
|
+
padding: 5px 0
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
#adi-opts-view .adi-opt-heading {
|
|
442
|
+
padding: 20px 0 10px;
|
|
443
|
+
font-size: 1rem;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
#adi-opts-view .adi-opt-heading:first-child {
|
|
447
|
+
padding-top: 10px
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
#adi-opts-view .adi-opt input {
|
|
451
|
+
margin-right: 6px
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
#adi-opts-view .adi-opt-close {
|
|
455
|
+
position: absolute;
|
|
456
|
+
top: 5px;
|
|
457
|
+
right: 28px;
|
|
458
|
+
width: 16px;
|
|
459
|
+
height: 16px;
|
|
460
|
+
background: url('/resources/scripts/dom-inspector/img/options_close.png') no-repeat;
|
|
461
|
+
opacity: .7;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
#adi-opts-view .adi-opt-close:hover {
|
|
465
|
+
opacity: 1;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
#adi-attr-view {
|
|
469
|
+
top: 0.5rem;
|
|
470
|
+
border: 1px solid #ddd;
|
|
471
|
+
overflow: auto;
|
|
472
|
+
padding: 0.25em;
|
|
473
|
+
height: calc(90% - 1em);
|
|
474
|
+
min-width: 10rem;
|
|
475
|
+
position: absolute;
|
|
476
|
+
z-index: 10;
|
|
477
|
+
right: 0.5rem;
|
|
478
|
+
background:rgba(255,255,255,0.85);
|
|
479
|
+
}
|
|
480
|
+
#adi-attr-view > .adi-content{
|
|
481
|
+
height:calc(100% - 5em);
|
|
482
|
+
overflow:auto;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
#adi-attr-view .adi-attr {
|
|
486
|
+
display: block;
|
|
487
|
+
padding: 0.25em;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
#adi-attr-view hr {
|
|
491
|
+
height: 1px;
|
|
492
|
+
border: none
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
#adi-attr-view input[type=text] {
|
|
496
|
+
width: calc(100% - 0.5em);
|
|
497
|
+
margin-top: 3px;
|
|
498
|
+
padding: 2px;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
#adi-horiz-split {
|
|
502
|
+
height: 4px;
|
|
503
|
+
cursor: n-resize;
|
|
504
|
+
border-width: 0 0 1px 0;
|
|
505
|
+
background: #bbc5c9;
|
|
506
|
+
border-color: #768285;
|
|
507
|
+
border-style: solid;
|
|
508
|
+
-webkit-user-select: none;
|
|
509
|
+
-moz-user-select: none;
|
|
510
|
+
-ms-user-select: none;
|
|
511
|
+
user-select: none;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
#adi-horiz-split:hover {
|
|
515
|
+
background: #c5d9d8;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
#adi-dom-view .fore-node{
|
|
519
|
+
background: var(--paper-blue-700);
|
|
520
|
+
font-size:1.1em;
|
|
521
|
+
color:white;
|
|
522
|
+
}
|
|
523
|
+
#adi-dom-view .adi-normal-node.fore-node:hover {
|
|
524
|
+
background: var(--paper-grey-700);
|
|
525
|
+
color:white;
|
|
526
|
+
}
|
|
527
|
+
#adi-dom-view .adi-end-node.fore-node{
|
|
528
|
+
background: var(--paper-blue-700);
|
|
529
|
+
font-size:1em;
|
|
530
|
+
color:white;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
#adi-dom-view .adi-node .adi-active-node.fore-node,
|
|
534
|
+
#adi-dom-view .adi-node.action .adi-active-node.fore-node,
|
|
535
|
+
#adi-dom-view .adi-node.action .adi-active-node.fore-node ~ .adi-end-node
|
|
536
|
+
{
|
|
537
|
+
background: var(--paper-grey-700);
|
|
538
|
+
color:white;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
#adi-dom-view .adi-node.fx-fore{
|
|
542
|
+
background:var(--paper-blue-grey-50);
|
|
543
|
+
}
|
|
544
|
+
#adi-dom-view .adi-node.fx-model{
|
|
545
|
+
background:var(--paper-blue-grey-100);
|
|
546
|
+
padding:0.25em 0;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
#adi-dom-view .adi-node.action .fore-node {
|
|
550
|
+
background:var(--paper-blue-grey-100);
|
|
551
|
+
color:black;
|
|
552
|
+
font-family:monospace;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.toggleView{
|
|
556
|
+
/*width:20px;*/
|
|
557
|
+
/*height: 20px;*/
|
|
558
|
+
}
|
|
559
|
+
input, select{
|
|
560
|
+
display: block;
|
|
561
|
+
}
|
|
562
|
+
header{
|
|
563
|
+
background:rgba(255, 255, 255, 0.2);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.selected-btn { color: orange }
|
|
567
|
+
`;
|
|
568
|
+
|
|
569
|
+
const html = `
|
|
570
|
+
<slot name="header"></slot>
|
|
571
|
+
<button id="focus-button">Focus</button>
|
|
572
|
+
<slot></slot>
|
|
573
|
+
`;
|
|
574
|
+
|
|
575
|
+
this.shadowRoot.innerHTML = `
|
|
576
|
+
<style>
|
|
577
|
+
${style}
|
|
578
|
+
</style>
|
|
579
|
+
${html}
|
|
580
|
+
`;
|
|
581
|
+
const inst = this.hasAttribute('instance') ?
|
|
582
|
+
this.getAttribute('instance') :
|
|
583
|
+
'#document';
|
|
584
|
+
this.adiInstance = new ADI(this.shadowRoot, this.hasAttribute('instance') ? this.instance : '#document');
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
verticalResize(e) {
|
|
588
|
+
if (!this.vertResizing) {
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
e = e || window.event;
|
|
593
|
+
document.documentElement.style.cursor = 'e-resize';
|
|
594
|
+
const nWidth = this.options.width + this.xPos - e.clientX;
|
|
595
|
+
|
|
596
|
+
if (nWidth >= this.options.minWidth) {
|
|
597
|
+
this.options.width = nWidth;
|
|
598
|
+
this.xPos = e.clientX;
|
|
599
|
+
this.refreshUI();
|
|
600
|
+
this.saveOptions();
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
if (!customElements.get('fx-dom-inspector')) {
|
|
608
|
+
customElements.define('fx-dom-inspector', FxDomInspector);
|
|
609
|
+
}
|