@commonpub/layer 0.7.19 → 0.7.21

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.
@@ -603,10 +603,18 @@ onUnmounted(() => { document.removeEventListener('keydown', onKeydown); });
603
603
  .cpub-content-wrap {
604
604
  max-width: 720px;
605
605
  margin: 0 auto;
606
- padding: 44px 36px 80px;
606
+ padding: 44px clamp(12px, 4vw, 36px) 80px;
607
607
  min-height: calc(100vh - 51px - 80px);
608
+ overflow-wrap: break-word;
609
+ word-break: break-word;
608
610
  }
609
611
 
612
+ /* Prevent content overflow */
613
+ .cpub-content-wrap :deep(img),
614
+ .cpub-content-wrap :deep(video),
615
+ .cpub-content-wrap :deep(iframe) { max-width: 100%; height: auto; }
616
+ .cpub-content-wrap :deep(pre) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
617
+
610
618
  /* ── COVER IMAGE ── */
611
619
  .cpub-explainer-cover {
612
620
  width: 100%;
@@ -773,7 +781,7 @@ onUnmounted(() => { document.removeEventListener('keydown', onKeydown); });
773
781
  @media (max-width: 768px) {
774
782
  .cpub-explainer-sidebar { display: none; }
775
783
  .cpub-mobile-author { display: flex; }
776
- .cpub-content-wrap { padding: 24px 16px 48px; }
784
+ .cpub-content-wrap { padding-top: 24px; padding-bottom: 48px; }
777
785
  .cpub-section-nav { flex-direction: column; gap: 16px; }
778
786
  .cpub-section-title { font-size: 22px; }
779
787
  .cpub-explainer-topbar { gap: 6px; padding: 0 10px; }
@@ -786,7 +794,7 @@ onUnmounted(() => { document.removeEventListener('keydown', onKeydown); });
786
794
  }
787
795
 
788
796
  @media (max-width: 480px) {
789
- .cpub-content-wrap { padding: 16px 12px 40px; }
797
+ .cpub-content-wrap { padding-top: 16px; padding-bottom: 40px; }
790
798
  .cpub-section-title { font-size: 18px; }
791
799
  .cpub-section-body { font-size: 14px; }
792
800
  .cpub-section-num-badge { width: 28px; height: 28px; font-size: 11px; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonpub/layer",
3
- "version": "0.7.19",
3
+ "version": "0.7.21",
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/editor": "0.7.5",
54
53
  "@commonpub/docs": "0.6.2",
55
- "@commonpub/auth": "0.5.0",
56
54
  "@commonpub/config": "0.9.0",
57
- "@commonpub/explainer": "0.7.6",
58
- "@commonpub/learning": "0.5.0",
59
- "@commonpub/server": "2.27.7",
55
+ "@commonpub/auth": "0.5.0",
56
+ "@commonpub/editor": "0.7.5",
60
57
  "@commonpub/protocol": "0.9.7",
58
+ "@commonpub/explainer": "0.7.6",
61
59
  "@commonpub/ui": "0.8.5",
62
- "@commonpub/schema": "0.9.5"
60
+ "@commonpub/learning": "0.5.0",
61
+ "@commonpub/schema": "0.9.5",
62
+ "@commonpub/server": "2.27.7"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@testing-library/jest-dom": "^6.9.1",
@@ -50,7 +50,25 @@ const mode = ref<'write' | 'preview' | 'code'>('write');
50
50
  const contentId = ref<string | null>(null);
51
51
 
52
52
  // --- Block editor (articles, blogs, projects) ---
53
- const blockEditor = useBlockEditor();
53
+ // Pre-populate new projects with a structured template using build step blocks
54
+ const projectTemplate: [string, Record<string, unknown>][] = [
55
+ ['heading', { text: 'Introduction', level: 2 }],
56
+ ['paragraph', { html: '<p>State what the reader will build or learn. Open with a relatable scenario or clear goal: "In this guide, we\'ll..."</p>' }],
57
+ ['heading', { text: 'Prerequisites', level: 2 }],
58
+ ['paragraph', { html: '<ul><li><p>Required tools, accounts, or hardware</p></li><li><p>Link each tool/service on first mention</p></li></ul>' }],
59
+ ['buildStep', { stepNumber: 1, instructions: 'Brief context sentence — why this step matters.\n\nNumbered steps with imperative verbs. Use code blocks for commands, inline code for filenames and values.\n\nAfter key steps, state what the reader should see or expect.', image: '', time: '' }],
60
+ ['buildStep', { stepNumber: 2, instructions: 'Continue the pattern. Each build step = one phase of the build.\n\nLink to external repos for full code instead of pasting walls of code.', image: '', time: '' }],
61
+ ['buildStep', { stepNumber: 3, instructions: 'Add as many steps as needed. Each step should be a clear, actionable phase.', image: '', time: '' }],
62
+ ['heading', { text: 'Testing & Verification', level: 2 }],
63
+ ['paragraph', { html: '<p>Tell the reader how to confirm it works. Describe expected output or show what success looks like. Mention common pitfalls briefly if relevant.</p>' }],
64
+ ['heading', { text: "What\'s Next?!", level: 2 }],
65
+ ['paragraph', { html: '<p>Summarize what was accomplished in 2–3 sentences. Suggest ideas for extending or remixing the project. Keep the tone forward-looking and inspiring.</p>' }],
66
+ ['heading', { text: 'Community', level: 2 }],
67
+ ['paragraph', { html: '<p>Invite readers to share their results. Link to relevant community spaces. Close with genuine enthusiasm: "We\'d love to see what you build!"</p>' }],
68
+ ];
69
+
70
+ const initialBlocks = isNew.value && contentType.value === 'project' ? projectTemplate : undefined;
71
+ const blockEditor = useBlockEditor(initialBlocks as [string, Record<string, unknown>][] | undefined);
54
72
 
55
73
  // --- Explainer document (explainers only) ---
56
74
  const isExplainer = computed(() => contentType.value === 'explainer');