@salesforcedevs/docs-components 1.17.0-hack-alpha4 → 1.17.0-hack-alpha5

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.
@@ -33,10 +33,10 @@ h4 doc-heading-content {
33
33
  }
34
34
 
35
35
  /* Heading alignment when comment popup is present */
36
- h1:has(.comment-icon-container),
37
- h2:has(.comment-icon-container),
38
- h3:has(.comment-icon-container),
39
- h4:has(.comment-icon-container) {
36
+ h1:has(doc-comment-popup),
37
+ h2:has(doc-comment-popup),
38
+ h3:has(doc-comment-popup),
39
+ h4:has(doc-comment-popup) {
40
40
  display: flex;
41
41
  align-items: center;
42
42
  gap: var(--dx-g-spacing-xs, 4px);
@@ -49,10 +49,10 @@ doc-heading-content {
49
49
  }
50
50
 
51
51
  /* When no comment popup is present, reset flex to normal display */
52
- h1:not(:has(.comment-icon-container)),
53
- h2:not(:has(.comment-icon-container)),
54
- h3:not(:has(.comment-icon-container)),
55
- h4:not(:has(.comment-icon-container)) {
52
+ h1:not(:has(doc-comment-popup)),
53
+ h2:not(:has(doc-comment-popup)),
54
+ h3:not(:has(doc-comment-popup)),
55
+ h4:not(:has(doc-comment-popup)) {
56
56
  display: block;
57
57
  }
58
58
 
@@ -69,263 +69,12 @@ h4:not(:has(.comment-icon-container)) {
69
69
  }
70
70
  }
71
71
 
72
- /* Comment Icon Container */
73
- .comment-icon-container {
74
- position: relative;
75
- display: flex;
76
- align-items: center;
77
- justify-content: center;
78
- flex-shrink: 0;
79
- z-index: 1000;
80
- }
81
-
82
- .comment-icon-button {
83
- background: var(--dx-g-blue-vibrant-20);
84
- border: none;
85
- border-radius: 50%;
86
- cursor: pointer;
87
- transition: all 0.3s ease;
88
- display: flex;
89
- align-items: center;
90
- justify-content: center;
91
- color: white;
92
- padding: 6px;
93
- width: 28px;
94
- height: 28px;
95
- box-sizing: border-box;
96
- }
97
-
98
- .comment-icon-button dx-icon {
99
- color: white;
100
- }
101
-
102
- .comment-icon-button:hover {
103
- background: var(--dx-g-blue-vibrant-50);
104
- color: white;
105
- }
106
-
107
- .comment-icon-button:active {
108
- transform: scale(0.95);
109
- }
110
-
111
- /* Comment Count Badge */
112
- .comment-count-badge {
113
- position: absolute;
114
- top: -8px;
115
- right: -8px;
116
- background: #f44336;
117
- color: white;
118
- border-radius: 50%;
119
- width: 20px;
120
- height: 20px;
121
- font-size: 12px;
122
- font-weight: bold;
123
- display: flex;
124
- align-items: center;
125
- justify-content: center;
126
- min-width: 20px;
127
- padding: 0 2px;
128
- box-sizing: border-box;
129
- border: 2px solid white;
130
- box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
131
- z-index: 1001;
132
- }
133
-
134
- /* Popup Overlay */
135
- .popup-overlay {
136
- position: fixed;
137
- top: 0;
138
- left: 0;
139
- width: 100%;
140
- height: 100%;
141
- background: rgb(0 0 0 / 50%);
142
- display: flex;
143
- align-items: center;
144
- justify-content: center;
145
- z-index: 2000;
146
- padding: 20px;
147
- box-sizing: border-box;
148
- }
149
-
150
- /* Popup Container */
151
- .popup-container {
152
- background: white;
153
- border-radius: 12px;
154
- box-shadow: 0 20px 40px rgb(0 0 0 / 10%);
155
- max-width: 500px;
156
- width: 100%;
157
- max-height: 80vh;
158
- overflow-y: auto;
159
- position: relative;
160
- }
161
-
162
- /* Popup Header */
163
- .popup-header {
164
- display: flex;
165
- justify-content: space-between;
166
- align-items: center;
167
- padding: 24px 24px 0;
168
- border-bottom: 1px solid #e0e0e0;
169
- margin-bottom: 24px;
170
- }
171
-
172
- .popup-title {
173
- margin: 0;
174
- font-size: 20px;
175
- font-weight: 600;
176
- color: #212121;
177
- }
178
-
179
- .close-button {
180
- background: none;
181
- border: none;
182
- cursor: pointer;
183
- padding: 8px;
184
- border-radius: 50%;
185
- display: flex;
186
- align-items: center;
187
- justify-content: center;
188
- transition: background-color 0.2s ease;
189
- }
190
-
191
- .close-button:hover {
192
- background: #f5f5f5;
193
- }
194
-
195
- /* Popup Content */
196
- .popup-content {
197
- padding: 0 24px 24px;
198
- }
199
-
200
- /* Comment Form */
201
- .comment-form {
202
- margin-bottom: 24px;
203
- }
204
-
205
- .form-group {
206
- margin-bottom: 20px;
207
- }
208
-
209
- .form-label {
210
- display: block;
211
- margin-bottom: 8px;
212
- font-weight: 500;
213
- color: #424242;
214
- font-size: 14px;
215
- }
216
-
217
- .form-input,
218
- .form-textarea {
219
- width: 100%;
220
- padding: 12px 16px;
221
- border: 2px solid #e0e0e0;
222
- border-radius: 8px;
223
- font-size: 14px;
224
- font-family: inherit;
225
- transition: border-color 0.2s ease;
226
- box-sizing: border-box;
227
- }
228
-
229
- .form-input:focus,
230
- .form-textarea:focus {
231
- outline: none;
232
- border-color: #1976d2;
233
- }
234
-
235
- .form-textarea {
236
- resize: vertical;
237
- min-height: 100px;
238
- }
239
-
240
- .error-message {
241
- color: #d32f2f;
242
- font-size: 12px;
243
- margin-top: 4px;
244
- }
245
-
246
- .form-actions {
247
- display: flex;
248
- justify-content: flex-end;
249
- }
250
-
251
- .submit-button {
252
- background: #1976d2;
253
- color: white;
254
- border: none;
255
- border-radius: 8px;
256
- padding: 12px 24px;
257
- font-size: 14px;
258
- font-weight: 500;
259
- cursor: pointer;
260
- transition: background-color 0.2s ease;
261
- font-family: inherit;
262
- }
263
-
264
- .submit-button:hover:not(:disabled) {
265
- background: #1565c0;
266
- }
267
-
268
- .submit-button:disabled {
269
- background: #ccc;
270
- cursor: not-allowed;
271
- }
272
-
273
- /* Comments Section */
274
- .comments-section {
275
- border-top: 1px solid #e0e0e0;
276
- padding-top: 24px;
277
- }
278
-
279
- .comments-title {
280
- margin: 0 0 16px;
281
- font-size: 16px;
282
- font-weight: 600;
283
- color: #212121;
284
- }
285
-
286
- .comments-list {
287
- display: flex;
288
- flex-direction: column;
289
- gap: 16px;
290
- }
291
-
292
- .comment-item {
293
- background: #f8f9fa;
294
- border-radius: 8px;
295
- padding: 16px;
296
- border-left: 4px solid #1976d2;
297
- }
298
-
299
- .comment-header {
300
- display: flex;
301
- justify-content: space-between;
302
- align-items: center;
303
- margin-bottom: 8px;
304
- }
305
-
306
- .comment-email {
307
- font-weight: 500;
308
- color: #1976d2;
309
- font-size: 14px;
310
- }
311
-
312
- .comment-time {
313
- font-size: 12px;
314
- color: #757575;
315
- }
316
-
317
- .comment-text {
318
- color: #424242;
319
- line-height: 1.5;
320
- font-size: 14px;
321
- }
322
-
323
72
  /* Responsive Design */
324
73
  @media (max-width: 768px) {
325
- h1:has(.comment-icon-container),
326
- h2:has(.comment-icon-container),
327
- h3:has(.comment-icon-container),
328
- h4:has(.comment-icon-container) {
74
+ h1:has(doc-comment-popup),
75
+ h2:has(doc-comment-popup),
76
+ h3:has(doc-comment-popup),
77
+ h4:has(doc-comment-popup) {
329
78
  gap: var(--dx-g-spacing-2xs, 2px);
330
79
  }
331
80
 
@@ -337,123 +86,4 @@ h4:not(:has(.comment-icon-container)) {
337
86
  gap: var(--dx-g-spacing-2xs, 2px);
338
87
  }
339
88
  }
340
-
341
- .comment-icon-button {
342
- width: 24px;
343
- height: 24px;
344
- padding: 4px;
345
- }
346
-
347
- .comment-count-badge {
348
- width: 18px;
349
- height: 18px;
350
- font-size: 11px;
351
- top: -6px;
352
- right: -6px;
353
- }
354
-
355
- .popup-overlay {
356
- padding: 16px;
357
- }
358
-
359
- .popup-container {
360
- max-height: 90vh;
361
- }
362
-
363
- .popup-header {
364
- padding: 16px 16px 0;
365
- margin-bottom: 16px;
366
- }
367
-
368
- .popup-title {
369
- font-size: 18px;
370
- }
371
-
372
- .popup-content {
373
- padding: 0 16px 16px;
374
- }
375
-
376
- .comments-section {
377
- padding-top: 16px;
378
- }
379
- }
380
-
381
- /* Dark mode support */
382
- @media (prefers-color-scheme: dark) {
383
- .popup-container {
384
- background: #303030;
385
- color: #fff;
386
- }
387
-
388
- .popup-title {
389
- color: #fff;
390
- }
391
-
392
- .popup-header {
393
- border-bottom-color: #424242;
394
- }
395
-
396
- .form-label {
397
- color: #e0e0e0;
398
- }
399
-
400
- .form-input,
401
- .form-textarea {
402
- background: #424242;
403
- border-color: #616161;
404
- color: #fff;
405
- }
406
-
407
- .form-input:focus,
408
- .form-textarea:focus {
409
- border-color: #42a5f5;
410
- }
411
-
412
- .form-input::placeholder,
413
- .form-textarea::placeholder {
414
- color: #bdbdbd;
415
- }
416
-
417
- .close-button:hover {
418
- background: #424242;
419
- }
420
-
421
- .comments-section {
422
- border-top-color: #424242;
423
- }
424
-
425
- .comments-title {
426
- color: #fff;
427
- }
428
-
429
- .comment-item {
430
- background: #424242;
431
- border-left-color: #42a5f5;
432
- }
433
-
434
- .comment-email {
435
- color: #42a5f5;
436
- }
437
-
438
- .comment-text {
439
- color: #e0e0e0;
440
- }
441
-
442
- .comment-count-badge {
443
- border-color: #303030;
444
- }
445
-
446
- .submit-button {
447
- background: #1976d2;
448
- color: white;
449
- }
450
-
451
- .submit-button:hover:not(:disabled) {
452
- background: #1565c0;
453
- }
454
-
455
- .submit-button:disabled {
456
- background: #555;
457
- color: #999;
458
- }
459
89
  }
@@ -2,175 +2,53 @@
2
2
  <h1 class={className} if:true={isAriaLevelOne}>
3
3
  <!-- Comment Popup -->
4
4
  <template if:true={hasCommentPopup}>
5
- <div class="comment-icon-container">
6
- <button
7
- class="comment-icon-button"
8
- onclick={handleIconClick}
9
- aria-label="Open comment popup"
10
- >
11
- <dx-icon symbol={iconSymbol} size={iconSize}></dx-icon>
12
- </button>
13
- <div if:true={showCommentCount} class="comment-count-badge">
14
- {commentCount}
15
- </div>
16
- </div>
5
+ <doc-comment-popup
6
+ heading-title={headingTitle}
7
+ file-path={filePath}
8
+ start-line={startLine}
9
+ end-line={endLine}
10
+ current-branch={currentBranch}
11
+ ></doc-comment-popup>
17
12
  </template>
18
13
  <doc-heading-content header={header} hash={hash}></doc-heading-content>
19
14
  </h1>
20
15
  <h2 class={className} if:true={isAriaLevelTwo}>
21
16
  <!-- Comment Popup -->
22
17
  <template if:true={hasCommentPopup}>
23
- <div class="comment-icon-container">
24
- <button
25
- class="comment-icon-button"
26
- onclick={handleIconClick}
27
- aria-label="Open comment popup"
28
- >
29
- <dx-icon symbol={iconSymbol} size={iconSize}></dx-icon>
30
- </button>
31
- <div if:true={showCommentCount} class="comment-count-badge">
32
- {commentCount}
33
- </div>
34
- </div>
18
+ <doc-comment-popup
19
+ heading-title={headingTitle}
20
+ file-path={filePath}
21
+ start-line={startLine}
22
+ end-line={endLine}
23
+ current-branch={currentBranch}
24
+ ></doc-comment-popup>
35
25
  </template>
36
26
  <doc-heading-content header={header} hash={hash}></doc-heading-content>
37
27
  </h2>
38
28
  <h3 class={className} if:true={isAriaLevelThree}>
39
29
  <!-- Comment Popup -->
40
30
  <template if:true={hasCommentPopup}>
41
- <div class="comment-icon-container">
42
- <button
43
- class="comment-icon-button"
44
- onclick={handleIconClick}
45
- aria-label="Open comment popup"
46
- >
47
- <dx-icon symbol={iconSymbol} size={iconSize}></dx-icon>
48
- </button>
49
- <div if:true={showCommentCount} class="comment-count-badge">
50
- {commentCount}
51
- </div>
52
- </div>
31
+ <doc-comment-popup
32
+ heading-title={headingTitle}
33
+ file-path={filePath}
34
+ start-line={startLine}
35
+ end-line={endLine}
36
+ current-branch={currentBranch}
37
+ ></doc-comment-popup>
53
38
  </template>
54
39
  <doc-heading-content header={header} hash={hash}></doc-heading-content>
55
40
  </h3>
56
41
  <h4 class={className} if:true={isAriaLevelFour}>
57
42
  <!-- Comment Popup -->
58
43
  <template if:true={hasCommentPopup}>
59
- <div class="comment-icon-container">
60
- <button
61
- class="comment-icon-button"
62
- onclick={handleIconClick}
63
- aria-label="Open comment popup"
64
- >
65
- <dx-icon symbol={iconSymbol} size={iconSize}></dx-icon>
66
- </button>
67
- <div if:true={showCommentCount} class="comment-count-badge">
68
- {commentCount}
69
- </div>
70
- </div>
44
+ <doc-comment-popup
45
+ heading-title={headingTitle}
46
+ file-path={filePath}
47
+ start-line={startLine}
48
+ end-line={endLine}
49
+ current-branch={currentBranch}
50
+ ></doc-comment-popup>
71
51
  </template>
72
52
  <doc-heading-content header={header} hash={hash}></doc-heading-content>
73
53
  </h4>
74
-
75
- <!-- Popup Overlay -->
76
- <div if:true={open} class="popup-overlay" onclick={handleOverlayClick}>
77
- <div
78
- class="popup-container"
79
- role="dialog"
80
- aria-modal="true"
81
- aria-labelledby="popup-title"
82
- >
83
- <!-- Popup Header -->
84
- <div class="popup-header">
85
- <h3 id="popup-title" class="popup-title">{popupTitle}</h3>
86
- <button
87
- class="close-button"
88
- onclick={handleClose}
89
- aria-label="Close popup"
90
- >
91
- <dx-icon symbol="close" size="small"></dx-icon>
92
- </button>
93
- </div>
94
-
95
- <!-- Comment Form -->
96
- <div class="popup-content">
97
- <form class="comment-form" onsubmit={handleSubmit}>
98
- <div class="form-group">
99
- <label for="email-input" class="form-label">
100
- Email
101
- </label>
102
- <input
103
- id="email-input"
104
- type="email"
105
- class="form-input"
106
- placeholder={emailPlaceholder}
107
- value={email}
108
- oninput={handleEmailChange}
109
- required
110
- />
111
- <div if:true={emailError} class="error-message">
112
- {emailError}
113
- </div>
114
- </div>
115
-
116
- <div class="form-group">
117
- <label for="comment-input" class="form-label">
118
- Comment
119
- </label>
120
- <textarea
121
- id="comment-input"
122
- class="form-textarea"
123
- placeholder={commentPlaceholder}
124
- value={comment}
125
- oninput={handleCommentChange}
126
- rows="4"
127
- required
128
- ></textarea>
129
- <div if:true={commentError} class="error-message">
130
- {commentError}
131
- </div>
132
- </div>
133
-
134
- <div class="form-actions">
135
- <button
136
- type="submit"
137
- class="submit-button"
138
- disabled={submitButtonDisabled}
139
- onclick={handleSubmit}
140
- >
141
- <span if:false={isSubmitting}>
142
- {submitButtonLabel}
143
- </span>
144
- <span if:true={isSubmitting}>Posting...</span>
145
- </button>
146
- </div>
147
- </form>
148
-
149
- <!-- Comments List -->
150
- <div if:true={showComments} class="comments-section">
151
- <h4 class="comments-title">Comments</h4>
152
- <div class="comments-list">
153
- <template
154
- for:each={formattedComments}
155
- for:item="comment"
156
- >
157
- <div key={comment.email} class="comment-item">
158
- <div class="comment-header">
159
- <span class="comment-email">
160
- {comment.maskedEmail}
161
- </span>
162
- <span class="comment-time">
163
- {comment.formattedTimestamp}
164
- </span>
165
- </div>
166
- <div class="comment-text">
167
- {comment.comment}
168
- </div>
169
- </div>
170
- </template>
171
- </div>
172
- </div>
173
- </div>
174
- </div>
175
- </div>
176
54
  </template>