@commonpub/layer 0.7.14 → 0.7.16

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.
@@ -179,6 +179,7 @@ function closeMobileSidebars(): void {
179
179
  }
180
180
 
181
181
  // --- Canvas toolbar ---
182
+ const canvasRef = ref<{ toggleMark: (mark: string) => void; toggleLink: () => void; getActiveMarks: () => Record<string, boolean> } | null>(null);
182
183
  const viewportMode = ref<'desktop' | 'tablet' | 'mobile'>('desktop');
183
184
  const canvasMaxWidth = computed(() => {
184
185
  if (viewportMode.value === 'mobile') return '375px';
@@ -259,6 +260,14 @@ const canvasMaxWidth = computed(() => {
259
260
  <div class="cpub-ae-center">
260
261
  <!-- Canvas toolbar -->
261
262
  <div class="cpub-ae-canvas-toolbar">
263
+ <!-- Text formatting -->
264
+ <button class="cpub-ae-tool-btn" title="Bold (Ctrl+B)" @click="canvasRef?.toggleMark('bold')"><i class="fa-solid fa-bold"></i></button>
265
+ <button class="cpub-ae-tool-btn" title="Italic (Ctrl+I)" @click="canvasRef?.toggleMark('italic')"><i class="fa-solid fa-italic"></i></button>
266
+ <button class="cpub-ae-tool-btn" title="Strikethrough" @click="canvasRef?.toggleMark('strike')"><i class="fa-solid fa-strikethrough"></i></button>
267
+ <button class="cpub-ae-tool-btn" title="Inline code" @click="canvasRef?.toggleMark('code')"><i class="fa-solid fa-code"></i></button>
268
+ <button class="cpub-ae-tool-btn" title="Link" @click="canvasRef?.toggleLink()"><i class="fa-solid fa-link"></i></button>
269
+ <div class="cpub-ae-toolbar-divider" />
270
+ <!-- Navigation -->
262
271
  <button class="cpub-ae-tool-btn" title="Previous block"><i class="fa-solid fa-chevron-up"></i></button>
263
272
  <button class="cpub-ae-tool-btn" title="Next block"><i class="fa-solid fa-chevron-down"></i></button>
264
273
  <div class="cpub-ae-toolbar-divider" />
@@ -272,7 +281,7 @@ const canvasMaxWidth = computed(() => {
272
281
  <!-- Scrollable canvas -->
273
282
  <div class="cpub-ae-canvas">
274
283
  <div class="cpub-ae-canvas-inner" :style="{ maxWidth: canvasMaxWidth }">
275
- <BlockCanvas :block-editor="blockEditor" :block-types="blockTypes" />
284
+ <BlockCanvas ref="canvasRef" :block-editor="blockEditor" :block-types="blockTypes" />
276
285
  </div>
277
286
  </div>
278
287
 
@@ -132,6 +132,7 @@ function closeMobileSidebars(): void {
132
132
  }
133
133
 
134
134
  // --- Canvas toolbar ---
135
+ const canvasRef = ref<{ toggleMark: (mark: string) => void; toggleLink: () => void; getActiveMarks: () => Record<string, boolean> } | null>(null);
135
136
  const viewportMode = ref<'desktop' | 'tablet' | 'mobile'>('desktop');
136
137
  const canvasMaxWidth = computed(() => {
137
138
  if (viewportMode.value === 'mobile') return '375px';
@@ -158,6 +159,13 @@ const canvasMaxWidth = computed(() => {
158
159
  <div class="cpub-be-center">
159
160
  <!-- Canvas toolbar -->
160
161
  <div class="cpub-be-canvas-toolbar">
162
+ <!-- Text formatting -->
163
+ <button class="cpub-be-tool-btn" title="Bold (Ctrl+B)" @click="canvasRef?.toggleMark('bold')"><i class="fa-solid fa-bold"></i></button>
164
+ <button class="cpub-be-tool-btn" title="Italic (Ctrl+I)" @click="canvasRef?.toggleMark('italic')"><i class="fa-solid fa-italic"></i></button>
165
+ <button class="cpub-be-tool-btn" title="Strikethrough" @click="canvasRef?.toggleMark('strike')"><i class="fa-solid fa-strikethrough"></i></button>
166
+ <button class="cpub-be-tool-btn" title="Inline code" @click="canvasRef?.toggleMark('code')"><i class="fa-solid fa-code"></i></button>
167
+ <button class="cpub-be-tool-btn" title="Link" @click="canvasRef?.toggleLink()"><i class="fa-solid fa-link"></i></button>
168
+ <div class="cpub-be-toolbar-divider" />
161
169
  <div class="cpub-be-viewport-tabs">
162
170
  <button class="cpub-be-viewport-tab" :class="{ active: viewportMode === 'desktop' }" title="Desktop" @click="viewportMode = 'desktop'"><i class="fa-solid fa-desktop"></i></button>
163
171
  <button class="cpub-be-viewport-tab" :class="{ active: viewportMode === 'tablet' }" title="Tablet" @click="viewportMode = 'tablet'"><i class="fa-solid fa-tablet-screen-button"></i></button>
@@ -233,7 +241,7 @@ const canvasMaxWidth = computed(() => {
233
241
  </div>
234
242
 
235
243
  <!-- Block editor canvas -->
236
- <BlockCanvas :block-editor="blockEditor" :block-types="blockTypes" />
244
+ <BlockCanvas ref="canvasRef" :block-editor="blockEditor" :block-types="blockTypes" />
237
245
  </div>
238
246
 
239
247
  <!-- Word count bar -->
@@ -362,9 +370,15 @@ const canvasMaxWidth = computed(() => {
362
370
  .cpub-be-canvas-toolbar {
363
371
  display: flex; align-items: center; gap: 2px; padding: 4px 12px;
364
372
  background: var(--surface); border-bottom: var(--border-width-default) solid var(--border); flex-shrink: 0; min-height: 32px;
365
- justify-content: flex-end;
366
373
  }
367
- .cpub-be-viewport-tabs { display: flex; gap: 0; }
374
+ .cpub-be-tool-btn {
375
+ width: 28px; height: 26px; display: flex; align-items: center; justify-content: center;
376
+ background: none; border: var(--border-width-default) solid transparent; color: var(--text-dim);
377
+ font-size: 11px; cursor: pointer;
378
+ }
379
+ .cpub-be-tool-btn:hover { background: var(--surface2); border-color: var(--border2); color: var(--text); }
380
+ .cpub-be-toolbar-divider { width: 2px; height: 18px; background: var(--border2); margin: 0 6px; }
381
+ .cpub-be-viewport-tabs { display: flex; gap: 0; margin-left: auto; }
368
382
  .cpub-be-viewport-tab {
369
383
  width: 28px; height: 24px; display: flex; align-items: center; justify-content: center;
370
384
  background: none; border: var(--border-width-default) solid var(--border); border-left-width: 0; color: var(--text-faint);
@@ -122,6 +122,7 @@ watch(() => props.metadata.title, (v) => { if (v !== titleRef.value) titleRef.va
122
122
  watch(titleRef, (v) => updateMeta('title', v));
123
123
 
124
124
  // --- Canvas toolbar ---
125
+ const canvasRef = ref<{ toggleMark: (mark: string) => void; toggleLink: () => void; getActiveMarks: () => Record<string, boolean> } | null>(null);
125
126
  const viewportMode = ref<'desktop' | 'tablet' | 'mobile'>('desktop');
126
127
  const canvasMaxWidth = computed(() => {
127
128
  if (viewportMode.value === 'mobile') return '375px';
@@ -163,6 +164,13 @@ const blockCount = computed(() => props.blockEditor.blocks.value.length);
163
164
  <div class="cpub-pe-center">
164
165
  <!-- Canvas toolbar -->
165
166
  <div class="cpub-pe-canvas-toolbar">
167
+ <!-- Text formatting -->
168
+ <button class="cpub-pe-tool-btn" title="Bold (Ctrl+B)" @click="canvasRef?.toggleMark('bold')"><i class="fa-solid fa-bold"></i></button>
169
+ <button class="cpub-pe-tool-btn" title="Italic (Ctrl+I)" @click="canvasRef?.toggleMark('italic')"><i class="fa-solid fa-italic"></i></button>
170
+ <button class="cpub-pe-tool-btn" title="Strikethrough" @click="canvasRef?.toggleMark('strike')"><i class="fa-solid fa-strikethrough"></i></button>
171
+ <button class="cpub-pe-tool-btn" title="Inline code" @click="canvasRef?.toggleMark('code')"><i class="fa-solid fa-code"></i></button>
172
+ <button class="cpub-pe-tool-btn" title="Link" @click="canvasRef?.toggleLink()"><i class="fa-solid fa-link"></i></button>
173
+ <div class="cpub-pe-toolbar-divider" />
166
174
  <div class="cpub-pe-viewport-tabs">
167
175
  <button class="cpub-pe-viewport-tab" :class="{ active: viewportMode === 'desktop' }" title="Desktop" @click="viewportMode = 'desktop'"><i class="fa-solid fa-desktop"></i></button>
168
176
  <button class="cpub-pe-viewport-tab" :class="{ active: viewportMode === 'tablet' }" title="Tablet" @click="viewportMode = 'tablet'"><i class="fa-solid fa-tablet-screen-button"></i></button>
@@ -207,7 +215,7 @@ const blockCount = computed(() => props.blockEditor.blocks.value.length);
207
215
  placeholder="Project title..."
208
216
  />
209
217
 
210
- <BlockCanvas :block-editor="blockEditor" :block-types="blockTypes" />
218
+ <BlockCanvas ref="canvasRef" :block-editor="blockEditor" :block-types="blockTypes" />
211
219
  </div>
212
220
  </div>
213
221
 
@@ -359,9 +367,15 @@ const blockCount = computed(() => props.blockEditor.blocks.value.length);
359
367
  .cpub-pe-canvas-toolbar {
360
368
  display: flex; align-items: center; gap: 2px; padding: 4px 12px;
361
369
  background: var(--surface); border-bottom: var(--border-width-default) solid var(--border); flex-shrink: 0; min-height: 32px;
362
- justify-content: flex-end;
363
370
  }
364
- .cpub-pe-viewport-tabs { display: flex; gap: 0; }
371
+ .cpub-pe-tool-btn {
372
+ width: 28px; height: 26px; display: flex; align-items: center; justify-content: center;
373
+ background: none; border: var(--border-width-default) solid transparent; color: var(--text-dim);
374
+ font-size: 11px; cursor: pointer;
375
+ }
376
+ .cpub-pe-tool-btn:hover { background: var(--surface2); border-color: var(--border2); color: var(--text); }
377
+ .cpub-pe-toolbar-divider { width: 2px; height: 18px; background: var(--border2); margin: 0 6px; }
378
+ .cpub-pe-viewport-tabs { display: flex; gap: 0; margin-left: auto; }
365
379
  .cpub-pe-viewport-tab {
366
380
  width: 28px; height: 24px; display: flex; align-items: center; justify-content: center;
367
381
  background: none; border: var(--border-width-default) solid var(--border); border-left-width: 0; color: var(--text-faint);
@@ -778,9 +778,11 @@ useJsonLd({
778
778
  overflow: hidden;
779
779
  }
780
780
  .cpub-cover-photo-img {
781
- width: 100%;
782
- display: block;
781
+ max-width: 100%;
782
+ max-height: 500px;
783
783
  height: auto;
784
+ display: block;
785
+ margin: 0 auto;
784
786
  }
785
787
 
786
788
  /* ── RESPONSIVE ── */
@@ -338,9 +338,11 @@ const hasSeries = computed(() => !!seriesTitle.value && seriesTotalParts.value >
338
338
  overflow: hidden;
339
339
  }
340
340
  .cpub-cover-photo-img {
341
- width: 100%;
342
- display: block;
341
+ max-width: 100%;
342
+ max-height: 500px;
343
343
  height: auto;
344
+ display: block;
345
+ margin: 0 auto;
344
346
  }
345
347
 
346
348
  /* ── ENGAGEMENT ROW ── */
@@ -937,9 +937,11 @@ async function handleBuild(): Promise<void> {
937
937
  }
938
938
 
939
939
  .cpub-cover-photo-img {
940
- width: 100%;
941
- display: block;
940
+ max-width: 100%;
941
+ max-height: 500px;
942
942
  height: auto;
943
+ display: block;
944
+ margin: 0 auto;
943
945
  }
944
946
 
945
947
  /* ── PROSE ── */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonpub/layer",
3
- "version": "0.7.14",
3
+ "version": "0.7.16",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "files": [
@@ -50,16 +50,16 @@
50
50
  "vue": "^3.4.0",
51
51
  "vue-router": "^4.3.0",
52
52
  "zod": "^4.3.6",
53
- "@commonpub/config": "0.9.0",
54
- "@commonpub/docs": "0.6.2",
55
53
  "@commonpub/auth": "0.5.0",
56
- "@commonpub/explainer": "0.7.6",
57
- "@commonpub/editor": "0.7.4",
54
+ "@commonpub/editor": "0.7.5",
55
+ "@commonpub/docs": "0.6.2",
58
56
  "@commonpub/learning": "0.5.0",
59
- "@commonpub/ui": "0.8.5",
57
+ "@commonpub/config": "0.9.0",
60
58
  "@commonpub/server": "2.27.7",
61
- "@commonpub/schema": "0.9.5",
62
- "@commonpub/protocol": "0.9.7"
59
+ "@commonpub/explainer": "0.7.6",
60
+ "@commonpub/ui": "0.8.5",
61
+ "@commonpub/protocol": "0.9.7",
62
+ "@commonpub/schema": "0.9.5"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@testing-library/jest-dom": "^6.9.1",