@lokascript/compilation-service 2.11.1 → 3.1.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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CoreParserAdapter,
3
3
  createCoreParserAdapter
4
- } from "./chunk-BDISUJ32.js";
4
+ } from "./chunk-TVK2OFIB.js";
5
5
  import {
6
6
  SemanticParserAdapter,
7
7
  createSemanticAdapter
@@ -1889,7 +1889,8 @@ var AddCodegen = class {
1889
1889
  generate(node, ctx) {
1890
1890
  const args = node.args ?? [];
1891
1891
  if (args.length === 0) return null;
1892
- const target = node.target ? ctx.generateExpression(node.target) : "_ctx.me";
1892
+ const targetSlot = node.target ?? node.modifiers?.to;
1893
+ const target = targetSlot ? ctx.generateExpression(targetSlot) : "_ctx.me";
1893
1894
  const arg = args[0];
1894
1895
  if (arg.type === "selector") {
1895
1896
  const selector = arg.value;
@@ -1940,14 +1941,16 @@ var RemoveCodegen = class {
1940
1941
  generate(node, ctx) {
1941
1942
  const args = node.args ?? [];
1942
1943
  if (args.length === 0) {
1943
- const target2 = node.target ? ctx.generateExpression(node.target) : "_ctx.me";
1944
+ const targetSlot2 = node.target ?? node.modifiers?.from;
1945
+ const target2 = targetSlot2 ? ctx.generateExpression(targetSlot2) : "_ctx.me";
1944
1946
  return {
1945
1947
  code: `${target2}.remove()`,
1946
1948
  async: false,
1947
1949
  sideEffects: true
1948
1950
  };
1949
1951
  }
1950
- const target = node.target ? ctx.generateExpression(node.target) : "_ctx.me";
1952
+ const targetSlot = node.target ?? node.modifiers?.from;
1953
+ const target = targetSlot ? ctx.generateExpression(targetSlot) : "_ctx.me";
1951
1954
  const arg = args[0];
1952
1955
  if (arg.type === "selector") {
1953
1956
  const selector = arg.value;
@@ -2429,7 +2432,9 @@ var ScrollCodegen = class {
2429
2432
  }
2430
2433
  generate(node, ctx) {
2431
2434
  const target = node.target ? ctx.generateExpression(node.target) : "_ctx.me";
2432
- const behavior = node.modifiers?.smooth ? "'smooth'" : "'auto'";
2435
+ const mods = node.modifiers;
2436
+ const smooth = mods?.smooth || mods?.behavior?.value === "smooth";
2437
+ const behavior = smooth ? "'smooth'" : "'auto'";
2433
2438
  return {
2434
2439
  code: `${target}.scrollIntoView({ behavior: ${behavior} })`,
2435
2440
  async: false,
@@ -2596,7 +2601,11 @@ var GoCodegen = class {
2596
2601
  generate(node, ctx) {
2597
2602
  const args = node.args ?? [];
2598
2603
  const roles = node.roles;
2599
- const target = roles?.destination ?? args[0];
2604
+ const mods = node.modifiers;
2605
+ if (mods?.back) {
2606
+ return { code: "history.back()", async: false, sideEffects: true };
2607
+ }
2608
+ const target = mods?.url ?? roles?.destination ?? args[0];
2600
2609
  if (!target) return null;
2601
2610
  if (target.type === "identifier") {
2602
2611
  const name = target.value;
@@ -4214,7 +4223,7 @@ async function compileHyperscript(code, options) {
4214
4223
  async function createMultilingualCompiler() {
4215
4224
  const compiler = new AOTCompiler();
4216
4225
  try {
4217
- const { createCoreParserAdapter: createCoreParserAdapter2 } = await import("./core-parser-adapter-VCJB52SO-W3GDT5C6.js");
4226
+ const { createCoreParserAdapter: createCoreParserAdapter2 } = await import("./core-parser-adapter-W5UPZR4X-AIVYD5RA.js");
4218
4227
  compiler.setParser(await createCoreParserAdapter2());
4219
4228
  } catch {
4220
4229
  }
@@ -4267,4 +4276,4 @@ export {
4267
4276
  sanitizeSelector,
4268
4277
  scanFiles
4269
4278
  };
4270
- //# sourceMappingURL=dist-4JWIJVFR.js.map
4279
+ //# sourceMappingURL=dist-HDVJKXUX.js.map