mosaic-headless 1.28.0 → 1.29.0

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.
package/SKILL.md CHANGED
@@ -4,7 +4,7 @@ description: |
4
4
  Build and modify Mosaic Pro (Nextend) sites by writing the underlying data model directly - no visual editor, no DOM. Query the real surface with `mo.py`, which joins every source table to the live sweeps so a lookup leads with the measured verdict rather than the declaration (128 node types, 191 properties, 98 style properties with 20 structured value shapes pinned down, 53 style states, 156 variants, 74 dynamic variables, 15 interaction triggers, 115 REST routes, 23 tables) instead of guessing, with every node type placed on a live site one at a time and asserted against the delivered HTML, the design-token and element-class layers verified against compiled CSS, the @VAR() dynamic language verified against rendered output, nine designed pages built through the tables themselves, and the delivered pages re-read in Chromium at three viewports so a rule that is present, correct and still wrong cannot pass. Drives Mosaic's own theme export/import and its plugin data upgrade from outside the editor and holds the copy against the source tree for tree. Measured on Mosaic Pro 1.0.9: the modal (`<dialog>`), OpenStreetMap, the exit-intent and scroll-depth triggers, run rules and the memory actions all built on a live page and read back, and the 1.0.7 -> 1.0.8 -> 1.0.9 migrations driven from outside wp-admin.
5
5
  license: "MIT"
6
6
  author: "moksa (https://moksaweb.com)"
7
- version: "1.28.0"
7
+ version: "1.29.0"
8
8
  ---
9
9
 
10
10
  # Headless Mosaic
@@ -530,15 +530,15 @@ so the pattern is in the data, not just in this paragraph.
530
530
  | `data/conversion-batch.csv` | 19 | **converted, built and checked live, one page after another** - every Elementor page of a production site through the converter, with per-page element and content counts |
531
531
  | `data/token-benchmark.csv` | 6 | **measured with tiktoken** - the same six lookups priced three ways: reading the plugin source, loading every table, querying `mo.py`. 71-99.5% fewer tokens than the source and 99.6%+ fewer than the tables, which total 259,539 - never load them, query them |
532
532
  | `data/slider-verification.csv` | 30 | **driven live** - two sliders, one autoplaying and one a carousel: advance, arrows, bullets, keyboard, reduced motion |
533
- | `data/navigation-verification.csv` | 39 | **fetched and opened live** - every menu item is a real `<a href>`, every page of the nineteen answers 200, and no page scrolls sideways at 390 / 768 / 1280 |
533
+ | `data/navigation-verification.csv` | 36 | **fetched and opened live** - every menu item is a real `<a href>`, every page of the nineteen answers 200, and no page scrolls sideways at 390 / 768 / 1280 |
534
534
  | `data/page-modal-verification.csv` | 19 | **read live** - one modal per page, and what each one's trigger, run rule, memory scope and dismissal policy actually came out as |
535
535
  | `data/dialog-verification.csv` | 19 | **driven live** - the 1.0.9 modal, its triggers, its run rules and the memory actions, each exercised in a real browser |
536
536
  | `data/dialog-form-verification.csv` | 49 | **driven live** - the same three nodes made into five FORMS (sheet, drawer, corner, takeover, gate), each re-opened at 390px and 768px; also where `pickOne` on a click turned out to be a latch rather than a lottery |
537
537
  | `data/token-verification.csv` | 15 | **driven live** - every `:root` custom property declared once, non-empty, and resolved by something on the page; a token nothing points at is a token that is not working |
538
538
  | `data/mobile-audit.csv` | 63 | **driven live** - what a sideways-scroll check cannot see: type under the legible floor, controls too small to hit, a grid that never collapsed, content escaping its box |
539
- | `data/component-wall-verification.csv` | 13 | **driven live** - tabs switched, an accordion opened, a form's fields and Mosaic's own honeypot, and an OpenStreetMap asserted on the coordinates it was GIVEN rather than the default it falls back to |
540
- | `data/form-surface-verification.csv` | 8 | **driven live** - every field type Mosaic ships in one form: select with labelled options, radio and checkbox groups, file upload, and the browser's own validation refusing an empty submit |
541
- | `data/content-loop-verification.csv` | 10 | **driven live** - a slider, a tab bar, a list and a paginated archive whose children all come from one authored template repeated per post; the pagination is clicked and the rows asserted to CHANGE |
539
+ | `data/component-wall-verification.csv` | 19 | **driven live** - tabs switched, an accordion opened, a form's fields and Mosaic's own honeypot, and an OpenStreetMap asserted on the coordinates it was GIVEN rather than the default it falls back to |
540
+ | `data/form-surface-verification.csv` | 12 | **driven live** - every field type Mosaic ships in one form: select with labelled options, radio and checkbox groups, file upload, and the browser's own validation refusing an empty submit |
541
+ | `data/content-loop-verification.csv` | 11 | **driven live** - a slider, a tab bar, a list and a paginated archive whose children all come from one authored template repeated per post; the pagination is clicked and the rows asserted to CHANGE |
542
542
  | `data/custom-fields-verification.csv` | 62 | **rendered live** - ACF and Meta Box fields of every common type read back through `@VAR` / `@LOOP` off the delivered page, loops included |
543
543
  | `data/theme-zip-verification.csv` | 22 | **round-tripped live** - Mosaic's own ZIP export imported in test mode and compared to its source, table by table and tree by tree |
544
544
  | `data/node-type-notes.csv` | 8 | where a sweep outcome is true but misleading on its own, why. Surfaced by `mo.py type` |
@@ -20,7 +20,7 @@
20
20
  "description": "Build and modify Mosaic Pro (Nextend) sites by writing the underlying data model directly - no visual editor, no DOM. Query the real surface (122 node types, 181 node properties, 98 style properties, 53 style states, 151 element classes, 74 dynamic variables, 114 REST routes, 23 tables) instead of guessing, with every node type placed on a live site one at a time and asserted against the delivered HTML, every style and node property swept against the compiled CSS and markup, and 569 responsive declarations checked against the stylesheet the site actually served.",
21
21
  "license": "MIT",
22
22
  "author": "moksa (https://moksaweb.com)",
23
- "version": "1.28.0"
23
+ "version": "1.29.0"
24
24
  },
25
25
  "loaderBehaviour": "Upload via Settings -> Skills -> Upload. Claude.ai parses SKILL.md frontmatter and surfaces the skill in your library. The extraction tool (extract-block-schema.php) needs a live WP-CLI connection and won't run in the sandbox; use it from a local terminal against your own site instead.",
26
26
  "uploadSteps": [
@@ -20,7 +20,7 @@
20
20
  "description": "Build and modify Mosaic Pro (Nextend) sites by writing the underlying data model directly - no visual editor, no DOM. Query the real surface (122 node types, 181 node properties, 98 style properties, 53 style states, 151 element classes, 74 dynamic variables, 114 REST routes, 23 tables) instead of guessing, with every node type placed on a live site one at a time and asserted against the delivered HTML, every style and node property swept against the compiled CSS and markup, and 569 responsive declarations checked against the stylesheet the site actually served.",
21
21
  "license": "MIT",
22
22
  "author": "moksa (https://moksaweb.com)",
23
- "version": "1.28.0"
23
+ "version": "1.29.0"
24
24
  },
25
25
  "loaderBehaviour": "Auto-loads on session start when SKILL.md frontmatter parses successfully.",
26
26
  "verified": true,
@@ -20,7 +20,7 @@
20
20
  "description": "Build and modify Mosaic Pro (Nextend) sites by writing the underlying data model directly - no visual editor, no DOM. Query the real surface (122 node types, 181 node properties, 98 style properties, 53 style states, 151 element classes, 74 dynamic variables, 114 REST routes, 23 tables) instead of guessing, with every node type placed on a live site one at a time and asserted against the delivered HTML, every style and node property swept against the compiled CSS and markup, and 569 responsive declarations checked against the stylesheet the site actually served.",
21
21
  "license": "MIT",
22
22
  "author": "moksa (https://moksaweb.com)",
23
- "version": "1.28.0"
23
+ "version": "1.29.0"
24
24
  },
25
25
  "loaderBehaviour": "Confirmed (2026-07-11): Codex CLI natively supports the SKILL.md spec. Place SKILL.md under .codex/skills/<name>/ (project) or ~/.codex/skills/<name>/ (personal) and Codex loads the name+description at session start, then the full body on demand. A parallel, broader convention .agents/skills/ (searched from cwd up to repo root, then ~/.agents/skills/) also exists across multiple tools - if your Codex CLI version prioritizes that path instead, mirror the same SKILL.md there.",
26
26
  "verified": true,
@@ -20,7 +20,7 @@
20
20
  "description": "Build and modify Mosaic Pro (Nextend) sites by writing the underlying data model directly - no visual editor, no DOM. Query the real surface (122 node types, 181 node properties, 98 style properties, 53 style states, 151 element classes, 74 dynamic variables, 114 REST routes, 23 tables) instead of guessing, with every node type placed on a live site one at a time and asserted against the delivered HTML, every style and node property swept against the compiled CSS and markup, and 569 responsive declarations checked against the stylesheet the site actually served.",
21
21
  "license": "MIT",
22
22
  "author": "moksa (https://moksaweb.com)",
23
- "version": "1.28.0"
23
+ "version": "1.29.0"
24
24
  },
25
25
  "loaderBehaviour": "CHANGED as of 2026-07-11: GitHub Copilot added a proper '.github/skills/' Agent Skills directory (December 2025), alongside the older single-file .github/copilot-instructions.md convention. This config targets the new skills-directory form. If your Copilot version predates this (pre Dec 2025), use the instructions-append fallback instead (see fallback below).",
26
26
  "fallback": {
@@ -20,7 +20,7 @@
20
20
  "description": "Build and modify Mosaic Pro (Nextend) sites by writing the underlying data model directly - no visual editor, no DOM. Query the real surface (122 node types, 181 node properties, 98 style properties, 53 style states, 151 element classes, 74 dynamic variables, 114 REST routes, 23 tables) instead of guessing, with every node type placed on a live site one at a time and asserted against the delivered HTML, every style and node property swept against the compiled CSS and markup, and 569 responsive declarations checked against the stylesheet the site actually served.",
21
21
  "license": "MIT",
22
22
  "author": "moksa (https://moksaweb.com)",
23
- "version": "1.28.0"
23
+ "version": "1.29.0"
24
24
  },
25
25
  "loaderBehaviour": "CHANGED as of 2026-07-11: Gemini CLI now natively supports the same SKILL.md standard as Claude Code and Codex CLI - the same directory-based skill works unmodified. Gemini CLI discovers skills in this precedence order: built-in, extension skills, ~/.gemini/skills/ (personal), .gemini/skills/ (project, shared via version control). At session start Gemini injects each discovered skill's name+description into the system prompt and calls activate_skill when a task matches.",
26
26
  "verified": true,
@@ -10,5 +10,11 @@ FORM/required,PASS,required is set on 3 of them
10
10
  FORM/honeypot,PASS,"Mosaic adds its own spam trap: ['mosaic_hp_url', 'mosaic_hp_ts']"
11
11
  FORM/option_labels,SKIPPED,no select on this form
12
12
  FORM/required_blocks,PASS,"empty form reports invalid: ['name', 'email', 'message']"
13
+ COMPONENT/instances,PASS,"3 instances: ['cs-0-cs-card', 'cs-1-cs-card', 'cs-2-cs-card']"
14
+ COMPONENT/one_definition,PASS,"all share the generated class ['_fm'] - one definition, not 3 copies"
15
+ COMPONENT/content_differs,PASS,"3 instances, 3 distinct bodies - the overrides are per-instance"
16
+ LOOP/slider,SKIPPED,not on this page
17
+ LOOP/tabs,SKIPPED,not on this page
18
+ LOOP/pagination,SKIPPED,not on this page
13
19
  MAP/frame,PASS,renders an openstreetmap iframe
14
20
  MAP/coordinates_applied,PASS,"marker=24.147700,120.673600"
@@ -2,10 +2,11 @@ check,result,detail
2
2
  TABS,SKIPPED,not on this page
3
3
  ACCORDION,SKIPPED,not on this page
4
4
  FORM,SKIPPED,not on this page
5
+ COMPONENT/instances,SKIPPED,fewer than two on this page
5
6
  LOOP/slider,PASS,6 slides from one authored slider-slide
6
7
  LOOP/tabs,PASS,4 tabs from one authored tabs-tab
7
8
  LOOP/tab_labels_intact,PASS,"no replacement characters - @substr counts bytes, so a length that is not a multiple of the encoding cuts a glyph in half"
8
- LOOP/pagination_links,PASS,"3 page links: ['v=5499&notes=1', 'v=5499&notes=2', 'v=5499&notes=3']"
9
+ LOOP/pagination_links,PASS,"3 page links: ['v=16802&notes=1', 'v=16802&notes=2', 'v=16802&notes=3']"
9
10
  LOOP/pagination_key_is_safe,PASS,paginationKey does not collide with a WordPress query var
10
11
  LOOP/pagination_changes_rows,PASS,page 1 3 -> page 2 3
11
12
  MAP,SKIPPED,not on this page
@@ -6,4 +6,8 @@ FORM/required,PASS,required is set on 8 of them
6
6
  FORM/honeypot,PASS,"Mosaic adds its own spam trap: ['mosaic_hp_url', 'mosaic_hp_ts']"
7
7
  FORM/option_labels,PASS,"5 options, all labelled"
8
8
  FORM/required_blocks,PASS,"empty form reports invalid: ['name', 'email', 'kind', 'kind']"
9
+ COMPONENT/instances,SKIPPED,fewer than two on this page
10
+ LOOP/slider,SKIPPED,not on this page
11
+ LOOP/tabs,SKIPPED,not on this page
12
+ LOOP/pagination,SKIPPED,not on this page
9
13
  MAP,SKIPPED,not on this page
@@ -1,8 +1,8 @@
1
1
  path,width,finding,element,detail
2
- content/,390,GRID_NOT_COLLAPSED,mk-f-links,2 columns at 390px
3
- forms/,390,GRID_NOT_COLLAPSED,mk-f-links,2 columns at 390px
4
2
  components/,390,GRID_NOT_COLLAPSED,cp-tabs-menu,2 columns at 390px
5
3
  components/,390,GRID_NOT_COLLAPSED,mk-f-links,2 columns at 390px
4
+ content/,390,GRID_NOT_COLLAPSED,mk-f-links,2 columns at 390px
5
+ forms/,390,GRID_NOT_COLLAPSED,mk-f-links,2 columns at 390px
6
6
  dialogs/,390,GRID_NOT_COLLAPSED,mk-f-links,2 columns at 390px
7
7
  sliders/,390,SMALL_TARGET,sl-main-nav-dot,34x28:
8
8
  sliders/,390,SMALL_TARGET,sl-main-nav-dot,34x28:
@@ -18,11 +18,11 @@ sliders/,390,GRID_NOT_COLLAPSED,mk-f-links,2 columns at 390px
18
18
  tokens/,390,GRID_NOT_COLLAPSED,mk-f-links,2 columns at 390px
19
19
  dynamic/,390,GRID_NOT_COLLAPSED,mk-f-links,2 columns at 390px
20
20
  conversion/,390,GRID_NOT_COLLAPSED,mk-f-links,2 columns at 390px
21
+ components/,768,LONG_MEASURE,m-text,44 chars/line
22
+ components/,768,LONG_MEASURE,m-text,56 chars/line
21
23
  content/,768,LONG_MEASURE,m-text,43 chars/line
22
24
  content/,768,LONG_MEASURE,m-text,58 chars/line
23
25
  forms/,768,LONG_MEASURE,m-text,59 chars/line
24
- components/,768,LONG_MEASURE,m-text,44 chars/line
25
- components/,768,LONG_MEASURE,m-text,56 chars/line
26
26
  dialogs/,768,LONG_MEASURE,m-text,46 chars/line
27
27
  dialogs/,768,LONG_MEASURE,m-text,45 chars/line
28
28
  dialogs/,768,LONG_MEASURE,m-text,45 chars/line
@@ -1,21 +1,18 @@
1
1
  check,result,detail
2
- FRONT_PAGE,PASS,"HTTP 200, 240862 bytes"
3
- MENU_IS_LINKS,PASS,4 real <a href> in #mk-nav
4
- NAV 服務,PASS,"/#services -> HTTP 200, 240958 bytes"
5
- NAV 作品,PASS,"/#works -> HTTP 200, 240958 bytes"
6
- NAV 產品,PASS,"/#products -> HTTP 200, 240958 bytes"
7
- NAV 聯絡,PASS,"/#contact -> HTTP 200, 240958 bytes"
8
- PAGE moksa,PASS,"HTTP 200, 240862 bytes"
9
- PAGE my-account,PASS,"HTTP 200, 101069 bytes"
10
- PAGE intro,PASS,"HTTP 200, 134776 bytes"
11
- PAGE content,PASS,"HTTP 200, 102296 bytes"
12
- PAGE forms,PASS,"HTTP 200, 101374 bytes"
13
- PAGE components,PASS,"HTTP 200, 115556 bytes"
14
- PAGE conversion,PASS,"HTTP 200, 103234 bytes"
15
- PAGE dynamic,PASS,"HTTP 200, 112654 bytes"
16
- PAGE tokens,PASS,"HTTP 200, 125824 bytes"
17
- PAGE sliders,PASS,"HTTP 200, 151841 bytes"
18
- PAGE dialogs,PASS,"HTTP 200, 207378 bytes"
2
+ FRONT_PAGE,PASS,"HTTP 200, 240831 bytes"
3
+ MENU_IS_LINKS,PASS,1 real <a href> in #mk-nav
4
+ NAV 首頁,PASS,"/ -> HTTP 200, 240830 bytes"
5
+ PAGE moksa,PASS,"HTTP 200, 240830 bytes"
6
+ PAGE my-account,PASS,"HTTP 200, 101036 bytes"
7
+ PAGE intro,PASS,"HTTP 200, 134744 bytes"
8
+ PAGE content,PASS,"HTTP 200, 102378 bytes"
9
+ PAGE forms,PASS,"HTTP 200, 101343 bytes"
10
+ PAGE components,PASS,"HTTP 200, 115524 bytes"
11
+ PAGE conversion,PASS,"HTTP 200, 103202 bytes"
12
+ PAGE dynamic,PASS,"HTTP 200, 112622 bytes"
13
+ PAGE tokens,PASS,"HTTP 200, 125792 bytes"
14
+ PAGE sliders,PASS,"HTTP 200, 151809 bytes"
15
+ PAGE dialogs,PASS,"HTTP 200, 207347 bytes"
19
16
  ANCHORS moksa,PASS,every in-page link resolves
20
17
  ANCHORS my-account,PASS,every in-page link resolves
21
18
  ANCHORS intro,PASS,every in-page link resolves
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mosaic-headless",
3
- "version": "1.28.0",
3
+ "version": "1.29.0",
4
4
  "description": "AI-agent skill: build Mosaic Pro (Nextend) WordPress sites by writing the underlying data model directly - 23 custom tables, no visual editor, no DOM. Every node type, style property and node property swept against a live install and asserted on the delivered HTML and compiled CSS. Installs into Claude Code, Cursor, Codex CLI, Gemini CLI, Copilot, Continue, Windsurf and Claude.ai.",
5
5
  "keywords": [
6
6
  "wordpress",
@@ -196,3 +196,33 @@ is in the wrong hemisphere. The three coordinate properties take
196
196
  The element is an `<iframe>` to openstreetmap.org, not a tile layer, so "how many
197
197
  tiles loaded" is unanswerable from the parent document — assert on the frame's
198
198
  `src`, which carries `marker=lat,lon`.
199
+
200
+ ## Component instances: one definition, many uses
201
+
202
+ A component is a theme-level record; a page writes an INSTANCE of it and supplies
203
+ only the slots that differ:
204
+
205
+ ```jsonc
206
+ // the definition, once, in the site's `components` map
207
+ "case-card": <tree with slot() text nodes>
208
+
209
+ // an instance, on a page
210
+ {"type": "div", "component": "case-card",
211
+ "data": {"attrID": "cs-0"},
212
+ "overrides": {"cs-kind": {"text": "E-COMMERCE"},
213
+ "cs-name": {"text": "…"}}}
214
+ ```
215
+
216
+ **An instance's ids are prefixed with the instance's own attrID.** The definition's
217
+ `cs-card` becomes `cs-0-cs-card`, `cs-1-cs-card`, and so on, so the definition's
218
+ attrID is a SUFFIX in the delivered page and `getElementById` on it finds nothing.
219
+ Address instances with `[id$="-cs-card"]`.
220
+
221
+ The claim worth verifying is not that three cards rendered. It is that they are the
222
+ same definition, and the evidence is in the class: all three carry the identical
223
+ generated token (`_fm` here) while their text differs. Three copy-pasted sections
224
+ would carry three tokens and three rules. `verify_components.py` asserts exactly
225
+ that — and the first version of the check passed on three `null`s, because its
226
+ regex contained a literal backspace: `\b` inside a non-raw Python string is 0x08,
227
+ not a word boundary. An assertion that cannot fail is worse than no assertion, so
228
+ the check now also refuses a token it could not read.
@@ -102,10 +102,10 @@ const counts = {
102
102
  "data/slider-verification.csv": 30,
103
103
  "data/token-verification.csv": 15,
104
104
  "data/mobile-audit.csv": 63,
105
- "data/component-wall-verification.csv": 13,
106
- "data/form-surface-verification.csv": 8,
107
- "data/content-loop-verification.csv": 10,
108
- "data/navigation-verification.csv": 39,
105
+ "data/component-wall-verification.csv": 19,
106
+ "data/form-surface-verification.csv": 12,
107
+ "data/content-loop-verification.csv": 11,
108
+ "data/navigation-verification.csv": 36,
109
109
  "data/page-modal-verification.csv": 19,
110
110
  "data/interaction-rules-verification.csv": 17,
111
111
  "data/dialog-form-verification.csv": 49,
package/sites/_moksa.py CHANGED
@@ -285,8 +285,11 @@ def mask_line(attr, text, tag="h1", **st):
285
285
  # bare `#services` is therefore a dead link on all seven of the others: the
286
286
  # browser looks for that id in the current document, does not find it, and does
287
287
  # nothing at all. Absolute, so they mean the same thing from anywhere.
288
- NAV = [("服務", "/#services"), ("作品", "/#works"),
289
- ("產品", "/#products"), ("聯絡", "/#contact")]
288
+ # The header used to be the studio site's own section anchors. On a demo whose
289
+ # whole job is to show what Mosaic can do, those were four links that left the
290
+ # showcase - so the menu IS the showcase now, and the one remaining top-level
291
+ # link goes home.
292
+ NAV = [("首頁", "/")]
290
293
 
291
294
  # Read from the shipped tables rather than typed, so the menu cannot claim a
292
295
  # number the evidence no longer supports.
@@ -302,7 +305,31 @@ TOKENABLE_COUNT = _count("style-properties.csv",
302
305
  CONVERTED_COUNT = _count("conversion-batch.csv",
303
306
  lambda rs: sum(int(r["converted"]) for r in rs))
304
307
 
305
- # label, href, one line of what it demonstrates
308
+ # Two groups, because eight flat links is the thing this menu was already fixed
309
+ # for once. `label, href, one line of what it demonstrates`.
310
+ CAPABILITY_GROUPS = [
311
+ ("介面元件", [
312
+ ("元件牆", "/components/",
313
+ "分頁、手風琴、表單、地圖——都能直接操作"),
314
+ ("表單", "/forms/",
315
+ "下拉、單選、複選、上傳、必填規則與錯誤訊息"),
316
+ ("輪播", "/sliders/",
317
+ "四種動畫並排、輪轉模式、鍵盤與減少動態"),
318
+ ("彈窗與觸發", "/dialogs/",
319
+ "九種形態、四種觸發、四種執行規則"),
320
+ ]),
321
+ ("資料與系統", [
322
+ ("內容驅動", "/content/",
323
+ "輪播、分頁、存檔——都由文章資料複製"),
324
+ ("動態內容", "/dynamic/",
325
+ "迴圈、@VAR 表達式、自訂欄位"),
326
+ ("設計系統", "/tokens/",
327
+ "設計代幣、variant 層、%d 個接得住代幣的屬性" % TOKENABLE_COUNT),
328
+ ("Elementor 轉換", "/conversion/",
329
+ "19 頁、%s 個元素、每一段字都核過" % "{:,}".format(CONVERTED_COUNT)),
330
+ ]),
331
+ ]
332
+
306
333
  CAPABILITIES = [
307
334
  ("內容驅動", "/content/",
308
335
  "輪播、分頁、存檔——都由文章資料複製"),
@@ -1368,7 +1395,7 @@ NAV_LINK = {"color": {"token": "--mk-ink"}, "fontSize": "13px",
1368
1395
  "cursor": "pointer"}
1369
1396
 
1370
1397
 
1371
- def capability_dropdown():
1398
+ def capability_dropdown(key, title, entries):
1372
1399
  """The capability pages as one labelled group.
1373
1400
 
1374
1401
  `dropdown` heals in its own `dropdown-toggle` and `dropdown-wrapper`, so only
@@ -1379,11 +1406,11 @@ def capability_dropdown():
1379
1406
  table now carries a `takes_children` column and the build guard reads it.
1380
1407
  """
1381
1408
  return {"type": "dropdown",
1382
- "data": {"attrID": "mk-cap", "horizontalAlign": "right"},
1409
+ "data": {"attrID": "mk-cap-" + key, "horizontalAlign": "right"},
1383
1410
  "style": {"&": {"_": {"position": "relative"}}},
1384
1411
  "children": [
1385
1412
  {"type": "dropdown-toggle",
1386
- "data": {"attrID": "mk-cap-toggle"},
1413
+ "data": {"attrID": "mk-cap-%s-toggle" % key},
1387
1414
  "style": {"&": {"_": dict(NAV_LINK, **{
1388
1415
  "display": "flex", "alignItems": "center", "columnGap": "6px",
1389
1416
  "customDeclarations":
@@ -1393,14 +1420,14 @@ def capability_dropdown():
1393
1420
  "hover": {"_": {"color": {"token": "--mk-accent"}}},
1394
1421
  "focus-visible": {"_": dict(FOCUS_RING)}},
1395
1422
  "children": [
1396
- T("p", "能力展示", fontFamily=MONO,
1423
+ T("p", title, fontFamily=MONO,
1397
1424
  fontSize="13px", letterSpacing="0.04em",
1398
1425
  color={"token": "--mk-ink"}, _t={"fontSize": "12px"}),
1399
1426
  T("p", "+", fontFamily=MONO, fontSize="11px",
1400
1427
  color={"token": "--mk-faint"}),
1401
1428
  ]},
1402
1429
  {"type": "dropdown-wrapper",
1403
- "data": {"attrID": "mk-cap-menu"},
1430
+ "data": {"attrID": "mk-cap-%s-menu" % key},
1404
1431
  "style": bp({"backgroundColor": {"token": "--mk-paper"},
1405
1432
  "paddingTop": "10px", "paddingBottom": "10px",
1406
1433
  "minWidth": "272px",
@@ -1417,7 +1444,8 @@ def capability_dropdown():
1417
1444
  "box-shadow:0 18px 40px rgba(22,24,28,.16);"}),
1418
1445
  "children": [
1419
1446
  {"type": "menu-link",
1420
- "data": {"attrID": "mk-cap-%d" % i, "url": href},
1447
+ "data": {"attrID": "mk-cap-%s-%d" % (key, i),
1448
+ "url": href},
1421
1449
  "style": {"&": {"_": {
1422
1450
  "display": "block", "cursor": "pointer",
1423
1451
  "paddingTop": "9px", "paddingBottom": "9px",
@@ -1432,7 +1460,7 @@ def capability_dropdown():
1432
1460
  lineHeight="1.6", color={"token": "--mk-muted"},
1433
1461
  marginTop="3px"),
1434
1462
  ]}
1435
- for i, (label, href, blurb) in enumerate(CAPABILITIES)
1463
+ for i, (label, href, blurb) in enumerate(entries)
1436
1464
  ]},
1437
1465
  ]}
1438
1466
 
@@ -1519,7 +1547,8 @@ HEADER = box("mk-shell-top", {}, [
1519
1547
  "focus-visible": {"_": FOCUS_RING}},
1520
1548
  "text": text}
1521
1549
  for i, (text, href) in enumerate(NAV)
1522
- ] + [capability_dropdown()]},
1550
+ ] + [capability_dropdown("g%d" % gi, title, entries)
1551
+ for gi, (title, entries) in enumerate(CAPABILITY_GROUPS)]},
1523
1552
  # not a pill: a bracketed link, the way a document cross-references
1524
1553
  {"type": "button", "data": {"attrID": "mk-header-cta",
1525
1554
  "url": "/#contact"},
@@ -3241,6 +3270,10 @@ if __name__ == "__main__":
3241
3270
  "title": "表單",
3242
3271
  "tree": apply_type(_forms.TREE, DISPLAY, CJK, "600")})
3243
3272
  import _components
3273
+ # the showcase page brings its own component definition; components are a
3274
+ # theme-level record, so they have to join the site's map before build_site
3275
+ # walks it
3276
+ SITE["components"].update(_components.COMPONENTS)
3244
3277
  SITE["pages"].append({"slug": "components", "post_id": 281,
3245
3278
  "title": "元件",
3246
3279
  "tree": apply_type(_components.TREE, DISPLAY, CJK, "600")})