@awesomeness-js/server 1.1.7 → 1.1.9

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 (62) hide show
  1. package/package.json +1 -1
  2. package/src/componentDependencies.js +24 -0
  3. package/src/koa/routeRequest.js +87 -26
  4. package/example-site/example.awesomenessjs.com/components/example/index.js +0 -3
  5. package/example-site/example.awesomenessjs.com/components/notCommonExample/_.css +0 -1
  6. package/example-site/example.awesomenessjs.com/components/notCommonExample/index.js +0 -3
  7. package/ui/README.md +0 -438
  8. package/ui/awesomeness-ui.instructions.md +0 -156
  9. package/ui/build.js +0 -119
  10. package/ui/commonComponent.test.js +0 -27
  11. package/ui/components/blogPost/all.css +0 -371
  12. package/ui/components/blogPost/headerImage.js +0 -153
  13. package/ui/components/blogPost/index.js +0 -45
  14. package/ui/components/blogPost/marked.js +0 -74
  15. package/ui/components/blogPost/md.js +0 -73
  16. package/ui/components/blogPost/parseAwesomeness.jQuery.js +0 -47
  17. package/ui/components/blogPost/readme.md +0 -8
  18. package/ui/components/colors/README.md +0 -65
  19. package/ui/components/colors/dynamic.css +0 -1884
  20. package/ui/components/colors/dynamic.css.js +0 -135
  21. package/ui/components/colors/dynamic.css.php +0 -79
  22. package/ui/components/colors/example.js +0 -133
  23. package/ui/components/colors/index.js +0 -65
  24. package/ui/components/colors/map.js +0 -13
  25. package/ui/components/colors/random.js +0 -17
  26. package/ui/components/colors/tailwind-colors.css +0 -247
  27. package/ui/components/insertIntoList/insertIntoList.jquery.js +0 -150
  28. package/ui/components/statusPage/index.css +0 -120
  29. package/ui/components/statusPage/index.js +0 -39
  30. package/ui/components/tag/category.js +0 -8
  31. package/ui/components/tag/index.js +0 -33
  32. package/ui/components/tag/list.js +0 -42
  33. package/ui/components/tag/map.js +0 -64
  34. package/ui/components/tag/tagMap.css +0 -60
  35. package/ui/components/tag/tags.css +0 -20
  36. package/ui/core/css/_normalize.css +0 -57
  37. package/ui/core/css/dynamic/flex.js +0 -36
  38. package/ui/core/css/dynamic/grid.js +0 -185
  39. package/ui/core/css/dynamic/shortcuts.js +0 -48
  40. package/ui/core/css/dynamic/spacing.js +0 -61
  41. package/ui/core/css/dynamic/text.js +0 -80
  42. package/ui/core/css/dynamic/width.js +0 -75
  43. package/ui/core/css/dynamic.js +0 -40
  44. package/ui/core/js/app/api.js +0 -143
  45. package/ui/core/js/app/init.js +0 -88
  46. package/ui/core/js/app/initDarkMode.js +0 -26
  47. package/ui/core/js/app/initialScroll.js +0 -28
  48. package/ui/core/js/app/meta/update/components.js +0 -65
  49. package/ui/core/js/app/meta/update/pages.js +0 -86
  50. package/ui/core/js/app/metaUpdates.js +0 -10
  51. package/ui/core/js/app/page.js +0 -319
  52. package/ui/core/js/app/resize.js +0 -52
  53. package/ui/core/js/app/state/back.js +0 -16
  54. package/ui/core/js/app/state/create.js +0 -50
  55. package/ui/core/js/app/state/get.js +0 -5
  56. package/ui/core/js/app/state/init.js +0 -25
  57. package/ui/core/js/app.js +0 -41
  58. package/ui/core/js/jquery-3.7.1.min.js +0 -2
  59. package/ui/core/public/app.css +0 -1
  60. package/ui/core/public/app.js +0 -975
  61. package/ui/core/public/favicon.ico +0 -0
  62. package/ui/core/public/index.html +0 -40
@@ -1,150 +0,0 @@
1
- (function(){
2
-
3
- // IMPORTANT NOTE: with custom sortFn's use toLowerCase !!
4
- $.fn.extend({
5
-
6
- //Name the function
7
- insertIntoList: function($ul, options) {
8
-
9
- var defaults = {
10
- 'sortFn':function($elm){
11
-
12
- return $elm.html().toLowerCase();
13
-
14
- },
15
- 'insertBeforeLast':false,
16
- 'za':false,
17
- 'selector':null
18
- };
19
-
20
- var options = $.extend(defaults, options); // jshint ignore:line
21
-
22
- return this.each(function() {
23
-
24
- if(!$ul){
25
-
26
- return false;
27
-
28
- }
29
-
30
- // From here on in, it's "normal" jQuery
31
-
32
- var $li = $(this); // new item
33
- var $lis;
34
-
35
-
36
- if(options.selector){
37
-
38
- $lis = $ul.children(options.selector); // existing items
39
-
40
- } else {
41
-
42
- $lis = $ul.children(); // existing items
43
-
44
- }
45
-
46
- var newHtml = options.sortFn($li);
47
-
48
- if($lis.length === 0){
49
-
50
- $li.appendTo($ul);
51
-
52
- return;
53
-
54
- }
55
-
56
- $lis.each(function(k,e){
57
-
58
- var $t = $(this);
59
-
60
- // meta hack for skip
61
- if($t.data('insertIntoListSkip') === true){
62
-
63
- return true;
64
-
65
- }
66
-
67
- var isLast = $t.is( ":last-child" );
68
- var current = options.sortFn($t);
69
-
70
- if(options.insertBeforeLast && isLast){
71
-
72
- // insert before last child
73
- $li.insertBefore($t);
74
-
75
- return false;
76
-
77
- }
78
-
79
- if(options.za){
80
-
81
- if(current < newHtml){
82
-
83
- $li.insertBefore($t);
84
-
85
- return false;
86
-
87
- } else {
88
-
89
- // continue if it is not the last item
90
- if(!isLast){
91
-
92
- return true;
93
-
94
- }
95
-
96
- // it is the last item
97
- if(options.insertBeforeLast){
98
-
99
- $li.insertBefore($t);
100
-
101
- } else {
102
-
103
- $li.insertAfter($t);
104
-
105
- }
106
-
107
- }
108
-
109
- } else {
110
-
111
- if(current > newHtml){
112
-
113
- $li.insertBefore($t);
114
-
115
- return false;
116
-
117
- } else {
118
-
119
- // continue if it is not the last item
120
- if(!isLast){
121
-
122
- return true;
123
-
124
- }
125
-
126
- // it is the last item
127
- if(options.insertBeforeLast){
128
-
129
- $li.insertBefore($t);
130
-
131
- } else {
132
-
133
- $li.insertAfter($t);
134
-
135
- }
136
-
137
- }
138
-
139
- }
140
-
141
-
142
- });
143
-
144
- }); // each CORE
145
-
146
- } // xoSelect Function
147
-
148
- }); // extend
149
-
150
- })();
@@ -1,120 +0,0 @@
1
- /* All styles scoped to .status-page and only using existing CSS variables (e.g., --sky-500, --violet-500, --slate-950). */
2
-
3
- .status-page {
4
- /* layout */
5
- display: flex;
6
- flex-direction: column;
7
- align-items: center;
8
- justify-content: center;
9
- gap: 14px;
10
- min-height: min(70vh, 560px);
11
- padding: 36px 22px 28px;
12
- margin: min(12vh, 120px) auto;
13
- text-align: center;
14
- width: min(720px, 92vw);
15
-
16
- /* card look */
17
- position: relative;
18
- border-radius: 18px;
19
- background:
20
- linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.04)) padding-box;
21
- border: 1px solid color-mix(in oklab, white 14%, transparent);
22
- box-shadow: 0 10px 30px rgba(0,0,0,.35);
23
- backdrop-filter: saturate(160%) blur(10px);
24
- color: var(--slate-50);
25
- isolation: isolate;
26
- }
27
-
28
- .status-page::before {
29
- content: "";
30
- position: absolute;
31
- inset: -1px;
32
- border-radius: inherit;
33
- z-index: -1;
34
- background:
35
- radial-gradient(80% 60% at 20% 0%, color-mix(in oklab, var(--sky-500) 32%, transparent), transparent 65%),
36
- radial-gradient(70% 50% at 100% 10%, color-mix(in oklab, var(--violet-500) 28%, transparent), transparent 60%),
37
- var(--slate-950);
38
- filter: saturate(110%);
39
- }
40
-
41
- /* Headline */
42
- .status-page h1 {
43
- margin: 0;
44
- line-height: 1;
45
- letter-spacing: -0.02em;
46
- font-weight: 800;
47
- font-size: clamp(48px, 14vw, 120px);
48
- background:
49
- conic-gradient(from 220deg, var(--sky-400), var(--violet-400), var(--sky-400)) text;
50
- -webkit-background-clip: text;
51
- background-clip: text;
52
- color: transparent;
53
- filter: drop-shadow(0 6px 18px color-mix(in oklab, var(--sky-500) 25%, transparent));
54
- }
55
-
56
- /* Message */
57
- .status-page p {
58
- margin: 2px 0 18px;
59
- color: var(--slate-400);
60
- font-size: clamp(14px, 1.7vw, 18px);
61
- }
62
-
63
- /* CTA */
64
- .status-page .btn-home {
65
- display: inline-flex;
66
- align-items: center;
67
- justify-content: center;
68
- height: 46px;
69
- padding: 0 18px;
70
- gap: .5ch;
71
- border-radius: 12px;
72
- text-decoration: none;
73
- font-weight: 700;
74
- letter-spacing: .01em;
75
-
76
- color: var(--slate-50);
77
- background:
78
- linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04)),
79
- linear-gradient(90deg, color-mix(in oklab, var(--sky-500) 32%, transparent), color-mix(in oklab, var(--violet-500) 32%, transparent));
80
- border: 1px solid color-mix(in oklab, white 14%, transparent);
81
- box-shadow: 0 4px 18px rgba(0,0,0,.2);
82
- transition: transform .15s ease, box-shadow .2s ease, filter .15s ease, background .25s ease;
83
- }
84
- .status-page .btn-home:hover {
85
- transform: translateY(-1px);
86
- box-shadow: 0 10px 26px rgba(0,0,0,.28);
87
- filter: saturate(120%);
88
- }
89
- .status-page .btn-home:active { transform: translateY(0) }
90
- .status-page .btn-home:focus-visible {
91
- outline: none;
92
- box-shadow:
93
- 0 0 0 2px var(--slate-950),
94
- 0 0 0 6px color-mix(in oklab, var(--sky-500) 45%, transparent);
95
- }
96
-
97
- /* 404 variant */
98
- .status-page.status-page-404 p {
99
- font-size: clamp(15px, 1.9vw, 20px);
100
- }
101
-
102
- /* Generic variant trims the gradient headline */
103
- .status-page.status-page-generic h1 {
104
- background: linear-gradient(180deg, currentColor, currentColor) text;
105
- -webkit-background-clip: text;
106
- background-clip: text;
107
- color: currentColor;
108
- filter: none;
109
- }
110
-
111
- /* Compact on very small screens */
112
- @media (max-width: 420px){
113
- .status-page { padding: 26px 16px 20px; border-radius: 16px; }
114
- .status-page .btn-home { width: 100% }
115
- }
116
-
117
- /* Reduced motion */
118
- @media (prefers-reduced-motion: reduce){
119
- .status-page .btn-home { transition: none }
120
- }
@@ -1,39 +0,0 @@
1
- export default (code) => {
2
-
3
- let $statusPage;
4
-
5
- if(code === 404){
6
-
7
- $statusPage = $(`
8
- <div class="status-page status-page-404">
9
- <h1>404</h1>
10
- <p>Oops! The page you are looking for does not exist.</p>
11
- <a href="/" class="btn-home">Go to Home Page</a>
12
- </div>
13
- `);
14
-
15
- } else if(code === 401){
16
-
17
- $statusPage = $(`
18
- <div class="status-page status-page-404">
19
- <h1>Nah...</h1>
20
- <p>Sorry Bro... Access Denied.</p>
21
- <a href="/" class="btn-home">Go to Home Page</a>
22
- </div>
23
- `);
24
-
25
- } else {
26
-
27
- $statusPage = $(`
28
- <div class="status-page status-page-generic">
29
- <h1>${code}</h1>
30
- <p>Something went wrong.</p>
31
- <a href="/" class="btn-home">Go to Home Page</a>
32
- </div>
33
- `);
34
-
35
- }
36
-
37
- return $statusPage;
38
-
39
- };
@@ -1,8 +0,0 @@
1
- export default function tagCategory(tag){
2
-
3
- return tag
4
- .toLowerCase() // Convert to lowercase
5
- .replace(/[^a-z\s]/g, '') // Remove non a-z characters
6
- .replace(/\s+/g, '-'); // Replace spaces with hyphens
7
-
8
- }
@@ -1,33 +0,0 @@
1
- import ui from '#ui';
2
-
3
- export default (tags)=>{
4
-
5
- if(typeof(tags) === 'string'){
6
-
7
- tags = [ tags ];
8
-
9
- }
10
-
11
- const $tags = $('<div class="tags"></div>');
12
-
13
- tags.forEach((tag)=>{
14
-
15
- const catClass = `category-${ui.tag.category(tag)}`;
16
-
17
- const $tag = $(`<span class="tag ${catClass}">${tag}</span>`).appendTo($tags);
18
-
19
- if(typeof tag.callback === 'function'){
20
-
21
- $tag.click(()=>{
22
-
23
- tag.callback(tag, catClass);
24
-
25
- });
26
-
27
- }
28
-
29
- });
30
-
31
- return $tags;
32
-
33
- };
@@ -1,42 +0,0 @@
1
- import ui from '#ui';
2
- // awesomeness import 'insertIntoList';
3
-
4
- export default ({
5
- tags,
6
- title = 'Categories',
7
- onClick = (tag)=>{}
8
- })=>{
9
-
10
- const $area = $('<div class="tag-map"></div>').appendTo('body');
11
-
12
- let $categoriesH = $(`<h1 class="">${title}</h1>`).appendTo($area);
13
- let $categories = $(`<div class="tag-list"></div>`).appendTo($area);
14
-
15
-
16
- let allLength = tags.length;
17
-
18
- tags.forEach((tag) => {
19
-
20
- const tagCat = ui.tag.category(tag.name);
21
-
22
- let $tag = $(`<div class="tag category-${tagCat}">${tag.name} <span>${tag.count}</span></div>`)
23
- .data('tagCount', tag.count)
24
- .data('tag', tag.name)
25
- .insertIntoList($categories,{
26
- za: true,
27
- sortFn: ($elm)=>{
28
-
29
- return $elm.data('tagCount') * 1;
30
-
31
- }
32
- }).click(()=>{
33
-
34
- onClick(tag);
35
-
36
- });
37
-
38
- });
39
-
40
- return $area;
41
-
42
- };
@@ -1,64 +0,0 @@
1
- // awesomeness import 'insertIntoList';
2
-
3
- export default ({
4
- datas,
5
- title = 'Categories',
6
- onClick = (category)=>{}
7
- })=>{
8
-
9
- let categories = {};
10
-
11
- datas.forEach(function(thing){
12
-
13
- thing.tags.forEach(function(tag){
14
-
15
- if(!categories[tag]) categories[tag] = [];
16
- categories[tag].push(thing);
17
-
18
- });
19
-
20
- });
21
-
22
- const $area = $('<div class="tag-map"></div>').appendTo('body');
23
-
24
- $(`<h1>${title}</h1>`).appendTo($area);
25
- let $tagMap = $('<div class="tag-map"></div>').appendTo($area);
26
-
27
- function tagCategory(tag){
28
-
29
- return tag
30
- .toLowerCase() // Convert to lowercase
31
- .replace(/[^a-z\s]/g, '') // Remove non a-z characters
32
- .replace(/\s+/g, '-'); // Replace spaces with hyphens
33
-
34
- }
35
-
36
- let allLength = datas.length;
37
-
38
- categories['all'] = datas;
39
-
40
- $.each(categories, function(category, things){
41
-
42
- const tagCat = tagCategory(category);
43
-
44
- let $category = $(`<div class="category tag category-${tagCat}">${category} <span>${things.length}</span></div>`)
45
- .data('categoryCount', things.length)
46
- .data('category', category)
47
- .insertIntoList($tagMap,{
48
- za: true,
49
- sortFn: ($elm)=>{
50
-
51
- return $elm.data('categoryCount') * 1;
52
-
53
- }
54
- }).click(()=>{
55
-
56
- onClick(category);
57
-
58
- });
59
-
60
- });
61
-
62
- return $area;
63
-
64
- };
@@ -1,60 +0,0 @@
1
- .tag-map {
2
- display: block;
3
- position: relative;
4
- overflow-x: hidden;
5
- overflow-y: auto;
6
- }
7
-
8
- .tag-map .tag-list {
9
- margin-top: 20px;
10
-
11
- }
12
-
13
- .tag-map .tag-list .tag {
14
- width: 100%;
15
- }
16
-
17
- .app-size-p .tag-list .category {
18
- font-size: 1em;
19
- }
20
-
21
- .app-size-t .tag-list .category {
22
- font-size: 1.2em;
23
- }
24
-
25
- .tag-map .tag {
26
- background-color: #ffffff;
27
- color: #2b2b2b;
28
- padding: 12px 20px;
29
- margin-right: 10px;
30
- margin-bottom: 10px;
31
- border-radius: 3px;
32
- border: solid 1px #dddddd;
33
- font-size: 1.5em;
34
- font-weight: 300;
35
- font-family: Raleway;
36
- letter-spacing: 3px;
37
- transition: all 200ms ease-in-out;
38
- position: relative;
39
- padding-right: 50px;
40
- display: inline-block;
41
- }
42
-
43
- .tag-map .tag:hover {
44
- cursor: pointer;
45
- }
46
-
47
- .tag-map .tag span {
48
- position: absolute;
49
- top: 10px;
50
- right: 10px;
51
- font-size: 0.6em;
52
- background-color: #ffffff;
53
- color: #777;
54
- width: 32px;
55
- height: 32px;
56
- text-align: center;
57
- border-radius: 33px;
58
- padding-top: 7px;
59
- padding-left: 3px;
60
- }
@@ -1,20 +0,0 @@
1
- .tags{
2
- margin-top: 10px;
3
- display: inline-block;
4
- }
5
-
6
- .tags span {
7
- font-family: 'Raleway';
8
- font-size: 0.8em;
9
- padding: 5px 8px;
10
- border-radius: 3px;
11
- margin-right: 6px;
12
- border: solid 1px #e4e4e4;
13
- margin-bottom: 6px;
14
- display: inline-block;
15
- color: #777;
16
- }
17
-
18
- .tags span:hover {
19
- cursor: pointer;
20
- }
@@ -1,57 +0,0 @@
1
- #app {
2
- margin: 0;
3
- padding: 0;
4
- background-color: #fdfdfd
5
- }
6
-
7
- * {
8
- -webkit-box-sizing: border-box;
9
- -moz-box-sizing: border-box;
10
- box-sizing: border-box;
11
-
12
- -webkit-tap-highlight-color: transparent;
13
- -ms-touch-action: manipulation;
14
- touch-action: manipulation;
15
- }
16
-
17
- html {
18
- width:100%;
19
- height:100%;
20
- margin:0;
21
- padding:0;
22
- font-family: 'Montserrat', 'Work Sans', sans-serif;
23
- }
24
-
25
- body {
26
- width:100%;
27
- height:100%;
28
- overflow-x:hidden;
29
- margin:0;
30
- padding:0;
31
- /* stupid iphone notches */
32
- padding-top: constant(safe-area-inset-top); /* iOS 11.0 */
33
- padding-top: env(safe-area-inset-top); /* iOS 11.2 */
34
- }
35
-
36
- h1, h2, h3, h4, h5, h6 {
37
- font-weight:normal;
38
- margin:0;
39
- padding:0;
40
- width:100%;
41
- }
42
-
43
- [class^="ico"] { line-height: 0px; }
44
-
45
- a {
46
- text-decoration: none;
47
- color: inherit;
48
- }
49
-
50
- .no-select, .no-select * {
51
- -webkit-touch-callout: none;
52
- -webkit-user-select: none;
53
- -khtml-user-select: none;
54
- -moz-user-select: none;
55
- -ms-user-select: none;
56
- user-select: none;
57
- }
@@ -1,36 +0,0 @@
1
- export default function(sizes = [
2
- 'xl',
3
- 'd',
4
- 't',
5
- 'p'
6
- ], max = 12) {
7
-
8
- let data = ` `;
9
-
10
- // dynamic display
11
- data += ".flex { display: flex; } ";
12
- data += ".flex-wrap { flex-wrap: wrap; } ";
13
-
14
- for (let i = 1; i <= max; i++) {
15
-
16
- // float
17
- data += `.flex-${i} { flex:${i} ; } `;
18
-
19
- }
20
-
21
- sizes.forEach((s) => {
22
-
23
- for (let i = 1; i <= max; i++) {
24
-
25
- // float
26
- data += `.app-size-${s} .flex-${i}-${s} { flex:${i} ; } `;
27
- data += `.app-size-${s} .flex-wrap-${s} { flex-wrap: wrap; } `;
28
-
29
- }
30
-
31
- });
32
-
33
-
34
- return data;
35
-
36
- }