@wrnrlr/prelude 0.1.2 → 0.1.3

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/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrnrlr/prelude",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "exports": "./src/mod.ts",
5
5
  "compilerOptions": {
6
6
  "strict": false,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wrnrlr/prelude",
3
3
  "type": "module",
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "author": "Werner Laurensse",
6
6
  "description": "A signal based frontend library with fine-grained reactivity",
7
7
  "main": "./src/mod.ts",
@@ -81,7 +81,7 @@ export function List<T>(props:ListProps<T>) {
81
81
  }
82
82
  const mapper = indexes ? mapperWithIndexes : mapperWithoutIndexes
83
83
  return memo(() => {
84
- const newItems = list.call ? list() : []
84
+ const newItems = list.call ? list() : list
85
85
  // (newItems)[$TRACK]; // top level tracking
86
86
  return untrack(() => {
87
87
  const temp = new Array(newItems.length) // new mapped array
@@ -5,7 +5,7 @@
5
5
  font-style: normal;
6
6
  font-weight: 400;
7
7
  font-display: block;
8
- src: url("./assets/fonts/far.woff2") format("woff2"), url("./assets/fonts/far.ttf") format("truetype");
8
+ src: url("/fonts/far.woff2") format("woff2"), url("/fonts/far.ttf") format("truetype");
9
9
  }
10
10
 
11
11
  @font-face {
@@ -13,7 +13,7 @@
13
13
  font-style: normal;
14
14
  font-weight: 900;
15
15
  font-display: block;
16
- src: url("./assets/fonts/fas.woff2") format("woff2"), url("./assets/fonts/fas.ttf") format("truetype");
16
+ src: url("/fonts/fas.woff2") format("woff2"), url("/fonts/fas.ttf") format("truetype");
17
17
  };
18
18
 
19
19
  @font-face {
@@ -21,7 +21,7 @@
21
21
  font-style: normal;
22
22
  font-weight: 400;
23
23
  font-display: block;
24
- src: url("./assets/fonts/fab.woff2") format("woff2"), url("./assets/fonts/fab.ttf") format("truetype");
24
+ src: url("/fonts/fab.woff2") format("woff2"), url("/fonts/fab.ttf") format("truetype");
25
25
  }
26
26
 
27
27
  .icon {display:flex; display:inline-block}
package/www/demo.html ADDED
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <title>Demo</title>
3
+
4
+ <script type="module">
5
+
6
+ import {h,signal,effect,batch,wrap,render,onMount,List} from '../src/mod.ts'
7
+
8
+ function App() {
9
+ const fruits = ['apple', 'banana', 'cherry']
10
+ return h(List, {each:fruits}, f => f)
11
+ }
12
+
13
+ render(App, document.body)
14
+
15
+ </script>
package/www/index.html CHANGED
@@ -36,7 +36,7 @@
36
36
  <section class="flex column items-center py-8 gap-8">
37
37
  <h1 class="center text-5xl">Just write JavaScript!</h1>
38
38
  <p class="center text-2xl">Instead of JSX, Prelude uses HyperScript,<br>
39
- a DSL that lets you defined components in JavaScript.</p>
39
+ a DSL that lets you define components in JavaScript.</p>
40
40
  <div class="flex items-center content-center gap-8">
41
41
  <pre><code class="language-js">import {h, signal, render} from 'prelude'
42
42
 
@@ -70,7 +70,7 @@ render(Counter, window.counter)</code></pre>
70
70
 
71
71
  <footer class="flex px-2 py-2 gap-8" style="background-color: var(--neutral-100);">
72
72
  <div class="flex column justify-center gap-3">
73
- <a href="https://npm.com/@wrnrlr/prelude">NPM</a>
73
+ <a href="https://www.npmjs.com/package/@wrnrlr/prelude">NPM</a>
74
74
  <a href="https://jsr.io/@wrnrlr/prelude">JSR</a>
75
75
  </div>
76
76
  <div class="flex column justify-center gap-3">
@@ -17,7 +17,7 @@ import {html} from "@codemirror/lang-html"
17
17
  const playing = signal(true)
18
18
  const examples = [
19
19
  {name:'counter',title:'Counter'},
20
- {name:'todo',title:'Todo'},
20
+ {name:'todo',title:'Todo App'},
21
21
  // {name:'admin',title:'Admin'}
22
22
  ]
23
23
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  <script type="module">
5
5
 
6
- import {h,signal,render} from '/prelude/bundle.js'
6
+ import {h,signal,render} from 'https://esm.sh/@wrnrlr/prelude'
7
7
 
8
8
  function Input(props) {
9
9
  const onInput = e => props.value(parseInt(e.target.value))
@@ -3,7 +3,7 @@
3
3
 
4
4
  <script type="module">
5
5
 
6
- import {h,signal,effect,batch,wrap,render,List} from '/prelude/bundle.js'
6
+ import {h,signal,effect,batch,wrap,render,List} from 'https://esm.sh/@wrnrlr/prelude'
7
7
 
8
8
  const data = [
9
9
  {description:'Buy groceries',done:false},
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes