@nine-lab/nine-mu 0.1.26 → 0.1.28
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/css/nine-mu.css +148 -0
- package/dist/nine-mu.js +9 -21
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +1 -1
- package/dist/nine-mu.umd.js.map +1 -1
- package/package.json +1 -1
- package/public/css/nine-mu.css +148 -0
- package/src/components/NineDiff.js +0 -6
- package/src/components/NineDiffContainer.js +6 -17
package/package.json
CHANGED
package/public/css/nine-mu.css
CHANGED
|
@@ -793,4 +793,152 @@
|
|
|
793
793
|
object-fit: contain; /* 비율 유지하며 꽉 채우기 */
|
|
794
794
|
filter: invert(0.8);
|
|
795
795
|
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
:host(nine-diff-popup) {
|
|
801
|
+
|
|
802
|
+
div.buttons {
|
|
803
|
+
position: absolute;
|
|
804
|
+
right: 16px;
|
|
805
|
+
/* width: 100px; */
|
|
806
|
+
display: flex;
|
|
807
|
+
flex-direction: row;
|
|
808
|
+
justify-content: flex-end;
|
|
809
|
+
z-index: 1;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
button.save {
|
|
813
|
+
cursor: pointer;
|
|
814
|
+
outline: none;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
:host(nine-diff-container) {
|
|
819
|
+
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
:host(nine-diff) {
|
|
823
|
+
width: 100%;
|
|
824
|
+
height: 100%;
|
|
825
|
+
|
|
826
|
+
.wrapper {
|
|
827
|
+
display: flex;
|
|
828
|
+
position: relative;
|
|
829
|
+
--gap: 8px;
|
|
830
|
+
--font-family: monospace;
|
|
831
|
+
height: 100%;
|
|
832
|
+
}
|
|
833
|
+
.panel {
|
|
834
|
+
width: 50%;
|
|
835
|
+
border: 1px solid #ccc;
|
|
836
|
+
--padding: 8px;
|
|
837
|
+
overflow: auto;
|
|
838
|
+
white-space: pre-wrap;
|
|
839
|
+
text-align: left;
|
|
840
|
+
display: flex;
|
|
841
|
+
justify-content: flex-start; /* 좌측 정렬 */
|
|
842
|
+
align-items: flex-start; /* 상단 정렬 */
|
|
843
|
+
flex-direction: column;
|
|
844
|
+
box-sizing: border-box;
|
|
845
|
+
}
|
|
846
|
+
.panel pre {
|
|
847
|
+
margin: 0;
|
|
848
|
+
--padding: 8px;
|
|
849
|
+
text-align: left;
|
|
850
|
+
white-space: pre-wrap;
|
|
851
|
+
word-break: break-word;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
.cm-editor {
|
|
855
|
+
height: 100%;
|
|
856
|
+
width: 100%;
|
|
857
|
+
--padding-left: 80px;
|
|
858
|
+
}
|
|
859
|
+
.cm-content { /* CodeMirror 텍스트 내용을 감싸는 내부 div */
|
|
860
|
+
}
|
|
861
|
+
/* 각 라인에 버튼 공간 확보 */
|
|
862
|
+
|
|
863
|
+
/* ideDiff.css */
|
|
864
|
+
|
|
865
|
+
/* 기본적인 CodeMirror 라인 포지셔닝 */
|
|
866
|
+
.cm-line {
|
|
867
|
+
position: relative;
|
|
868
|
+
--display: flex;
|
|
869
|
+
padding-left: 18px;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/* 병합 버튼 컨테이너 */
|
|
873
|
+
.cm-merge-button-container {
|
|
874
|
+
position: absolute;
|
|
875
|
+
height: 16px;
|
|
876
|
+
width: 16px; /* 버튼 너비 고정으로 겹침 방지 */
|
|
877
|
+
left: 2px; /* 라인 번호 영역 바로 옆에 배치. 필요에 따라 조절하세요. */
|
|
878
|
+
top: 50%;
|
|
879
|
+
transform: translateY(-50%);
|
|
880
|
+
--z-index: 1; /* 다른 요소 위에 표시되도록 Z-index를 높게 설정 */
|
|
881
|
+
display: flex;
|
|
882
|
+
--gap: 5px;
|
|
883
|
+
justify-content: center; /* 버튼 중앙 정렬 */
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
/* 병합 버튼 기본 스타일 */
|
|
887
|
+
.cm-merge-button {
|
|
888
|
+
--margin: 2px 0;
|
|
889
|
+
width: 100%;
|
|
890
|
+
border: none;
|
|
891
|
+
border-radius: 3px;
|
|
892
|
+
cursor: pointer;
|
|
893
|
+
opacity: 0.7; /* 기본적으로 약간 투명하게 */
|
|
894
|
+
transition: opacity 0.2s ease-in-out; /* 호버 시 부드러운 전환 */
|
|
895
|
+
background-repeat: no-repeat;
|
|
896
|
+
background-position: center;
|
|
897
|
+
background-size: auto;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/* 호버 시 버튼 불투명도 증가 */
|
|
901
|
+
.cm-merge-button:hover {
|
|
902
|
+
opacity: 1;
|
|
903
|
+
background-color: #e0e0e0;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
/* AI 추천을 현재 소스에 '적용'하는 버튼 (오른쪽 TOBE 에디터에 붙음) */
|
|
907
|
+
.cm-merge-button.accept {
|
|
908
|
+
background-color: #4CAF50; /* 녹색 */
|
|
909
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" class="bi bi-arrow-left-short" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M12 8a.5.5 0 0 1-.5.5H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5H11.5a.5.5 0 0 1 .5.5"/></svg>');
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
/* AI의 삭제를 현재 소스 기준으로 '되돌리는' 버튼 (왼쪽 ASIS 에디터에 붙음) */
|
|
913
|
+
.cm-merge-button.revert {
|
|
914
|
+
background-color: #f44336; /* 빨간색 */
|
|
915
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" class="bi bi-x" viewBox="0 0 16 16"><path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"/></svg>');
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
/* 삽입된 라인 (AI 추천 소스에 새로 추가된 라인) 배경색 및 경계선 */
|
|
919
|
+
.cm-inserted-line-bg {
|
|
920
|
+
background-color: #e6ffed; /* 연한 녹색 */
|
|
921
|
+
--border-left: 3px solid #66bb6a; /* 진한 녹색 */
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/* 삭제된 라인 (현재 소스에서 AI가 삭제한 것으로 판단된 라인) 배경색 및 경계선 */
|
|
925
|
+
.cm-deleted-line-bg {
|
|
926
|
+
background-color: #ffebe9; /* 연한 빨간색 */
|
|
927
|
+
--border-left: 3px solid #ef5350; /* 진한 빨간색 */
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
/* CodeMirror 선택 영역 배경색 */
|
|
931
|
+
.cm-selectionBackground {
|
|
932
|
+
background-color: #d7d4f9 !important; /* 보라색 계열 */
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/* 텍스트 선택 시 배경색 (브라우저 기본 선택색 재정의) */
|
|
936
|
+
.cm-editor ::selection {
|
|
937
|
+
background-color: #d7d4f9 !important;
|
|
938
|
+
color: inherit !important; /* 텍스트 색상은 유지 */
|
|
939
|
+
}
|
|
940
|
+
.cm-editor::-moz-selection { /* Firefox를 위한 접두사 */
|
|
941
|
+
background-color: #d7d4f9 !important;
|
|
942
|
+
color: inherit !important;
|
|
943
|
+
}
|
|
796
944
|
}
|
|
@@ -191,12 +191,6 @@ export class NineDiff extends HTMLElement {
|
|
|
191
191
|
|
|
192
192
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
193
193
|
|
|
194
|
-
/**
|
|
195
|
-
* nine-ai > nine-ai-diff-popup > nx-tab > nine-ai-diff
|
|
196
|
-
*/
|
|
197
|
-
//this.#host = this.getRootNode().host.getRootNode().host.getRootNode().host;
|
|
198
|
-
|
|
199
|
-
|
|
200
194
|
this.shadowRoot.innerHTML = `
|
|
201
195
|
<style>
|
|
202
196
|
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${__APP_VERSION__}/dist/css/nine-mu.css";
|
|
@@ -31,25 +31,14 @@ export class NineDiffContainer extends HTMLElement {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
render() {
|
|
34
|
+
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
35
|
+
|
|
34
36
|
this.shadowRoot.innerHTML = `
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
width: 100%;
|
|
39
|
-
height: 100%;
|
|
40
|
-
border: 1px solid #ddd;
|
|
41
|
-
background: #fff;
|
|
42
|
-
}
|
|
43
|
-
.diff-wrapper {
|
|
44
|
-
width: 100%;
|
|
45
|
-
height: 100%;
|
|
46
|
-
overflow: hidden;
|
|
47
|
-
}
|
|
48
|
-
nine-diff {
|
|
49
|
-
width: 100%;
|
|
50
|
-
height: 100%;
|
|
51
|
-
}
|
|
37
|
+
<style>
|
|
38
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${__APP_VERSION__}/dist/css/nine-mu.css";
|
|
39
|
+
${customImport}
|
|
52
40
|
</style>
|
|
41
|
+
|
|
53
42
|
<div class="diff-wrapper">
|
|
54
43
|
<nine-diff id="single-diff"></nine-diff>
|
|
55
44
|
</div>
|