@danielx/civet 0.5.13 → 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
@@ -11674,10 +11674,9 @@ ${input.slice(result.pos)}
11674
11674
  return result;
11675
11675
  }
11676
11676
  }
11677
- var JSXChild$0 = JSXText;
11678
- var JSXChild$1 = JSXElement;
11679
- var JSXChild$2 = JSXFragment;
11680
- 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) {
11681
11680
  var expression = $2;
11682
11681
  return {
11683
11682
  type: "JSXChildExpression",
@@ -11685,6 +11684,15 @@ ${input.slice(result.pos)}
11685
11684
  expression
11686
11685
  };
11687
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;
11688
11696
  function JSXChild(state) {
11689
11697
  if (state.events) {
11690
11698
  const result = state.events.enter?.("JSXChild", state);
@@ -11692,12 +11700,12 @@ ${input.slice(result.pos)}
11692
11700
  return result.cache;
11693
11701
  }
11694
11702
  if (state.tokenize) {
11695
- 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));
11696
11704
  if (state.events)
11697
11705
  state.events.exit?.("JSXChild", state, result);
11698
11706
  return result;
11699
11707
  } else {
11700
- 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);
11701
11709
  if (state.events)
11702
11710
  state.events.exit?.("JSXChild", state, result);
11703
11711
  return result;
package/dist/main.js CHANGED
@@ -11673,10 +11673,9 @@ ${input.slice(result.pos)}
11673
11673
  return result;
11674
11674
  }
11675
11675
  }
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) {
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) {
11680
11679
  var expression = $2;
11681
11680
  return {
11682
11681
  type: "JSXChildExpression",
@@ -11684,6 +11683,15 @@ ${input.slice(result.pos)}
11684
11683
  expression
11685
11684
  };
11686
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;
11687
11695
  function JSXChild(state) {
11688
11696
  if (state.events) {
11689
11697
  const result = state.events.enter?.("JSXChild", state);
@@ -11691,12 +11699,12 @@ ${input.slice(result.pos)}
11691
11699
  return result.cache;
11692
11700
  }
11693
11701
  if (state.tokenize) {
11694
- 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));
11695
11703
  if (state.events)
11696
11704
  state.events.exit?.("JSXChild", state, result);
11697
11705
  return result;
11698
11706
  } else {
11699
- 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);
11700
11708
  if (state.events)
11701
11709
  state.events.exit?.("JSXChild", state, result);
11702
11710
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
- "version": "0.5.13",
3
+ "version": "0.5.14",
4
4
  "description": "CoffeeScript style syntax for TypeScript",
5
5
  "main": "dist/main.js",
6
6
  "exports": {