@kernlang/core 3.5.6 → 3.5.7

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.
@@ -26,7 +26,10 @@ function validateNode(state, node) {
26
26
  }
27
27
  catch (err) {
28
28
  const msg = err instanceof Error ? err.message : String(err);
29
- emitDiagnostic(state, 'INVALID_EXPRESSION', 'error', `Invalid expression in '${propName}': ${msg}`, node.loc?.line ?? 0, node.loc?.col ?? 0, { endCol: (node.loc?.col ?? 0) + propName.length });
29
+ const detail = val.includes('<<<')
30
+ ? `Raw code block delimiter '<<<' cannot appear inside an expression prop. Put raw code blocks on a statement-line handler body with lang=, for example: handler lang="ts" <<<...>>>. Parser error: ${msg}`
31
+ : msg;
32
+ emitDiagnostic(state, 'INVALID_EXPRESSION', 'error', `Invalid expression in '${propName}': ${detail}`, node.loc?.line ?? 0, node.loc?.col ?? 0, { endCol: (node.loc?.col ?? 0) + propName.length });
30
33
  }
31
34
  }
32
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parser-validate-expressions.js","sourceRoot":"","sources":["../src/parser-validate-expressions.ts"],"names":[],"mappings":"AAAA;;2EAE2E;AAG3E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAe,YAAY,EAAE,MAAM,YAAY,CAAC;AAEvD,SAAS,YAAY,CAAC,KAAiB,EAAE,IAAY;IACnD,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,IAAc,CAAC,CAAC;IACjD,IAAI,MAAM,EAAE,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;QAClC,KAAK,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,M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,CAAC,KAAK,CAAC;oBAChC,CAAC,CAAC,oMAAoM,GAAG,EAAE;oBAC3M,CAAC,CAAC,GAAG,CAAC;gBACR,cAAc,CACZ,KAAK,EACL,oBAAoB,EACpB,OAAO,EACP,0BAA0B,QAAQ,MAAM,MAAM,EAAE,EAChD,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,EACnB,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,EAClB,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CACnD,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;YAAE,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAiB,EAAE,IAAY;IACjE,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC"}
package/dist/spec.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  * Meta: theme nodes ($ref), pseudo-selectors (:press, :hover)
10
10
  * Targets: Next.js, React+Tailwind, React Native, Express
11
11
  */
12
- export declare const KERN_VERSION = "3.5.6";
12
+ export declare const KERN_VERSION = "3.5.7";
13
13
  export declare const IR_GRAMMAR = "\ndocument = node+\nnode = indent type (SP prop)* (SP style)? (SP themeref)* NL child*\nchild = node\nindent = \" \"*\ntype = ident\nprop = ident \"=\" value\nvalue = quoted | bare\nquoted = '\"' [^\"]* '\"'\nbare = [^\\s{$]+\nstyle = \"{\" spair (\",\" spair)* \"}\"\nspair = sident \":\" svalue | \":\" pseudo \":\" sident \":\" svalue\npseudo = \"press\" | \"hover\" | \"active\" | \"focus\"\nsident = shorthand | ident\nsvalue = [^,}]+\nthemeref = \"$\" ident\nident = [A-Za-z_][A-Za-z0-9_-]*\nSP = \" \"+\nNL = \"\\n\" | EOF\n";
14
14
  export declare const NODE_TYPES: readonly ["screen", "page", "row", "col", "card", "grid", "scroll", "text", "image", "progress", "divider", "codeblock", "section", "form", "button", "input", "textarea", "slider", "toggle", "modal", "list", "item", "tabs", "tab", "header", "link", "theme", "doc", "decorator", "server", "route", "middleware", "handler", "schema", "stream", "spawn", "timer", "on", "env", "websocket", "params", "auth", "validate", "respond", "trigger", "cli", "command", "arg", "flag", "import", "extern", "island", "separator", "table", "thead", "tbody", "tr", "th", "td", "scoreboard", "metric", "spinner", "box", "gradient", "state", "animation", "repl", "guard", "parallel", "dispatch", "then", "each", "let", "assign", "local", "comment", "return", "throw", "do", "continue", "break", "if", "while", "for", "with", "layout", "loading", "metadata", "generateMetadata", "notFound", "redirect", "fetch", "type", "interface", "field", "fn", "const", "destructure", "binding", "element", "mapLit", "mapEntry", "setLit", "setItem", "enum", "member", "union", "variant", "indexer", "overload", "service", "class", "method", "getter", "setter", "singleton", "constructor", "signal", "cleanup", "machine", "transition", "error", "module", "export", "use", "from", "config", "store", "test", "describe", "it", "event", "hook", "provider", "effect", "logic", "memo", "callback", "ref", "context", "prop", "returns", "render", "input-area", "output-area", "text-input", "select-input", "multi-select", "confirm-input", "password-input", "status-message", "alert", "ordered-list", "unordered-list", "focus", "app-exit", "static-log", "newline", "layout-row", "layout-col", "layout-stack", "spacer", "screen-embed", "alternate-screen", "scroll-box", "model", "column", "relation", "repository", "dependency", "inject", "cache", "entry", "invalidate", "conditional", "else", "elseif", "component", "select", "option", "group", "icon", "svg", "template", "slot", "body", "derive", "fmt", "cell", "set", "async", "try", "step", "catch", "finally", "filter", "find", "some", "every", "findIndex", "reduce", "map", "flatMap", "flat", "slice", "at", "sort", "reverse", "join", "includes", "indexOf", "lastIndexOf", "concat", "forEach", "compact", "pluck", "unique", "uniqueBy", "groupBy", "partition", "indexBy", "countBy", "chunk", "zip", "range", "take", "drop", "min", "max", "minBy", "maxBy", "sum", "sumBy", "avg", "intersect", "findLast", "findLastIndex", "transform", "action", "actionRegistry", "assume", "invariant", "branch", "path", "resolve", "candidate", "discriminator", "collect", "fanout", "emit", "pattern", "apply", "expect", "recover", "strategy", "reason", "evidence", "needs", "rule", "message", "mcp", "tool", "resource", "prompt", "param", "description", "sampling", "elicitation"];
15
15
  export type IRNodeType = (typeof NODE_TYPES)[number];
package/dist/spec.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * Meta: theme nodes ($ref), pseudo-selectors (:press, :hover)
10
10
  * Targets: Next.js, React+Tailwind, React Native, Express
11
11
  */
12
- export const KERN_VERSION = '3.5.6';
12
+ export const KERN_VERSION = '3.5.7';
13
13
  // ── Grammar ─────────────────────────────────────────────────────────────
14
14
  export const IR_GRAMMAR = `
15
15
  document = node+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kernlang/core",
3
- "version": "3.5.6",
3
+ "version": "3.5.7",
4
4
  "description": "Kern core — parser, types, spec, config, style engines, codegen",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",