@esportsplus/template 0.16.0 → 0.16.2

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 (53) hide show
  1. package/.editorconfig +9 -9
  2. package/.gitattributes +2 -2
  3. package/.github/dependabot.yml +24 -24
  4. package/.github/workflows/bump.yml +8 -8
  5. package/.github/workflows/dependabot.yml +11 -11
  6. package/.github/workflows/publish.yml +16 -16
  7. package/README.md +385 -385
  8. package/build/compiler/codegen.js +9 -9
  9. package/build/compiler/index.js +3 -3
  10. package/{src/llm.txt → llm.txt} +403 -403
  11. package/package.json +10 -3
  12. package/src/attributes.ts +312 -312
  13. package/src/compiler/codegen.ts +492 -492
  14. package/src/compiler/constants.ts +24 -24
  15. package/src/compiler/index.ts +87 -87
  16. package/src/compiler/parser.ts +242 -242
  17. package/src/compiler/plugins/tsc.ts +6 -6
  18. package/src/compiler/plugins/vite.ts +10 -10
  19. package/src/compiler/ts-analyzer.ts +89 -89
  20. package/src/compiler/ts-parser.ts +112 -112
  21. package/src/constants.ts +44 -44
  22. package/src/event/index.ts +130 -130
  23. package/src/event/onconnect.ts +22 -22
  24. package/src/event/onresize.ts +37 -37
  25. package/src/event/ontick.ts +59 -59
  26. package/src/html.ts +18 -18
  27. package/src/index.ts +18 -18
  28. package/src/render.ts +13 -13
  29. package/src/slot/array.ts +257 -257
  30. package/src/slot/cleanup.ts +37 -37
  31. package/src/slot/effect.ts +114 -114
  32. package/src/slot/index.ts +16 -16
  33. package/src/slot/render.ts +61 -61
  34. package/src/svg.ts +27 -27
  35. package/src/types.ts +40 -40
  36. package/src/utilities.ts +53 -53
  37. package/test/attributes.test.ts +311 -0
  38. package/test/compiler/parser.test.ts +402 -0
  39. package/test/compiler/ts-analyzer.test.ts +296 -0
  40. package/test/constants.test.ts +153 -0
  41. package/test/event/index.test.ts +359 -0
  42. package/test/html.test.ts +33 -0
  43. package/test/index.ts +648 -648
  44. package/test/render.test.ts +154 -0
  45. package/test/slot/array.test.ts +475 -0
  46. package/test/slot/cleanup.test.ts +243 -0
  47. package/test/slot/effect.test.ts +263 -0
  48. package/test/slot/index.test.ts +176 -0
  49. package/test/slot/render.test.ts +216 -0
  50. package/test/svg.test.ts +92 -0
  51. package/test/utilities.test.ts +242 -0
  52. package/tsconfig.json +8 -8
  53. package/vitest.config.ts +21 -0
@@ -21,9 +21,9 @@ function collectNestedReplacements(ctx, node, replacements) {
21
21
  replacements.push({
22
22
  end: node.end,
23
23
  start: node.getStart(ctx.sourceFile),
24
- text: `new ${NAMESPACE}.ArraySlot(
25
- ${rewriteExpression(ctx, call.arguments[0])},
26
- ${rewriteExpression(ctx, call.arguments[1])}
24
+ text: `new ${NAMESPACE}.ArraySlot(
25
+ ${rewriteExpression(ctx, call.arguments[0])},
26
+ ${rewriteExpression(ctx, call.arguments[1])}
27
27
  )`
28
28
  });
29
29
  return;
@@ -162,16 +162,16 @@ function generateTemplateCode(ctx, { html, slots }, exprTexts, exprNodes, templa
162
162
  }
163
163
  }
164
164
  else {
165
- code.push(`${NAMESPACE}.setProperties(
166
- ${element}, ${exprTexts[index] || 'undefined'},
167
- ${getAttributes(declarations, i, 'attributes', slot, attributes)}
165
+ code.push(`${NAMESPACE}.setProperties(
166
+ ${element}, ${exprTexts[index] || 'undefined'},
167
+ ${getAttributes(declarations, i, 'attributes', slot, attributes)}
168
168
  );`);
169
169
  }
170
170
  }
171
171
  else {
172
- code.push(`${NAMESPACE}.setProperties(
173
- ${element}, ${exprTexts[index] || 'undefined'},
174
- ${getAttributes(declarations, i, 'attributes', slot, attributes)}
172
+ code.push(`${NAMESPACE}.setProperties(
173
+ ${element}, ${exprTexts[index] || 'undefined'},
174
+ ${getAttributes(declarations, i, 'attributes', slot, attributes)}
175
175
  );`);
176
176
  }
177
177
  index++;
@@ -32,9 +32,9 @@ export default {
32
32
  templates: callTemplates
33
33
  }, call.callbackArg);
34
34
  replacements.push({
35
- generate: (sourceFile) => `new ${NAMESPACE}.ArraySlot(
36
- ${printer.printNode(ts.EmitHint.Expression, call.arrayArg, sourceFile)},
37
- ${rewrittenCallback}
35
+ generate: (sourceFile) => `new ${NAMESPACE}.ArraySlot(
36
+ ${printer.printNode(ts.EmitHint.Expression, call.arrayArg, sourceFile)},
37
+ ${rewrittenCallback}
38
38
  )`,
39
39
  node: call.node
40
40
  });