@geekity/cms 0.21.0 → 0.22.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 (99) hide show
  1. package/README.md +23 -0
  2. package/admin/components/admin-bar.njk +27 -6
  3. package/admin/components/alert.njk +28 -0
  4. package/admin/components/badge.njk +58 -0
  5. package/admin/components/button.njk +56 -0
  6. package/admin/components/card.njk +40 -0
  7. package/admin/components/collapse.njk +36 -0
  8. package/admin/components/copy.njk +20 -0
  9. package/admin/components/dropdown.njk +32 -0
  10. package/admin/components/fields.njk +81 -45
  11. package/admin/components/flash.njk +12 -5
  12. package/admin/components/menu.njk +51 -0
  13. package/admin/components/navbar.njk +23 -0
  14. package/admin/components/pagination.njk +47 -0
  15. package/admin/components/public-admin-bar.njk +4 -41
  16. package/admin/components/stat.njk +35 -0
  17. package/admin/components/table.njk +74 -0
  18. package/admin/components/tabs.njk +33 -0
  19. package/admin/components/theme-choice.njk +18 -0
  20. package/admin/layouts/base.njk +9 -16
  21. package/admin/layouts/settings-page.njk +15 -10
  22. package/admin/layouts/shell.njk +23 -31
  23. package/admin/pages/account/forgot.njk +39 -33
  24. package/admin/pages/account/login.njk +22 -16
  25. package/admin/pages/account/reset.njk +34 -25
  26. package/admin/pages/account/setup.njk +21 -15
  27. package/admin/pages/appearance/themes.njk +50 -44
  28. package/admin/pages/comments/all.njk +88 -106
  29. package/admin/pages/dashboard/home.njk +50 -62
  30. package/admin/pages/documents/conflict.njk +29 -24
  31. package/admin/pages/documents/editor.njk +155 -275
  32. package/admin/pages/documents/list.njk +60 -69
  33. package/admin/pages/documents/syndication.njk +98 -60
  34. package/admin/pages/documents/taxonomy.njk +36 -32
  35. package/admin/pages/error.njk +8 -5
  36. package/admin/pages/federation/followers.njk +91 -97
  37. package/admin/pages/federation/settings.njk +10 -11
  38. package/admin/pages/indieauth/consent.njk +60 -44
  39. package/admin/pages/indieauth/refused.njk +6 -3
  40. package/admin/pages/media/library.njk +86 -107
  41. package/admin/pages/messages/all.njk +71 -77
  42. package/admin/pages/navigation/menus.njk +90 -85
  43. package/admin/pages/placeholder.njk +13 -8
  44. package/admin/pages/settings/discussion.njk +30 -29
  45. package/admin/pages/settings/email.njk +26 -28
  46. package/admin/pages/settings/general.njk +10 -4
  47. package/admin/pages/settings/permalinks.njk +8 -9
  48. package/admin/pages/settings/privacy.njk +3 -3
  49. package/admin/pages/settings/reading.njk +3 -3
  50. package/admin/pages/tools/content-index.njk +79 -73
  51. package/admin/pages/tools/personal-data.njk +61 -55
  52. package/admin/pages/users/activity-entry.njk +12 -12
  53. package/admin/pages/users/activity.njk +13 -19
  54. package/admin/pages/users/apps.njk +112 -100
  55. package/admin/pages/users/edit.njk +65 -58
  56. package/admin/pages/users/list.njk +26 -24
  57. package/admin/pages/users/new.njk +11 -7
  58. package/admin/src/admin.css +174 -0
  59. package/admin/static/admin-bar.css +33 -31
  60. package/admin/static/admin-bar.js +22 -0
  61. package/admin/static/admin.css +7388 -1195
  62. package/admin/static/copy.js +1 -1
  63. package/admin/static/editor.js +18 -18
  64. package/dist/admin/accounts.d.ts +20 -0
  65. package/dist/admin/accounts.d.ts.map +1 -1
  66. package/dist/admin/accounts.js +25 -0
  67. package/dist/admin/accounts.js.map +1 -1
  68. package/dist/admin/admin-theme.d.ts +157 -0
  69. package/dist/admin/admin-theme.d.ts.map +1 -0
  70. package/dist/admin/admin-theme.js +52 -0
  71. package/dist/admin/admin-theme.js.map +1 -0
  72. package/dist/admin/assets.d.ts +4 -3
  73. package/dist/admin/assets.d.ts.map +1 -1
  74. package/dist/admin/assets.js +4 -3
  75. package/dist/admin/assets.js.map +1 -1
  76. package/dist/admin/documents.js +1 -1
  77. package/dist/admin/documents.js.map +1 -1
  78. package/dist/admin/headers.js +1 -1
  79. package/dist/admin/headers.js.map +1 -1
  80. package/dist/admin/routes.d.ts.map +1 -1
  81. package/dist/admin/routes.js +17 -8
  82. package/dist/admin/routes.js.map +1 -1
  83. package/dist/admin/templates.d.ts +6 -3
  84. package/dist/admin/templates.d.ts.map +1 -1
  85. package/dist/admin/templates.js +25 -3
  86. package/dist/admin/templates.js.map +1 -1
  87. package/dist/admin/users.d.ts +4 -0
  88. package/dist/admin/users.d.ts.map +1 -1
  89. package/dist/admin/users.js +37 -1
  90. package/dist/admin/users.js.map +1 -1
  91. package/dist/content/post-type.d.ts.map +1 -1
  92. package/dist/content/post-type.js +7 -2
  93. package/dist/content/post-type.js.map +1 -1
  94. package/dist/web/admin-bar.d.ts +4 -4
  95. package/dist/web/admin-bar.d.ts.map +1 -1
  96. package/dist/web/admin-bar.js +11 -34
  97. package/dist/web/admin-bar.js.map +1 -1
  98. package/package.json +8 -4
  99. package/themes/default/README.md +3 -1
@@ -6,13 +6,17 @@
6
6
  #}
7
7
  {% extends "layouts/shell.njk" %}
8
8
  {% import "components/fields.njk" as field %}
9
+ {% from "components/button.njk" import button %}
10
+ {% from "components/card.njk" import card %}
9
11
 
10
12
  {% block title %}Add new user{% endblock %}
11
13
 
12
14
  {% block content %}
13
- <h1>Add new user</h1>
15
+ <h1 class="mb-6 text-2xl font-bold">Add new user</h1>
14
16
 
15
- <form class="admin-settings" method="post" action="{{ addUserUrl }}">
17
+ <div class="flex max-w-2xl flex-col gap-6">
18
+ {% call card() %}
19
+ <form method="post" action="{{ addUserUrl }}">
16
20
  <input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
17
21
 
18
22
  {% if addProblems.username or addProblems.password or addProblems.email %}
@@ -26,7 +30,7 @@
26
30
  {{ field.text('add-username', fields.username, 'Username', addForm.username,
27
31
  error=addProblems.username, required=true) }}
28
32
 
29
- {{ field.text('add-email', fields.email, 'Email <span class="admin-status">(optional)</span>',
33
+ {{ field.text('add-email', fields.email, 'Email <span class="font-normal">(optional)</span>',
30
34
  addForm.email, type='email', autocomplete='email', error=addProblems.email) }}
31
35
 
32
36
  {{ field.password('add-password', fields.password, 'Password',
@@ -36,10 +40,10 @@
36
40
  'Generate one instead, and show it to me once', checked=addForm.generate,
37
41
  hint='A generated password is shown on the next page and nowhere else. Copy it before you leave.') }}
38
42
 
39
- <p class="admin-settings-buttons">
40
- <button type="submit">Add user</button>
41
- </p>
43
+ <div class="mt-2">{{ button('Add user', type='submit', color='primary') }}</div>
42
44
  </form>
45
+ {% endcall %}
43
46
 
44
- <p class="admin-hint"><a href="{{ usersUrl }}">Back to all users</a></p>
47
+ <p class="text-sm"><a class="link" href="{{ usersUrl }}">Back to all users</a></p>
48
+ </div>
45
49
  {% endblock %}
@@ -0,0 +1,174 @@
1
+ @import 'tailwindcss' source(none);
2
+ @source '../layouts';
3
+ @source '../components';
4
+ @source '../pages';
5
+ @source '../../editor/look.ts';
6
+
7
+ @plugin 'daisyui' {
8
+ themes:
9
+ light --default,
10
+ dark --prefersdark,
11
+ cupcake,
12
+ bumblebee,
13
+ emerald,
14
+ corporate,
15
+ synthwave,
16
+ retro,
17
+ cyberpunk,
18
+ valentine,
19
+ halloween,
20
+ garden,
21
+ forest,
22
+ aqua,
23
+ lofi,
24
+ pastel,
25
+ fantasy,
26
+ wireframe,
27
+ black,
28
+ luxury,
29
+ dracula,
30
+ cmyk,
31
+ autumn,
32
+ business,
33
+ acid,
34
+ lemonade,
35
+ night,
36
+ coffee,
37
+ winter,
38
+ dim,
39
+ nord,
40
+ sunset,
41
+ caramellatte,
42
+ abyss,
43
+ silk;
44
+ logs: false;
45
+ }
46
+
47
+ /*
48
+ * CodeMirror injects its own theme after this sheet, outside any layer, two
49
+ * classes to a selector; the id on every rule outranks it. `editor/main.ts`
50
+ * writes the `.cm-md-*` classes.
51
+ */
52
+ #editor-surface .cm-editor {
53
+ height: 28rem;
54
+ border: 1px solid var(--color-base-300);
55
+ border-radius: var(--radius-field);
56
+ background-color: var(--color-base-100);
57
+ color: var(--color-base-content);
58
+ font-size: 0.95rem;
59
+ }
60
+
61
+ #editor-surface .cm-editor.cm-focused {
62
+ outline: 2px solid var(--color-base-content);
63
+ outline-offset: 2px;
64
+ }
65
+
66
+ #editor-surface .cm-scroller {
67
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
68
+ line-height: 1.5;
69
+ }
70
+
71
+ #editor-surface .cm-content {
72
+ caret-color: var(--color-base-content);
73
+ }
74
+
75
+ #editor-surface .cm-cursor,
76
+ #editor-surface .cm-dropCursor {
77
+ border-left-color: var(--color-base-content);
78
+ }
79
+
80
+ #editor-surface .cm-selectionBackground {
81
+ background: color-mix(in oklab, var(--color-base-content) 15%, transparent);
82
+ }
83
+
84
+ #editor-surface .cm-focused .cm-selectionBackground {
85
+ background: color-mix(in oklab, var(--color-primary) 30%, transparent);
86
+ }
87
+
88
+ #editor-surface .cm-activeLine {
89
+ background-color: color-mix(in oklab, var(--color-base-content) 5%, transparent);
90
+ }
91
+
92
+ #editor-surface .cm-gutters {
93
+ border-color: var(--color-base-300);
94
+ background-color: var(--color-base-200);
95
+ color: color-mix(in oklab, var(--color-base-content) 60%, transparent);
96
+ }
97
+
98
+ #editor-surface .cm-activeLineGutter {
99
+ background-color: var(--color-base-300);
100
+ color: var(--color-base-content);
101
+ }
102
+
103
+ #editor-surface .cm-selectionMatch {
104
+ background-color: color-mix(in oklab, var(--color-accent) 25%, transparent);
105
+ }
106
+
107
+ #editor-surface .cm-searchMatch {
108
+ background-color: color-mix(in oklab, var(--color-warning) 35%, transparent);
109
+ }
110
+
111
+ #editor-surface .cm-searchMatch-selected {
112
+ background-color: color-mix(in oklab, var(--color-warning) 65%, transparent);
113
+ }
114
+
115
+ #editor-surface .cm-matchingBracket {
116
+ background-color: color-mix(in oklab, var(--color-success) 30%, transparent);
117
+ }
118
+
119
+ #editor-surface .cm-nonmatchingBracket {
120
+ background-color: color-mix(in oklab, var(--color-error) 30%, transparent);
121
+ }
122
+
123
+ #editor-surface .cm-specialChar {
124
+ color: var(--color-error);
125
+ }
126
+
127
+ #editor-surface .cm-panels,
128
+ #editor-surface .cm-tooltip,
129
+ #editor-surface .cm-foldPlaceholder {
130
+ border-color: var(--color-base-300);
131
+ background-color: var(--color-base-200);
132
+ color: var(--color-base-content);
133
+ }
134
+
135
+ #editor-surface .cm-textfield {
136
+ border-color: var(--color-base-300);
137
+ background-color: var(--color-base-100);
138
+ color: var(--color-base-content);
139
+ }
140
+
141
+ #editor-surface .cm-button {
142
+ border-color: var(--color-base-300);
143
+ background-image: none;
144
+ background-color: var(--color-base-300);
145
+ color: var(--color-base-content);
146
+ }
147
+
148
+ #editor-surface .cm-md-heading,
149
+ #editor-surface .cm-md-strong {
150
+ font-weight: 700;
151
+ }
152
+
153
+ #editor-surface .cm-md-emphasis,
154
+ #editor-surface .cm-md-quote {
155
+ font-style: italic;
156
+ }
157
+
158
+ #editor-surface .cm-md-strikethrough {
159
+ text-decoration: line-through;
160
+ }
161
+
162
+ #editor-surface .cm-md-link {
163
+ text-decoration: underline;
164
+ text-decoration-color: var(--color-primary);
165
+ }
166
+
167
+ #editor-surface .cm-md-code {
168
+ border-radius: 0.25rem;
169
+ background-color: var(--color-base-200);
170
+ }
171
+
172
+ #editor-surface .cm-md-mark {
173
+ color: color-mix(in oklab, var(--color-base-content) 60%, transparent);
174
+ }
@@ -1,21 +1,27 @@
1
1
  /*
2
- * The admin bar: the dark strip across the top of every admin screen, and of
3
- * every public page a signed-in user reads (TASK-183).
2
+ * The admin bar's stylesheet (decision-30), inlined into the bar's shadow root
3
+ * on admin screens and on the public site alike.
4
4
  *
5
- * Self-contained, because on the public site it is inlined into the bar's
6
- * shadow root, under a host reset to `all: initial`: nothing here may lean on
7
- * admin.css or on whatever theme the site wears. Sizes are in pixels for the
8
- * same reason, since a `rem` is the theme's root font size. The colours are
9
- * declared on `:host` there and on `:root` in the admin, where admin.css
10
- * reads them too.
5
+ * Nothing here may lean on another stylesheet, and sizes are in pixels: a
6
+ * `rem` is the host page's.
11
7
  */
12
8
 
13
- :root,
14
- :host {
15
- --admin-bar: #1d2327;
16
- --admin-nav: #2c3338;
17
- --admin-nav-text: #f0f0f1;
18
- --admin-focus-on-dark: #fff;
9
+ .admin-bar {
10
+ color-scheme: light dark;
11
+ --admin-bar-surface: light-dark(#f0f0f1, #1d2327);
12
+ --admin-bar-menu: light-dark(#ffffff, #2c3338);
13
+ --admin-bar-text: light-dark(#1d2327, #f0f0f1);
14
+ --admin-bar-hover: light-dark(#135e96, #72aee6);
15
+ --admin-bar-focus: light-dark(#2271b1, #ffffff);
16
+ --admin-bar-edge: light-dark(#c3c4c7, #1d2327);
17
+ }
18
+
19
+ :host([data-scheme='light']) .admin-bar {
20
+ color-scheme: light;
21
+ }
22
+
23
+ :host([data-scheme='dark']) .admin-bar {
24
+ color-scheme: dark;
19
25
  }
20
26
 
21
27
  .admin-bar,
@@ -32,8 +38,9 @@
32
38
  gap: 0 16px;
33
39
  padding: 0 16px;
34
40
  min-height: 40px;
35
- background: var(--admin-bar);
36
- color: var(--admin-nav-text);
41
+ background: var(--admin-bar-surface);
42
+ box-shadow: 0 1px 0 var(--admin-bar-edge);
43
+ color: var(--admin-bar-text);
37
44
  font:
38
45
  14px/40px -apple-system,
39
46
  BlinkMacSystemFont,
@@ -44,22 +51,18 @@
44
51
  }
45
52
 
46
53
  .admin-bar a {
47
- color: var(--admin-nav-text);
54
+ color: var(--admin-bar-text);
48
55
  text-decoration: none;
49
56
  white-space: nowrap;
50
57
  }
51
58
 
52
59
  .admin-bar a:hover,
53
60
  .admin-bar a:focus {
54
- color: #72aee6;
61
+ color: var(--admin-bar-hover);
55
62
  }
56
63
 
57
- /* The ring where the keyboard is, white on the dark bar. Here rather than in
58
- admin.css because on the public site this is the only stylesheet the bar
59
- has. */
60
-
61
64
  .admin-bar :focus-visible {
62
- outline: 2px solid var(--admin-focus-on-dark);
65
+ outline: 2px solid var(--admin-bar-focus);
63
66
  outline-offset: 2px;
64
67
  }
65
68
 
@@ -75,7 +78,7 @@
75
78
  padding: 0;
76
79
  border: 0;
77
80
  background: none;
78
- color: var(--admin-nav-text);
81
+ color: var(--admin-bar-text);
79
82
  font: inherit;
80
83
  text-align: right;
81
84
  cursor: pointer;
@@ -92,7 +95,7 @@
92
95
  .admin-bar-account:hover,
93
96
  .admin-bar-account:focus-visible,
94
97
  .admin-bar-account:popover-open {
95
- color: #72aee6;
98
+ color: var(--admin-bar-hover);
96
99
  }
97
100
 
98
101
  .admin-bar-account::after {
@@ -109,8 +112,8 @@
109
112
  min-width: 160px;
110
113
  padding: 4px 0;
111
114
  border: 0;
112
- background: var(--admin-nav);
113
- color: var(--admin-nav-text);
115
+ background: var(--admin-bar-menu);
116
+ color: var(--admin-bar-text);
114
117
  line-height: 1.6;
115
118
  box-shadow: 0 3px 5px rgb(0 0 0 / 20%);
116
119
  }
@@ -124,14 +127,13 @@
124
127
  .admin-account-menu a,
125
128
  .admin-account-menu button[type='submit'] {
126
129
  display: block;
127
- box-sizing: border-box;
128
130
  width: 100%;
129
131
  margin: 0;
130
132
  padding: 8px 16px;
131
133
  border: 0;
132
134
  border-radius: 0;
133
135
  background: none;
134
- color: var(--admin-nav-text);
136
+ color: var(--admin-bar-text);
135
137
  font: inherit;
136
138
  text-align: left;
137
139
  text-decoration: none;
@@ -148,6 +150,6 @@
148
150
  .admin-account-menu a:focus-visible,
149
151
  .admin-account-menu button[type='submit']:hover,
150
152
  .admin-account-menu button[type='submit']:focus-visible {
151
- background: var(--admin-bar);
152
- color: #72aee6;
153
+ background: var(--admin-bar-surface);
154
+ color: var(--admin-bar-hover);
153
155
  }
@@ -0,0 +1,22 @@
1
+ (function () {
2
+ var host = document.querySelector('geekity-admin-bar');
3
+ var root = host && host.shadowRoot;
4
+ if (!root) return;
5
+
6
+ new ResizeObserver(function () {
7
+ var height = host.getBoundingClientRect().height;
8
+ document.documentElement.style.setProperty('--geekity-admin-bar-height', height + 'px');
9
+ }).observe(host);
10
+
11
+ var menu = root.getElementById('admin-account-menu');
12
+ if (!menu) return;
13
+ /* Chrome restores focus when a light-DOM popover closes, not one inside a
14
+ shadow root. */
15
+ menu.addEventListener('beforetoggle', function (event) {
16
+ if (event.newState === 'closed' && menu.contains(root.activeElement)) {
17
+ setTimeout(function () {
18
+ root.querySelector('.admin-bar-account').focus();
19
+ });
20
+ }
21
+ });
22
+ })();