@wrnrlr/prelude 0.1.8 → 0.2.0

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/.github/workflows/publish.yml +12 -11
  2. package/{deno.json → deno.jsonc} +13 -8
  3. package/example/index.html +43 -0
  4. package/package.json +6 -2
  5. package/src/constants.ts +110 -52
  6. package/src/controlflow.ts +140 -91
  7. package/src/hyperscript.ts +85 -109
  8. package/src/mod.ts +3 -5
  9. package/src/reactive.ts +29 -17
  10. package/src/runtime.ts +128 -66
  11. package/test/hyperscript.js +7 -6
  12. package/test/reactive.js +22 -2
  13. package/test/types.ts +44 -0
  14. package/src/components.js +0 -20
  15. package/src/ui/accordion.ts +0 -8
  16. package/src/ui/button.ts +0 -9
  17. package/src/ui/canvas.ts +0 -8
  18. package/src/ui/date.ts +0 -8
  19. package/src/ui/dialog.ts +0 -12
  20. package/src/ui/filter.ts +0 -8
  21. package/src/ui/form.ts +0 -7
  22. package/src/ui/h.ts +0 -48
  23. package/src/ui/image.ts +0 -5
  24. package/src/ui/input.ts +0 -49
  25. package/src/ui/mod.ts +0 -12
  26. package/src/ui/multiselect.ts +0 -42
  27. package/src/ui/option.ts +0 -1
  28. package/src/ui/select.ts +0 -28
  29. package/src/ui/tab.ts +0 -7
  30. package/src/ui/table.ts +0 -9
  31. package/src/ui/upload.ts +0 -7
  32. package/www/assets/css/presets.css +0 -504
  33. package/www/assets/css/style.css +0 -90
  34. package/www/demo.html +0 -28
  35. package/www/index.html +0 -211
  36. package/www/playground.html +0 -184
  37. package/www/public/banner.svg +0 -6
  38. package/www/public/example/admin.html +0 -88
  39. package/www/public/example/counter.html +0 -24
  40. package/www/public/example/greeting.html +0 -25
  41. package/www/public/example/select.html +0 -27
  42. package/www/public/example/show.html +0 -18
  43. package/www/public/example/todo.html +0 -70
  44. package/www/public/fonts/fab.ttf +0 -0
  45. package/www/public/fonts/fab.woff2 +0 -0
  46. package/www/public/fonts/far.ttf +0 -0
  47. package/www/public/fonts/far.woff2 +0 -0
  48. package/www/public/fonts/fas.ttf +0 -0
  49. package/www/public/fonts/fas.woff2 +0 -0
  50. package/www/public/logo.svg +0 -16
  51. package/www/typedoc.json +0 -13
  52. package/www/ui.html +0 -49
  53. package/www/vite.config.js +0 -106
package/www/typedoc.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "name": "prelude",
3
- "out":"./docs/",
4
- "compilerOptions": {
5
- "strict": false,
6
- "allowJs": true,
7
- "checkJs": false,
8
- "noImplicitThis": false,
9
- "allowImportingTsExtensions": true,
10
- "downlevelIteration": true
11
- },
12
- "entryPoints": ["../src/mod.ts"]
13
- }
package/www/ui.html DELETED
@@ -1,49 +0,0 @@
1
- <!DOCTYPE html>
2
- <title>Demo</title>
3
-
4
- <script src="./accordion.ts"></script>
5
- <script src="./button.ts"></script>
6
- <script src="./canvas.ts"></script>
7
- <script src="./date.ts"></script>
8
- <script src="./editable.ts"></script>
9
- <script src="./filter.ts"></script>
10
- <script src="./multiselect.ts"></script>
11
- <script src="./select.ts"></script>
12
- <script src="./table.ts"></script>
13
-
14
- <body>
15
- <h1>UI</h1>
16
- <div id="example"></div>
17
- </body>
18
-
19
- <script type="module">
20
- function App() {}
21
-
22
- function AccordionExample() {
23
- return h('#accordion', h(Accordion))
24
- }
25
- function ButtonExample() {
26
- return h('#button', h(Button))
27
- }
28
- function CanvasExample() {
29
- return h('#canvas', h(Canvas))
30
- }
31
- function DateInputExample() {
32
- return h('#date', h(DateInput))
33
- }
34
- function EditableExample() {
35
- return h('#editable', h(Editbale))
36
- }
37
- function FilterExample() {
38
- return h('#filter', h(Filter))
39
- }
40
- function MultiselectExample() {
41
- return h('#multiselect', h(Multiselect))
42
- }
43
- function SelectExample() {
44
- return h('#select', h(Select))
45
- }
46
- function TableExample() {
47
- return h('#table', h(Table))
48
- }
49
- </script>
@@ -1,106 +0,0 @@
1
- import * as path from '@std/path'
2
- import * as fs from '@std/fs'
3
- import {defineConfig} from 'vite'
4
- import * as esbuild from 'esbuild'
5
- import { Application, TSConfigReader, TypeDocReader } from 'typedoc'
6
-
7
- export default defineConfig(({ command, mode }) => {
8
- const root = path.join(__dirname, '')
9
-
10
- const define = {}
11
- let build
12
- const optimizeDeps = {
13
- // exclude: ['dist/','public/'],
14
- }
15
- const assetsInclude = [
16
- // 'public/example/**'
17
- ]
18
-
19
- const input = {
20
- 'index': path.join(root, 'index.html'),
21
- 'playground': path.join(root, 'playground.html'),
22
- }
23
- // const docs = path.join(root, 'distdocs/index.html')
24
- // if (fs.existsSync(docs)) input.docs = docs
25
- // console.log('docs',input.docs)
26
-
27
- build = {
28
- lib: {
29
- entry: path.join(root, '../src/mod.ts'),
30
- formats: ['es'],
31
- name: 'mod',
32
- fileName: (name) => 'prelude.js'
33
- },
34
- rollupOptions: {
35
- input,
36
- exports: 'named',
37
- output: {
38
- manualChunks(id) {
39
- // if (id.endsWith('src/mod.ts')) return 'prelude'
40
- }
41
- }
42
- }
43
- }
44
-
45
- return {
46
- root,
47
- define,
48
- build,
49
- optimizeDeps,
50
- assetsInclude,
51
- base: '/prelude',
52
- plugins: [
53
- esbuildPlugin(), typedocPlugin()
54
- ]
55
- }
56
- })
57
-
58
- function esbuildPlugin() {
59
- let ctx
60
- return {
61
- name: 'typedoc-plugin',
62
- async buildStart() {
63
- const entry = path.join(__dirname, '../src/mod.ts')
64
- const options = {
65
- entryPoints: [entry],
66
- outfile: path.join(__dirname, './public/bundle.js'),
67
- bundle: true,
68
- format:'esm',
69
- // minify: true,
70
- // sourcemap: true,
71
- target: ["es2020"],
72
- }
73
- ctx = await esbuild.context(options)
74
- await ctx.watch()
75
- },
76
- async buildEnd() {
77
- await ctx.dispose()
78
- }
79
- }
80
- }
81
-
82
- function typedocPlugin() {
83
- let _config
84
- return {
85
- name: 'typedoc-plugin',
86
- apply: 'build',
87
- configResolved(config) { _config = config },
88
- async writeBundle() {
89
- const name = path.join(__dirname, 'typedoc.json')
90
- const config = JSON.parse(await Deno.readTextFile(name))
91
- config.hostedBaseUrl = 'https://wrnrlr.github.io/prelude/docs'
92
- config.useHostedBaseUrlForAbsoluteLinks = true
93
- config.out = path.join(__dirname, './dist/docs')
94
- config.entryPoints = [path.join(__dirname, '../src/mod.ts')]
95
- const app = await Application.bootstrap(config)
96
- if (!app) Deno.exit()
97
- const project = await app.convert()
98
- if (!project) Deno.exit()
99
- try {
100
- await app.generateDocs(project, config.out)
101
- } catch (e) {
102
- console.error(e)
103
- }
104
- }
105
- }
106
- }