@spektre/veil 0.1.8 → 0.1.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/dist/devUI.d.ts +1 -1
- package/dist/index.esm.js +63 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +63 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/devUI.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { createContext, useState, useEffect, useContext } from 'react';
|
|
2
2
|
|
|
3
3
|
const DEV_UI_STORAGE_KEY = 'spektre_dev_enabled';
|
|
4
|
+
let DEV_UI_VERSION = '1.0.0';
|
|
4
5
|
// Inject styles directly into the document
|
|
5
6
|
function injectDevUIStyles() {
|
|
6
7
|
if (document.getElementById('spektre-dev-ui-styles')) {
|
|
@@ -93,6 +94,8 @@ function injectDevUIStyles() {
|
|
|
93
94
|
max-width: 400px;
|
|
94
95
|
overflow: hidden;
|
|
95
96
|
animation: spektre-slide-up 0.3s ease;
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
@keyframes spektre-slide-up {
|
|
@@ -112,7 +115,6 @@ function injectDevUIStyles() {
|
|
|
112
115
|
justify-content: space-between;
|
|
113
116
|
align-items: center;
|
|
114
117
|
padding: 20px;
|
|
115
|
-
border-bottom: 1px solid #1e293b;
|
|
116
118
|
background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(0, 0, 0, 0.5) 100%);
|
|
117
119
|
}
|
|
118
120
|
|
|
@@ -151,6 +153,7 @@ function injectDevUIStyles() {
|
|
|
151
153
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
152
154
|
max-height: 60vh;
|
|
153
155
|
overflow-y: auto;
|
|
156
|
+
flex: 1;
|
|
154
157
|
}
|
|
155
158
|
|
|
156
159
|
.spektre-dev-modal-info {
|
|
@@ -303,6 +306,26 @@ function injectDevUIStyles() {
|
|
|
303
306
|
font-weight: 500;
|
|
304
307
|
}
|
|
305
308
|
|
|
309
|
+
/* Modal Footer */
|
|
310
|
+
.spektre-dev-modal-footer {
|
|
311
|
+
display: flex;
|
|
312
|
+
justify-content: space-between;
|
|
313
|
+
align-items: center;
|
|
314
|
+
padding: 16px 24px;
|
|
315
|
+
background-color: #000000;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.spektre-dev-modal-version {
|
|
319
|
+
font-size: 12px;
|
|
320
|
+
color: #64748b;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.spektre-dev-modal-footer-controls {
|
|
324
|
+
display: flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
gap: 12px;
|
|
327
|
+
}
|
|
328
|
+
|
|
306
329
|
/* Accessibility */
|
|
307
330
|
@media (prefers-reduced-motion: reduce) {
|
|
308
331
|
.spektre-dev-dot,
|
|
@@ -343,6 +366,12 @@ function injectDevUIStyles() {
|
|
|
343
366
|
.spektre-dev-modal-body {
|
|
344
367
|
padding: 16px;
|
|
345
368
|
}
|
|
369
|
+
|
|
370
|
+
.spektre-dev-modal-footer {
|
|
371
|
+
flex-direction: column;
|
|
372
|
+
gap: 12px;
|
|
373
|
+
padding: 12px 16px;
|
|
374
|
+
}
|
|
346
375
|
}
|
|
347
376
|
`;
|
|
348
377
|
document.head.appendChild(styleSheet);
|
|
@@ -406,7 +435,11 @@ function runSecurityScan() {
|
|
|
406
435
|
issues,
|
|
407
436
|
};
|
|
408
437
|
}
|
|
409
|
-
function initializeDevUI() {
|
|
438
|
+
function initializeDevUI(version) {
|
|
439
|
+
// Set version if provided
|
|
440
|
+
{
|
|
441
|
+
DEV_UI_VERSION = version;
|
|
442
|
+
}
|
|
410
443
|
// Inject styles first
|
|
411
444
|
injectDevUIStyles();
|
|
412
445
|
// Check if Spektre is enabled in localStorage (default to true)
|
|
@@ -418,18 +451,20 @@ function initializeDevUI() {
|
|
|
418
451
|
}
|
|
419
452
|
// Create and inject the orange dot
|
|
420
453
|
createDevDot();
|
|
421
|
-
//
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
dot
|
|
454
|
+
// Only run security scan if Spektre is enabled
|
|
455
|
+
if (spektreEnabled) {
|
|
456
|
+
setTimeout(() => {
|
|
457
|
+
const scanResult = runSecurityScan();
|
|
458
|
+
if (scanResult.hasIssues) {
|
|
459
|
+
// Update dot to warning state and auto-open modal
|
|
460
|
+
const dot = document.getElementById('spektre-dev-dot');
|
|
461
|
+
if (dot) {
|
|
462
|
+
dot.classList.add('warning');
|
|
463
|
+
}
|
|
464
|
+
openDevModal(scanResult);
|
|
429
465
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}, 500);
|
|
466
|
+
}, 500);
|
|
467
|
+
}
|
|
433
468
|
}
|
|
434
469
|
function createDevDot() {
|
|
435
470
|
const dot = document.createElement('div');
|
|
@@ -537,6 +572,18 @@ function openDevModal(scanResult) {
|
|
|
537
572
|
}
|
|
538
573
|
modalContent.appendChild(header);
|
|
539
574
|
modalContent.appendChild(body);
|
|
575
|
+
// Create footer with version on left and toggle on right
|
|
576
|
+
const footer = document.createElement('div');
|
|
577
|
+
footer.className = 'spektre-dev-modal-footer';
|
|
578
|
+
const versionLabel = document.createElement('div');
|
|
579
|
+
versionLabel.className = 'spektre-dev-modal-version';
|
|
580
|
+
versionLabel.textContent = `Spektre v${DEV_UI_VERSION}`;
|
|
581
|
+
const footerControls = document.createElement('div');
|
|
582
|
+
footerControls.className = 'spektre-dev-modal-footer-controls';
|
|
583
|
+
footerControls.appendChild(toggleLabel);
|
|
584
|
+
footer.appendChild(versionLabel);
|
|
585
|
+
footer.appendChild(footerControls);
|
|
586
|
+
modalContent.appendChild(footer);
|
|
540
587
|
modal.appendChild(modalContent);
|
|
541
588
|
// Close on overlay click
|
|
542
589
|
modal.addEventListener('click', (e) => {
|
|
@@ -993,9 +1040,11 @@ const useProtectedFetch = () => {
|
|
|
993
1040
|
return protectedFetch;
|
|
994
1041
|
};
|
|
995
1042
|
|
|
1043
|
+
// Manually set version - update this with each release
|
|
1044
|
+
const packageVersion = '0.1.11';
|
|
996
1045
|
// Check if we're in an iframe (development environment) and initialize dev UI
|
|
997
1046
|
if (typeof window !== 'undefined' && window.self !== window.top) {
|
|
998
|
-
initializeDevUI();
|
|
1047
|
+
initializeDevUI(packageVersion);
|
|
999
1048
|
}
|
|
1000
1049
|
|
|
1001
1050
|
export { SecurityGate, SpektreContext, SpektreProvider, useProtectedFetch, useSpektre };
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
|
|
5
5
|
const DEV_UI_STORAGE_KEY = 'spektre_dev_enabled';
|
|
6
|
+
let DEV_UI_VERSION = '1.0.0';
|
|
6
7
|
// Inject styles directly into the document
|
|
7
8
|
function injectDevUIStyles() {
|
|
8
9
|
if (document.getElementById('spektre-dev-ui-styles')) {
|
|
@@ -95,6 +96,8 @@ function injectDevUIStyles() {
|
|
|
95
96
|
max-width: 400px;
|
|
96
97
|
overflow: hidden;
|
|
97
98
|
animation: spektre-slide-up 0.3s ease;
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
98
101
|
}
|
|
99
102
|
|
|
100
103
|
@keyframes spektre-slide-up {
|
|
@@ -114,7 +117,6 @@ function injectDevUIStyles() {
|
|
|
114
117
|
justify-content: space-between;
|
|
115
118
|
align-items: center;
|
|
116
119
|
padding: 20px;
|
|
117
|
-
border-bottom: 1px solid #1e293b;
|
|
118
120
|
background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(0, 0, 0, 0.5) 100%);
|
|
119
121
|
}
|
|
120
122
|
|
|
@@ -153,6 +155,7 @@ function injectDevUIStyles() {
|
|
|
153
155
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
154
156
|
max-height: 60vh;
|
|
155
157
|
overflow-y: auto;
|
|
158
|
+
flex: 1;
|
|
156
159
|
}
|
|
157
160
|
|
|
158
161
|
.spektre-dev-modal-info {
|
|
@@ -305,6 +308,26 @@ function injectDevUIStyles() {
|
|
|
305
308
|
font-weight: 500;
|
|
306
309
|
}
|
|
307
310
|
|
|
311
|
+
/* Modal Footer */
|
|
312
|
+
.spektre-dev-modal-footer {
|
|
313
|
+
display: flex;
|
|
314
|
+
justify-content: space-between;
|
|
315
|
+
align-items: center;
|
|
316
|
+
padding: 16px 24px;
|
|
317
|
+
background-color: #000000;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.spektre-dev-modal-version {
|
|
321
|
+
font-size: 12px;
|
|
322
|
+
color: #64748b;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.spektre-dev-modal-footer-controls {
|
|
326
|
+
display: flex;
|
|
327
|
+
align-items: center;
|
|
328
|
+
gap: 12px;
|
|
329
|
+
}
|
|
330
|
+
|
|
308
331
|
/* Accessibility */
|
|
309
332
|
@media (prefers-reduced-motion: reduce) {
|
|
310
333
|
.spektre-dev-dot,
|
|
@@ -345,6 +368,12 @@ function injectDevUIStyles() {
|
|
|
345
368
|
.spektre-dev-modal-body {
|
|
346
369
|
padding: 16px;
|
|
347
370
|
}
|
|
371
|
+
|
|
372
|
+
.spektre-dev-modal-footer {
|
|
373
|
+
flex-direction: column;
|
|
374
|
+
gap: 12px;
|
|
375
|
+
padding: 12px 16px;
|
|
376
|
+
}
|
|
348
377
|
}
|
|
349
378
|
`;
|
|
350
379
|
document.head.appendChild(styleSheet);
|
|
@@ -408,7 +437,11 @@ function runSecurityScan() {
|
|
|
408
437
|
issues,
|
|
409
438
|
};
|
|
410
439
|
}
|
|
411
|
-
function initializeDevUI() {
|
|
440
|
+
function initializeDevUI(version) {
|
|
441
|
+
// Set version if provided
|
|
442
|
+
{
|
|
443
|
+
DEV_UI_VERSION = version;
|
|
444
|
+
}
|
|
412
445
|
// Inject styles first
|
|
413
446
|
injectDevUIStyles();
|
|
414
447
|
// Check if Spektre is enabled in localStorage (default to true)
|
|
@@ -420,18 +453,20 @@ function initializeDevUI() {
|
|
|
420
453
|
}
|
|
421
454
|
// Create and inject the orange dot
|
|
422
455
|
createDevDot();
|
|
423
|
-
//
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
dot
|
|
456
|
+
// Only run security scan if Spektre is enabled
|
|
457
|
+
if (spektreEnabled) {
|
|
458
|
+
setTimeout(() => {
|
|
459
|
+
const scanResult = runSecurityScan();
|
|
460
|
+
if (scanResult.hasIssues) {
|
|
461
|
+
// Update dot to warning state and auto-open modal
|
|
462
|
+
const dot = document.getElementById('spektre-dev-dot');
|
|
463
|
+
if (dot) {
|
|
464
|
+
dot.classList.add('warning');
|
|
465
|
+
}
|
|
466
|
+
openDevModal(scanResult);
|
|
431
467
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}, 500);
|
|
468
|
+
}, 500);
|
|
469
|
+
}
|
|
435
470
|
}
|
|
436
471
|
function createDevDot() {
|
|
437
472
|
const dot = document.createElement('div');
|
|
@@ -539,6 +574,18 @@ function openDevModal(scanResult) {
|
|
|
539
574
|
}
|
|
540
575
|
modalContent.appendChild(header);
|
|
541
576
|
modalContent.appendChild(body);
|
|
577
|
+
// Create footer with version on left and toggle on right
|
|
578
|
+
const footer = document.createElement('div');
|
|
579
|
+
footer.className = 'spektre-dev-modal-footer';
|
|
580
|
+
const versionLabel = document.createElement('div');
|
|
581
|
+
versionLabel.className = 'spektre-dev-modal-version';
|
|
582
|
+
versionLabel.textContent = `Spektre v${DEV_UI_VERSION}`;
|
|
583
|
+
const footerControls = document.createElement('div');
|
|
584
|
+
footerControls.className = 'spektre-dev-modal-footer-controls';
|
|
585
|
+
footerControls.appendChild(toggleLabel);
|
|
586
|
+
footer.appendChild(versionLabel);
|
|
587
|
+
footer.appendChild(footerControls);
|
|
588
|
+
modalContent.appendChild(footer);
|
|
542
589
|
modal.appendChild(modalContent);
|
|
543
590
|
// Close on overlay click
|
|
544
591
|
modal.addEventListener('click', (e) => {
|
|
@@ -995,9 +1042,11 @@ const useProtectedFetch = () => {
|
|
|
995
1042
|
return protectedFetch;
|
|
996
1043
|
};
|
|
997
1044
|
|
|
1045
|
+
// Manually set version - update this with each release
|
|
1046
|
+
const packageVersion = '0.1.11';
|
|
998
1047
|
// Check if we're in an iframe (development environment) and initialize dev UI
|
|
999
1048
|
if (typeof window !== 'undefined' && window.self !== window.top) {
|
|
1000
|
-
initializeDevUI();
|
|
1049
|
+
initializeDevUI(packageVersion);
|
|
1001
1050
|
}
|
|
1002
1051
|
|
|
1003
1052
|
exports.SecurityGate = SecurityGate;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|