@zvndev/darkmown 2.3.1-next.1.g3a4a8dc → 2.3.1-next.3.g33fa7dd

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.
Files changed (46) hide show
  1. package/package.json +1 -1
  2. package/site/_/footer.wd +1 -1
  3. package/site/pages/index.js +26 -21
  4. package/site/pages/index.skin +111 -205
  5. package/site/pages/index.wd +115 -103
  6. package/site/pages/vs/markdoc.skin +53 -0
  7. package/site/pages/vs/markdoc.wd +96 -0
  8. package/types/compiler/context.d.ts +74 -60
  9. package/types/compiler/reader.d.ts +10 -2
  10. package/types/src/api-runner.d.ts +0 -94
  11. package/types/src/builder.d.ts +0 -170
  12. package/types/src/catalog.d.ts +0 -97
  13. package/types/src/compiler/actions.d.ts +0 -41
  14. package/types/src/compiler/body.d.ts +0 -11
  15. package/types/src/compiler/collections.d.ts +0 -76
  16. package/types/src/compiler/context.d.ts +0 -647
  17. package/types/src/compiler/directives.d.ts +0 -6
  18. package/types/src/compiler/expr-ast.d.ts +0 -20
  19. package/types/src/compiler/fetch.d.ts +0 -29
  20. package/types/src/compiler/format.d.ts +0 -49
  21. package/types/src/compiler/forms.d.ts +0 -94
  22. package/types/src/compiler/frontmatter.d.ts +0 -33
  23. package/types/src/compiler/fs-reader.d.ts +0 -7
  24. package/types/src/compiler/image-size.d.ts +0 -14
  25. package/types/src/compiler/includes.d.ts +0 -100
  26. package/types/src/compiler/index.d.ts +0 -5
  27. package/types/src/compiler/interpolation.d.ts +0 -115
  28. package/types/src/compiler/loops.d.ts +0 -36
  29. package/types/src/compiler/markdown.d.ts +0 -34
  30. package/types/src/compiler/media.d.ts +0 -32
  31. package/types/src/compiler/page.d.ts +0 -109
  32. package/types/src/compiler/predicates.d.ts +0 -50
  33. package/types/src/compiler/reader.d.ts +0 -48
  34. package/types/src/compiler/state.d.ts +0 -68
  35. package/types/src/compiler/structure.d.ts +0 -56
  36. package/types/src/compiler.d.ts +0 -48
  37. package/types/src/config.d.ts +0 -45
  38. package/types/src/dev.d.ts +0 -58
  39. package/types/src/errors.d.ts +0 -100
  40. package/types/src/feeds.d.ts +0 -150
  41. package/types/src/headers.d.ts +0 -44
  42. package/types/src/highlight.d.ts +0 -24
  43. package/types/src/router.d.ts +0 -78
  44. package/types/src/scaffold.d.ts +0 -20
  45. package/types/src/skin.d.ts +0 -48
  46. package/types/src/statics.d.ts +0 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zvndev/darkmown",
3
- "version": "2.3.1-next.1.g3a4a8dc",
3
+ "version": "2.3.1-next.3.g33fa7dd",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
package/site/_/footer.wd CHANGED
@@ -5,7 +5,7 @@ html: true
5
5
  <footer class="sitefooter">
6
6
  <div class="foot-inner">
7
7
  <div>
8
- <strong>Darkmown</strong> — Markdown that runs.
8
+ <strong>Darkmown</strong>. Markdown that runs.
9
9
  <div class="small">Zero JS on static pages · one ~7.7&nbsp;KB runtime when reactive.</div>
10
10
  </div>
11
11
  <nav class="foot-links">
@@ -1,29 +1,34 @@
1
- const copyBtn = document.querySelector("[data-copy-cmd]");
1
+ // Colocated behavior for the landing page, discovered by basename
2
+ // (site/pages/index.wd -> site/pages/index.js). It is the only hand-written
3
+ // JavaScript on this page; everything else is directives.
4
+ //
5
+ // The page authors its install command as a plain ```sh fence so the source
6
+ // stays free of raw HTML. The copy button is added here instead: progressive
7
+ // enhancement, so the command is still readable and selectable with JS off.
2
8
 
3
- if (copyBtn) {
4
- copyBtn.addEventListener("click", async () => {
5
- const cmd = copyBtn.previousElementSibling?.textContent ?? "";
9
+ const installBlock = document.querySelector(".hero pre > code");
10
+
11
+ if (installBlock && navigator.clipboard) {
12
+ const pre = installBlock.parentElement;
13
+ const button = document.createElement("button");
14
+ button.type = "button";
15
+ button.className = "copy-cmd";
16
+ button.textContent = "Copy";
17
+ button.setAttribute("aria-label", "Copy install command");
18
+ pre.classList.add("has-copy");
19
+ pre.append(button);
20
+
21
+ button.addEventListener("click", async () => {
6
22
  try {
7
- await navigator.clipboard.writeText(cmd);
8
- copyBtn.textContent = "Copied";
9
- copyBtn.classList.add("is-copied");
23
+ await navigator.clipboard.writeText(installBlock.textContent.trim());
24
+ button.textContent = "Copied";
25
+ button.classList.add("is-copied");
10
26
  setTimeout(() => {
11
- copyBtn.textContent = "Copy";
12
- copyBtn.classList.remove("is-copied");
27
+ button.textContent = "Copy";
28
+ button.classList.remove("is-copied");
13
29
  }, 1600);
14
30
  } catch {
15
- copyBtn.textContent = "Select + ⌘C";
31
+ button.textContent = "Select + ⌘C";
16
32
  }
17
33
  });
18
34
  }
19
-
20
- const button = document.querySelector("[data-wd-demo]");
21
-
22
- if (button) {
23
- button.addEventListener("click", () => {
24
- button.classList.toggle("is-on");
25
- button.textContent = button.classList.contains("is-on")
26
- ? "Colocated index.js is active"
27
- : "Script is waiting";
28
- });
29
- }
@@ -1,5 +1,9 @@
1
- /* Landing page — layers on /base.wd (tokens, type, components, dark mode).
2
- Only landing-specific layout lives here. */
1
+ /* Landing page. Layers on /base.wd (tokens, type, components, dark mode).
2
+ Only landing-specific layout lives here.
3
+
4
+ The page itself contains no raw HTML: every block below is produced by a
5
+ `::: name` container, a markdown element, or a directive. Class names match
6
+ the container names in site/pages/index.wd. */
3
7
 
4
8
  /* ── Hero ───────────────────────────────────────────────────────── */
5
9
 
@@ -9,173 +13,105 @@
9
13
  margin-bottom 2.5rem
10
14
 
11
15
  .hero h1
12
- max-width 16ch
16
+ max-width 15ch
17
+ font-size clamp(2.4rem, 6vw, 3.6rem)
13
18
 
14
19
  .hero h1 em
15
20
  font-style italic
16
21
  color $accent
17
22
 
18
23
  .hero > p
19
- max-width 64ch
24
+ max-width 60ch
20
25
  font-size 1.18rem
21
26
  color $ink-soft
22
27
  margin 1rem 0 1.75rem
23
28
 
24
- .hero .eyebrow
25
- background $accent-soft
26
- padding .3rem .7rem
27
- radius 999px
28
-
29
- .hero-cta
30
- display flex
31
- flex-wrap wrap
32
- margin-bottom 1.5rem
33
-
34
- .hero-install
35
- display inline-flex
36
- align-items center
37
- gap .55rem
38
- max-width 100%
39
- margin 0 0 2rem
40
- padding .7rem 1rem
29
+ /* The install command is a plain ```sh fence; index.js appends the copy
30
+ button, so the markup stays directive-only and works with JS off. */
31
+ .hero pre
32
+ position relative
33
+ max-width 34rem
34
+ margin 0 0 1.75rem
35
+ padding .85rem 1rem
41
36
  border 1px solid $line
42
37
  radius 10px
43
38
  bg $sunk
44
- font-family ui-monospace, SFMono-Regular, Menlo, monospace
45
- overflow-x auto
46
39
 
47
- .hero-install::before
48
- content "$"
49
- color $accent
50
- font-weight 700
51
- flex-shrink 0
52
-
53
- .hero-install code
54
- font-family inherit
40
+ .hero pre code
55
41
  font-size .95rem
56
42
  color $ink
57
43
  white-space nowrap
58
44
 
59
- .hero-install .copy-cmd
60
- flex-shrink 0
61
- margin-left .35rem
62
- padding .25rem .65rem
45
+ .hero pre.has-copy
46
+ padding-right 5.5rem
47
+
48
+ .hero pre .copy-cmd
49
+ position absolute
50
+ top 50%
51
+ right .6rem
52
+ transform translateY(-50%)
53
+ padding .3rem .7rem
63
54
  border 1px solid $line
64
55
  radius 7px
65
- bg transparent
56
+ bg $panel
66
57
  color $ink-soft
67
58
  font-family inherit
68
59
  font-size .8rem
69
60
  cursor pointer
70
61
 
71
- .hero-install .copy-cmd:hover
62
+ .hero pre .copy-cmd:hover
72
63
  color $ink
73
64
  border-color $accent
74
65
 
75
- .hero-install .copy-cmd.is-copied
66
+ .hero pre .copy-cmd.is-copied
76
67
  color $accent
77
68
  border-color $accent
78
69
 
79
- .hero-stats
80
- display grid
81
- grid-template-columns repeat(4, auto)
82
- gap 1.25rem 2.5rem
83
- list-style none
84
- padding 0
85
- margin 0
86
- border-top 1px solid $line-soft
87
- padding-top 1.5rem
88
-
89
- .hero-stats li
70
+ .hero-cta
90
71
  display flex
91
- flex-direction column
92
-
93
- .hero-stats strong
94
- font-size 1.6rem
95
- color $accent
96
- letter-spacing -.02em
97
-
98
- .hero-stats span
99
- font-size .82rem
100
- color $muted
101
- max-width 18ch
102
-
103
- @media (max-width: 720px)
104
- .hero-stats
105
- grid-template-columns 1fr 1fr
106
-
107
- /* ── vs-Markdoc comparison ──────────────────────────────────────── */
72
+ flex-wrap wrap
73
+ gap .6rem
74
+ margin 0
108
75
 
109
- .versus
110
- display grid
111
- grid-template-columns 1fr 1fr
112
- gap 1.25rem
113
- align-items start
114
- margin 2.5rem 0 1rem
76
+ /* ── Source + the same file running, as one paired module ───────── */
115
77
 
116
- .vs-card
78
+ /* The source block and the live demo are deliberately the same width and sit
79
+ inside one bordered card, so the "this text produced that UI" claim reads as
80
+ a single before/after unit rather than two unrelated page chunks. */
81
+ .pair
82
+ max-width 46rem
83
+ margin 1.25rem 0 2.5rem
84
+ padding 1.25rem
117
85
  border 1px solid $line
118
86
  radius $radius
119
87
  bg $panel
120
- padding 1.35rem
121
- display flex
122
- flex-direction column
123
- min-width 0
124
- box-shadow 0 1px 2px rgba(28,24,20,.04)
125
-
126
- .vs-card.vs-dark
127
- background linear-gradient(180deg, $accent-soft, $panel)
128
- border 1px solid $accent
129
88
 
130
- .vs-head
131
- display flex
132
- align-items baseline
133
- justify-content space-between
134
- gap .75rem
135
- margin-bottom .85rem
136
-
137
- .vs-tag
138
- font-family ui-monospace, SFMono-Regular, Menlo, monospace
139
- font-size .72rem
140
- font-weight 700
89
+ .pairlabel
90
+ margin 0 0 .5rem
91
+ font-size .78rem
141
92
  text-transform uppercase
142
- letter-spacing .08em
143
- padding .25rem .55rem
144
- radius 999px
145
-
146
- .vs-tag-wd
147
- color white
148
- bg $accent
149
-
150
- .vs-tag-md
93
+ letter-spacing .07em
151
94
  color $muted
152
- bg $sunk
153
- border 1px solid $line
154
95
 
155
- .vs-sub
156
- font-family ui-monospace, SFMono-Regular, Menlo, monospace
157
- font-size .82rem
158
- color $muted
96
+ .pairlabel code
97
+ font-size .78rem
98
+ text-transform none
99
+ letter-spacing 0
100
+ color $ink
159
101
 
160
- .vs-card pre
161
- margin .25rem 0 0
162
- font-size .8rem
163
- line-height 1.55
102
+ .pair > pre
103
+ margin 0 0 1.5rem
164
104
 
165
- .vs-live-label
166
- margin 1rem 0 .35rem
167
- font-size .88rem
168
- color $muted
169
- font-style italic
105
+ .pair .pairlabel + .demo
106
+ margin 0
170
107
 
171
- .vs-live
172
- border 1px dashed $accent
108
+ .demo
109
+ border 1px solid $accent
173
110
  radius $radius-sm
174
- background color-mix(in srgb, $accent-soft 50%, $panel)
175
- padding 1rem 1.1rem .85rem
176
- margin .15rem 0 0
111
+ background color-mix(in srgb, $accent-soft 45%, $panel)
112
+ padding 1.15rem 1.25rem 1rem
177
113
 
178
- .vs-live input[data-wd-bind-input]
114
+ .demo input[data-wd-bind-input]
179
115
  width 100%
180
116
  box-sizing border-box
181
117
  font-family inherit
@@ -187,7 +123,7 @@
187
123
  color $ink
188
124
  margin 0 0 .75rem
189
125
 
190
- .vs-live .product
126
+ .demo .product
191
127
  display flex
192
128
  align-items center
193
129
  justify-content space-between
@@ -199,10 +135,10 @@
199
135
  radius 8px
200
136
  font-size .95rem
201
137
 
202
- .vs-live .product p
138
+ .demo .product p
203
139
  margin 0
204
140
 
205
- .vs-live .product button
141
+ .demo .product button
206
142
  border 0
207
143
  bg $accent
208
144
  color white
@@ -213,57 +149,68 @@
213
149
  cursor pointer
214
150
  flex-shrink 0
215
151
 
216
- .vs-live .product button:hover
152
+ .demo .product button:hover
217
153
  bg $accent-deep
218
154
 
219
- .vs-live > p:last-of-type
155
+ .demo > p:last-of-type
220
156
  margin .85rem 0 0
221
157
  font-size .95rem
222
158
 
223
- .vs-needs
224
- margin 1rem 0 0
225
- padding 1rem 1.1rem
226
- border-left 3px solid $warm
227
- bg $warm-soft
228
- radius 8px
159
+ /* ── Live data strip (:fetch stars + visits) ────────────────────── */
229
160
 
230
- .vs-needs strong
231
- color $warm
232
- font-size .92rem
161
+ .livestrip
162
+ display grid
163
+ grid-template-columns repeat(4, 1fr)
164
+ gap 1rem
165
+ margin 1.5rem 0 2rem
166
+ padding 1.35rem 0
167
+ border-top 1px solid $line-soft
168
+ border-bottom 1px solid $line-soft
169
+
170
+ /* Every stat is structurally identical: the value is a bare <p> (either plain
171
+ prose or the body of an `:if` region), the label is its own `.statlabel`
172
+ container. Keeping the label in a container is what stops markdown from
173
+ folding value and label into one paragraph, which is exactly what happened
174
+ when they were two adjacent lines. */
175
+ .stat
176
+ display flex
177
+ flex-direction column
178
+ gap .2rem
179
+ min-width 0
233
180
 
234
- .vs-needs pre
235
- margin .7rem 0 .6rem
236
- font-size .78rem
181
+ .stat > p
182
+ margin 0
183
+ font-size 1.85rem
184
+ line-height 1.05
185
+ color $accent
186
+ letter-spacing -.02em
187
+ font-variant-numeric tabular-nums
237
188
 
238
- .vs-needs-foot
239
- display block
240
- font-size .85rem
241
- color $muted
189
+ /* The `:if` lifecycle regions wrap the value; unwrap them for layout so the
190
+ value sits on the same baseline whether it is static or fetched. */
191
+ .stat > div[data-wd-if] p
192
+ margin 0
193
+ font-size 1.85rem
194
+ line-height 1.05
195
+ color $accent
196
+ letter-spacing -.02em
197
+ font-variant-numeric tabular-nums
242
198
 
243
- .vs-caption
244
- margin auto 0 0
245
- padding-top 1rem
246
- font-style italic
247
- color $ink
248
- font-size .95rem
199
+ .statlabel
200
+ font-size .88rem
201
+ line-height 1.35
202
+ color $ink-soft
203
+ max-width 20ch
249
204
 
250
- .vs-card.vs-dark .vs-caption
251
- color $accent-deep
205
+ .statlabel p
206
+ margin 0
252
207
 
253
208
  @media (max-width: 720px)
254
- .versus
255
- grid-template-columns 1fr
256
- gap 1rem
257
-
258
- /* ── Secondary value props ──────────────────────────────────────── */
259
-
260
- .props
261
- margin 1.5rem 0 0
262
-
263
- .props h2
264
- margin-top 1.5rem
209
+ .livestrip
210
+ grid-template-columns 1fr 1fr
211
+ gap 1.25rem
265
212
 
266
- /* ── Demo-directive widgets (`:try`, feature-card include, index.js) ─ */
213
+ /* ── Demo-directive widgets (`:try`) ────────────────────────────── */
267
214
 
268
215
  .try-card
269
216
  display inline-flex
@@ -286,44 +233,3 @@
286
233
  padding .1rem .5rem
287
234
  radius 999px
288
235
  font-size .8rem
289
-
290
- .feature-card
291
- display grid
292
- gap .35rem
293
- margin 1rem 0
294
- padding 1.1rem 1.25rem
295
- bg $panel
296
- border 1px solid $line
297
- radius $radius
298
-
299
- .feature-card strong
300
- color $warm
301
-
302
- .pulse-button
303
- border 0
304
- bg $ink
305
- color $paper
306
- padding .85rem 1.15rem
307
- radius 999px
308
- font-family inherit
309
- cursor pointer
310
-
311
- .pulse-button.is-on
312
- bg $warm
313
-
314
- .sprint-board
315
- display grid
316
- grid-template-columns repeat(auto-fit, minmax(130px, 1fr))
317
- gap 1rem
318
- margin 1rem 0
319
-
320
- .sprint-board article
321
- bg $panel
322
- border 1px solid $line
323
- padding 1rem
324
- radius $radius
325
-
326
- .sprint-board span
327
- display block
328
- color $accent
329
- font-size .9rem