mosaic-headless 1.31.0 → 1.31.1

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
@@ -5,7 +5,7 @@ description: |
5
5
  license: "MIT"
6
6
  metadata:
7
7
  author: "moksa (https://moksaweb.com)"
8
- version: "1.31.0"
8
+ version: "1.31.1"
9
9
  homepage: "https://github.com/Moksa1123/mosaic-headless"
10
10
  ---
11
11
 
@@ -788,6 +788,10 @@ post — `build_all.py` resets first for that reason.
788
788
  references/dialog-and-triggers.md
789
789
  - **`scrollDepth`'s action slot is `reached` since 1.0.10** (plus `returned`). An
790
790
  action stored under the old slot name `scrollDepth` is kept and never runs.
791
+ - **A local-context loop's `loopSource` is `@VAR('post/<loop>')`, never `@LOOP()`.**
792
+ Both render on the front end; `@LOOP` there throws in the editor
793
+ (`_loopEvaluatorFunction is not a function`) and the canvas never finishes.
794
+ `build_page.py` refuses it. `@LOOP(…)` inside text is fine.
791
795
  - **A custom field is `@VAR('post/meta_<key>')`, and a multi-value one is a LOOP.**
792
796
  ACF and Meta Box both, plus bare post meta. Derived properties hang off the
793
797
  name with two underscores (`meta_k__label`, `__url`, `__id`); an ACF group is
@@ -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.31.0"
23
+ "version": "1.31.1"
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.31.0"
23
+ "version": "1.31.1"
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.31.0"
23
+ "version": "1.31.1"
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.31.0"
23
+ "version": "1.31.1"
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.31.0"
23
+ "version": "1.31.1"
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mosaic-headless",
3
- "version": "1.31.0",
3
+ "version": "1.31.1",
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",
@@ -81,13 +81,36 @@ the source on the loop node:
81
81
  ```json
82
82
  {"type": "loop",
83
83
  "data": {"loopType": "localContext",
84
- "localContextOptions": {"loopSource": {"v": "@LOOP('post/loopacf_rel')"}}},
84
+ "localContextOptions": {"loopSource": {"v": "@VAR('post/loopacf_rel')"}}},
85
85
  "children": [{"type": "loop-items", "children": [{"type": "loop-item", "children": [
86
86
  {"type": "text", "data": {"tagName": "p"},
87
87
  "children": [{"type": "wysiwyg-variable", "data": {"dynamicCode": "@VAR('item/value__label')"}}]}
88
88
  ]}]}]}
89
89
  ```
90
90
 
91
+ **The `loopSource` is `@VAR('<namespace>/<loop>')`, never `@LOOP(…)`.** This page
92
+ used to show `@LOOP('post/loopacf_rel')` here, and that form breaks the editor while
93
+ the front end renders it fine - the worst kind of split, because the page looks done:
94
+
95
+ - the front end (`LoopEvaluator.php`) takes the first string argument of whatever
96
+ function call it is given and ignores the function's name, so `@LOOP('post/x')`
97
+ and `@VAR('post/x')` resolve to the same loop;
98
+ - the editor (`evaluateLoop` in `AppMosaicEditor-bundle.js`, 1.0.10) builds its
99
+ expression evaluator with the loop lookup as the VARIABLE evaluator and `null` as
100
+ the loop evaluator, so `@VAR` resolves the loop and `@LOOP` calls `null`:
101
+ `TypeError: this._loopEvaluatorFunction is not a function`, the canvas renders
102
+ for a long time and never finishes. Mosaic's own callers write
103
+ `evaluateLoop("@VAR('<menu>/loop')")`.
104
+
105
+ Reported from a client build (a Meta Box `image_advanced` gallery as the source):
106
+ changing the source to `@VAR('post/loopwork_gallery')` cleared the editor error and
107
+ the front end still rendered all 35 images. `@LOOP(…)` *inside text* goes through a
108
+ different evaluator that is given both functions, and is fine in the editor too -
109
+ measured on the same build: a loop item's image `alt` of
110
+ `@concat(@VAR('post/title'), '|', @LOOP('post/work_category', 1, 'term_name'), '作品照片 ', @VAR('item/index'))`
111
+ opens with zero console errors and delivers `墨竹|住宅設計作品照片 1`. The table
112
+ above stays valid there.
113
+
91
114
  `loopType:"localContext"` is the built-in source that evaluates an expression in the
92
115
  page's context; the sweep's `loop` COMMIT_500 is what happens without it. The loop
93
116
  rendered exactly the rows the field holds for every family above (2, 2, 1, 1, 2, 2,
@@ -476,3 +476,14 @@ rendered - server-side output was fine - but with no front-end runtime every dro
476
476
  sat open and no modal could open. `find mosaic -type d -exec chmod 775 {} +` (files
477
477
  664), matching the other plugin folders, and purge the page cache. A REST-level check
478
478
  cannot see this; only fetching an asset can.
479
+
480
+ ## A loop source written as `@LOOP()` renders on the front end and kills the editor
481
+
482
+ `loopType: "localContext"` with `loopSource: {"v": "@LOOP('post/<loop>')"}` renders
483
+ every row on the delivered page, and opening the page in the Mosaic editor throws
484
+ `TypeError: this._loopEvaluatorFunction is not a function` from
485
+ `evaluateLoop` / `createLoopContextFactory`, leaving the canvas loading. The front
486
+ end reads the loop name out of any function call; the editor only out of `@VAR`.
487
+ Write `@VAR('post/<loop>')`. No server-side check can see this - the page is 200 and
488
+ complete - so it is only caught by opening the editor. Details in
489
+ `references/custom-fields.md`.
@@ -131,6 +131,19 @@ class Surface:
131
131
  problems.append("code content contains `%s` - Mosaic's template parser reads "
132
132
  "it as a function call and the page renders as HTTP 500; "
133
133
  "write `%s (`" % (hit.group(0), hit.group(0)[:-1]))
134
+ # A local-context loop's source written as `@LOOP('post/x')` renders on the
135
+ # front end - LoopEvaluator.php reads the loop name out of any function call -
136
+ # and throws in the editor, whose evaluateLoop only resolves `@VAR`
137
+ # ("this._loopEvaluatorFunction is not a function", canvas never finishes).
138
+ # The page is 200 and complete, so nothing downstream of this can see it.
139
+ if not force:
140
+ opts = (node.get("data") or {}).get("localContextOptions") or {}
141
+ src = opts.get("loopSource")
142
+ code = src.get("v") if isinstance(src, dict) else src
143
+ if isinstance(code, str) and code.lstrip().upper().startswith("@LOOP("):
144
+ problems.append("loopSource %r breaks the Mosaic editor (front end renders, "
145
+ "editor throws _loopEvaluatorFunction is not a function); "
146
+ "write it as %r" % (code, "@VAR(" + code.lstrip()[6:]))
134
147
  # node-verification.csv measured every type UNDER A PLAIN DIV. A type that broke
135
148
  # there is not broken in general - most of them are family members that simply
136
149
  # need their own parent. So the measured verdict only applies when the parent is