@web-widget/inspector 1.68.0 → 1.70.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/element.js +497 -614
- package/dist/element.js.map +1 -1
- package/dist/index.js +497 -614
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/element.js
CHANGED
|
@@ -46,118 +46,41 @@ var spacing = {
|
|
|
46
46
|
sm: "0.5rem",
|
|
47
47
|
md: "0.75rem",
|
|
48
48
|
lg: "1rem",
|
|
49
|
-
xl: "1.25rem"
|
|
50
|
-
"2xl": "1.5rem",
|
|
51
|
-
"3xl": "2rem",
|
|
52
|
-
"4xl": "2.5rem",
|
|
53
|
-
"5xl": "3rem"
|
|
49
|
+
xl: "1.25rem"
|
|
54
50
|
};
|
|
55
51
|
var typography = {
|
|
56
52
|
fontFamily: {
|
|
57
|
-
sans: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'
|
|
58
|
-
mono: 'ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace'
|
|
53
|
+
sans: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'
|
|
59
54
|
},
|
|
60
55
|
fontSize: {
|
|
61
56
|
xs: "0.75rem",
|
|
62
57
|
sm: "0.875rem",
|
|
63
|
-
base: "1rem"
|
|
64
|
-
lg: "1.125rem",
|
|
65
|
-
xl: "1.25rem",
|
|
66
|
-
"2xl": "1.5rem",
|
|
67
|
-
"3xl": "1.875rem",
|
|
68
|
-
"4xl": "2.25rem"
|
|
58
|
+
base: "1rem"
|
|
69
59
|
},
|
|
70
60
|
fontWeight: {
|
|
71
61
|
normal: "400",
|
|
72
62
|
medium: "500",
|
|
73
|
-
semibold: "600"
|
|
74
|
-
bold: "700"
|
|
63
|
+
semibold: "600"
|
|
75
64
|
},
|
|
76
65
|
lineHeight: {
|
|
77
|
-
|
|
78
|
-
tight: "1.25",
|
|
79
|
-
normal: "1.5",
|
|
80
|
-
relaxed: "1.75"
|
|
66
|
+
normal: "1.5"
|
|
81
67
|
},
|
|
82
68
|
letterSpacing: {
|
|
83
|
-
normal: "0"
|
|
84
|
-
wide: "0.025em",
|
|
85
|
-
wider: "0.05em",
|
|
86
|
-
widest: "0.1em"
|
|
69
|
+
normal: "0"
|
|
87
70
|
}
|
|
88
71
|
};
|
|
89
|
-
var borderRadius = {
|
|
90
|
-
none: "0",
|
|
91
|
-
sm: "0.125rem",
|
|
92
|
-
base: "0.25rem",
|
|
93
|
-
md: "0.375rem",
|
|
94
|
-
lg: "0.5rem",
|
|
95
|
-
xl: "0.75rem",
|
|
96
|
-
"2xl": "1rem",
|
|
97
|
-
"3xl": "1.5rem",
|
|
98
|
-
full: "9999px"
|
|
99
|
-
};
|
|
100
72
|
var boxShadow = {
|
|
101
|
-
|
|
102
|
-
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
103
|
-
base: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",
|
|
104
|
-
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
|
|
105
|
-
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
|
|
106
|
-
xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
|
|
107
|
-
"2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
108
|
-
inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"
|
|
109
|
-
};
|
|
110
|
-
var opacity = {
|
|
111
|
-
0: "0",
|
|
112
|
-
5: "0.05",
|
|
113
|
-
10: "0.1",
|
|
114
|
-
20: "0.2",
|
|
115
|
-
25: "0.25",
|
|
116
|
-
30: "0.3",
|
|
117
|
-
40: "0.4",
|
|
118
|
-
50: "0.5",
|
|
119
|
-
60: "0.6",
|
|
120
|
-
70: "0.7",
|
|
121
|
-
75: "0.75",
|
|
122
|
-
80: "0.8",
|
|
123
|
-
85: "0.85",
|
|
124
|
-
90: "0.9",
|
|
125
|
-
95: "0.95",
|
|
126
|
-
98: "0.98",
|
|
127
|
-
100: "1"
|
|
128
|
-
};
|
|
129
|
-
var backdropBlur = {
|
|
130
|
-
none: "0",
|
|
131
|
-
sm: "4px",
|
|
132
|
-
base: "8px",
|
|
133
|
-
md: "12px",
|
|
134
|
-
lg: "16px",
|
|
135
|
-
xl: "24px",
|
|
136
|
-
"2xl": "40px",
|
|
137
|
-
"3xl": "64px"
|
|
138
|
-
};
|
|
139
|
-
var transition = {
|
|
140
|
-
none: "none",
|
|
141
|
-
all: "all 150ms cubic-bezier(0.4, 0, 0.2, 1)",
|
|
142
|
-
colors: "color 150ms cubic-bezier(0.4, 0, 0.2, 1), background-color 150ms cubic-bezier(0.4, 0, 0.2, 1), border-color 150ms cubic-bezier(0.4, 0, 0.2, 1)",
|
|
143
|
-
opacity: "opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)",
|
|
144
|
-
transform: "transform 150ms cubic-bezier(0.4, 0, 0.2, 1)"
|
|
73
|
+
base: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"
|
|
145
74
|
};
|
|
146
75
|
var zIndex = {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
sticky: "1020",
|
|
156
|
-
fixed: "1030",
|
|
157
|
-
modal: "1040",
|
|
158
|
-
popover: "1050",
|
|
159
|
-
tooltip: "1060",
|
|
160
|
-
toast: "1070"
|
|
76
|
+
TOOLTIP: 2147483647,
|
|
77
|
+
TOOLBAR: 2147483646,
|
|
78
|
+
OVERLAY: 2147483645
|
|
79
|
+
};
|
|
80
|
+
var colors = {
|
|
81
|
+
green: "#22c55e",
|
|
82
|
+
// Primary green
|
|
83
|
+
overlayBorder: "#22c55e"
|
|
161
84
|
};
|
|
162
85
|
var themes = {
|
|
163
86
|
light: {
|
|
@@ -169,9 +92,10 @@ var themes = {
|
|
|
169
92
|
accent: "#888",
|
|
170
93
|
accentHover: "#666",
|
|
171
94
|
accentSelected: "#444",
|
|
172
|
-
primary:
|
|
173
|
-
primaryHover: "
|
|
174
|
-
primarySelected: "
|
|
95
|
+
primary: colors.green,
|
|
96
|
+
primaryHover: "#16a34a",
|
|
97
|
+
primarySelected: "#15803d",
|
|
98
|
+
overlayBorder: colors.overlayBorder
|
|
175
99
|
},
|
|
176
100
|
dark: {
|
|
177
101
|
bg: "rgba(17, 17, 17, 0.92)",
|
|
@@ -182,20 +106,56 @@ var themes = {
|
|
|
182
106
|
accent: "#9ca3af",
|
|
183
107
|
accentHover: "#d1d5db",
|
|
184
108
|
accentSelected: "#f3f4f6",
|
|
185
|
-
primary:
|
|
186
|
-
primaryHover: "
|
|
187
|
-
primarySelected: "
|
|
109
|
+
primary: colors.green,
|
|
110
|
+
primaryHover: "#4ade80",
|
|
111
|
+
primarySelected: "#16a34a",
|
|
112
|
+
overlayBorder: colors.overlayBorder
|
|
188
113
|
}
|
|
189
114
|
};
|
|
115
|
+
function generateCSSVariables() {
|
|
116
|
+
return {
|
|
117
|
+
// Typography - only used values
|
|
118
|
+
"--wwi-font-sans": typography.fontFamily.sans,
|
|
119
|
+
"--wwi-font-size-xs": typography.fontSize.xs,
|
|
120
|
+
"--wwi-font-size-sm": typography.fontSize.sm,
|
|
121
|
+
"--wwi-font-size-base": typography.fontSize.base,
|
|
122
|
+
"--wwi-font-weight-normal": typography.fontWeight.normal,
|
|
123
|
+
"--wwi-font-weight-medium": typography.fontWeight.medium,
|
|
124
|
+
"--wwi-font-weight-semibold": typography.fontWeight.semibold,
|
|
125
|
+
"--wwi-line-height-normal": typography.lineHeight.normal,
|
|
126
|
+
"--wwi-letter-spacing-normal": typography.letterSpacing.normal,
|
|
127
|
+
// Spacing - only used values
|
|
128
|
+
"--wwi-spacing-xs": spacing.xs,
|
|
129
|
+
"--wwi-spacing-sm": spacing.sm,
|
|
130
|
+
"--wwi-spacing-md": spacing.md,
|
|
131
|
+
"--wwi-spacing-lg": spacing.lg,
|
|
132
|
+
"--wwi-spacing-xl": spacing.xl,
|
|
133
|
+
// Box shadow - only used values
|
|
134
|
+
"--wwi-shadow-base": boxShadow.base,
|
|
135
|
+
// Z-index - only used values
|
|
136
|
+
"--wwi-z-tooltip": zIndex.TOOLTIP.toString(),
|
|
137
|
+
"--wwi-z-toolbar": zIndex.TOOLBAR.toString(),
|
|
138
|
+
"--wwi-z-overlay": zIndex.OVERLAY.toString(),
|
|
139
|
+
// Brand colors - only used values
|
|
140
|
+
"--wwi-green": colors.green,
|
|
141
|
+
"--wwi-overlay-border": colors.overlayBorder
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
var designSystem = {
|
|
145
|
+
spacing,
|
|
146
|
+
typography,
|
|
147
|
+
boxShadow,
|
|
148
|
+
zIndex,
|
|
149
|
+
colors,
|
|
150
|
+
themes,
|
|
151
|
+
cssVariables: generateCSSVariables()
|
|
152
|
+
};
|
|
190
153
|
var DESIGN_SYSTEM = {
|
|
191
154
|
spacing,
|
|
192
155
|
typography,
|
|
193
|
-
borderRadius,
|
|
194
156
|
boxShadow,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
transition,
|
|
198
|
-
zIndex
|
|
157
|
+
zIndex,
|
|
158
|
+
colors
|
|
199
159
|
};
|
|
200
160
|
function getThemeVariables(theme) {
|
|
201
161
|
return themes[theme];
|
|
@@ -203,11 +163,26 @@ function getThemeVariables(theme) {
|
|
|
203
163
|
|
|
204
164
|
// src/utils/theme.ts
|
|
205
165
|
function applyTheme(vars) {
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
166
|
+
const existingStyle = document.getElementById("wwi-design-system-styles");
|
|
167
|
+
if (existingStyle) {
|
|
168
|
+
existingStyle.remove();
|
|
169
|
+
}
|
|
170
|
+
const style = document.createElement("style");
|
|
171
|
+
style.id = "wwi-design-system-styles";
|
|
172
|
+
const cssVariables = Object.entries(designSystem.cssVariables).map(([property2, value]) => ` ${property2}: ${value};`).join("\n");
|
|
173
|
+
const themeVariables = `
|
|
174
|
+
--wwi-bg: ${vars.bg};
|
|
175
|
+
--wwi-fg: ${vars.fg};
|
|
176
|
+
--wwi-border: ${vars.border};
|
|
177
|
+
--wwi-accent: ${vars.accent};
|
|
178
|
+
`;
|
|
179
|
+
style.textContent = `
|
|
180
|
+
:root {
|
|
181
|
+
${cssVariables}
|
|
182
|
+
${themeVariables}
|
|
183
|
+
}
|
|
184
|
+
`;
|
|
185
|
+
document.head.appendChild(style);
|
|
211
186
|
}
|
|
212
187
|
function detectAutoTheme() {
|
|
213
188
|
if (typeof document === "undefined" || !document.body || !document.documentElement) {
|
|
@@ -316,192 +291,154 @@ function getElementBox(el) {
|
|
|
316
291
|
}
|
|
317
292
|
|
|
318
293
|
// src/utils/debug-data.ts
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
isWebWidget
|
|
337
|
-
};
|
|
338
|
-
if (element.id) {
|
|
339
|
-
data.id = element.id;
|
|
340
|
-
}
|
|
341
|
-
if (isWebWidget) {
|
|
342
|
-
data.webWidgetData = this.collectWebWidgetData(element);
|
|
343
|
-
}
|
|
344
|
-
return data;
|
|
294
|
+
function collectElementData(element) {
|
|
295
|
+
const bounds = getElementBox(element) ?? {
|
|
296
|
+
left: 0,
|
|
297
|
+
top: 0,
|
|
298
|
+
right: 0,
|
|
299
|
+
bottom: 0,
|
|
300
|
+
width: 0,
|
|
301
|
+
height: 0
|
|
302
|
+
};
|
|
303
|
+
const isWebWidget = element.tagName === "WEB-WIDGET";
|
|
304
|
+
const data = {
|
|
305
|
+
tag: element.tagName.toLowerCase(),
|
|
306
|
+
bounds,
|
|
307
|
+
isWebWidget
|
|
308
|
+
};
|
|
309
|
+
if (element.id) {
|
|
310
|
+
data.id = element.id;
|
|
345
311
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
312
|
+
if (isWebWidget) {
|
|
313
|
+
data.webWidgetData = collectWebWidgetData(element);
|
|
314
|
+
}
|
|
315
|
+
return data;
|
|
316
|
+
}
|
|
317
|
+
function collectWebWidgetData(element) {
|
|
318
|
+
const data = {};
|
|
319
|
+
const webWidgetElement = element;
|
|
320
|
+
const name = element.getAttribute("name");
|
|
321
|
+
if (name) {
|
|
322
|
+
data.name = name;
|
|
323
|
+
}
|
|
324
|
+
const importUrl = element.getAttribute("import");
|
|
325
|
+
if (importUrl) {
|
|
326
|
+
data.module = importUrl;
|
|
327
|
+
}
|
|
328
|
+
const loading = webWidgetElement.loading;
|
|
329
|
+
if (loading && loading !== "eager") {
|
|
330
|
+
data.loading = loading;
|
|
331
|
+
}
|
|
332
|
+
const renderTarget = webWidgetElement.renderTarget;
|
|
333
|
+
if (renderTarget && renderTarget !== "light") {
|
|
334
|
+
data.renderTarget = renderTarget;
|
|
335
|
+
}
|
|
336
|
+
const status = webWidgetElement.status;
|
|
337
|
+
if (status) {
|
|
338
|
+
data.status = status;
|
|
339
|
+
}
|
|
340
|
+
if (webWidgetElement.inactive) {
|
|
341
|
+
data.inactive = true;
|
|
342
|
+
}
|
|
343
|
+
const contextData = webWidgetElement.contextData;
|
|
344
|
+
if (contextData && typeof contextData === "object") {
|
|
345
|
+
data.contextData = contextData;
|
|
346
|
+
}
|
|
347
|
+
const performanceData = collectPerformanceData(element);
|
|
348
|
+
if (performanceData.loadTime !== undefined) {
|
|
349
|
+
data.loadTime = performanceData.loadTime;
|
|
350
|
+
}
|
|
351
|
+
if (performanceData.mountTime !== undefined) {
|
|
352
|
+
data.mountTime = performanceData.mountTime;
|
|
353
|
+
}
|
|
354
|
+
return data;
|
|
355
|
+
}
|
|
356
|
+
function collectPerformanceData(element) {
|
|
357
|
+
const data = {};
|
|
358
|
+
const webWidgetElement = element;
|
|
359
|
+
const performanceData = webWidgetElement.performance;
|
|
360
|
+
if (performanceData && typeof performanceData === "object") {
|
|
382
361
|
if (performanceData.loadTime) {
|
|
383
|
-
|
|
362
|
+
const loadTimeStr = performanceData.loadTime;
|
|
363
|
+
if (typeof loadTimeStr === "string" && loadTimeStr.endsWith("ms")) {
|
|
364
|
+
data.loadTime = parseInt(loadTimeStr, 10);
|
|
365
|
+
}
|
|
384
366
|
}
|
|
385
367
|
if (performanceData.mountTime) {
|
|
386
|
-
|
|
368
|
+
const mountTimeStr = performanceData.mountTime;
|
|
369
|
+
if (typeof mountTimeStr === "string" && mountTimeStr.endsWith("ms")) {
|
|
370
|
+
data.mountTime = parseInt(mountTimeStr, 10);
|
|
371
|
+
}
|
|
387
372
|
}
|
|
388
|
-
return data;
|
|
389
373
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
const
|
|
396
|
-
const
|
|
397
|
-
if (
|
|
398
|
-
|
|
374
|
+
return data;
|
|
375
|
+
}
|
|
376
|
+
function formatDebugData(data, element) {
|
|
377
|
+
const items = [];
|
|
378
|
+
if (data.isWebWidget && data.webWidgetData) {
|
|
379
|
+
const widgetData = data.webWidgetData;
|
|
380
|
+
const componentName = element.getAttribute("name");
|
|
381
|
+
if (componentName) {
|
|
382
|
+
items.push({ key: "Name", value: componentName, priority: 1 });
|
|
383
|
+
}
|
|
384
|
+
if (widgetData.module) {
|
|
385
|
+
items.push({ key: "Module", value: widgetData.module, priority: 2 });
|
|
386
|
+
}
|
|
387
|
+
if (widgetData.loadTime !== undefined) {
|
|
388
|
+
items.push({
|
|
389
|
+
key: "Load Time",
|
|
390
|
+
value: `${widgetData.loadTime}ms`,
|
|
391
|
+
priority: 3
|
|
392
|
+
});
|
|
399
393
|
}
|
|
400
|
-
if (
|
|
401
|
-
|
|
394
|
+
if (widgetData.mountTime !== undefined) {
|
|
395
|
+
items.push({
|
|
396
|
+
key: "Mount Time",
|
|
397
|
+
value: `${widgetData.mountTime}ms`,
|
|
398
|
+
priority: 3
|
|
399
|
+
});
|
|
402
400
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if (
|
|
419
|
-
items.push({ key: "Status", value: widgetData.status, priority: 3 });
|
|
420
|
-
}
|
|
421
|
-
if (widgetData.inactive) {
|
|
422
|
-
items.push({ key: "State", value: "inactive", priority: 4 });
|
|
423
|
-
}
|
|
424
|
-
if (widgetData.loading) {
|
|
425
|
-
items.push({ key: "Loading", value: widgetData.loading, priority: 5 });
|
|
426
|
-
}
|
|
427
|
-
if (widgetData.renderTarget) {
|
|
428
|
-
items.push({
|
|
429
|
-
key: "Render",
|
|
430
|
-
value: widgetData.renderTarget,
|
|
431
|
-
priority: 6
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
if (widgetData.loadTime) {
|
|
435
|
-
items.push({
|
|
436
|
-
key: "Load Time",
|
|
437
|
-
value: `${widgetData.loadTime}ms`,
|
|
438
|
-
priority: 7
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
if (widgetData.mountTime) {
|
|
401
|
+
if (widgetData.status) {
|
|
402
|
+
items.push({ key: "Status", value: widgetData.status, priority: 4 });
|
|
403
|
+
}
|
|
404
|
+
if (widgetData.loading) {
|
|
405
|
+
items.push({ key: "Loading", value: widgetData.loading, priority: 4 });
|
|
406
|
+
}
|
|
407
|
+
if (widgetData.renderTarget) {
|
|
408
|
+
items.push({
|
|
409
|
+
key: "Render",
|
|
410
|
+
value: widgetData.renderTarget,
|
|
411
|
+
priority: 4
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
if (widgetData.contextData) {
|
|
415
|
+
const dataKeys = Object.keys(widgetData.contextData);
|
|
416
|
+
if (dataKeys.length > 0) {
|
|
442
417
|
items.push({
|
|
443
|
-
key: "
|
|
444
|
-
value: `${
|
|
445
|
-
priority:
|
|
418
|
+
key: "Parameters",
|
|
419
|
+
value: `${dataKeys.length} keys`,
|
|
420
|
+
priority: 5
|
|
446
421
|
});
|
|
447
422
|
}
|
|
448
|
-
if (widgetData.contextData) {
|
|
449
|
-
const dataKeys = Object.keys(widgetData.contextData);
|
|
450
|
-
if (dataKeys.length > 0) {
|
|
451
|
-
items.push({
|
|
452
|
-
key: "Parameters",
|
|
453
|
-
value: `${dataKeys.length} keys`,
|
|
454
|
-
priority: 9
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
} else {
|
|
459
|
-
items.push({ key: "Tag", value: data.tag, priority: 1 });
|
|
460
|
-
if (data.id) {
|
|
461
|
-
items.push({ key: "ID", value: data.id, priority: 2 });
|
|
462
|
-
}
|
|
463
423
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
priority:
|
|
468
|
-
}
|
|
469
|
-
return items.sort((a, b) => a.priority - b.priority);
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* Generate tooltip content with priority-based styling
|
|
473
|
-
*/
|
|
474
|
-
static generateTooltipContent(element) {
|
|
475
|
-
const debugData = this.collectElementData(element);
|
|
476
|
-
const formattedData = this.formatDebugData(debugData);
|
|
477
|
-
const tableRows = formattedData.map((item) => {
|
|
478
|
-
const priorityClass = this.getPriorityClass(item.priority);
|
|
479
|
-
return `<tr class="${priorityClass}"><td class="key">${item.key}</td><td class="value">${item.value}</td></tr>`;
|
|
480
|
-
}).join("");
|
|
481
|
-
const helpText = debugData.isWebWidget ? '<div class="tooltip-help">\u{1F4A1} Click to open source code</div>' : "";
|
|
482
|
-
return `<table class="tooltip-table">${tableRows}</table>${helpText}`;
|
|
483
|
-
}
|
|
484
|
-
/**
|
|
485
|
-
* Get CSS class based on priority level
|
|
486
|
-
*/
|
|
487
|
-
static getPriorityClass(priority) {
|
|
488
|
-
if (priority <= 3) return "priority-high";
|
|
489
|
-
if (priority <= 6) return "priority-medium";
|
|
490
|
-
return "priority-low";
|
|
424
|
+
} else {
|
|
425
|
+
items.push({ key: "Tag", value: data.tag, priority: 1 });
|
|
426
|
+
if (data.id) {
|
|
427
|
+
items.push({ key: "ID", value: data.id, priority: 2 });
|
|
428
|
+
}
|
|
491
429
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
};
|
|
430
|
+
items.push({
|
|
431
|
+
key: "Size",
|
|
432
|
+
value: `${Math.round(data.bounds.width)}\xD7${Math.round(data.bounds.height)}px`,
|
|
433
|
+
priority: 10
|
|
434
|
+
});
|
|
435
|
+
return items.sort((a, b) => a.priority - b.priority);
|
|
436
|
+
}
|
|
437
|
+
function getPriorityClass(priority) {
|
|
438
|
+
if (priority <= 3) return "priority-high";
|
|
439
|
+
if (priority <= 6) return "priority-medium";
|
|
440
|
+
return "priority-low";
|
|
441
|
+
}
|
|
505
442
|
|
|
506
443
|
// src/element.ts
|
|
507
444
|
var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
@@ -518,7 +455,15 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
518
455
|
this.widgetCount = 0;
|
|
519
456
|
this.pressedKeys = /* @__PURE__ */ new Set();
|
|
520
457
|
this.tooltipElement = null;
|
|
521
|
-
this.
|
|
458
|
+
this.currentElementBounds = {
|
|
459
|
+
top: 0,
|
|
460
|
+
left: 0,
|
|
461
|
+
right: 0,
|
|
462
|
+
bottom: 0,
|
|
463
|
+
width: 0,
|
|
464
|
+
height: 0
|
|
465
|
+
};
|
|
466
|
+
this.overlayElement = null;
|
|
522
467
|
}
|
|
523
468
|
get theme() {
|
|
524
469
|
return this._theme;
|
|
@@ -541,7 +486,6 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
541
486
|
}
|
|
542
487
|
disconnectedCallback() {
|
|
543
488
|
super.disconnectedCallback();
|
|
544
|
-
this.cleanupTooltip();
|
|
545
489
|
this.cleanupInspectorElements();
|
|
546
490
|
}
|
|
547
491
|
initializeTheme() {
|
|
@@ -607,108 +551,95 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
607
551
|
if (!this.isInspectorMode) return;
|
|
608
552
|
const target = findWebWidgetContainer(event.target);
|
|
609
553
|
if (this.hoveredElement !== target) {
|
|
554
|
+
if (this.hoveredElement) {
|
|
555
|
+
this.hoveredElement.style.removeProperty("cursor");
|
|
556
|
+
}
|
|
610
557
|
this.hoveredElement = target;
|
|
611
558
|
this.updateState();
|
|
612
559
|
}
|
|
613
560
|
}
|
|
614
561
|
handleClickEvent(event) {
|
|
615
562
|
if (this.isInspectorMode) {
|
|
616
|
-
const toolbar = this.renderRoot?.querySelector(".
|
|
563
|
+
const toolbar = this.renderRoot?.querySelector(".wwi-toolbar");
|
|
617
564
|
const isToolbarClick = toolbar?.contains(event.target);
|
|
618
565
|
if (isToolbarClick) {
|
|
619
566
|
return;
|
|
620
567
|
}
|
|
621
|
-
event.preventDefault();
|
|
622
|
-
event.stopPropagation();
|
|
623
|
-
event.stopImmediatePropagation();
|
|
624
568
|
const widgetTarget = findWebWidgetContainer(event.target);
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
569
|
+
if (widgetTarget) {
|
|
570
|
+
event.preventDefault();
|
|
571
|
+
event.stopPropagation();
|
|
572
|
+
event.stopImmediatePropagation();
|
|
573
|
+
const inspectUrl = widgetTarget?.getAttribute("import");
|
|
574
|
+
if (inspectUrl) {
|
|
575
|
+
document.body.style.cursor = "progress";
|
|
576
|
+
this.openInEditor(inspectUrl, this.dir);
|
|
577
|
+
this.updateState();
|
|
578
|
+
}
|
|
630
579
|
}
|
|
631
580
|
}
|
|
632
581
|
}
|
|
633
582
|
updateState() {
|
|
634
|
-
const shouldShowInspector = !!(this.hoveredElement && this.isInspectorMode);
|
|
635
583
|
const targetKeys = this.keys;
|
|
636
|
-
this.isToolbarVisible || this.checkKeysMatch(targetKeys);
|
|
637
584
|
if (!this.isToolbarVisible && this.checkKeysMatch(targetKeys)) {
|
|
638
585
|
this.showToolbar();
|
|
639
586
|
}
|
|
640
|
-
this.
|
|
587
|
+
if (this.isInspectorMode && this.hoveredElement) {
|
|
588
|
+
this.updateInspectorOverlays(this.hoveredElement);
|
|
589
|
+
} else {
|
|
590
|
+
this.clearInspectorOverlays();
|
|
591
|
+
}
|
|
641
592
|
this.setButtonSelected(this.isInspectorMode);
|
|
642
593
|
if (this.isInspectorMode) {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
document.body.style.setProperty("cursor", "pointer", "important");
|
|
646
|
-
} else {
|
|
647
|
-
document.body.style.removeProperty("cursor");
|
|
594
|
+
if (this.hoveredElement) {
|
|
595
|
+
this.hoveredElement.style.cursor = "pointer";
|
|
648
596
|
}
|
|
649
597
|
} else {
|
|
650
598
|
document.body.style.removeProperty("cursor");
|
|
599
|
+
const allElements = document.querySelectorAll("*");
|
|
600
|
+
allElements.forEach((el) => {
|
|
601
|
+
if (el instanceof HTMLElement) {
|
|
602
|
+
el.style.removeProperty("cursor");
|
|
603
|
+
}
|
|
604
|
+
});
|
|
651
605
|
}
|
|
652
606
|
this.requestUpdate();
|
|
653
607
|
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
if (this.isInspectorMode) {
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
background: repeating-linear-gradient(
|
|
686
|
-
45deg,
|
|
687
|
-
rgba(102, 126, 234, 0.5),
|
|
688
|
-
rgba(102, 126, 234, 0.5) 5px,
|
|
689
|
-
rgba(255, 255, 255, 0.5) 5px,
|
|
690
|
-
rgba(255, 255, 255, 0.5) 10px
|
|
691
|
-
) !important;
|
|
692
|
-
border: 2px solid rgba(102, 126, 234, 0.9) !important;
|
|
693
|
-
border-radius: 0 !important;
|
|
694
|
-
box-sizing: border-box !important;
|
|
695
|
-
`;
|
|
696
|
-
this.showTooltip(this.hoveredElement);
|
|
697
|
-
} else {
|
|
698
|
-
if (highlightOverlay) {
|
|
699
|
-
highlightOverlay.remove();
|
|
700
|
-
}
|
|
701
|
-
this.hideTooltip();
|
|
702
|
-
}
|
|
703
|
-
} else {
|
|
704
|
-
if (highlightOverlay) {
|
|
705
|
-
highlightOverlay.remove();
|
|
706
|
-
}
|
|
707
|
-
this.hideTooltip();
|
|
608
|
+
createOverlayElement() {
|
|
609
|
+
if (this.overlayElement) {
|
|
610
|
+
return this.overlayElement;
|
|
611
|
+
}
|
|
612
|
+
if (!this.isInspectorMode) {
|
|
613
|
+
const dummy = document.createElement("div");
|
|
614
|
+
dummy.style.visibility = "hidden";
|
|
615
|
+
return dummy;
|
|
616
|
+
}
|
|
617
|
+
this.ensureOverlayStyles();
|
|
618
|
+
const overlay = document.createElement("div");
|
|
619
|
+
overlay.className = "wwi-overlay";
|
|
620
|
+
overlay.setAttribute("aria-hidden", "true");
|
|
621
|
+
document.body.appendChild(overlay);
|
|
622
|
+
this.overlayElement = overlay;
|
|
623
|
+
return overlay;
|
|
624
|
+
}
|
|
625
|
+
showOverlay(element) {
|
|
626
|
+
if (!this.isInspectorMode || !element) return;
|
|
627
|
+
const overlay = this.createOverlayElement();
|
|
628
|
+
const rect = this.currentElementBounds;
|
|
629
|
+
overlay.style.top = `${rect.top}px`;
|
|
630
|
+
overlay.style.left = `${rect.left}px`;
|
|
631
|
+
overlay.style.width = `${rect.width}px`;
|
|
632
|
+
overlay.style.height = `${rect.height}px`;
|
|
633
|
+
overlay.style.visibility = "visible";
|
|
634
|
+
}
|
|
635
|
+
cleanupOverlay() {
|
|
636
|
+
if (this.overlayElement) {
|
|
637
|
+
this.overlayElement.remove();
|
|
638
|
+
this.overlayElement = null;
|
|
708
639
|
}
|
|
709
640
|
}
|
|
710
641
|
setButtonSelected(selected) {
|
|
711
|
-
const btn = this.renderRoot?.querySelector(".inspect-btn");
|
|
642
|
+
const btn = this.renderRoot?.querySelector(".wwi-inspect-btn");
|
|
712
643
|
if (btn) {
|
|
713
644
|
btn.setAttribute("data-selected", selected ? "true" : "false");
|
|
714
645
|
btn.setAttribute("aria-pressed", selected ? "true" : "false");
|
|
@@ -723,31 +654,56 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
723
654
|
}
|
|
724
655
|
if (!this.isInspectorMode) {
|
|
725
656
|
const dummy = document.createElement("div");
|
|
726
|
-
dummy.style.
|
|
657
|
+
dummy.style.visibility = "hidden";
|
|
727
658
|
return dummy;
|
|
728
659
|
}
|
|
729
660
|
this.ensureTooltipStyles();
|
|
730
661
|
const tooltip = document.createElement("div");
|
|
731
|
-
tooltip.className = "
|
|
662
|
+
tooltip.className = "wwi-tooltip";
|
|
732
663
|
tooltip.setAttribute("aria-hidden", "true");
|
|
733
|
-
tooltip.setAttribute("data-visible", "false");
|
|
734
664
|
document.body.appendChild(tooltip);
|
|
735
665
|
this.tooltipElement = tooltip;
|
|
736
666
|
return tooltip;
|
|
737
667
|
}
|
|
668
|
+
ensureOverlayStyles() {
|
|
669
|
+
if (!this.isInspectorMode) {
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
if (document.getElementById("wwi-overlay-styles")) {
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
const style = document.createElement("style");
|
|
676
|
+
style.id = "wwi-overlay-styles";
|
|
677
|
+
style.textContent = `
|
|
678
|
+
.wwi-overlay {
|
|
679
|
+
position: fixed;
|
|
680
|
+
z-index: ${DESIGN_SYSTEM.zIndex.OVERLAY};
|
|
681
|
+
pointer-events: none;
|
|
682
|
+
visibility: hidden;
|
|
683
|
+
opacity: 1;
|
|
684
|
+
display: block;
|
|
685
|
+
background: rgba(34, 197, 94, 0.3);
|
|
686
|
+
border: 2px solid var(--wwi-overlay-border, #22c55e);
|
|
687
|
+
border-radius: 0;
|
|
688
|
+
box-sizing: border-box;
|
|
689
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
690
|
+
}
|
|
691
|
+
`;
|
|
692
|
+
document.head.appendChild(style);
|
|
693
|
+
}
|
|
738
694
|
ensureTooltipStyles() {
|
|
739
695
|
if (!this.isInspectorMode) {
|
|
740
696
|
return;
|
|
741
697
|
}
|
|
742
|
-
if (document.getElementById("
|
|
698
|
+
if (document.getElementById("wwi-tooltip-styles")) {
|
|
743
699
|
return;
|
|
744
700
|
}
|
|
745
701
|
const style = document.createElement("style");
|
|
746
|
-
style.id = "
|
|
702
|
+
style.id = "wwi-tooltip-styles";
|
|
747
703
|
style.textContent = `
|
|
748
|
-
.
|
|
704
|
+
.wwi-tooltip {
|
|
749
705
|
position: fixed;
|
|
750
|
-
z-index: ${
|
|
706
|
+
z-index: ${DESIGN_SYSTEM.zIndex.TOOLTIP};
|
|
751
707
|
pointer-events: none;
|
|
752
708
|
background: var(--wwi-bg, rgba(255, 255, 255, 0.95));
|
|
753
709
|
color: var(--wwi-fg, #222);
|
|
@@ -755,7 +711,7 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
755
711
|
border-radius: 0.375rem;
|
|
756
712
|
padding: ${DESIGN_SYSTEM.spacing.lg} ${DESIGN_SYSTEM.spacing.xl};
|
|
757
713
|
font-size: ${DESIGN_SYSTEM.typography.fontSize.base};
|
|
758
|
-
font-family:
|
|
714
|
+
font-family: ${DESIGN_SYSTEM.typography.fontFamily.sans};
|
|
759
715
|
line-height: ${DESIGN_SYSTEM.typography.lineHeight.normal};
|
|
760
716
|
font-weight: ${DESIGN_SYSTEM.typography.fontWeight.normal};
|
|
761
717
|
letter-spacing: ${DESIGN_SYSTEM.typography.letterSpacing.normal};
|
|
@@ -766,21 +722,22 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
766
722
|
max-width: 640px;
|
|
767
723
|
min-width: 280px;
|
|
768
724
|
visibility: hidden;
|
|
725
|
+
display: block;
|
|
769
726
|
}
|
|
770
727
|
|
|
771
|
-
.tooltip-table {
|
|
728
|
+
.wwi-tooltip-table {
|
|
772
729
|
width: 100%;
|
|
773
730
|
border-collapse: collapse;
|
|
774
731
|
font-size: ${DESIGN_SYSTEM.typography.fontSize.xs};
|
|
775
732
|
line-height: ${DESIGN_SYSTEM.typography.lineHeight.normal};
|
|
776
733
|
}
|
|
777
734
|
|
|
778
|
-
.tooltip-table td {
|
|
735
|
+
.wwi-tooltip-table td {
|
|
779
736
|
padding: ${DESIGN_SYSTEM.spacing.xs} 0;
|
|
780
737
|
vertical-align: top;
|
|
781
738
|
}
|
|
782
739
|
|
|
783
|
-
.tooltip-table .key {
|
|
740
|
+
.wwi-tooltip-table .key {
|
|
784
741
|
color: var(--wwi-accent, #888);
|
|
785
742
|
font-weight: ${DESIGN_SYSTEM.typography.fontWeight.medium};
|
|
786
743
|
padding-right: ${DESIGN_SYSTEM.spacing.lg};
|
|
@@ -789,49 +746,48 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
789
746
|
opacity: 0.8;
|
|
790
747
|
}
|
|
791
748
|
|
|
792
|
-
.tooltip-table .value {
|
|
749
|
+
.wwi-tooltip-table .value {
|
|
793
750
|
color: var(--wwi-fg, #222);
|
|
794
751
|
font-weight: ${DESIGN_SYSTEM.typography.fontWeight.normal};
|
|
795
752
|
word-break: break-all;
|
|
796
753
|
text-align: right;
|
|
797
754
|
}
|
|
798
755
|
|
|
799
|
-
|
|
800
|
-
.tooltip-table tr.priority-high .key {
|
|
756
|
+
.wwi-tooltip-table tr.priority-high .key {
|
|
801
757
|
color: var(--wwi-fg, #222);
|
|
802
758
|
font-weight: ${DESIGN_SYSTEM.typography.fontWeight.semibold};
|
|
803
759
|
opacity: 1;
|
|
804
760
|
}
|
|
805
761
|
|
|
806
|
-
.tooltip-table tr.priority-high .value {
|
|
762
|
+
.wwi-tooltip-table tr.priority-high .value {
|
|
807
763
|
color: var(--wwi-fg, #222);
|
|
808
764
|
font-weight: ${DESIGN_SYSTEM.typography.fontWeight.medium};
|
|
809
765
|
}
|
|
810
766
|
|
|
811
|
-
.tooltip-table tr.priority-medium .key {
|
|
767
|
+
.wwi-tooltip-table tr.priority-medium .key {
|
|
812
768
|
color: var(--wwi-accent, #666);
|
|
813
769
|
font-weight: ${DESIGN_SYSTEM.typography.fontWeight.medium};
|
|
814
770
|
opacity: 0.9;
|
|
815
771
|
}
|
|
816
772
|
|
|
817
|
-
.tooltip-table tr.priority-medium .value {
|
|
773
|
+
.wwi-tooltip-table tr.priority-medium .value {
|
|
818
774
|
color: var(--wwi-fg, #444);
|
|
819
775
|
font-weight: ${DESIGN_SYSTEM.typography.fontWeight.normal};
|
|
820
776
|
}
|
|
821
777
|
|
|
822
|
-
.tooltip-table tr.priority-low .key {
|
|
778
|
+
.wwi-tooltip-table tr.priority-low .key {
|
|
823
779
|
color: var(--wwi-accent, #888);
|
|
824
780
|
font-weight: ${DESIGN_SYSTEM.typography.fontWeight.normal};
|
|
825
781
|
opacity: 0.7;
|
|
826
782
|
}
|
|
827
783
|
|
|
828
|
-
.tooltip-table tr.priority-low .value {
|
|
784
|
+
.wwi-tooltip-table tr.priority-low .value {
|
|
829
785
|
color: var(--wwi-fg, #666);
|
|
830
786
|
font-weight: ${DESIGN_SYSTEM.typography.fontWeight.normal};
|
|
831
787
|
opacity: 0.8;
|
|
832
788
|
}
|
|
833
789
|
|
|
834
|
-
.tooltip-help {
|
|
790
|
+
.wwi-tooltip-help {
|
|
835
791
|
margin-top: ${DESIGN_SYSTEM.spacing.md};
|
|
836
792
|
padding-top: ${DESIGN_SYSTEM.spacing.md};
|
|
837
793
|
border-top: 1px solid var(--wwi-border, #e5e7eb);
|
|
@@ -851,25 +807,6 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
851
807
|
padding: ${DESIGN_SYSTEM.spacing.md} ${DESIGN_SYSTEM.spacing.lg};
|
|
852
808
|
gap: ${DESIGN_SYSTEM.spacing.md};
|
|
853
809
|
}
|
|
854
|
-
|
|
855
|
-
.inspector-btn {
|
|
856
|
-
padding: ${DESIGN_SYSTEM.spacing.md} ${DESIGN_SYSTEM.spacing.md};
|
|
857
|
-
font-size: ${DESIGN_SYSTEM.typography.fontSize.sm};
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
.inspector-info {
|
|
861
|
-
font-size: ${DESIGN_SYSTEM.typography.fontSize.sm};
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
.inspector-tooltip {
|
|
865
|
-
font-size: ${DESIGN_SYSTEM.typography.fontSize.sm};
|
|
866
|
-
padding: ${DESIGN_SYSTEM.spacing.md} ${DESIGN_SYSTEM.spacing.lg};
|
|
867
|
-
max-width: calc(100vw - ${DESIGN_SYSTEM.spacing.xl});
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
.tooltip-table {
|
|
871
|
-
font-size: ${DESIGN_SYSTEM.typography.fontSize.sm};
|
|
872
|
-
}
|
|
873
810
|
}
|
|
874
811
|
`;
|
|
875
812
|
document.head.appendChild(style);
|
|
@@ -895,45 +832,32 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
895
832
|
return { x, y };
|
|
896
833
|
}
|
|
897
834
|
generateTooltipContent(element) {
|
|
898
|
-
|
|
835
|
+
const debugData = collectElementData(element);
|
|
836
|
+
const formattedData = formatDebugData(debugData, element);
|
|
837
|
+
const tableRows = formattedData.map((item) => {
|
|
838
|
+
const priorityClass = getPriorityClass(item.priority);
|
|
839
|
+
return `<tr class="${priorityClass}"><td class="key">${item.key}</td><td class="value">${item.value}</td></tr>`;
|
|
840
|
+
}).join("");
|
|
841
|
+
const helpText = debugData.isWebWidget ? '<div class="wwi-tooltip-help">\u{1F4A1} Click to open source code</div>' : "";
|
|
842
|
+
return `<table class="wwi-tooltip-table">${tableRows}</table>${helpText}`;
|
|
899
843
|
}
|
|
900
844
|
showTooltip(element) {
|
|
901
845
|
if (!this.isInspectorMode || !element) return;
|
|
902
|
-
if (this.tooltipTimeout) {
|
|
903
|
-
clearTimeout(this.tooltipTimeout);
|
|
904
|
-
this.tooltipTimeout = null;
|
|
905
|
-
}
|
|
906
846
|
const tooltip = this.createTooltipElement();
|
|
907
847
|
const content = this.generateTooltipContent(element);
|
|
908
848
|
tooltip.innerHTML = content;
|
|
909
849
|
tooltip.style.visibility = "hidden";
|
|
910
850
|
tooltip.style.display = "block";
|
|
911
851
|
tooltip.offsetHeight;
|
|
912
|
-
const elementRect =
|
|
852
|
+
const elementRect = this.currentElementBounds;
|
|
913
853
|
const tooltipRect = tooltip.getBoundingClientRect();
|
|
914
|
-
const position = this.calculateSimplePosition(
|
|
915
|
-
elementRect ?? {
|
|
916
|
-
top: 0,
|
|
917
|
-
left: 0,
|
|
918
|
-
right: 0,
|
|
919
|
-
bottom: 0,
|
|
920
|
-
width: 0,
|
|
921
|
-
height: 0
|
|
922
|
-
},
|
|
923
|
-
tooltipRect
|
|
924
|
-
);
|
|
854
|
+
const position = this.calculateSimplePosition(elementRect, tooltipRect);
|
|
925
855
|
tooltip.style.left = `${position.x}px`;
|
|
926
856
|
tooltip.style.top = `${position.y}px`;
|
|
927
|
-
tooltip.setAttribute("data-visible", "true");
|
|
928
857
|
tooltip.style.visibility = "visible";
|
|
929
858
|
}
|
|
930
859
|
hideTooltip() {
|
|
931
|
-
if (this.tooltipTimeout) {
|
|
932
|
-
clearTimeout(this.tooltipTimeout);
|
|
933
|
-
this.tooltipTimeout = null;
|
|
934
|
-
}
|
|
935
860
|
if (this.tooltipElement) {
|
|
936
|
-
this.tooltipElement.setAttribute("data-visible", "false");
|
|
937
861
|
this.tooltipElement.style.visibility = "hidden";
|
|
938
862
|
}
|
|
939
863
|
}
|
|
@@ -942,19 +866,23 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
942
866
|
this.tooltipElement.remove();
|
|
943
867
|
this.tooltipElement = null;
|
|
944
868
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
869
|
+
}
|
|
870
|
+
updateTooltipContent() {
|
|
871
|
+
if (this.hoveredElement && this.tooltipElement) {
|
|
872
|
+
const content = this.generateTooltipContent(this.hoveredElement);
|
|
873
|
+
this.tooltipElement.innerHTML = content;
|
|
948
874
|
}
|
|
949
875
|
}
|
|
950
876
|
cleanupInspectorElements() {
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
877
|
+
if (this.overlayElement) {
|
|
878
|
+
this.overlayElement.remove();
|
|
879
|
+
this.overlayElement = null;
|
|
880
|
+
}
|
|
881
|
+
const overlayStyles = document.getElementById("wwi-overlay-styles");
|
|
882
|
+
if (overlayStyles) {
|
|
883
|
+
overlayStyles.remove();
|
|
956
884
|
}
|
|
957
|
-
const tooltipStyles = document.getElementById("
|
|
885
|
+
const tooltipStyles = document.getElementById("wwi-tooltip-styles");
|
|
958
886
|
if (tooltipStyles) {
|
|
959
887
|
tooltipStyles.remove();
|
|
960
888
|
}
|
|
@@ -1034,18 +962,47 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
1034
962
|
});
|
|
1035
963
|
}
|
|
1036
964
|
}
|
|
965
|
+
/**
|
|
966
|
+
* Batch update all inspector overlays for the current hovered element
|
|
967
|
+
* This avoids multiple expensive getElementBox calls
|
|
968
|
+
*/
|
|
969
|
+
updateInspectorOverlays(element) {
|
|
970
|
+
const bounds = getElementBox(element);
|
|
971
|
+
this.currentElementBounds = bounds ?? {
|
|
972
|
+
top: 0,
|
|
973
|
+
left: 0,
|
|
974
|
+
right: 0,
|
|
975
|
+
bottom: 0,
|
|
976
|
+
width: 0,
|
|
977
|
+
height: 0
|
|
978
|
+
};
|
|
979
|
+
this.showOverlay(element);
|
|
980
|
+
this.showTooltip(element);
|
|
981
|
+
}
|
|
982
|
+
clearInspectorOverlays() {
|
|
983
|
+
this.currentElementBounds = {
|
|
984
|
+
top: 0,
|
|
985
|
+
left: 0,
|
|
986
|
+
right: 0,
|
|
987
|
+
bottom: 0,
|
|
988
|
+
width: 0,
|
|
989
|
+
height: 0
|
|
990
|
+
};
|
|
991
|
+
this.cleanupOverlay();
|
|
992
|
+
this.cleanupTooltip();
|
|
993
|
+
}
|
|
1037
994
|
render() {
|
|
1038
995
|
if (!this.isToolbarVisible) {
|
|
1039
996
|
return html``;
|
|
1040
997
|
}
|
|
1041
998
|
return html`
|
|
1042
999
|
<div
|
|
1043
|
-
class="
|
|
1000
|
+
class="wwi-toolbar"
|
|
1044
1001
|
data-minimized=${this.isMinimized ? "true" : "false"}
|
|
1045
1002
|
data-inspector-active=${this.isInspectorMode ? "true" : "false"}>
|
|
1046
|
-
<div class="
|
|
1003
|
+
<div class="wwi-header">
|
|
1047
1004
|
<div
|
|
1048
|
-
class="
|
|
1005
|
+
class="wwi-logo"
|
|
1049
1006
|
tabindex="0"
|
|
1050
1007
|
title="Web Widget Inspector"
|
|
1051
1008
|
@click=${this.minimizeToolbar}>
|
|
@@ -1065,13 +1022,13 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
1065
1022
|
</div>
|
|
1066
1023
|
</div>
|
|
1067
1024
|
|
|
1068
|
-
<div class="
|
|
1025
|
+
<div class="wwi-info">
|
|
1069
1026
|
<span class="widget-count">${this.widgetCount} widgets</span>
|
|
1070
1027
|
</div>
|
|
1071
1028
|
|
|
1072
|
-
<div class="
|
|
1029
|
+
<div class="wwi-actions">
|
|
1073
1030
|
<button
|
|
1074
|
-
class="
|
|
1031
|
+
class="wwi-btn wwi-inspect-btn"
|
|
1075
1032
|
@click=${this.toggleInspector}
|
|
1076
1033
|
title="Click to activate widget inspector (ESC to exit)"
|
|
1077
1034
|
aria-label="Activate widget inspector mode">
|
|
@@ -1091,7 +1048,7 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
1091
1048
|
</button>
|
|
1092
1049
|
|
|
1093
1050
|
<button
|
|
1094
|
-
class="
|
|
1051
|
+
class="wwi-btn wwi-page-btn"
|
|
1095
1052
|
@click=${() => {
|
|
1096
1053
|
const currentFilePath = this.getCurrentFilePath();
|
|
1097
1054
|
if (currentFilePath) {
|
|
@@ -1116,9 +1073,9 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
1116
1073
|
</button>
|
|
1117
1074
|
</div>
|
|
1118
1075
|
|
|
1119
|
-
<div class="
|
|
1076
|
+
<div class="wwi-controls">
|
|
1120
1077
|
<button
|
|
1121
|
-
class="
|
|
1078
|
+
class="wwi-btn wwi-hide-btn"
|
|
1122
1079
|
@click=${this.hideToolbar}
|
|
1123
1080
|
title="Hide Web Widget Inspector"
|
|
1124
1081
|
aria-label="Hide inspector toolbar">
|
|
@@ -1136,7 +1093,7 @@ var HTMLWebWidgetInspectorElement = class extends LitElement {
|
|
|
1136
1093
|
</svg>
|
|
1137
1094
|
</button>
|
|
1138
1095
|
<button
|
|
1139
|
-
class="
|
|
1096
|
+
class="wwi-btn wwi-toggle-btn"
|
|
1140
1097
|
@click=${this.minimizeToolbar}
|
|
1141
1098
|
title="Minimize Web Widget Inspector"
|
|
1142
1099
|
aria-label="Minimize inspector toolbar">
|
|
@@ -1162,23 +1119,30 @@ HTMLWebWidgetInspectorElement.styles = css`
|
|
|
1162
1119
|
display: contents;
|
|
1163
1120
|
}
|
|
1164
1121
|
|
|
1165
|
-
.
|
|
1166
|
-
.
|
|
1167
|
-
.
|
|
1168
|
-
.
|
|
1169
|
-
font-family:
|
|
1170
|
-
-
|
|
1171
|
-
|
|
1122
|
+
.wwi-toolbar,
|
|
1123
|
+
.wwi-toolbar *,
|
|
1124
|
+
.wwi-tooltip,
|
|
1125
|
+
.wwi-tooltip * {
|
|
1126
|
+
font-family: var(
|
|
1127
|
+
--wwi-font-sans,
|
|
1128
|
+
-apple-system,
|
|
1129
|
+
BlinkMacSystemFont,
|
|
1130
|
+
'Segoe UI',
|
|
1131
|
+
Roboto,
|
|
1132
|
+
'Helvetica Neue',
|
|
1133
|
+
Arial,
|
|
1134
|
+
sans-serif
|
|
1135
|
+
);
|
|
1172
1136
|
}
|
|
1173
1137
|
|
|
1174
|
-
.
|
|
1138
|
+
.wwi-toolbar {
|
|
1175
1139
|
display: flex;
|
|
1176
1140
|
align-items: center;
|
|
1177
1141
|
gap: 0.75rem;
|
|
1178
1142
|
position: fixed;
|
|
1179
1143
|
bottom: 1rem;
|
|
1180
1144
|
left: 1rem;
|
|
1181
|
-
z-index: ${
|
|
1145
|
+
z-index: ${DESIGN_SYSTEM.zIndex.TOOLBAR};
|
|
1182
1146
|
background: var(--wwi-bg, rgba(255, 255, 255, 0.95));
|
|
1183
1147
|
color: var(--wwi-fg, #222);
|
|
1184
1148
|
padding: 0.75rem 1rem;
|
|
@@ -1187,89 +1151,93 @@ HTMLWebWidgetInspectorElement.styles = css`
|
|
|
1187
1151
|
box-shadow:
|
|
1188
1152
|
0 1px 3px 0 rgba(0, 0, 0, 0.1),
|
|
1189
1153
|
0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
|
1190
|
-
font-family:
|
|
1191
|
-
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1154
|
+
font-family: var(
|
|
1155
|
+
--wwi-font-sans,
|
|
1156
|
+
-apple-system,
|
|
1157
|
+
BlinkMacSystemFont,
|
|
1158
|
+
'Segoe UI',
|
|
1159
|
+
Roboto,
|
|
1160
|
+
'Helvetica Neue',
|
|
1161
|
+
Arial,
|
|
1162
|
+
sans-serif
|
|
1163
|
+
);
|
|
1164
|
+
font-size: 0.75rem;
|
|
1194
1165
|
min-width: max-content;
|
|
1195
1166
|
transition: all 0.2s;
|
|
1196
1167
|
backdrop-filter: blur(8px);
|
|
1197
1168
|
}
|
|
1198
1169
|
|
|
1199
|
-
.
|
|
1200
|
-
padding: 0
|
|
1201
|
-
gap: 0
|
|
1202
|
-
min-width: 0
|
|
1203
|
-
width: 32px
|
|
1204
|
-
height: 32px
|
|
1205
|
-
background: var(--wwi-bg, rgba(255, 255, 255, 0.95))
|
|
1206
|
-
border: 1px solid var(--wwi-border, #e5e7eb)
|
|
1207
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06)
|
|
1208
|
-
border-radius: 50
|
|
1209
|
-
cursor: pointer
|
|
1210
|
-
justify-content: center
|
|
1211
|
-
align-items: center
|
|
1212
|
-
display: flex
|
|
1170
|
+
.wwi-toolbar[data-minimized='true'] {
|
|
1171
|
+
padding: 0;
|
|
1172
|
+
gap: 0;
|
|
1173
|
+
min-width: 0;
|
|
1174
|
+
width: 32px;
|
|
1175
|
+
height: 32px;
|
|
1176
|
+
background: var(--wwi-bg, rgba(255, 255, 255, 0.95));
|
|
1177
|
+
border: 1px solid var(--wwi-border, #e5e7eb);
|
|
1178
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
|
1179
|
+
border-radius: 50%;
|
|
1180
|
+
cursor: pointer;
|
|
1181
|
+
justify-content: center;
|
|
1182
|
+
align-items: center;
|
|
1183
|
+
display: flex;
|
|
1213
1184
|
transition:
|
|
1214
1185
|
background 0.2s,
|
|
1215
|
-
border 0.2s
|
|
1186
|
+
border 0.2s;
|
|
1216
1187
|
}
|
|
1217
1188
|
|
|
1218
|
-
.
|
|
1219
|
-
background: var(--wwi-bg, rgba(255, 255, 255, 0.98))
|
|
1220
|
-
border: 1px solid var(--wwi-border, #e5e7eb)
|
|
1221
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08)
|
|
1189
|
+
.wwi-toolbar[data-minimized='true']:hover {
|
|
1190
|
+
background: var(--wwi-bg, rgba(255, 255, 255, 0.98));
|
|
1191
|
+
border: 1px solid var(--wwi-border, #e5e7eb);
|
|
1192
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
1222
1193
|
}
|
|
1223
1194
|
|
|
1224
|
-
.
|
|
1225
|
-
display: flex
|
|
1226
|
-
flex: 1 1 auto
|
|
1227
|
-
align-items: center
|
|
1228
|
-
justify-content: center
|
|
1229
|
-
padding: 0
|
|
1230
|
-
margin: 0
|
|
1231
|
-
height: 100
|
|
1195
|
+
.wwi-toolbar[data-minimized='true'] .wwi-header {
|
|
1196
|
+
display: flex;
|
|
1197
|
+
flex: 1 1 auto;
|
|
1198
|
+
align-items: center;
|
|
1199
|
+
justify-content: center;
|
|
1200
|
+
padding: 0;
|
|
1201
|
+
margin: 0;
|
|
1202
|
+
height: 100%;
|
|
1232
1203
|
}
|
|
1233
1204
|
|
|
1234
|
-
.
|
|
1235
|
-
display: flex
|
|
1236
|
-
align-items: center
|
|
1237
|
-
justify-content: center
|
|
1238
|
-
width: 100
|
|
1239
|
-
height: 100
|
|
1240
|
-
margin: 0
|
|
1241
|
-
padding: 0
|
|
1205
|
+
.wwi-toolbar[data-minimized='true'] .wwi-logo {
|
|
1206
|
+
display: flex;
|
|
1207
|
+
align-items: center;
|
|
1208
|
+
justify-content: center;
|
|
1209
|
+
width: 100%;
|
|
1210
|
+
height: 100%;
|
|
1211
|
+
margin: 0;
|
|
1212
|
+
padding: 0;
|
|
1242
1213
|
}
|
|
1243
1214
|
|
|
1244
|
-
.
|
|
1245
|
-
margin: 0
|
|
1246
|
-
width: 16px
|
|
1247
|
-
height: 16px
|
|
1248
|
-
display: block
|
|
1249
|
-
opacity: 0.7
|
|
1250
|
-
filter: none
|
|
1251
|
-
transition: opacity 0.2s
|
|
1215
|
+
.wwi-toolbar[data-minimized='true'] .wwi-logo svg {
|
|
1216
|
+
margin: 0;
|
|
1217
|
+
width: 16px;
|
|
1218
|
+
height: 16px;
|
|
1219
|
+
display: block;
|
|
1220
|
+
opacity: 0.7;
|
|
1221
|
+
filter: none;
|
|
1222
|
+
transition: opacity 0.2s;
|
|
1252
1223
|
}
|
|
1253
1224
|
|
|
1254
|
-
.
|
|
1255
|
-
opacity: 1
|
|
1256
|
-
filter: none
|
|
1225
|
+
.wwi-toolbar[data-minimized='true']:hover .wwi-logo svg {
|
|
1226
|
+
opacity: 1;
|
|
1227
|
+
filter: none;
|
|
1257
1228
|
}
|
|
1258
1229
|
|
|
1259
|
-
.
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
.
|
|
1264
|
-
|
|
1265
|
-
.inspector-toolbar[data-minimized='true'] .inspector-actions,
|
|
1266
|
-
.inspector-toolbar[data-minimized='true'] .inspector-controls {
|
|
1267
|
-
display: none !important;
|
|
1230
|
+
.wwi-toolbar[data-minimized='true'] .wwi-header .wwi-logo span,
|
|
1231
|
+
.wwi-toolbar[data-minimized='true'] .wwi-logo .logo-text,
|
|
1232
|
+
.wwi-toolbar[data-minimized='true'] .wwi-info,
|
|
1233
|
+
.wwi-toolbar[data-minimized='true'] .wwi-actions,
|
|
1234
|
+
.wwi-toolbar[data-minimized='true'] .wwi-controls {
|
|
1235
|
+
display: none;
|
|
1268
1236
|
}
|
|
1269
1237
|
|
|
1270
|
-
.
|
|
1238
|
+
.wwi-overlay {
|
|
1271
1239
|
position: fixed;
|
|
1272
|
-
z-index: ${
|
|
1240
|
+
z-index: ${DESIGN_SYSTEM.zIndex.OVERLAY};
|
|
1273
1241
|
pointer-events: none;
|
|
1274
1242
|
background: repeating-linear-gradient(
|
|
1275
1243
|
45deg,
|
|
@@ -1283,19 +1251,19 @@ HTMLWebWidgetInspectorElement.styles = css`
|
|
|
1283
1251
|
box-sizing: border-box;
|
|
1284
1252
|
}
|
|
1285
1253
|
|
|
1286
|
-
.
|
|
1254
|
+
.wwi-tooltip {
|
|
1287
1255
|
/* Styles dynamically injected by ensureTooltipStyles */
|
|
1288
|
-
|
|
1256
|
+
visibility: hidden;
|
|
1289
1257
|
}
|
|
1290
1258
|
|
|
1291
|
-
.
|
|
1259
|
+
.wwi-header {
|
|
1292
1260
|
display: flex;
|
|
1293
1261
|
align-items: center;
|
|
1294
1262
|
gap: 0.375rem;
|
|
1295
1263
|
padding-right: 0.5rem;
|
|
1296
1264
|
}
|
|
1297
1265
|
|
|
1298
|
-
.
|
|
1266
|
+
.wwi-logo {
|
|
1299
1267
|
display: flex;
|
|
1300
1268
|
align-items: center;
|
|
1301
1269
|
gap: 0.375rem;
|
|
@@ -1305,7 +1273,7 @@ HTMLWebWidgetInspectorElement.styles = css`
|
|
|
1305
1273
|
user-select: none;
|
|
1306
1274
|
}
|
|
1307
1275
|
|
|
1308
|
-
.
|
|
1276
|
+
.wwi-logo svg {
|
|
1309
1277
|
cursor: pointer;
|
|
1310
1278
|
color: var(--wwi-accent, #888);
|
|
1311
1279
|
width: 16px;
|
|
@@ -1338,11 +1306,11 @@ HTMLWebWidgetInspectorElement.styles = css`
|
|
|
1338
1306
|
text-transform: uppercase;
|
|
1339
1307
|
}
|
|
1340
1308
|
|
|
1341
|
-
.
|
|
1309
|
+
.wwi-info {
|
|
1342
1310
|
display: flex;
|
|
1343
1311
|
align-items: center;
|
|
1344
1312
|
gap: 0.5rem;
|
|
1345
|
-
font-size: 0.
|
|
1313
|
+
font-size: 0.75rem;
|
|
1346
1314
|
color: var(--wwi-fg, #222);
|
|
1347
1315
|
opacity: 0.7;
|
|
1348
1316
|
}
|
|
@@ -1352,19 +1320,19 @@ HTMLWebWidgetInspectorElement.styles = css`
|
|
|
1352
1320
|
font-weight: 500;
|
|
1353
1321
|
}
|
|
1354
1322
|
|
|
1355
|
-
.
|
|
1323
|
+
.wwi-actions {
|
|
1356
1324
|
display: flex;
|
|
1357
1325
|
align-items: center;
|
|
1358
1326
|
gap: 0.375rem;
|
|
1359
1327
|
}
|
|
1360
1328
|
|
|
1361
|
-
.
|
|
1329
|
+
.wwi-controls {
|
|
1362
1330
|
display: flex;
|
|
1363
1331
|
align-items: center;
|
|
1364
1332
|
gap: 0.125rem;
|
|
1365
1333
|
}
|
|
1366
1334
|
|
|
1367
|
-
.
|
|
1335
|
+
.wwi-btn {
|
|
1368
1336
|
display: flex;
|
|
1369
1337
|
align-items: center;
|
|
1370
1338
|
gap: 0.25rem;
|
|
@@ -1375,65 +1343,31 @@ HTMLWebWidgetInspectorElement.styles = css`
|
|
|
1375
1343
|
border-radius: 0.25rem;
|
|
1376
1344
|
cursor: pointer;
|
|
1377
1345
|
transition: all 0.15s ease;
|
|
1378
|
-
font-size: 0.
|
|
1346
|
+
font-size: 0.75rem;
|
|
1379
1347
|
font-weight: 500;
|
|
1380
1348
|
white-space: nowrap;
|
|
1381
1349
|
opacity: 0.8;
|
|
1382
1350
|
}
|
|
1383
1351
|
|
|
1384
|
-
.
|
|
1352
|
+
.wwi-btn:hover {
|
|
1385
1353
|
background: rgba(0, 0, 0, 0.12);
|
|
1386
1354
|
border-color: rgba(0, 0, 0, 0.2);
|
|
1387
1355
|
color: var(--wwi-fg, #111);
|
|
1388
1356
|
opacity: 1;
|
|
1389
|
-
transform: translateY(-1px);
|
|
1390
1357
|
box-shadow:
|
|
1391
1358
|
0 1px 3px 0 rgba(0, 0, 0, 0.1),
|
|
1392
1359
|
0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
|
1393
1360
|
}
|
|
1394
1361
|
|
|
1395
|
-
.
|
|
1396
|
-
background: rgba(
|
|
1397
|
-
border-color:
|
|
1398
|
-
|
|
1399
|
-
box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
|
|
1362
|
+
.wwi-btn[data-selected='true'] {
|
|
1363
|
+
background: rgba(34, 197, 94, 0.15);
|
|
1364
|
+
border-color: #22c55e;
|
|
1365
|
+
box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
|
|
1400
1366
|
opacity: 1;
|
|
1401
1367
|
position: relative;
|
|
1402
1368
|
}
|
|
1403
1369
|
|
|
1404
|
-
.
|
|
1405
|
-
content: '';
|
|
1406
|
-
position: absolute;
|
|
1407
|
-
top: -2px;
|
|
1408
|
-
left: -2px;
|
|
1409
|
-
right: -2px;
|
|
1410
|
-
bottom: -2px;
|
|
1411
|
-
background: linear-gradient(
|
|
1412
|
-
45deg,
|
|
1413
|
-
rgba(102, 126, 234, 0.3),
|
|
1414
|
-
rgba(102, 126, 234, 0.1)
|
|
1415
|
-
);
|
|
1416
|
-
border-radius: 0.375rem;
|
|
1417
|
-
z-index: -1;
|
|
1418
|
-
animation: pulse 2s infinite;
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
@keyframes pulse {
|
|
1422
|
-
0%,
|
|
1423
|
-
100% {
|
|
1424
|
-
opacity: 0.6;
|
|
1425
|
-
}
|
|
1426
|
-
50% {
|
|
1427
|
-
opacity: 1;
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
.inspector-btn[data-selected='true'] svg {
|
|
1432
|
-
stroke: rgba(102, 126, 234, 1);
|
|
1433
|
-
filter: drop-shadow(0 0 2px rgba(102, 126, 234, 0.3));
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
.inspector-btn svg {
|
|
1370
|
+
.wwi-btn svg {
|
|
1437
1371
|
flex-shrink: 0;
|
|
1438
1372
|
width: 14px;
|
|
1439
1373
|
height: 14px;
|
|
@@ -1441,73 +1375,22 @@ HTMLWebWidgetInspectorElement.styles = css`
|
|
|
1441
1375
|
opacity: 0.9;
|
|
1442
1376
|
}
|
|
1443
1377
|
|
|
1444
|
-
.
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
0 2px 8px rgba(0, 0, 0, 0.06),
|
|
1448
|
-
0 0 0 1px rgba(102, 126, 234, 0.2);
|
|
1449
|
-
background: var(--wwi-bg, rgba(255, 255, 255, 0.98));
|
|
1378
|
+
.wwi-controls .wwi-btn {
|
|
1379
|
+
padding: 0.25rem;
|
|
1380
|
+
border-radius: 50%;
|
|
1450
1381
|
}
|
|
1451
1382
|
|
|
1452
|
-
.
|
|
1453
|
-
|
|
1454
|
-
position: absolute;
|
|
1455
|
-
top: -1px;
|
|
1456
|
-
left: -1px;
|
|
1457
|
-
right: -1px;
|
|
1458
|
-
bottom: -1px;
|
|
1459
|
-
background: linear-gradient(
|
|
1460
|
-
45deg,
|
|
1461
|
-
rgba(102, 126, 234, 0.1),
|
|
1462
|
-
rgba(102, 126, 234, 0.05)
|
|
1463
|
-
);
|
|
1464
|
-
border-radius: 0.5rem;
|
|
1465
|
-
z-index: -1;
|
|
1466
|
-
animation: toolbar-pulse 3s infinite;
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
@keyframes toolbar-pulse {
|
|
1470
|
-
0%,
|
|
1471
|
-
100% {
|
|
1472
|
-
opacity: 0.3;
|
|
1473
|
-
}
|
|
1474
|
-
50% {
|
|
1475
|
-
opacity: 0.6;
|
|
1476
|
-
}
|
|
1383
|
+
.wwi-toolbar[data-inspector-active='true'] {
|
|
1384
|
+
background: var(--wwi-bg, rgba(255, 255, 255, 0.98));
|
|
1477
1385
|
}
|
|
1478
1386
|
|
|
1479
1387
|
@media (max-width: 768px) {
|
|
1480
|
-
.
|
|
1388
|
+
.wwi-toolbar {
|
|
1481
1389
|
bottom: 0.75rem;
|
|
1482
1390
|
left: 0.75rem;
|
|
1483
1391
|
right: 0.75rem;
|
|
1484
1392
|
flex-wrap: wrap;
|
|
1485
1393
|
max-width: calc(100vw - 1.25rem);
|
|
1486
|
-
padding: 0.75rem 1rem;
|
|
1487
|
-
gap: 0.75rem;
|
|
1488
|
-
}
|
|
1489
|
-
|
|
1490
|
-
.inspector-btn {
|
|
1491
|
-
padding: 0.75rem 0.75rem;
|
|
1492
|
-
font-size: 0.875rem;
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
.inspector-info {
|
|
1496
|
-
font-size: 0.875rem;
|
|
1497
|
-
}
|
|
1498
|
-
|
|
1499
|
-
.logo-text {
|
|
1500
|
-
gap: 0.1rem;
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
|
-
.logo-title {
|
|
1504
|
-
font-size: 0.6rem;
|
|
1505
|
-
letter-spacing: 0.04em;
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
|
-
.logo-subtitle {
|
|
1509
|
-
font-size: 0.45rem;
|
|
1510
|
-
letter-spacing: 0.12em;
|
|
1511
1394
|
}
|
|
1512
1395
|
}
|
|
1513
1396
|
`;
|