sparkecode-devtools 0.1.39 → 0.1.41
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/package.json +1 -1
- package/sparkecode-select.js +54 -39
package/package.json
CHANGED
package/sparkecode-select.js
CHANGED
|
@@ -14,10 +14,13 @@
|
|
|
14
14
|
|
|
15
15
|
const DEFAULT_CONFIG = {
|
|
16
16
|
webhookUrl: null,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
// Colors matched to SparkeCoder web dark theme
|
|
18
|
+
primaryColor: '#91AEFF', // Focus Blue 200
|
|
19
|
+
successColor: '#10B981', // Tests green
|
|
20
|
+
bgColor: '#171717', // Card background
|
|
21
|
+
borderColor: 'rgba(255, 255, 255, 0.1)',
|
|
22
|
+
textColor: '#FAFAFA', // Foreground
|
|
23
|
+
mutedColor: '#A3A3A3', // Muted foreground
|
|
21
24
|
sparkecoder: {
|
|
22
25
|
enabled: false,
|
|
23
26
|
apiBase: null,
|
|
@@ -458,27 +461,35 @@
|
|
|
458
461
|
function createFloatingButton() {
|
|
459
462
|
floatingButton = document.createElement('div');
|
|
460
463
|
floatingButton.id = 'sparkecode-button';
|
|
461
|
-
|
|
464
|
+
// Clean pointer icon + text
|
|
465
|
+
floatingButton.innerHTML = `
|
|
466
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" style="flex-shrink: 0;">
|
|
467
|
+
<path d="M3 1.5L3 12.5L6.5 9L10 14L12 13L8.5 8L13 7.5L3 1.5Z"/>
|
|
468
|
+
</svg>
|
|
469
|
+
<span style="font-weight: 500; font-size: 12px;">SparkeCode Select</span>
|
|
470
|
+
`;
|
|
462
471
|
floatingButton.style.cssText = `
|
|
463
472
|
position: fixed;
|
|
464
473
|
top: ${buttonPos.y}px;
|
|
465
474
|
left: ${buttonPos.x}px;
|
|
466
|
-
height:
|
|
467
|
-
padding: 0
|
|
468
|
-
|
|
469
|
-
|
|
475
|
+
height: 32px;
|
|
476
|
+
padding: 0 10px;
|
|
477
|
+
gap: 6px;
|
|
478
|
+
background: ${config.bgColor};
|
|
479
|
+
border: 1px solid ${config.borderColor};
|
|
480
|
+
border-radius: 6px;
|
|
470
481
|
display: flex;
|
|
471
482
|
align-items: center;
|
|
472
483
|
justify-content: center;
|
|
473
484
|
cursor: grab;
|
|
474
485
|
z-index: 999998;
|
|
475
|
-
box-shadow: 0
|
|
476
|
-
transition:
|
|
477
|
-
color:
|
|
486
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
487
|
+
transition: all 0.15s ease;
|
|
488
|
+
color: ${config.primaryColor};
|
|
478
489
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
479
490
|
user-select: none;
|
|
480
491
|
`;
|
|
481
|
-
floatingButton.title = '
|
|
492
|
+
floatingButton.title = 'Click to toggle • Drag to move';
|
|
482
493
|
|
|
483
494
|
// Drag handling
|
|
484
495
|
floatingButton.addEventListener('mousedown', startDrag);
|
|
@@ -685,17 +696,18 @@
|
|
|
685
696
|
bottom: 20px;
|
|
686
697
|
left: 50%;
|
|
687
698
|
transform: translateX(-50%) translateY(10px);
|
|
688
|
-
background: ${config.
|
|
689
|
-
color:
|
|
690
|
-
padding:
|
|
691
|
-
border-radius:
|
|
699
|
+
background: ${config.bgColor};
|
|
700
|
+
color: ${config.textColor};
|
|
701
|
+
padding: 10px 20px;
|
|
702
|
+
border-radius: 8px;
|
|
703
|
+
border: 1px solid ${config.borderColor};
|
|
692
704
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
693
|
-
font-size:
|
|
694
|
-
font-weight:
|
|
705
|
+
font-size: 13px;
|
|
706
|
+
font-weight: 500;
|
|
695
707
|
z-index: 1000002;
|
|
696
708
|
opacity: 0;
|
|
697
|
-
transition: all 0.
|
|
698
|
-
box-shadow: 0 4px
|
|
709
|
+
transition: all 0.15s ease;
|
|
710
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
|
699
711
|
`;
|
|
700
712
|
toast.textContent = message;
|
|
701
713
|
document.body.appendChild(toast);
|
|
@@ -746,16 +758,16 @@
|
|
|
746
758
|
position: fixed;
|
|
747
759
|
top: 20%;
|
|
748
760
|
left: 50%;
|
|
749
|
-
transform: translateX(-50%) scale(0.
|
|
761
|
+
transform: translateX(-50%) scale(0.98);
|
|
750
762
|
background: ${config.bgColor};
|
|
751
763
|
border-radius: 12px;
|
|
752
764
|
z-index: 1000003;
|
|
753
|
-
box-shadow: 0
|
|
754
|
-
border: 1px solid
|
|
765
|
+
box-shadow: 0 24px 80px rgba(0,0,0,0.6);
|
|
766
|
+
border: 1px solid ${config.borderColor};
|
|
755
767
|
display: none;
|
|
756
768
|
opacity: 0;
|
|
757
769
|
transition: all 0.15s ease;
|
|
758
|
-
width:
|
|
770
|
+
width: 480px;
|
|
759
771
|
max-width: calc(100vw - 32px);
|
|
760
772
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
761
773
|
overflow: hidden;
|
|
@@ -765,15 +777,14 @@
|
|
|
765
777
|
const tag = document.createElement('div');
|
|
766
778
|
tag.id = 'sparkecode-prompt-tag';
|
|
767
779
|
tag.style.cssText = `
|
|
768
|
-
padding:
|
|
769
|
-
|
|
770
|
-
border-bottom: 1px solid rgba(255,255,255,0.05);
|
|
780
|
+
padding: 12px 16px;
|
|
781
|
+
border-bottom: 1px solid ${config.borderColor};
|
|
771
782
|
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
|
|
772
|
-
font-size:
|
|
773
|
-
color: ${config.
|
|
783
|
+
font-size: 12px;
|
|
784
|
+
color: ${config.mutedColor};
|
|
774
785
|
display: flex;
|
|
775
786
|
align-items: center;
|
|
776
|
-
gap:
|
|
787
|
+
gap: 6px;
|
|
777
788
|
`;
|
|
778
789
|
promptBar.appendChild(tag);
|
|
779
790
|
|
|
@@ -781,16 +792,18 @@
|
|
|
781
792
|
const input = document.createElement('input');
|
|
782
793
|
input.id = 'sparkecode-prompt-input';
|
|
783
794
|
input.type = 'text';
|
|
784
|
-
input.placeholder = 'What do you want to do?
|
|
795
|
+
input.placeholder = 'What do you want to do?';
|
|
785
796
|
input.style.cssText = `
|
|
786
797
|
width: 100%;
|
|
787
798
|
background: transparent;
|
|
788
799
|
border: none;
|
|
789
|
-
padding: 16px;
|
|
800
|
+
padding: 14px 16px;
|
|
790
801
|
color: ${config.textColor};
|
|
791
|
-
font-size:
|
|
802
|
+
font-size: 15px;
|
|
792
803
|
outline: none;
|
|
793
804
|
`;
|
|
805
|
+
input.setAttribute('autocomplete', 'off');
|
|
806
|
+
input.setAttribute('spellcheck', 'false');
|
|
794
807
|
input.addEventListener('keydown', (e) => {
|
|
795
808
|
if (e.key === 'Enter') {
|
|
796
809
|
e.preventDefault();
|
|
@@ -814,7 +827,7 @@
|
|
|
814
827
|
// Update tag
|
|
815
828
|
const tag = document.getElementById('sparkecode-prompt-tag');
|
|
816
829
|
if (tag && componentInfo) {
|
|
817
|
-
tag.innerHTML = `<span style="
|
|
830
|
+
tag.innerHTML = `<span style="color: ${config.primaryColor};"><${componentInfo.name}></span>`;
|
|
818
831
|
}
|
|
819
832
|
|
|
820
833
|
const input = document.getElementById('sparkecode-prompt-input');
|
|
@@ -1004,8 +1017,9 @@
|
|
|
1004
1017
|
createOverlay();
|
|
1005
1018
|
|
|
1006
1019
|
if (floatingButton) {
|
|
1007
|
-
floatingButton.style.background = config.
|
|
1008
|
-
floatingButton.style.
|
|
1020
|
+
floatingButton.style.background = config.primaryColor;
|
|
1021
|
+
floatingButton.style.color = '#171717';
|
|
1022
|
+
floatingButton.style.borderColor = config.primaryColor;
|
|
1009
1023
|
}
|
|
1010
1024
|
|
|
1011
1025
|
document.addEventListener('mousemove', handleMouseMove, true);
|
|
@@ -1025,8 +1039,9 @@
|
|
|
1025
1039
|
removeOverlay();
|
|
1026
1040
|
|
|
1027
1041
|
if (floatingButton) {
|
|
1028
|
-
floatingButton.style.background = config.
|
|
1029
|
-
floatingButton.style.
|
|
1042
|
+
floatingButton.style.background = config.bgColor;
|
|
1043
|
+
floatingButton.style.color = config.primaryColor;
|
|
1044
|
+
floatingButton.style.borderColor = config.borderColor;
|
|
1030
1045
|
}
|
|
1031
1046
|
|
|
1032
1047
|
document.removeEventListener('mousemove', handleMouseMove, true);
|