enigmatic 0.9.20 → 0.10.2
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/components.mjs +17 -0
- package/enigmatic.css +246 -314
- package/enigmatic.js +143 -120
- package/index.html +1 -8
- package/package.json +4 -11
- package/.vscode/launch.json +0 -15
- package/elements/alert-box/alert-box.js +0 -19
- package/elements/alert-box/index.html +0 -6
- package/elements/block-maker/block-maker.js +0 -15
- package/elements/block-maker/index.html +0 -7
- package/elements/chart-progress-bar/chart-progress-bar.js +0 -9
- package/elements/chart-progress-bar/index.html +0 -5
- package/elements/chart-radial-progress/chart-radial-progress.css +0 -39
- package/elements/chart-radial-progress/chart-radial-progress.js +0 -13
- package/elements/chart-radial-progress/index.html +0 -13
- package/elements/chart-statistic/chart-statistic.js +0 -34
- package/elements/chart-statistic/index.html +0 -13
- package/elements/data-grid/data-grid.js +0 -39
- package/elements/data-grid/index.html +0 -13
- package/elements/data-source/data-source.js +0 -36
- package/elements/data-source/index.html +0 -10
- package/elements/data-stream/data-stream.js +0 -28
- package/elements/data-stream/index.html +0 -7
- package/elements/font-awesome/font-awesome.js +0 -11
- package/elements/font-awesome/index.html +0 -7
- package/elements/for-list/for-list.js +0 -25
- package/elements/for-list/index.html +0 -11
- package/elements/hello-world/hello-world.js +0 -16
- package/elements/hello-world/index.html +0 -3
- package/elements/index.mjs +0 -20
- package/elements/map-embed/index.html +0 -4
- package/elements/map-embed/map-embed.js +0 -9
- package/elements/monaco-editor/index.html +0 -11
- package/elements/monaco-editor/monaco-editor.mjs +0 -33
- package/elements/online-indicator/index.html +0 -15
- package/elements/online-indicator/online-indicator.js +0 -20
- package/elements/side-menu/index.html +0 -10
- package/elements/side-menu/side-menu.js +0 -16
- package/elements/tailwind-css/index.html +0 -11
- package/elements/tailwind-css/tailwind-css.js +0 -11
- package/elements/test-runner/index.html +0 -176
- package/elements/test-runner/test-runner.js +0 -59
- package/elements/time-ago/index.html +0 -11
- package/elements/time-ago/time-ago.js +0 -22
- package/elements/toggle-switch/index.html +0 -8
- package/elements/toggle-switch/toggle-switch.js +0 -86
- package/elements/view-panel/index.html +0 -18
- package/elements/view-panel/view-panel.js +0 -22
- package/elements/you-tube/index.html +0 -7
- package/elements/you-tube/you-tube.js +0 -9
- package/readme.md +0 -93
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
class YouTube extends EnigmaticElement {
|
|
2
|
-
connectedCallback() {
|
|
3
|
-
this.uid = this.getAttribute('uid') || 'Fku7hi5kI-c'
|
|
4
|
-
this.innerHTML = `<iframe width="560" height="315" src="https://www.youtube.com/embed/${this.uid}"
|
|
5
|
-
title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write;
|
|
6
|
-
encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
customElements.define('you-tube', YouTube)
|
package/readme.md
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# enigmatic
|
|
2
|
-

|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
Enigmatic is a JavaScript micro-library for creating web applications using lightweight web components.
|
|
6
|
-
It aspires to enable faster web app peformance, better reliabilty, and faster development process.
|
|
7
|
-
|
|
8
|
-
Enigmatic uses HTML attributes (directives) with a simple component model and data binding - all on existing HTML, JS, and CSS functionality.
|
|
9
|
-
- Minimal JS and CSS core, includes basic components and two way data binding
|
|
10
|
-
|
|
11
|
-
## Quick Start
|
|
12
|
-
Just create an HTML page
|
|
13
|
-
````
|
|
14
|
-
<script src='//unpkg.com/enigmatic'></script>
|
|
15
|
-
<script src='//unpkg.com/enigmatic/elements/hello-world/hello-world.js'></script>
|
|
16
|
-
<link href='//unpkg.com/enigmatic.css' rel='stylesheet'>
|
|
17
|
-
````
|
|
18
|
-
|
|
19
|
-
## Enigmatic also includes some helpers
|
|
20
|
-
````
|
|
21
|
-
window.$ -- $([body]) // Query Selector
|
|
22
|
-
window.$$ -- $$([div])[0] // Query Selector All
|
|
23
|
-
await window.loadJS('https://.../some.js')
|
|
24
|
-
await window.loadCSS('https://.../some.css')
|
|
25
|
-
await window.wait(1000) // Pause execution
|
|
26
|
-
await window.ready() // Pause until page loads
|
|
27
|
-
body.child(type, id) // Append an element to body
|
|
28
|
-
````
|
|
29
|
-
Encapsulated components make it possible to not have inlined JS
|
|
30
|
-
|
|
31
|
-
But, code can be inlined to run after the page is completely loaded
|
|
32
|
-
|
|
33
|
-
### window.main
|
|
34
|
-
````
|
|
35
|
-
<script>
|
|
36
|
-
main = () => {
|
|
37
|
-
// do something after page is loaded
|
|
38
|
-
}
|
|
39
|
-
</script>
|
|
40
|
-
````
|
|
41
|
-
|
|
42
|
-
## window.data
|
|
43
|
-
window.data is a single data object, that holds all the data/state for the app.
|
|
44
|
-
It's a simple object, with each key being an identifier, or *channel* to use with elements that specify the data attribute
|
|
45
|
-
|
|
46
|
-
Controls set the data object to send and receive data, using a data attribute and .set() method of a custom element
|
|
47
|
-
````
|
|
48
|
-
<hello-world data='mykey'></hello-world>
|
|
49
|
-
|
|
50
|
-
<script>
|
|
51
|
-
main = () => data.mykey = 'Hello world!'
|
|
52
|
-
</script>
|
|
53
|
-
````
|
|
54
|
-
|
|
55
|
-
One may create a simple counter. In this example, the window.data object takes care of the binding
|
|
56
|
-
````
|
|
57
|
-
<button onclick='data.count++'>Click me</button>
|
|
58
|
-
<simple-counter data='count'>0</simple-counter>
|
|
59
|
-
|
|
60
|
-
<script>
|
|
61
|
-
main = () => data.count = 0
|
|
62
|
-
</script>
|
|
63
|
-
````
|
|
64
|
-
|
|
65
|
-
## Enigmatic element (e-e)
|
|
66
|
-
e-e is an element that may be extended to create custom elements
|
|
67
|
-
|
|
68
|
-
It includes some simple methods
|
|
69
|
-
````
|
|
70
|
-
hide()
|
|
71
|
-
show()
|
|
72
|
-
toggle([class1, class2]) - toggle any number of classes
|
|
73
|
-
set() = handles window.data object
|
|
74
|
-
child(type, id) - append a child element
|
|
75
|
-
````
|
|
76
|
-
|
|
77
|
-
## Simple page layout
|
|
78
|
-
Pages are simple grids, and cells may also be grids
|
|
79
|
-
Only a couple of directives to lay out the page
|
|
80
|
-
|
|
81
|
-
## enigmatic.css
|
|
82
|
-
Optional CSS with some helper classes
|
|
83
|
-
ie.. bg-red, red, center, fixed, margins, padding, etc..
|
|
84
|
-
|
|
85
|
-
## Custom Elements and the Data object
|
|
86
|
-
Custom elements can be created according to the HTML standard, and interact with data without the need for additinal abstractions and sugar
|
|
87
|
-
|
|
88
|
-
A JSON fetch element, data-source, handles the fetch of data
|
|
89
|
-
````
|
|
90
|
-
<my-list-element id='mye' data='users.results'></my-list-element>
|
|
91
|
-
|
|
92
|
-
<data-source href='https://randomuser.me/api' target='users'></data-source>
|
|
93
|
-
````
|