@hyperfixi/core 2.9.4 → 2.10.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.
Files changed (91) hide show
  1. package/dist/ast-utils/index.js +295 -85
  2. package/dist/ast-utils/index.mjs +295 -85
  3. package/dist/chunks/{bridge-DhmZ3Khh.js → bridge-CPNAPYAo.js} +2 -2
  4. package/dist/chunks/browser-modular-B0lGdcoP.js +2 -0
  5. package/dist/chunks/{index-DKrx4rv2.js → index-BQkkNlzO.js} +2 -2
  6. package/dist/commands/advanced/async.d.ts +0 -8
  7. package/dist/commands/advanced/js.d.ts +0 -8
  8. package/dist/commands/animation/measure.d.ts +0 -8
  9. package/dist/commands/animation/settle.d.ts +0 -8
  10. package/dist/commands/animation/start-view-transition.d.ts +0 -8
  11. package/dist/commands/animation/take.d.ts +0 -8
  12. package/dist/commands/animation/transition.d.ts +0 -8
  13. package/dist/commands/async/fetch.d.ts +0 -8
  14. package/dist/commands/async/wait.d.ts +0 -8
  15. package/dist/commands/behaviors/install.d.ts +0 -8
  16. package/dist/commands/content/append.d.ts +0 -8
  17. package/dist/commands/content/prepend.d.ts +0 -8
  18. package/dist/commands/control-flow/break.d.ts +0 -8
  19. package/dist/commands/control-flow/continue.d.ts +0 -8
  20. package/dist/commands/control-flow/exit.d.ts +0 -8
  21. package/dist/commands/control-flow/halt.d.ts +0 -8
  22. package/dist/commands/control-flow/if.d.ts +0 -8
  23. package/dist/commands/control-flow/repeat.d.ts +0 -8
  24. package/dist/commands/control-flow/return.d.ts +0 -8
  25. package/dist/commands/control-flow/throw.d.ts +0 -8
  26. package/dist/commands/data/clear.d.ts +0 -8
  27. package/dist/commands/data/default.d.ts +0 -8
  28. package/dist/commands/data/get.d.ts +0 -8
  29. package/dist/commands/data/increment.d.ts +0 -8
  30. package/dist/commands/data/set.d.ts +0 -8
  31. package/dist/commands/decorators/index.d.ts +2 -8
  32. package/dist/commands/dom/add.d.ts +0 -8
  33. package/dist/commands/dom/close.d.ts +0 -8
  34. package/dist/commands/dom/empty.d.ts +0 -8
  35. package/dist/commands/dom/hide.d.ts +0 -8
  36. package/dist/commands/dom/make.d.ts +0 -8
  37. package/dist/commands/dom/open.d.ts +0 -8
  38. package/dist/commands/dom/process-partials.d.ts +0 -8
  39. package/dist/commands/dom/put.d.ts +0 -8
  40. package/dist/commands/dom/remove.d.ts +0 -8
  41. package/dist/commands/dom/reset.d.ts +0 -8
  42. package/dist/commands/dom/select.d.ts +0 -8
  43. package/dist/commands/dom/show.d.ts +0 -8
  44. package/dist/commands/dom/swap.d.ts +2 -18
  45. package/dist/commands/dom/toggle.d.ts +0 -8
  46. package/dist/commands/events/trigger.d.ts +0 -8
  47. package/dist/commands/execution/blur.d.ts +0 -8
  48. package/dist/commands/execution/call.d.ts +0 -8
  49. package/dist/commands/execution/focus.d.ts +0 -8
  50. package/dist/commands/execution/pseudo-command.d.ts +0 -8
  51. package/dist/commands/index.js +82 -23
  52. package/dist/commands/index.mjs +82 -23
  53. package/dist/commands/navigation/go.d.ts +0 -8
  54. package/dist/commands/navigation/push-url.d.ts +0 -8
  55. package/dist/commands/navigation/scroll-to.d.ts +0 -8
  56. package/dist/commands/templates/render.d.ts +0 -8
  57. package/dist/commands/utility/beep.d.ts +0 -8
  58. package/dist/commands/utility/breakpoint.d.ts +0 -8
  59. package/dist/commands/utility/copy.d.ts +0 -8
  60. package/dist/commands/utility/log.d.ts +0 -8
  61. package/dist/commands/utility/pick.d.ts +0 -8
  62. package/dist/commands/utility/tell.d.ts +0 -8
  63. package/dist/hyperfixi-browser-classic-i18n.js +1 -1
  64. package/dist/hyperfixi-browser-minimal.js +1 -1
  65. package/dist/hyperfixi-browser-standard.js +1 -1
  66. package/dist/hyperfixi-browser.js +1 -1
  67. package/dist/hyperfixi-classic-i18n.js +1 -1
  68. package/dist/hyperfixi-hx-v4.js +1 -1
  69. package/dist/hyperfixi-minimal.js +1 -1
  70. package/dist/hyperfixi-multilingual.js +1 -1
  71. package/dist/hyperfixi-standard.js +1 -1
  72. package/dist/hyperfixi.js +1 -1
  73. package/dist/hyperfixi.mjs +1 -1
  74. package/dist/index.js +441 -143
  75. package/dist/index.min.js +1 -1
  76. package/dist/index.mjs +441 -143
  77. package/dist/lokascript-browser-classic-i18n.js +1 -1
  78. package/dist/lokascript-browser-minimal.js +1 -1
  79. package/dist/lokascript-browser-standard.js +1 -1
  80. package/dist/lokascript-browser.js +1 -1
  81. package/dist/lokascript-multilingual.js +1 -1
  82. package/dist/parser/command-parsers/dom-commands.d.ts +1 -0
  83. package/dist/parser/full-parser.js +47 -1
  84. package/dist/parser/full-parser.mjs +47 -1
  85. package/dist/reference/index.js +6 -5
  86. package/dist/reference/index.mjs +6 -5
  87. package/dist/registry/index.js +50 -6
  88. package/dist/registry/index.mjs +50 -6
  89. package/dist/runtime/command-adapter.d.ts +8 -8
  90. package/package.json +5 -5
  91. package/dist/chunks/browser-modular-BllAMlht.js +0 -2
@@ -5502,7 +5502,7 @@ function getSchema(action) {
5502
5502
  function getDefinedSchemas() {
5503
5503
  return Object.values(commandSchemas).filter((s) => s.roles.length > 0 || s.bareKeyword === true);
5504
5504
  }
5505
- var toggleSchema, addSchema, removeSchema, putSchema, setSchema, bindSchema, liveSchema, eventsourceSchema, socketSchema, workerSchema, interceptSchema, showSchema, hideSchema, onSchema, triggerSchema, waitSchema, fetchSchema, incrementSchema, decrementSchema, appendSchema, prependSchema, logSchema, getCommandSchema, takeSchema, makeSchema, haltSchema, settleSchema, throwSchema, sendSchema, ifSchema, unlessSchema, elseSchema, repeatSchema, forSchema, whileSchema, continueSchema, URL_MARKER_ALL_LANGS, goSchema, transitionSchema, cloneSchema, focusSchema, blurSchema, emptySchema, openSchema, closeSchema, selectSchema, clearSchema, resetSchema, breakpointSchema, callSchema, returnSchema, jsSchema, asyncSchema, tellSchema, defaultSchema, initSchema, behaviorSchema, installSchema, measureSchema, swapSchema, morphSchema, beepSchema, breakSchema, copySchema, exitSchema, pickSchema, scrollSchema, PARTIALS_IN_MARKER_ALL_LANGS, pushSchema, replaceSchema, processSchema, renderSchema, commandSchemas;
5505
+ var toggleSchema, addSchema, removeSchema, putSchema, setSchema, bindSchema, liveSchema, eventsourceSchema, socketSchema, workerSchema, interceptSchema, showSchema, hideSchema, onSchema, triggerSchema, waitSchema, fetchSchema, incrementSchema, decrementSchema, appendSchema, prependSchema, logSchema, getCommandSchema, takeSchema, makeSchema, haltSchema, settleSchema, throwSchema, sendSchema, ifSchema, unlessSchema, elseSchema, repeatSchema, forSchema, whileSchema, continueSchema, URL_MARKER_ALL_LANGS, goSchema, transitionSchema, cloneSchema, focusSchema, blurSchema, emptySchema, openSchema, closeSchema, selectSchema, clearSchema, resetSchema, breakpointSchema, callSchema, returnSchema, jsSchema, asyncSchema, tellSchema, defaultSchema, initSchema, behaviorSchema, installSchema, measureSchema, USING_VIEW_MARKER_ALL_LANGS, VIEW_TRANSITION_MANNER_ROLE, swapSchema, morphSchema, beepSchema, breakSchema, copySchema, exitSchema, pickSchema, scrollSchema, PARTIALS_IN_MARKER_ALL_LANGS, pushSchema, replaceSchema, processSchema, renderSchema, commandSchemas;
5506
5506
  var init_command_schemas = __esm({
5507
5507
  "src/generators/command-schemas.ts"() {
5508
5508
  toggleSchema = {
@@ -5511,7 +5511,6 @@ var init_command_schemas = __esm({
5511
5511
  category: "dom-class",
5512
5512
  primaryRole: "patient",
5513
5513
  // `toggle .active on #btn for 2s` \u2192 args ['.active'], modifiers { on, for }.
5514
- // NOTE: `duration` is read here but not declared in `roles` below.
5515
5514
  ast: { args: ["patient"], modifiers: { on: "destination", for: "duration" } },
5516
5515
  roles: [
5517
5516
  {
@@ -6602,8 +6601,8 @@ var init_command_schemas = __esm({
6602
6601
  description: "Take content from a source element",
6603
6602
  category: "dom-content",
6604
6603
  primaryRole: "patient",
6605
- // `take .active from #parent` \u2192 args ['.active'], modifiers { from: '#parent' }.
6606
- ast: { args: ["patient"], modifiers: { from: "source" } },
6604
+ // `take .active from #parent for me` \u2192 args ['.active'], modifiers { from, for }.
6605
+ ast: { args: ["patient"], modifiers: { from: "source", for: "recipient" } },
6607
6606
  roles: [
6608
6607
  {
6609
6608
  role: "patient",
@@ -6626,6 +6625,38 @@ var init_command_schemas = __esm({
6626
6625
  expectedTypes: ["selector", "reference"],
6627
6626
  svoPosition: 2,
6628
6627
  sovPosition: 1
6628
+ },
6629
+ {
6630
+ role: "recipient",
6631
+ description: "The element the class moves ONTO (`take .active from .tab for me`)",
6632
+ required: false,
6633
+ // References only, deliberately. Upstream accepts an element expression,
6634
+ // but the 23 non-en corpus surfaces carry the recipient as a BARE
6635
+ // trailing pronoun (i18n renders `\u2026 von .tab-button ich`), so this slot
6636
+ // is marker-less almost everywhere and a selector-typed slot would
6637
+ // swallow the second selector of `take .active from .a .b`. English is
6638
+ // unaffected: `take` is on the core parser's skipSemanticParsing list,
6639
+ // so the traditional parser owns `for <anything>` there.
6640
+ expectedTypes: ["reference"],
6641
+ svoPosition: 3,
6642
+ sovPosition: 3,
6643
+ // NO default. The runtime already defaults the recipient to `me`
6644
+ // (commands/animation/take.ts), and a schema default would emit an
6645
+ // explicit `for me` modifier on every take \u2014 re-smuggling the exact
6646
+ // "absent means absent" semantics #859 removed from `source`.
6647
+ //
6648
+ // Shape-anchored on `reference`: without it this optional slot weighs
6649
+ // into every take pattern's denominator in `scoreRoleCoverage`, dropping
6650
+ // plain `take .active from .tab-button` from 1.0 to ~0.69 \u2014 the toggle-es
6651
+ // regression class the R1 role-set flip ratchet exists to catch.
6652
+ valueShape: "reference",
6653
+ // en only. The other 23 languages render the recipient unmarked, so a
6654
+ // marker there would never match their corpus rows; where the marker-less
6655
+ // slot proves inert they stay uncaptured and the pattern lands in the
6656
+ // baseline's `roleLossyPatterns` as named R1 burn-down tail. A language
6657
+ // gets a real particle here ONLY if the empty slot perturbs its other
6658
+ // parses (toggle's ja \u9593 / ko \ub3d9\uc548 case).
6659
+ markerOverride: { en: "for" }
6629
6660
  }
6630
6661
  ]
6631
6662
  };
@@ -7690,6 +7721,47 @@ var init_command_schemas = __esm({
7690
7721
  }
7691
7722
  ]
7692
7723
  };
7724
+ USING_VIEW_MARKER_ALL_LANGS = {
7725
+ en: "using view",
7726
+ es: "using view",
7727
+ pt: "using view",
7728
+ fr: "using view",
7729
+ de: "using view",
7730
+ it: "using view",
7731
+ ja: "using view",
7732
+ ko: "using view",
7733
+ zh: "using view",
7734
+ ar: "using view",
7735
+ he: "using view",
7736
+ hi: "using view",
7737
+ bn: "using view",
7738
+ tr: "using view",
7739
+ ru: "using view",
7740
+ uk: "using view",
7741
+ pl: "using view",
7742
+ id: "using view",
7743
+ vi: "using view",
7744
+ th: "using view",
7745
+ ms: "using view",
7746
+ tl: "using view",
7747
+ sw: "using view",
7748
+ qu: "using view"
7749
+ };
7750
+ VIEW_TRANSITION_MANNER_ROLE = {
7751
+ role: "manner",
7752
+ description: "Run the swap inside a `document.startViewTransition()` (`using view transition`)",
7753
+ required: false,
7754
+ // Both types, because the SAME word tokenizes differently per language and
7755
+ // the difference is an accident of vocabulary: `transition` is a command
7756
+ // keyword in en/fr (it is also their verb) and a bare identifier everywhere
7757
+ // else, which types it `literal` in the first group and `expression` in the
7758
+ // second. Measured: with `['literal']` alone only en and fr captured the
7759
+ // tail. Widening is safe precisely because the slot is marker-guarded \u2014
7760
+ // nothing reaches it until `using view` has matched.
7761
+ expectedTypes: ["literal", "expression"],
7762
+ valueShape: "keyword",
7763
+ markerOverride: USING_VIEW_MARKER_ALL_LANGS
7764
+ };
7693
7765
  swapSchema = {
7694
7766
  action: "swap",
7695
7767
  description: "Swap DOM content using various strategies (innerHTML, outerHTML, delete, etc.)",
@@ -7710,7 +7782,11 @@ var init_command_schemas = __esm({
7710
7782
  // work. Preserved verbatim by the Arc F migration (a faithful migration must
7711
7783
  // not change output) and pinned as two `drift` exemptions; this is the
7712
7784
  // behavior fix those entries were waiting for.
7713
- ast: { args: ["method", "destination", "patient"] },
7785
+ //
7786
+ // `manner` is the exception to "keyword-positional args": it rides as
7787
+ // `modifiers.viewTransition`, which SwapCommand.parseInput reads for presence
7788
+ // alongside its existing flat-args `using`/`view`/`transition` scan.
7789
+ ast: { args: ["method", "destination", "patient"], modifiers: { viewTransition: "manner" } },
7714
7790
  roles: [
7715
7791
  {
7716
7792
  role: "method",
@@ -7805,6 +7881,11 @@ var init_command_schemas = __esm({
7805
7881
  ar: "\u0628\u0640",
7806
7882
  tl: "nang"
7807
7883
  }
7884
+ },
7885
+ {
7886
+ ...VIEW_TRANSITION_MANNER_ROLE,
7887
+ svoPosition: 4,
7888
+ sovPosition: 4
7808
7889
  }
7809
7890
  ]
7810
7891
  };
@@ -7815,7 +7896,15 @@ var init_command_schemas = __esm({
7815
7896
  primaryRole: "patient",
7816
7897
  // `morph #list to it` \u2192 args [content], modifiers { on: element }.
7817
7898
  // Content is source or destination; the element being morphed is the patient.
7818
- ast: { args: [["source", "destination"]], modifiers: { on: "patient" } },
7899
+ //
7900
+ // `manner` rides as `modifiers.viewTransition`, same as swap/process \u2014
7901
+ // MorphCommand.parseInput reads it for presence alongside its existing
7902
+ // flat-args `using`/`view`/`transition` scan (the traditional-parser path,
7903
+ // which owns English because morph sits on SKIP_SEMANTIC_COMMANDS).
7904
+ ast: {
7905
+ args: [["source", "destination"]],
7906
+ modifiers: { on: "patient", viewTransition: "manner" }
7907
+ },
7819
7908
  roles: [
7820
7909
  {
7821
7910
  role: "patient",
@@ -7836,6 +7925,18 @@ var init_command_schemas = __esm({
7836
7925
  sovPosition: 2,
7837
7926
  markerOverride: { en: "to" }
7838
7927
  // "morph #target to it"
7928
+ },
7929
+ {
7930
+ // `morph #target to it using view transition` \u2014 the same tail as swap and
7931
+ // process, closed here for the same reason (#870's third-schema filing):
7932
+ // without the role the semantic parser matched morph at confidence 1.0
7933
+ // and stranded the tail, so every semantic-only consumer (multilingual
7934
+ // bundles, the bridge, `translate()`) silently dropped the animation
7935
+ // request in all 24 languages. Morph has NO hand-written patterns in any
7936
+ // language, so this schema role is the whole fix on the pattern side.
7937
+ ...VIEW_TRANSITION_MANNER_ROLE,
7938
+ svoPosition: 3,
7939
+ sovPosition: 3
7839
7940
  }
7840
7941
  ]
7841
7942
  };
@@ -8022,6 +8123,13 @@ var init_command_schemas = __esm({
8022
8123
  description: "Process hx-partial markup in HTML content",
8023
8124
  category: "dom-content",
8024
8125
  primaryRole: "patient",
8126
+ // `process partials in it` \u2192 args ['it']; the optional tail rides as
8127
+ // `modifiers.viewTransition`, which ProcessPartialsCommand.parseInput has
8128
+ // read since #861 (`raw.modifiers?.viewTransition !== undefined`). Without a
8129
+ // descriptor this schema fell through to `buildGenericCommand`, whose
8130
+ // modifier list is fixed (destination/duration/method/style) and would have
8131
+ // dropped a captured `manner` on the floor.
8132
+ ast: { args: ["patient"], modifiers: { viewTransition: "manner" } },
8025
8133
  roles: [
8026
8134
  {
8027
8135
  role: "patient",
@@ -8031,6 +8139,11 @@ var init_command_schemas = __esm({
8031
8139
  svoPosition: 1,
8032
8140
  sovPosition: 1,
8033
8141
  markerOverride: PARTIALS_IN_MARKER_ALL_LANGS
8142
+ },
8143
+ {
8144
+ ...VIEW_TRANSITION_MANNER_ROLE,
8145
+ svoPosition: 2,
8146
+ sovPosition: 2
8034
8147
  }
8035
8148
  ]
8036
8149
  };
@@ -9486,7 +9599,9 @@ var init_french = __esm({
9486
9599
  trigger: { primary: "d\xE9clencher", normalized: "trigger" },
9487
9600
  send: { primary: "envoyer", alternatives: ["envoie"], normalized: "send" },
9488
9601
  focus: { primary: "focaliser", alternatives: ["concentrer"], normalized: "focus" },
9489
- blur: { primary: "d\xE9focaliser", normalized: "blur" },
9602
+ // `d\u00e9focaliser` is an unattested infinitive; French pedagogy writes
9603
+ // `perte de focus` for the event (2026-07 terminology review).
9604
+ blur: { primary: "perte de focus", alternatives: ["d\xE9focaliser"], normalized: "blur" },
9490
9605
  // Phase 1 (v0.9.90): DOM / form state / debug
9491
9606
  // `vide` (adjective, "empty") is the i18n transformer's `is empty` predicate
9492
9607
  // form; `vider` is the verb ("to empty"). Accept both so the emptiness check
@@ -9499,7 +9614,13 @@ var init_french = __esm({
9499
9614
  reset: { primary: "r\xE9initialiser", alternatives: ["reinitialiser"], normalized: "reset" },
9500
9615
  breakpoint: { primary: "point-arr\xEAt", alternatives: ["point-arret"], normalized: "breakpoint" },
9501
9616
  go: { primary: "aller", alternatives: ["naviguer", "va"], normalized: "go" },
9502
- scroll: { primary: "d\xE9filer", alternatives: ["faire-d\xE9filer"], normalized: "scroll" },
9617
+ // MDN fr and the OQLF standardize the noun `d\u00e9filement` for the event; the
9618
+ // infinitive stays as an alternative.
9619
+ scroll: {
9620
+ primary: "d\xE9filement",
9621
+ alternatives: ["defilement", "d\xE9filer", "faire-d\xE9filer"],
9622
+ normalized: "scroll"
9623
+ },
9503
9624
  push: { primary: "pousser", normalized: "push" },
9504
9625
  replace: { primary: "remplacer", normalized: "replace" },
9505
9626
  process: { primary: "traiter", normalized: "process" },
@@ -9565,9 +9686,15 @@ var init_french = __esm({
9565
9686
  after: { primary: "apr\xE8s", normalized: "after" },
9566
9687
  // Common event names (for event handler patterns)
9567
9688
  click: { primary: "clic", alternatives: ["clique"], normalized: "click" },
9568
- // `resize` event (window-resize): dict emits redimensionner; register it so the
9569
- // event types as literal="resize" (matching en) instead of expression.
9570
- resize: { primary: "redimensionner", normalized: "resize" },
9689
+ // `resize` event (window-resize): the noun `redimensionnement` is the
9690
+ // attested event form ("lors du redimensionnement de la fen\u00eatre"). The dict
9691
+ // still emits redimensionner, kept as an alternative so the event keeps
9692
+ // typing as literal="resize" (matching en) instead of expression.
9693
+ resize: {
9694
+ primary: "redimensionnement",
9695
+ alternatives: ["redimensionner"],
9696
+ normalized: "resize"
9697
+ },
9571
9698
  hover: { primary: "survol", alternatives: ["survoler"], normalized: "hover" },
9572
9699
  submit: { primary: "soumission", alternatives: ["soumettre"], normalized: "submit" },
9573
9700
  input: { primary: "saisie", alternatives: ["entr\xE9e"], normalized: "input" },
@@ -13350,9 +13477,17 @@ var init_turkish = __esm({
13350
13477
  on: { primary: "\xFCzerinde", alternatives: ["zaman"], normalized: "on" },
13351
13478
  trigger: { primary: "tetikle", normalized: "trigger" },
13352
13479
  send: { primary: "g\xF6nder", normalized: "send" },
13353
- // DOM focus
13354
- focus: { primary: "odak", alternatives: ["odaklanma"], normalized: "focus" },
13355
- blur: { primary: "bulan\u0131k", alternatives: ["bulan\u0131kl\u0131k", "bulanik"], normalized: "blur" },
13480
+ // DOM focus. `odaklanma` (the act of focusing) leads over the static state
13481
+ // noun `odak` \u2014 Turkish event prose says "odaklanma olay\u0131". `bulan\u0131k` was
13482
+ // the optical blur (CSS filters, image processing), never the DOM event;
13483
+ // native usage is `odak kayb\u0131` (loss of focus). 2026-07 terminology-review
13484
+ // corrections; old forms stay as parse alternatives.
13485
+ focus: { primary: "odaklanma", alternatives: ["odak"], normalized: "focus" },
13486
+ blur: {
13487
+ primary: "odak kayb\u0131",
13488
+ alternatives: ["odak kaybi", "bulan\u0131k", "bulan\u0131kl\u0131k", "bulanik"],
13489
+ normalized: "blur"
13490
+ },
13356
13491
  // Phase 1 (v0.9.90): DOM / form state / debug
13357
13492
  empty: { primary: "bo\u015Falt", alternatives: ["bosalt", "bo\u015F"], normalized: "empty" },
13358
13493
  open: { primary: "a\xE7", alternatives: ["ac"], normalized: "open" },
@@ -13373,7 +13508,9 @@ var init_turkish = __esm({
13373
13508
  },
13374
13509
  hover: { primary: "\xFCzerine gelme", alternatives: ["\xFCzerinde gezinme"], normalized: "hover" },
13375
13510
  submit: { primary: "g\xF6nderme", normalized: "submit" },
13376
- input: { primary: "giri\u015F", alternatives: ["girdi", "giris"], normalized: "input" },
13511
+ // `giri\u015f` reads as entry/login (giri\u015f yapma) and can imply an auth event;
13512
+ // the data-input term is `girdi` ("Girdi (Input) Eventleri").
13513
+ input: { primary: "girdi", alternatives: ["giri\u015F", "giris"], normalized: "input" },
13377
13514
  change: { primary: "de\u011Fi\u015Fiklik", alternatives: ["de\u011Fi\u015Fim", "degisim"], normalized: "change" },
13378
13515
  // `load` event: the i18n dict emits y\u00fckle for `load`. Without this keyword the
13379
13516
  // SOV reorder's mid-stream `y\u00fckle de` (on load) tokenized as the `install`
@@ -13383,7 +13520,13 @@ var init_turkish = __esm({
13383
13520
  load: { primary: "y\xFCkle", normalized: "load" },
13384
13521
  // Navigation
13385
13522
  go: { primary: "git", normalized: "go" },
13386
- scroll: { primary: "kayd\u0131r", alternatives: ["kaydir"], normalized: "scroll" },
13523
+ // `kayd\u0131r` is the bare imperative; the attested event noun is `kayd\u0131rma`
13524
+ // ("kayd\u0131rma olay\u0131"). The imperative stays as an alternative.
13525
+ scroll: {
13526
+ primary: "kayd\u0131rma",
13527
+ alternatives: ["kaydirma", "kayd\u0131r", "kaydir"],
13528
+ normalized: "scroll"
13529
+ },
13387
13530
  push: { primary: "itele", alternatives: ["push"], normalized: "push" },
13388
13531
  replace: { primary: "de\u011Fi\u015Ftir_url", alternatives: ["degistir_url"], normalized: "replace" },
13389
13532
  process: { primary: "i\u015Fle", alternatives: ["isle"], normalized: "process" },
@@ -14336,6 +14479,49 @@ var init_chinese = __esm({
14336
14479
  }
14337
14480
  });
14338
14481
 
14482
+ // src/parser/utils/marker-resolution.ts
14483
+ function resolveMarkerForRole(roleSpec, profile) {
14484
+ const overrideMarker = roleSpec.markerOverride?.[profile.code];
14485
+ const defaultMarker = profile.roleMarkers[roleSpec.role];
14486
+ if (overrideMarker !== void 0) {
14487
+ const alternatives = legacyMarkerAlternatives(roleSpec, profile.code, overrideMarker);
14488
+ return {
14489
+ primary: overrideMarker,
14490
+ ...alternatives && { alternatives },
14491
+ position: defaultMarker?.position ?? "before",
14492
+ isOverride: true
14493
+ };
14494
+ }
14495
+ if (defaultMarker && defaultMarker.primary) {
14496
+ const result = {
14497
+ primary: defaultMarker.primary,
14498
+ position: defaultMarker.position,
14499
+ isOverride: false
14500
+ };
14501
+ if (defaultMarker.alternatives) {
14502
+ result.alternatives = defaultMarker.alternatives;
14503
+ }
14504
+ return result;
14505
+ }
14506
+ return null;
14507
+ }
14508
+ function legacyMarkerAlternatives(roleSpec, languageCode, overrideMarker) {
14509
+ const legacy = roleSpec.markerLegacy?.[languageCode];
14510
+ if (!legacy?.length) return void 0;
14511
+ const alternatives = [...new Set(legacy)].filter((a) => a && a !== overrideMarker);
14512
+ return alternatives.length ? alternatives : void 0;
14513
+ }
14514
+ function schemaMarkerAlternatives(roleSpec, languageCode, marker) {
14515
+ const legacy = roleSpec.markerLegacy?.[languageCode] ?? [];
14516
+ const variants = roleSpec.methodCarrier ? [] : roleSpec.markerVariants?.[languageCode] ?? [];
14517
+ const alternatives = [.../* @__PURE__ */ new Set([...legacy, ...variants])].filter((a) => a && a !== marker);
14518
+ return alternatives.length ? alternatives : void 0;
14519
+ }
14520
+ var init_marker_resolution = __esm({
14521
+ "src/parser/utils/marker-resolution.ts"() {
14522
+ }
14523
+ });
14524
+
14339
14525
  // src/patterns/put.ts
14340
14526
  function getPutPatternsBn() {
14341
14527
  return [
@@ -29135,49 +29321,6 @@ var init_role_positioning = __esm({
29135
29321
  }
29136
29322
  });
29137
29323
 
29138
- // src/parser/utils/marker-resolution.ts
29139
- function resolveMarkerForRole(roleSpec, profile) {
29140
- const overrideMarker = roleSpec.markerOverride?.[profile.code];
29141
- const defaultMarker = profile.roleMarkers[roleSpec.role];
29142
- if (overrideMarker !== void 0) {
29143
- const alternatives = legacyMarkerAlternatives(roleSpec, profile.code, overrideMarker);
29144
- return {
29145
- primary: overrideMarker,
29146
- ...alternatives && { alternatives },
29147
- position: defaultMarker?.position ?? "before",
29148
- isOverride: true
29149
- };
29150
- }
29151
- if (defaultMarker && defaultMarker.primary) {
29152
- const result = {
29153
- primary: defaultMarker.primary,
29154
- position: defaultMarker.position,
29155
- isOverride: false
29156
- };
29157
- if (defaultMarker.alternatives) {
29158
- result.alternatives = defaultMarker.alternatives;
29159
- }
29160
- return result;
29161
- }
29162
- return null;
29163
- }
29164
- function legacyMarkerAlternatives(roleSpec, languageCode, overrideMarker) {
29165
- const legacy = roleSpec.markerLegacy?.[languageCode];
29166
- if (!legacy?.length) return void 0;
29167
- const alternatives = [...new Set(legacy)].filter((a) => a && a !== overrideMarker);
29168
- return alternatives.length ? alternatives : void 0;
29169
- }
29170
- function schemaMarkerAlternatives(roleSpec, languageCode, marker) {
29171
- const legacy = roleSpec.markerLegacy?.[languageCode] ?? [];
29172
- const variants = roleSpec.methodCarrier ? [] : roleSpec.markerVariants?.[languageCode] ?? [];
29173
- const alternatives = [.../* @__PURE__ */ new Set([...legacy, ...variants])].filter((a) => a && a !== marker);
29174
- return alternatives.length ? alternatives : void 0;
29175
- }
29176
- var init_marker_resolution = __esm({
29177
- "src/parser/utils/marker-resolution.ts"() {
29178
- }
29179
- });
29180
-
29181
29324
  // src/generators/event-handlers-sov.ts
29182
29325
  function resolveRoleMarker(roleSpec, profile) {
29183
29326
  let marker;
@@ -29211,6 +29354,43 @@ function appendOptionalScope(tokens, extraction, commandSchema) {
29211
29354
  });
29212
29355
  extraction.scope = { fromRole: "scope" };
29213
29356
  }
29357
+ function appendOptionalViewTransition(tokens, extraction, commandSchema, languageCode) {
29358
+ appendOptionalTailRole(tokens, extraction, commandSchema, languageCode, "manner", {
29359
+ requireMarker: true
29360
+ });
29361
+ }
29362
+ function appendOptionalRecipient(tokens, extraction, commandSchema, languageCode) {
29363
+ appendOptionalTailRole(tokens, extraction, commandSchema, languageCode, "recipient", {
29364
+ requireMarker: false
29365
+ });
29366
+ }
29367
+ function appendOptionalTailRole(tokens, extraction, commandSchema, languageCode, role, opts) {
29368
+ const spec = commandSchema.roles.find((r) => r.role === role && !r.required);
29369
+ if (!spec) return;
29370
+ const marker = spec.markerOverride?.[languageCode];
29371
+ if (opts.requireMarker && !marker) return;
29372
+ tokens.push({
29373
+ type: "group",
29374
+ optional: true,
29375
+ tokens: [
29376
+ ...(marker ? marker.split(/\s+/) : []).map(
29377
+ (word) => ({ type: "literal", value: word })
29378
+ ),
29379
+ {
29380
+ type: "role",
29381
+ role,
29382
+ optional: true,
29383
+ expectedTypes: spec.expectedTypes,
29384
+ // Load-bearing, same as on the generated command patterns: it exempts
29385
+ // the trailing slot from the matcher's verb guard, keeps the uncaptured
29386
+ // slot out of `scoreRoleCoverage`'s denominator, and (for `keyword`)
29387
+ // normalizes the captured value type to the EN reference's `literal`.
29388
+ ...spec.valueShape !== void 0 ? { valueShape: spec.valueShape } : {}
29389
+ }
29390
+ ]
29391
+ });
29392
+ extraction[role] = { fromRole: role };
29393
+ }
29214
29394
  function generateSOVEventHandlerPattern(commandSchema, profile, keyword, eventMarker, config) {
29215
29395
  const tokens = [];
29216
29396
  tokens.push({ type: "role", role: "event", optional: false });
@@ -29305,6 +29485,15 @@ function generateSOVPatientFirstEventHandlerPattern(commandSchema, profile, keyw
29305
29485
  tokens.push(
29306
29486
  ...swapsOperands ? eventHandlerPatientGroup(commandSchema, trailingMarker) : eventHandlerDestinationGroup(commandSchema, trailingMarker)
29307
29487
  );
29488
+ const extraction = {
29489
+ action: { value: commandSchema.action },
29490
+ event: { fromRole: "event" },
29491
+ [frontedRole]: { fromRole: frontedRole },
29492
+ ...swapsOperands ? {} : eventHandlerDestinationExtraction(commandSchema),
29493
+ ...eventHandlerSourceExtraction(commandSchema)
29494
+ };
29495
+ appendOptionalRecipient(tokens, extraction, commandSchema, profile.code);
29496
+ appendOptionalViewTransition(tokens, extraction, commandSchema, profile.code);
29308
29497
  return {
29309
29498
  id: `${commandSchema.action}-event-${profile.code}-sov-patient-first`,
29310
29499
  language: profile.code,
@@ -29314,13 +29503,7 @@ function generateSOVPatientFirstEventHandlerPattern(commandSchema, profile, keyw
29314
29503
  format: `{patient} ${patientMarker?.primary || ""} {event} ${eventMarker.primary} ${keyword.primary}`,
29315
29504
  tokens
29316
29505
  },
29317
- extraction: {
29318
- action: { value: commandSchema.action },
29319
- event: { fromRole: "event" },
29320
- [frontedRole]: { fromRole: frontedRole },
29321
- ...swapsOperands ? {} : eventHandlerDestinationExtraction(commandSchema),
29322
- ...eventHandlerSourceExtraction(commandSchema)
29323
- }
29506
+ extraction
29324
29507
  };
29325
29508
  }
29326
29509
  function generateSOVPatientFirstWithDestEventHandlerPattern(commandSchema, profile, keyword, eventMarker, config) {
@@ -29762,6 +29945,16 @@ function generateVSOVerbFirstEventHandlerPattern(commandSchema, profile, keyword
29762
29945
  });
29763
29946
  }
29764
29947
  }
29948
+ const extraction = {
29949
+ action: { value: commandSchema.action },
29950
+ event: { fromRole: "event" },
29951
+ [swapsOperands ? "destination" : "patient"]: {
29952
+ fromRole: swapsOperands ? "destination" : "patient"
29953
+ },
29954
+ ...swapsOperands ? {} : eventHandlerDestinationExtraction(commandSchema),
29955
+ ...eventHandlerSourceExtraction(commandSchema)
29956
+ };
29957
+ appendOptionalViewTransition(tokens, extraction, commandSchema, profile.code);
29765
29958
  return {
29766
29959
  id: `${commandSchema.action}-event-${profile.code}-vso-verb-first`,
29767
29960
  language: profile.code,
@@ -29772,15 +29965,7 @@ function generateVSOVerbFirstEventHandlerPattern(commandSchema, profile, keyword
29772
29965
  format: `${keyword.primary} {patient} ${destMarker?.primary || ""} {destination?} ${eventMarker.primary} {event}`,
29773
29966
  tokens
29774
29967
  },
29775
- extraction: {
29776
- action: { value: commandSchema.action },
29777
- event: { fromRole: "event" },
29778
- [swapsOperands ? "destination" : "patient"]: {
29779
- fromRole: swapsOperands ? "destination" : "patient"
29780
- },
29781
- ...swapsOperands ? {} : eventHandlerDestinationExtraction(commandSchema),
29782
- ...eventHandlerSourceExtraction(commandSchema)
29783
- }
29968
+ extraction
29784
29969
  };
29785
29970
  }
29786
29971
  function generateVSOVerbFirstTwoRoleEventHandlerPattern(commandSchema, profile, keyword, eventMarker, config) {
@@ -30355,7 +30540,11 @@ function buildRoleToken(roleSpec, profile) {
30355
30540
  type: "role",
30356
30541
  role: roleSpec.role,
30357
30542
  optional: !roleSpec.required,
30358
- expectedTypes: roleSpec.expectedTypes
30543
+ expectedTypes: roleSpec.expectedTypes,
30544
+ // The matcher reads this too \u2014 a `'keyword'`-shaped slot holds a fixed
30545
+ // keyword phrase (`using view transition`) and must not be skipped by the
30546
+ // trailing-slot verb guard.
30547
+ ...roleSpec.valueShape !== void 0 ? { valueShape: roleSpec.valueShape } : {}
30359
30548
  };
30360
30549
  const prefixLiteral = roleSpec.valuePrefixLiteral?.[profile.code];
30361
30550
  const pushPrefixed = () => {
@@ -30636,9 +30825,24 @@ var init_pick = __esm({
30636
30825
  });
30637
30826
 
30638
30827
  // src/patterns/languages/en/swap.ts
30639
- var swapSimpleEnglish, swapElementEnglish, swapStrategyOfEnglish, swapStrategyEnglish, swapPatternsEn;
30828
+ var VIEW_TRANSITION_TAIL, swapSimpleEnglish, swapElementEnglish, swapStrategyOfEnglish, swapStrategyEnglish, swapPatternsEn;
30640
30829
  var init_swap = __esm({
30641
30830
  "src/patterns/languages/en/swap.ts"() {
30831
+ VIEW_TRANSITION_TAIL = {
30832
+ type: "group",
30833
+ optional: true,
30834
+ tokens: [
30835
+ { type: "literal", value: "using" },
30836
+ { type: "literal", value: "view" },
30837
+ {
30838
+ type: "role",
30839
+ role: "manner",
30840
+ optional: true,
30841
+ expectedTypes: ["literal", "expression"],
30842
+ valueShape: "keyword"
30843
+ }
30844
+ ]
30845
+ };
30642
30846
  swapSimpleEnglish = {
30643
30847
  id: "swap-en-handcrafted",
30644
30848
  language: "en",
@@ -30646,11 +30850,12 @@ var init_swap = __esm({
30646
30850
  priority: 110,
30647
30851
  // Higher than generated patterns
30648
30852
  template: {
30649
- format: "swap {method} {destination}",
30853
+ format: "swap {method} {destination} [using view {manner}]",
30650
30854
  tokens: [
30651
30855
  { type: "literal", value: "swap" },
30652
30856
  { type: "role", role: "method" },
30653
- { type: "role", role: "destination" }
30857
+ { type: "role", role: "destination" },
30858
+ VIEW_TRANSITION_TAIL
30654
30859
  ]
30655
30860
  },
30656
30861
  extraction: {
@@ -30664,12 +30869,13 @@ var init_swap = __esm({
30664
30869
  command: "swap",
30665
30870
  priority: 120,
30666
30871
  template: {
30667
- format: "swap {destination} with {patient}",
30872
+ format: "swap {destination} with {patient} [using view {manner}]",
30668
30873
  tokens: [
30669
30874
  { type: "literal", value: "swap" },
30670
30875
  { type: "role", role: "destination" },
30671
30876
  { type: "literal", value: "with" },
30672
- { type: "role", role: "patient" }
30877
+ { type: "role", role: "patient" },
30878
+ VIEW_TRANSITION_TAIL
30673
30879
  ]
30674
30880
  },
30675
30881
  extraction: {}
@@ -30680,14 +30886,15 @@ var init_swap = __esm({
30680
30886
  command: "swap",
30681
30887
  priority: 140,
30682
30888
  template: {
30683
- format: "swap {method} of {destination} with {patient}",
30889
+ format: "swap {method} of {destination} with {patient} [using view {manner}]",
30684
30890
  tokens: [
30685
30891
  { type: "literal", value: "swap" },
30686
30892
  { type: "role", role: "method" },
30687
30893
  { type: "literal", value: "of" },
30688
30894
  { type: "role", role: "destination" },
30689
30895
  { type: "literal", value: "with" },
30690
- { type: "role", role: "patient" }
30896
+ { type: "role", role: "patient" },
30897
+ VIEW_TRANSITION_TAIL
30691
30898
  ]
30692
30899
  },
30693
30900
  extraction: {}
@@ -30698,13 +30905,14 @@ var init_swap = __esm({
30698
30905
  command: "swap",
30699
30906
  priority: 130,
30700
30907
  template: {
30701
- format: "swap {method} {destination} with {patient}",
30908
+ format: "swap {method} {destination} with {patient} [using view {manner}]",
30702
30909
  tokens: [
30703
30910
  { type: "literal", value: "swap" },
30704
30911
  { type: "role", role: "method" },
30705
30912
  { type: "role", role: "destination" },
30706
30913
  { type: "literal", value: "with" },
30707
- { type: "role", role: "patient" }
30914
+ { type: "role", role: "patient" },
30915
+ VIEW_TRANSITION_TAIL
30708
30916
  ]
30709
30917
  },
30710
30918
  extraction: {}
@@ -32441,6 +32649,7 @@ init_vietnamese();
32441
32649
  init_chinese();
32442
32650
 
32443
32651
  // src/parser/pattern-matcher.ts
32652
+ init_marker_resolution();
32444
32653
  init_command_schemas();
32445
32654
 
32446
32655
  // src/parser/utils/possessive-keywords.ts
@@ -32478,6 +32687,7 @@ init_base();
32478
32687
  // src/parser/semantic-parser.ts
32479
32688
  init_registry();
32480
32689
  init_command_schemas();
32690
+ init_marker_resolution();
32481
32691
 
32482
32692
  // src/parser/block-parser.ts
32483
32693
  init_registry();
@@ -1,2 +1,2 @@
1
- import{D as n,d as i}from"./browser-modular-BllAMlht.js";import"./feature-sockets-CcTxD5sT.js";function e(n){const i=n.diagnostics;return i?.length?i.filter(n=>"unconsumed-input"===n.code).map(n=>n.message):[]}let t=null;async function a(){return t||(t=await import("./browser-modular-BllAMlht.js").then(function(n){return n.n})),t}class c{constructor(i={}){this._initialized=!1,this.config={confidenceThreshold:i.confidenceThreshold??n,fallbackOnLowConfidence:i.fallbackOnLowConfidence??!0}}async initialize(){await a(),this._initialized=!0}isInitialized(){return this._initialized}async transform(n,i,e){if(this.isInitialized()||await this.initialize(),i===e)return{output:n,usedSemantic:!1,confidence:1,sourceLang:i,targetLang:e};const t=await a();try{const a=t.translate(n,i,e);if(a!==n)return{output:a,usedSemantic:!0,confidence:.9,sourceLang:i,targetLang:e}}catch{}return{output:n,usedSemantic:!1,confidence:0,sourceLang:i,targetLang:e}}async parse(n,i){this.isInitialized()||await this.initialize();return(await a()).parseSemantic(n,i).node??null}async render(n,i){return(await a()).render(n,i)}async parseToAST(n,i){this.isInitialized()||await this.initialize();const e=await a(),t=e.parseSemantic(n,i);if(t.confidence>=this.config.confidenceThreshold&&t.node)try{return e.buildAST(t.node).ast}catch(n){}return null}async parseToASTWithDetails(n,i){this.isInitialized()||await this.initialize();const t=await a(),c=t.parseSemantic(n,i);if(c.confidence>=this.config.confidenceThreshold&&c.node)try{const n=t.buildAST(c.node);return{ast:n.ast,usedDirectPath:!0,confidence:c.confidence,lang:i,fallbackText:null,warnings:[...n.warnings??[],...e(c.node)]}}catch{}if(c.node&&this.config.fallbackOnLowConfidence){const n=t.render(c.node,"en");return{ast:null,usedDirectPath:!1,confidence:c.confidence,lang:i,fallbackText:n}}return{ast:null,usedDirectPath:!1,confidence:c.confidence,lang:i,fallbackText:null}}async getAllTranslations(n,i){const e=(await a()).getSupportedLanguages(),t={};for(const a of e)t[a]=await this.transform(n,i,a);return t}}export{c as SemanticGrammarBridge};
2
- //# sourceMappingURL=bridge-DhmZ3Khh.js.map
1
+ import{D as n,d as i}from"./browser-modular-B0lGdcoP.js";import"./feature-sockets-CcTxD5sT.js";function e(n){const i=n.diagnostics;return i?.length?i.filter(n=>"unconsumed-input"===n.code).map(n=>n.message):[]}let t=null;async function a(){return t||(t=await import("./browser-modular-B0lGdcoP.js").then(function(n){return n.n})),t}class c{constructor(i={}){this._initialized=!1,this.config={confidenceThreshold:i.confidenceThreshold??n,fallbackOnLowConfidence:i.fallbackOnLowConfidence??!0}}async initialize(){await a(),this._initialized=!0}isInitialized(){return this._initialized}async transform(n,i,e){if(this.isInitialized()||await this.initialize(),i===e)return{output:n,usedSemantic:!1,confidence:1,sourceLang:i,targetLang:e};const t=await a();try{const a=t.translate(n,i,e);if(a!==n)return{output:a,usedSemantic:!0,confidence:.9,sourceLang:i,targetLang:e}}catch{}return{output:n,usedSemantic:!1,confidence:0,sourceLang:i,targetLang:e}}async parse(n,i){this.isInitialized()||await this.initialize();return(await a()).parseSemantic(n,i).node??null}async render(n,i){return(await a()).render(n,i)}async parseToAST(n,i){this.isInitialized()||await this.initialize();const e=await a(),t=e.parseSemantic(n,i);if(t.confidence>=this.config.confidenceThreshold&&t.node)try{return e.buildAST(t.node).ast}catch(n){}return null}async parseToASTWithDetails(n,i){this.isInitialized()||await this.initialize();const t=await a(),c=t.parseSemantic(n,i);if(c.confidence>=this.config.confidenceThreshold&&c.node)try{const n=t.buildAST(c.node);return{ast:n.ast,usedDirectPath:!0,confidence:c.confidence,lang:i,fallbackText:null,warnings:[...n.warnings??[],...e(c.node)]}}catch{}if(c.node&&this.config.fallbackOnLowConfidence){const n=t.render(c.node,"en");return{ast:null,usedDirectPath:!1,confidence:c.confidence,lang:i,fallbackText:n}}return{ast:null,usedDirectPath:!1,confidence:c.confidence,lang:i,fallbackText:null}}async getAllTranslations(n,i){const e=(await a()).getSupportedLanguages(),t={};for(const a of e)t[a]=await this.transform(n,i,a);return t}}export{c as SemanticGrammarBridge};
2
+ //# sourceMappingURL=bridge-CPNAPYAo.js.map