@danielx/civet 0.5.12 → 0.5.14

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/README.md CHANGED
@@ -213,10 +213,14 @@ Things Added that CoffeeScript didn't
213
213
  - JSX enhancements (inspired by [solid-dsl discussions](https://github.com/solidjs-community/solid-dsl/discussions)):
214
214
  - Indentation: instead of explicitly closing `<tag>`s or `<>`s,
215
215
  you can indent the children and Civet will close your tags for you
216
+ - Arrow function children do not need to be wrapped in braces
217
+ (assuming they are not preceded by text); this is unambiguous because
218
+ `>` isn't valid JSX text. For example, `<For> (item) => ...`
219
+ (where function body can be indented).
216
220
  - Any braced object literal can be used as an attribute:
217
221
  `{foo}` → `foo={foo}`, `{foo: bar}` → `foo={bar}`,
218
222
  `{...foo}` remains as is; methods and getters/setters work too.
219
- - `...foo` shorthand for `{...foo}`
223
+ - Attribute `...foo` shorthand for `{...foo}`
220
224
  - Attribute values without whitespace or suitably wrapped
221
225
  (parenthesized expressions, strings and template strings,
222
226
  regular expressions, array literals, braced object literals)
package/dist/browser.js CHANGED
@@ -4615,8 +4615,9 @@ ${input.slice(result.pos)}
4615
4615
  }
4616
4616
  }
4617
4617
  var ArrayLiteralContent$0 = RangeExpression;
4618
- var ArrayLiteralContent$1 = NestedElementList;
4619
- var ArrayLiteralContent$2 = $TS($S(ElementList, InsertComma, $E(NestedElementList)), function($skip, $loc, $0, $1, $2, $3) {
4618
+ var ArrayLiteralContent$1 = $S(NestedImplicitObjectLiteral, $Q($S(__, Comma, NestedImplicitObjectLiteral)));
4619
+ var ArrayLiteralContent$2 = NestedElementList;
4620
+ var ArrayLiteralContent$3 = $TS($S(ElementList, InsertComma, $E(NestedElementList)), function($skip, $loc, $0, $1, $2, $3) {
4620
4621
  var list = $1;
4621
4622
  var comma = $2;
4622
4623
  var nested = $3;
@@ -4633,12 +4634,12 @@ ${input.slice(result.pos)}
4633
4634
  return result.cache;
4634
4635
  }
4635
4636
  if (state.tokenize) {
4636
- const result = $TOKEN("ArrayLiteralContent", state, ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state) || ArrayLiteralContent$2(state));
4637
+ const result = $TOKEN("ArrayLiteralContent", state, ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state) || ArrayLiteralContent$2(state) || ArrayLiteralContent$3(state));
4637
4638
  if (state.events)
4638
4639
  state.events.exit?.("ArrayLiteralContent", state, result);
4639
4640
  return result;
4640
4641
  } else {
4641
- const result = ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state) || ArrayLiteralContent$2(state);
4642
+ const result = ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state) || ArrayLiteralContent$2(state) || ArrayLiteralContent$3(state);
4642
4643
  if (state.events)
4643
4644
  state.events.exit?.("ArrayLiteralContent", state, result);
4644
4645
  return result;
@@ -11673,10 +11674,9 @@ ${input.slice(result.pos)}
11673
11674
  return result;
11674
11675
  }
11675
11676
  }
11676
- var JSXChild$0 = JSXText;
11677
- var JSXChild$1 = JSXElement;
11678
- var JSXChild$2 = JSXFragment;
11679
- var JSXChild$3 = $TS($S(OpenBrace, $E(JSXChildExpression), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
11677
+ var JSXChild$0 = JSXElement;
11678
+ var JSXChild$1 = JSXFragment;
11679
+ var JSXChild$2 = $TS($S(OpenBrace, $E(JSXChildExpression), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
11680
11680
  var expression = $2;
11681
11681
  return {
11682
11682
  type: "JSXChildExpression",
@@ -11684,6 +11684,15 @@ ${input.slice(result.pos)}
11684
11684
  expression
11685
11685
  };
11686
11686
  });
11687
+ var JSXChild$3 = $TS($S(InsertInlineOpenBrace, ArrowFunction, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
11688
+ var expression = $2;
11689
+ return {
11690
+ type: "JSXChildExpression",
11691
+ children: $0,
11692
+ expression
11693
+ };
11694
+ });
11695
+ var JSXChild$4 = JSXText;
11687
11696
  function JSXChild(state) {
11688
11697
  if (state.events) {
11689
11698
  const result = state.events.enter?.("JSXChild", state);
@@ -11691,12 +11700,12 @@ ${input.slice(result.pos)}
11691
11700
  return result.cache;
11692
11701
  }
11693
11702
  if (state.tokenize) {
11694
- const result = $TOKEN("JSXChild", state, JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state));
11703
+ const result = $TOKEN("JSXChild", state, JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state));
11695
11704
  if (state.events)
11696
11705
  state.events.exit?.("JSXChild", state, result);
11697
11706
  return result;
11698
11707
  } else {
11699
- const result = JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state);
11708
+ const result = JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state);
11700
11709
  if (state.events)
11701
11710
  state.events.exit?.("JSXChild", state, result);
11702
11711
  return result;
package/dist/main.js CHANGED
@@ -4614,8 +4614,9 @@ ${input.slice(result.pos)}
4614
4614
  }
4615
4615
  }
4616
4616
  var ArrayLiteralContent$0 = RangeExpression;
4617
- var ArrayLiteralContent$1 = NestedElementList;
4618
- var ArrayLiteralContent$2 = $TS($S(ElementList, InsertComma, $E(NestedElementList)), function($skip, $loc, $0, $1, $2, $3) {
4617
+ var ArrayLiteralContent$1 = $S(NestedImplicitObjectLiteral, $Q($S(__, Comma, NestedImplicitObjectLiteral)));
4618
+ var ArrayLiteralContent$2 = NestedElementList;
4619
+ var ArrayLiteralContent$3 = $TS($S(ElementList, InsertComma, $E(NestedElementList)), function($skip, $loc, $0, $1, $2, $3) {
4619
4620
  var list = $1;
4620
4621
  var comma = $2;
4621
4622
  var nested = $3;
@@ -4632,12 +4633,12 @@ ${input.slice(result.pos)}
4632
4633
  return result.cache;
4633
4634
  }
4634
4635
  if (state.tokenize) {
4635
- const result = $TOKEN("ArrayLiteralContent", state, ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state) || ArrayLiteralContent$2(state));
4636
+ const result = $TOKEN("ArrayLiteralContent", state, ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state) || ArrayLiteralContent$2(state) || ArrayLiteralContent$3(state));
4636
4637
  if (state.events)
4637
4638
  state.events.exit?.("ArrayLiteralContent", state, result);
4638
4639
  return result;
4639
4640
  } else {
4640
- const result = ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state) || ArrayLiteralContent$2(state);
4641
+ const result = ArrayLiteralContent$0(state) || ArrayLiteralContent$1(state) || ArrayLiteralContent$2(state) || ArrayLiteralContent$3(state);
4641
4642
  if (state.events)
4642
4643
  state.events.exit?.("ArrayLiteralContent", state, result);
4643
4644
  return result;
@@ -11672,10 +11673,9 @@ ${input.slice(result.pos)}
11672
11673
  return result;
11673
11674
  }
11674
11675
  }
11675
- var JSXChild$0 = JSXText;
11676
- var JSXChild$1 = JSXElement;
11677
- var JSXChild$2 = JSXFragment;
11678
- var JSXChild$3 = $TS($S(OpenBrace, $E(JSXChildExpression), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
11676
+ var JSXChild$0 = JSXElement;
11677
+ var JSXChild$1 = JSXFragment;
11678
+ var JSXChild$2 = $TS($S(OpenBrace, $E(JSXChildExpression), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
11679
11679
  var expression = $2;
11680
11680
  return {
11681
11681
  type: "JSXChildExpression",
@@ -11683,6 +11683,15 @@ ${input.slice(result.pos)}
11683
11683
  expression
11684
11684
  };
11685
11685
  });
11686
+ var JSXChild$3 = $TS($S(InsertInlineOpenBrace, ArrowFunction, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
11687
+ var expression = $2;
11688
+ return {
11689
+ type: "JSXChildExpression",
11690
+ children: $0,
11691
+ expression
11692
+ };
11693
+ });
11694
+ var JSXChild$4 = JSXText;
11686
11695
  function JSXChild(state) {
11687
11696
  if (state.events) {
11688
11697
  const result = state.events.enter?.("JSXChild", state);
@@ -11690,12 +11699,12 @@ ${input.slice(result.pos)}
11690
11699
  return result.cache;
11691
11700
  }
11692
11701
  if (state.tokenize) {
11693
- const result = $TOKEN("JSXChild", state, JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state));
11702
+ const result = $TOKEN("JSXChild", state, JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state));
11694
11703
  if (state.events)
11695
11704
  state.events.exit?.("JSXChild", state, result);
11696
11705
  return result;
11697
11706
  } else {
11698
- const result = JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state);
11707
+ const result = JSXChild$0(state) || JSXChild$1(state) || JSXChild$2(state) || JSXChild$3(state) || JSXChild$4(state);
11699
11708
  if (state.events)
11700
11709
  state.events.exit?.("JSXChild", state, result);
11701
11710
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
- "version": "0.5.12",
3
+ "version": "0.5.14",
4
4
  "description": "CoffeeScript style syntax for TypeScript",
5
5
  "main": "dist/main.js",
6
6
  "exports": {