@commonpub/layer 0.3.17 → 0.3.18

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.
@@ -54,7 +54,7 @@ function handleSend(): void {
54
54
  aria-label="Message"
55
55
  @keyup.enter="handleSend"
56
56
  />
57
- <button class="cpub-btn cpub-btn-primary" :disabled="!newMessage.trim()" @click="handleSend">
57
+ <button class="cpub-btn cpub-btn-primary" :disabled="!newMessage.trim()" aria-label="Send message" @click="handleSend">
58
58
  <i class="fa-solid fa-paper-plane"></i>
59
59
  </button>
60
60
  </div>
@@ -132,15 +132,15 @@ useJsonLd({
132
132
  <div class="cpub-engagement-row">
133
133
  <div class="cpub-eng-stat"><i class="fa-regular fa-eye"></i> {{ content.viewCount?.toLocaleString() || '0' }} views</div>
134
134
  <div class="cpub-eng-sep"></div>
135
- <button class="cpub-eng-btn" :class="{ liked }" @click="toggleLike">
135
+ <button class="cpub-eng-btn" :class="{ liked }" :aria-label="liked ? 'Unlike' : 'Like'" :aria-pressed="liked" @click="toggleLike">
136
136
  <i class="fa-solid fa-heart"></i> {{ likeCount }}
137
137
  </button>
138
- <button class="cpub-eng-btn" :class="{ bookmarked }" @click="toggleBookmark">
138
+ <button class="cpub-eng-btn" :class="{ bookmarked }" :aria-label="bookmarked ? 'Remove bookmark' : 'Bookmark'" :aria-pressed="bookmarked" @click="toggleBookmark">
139
139
  <i class="fa-solid fa-bookmark"></i> Bookmark
140
140
  </button>
141
141
  <div class="cpub-eng-spacer"></div>
142
- <button class="cpub-eng-btn" @click="share"><i class="fa-solid fa-share-nodes"></i> Share</button>
143
- <button class="cpub-eng-btn"><i class="fa-solid fa-ellipsis"></i></button>
142
+ <button class="cpub-eng-btn" aria-label="Share" @click="share"><i class="fa-solid fa-share-nodes"></i> Share</button>
143
+ <button class="cpub-eng-btn" aria-label="More options"><i class="fa-solid fa-ellipsis"></i></button>
144
144
  </div>
145
145
 
146
146
  <!-- ARTICLE BODY WITH TOC SIDEBAR -->
@@ -85,15 +85,15 @@ const hasSeries = computed(() => !!seriesTitle.value && seriesTotalParts.value >
85
85
  <div class="cpub-engagement-row">
86
86
  <div class="cpub-eng-stat"><i class="fa-regular fa-eye"></i> {{ content.viewCount?.toLocaleString() || '0' }} views</div>
87
87
  <div class="cpub-eng-sep"></div>
88
- <button class="cpub-eng-btn" :class="{ liked }" @click="toggleLike">
88
+ <button class="cpub-eng-btn" :class="{ liked }" :aria-label="liked ? 'Unlike' : 'Like'" :aria-pressed="liked" @click="toggleLike">
89
89
  <i class="fa-solid fa-heart"></i> {{ likeCount }}
90
90
  </button>
91
- <button class="cpub-eng-btn" :class="{ bookmarked }" @click="toggleBookmark">
91
+ <button class="cpub-eng-btn" :class="{ bookmarked }" :aria-label="bookmarked ? 'Remove bookmark' : 'Bookmark'" :aria-pressed="bookmarked" @click="toggleBookmark">
92
92
  <i class="fa-solid fa-bookmark"></i> Bookmark
93
93
  </button>
94
94
  <div class="cpub-eng-spacer"></div>
95
- <button class="cpub-eng-btn" @click="share"><i class="fa-solid fa-share-nodes"></i> Share</button>
96
- <button class="cpub-eng-btn"><i class="fa-solid fa-ellipsis"></i></button>
95
+ <button class="cpub-eng-btn" aria-label="Share" @click="share"><i class="fa-solid fa-share-nodes"></i> Share</button>
96
+ <button class="cpub-eng-btn" aria-label="More options"><i class="fa-solid fa-ellipsis"></i></button>
97
97
  </div>
98
98
 
99
99
  <!-- BLOG BODY (PROSE) -->
@@ -168,21 +168,21 @@ onUnmounted(() => { document.removeEventListener('keydown', onKeydown); });
168
168
  <span class="cpub-progress-text">Section {{ activeSection + 1 }} of {{ totalSections }}</span>
169
169
  <div class="cpub-topbar-divider"></div>
170
170
  <div class="cpub-nav-btn-group">
171
- <button class="cpub-icon-btn" :disabled="activeSection === 0" title="Previous section" @click="prevSection">
171
+ <button class="cpub-icon-btn" :disabled="activeSection === 0" aria-label="Previous section" @click="prevSection">
172
172
  <i class="fa-solid fa-arrow-left"></i>
173
173
  </button>
174
- <button class="cpub-icon-btn" :disabled="activeSection === totalSections - 1" title="Next section" @click="nextSection">
174
+ <button class="cpub-icon-btn" :disabled="activeSection === totalSections - 1" aria-label="Next section" @click="nextSection">
175
175
  <i class="fa-solid fa-arrow-right"></i>
176
176
  </button>
177
177
  </div>
178
178
  <div class="cpub-topbar-divider"></div>
179
- <button class="cpub-icon-btn" :class="{ active: liked }" title="Like" @click="toggleLike">
179
+ <button class="cpub-icon-btn" :class="{ active: liked }" :aria-label="liked ? 'Unlike' : 'Like'" :aria-pressed="liked" @click="toggleLike">
180
180
  <i :class="liked ? 'fa-solid fa-heart' : 'fa-regular fa-heart'"></i>
181
181
  </button>
182
- <button class="cpub-icon-btn" :class="{ active: bookmarked }" title="Bookmark" @click="toggleBookmark">
182
+ <button class="cpub-icon-btn" :class="{ active: bookmarked }" :aria-label="bookmarked ? 'Remove bookmark' : 'Bookmark'" :aria-pressed="bookmarked" @click="toggleBookmark">
183
183
  <i :class="bookmarked ? 'fa-solid fa-bookmark' : 'fa-regular fa-bookmark'"></i>
184
184
  </button>
185
- <button class="cpub-icon-btn" title="Share" @click="share">
185
+ <button class="cpub-icon-btn" aria-label="Share" @click="share">
186
186
  <i class="fa-solid fa-arrow-up-from-bracket"></i>
187
187
  </button>
188
188
  <NuxtLink
@@ -208,14 +208,14 @@ onUnmounted(() => { document.removeEventListener('keydown', onKeydown); });
208
208
  class="cpub-toc-item"
209
209
  :class="{ completed: completedSections.has(i), active: activeSection === i }"
210
210
  >
211
- <a @click="goToSection(i)">
211
+ <button type="button" :aria-label="`Go to section ${i + 1}: ${section.title}`" @click="goToSection(i)">
212
212
  <span class="cpub-toc-icon">
213
213
  <i v-if="completedSections.has(i)" class="fa-solid fa-check"></i>
214
214
  <i v-else-if="activeSection === i" class="fa-solid fa-arrow-right"></i>
215
215
  </span>
216
216
  <span class="cpub-toc-num">{{ String(i + 1).padStart(2, '0') }}</span>
217
217
  <span class="cpub-toc-label">{{ section.title }}</span>
218
- </a>
218
+ </button>
219
219
  </li>
220
220
  </ul>
221
221
 
@@ -291,14 +291,17 @@ onUnmounted(() => { document.removeEventListener('keydown', onKeydown); });
291
291
  </button>
292
292
  <div v-else></div>
293
293
 
294
- <div class="cpub-progress-dots">
295
- <div
294
+ <div class="cpub-progress-dots" role="group" aria-label="Section progress">
295
+ <button
296
296
  v-for="(_, i) in totalSections"
297
297
  :key="i"
298
+ type="button"
298
299
  class="cpub-dot"
299
300
  :class="{ done: completedSections.has(i), active: i === activeSection }"
301
+ :aria-label="`Section ${i + 1}`"
302
+ :aria-current="i === activeSection ? 'step' : undefined"
300
303
  @click="goToSection(i)"
301
- ></div>
304
+ ></button>
302
305
  </div>
303
306
 
304
307
  <button v-if="activeSection < totalSections - 1" class="cpub-next-btn" @click="nextSection">
@@ -430,22 +433,26 @@ onUnmounted(() => { document.removeEventListener('keydown', onKeydown); });
430
433
  border-bottom: 1px solid var(--border);
431
434
  }
432
435
  .cpub-toc-list { list-style: none; padding: 6px 0; }
433
- .cpub-toc-item a {
436
+ .cpub-toc-item button {
434
437
  display: flex;
435
438
  align-items: center;
436
439
  gap: 8px;
437
440
  padding: 8px 14px;
438
- text-decoration: none;
441
+ width: 100%;
442
+ background: none;
443
+ border: none;
444
+ text-align: left;
439
445
  color: var(--text-dim);
440
446
  font-size: 12px;
447
+ font-family: inherit;
441
448
  line-height: 1.4;
442
449
  border-left: 3px solid transparent;
443
450
  transition: background 0.1s, color 0.1s, border-color 0.1s;
444
451
  cursor: pointer;
445
452
  }
446
- .cpub-toc-item a:hover { background: var(--surface2); color: var(--text); }
447
- .cpub-toc-item.active a { background: var(--accent-bg); border-left-color: var(--accent); color: var(--accent); font-weight: 500; }
448
- .cpub-toc-item.completed a { color: var(--text-dim); }
453
+ .cpub-toc-item button:hover { background: var(--surface2); color: var(--text); }
454
+ .cpub-toc-item.active button { background: var(--accent-bg); border-left-color: var(--accent); color: var(--accent); font-weight: 500; }
455
+ .cpub-toc-item.completed button { color: var(--text-dim); }
449
456
  .cpub-toc-icon { width: 14px; font-size: 10px; flex-shrink: 0; text-align: center; }
450
457
  .cpub-toc-item.completed .cpub-toc-icon { color: var(--green); }
451
458
  .cpub-toc-item.active .cpub-toc-icon { color: var(--accent); }
@@ -669,6 +676,8 @@ onUnmounted(() => { document.removeEventListener('keydown', onKeydown); });
669
676
  .cpub-dot {
670
677
  width: 7px;
671
678
  height: 7px;
679
+ padding: 0;
680
+ border: none;
672
681
  border-radius: 50%;
673
682
  background: var(--border2);
674
683
  transition: background 0.15s, transform 0.15s;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonpub/layer",
3
- "version": "0.3.17",
3
+ "version": "0.3.18",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "files": [
@@ -44,15 +44,15 @@
44
44
  "vue": "^3.4.0",
45
45
  "vue-router": "^4.3.0",
46
46
  "zod": "^4.3.6",
47
- "@commonpub/auth": "0.5.0",
48
47
  "@commonpub/config": "0.7.0",
48
+ "@commonpub/auth": "0.5.0",
49
49
  "@commonpub/docs": "0.5.2",
50
50
  "@commonpub/editor": "0.5.0",
51
51
  "@commonpub/protocol": "0.9.4",
52
- "@commonpub/server": "2.12.1",
53
52
  "@commonpub/learning": "0.5.0",
53
+ "@commonpub/schema": "0.8.12",
54
54
  "@commonpub/ui": "0.7.1",
55
- "@commonpub/schema": "0.8.12"
55
+ "@commonpub/server": "2.12.1"
56
56
  },
57
57
  "scripts": {}
58
58
  }
@@ -162,7 +162,7 @@ useSeoMeta({
162
162
  .cpub-mirror-title { font-size: 2rem; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
163
163
  .cpub-mirror-desc { font-size: 1.0625rem; color: var(--text-dim); line-height: 1.6; margin-bottom: 16px; }
164
164
  .cpub-mirror-author { font-size: 0.875rem; color: var(--text-dim); margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
165
- .cpub-mirror-author-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: var(--border-width-default) solid var(--border); flex-shrink: 0; }
165
+ .cpub-mirror-author-avatar { width: 40px; height: 40px; object-fit: cover; border: var(--border-width-default) solid var(--border); flex-shrink: 0; }
166
166
  .cpub-mirror-bio { font-size: 0.8125rem; color: var(--text-faint); line-height: 1.5; margin-top: 4px; }
167
167
  .cpub-mirror-bio :deep(a) { color: var(--accent); }
168
168
  .cpub-mirror-handle { color: var(--text-faint); margin-left: 6px; }