ide-assi 0.558.0 → 0.559.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.
@@ -202994,11 +202994,11 @@ class IdeLoadingTips extends HTMLElement {
202994
202994
  this.#currentTipIndex = Math.floor(Math.random() * this.#tips.length);
202995
202995
  this.stopTips(); // Stop any existing intervals before starting new ones
202996
202996
 
202997
- this.showCurrentTip(); // Display the first tip immediately
202997
+ this.showRandomTip(); // Display the first tip immediately
202998
202998
 
202999
202999
  // Start interval for cycling through tips
203000
203000
  this.#tipIntervalId = setInterval(() => {
203001
- this.showNextTip();
203001
+ this.showRandomTip();
203002
203002
  }, this.#tipDisplayDuration);
203003
203003
 
203004
203004
  //this.loadingAnimation.style.display = 'block'; // Show the loading spinner
@@ -203031,59 +203031,69 @@ class IdeLoadingTips extends HTMLElement {
203031
203031
  }
203032
203032
 
203033
203033
  /**
203034
- * Advances to the next tip and calls showCurrentTip() to display it.
203034
+ * Displays the current tip's text and manages its associated images.
203035
+ */
203036
+ // aiLoadingTips.js (showCurrentTip 메서드 내부)
203037
+
203038
+ /**
203039
+ * Displays a randomly selected tip (excluding the currently displayed one if possible)
203040
+ * and manages its associated images.
203035
203041
  */
203036
- showNextTip() {
203037
- if (this.#tips.length <= 1) {
203038
- // 팁이 하나뿐이거나 없으면 다음 팁을 보여줄 필요가 없음
203039
- this.showCurrentTip(); // 현재 팁을 그냥 다시 표시
203042
+ showRandomTip() {
203043
+ if (this.#tips.length === 0) {
203044
+ this.tipElement.textContent = "";
203045
+ this.tipImageElement.style.display = 'none';
203046
+ this.tipImageContainer.style.display = 'none';
203040
203047
  return;
203041
203048
  }
203042
203049
 
203043
- let nextIndex;
203044
- do {
203045
- nextIndex = Math.floor(Math.random() * this.#tips.length);
203046
- } while (nextIndex === this.#currentTipIndex); // 현재 인덱스와 같으면 다시 뽑기
203050
+ let nextIndex = this.#currentTipIndex; // 초기값을 현재 인덱스로 설정
203051
+ const maxAttempts = 3; // 최대 시도 횟수
203047
203052
 
203048
- this.#currentTipIndex = nextIndex;
203049
- this.showCurrentTip();
203050
- }
203053
+ // 팁이 1개 초과인 경우에만 다른 팁을 찾으려고 시도합니다.
203054
+ // 팁이 하나뿐이거나 없으면 아래 루프에 들어가지 않으므로,
203055
+ // nextIndex는 초기값인 currentTipIndex (0이 될 가능성 높음)를 유지합니다.
203056
+ if (this.#tips.length > 1) {
203057
+ for (let i = 0; i < maxAttempts; i++) {
203058
+ const potentialNextIndex = Math.floor(Math.random() * this.#tips.length);
203059
+ if (potentialNextIndex !== this.#currentTipIndex) {
203060
+ nextIndex = potentialNextIndex;
203061
+ break; // 다른 팁을 찾으면 루프 종료
203062
+ }
203063
+ }
203064
+ }
203065
+ // 이전에 있던 'else { nextIndex = 0; }' 블록이 제거되었습니다.
203066
+ // 팁이 1개일 경우, if (this.#tips.length > 1) 조건에 걸리지 않고
203067
+ // nextIndex는 그대로 this.#currentTipIndex (대부분 0)를 유지하게 됩니다.
203068
+
203069
+ this.#currentTipIndex = nextIndex; // 최종 결정된 인덱스를 currentTipIndex에 할당
203051
203070
 
203052
- /**
203053
- * Displays the current tip's text and manages its associated images.
203054
- */
203055
- showCurrentTip() {
203056
203071
  const currentTip = this.#tips[this.#currentTipIndex];
203057
203072
 
203058
203073
  if (this.tipElement && currentTip) {
203059
- //this.tipElement.textContent = currentTip.text;
203060
203074
  this.tipElement.innerHTML = currentTip.text;
203061
203075
 
203062
- // Clear any existing image cycling interval for the previous tip
203063
203076
  if (this.#imageIntervalId) {
203064
203077
  clearInterval(this.#imageIntervalId);
203065
203078
  this.#imageIntervalId = null;
203066
203079
  }
203067
203080
 
203068
- // Image handling logic
203069
203081
  if (currentTip.images && currentTip.images.length > 0) {
203070
- this.#currentImageIndex = 0; // Reset image index for the new tip
203082
+ this.#currentImageIndex = 0;
203071
203083
  this.showCurrentImage(currentTip.images[this.#currentImageIndex]);
203072
- this.tipImageElement.style.display = 'block'; // Show the image
203073
- this.tipImageContainer.style.display = 'flex'; // Show the image container
203084
+ this.tipImageElement.style.display = 'block';
203085
+ this.tipImageContainer.style.display = 'flex';
203074
203086
 
203075
203087
  if (currentTip.images.length > 1) {
203076
- // If there's more than one image, start cycling through them
203077
203088
  this.#imageIntervalId = setInterval(() => {
203078
203089
  this.#currentImageIndex = (this.#currentImageIndex + 1) % currentTip.images.length;
203079
203090
  this.showCurrentImage(currentTip.images[this.#currentImageIndex]);
203080
203091
  }, this.#imageDisplayDuration);
203081
203092
  }
203082
203093
  } else {
203083
- // If no images are provided for this tip, hide the image elements
203084
203094
  this.tipImageElement.style.display = 'none';
203085
203095
  this.tipImageContainer.style.display = 'none';
203086
- this.tipImageElement.src = ''; // Clear image source
203096
+ this.tipImageElement.src = '';
203087
203097
  }
203088
203098
  }
203089
203099
  }
@@ -202990,11 +202990,11 @@ class IdeLoadingTips extends HTMLElement {
202990
202990
  this.#currentTipIndex = Math.floor(Math.random() * this.#tips.length);
202991
202991
  this.stopTips(); // Stop any existing intervals before starting new ones
202992
202992
 
202993
- this.showCurrentTip(); // Display the first tip immediately
202993
+ this.showRandomTip(); // Display the first tip immediately
202994
202994
 
202995
202995
  // Start interval for cycling through tips
202996
202996
  this.#tipIntervalId = setInterval(() => {
202997
- this.showNextTip();
202997
+ this.showRandomTip();
202998
202998
  }, this.#tipDisplayDuration);
202999
202999
 
203000
203000
  //this.loadingAnimation.style.display = 'block'; // Show the loading spinner
@@ -203027,59 +203027,69 @@ class IdeLoadingTips extends HTMLElement {
203027
203027
  }
203028
203028
 
203029
203029
  /**
203030
- * Advances to the next tip and calls showCurrentTip() to display it.
203030
+ * Displays the current tip's text and manages its associated images.
203031
+ */
203032
+ // aiLoadingTips.js (showCurrentTip 메서드 내부)
203033
+
203034
+ /**
203035
+ * Displays a randomly selected tip (excluding the currently displayed one if possible)
203036
+ * and manages its associated images.
203031
203037
  */
203032
- showNextTip() {
203033
- if (this.#tips.length <= 1) {
203034
- // 팁이 하나뿐이거나 없으면 다음 팁을 보여줄 필요가 없음
203035
- this.showCurrentTip(); // 현재 팁을 그냥 다시 표시
203038
+ showRandomTip() {
203039
+ if (this.#tips.length === 0) {
203040
+ this.tipElement.textContent = "";
203041
+ this.tipImageElement.style.display = 'none';
203042
+ this.tipImageContainer.style.display = 'none';
203036
203043
  return;
203037
203044
  }
203038
203045
 
203039
- let nextIndex;
203040
- do {
203041
- nextIndex = Math.floor(Math.random() * this.#tips.length);
203042
- } while (nextIndex === this.#currentTipIndex); // 현재 인덱스와 같으면 다시 뽑기
203046
+ let nextIndex = this.#currentTipIndex; // 초기값을 현재 인덱스로 설정
203047
+ const maxAttempts = 3; // 최대 시도 횟수
203043
203048
 
203044
- this.#currentTipIndex = nextIndex;
203045
- this.showCurrentTip();
203046
- }
203049
+ // 팁이 1개 초과인 경우에만 다른 팁을 찾으려고 시도합니다.
203050
+ // 팁이 하나뿐이거나 없으면 아래 루프에 들어가지 않으므로,
203051
+ // nextIndex는 초기값인 currentTipIndex (0이 될 가능성 높음)를 유지합니다.
203052
+ if (this.#tips.length > 1) {
203053
+ for (let i = 0; i < maxAttempts; i++) {
203054
+ const potentialNextIndex = Math.floor(Math.random() * this.#tips.length);
203055
+ if (potentialNextIndex !== this.#currentTipIndex) {
203056
+ nextIndex = potentialNextIndex;
203057
+ break; // 다른 팁을 찾으면 루프 종료
203058
+ }
203059
+ }
203060
+ }
203061
+ // 이전에 있던 'else { nextIndex = 0; }' 블록이 제거되었습니다.
203062
+ // 팁이 1개일 경우, if (this.#tips.length > 1) 조건에 걸리지 않고
203063
+ // nextIndex는 그대로 this.#currentTipIndex (대부분 0)를 유지하게 됩니다.
203064
+
203065
+ this.#currentTipIndex = nextIndex; // 최종 결정된 인덱스를 currentTipIndex에 할당
203047
203066
 
203048
- /**
203049
- * Displays the current tip's text and manages its associated images.
203050
- */
203051
- showCurrentTip() {
203052
203067
  const currentTip = this.#tips[this.#currentTipIndex];
203053
203068
 
203054
203069
  if (this.tipElement && currentTip) {
203055
- //this.tipElement.textContent = currentTip.text;
203056
203070
  this.tipElement.innerHTML = currentTip.text;
203057
203071
 
203058
- // Clear any existing image cycling interval for the previous tip
203059
203072
  if (this.#imageIntervalId) {
203060
203073
  clearInterval(this.#imageIntervalId);
203061
203074
  this.#imageIntervalId = null;
203062
203075
  }
203063
203076
 
203064
- // Image handling logic
203065
203077
  if (currentTip.images && currentTip.images.length > 0) {
203066
- this.#currentImageIndex = 0; // Reset image index for the new tip
203078
+ this.#currentImageIndex = 0;
203067
203079
  this.showCurrentImage(currentTip.images[this.#currentImageIndex]);
203068
- this.tipImageElement.style.display = 'block'; // Show the image
203069
- this.tipImageContainer.style.display = 'flex'; // Show the image container
203080
+ this.tipImageElement.style.display = 'block';
203081
+ this.tipImageContainer.style.display = 'flex';
203070
203082
 
203071
203083
  if (currentTip.images.length > 1) {
203072
- // If there's more than one image, start cycling through them
203073
203084
  this.#imageIntervalId = setInterval(() => {
203074
203085
  this.#currentImageIndex = (this.#currentImageIndex + 1) % currentTip.images.length;
203075
203086
  this.showCurrentImage(currentTip.images[this.#currentImageIndex]);
203076
203087
  }, this.#imageDisplayDuration);
203077
203088
  }
203078
203089
  } else {
203079
- // If no images are provided for this tip, hide the image elements
203080
203090
  this.tipImageElement.style.display = 'none';
203081
203091
  this.tipImageContainer.style.display = 'none';
203082
- this.tipImageElement.src = ''; // Clear image source
203092
+ this.tipImageElement.src = '';
203083
203093
  }
203084
203094
  }
203085
203095
  }
@@ -99,11 +99,11 @@ class IdeLoadingTips extends HTMLElement {
99
99
  this.#currentTipIndex = Math.floor(Math.random() * this.#tips.length);
100
100
  this.stopTips(); // Stop any existing intervals before starting new ones
101
101
 
102
- this.showCurrentTip(); // Display the first tip immediately
102
+ this.showRandomTip(); // Display the first tip immediately
103
103
 
104
104
  // Start interval for cycling through tips
105
105
  this.#tipIntervalId = setInterval(() => {
106
- this.showNextTip();
106
+ this.showRandomTip();
107
107
  }, this.#tipDisplayDuration);
108
108
 
109
109
  //this.loadingAnimation.style.display = 'block'; // Show the loading spinner
@@ -136,59 +136,69 @@ class IdeLoadingTips extends HTMLElement {
136
136
  }
137
137
 
138
138
  /**
139
- * Advances to the next tip and calls showCurrentTip() to display it.
139
+ * Displays the current tip's text and manages its associated images.
140
+ */
141
+ // aiLoadingTips.js (showCurrentTip 메서드 내부)
142
+
143
+ /**
144
+ * Displays a randomly selected tip (excluding the currently displayed one if possible)
145
+ * and manages its associated images.
140
146
  */
141
- showNextTip() {
142
- if (this.#tips.length <= 1) {
143
- // 팁이 하나뿐이거나 없으면 다음 팁을 보여줄 필요가 없음
144
- this.showCurrentTip(); // 현재 팁을 그냥 다시 표시
147
+ showRandomTip() {
148
+ if (this.#tips.length === 0) {
149
+ this.tipElement.textContent = "";
150
+ this.tipImageElement.style.display = 'none';
151
+ this.tipImageContainer.style.display = 'none';
145
152
  return;
146
153
  }
147
154
 
148
- let nextIndex;
149
- do {
150
- nextIndex = Math.floor(Math.random() * this.#tips.length);
151
- } while (nextIndex === this.#currentTipIndex); // 현재 인덱스와 같으면 다시 뽑기
155
+ let nextIndex = this.#currentTipIndex; // 초기값을 현재 인덱스로 설정
156
+ const maxAttempts = 3; // 최대 시도 횟수
157
+
158
+ // 팁이 1개 초과인 경우에만 다른 팁을 찾으려고 시도합니다.
159
+ // 팁이 하나뿐이거나 없으면 아래 루프에 들어가지 않으므로,
160
+ // nextIndex는 초기값인 currentTipIndex (0이 될 가능성 높음)를 유지합니다.
161
+ if (this.#tips.length > 1) {
162
+ for (let i = 0; i < maxAttempts; i++) {
163
+ const potentialNextIndex = Math.floor(Math.random() * this.#tips.length);
164
+ if (potentialNextIndex !== this.#currentTipIndex) {
165
+ nextIndex = potentialNextIndex;
166
+ break; // 다른 팁을 찾으면 루프 종료
167
+ }
168
+ }
169
+ }
170
+ // 이전에 있던 'else { nextIndex = 0; }' 블록이 제거되었습니다.
171
+ // 팁이 1개일 경우, if (this.#tips.length > 1) 조건에 걸리지 않고
172
+ // nextIndex는 그대로 this.#currentTipIndex (대부분 0)를 유지하게 됩니다.
152
173
 
153
- this.#currentTipIndex = nextIndex;
154
- this.showCurrentTip();
155
- }
174
+ this.#currentTipIndex = nextIndex; // 최종 결정된 인덱스를 currentTipIndex에 할당
156
175
 
157
- /**
158
- * Displays the current tip's text and manages its associated images.
159
- */
160
- showCurrentTip() {
161
176
  const currentTip = this.#tips[this.#currentTipIndex];
162
177
 
163
178
  if (this.tipElement && currentTip) {
164
- //this.tipElement.textContent = currentTip.text;
165
179
  this.tipElement.innerHTML = currentTip.text;
166
180
 
167
- // Clear any existing image cycling interval for the previous tip
168
181
  if (this.#imageIntervalId) {
169
182
  clearInterval(this.#imageIntervalId);
170
183
  this.#imageIntervalId = null;
171
184
  }
172
185
 
173
- // Image handling logic
174
186
  if (currentTip.images && currentTip.images.length > 0) {
175
- this.#currentImageIndex = 0; // Reset image index for the new tip
187
+ this.#currentImageIndex = 0;
176
188
  this.showCurrentImage(currentTip.images[this.#currentImageIndex]);
177
- this.tipImageElement.style.display = 'block'; // Show the image
178
- this.tipImageContainer.style.display = 'flex'; // Show the image container
189
+ this.tipImageElement.style.display = 'block';
190
+ this.tipImageContainer.style.display = 'flex';
179
191
 
180
192
  if (currentTip.images.length > 1) {
181
- // If there's more than one image, start cycling through them
182
193
  this.#imageIntervalId = setInterval(() => {
183
194
  this.#currentImageIndex = (this.#currentImageIndex + 1) % currentTip.images.length;
184
195
  this.showCurrentImage(currentTip.images[this.#currentImageIndex]);
185
196
  }, this.#imageDisplayDuration);
186
197
  }
187
198
  } else {
188
- // If no images are provided for this tip, hide the image elements
189
199
  this.tipImageElement.style.display = 'none';
190
200
  this.tipImageContainer.style.display = 'none';
191
- this.tipImageElement.src = ''; // Clear image source
201
+ this.tipImageElement.src = '';
192
202
  }
193
203
  }
194
204
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.558.0",
4
+ "version": "0.559.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -99,11 +99,11 @@ class IdeLoadingTips extends HTMLElement {
99
99
  this.#currentTipIndex = Math.floor(Math.random() * this.#tips.length);
100
100
  this.stopTips(); // Stop any existing intervals before starting new ones
101
101
 
102
- this.showCurrentTip(); // Display the first tip immediately
102
+ this.showRandomTip(); // Display the first tip immediately
103
103
 
104
104
  // Start interval for cycling through tips
105
105
  this.#tipIntervalId = setInterval(() => {
106
- this.showNextTip();
106
+ this.showRandomTip();
107
107
  }, this.#tipDisplayDuration);
108
108
 
109
109
  //this.loadingAnimation.style.display = 'block'; // Show the loading spinner
@@ -136,59 +136,69 @@ class IdeLoadingTips extends HTMLElement {
136
136
  }
137
137
 
138
138
  /**
139
- * Advances to the next tip and calls showCurrentTip() to display it.
139
+ * Displays the current tip's text and manages its associated images.
140
+ */
141
+ // aiLoadingTips.js (showCurrentTip 메서드 내부)
142
+
143
+ /**
144
+ * Displays a randomly selected tip (excluding the currently displayed one if possible)
145
+ * and manages its associated images.
140
146
  */
141
- showNextTip() {
142
- if (this.#tips.length <= 1) {
143
- // 팁이 하나뿐이거나 없으면 다음 팁을 보여줄 필요가 없음
144
- this.showCurrentTip(); // 현재 팁을 그냥 다시 표시
147
+ showRandomTip() {
148
+ if (this.#tips.length === 0) {
149
+ this.tipElement.textContent = "";
150
+ this.tipImageElement.style.display = 'none';
151
+ this.tipImageContainer.style.display = 'none';
145
152
  return;
146
153
  }
147
154
 
148
- let nextIndex;
149
- do {
150
- nextIndex = Math.floor(Math.random() * this.#tips.length);
151
- } while (nextIndex === this.#currentTipIndex); // 현재 인덱스와 같으면 다시 뽑기
155
+ let nextIndex = this.#currentTipIndex; // 초기값을 현재 인덱스로 설정
156
+ const maxAttempts = 3; // 최대 시도 횟수
157
+
158
+ // 팁이 1개 초과인 경우에만 다른 팁을 찾으려고 시도합니다.
159
+ // 팁이 하나뿐이거나 없으면 아래 루프에 들어가지 않으므로,
160
+ // nextIndex는 초기값인 currentTipIndex (0이 될 가능성 높음)를 유지합니다.
161
+ if (this.#tips.length > 1) {
162
+ for (let i = 0; i < maxAttempts; i++) {
163
+ const potentialNextIndex = Math.floor(Math.random() * this.#tips.length);
164
+ if (potentialNextIndex !== this.#currentTipIndex) {
165
+ nextIndex = potentialNextIndex;
166
+ break; // 다른 팁을 찾으면 루프 종료
167
+ }
168
+ }
169
+ }
170
+ // 이전에 있던 'else { nextIndex = 0; }' 블록이 제거되었습니다.
171
+ // 팁이 1개일 경우, if (this.#tips.length > 1) 조건에 걸리지 않고
172
+ // nextIndex는 그대로 this.#currentTipIndex (대부분 0)를 유지하게 됩니다.
152
173
 
153
- this.#currentTipIndex = nextIndex;
154
- this.showCurrentTip();
155
- }
174
+ this.#currentTipIndex = nextIndex; // 최종 결정된 인덱스를 currentTipIndex에 할당
156
175
 
157
- /**
158
- * Displays the current tip's text and manages its associated images.
159
- */
160
- showCurrentTip() {
161
176
  const currentTip = this.#tips[this.#currentTipIndex];
162
177
 
163
178
  if (this.tipElement && currentTip) {
164
- //this.tipElement.textContent = currentTip.text;
165
179
  this.tipElement.innerHTML = currentTip.text;
166
180
 
167
- // Clear any existing image cycling interval for the previous tip
168
181
  if (this.#imageIntervalId) {
169
182
  clearInterval(this.#imageIntervalId);
170
183
  this.#imageIntervalId = null;
171
184
  }
172
185
 
173
- // Image handling logic
174
186
  if (currentTip.images && currentTip.images.length > 0) {
175
- this.#currentImageIndex = 0; // Reset image index for the new tip
187
+ this.#currentImageIndex = 0;
176
188
  this.showCurrentImage(currentTip.images[this.#currentImageIndex]);
177
- this.tipImageElement.style.display = 'block'; // Show the image
178
- this.tipImageContainer.style.display = 'flex'; // Show the image container
189
+ this.tipImageElement.style.display = 'block';
190
+ this.tipImageContainer.style.display = 'flex';
179
191
 
180
192
  if (currentTip.images.length > 1) {
181
- // If there's more than one image, start cycling through them
182
193
  this.#imageIntervalId = setInterval(() => {
183
194
  this.#currentImageIndex = (this.#currentImageIndex + 1) % currentTip.images.length;
184
195
  this.showCurrentImage(currentTip.images[this.#currentImageIndex]);
185
196
  }, this.#imageDisplayDuration);
186
197
  }
187
198
  } else {
188
- // If no images are provided for this tip, hide the image elements
189
199
  this.tipImageElement.style.display = 'none';
190
200
  this.tipImageContainer.style.display = 'none';
191
- this.tipImageElement.src = ''; // Clear image source
201
+ this.tipImageElement.src = '';
192
202
  }
193
203
  }
194
204
  }