lilact 0.15.3 → 0.15.4

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,8 +1,29 @@
1
1
  module.exports = function() {
2
2
 
3
3
  return <center>
4
+ <button onClick={()=>{doUnknown()}}>
5
+ Press to get Error! (With Curly Brackets)
6
+ </button>
7
+ <br/><br/>
4
8
  <button onClick={()=>doUnknown()}>
5
- Press to get Error!
9
+ Press to get Error! (Without Curly Brackets)
6
10
  </button>
7
- </center>
11
+
12
+ <p>The first button's onClick arrow handler body is wrapped in curly brackets. <br/><br/>
13
+
14
+ {"<button onClick={()=>{doUnknown()}}>"}<br/><br/>
15
+
16
+ JS runtimes currently lack a consistent reporting mechanism for errors produced in eval,
17
+ and as Lilact runs the transpiled JSX in eval, tracing errors has its own difficulties.
18
+ <br/><br/>
19
+ At the moment things work pretty nice and errors are tracked to the JSX scripts in
20
+ {" "}<b>Firefox</b>{" "}and{" "}<b>Chrome</b>{" "}, but{" "}<b>Safari</b>{" "}
21
+ has problems sometimes, as it drops the eval frame data on async or deferred calls.
22
+ <br/><br/>
23
+ Lilact has a tracking mechanism to overcome this, but for the sake of efficiency,
24
+ it is block-based and only locates the code that is in {" {} "} blocks. As a result, the callbacks
25
+ should be wrapped in a {" {} "} to be tracable in Safari. If not, it works,
26
+ but it is not possible to display the exact location of some errors in Safari.</p>
27
+ </center>
28
+
8
29
  }
@@ -20,11 +20,11 @@ module.exports = function Demo() {
20
20
  childRefs.current[i] = handle;
21
21
  };
22
22
 
23
- const components = [1, 2, 3];
23
+ const components = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
24
24
 
25
25
  return <center>
26
26
  <p>This is an example of using forwardRef in combination with
27
- function refs.
27
+ function refs. See the console for logs.
28
28
  </p>
29
29
 
30
30
  <div>
@@ -18,7 +18,7 @@
18
18
  <script type='text/jsx'>
19
19
 
20
20
  const { useRef, useEffect, useState, Suspense, Spinner, run, render } = Lilact;
21
- const { css,cx,injectGlobal } = Lilact.emotion;
21
+ const { css,cx,keyframes,injectGlobal } = Lilact.emotion;
22
22
 
23
23
 
24
24
  const cache = new Map();
@@ -72,8 +72,8 @@ injectGlobal({
72
72
  overflowWrap: "anywhere"
73
73
  },
74
74
  p: {padding: "10px"},
75
- body: { padding: "20px", background: "#1a2d2c", color: "#e7e7e7" },
76
- ":visited": {color: "#c16480"},
75
+ body: { padding: "20px", background: "#434b5f", color: "#fff", textShadow: "0 0 10px #0002", lineHeight: "1.4rem" },
76
+ ":visited": {color: "#fff"},
77
77
 
78
78
  });
79
79
 
@@ -195,6 +195,17 @@ function DemoBlock({entry})
195
195
  </div>
196
196
  }
197
197
 
198
+ const glow = keyframes`
199
+ 0% {
200
+ filter: drop-shadow(rgb(202, 131, 203) 0px 0px 8px);
201
+ }
202
+ 50% {
203
+ filter: drop-shadow(rgb(252, 131, 203) 0px 0px 18px);
204
+ }
205
+ 100% {
206
+ filter: drop-shadow(rgb(202, 131, 203) 0px 0px 8px);
207
+ }
208
+ `;
198
209
 
199
210
  function App()
200
211
  {
@@ -234,7 +245,7 @@ function App()
234
245
 
235
246
  return<>
236
247
  <center>
237
- <img src="icon.png" width="128"/><br/>
248
+ <img src="icon.png" width="128" style={`animation: ${glow} 5s ease-in-out infinite`}/><br/>
238
249
  <h1>Lilact Examples</h1>
239
250
 
240
251
  <p>These scripts are transpiled and run directly in your browser. You have already loaded Lilact completely!</p>
@@ -10240,7 +10240,7 @@ function run(jsx, path=`InlineJSX-${++_lilact_jsx__WEBPACK_IMPORTED_MODULE_0__["
10240
10240
  appendSourcemap: false,
10241
10241
  blocks_info: _lilact_jsx__WEBPACK_IMPORTED_MODULE_0__["default"].blocks_info,
10242
10242
 
10243
- injectTraceLabels: false,
10243
+ injectTraceLabels: true,
10244
10244
  } );
10245
10245
  }
10246
10246
  catch(e) {