@geekity/cms 0.52.1 → 0.54.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 (72) hide show
  1. package/admin/components/cited-card.njk +32 -0
  2. package/admin/components/cited-preview.njk +2 -0
  3. package/admin/components/dashboard-widget-fill.njk +2 -0
  4. package/admin/components/dashboard-widget.njk +28 -0
  5. package/admin/pages/dashboard/home.njk +17 -19
  6. package/admin/pages/documents/editor.njk +6 -20
  7. package/admin/pages/media/file.njk +16 -1
  8. package/admin/static/admin.css +41 -0
  9. package/admin/static/dashboard.js +44 -0
  10. package/admin/static/editor.js +23 -23
  11. package/dist/admin/cited-preview.d.ts +22 -0
  12. package/dist/admin/cited-preview.d.ts.map +1 -0
  13. package/dist/admin/cited-preview.js +41 -0
  14. package/dist/admin/cited-preview.js.map +1 -0
  15. package/dist/admin/dashboard.d.ts +7 -0
  16. package/dist/admin/dashboard.d.ts.map +1 -1
  17. package/dist/admin/dashboard.js +78 -16
  18. package/dist/admin/dashboard.js.map +1 -1
  19. package/dist/admin/documents.d.ts.map +1 -1
  20. package/dist/admin/documents.js +8 -12
  21. package/dist/admin/documents.js.map +1 -1
  22. package/dist/admin/index.d.ts +1 -1
  23. package/dist/admin/index.d.ts.map +1 -1
  24. package/dist/admin/index.js +1 -1
  25. package/dist/admin/index.js.map +1 -1
  26. package/dist/admin/media.d.ts +3 -1
  27. package/dist/admin/media.d.ts.map +1 -1
  28. package/dist/admin/media.js +89 -2
  29. package/dist/admin/media.js.map +1 -1
  30. package/dist/admin/routes.d.ts.map +1 -1
  31. package/dist/admin/routes.js +12 -2
  32. package/dist/admin/routes.js.map +1 -1
  33. package/dist/admin/templates.d.ts +2 -0
  34. package/dist/admin/templates.d.ts.map +1 -1
  35. package/dist/admin/templates.js +2 -0
  36. package/dist/admin/templates.js.map +1 -1
  37. package/dist/admin/widgets.d.ts +8 -2
  38. package/dist/admin/widgets.d.ts.map +1 -1
  39. package/dist/admin/widgets.js +36 -22
  40. package/dist/admin/widgets.js.map +1 -1
  41. package/dist/cms/services.d.ts.map +1 -1
  42. package/dist/cms/services.js +5 -1
  43. package/dist/cms/services.js.map +1 -1
  44. package/dist/config.d.ts +12 -0
  45. package/dist/config.d.ts.map +1 -1
  46. package/dist/config.js +6 -0
  47. package/dist/config.js.map +1 -1
  48. package/dist/content/save.d.ts +21 -0
  49. package/dist/content/save.d.ts.map +1 -1
  50. package/dist/content/save.js +58 -0
  51. package/dist/content/save.js.map +1 -1
  52. package/dist/federation/article.d.ts +6 -0
  53. package/dist/federation/article.d.ts.map +1 -1
  54. package/dist/federation/article.js +47 -64
  55. package/dist/federation/article.js.map +1 -1
  56. package/dist/federation/delivery.d.ts +3 -0
  57. package/dist/federation/delivery.d.ts.map +1 -1
  58. package/dist/federation/delivery.js +17 -2
  59. package/dist/federation/delivery.js.map +1 -1
  60. package/dist/media/uploads.d.ts +13 -0
  61. package/dist/media/uploads.d.ts.map +1 -1
  62. package/dist/media/uploads.js +47 -14
  63. package/dist/media/uploads.js.map +1 -1
  64. package/dist/web/asset-routes.d.ts +1 -3
  65. package/dist/web/asset-routes.d.ts.map +1 -1
  66. package/dist/web/asset-routes.js +1 -3
  67. package/dist/web/asset-routes.js.map +1 -1
  68. package/dist/webmention/reply-contexts.d.ts +21 -3
  69. package/dist/webmention/reply-contexts.d.ts.map +1 -1
  70. package/dist/webmention/reply-contexts.js +93 -8
  71. package/dist/webmention/reply-contexts.js.map +1 -1
  72. package/package.json +1 -1
@@ -0,0 +1,32 @@
1
+ {% import "components/fields.njk" as field %}
2
+ {% from "components/card.njk" import card %}
3
+
4
+ {% macro citedCard(property) %}
5
+ {% set found = citedPreviews[property] %}
6
+ {% if found and found.unread %}
7
+ <p class="label whitespace-normal">This page could not be read. The post will call it {{ found.name }}.</p>
8
+ {% elif found %}
9
+ {% call card(size='sm', style='border') %}
10
+ {% if found.picture %}
11
+ {# First: Tailwind's `peer-*` variants reach later siblings only. #}
12
+ <input class="peer sr-only" type="checkbox" id="editor-preview-{{ property }}" name="preview" value="hide"{% if form.previewHidden %} checked{% endif %}>
13
+ <label class="btn btn-circle btn-xs absolute end-2 top-2 peer-checked:btn-neutral peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-base-content" for="editor-preview-{{ property }}"><span aria-hidden="true">×</span><span class="sr-only">Remove the preview of {{ found.name }}</span></label>
14
+ <img class="h-auto max-h-32 w-full rounded-box object-cover peer-checked:opacity-40" src="{{ found.picture.src }}" alt="" width="{{ found.picture.width }}" height="{{ found.picture.height }}" loading="lazy">
15
+ {% endif %}
16
+ <p class="break-words pe-8 peer-checked:opacity-40">{{ found.name }}</p>
17
+ {% if found.author %}
18
+ <p class="text-sm text-base-content/70 peer-checked:opacity-40">By {{ found.author }}</p>
19
+ {% endif %}
20
+ {% if found.picture %}
21
+ <p class="label hidden whitespace-normal peer-checked:block">Removed. The post shows the plain citation until you select the X again.</p>
22
+ {% endif %}
23
+ {% if found.described %}
24
+ {{ field.text('editor-cited-alt', 'cited-alt', 'Alt text of the reposted image', value=(form.citedAlt or form.title), error=(error if errorField == 'editor-cited-alt' else ''), hint='What the image shows, for readers who cannot see it. It starts as the post’s title.', hintId='editor-cited-alt-hint') }}
25
+ {% endif %}
26
+ {% endcall %}
27
+ {% endif %}
28
+ {% endmacro %}
29
+
30
+ {% macro citedSlot(fieldId, property) %}
31
+ <div data-cited-for="{{ fieldId }}" data-cited-property="{{ property }}" aria-live="polite">{{ citedCard(property) }}</div>
32
+ {% endmacro %}
@@ -0,0 +1,2 @@
1
+ {% import "components/cited-card.njk" as cited with context %}
2
+ {{ cited.citedCard(property) }}
@@ -0,0 +1,2 @@
1
+ {% from "components/dashboard-widget.njk" import widgetBody, alertCard %}
2
+ {% if widget.placement == 'alerts' %}{{ alertCard(widget) }}{% else %}{{ widgetBody(widget) }}{% endif %}
@@ -0,0 +1,28 @@
1
+ {% from "components/badge.njk" import badge %}
2
+ {% from "components/blocks.njk" import block %}
3
+ {% from "components/card.njk" import card %}
4
+
5
+ {% macro widgetBody(widget) -%}
6
+ {% if widget.status == 'stale' %}
7
+ <p class="text-sm">{{ badge('Stale', color='warning') }} The latest load failed. These figures are from {{ widget.loadedAt }}.</p>
8
+ {% elif widget.status == 'unavailable' %}
9
+ <p>These stats are unavailable right now.</p>
10
+ {% endif %}
11
+ {% for data in widget.blocks %}{{ block(data) }}{% endfor %}
12
+ {%- endmacro %}
13
+
14
+ {% macro alertCard(widget) -%}
15
+ {% call card(title=widget.title, tone='warning') %}
16
+ {{ widgetBody(widget) }}
17
+ {% endcall %}
18
+ {%- endmacro %}
19
+
20
+ {% macro widgetSkeleton() -%}
21
+ <div class="flex flex-col gap-3">
22
+ <div class="skeleton h-4 w-2/3"></div>
23
+ <div class="skeleton h-4 w-full"></div>
24
+ <div class="skeleton h-4 w-5/6"></div>
25
+ <div class="skeleton h-24 w-full"></div>
26
+ </div>
27
+ <span class="sr-only">Loading</span>
28
+ {%- endmacro %}
@@ -1,27 +1,16 @@
1
1
  {% extends "layouts/shell.njk" %}
2
2
  {% from "components/stat.njk" import stats, stat %}
3
- {% from "components/card.njk" import card %}
4
- {% from "components/badge.njk" import badge %}
5
- {% from "components/blocks.njk" import block %}
3
+ {% from "components/dashboard-widget.njk" import widgetBody, alertCard, widgetSkeleton %}
6
4
  {% from "components/tabs.njk" import tabs %}
7
5
  {% from "components/button.njk" import button %}
8
6
  {% from "components/dropdown.njk" import dropdown %}
9
7
 
10
8
  {% block title %}Dashboard{% endblock %}
11
9
 
12
- {% macro widgetBody(widget) -%}
13
- {% if widget.status == 'stale' %}
14
- <p class="text-sm">{{ badge('Stale', color='warning') }} The latest load failed. These figures are from {{ widget.loadedAt }}.</p>
15
- {% elif widget.status == 'unavailable' %}
16
- <p>These stats are unavailable right now.</p>
17
- {% endif %}
18
- {% for data in widget.blocks %}{{ block(data) }}{% endfor %}
19
- {%- endmacro %}
20
-
21
- {% macro widgetCard(widget, tone=none) -%}
22
- {% call card(title=widget.title, tone=tone) %}
23
- {{ widgetBody(widget) }}
24
- {% endcall %}
10
+ {% macro widgetSlot(widget) -%}
11
+ <div class="contents"{% if widget.loadUrl %} data-widget-url="{{ widget.loadUrl }}" aria-busy="true"{% endif %}>
12
+ {% if widget.loading %}{{ widgetSkeleton() }}{% else %}{{ widgetBody(widget) }}{% endif %}
13
+ </div>
25
14
  {%- endmacro %}
26
15
 
27
16
  {% macro arrangedCard(widget) -%}
@@ -33,6 +22,7 @@
33
22
  <input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
34
23
  <input type="hidden" name="widget" value="{{ widget.key }}" />
35
24
  {% if period %}<input type="hidden" name="period" value="{{ period }}" />{% endif %}
25
+ {% if wait %}<input type="hidden" name="wait" value="1" />{% endif %}
36
26
  {% for key in widget.shown %}<input type="hidden" name="shown" value="{{ key }}" />{% endfor %}
37
27
  {{ button('↑', type='submit', name='action', value='earlier', style='ghost', size='xs', shape='square', ariaLabel='Move ' + widget.title + ' earlier', disabled=widget.first) }}
38
28
  {{ button('↓', type='submit', name='action', value='later', style='ghost', size='xs', shape='square', ariaLabel='Move ' + widget.title + ' later', disabled=widget.last) }}
@@ -47,7 +37,7 @@
47
37
  </form>
48
38
  </div>
49
39
  {% if not widget.collapsed %}
50
- {{ widgetBody(widget) }}
40
+ {{ widgetSlot(widget) }}
51
41
  {% endif %}
52
42
  </div>
53
43
  </div>
@@ -55,6 +45,11 @@
55
45
 
56
46
  {% block content %}
57
47
  <h1 class="mb-6 text-2xl font-bold">Dashboard</h1>
48
+ {% if waitUrl %}
49
+ <noscript>
50
+ <p class="mb-6">Some cards load once the page is open, which needs JavaScript. <a class="link" href="{{ waitUrl }}">Show the dashboard with every card loaded</a>.</p>
51
+ </noscript>
52
+ {% endif %}
58
53
 
59
54
  {% set glance = [
60
55
  { label: 'Published posts', value: counts.posts },
@@ -76,7 +71,9 @@
76
71
  </section>
77
72
 
78
73
  {% for widget in alerts %}
79
- <section class="mb-8">{{ widgetCard(widget, tone='warning') }}</section>
74
+ <section class="mb-8"{% if widget.loadUrl %} data-widget-url="{{ widget.loadUrl }}"{% endif %}{% if widget.loading %} hidden{% endif %}>
75
+ {% if not widget.loading %}{{ alertCard(widget) }}{% endif %}
76
+ </section>
80
77
  {% endfor %}
81
78
 
82
79
  {% if arrangeable %}
@@ -96,6 +93,7 @@
96
93
  <input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
97
94
  <input type="hidden" name="widget" value="{{ card.key }}" />
98
95
  {% if period %}<input type="hidden" name="period" value="{{ period }}" />{% endif %}
96
+ {% if wait %}<input type="hidden" name="wait" value="1" />{% endif %}
99
97
  <span class="min-w-0 text-sm">{{ card.title }}</span>
100
98
  {{ button('Add back', type='submit', name='action', value='restore', size='xs', ariaLabel='Add back ' + card.title) }}
101
99
  </form>
@@ -121,6 +119,6 @@
121
119
  {% endfor %}
122
120
  </div>
123
121
  </div>
124
- <script defer src="{{ adminAsset('dashboard.js') }}"></script>
125
122
  {% endif %}
123
+ <script defer src="{{ adminAsset('dashboard.js') }}"></script>
126
124
  {% endblock %}
@@ -14,6 +14,7 @@
14
14
  {% from "components/collapse.njk" import collapse %}
15
15
  {% from "components/dropdown.njk" import dropdown %}
16
16
  {% from "components/upload.njk" import uploadControl %}
17
+ {% import "components/cited-card.njk" as cited with context %}
17
18
 
18
19
  {% set ACTION_COLORS = { 'publish': 'primary', 'update': 'primary', 'trash': 'error' } %}
19
20
  {% set ACTION_STYLES = { 'trash': 'ghost' } %}
@@ -62,22 +63,6 @@
62
63
  {% endif %}
63
64
  {% endmacro %}
64
65
 
65
- {% macro citedCard(property) %}
66
- {% set cited = citedPreviews[property] %}
67
- {% if cited %}
68
- {% call card(size='sm', style='border') %}
69
- {# First: Tailwind's `peer-*` variants reach later siblings only. #}
70
- <input class="peer sr-only" type="checkbox" id="editor-preview-{{ property }}" name="preview" value="hide"{% if form.previewHidden %} checked{% endif %}>
71
- <label class="btn btn-circle btn-xs absolute end-2 top-2 peer-checked:btn-neutral peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-base-content" for="editor-preview-{{ property }}"><span aria-hidden="true">×</span><span class="sr-only">Remove the preview of {{ cited.name }}</span></label>
72
- <img class="h-auto max-h-32 w-full rounded-box object-cover peer-checked:opacity-40" src="{{ cited.picture.src }}" alt="" width="{{ cited.picture.width }}" height="{{ cited.picture.height }}" loading="lazy">
73
- <p class="break-words pe-8 peer-checked:opacity-40">{{ cited.name }}</p>
74
- <p class="label hidden whitespace-normal peer-checked:block">Removed. The post shows the plain citation until you select the X again.</p>
75
- {% if cited.described %}
76
- {{ field.text('editor-cited-alt', 'cited-alt', 'Alt text of the reposted image', value=(form.citedAlt or form.title), error=(error if errorField == 'editor-cited-alt' else ''), hint='What the image shows, for readers who cannot see it. It starts as the post’s title.', hintId='editor-cited-alt-hint') }}
77
- {% endif %}
78
- {% endcall %}
79
- {% endif %}
80
- {% endmacro %}
81
66
 
82
67
  {% macro pluginActions(fieldId, buttons) %}
83
68
  {% if buttons %}
@@ -192,15 +177,15 @@
192
177
  </div>
193
178
  </fieldset>
194
179
  {{ field.text('editor-' + link.chosen, 'link-url', 'Address', value=link.url, type='url', error=(error if errorField == ('editor-' + link.chosen) else ''), hint='The page is fetched for its title and picture, and sent a webmention when you publish. Leave it empty for a post that cites nothing.') }}
195
- {{ citedCard(link.chosen) }}
180
+ {{ cited.citedSlot('editor-' + link.chosen, link.chosen) }}
196
181
  {% for other in link.others %}
197
182
  {{ field.text('editor-' + other.property, other.property, other.also, value=other.url, type='url', error=(error if errorField == ('editor-' + other.property) else ''), hint='Empty it to take it out.') }}
198
- {{ citedCard(other.property) }}
183
+ {{ cited.citedSlot('editor-' + other.property, other.property) }}
199
184
  {% endfor %}
200
185
 
201
186
  {% elif name == 'rsvp' %}
202
187
  {{ field.text('editor-in-reply-to', 'in-reply-to', 'Event address', value=form.inReplyTo, type='url', error=(error if errorField == 'editor-in-reply-to' else ''), hint='The event’s page. It is sent a webmention when you publish.') }}
203
- {{ citedCard('in-reply-to') }}
188
+ {{ cited.citedSlot('editor-in-reply-to', 'in-reply-to') }}
204
189
  <fieldset class="fieldset">
205
190
  <legend class="fieldset-legend">Going?</legend>
206
191
  <div class="join flex-wrap">
@@ -513,6 +498,7 @@
513
498
  class="flex flex-wrap items-center gap-2"
514
499
  id="editor-enhance"
515
500
  data-preview-url="{{ previewUrl }}"
501
+ data-cited-preview-url="{{ citedPreviewUrl }}"
516
502
  data-upload-url="{{ uploadsUrl }}"
517
503
  data-kind="{{ kind.type }}"
518
504
  data-wiki-slugs="{{ wikiSlugs | dump }}"
@@ -543,7 +529,7 @@
543
529
  <option value="{{ url }}"></option>
544
530
  {% endfor %}
545
531
  </datalist>
546
- {% if form.previewHidden and not (citedPreviews | length) %}
532
+ {% if form.previewHidden and not previewToggled %}
547
533
  <input type="hidden" name="preview" value="hide">
548
534
  {% endif %}
549
535
  {% if form.citedAlt and not describesCitedImage %}
@@ -67,7 +67,7 @@
67
67
  <div class="grid gap-6 overflow-hidden rounded-box border border-base-300 bg-base-100 lg:grid-cols-[3fr_2fr]">
68
68
  <div class="flex min-h-64 items-center justify-center bg-base-200 p-4">
69
69
  {% if file.kind == 'image' %}
70
- <a href="{{ file.url }}"><img class="max-h-[70vh] rounded-box object-contain" src="{{ file.url }}" alt=""{% if file.width %} width="{{ file.width }}" height="{{ file.height }}"{% endif %} /></a>
70
+ <a href="{{ previewUrl }}"><img class="max-h-[70vh] rounded-box object-contain" src="{{ previewUrl }}" alt=""{% if file.width %} width="{{ file.width }}" height="{{ file.height }}"{% endif %} /></a>
71
71
  {% elif file.kind == 'audio' %}
72
72
  <audio class="w-full" controls preload="none" src="{{ file.url }}"></audio>
73
73
  {% elif file.kind == 'video' %}
@@ -129,6 +129,21 @@
129
129
  {% endif %}
130
130
  </div>
131
131
 
132
+ <form class="border-t border-base-300 pt-4" method="post" action="{{ replaceUrl }}" enctype="multipart/form-data">
133
+ <input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
134
+ <input type="hidden" name="{{ fields.path }}" value="{{ file.path }}" />
135
+ <input type="hidden" name="{{ fields.from }}" value="{{ from }}" />
136
+ <div class="fieldset">
137
+ <label class="fieldset-legend" for="media-replace">Replace file</label>
138
+ <input id="media-replace" name="{{ fields.file }}" type="file" accept="{{ replaceAccepts }}" required aria-describedby="media-replace-help" class="file-input file-input-sm w-full" />
139
+ <p id="media-replace-help" class="label block whitespace-normal">
140
+ New bytes in the same format, at the same address, keeping the name and alt text.
141
+ Published posts that attach it are sent to their followers again.
142
+ </p>
143
+ </div>
144
+ <div class="mt-2">{{ button('Replace', type='submit') }}</div>
145
+ </form>
146
+
132
147
  <form class="border-t border-base-300 pt-4 text-right" method="post" action="{{ deleteUrl }}">
133
148
  <input type="hidden" name="csrf_token" value="{{ csrfToken }}" />
134
149
  <input type="hidden" name="{{ fields.path }}" value="{{ file.path }}" />
@@ -4451,6 +4451,31 @@
4451
4451
  rotate: 45deg;
4452
4452
  }
4453
4453
 
4454
+ .skeleton {
4455
+ border-radius: var(--radius-box);
4456
+ background-color: var(--color-base-300);
4457
+ will-change: background-position;
4458
+ background-image: linear-gradient(105deg, #0000 0% 40%, var(--color-base-100) 50%, #0000 60% 100%);
4459
+ background-position-x: -50%;
4460
+ background-size: 200%;
4461
+ }
4462
+
4463
+ @media (prefers-reduced-motion: reduce) {
4464
+ .skeleton {
4465
+ transition-duration: 15s;
4466
+ }
4467
+ }
4468
+
4469
+ @media (prefers-reduced-motion: no-preference) {
4470
+ .skeleton {
4471
+ animation: 1.8s ease-in-out infinite skeleton;
4472
+ }
4473
+
4474
+ .skeleton:dir(rtl) {
4475
+ animation-direction: reverse;
4476
+ }
4477
+ }
4478
+
4454
4479
  .link {
4455
4480
  cursor: pointer;
4456
4481
  text-decoration-line: underline;
@@ -7289,6 +7314,10 @@
7289
7314
  display: block;
7290
7315
  }
7291
7316
 
7317
+ .contents {
7318
+ display: contents;
7319
+ }
7320
+
7292
7321
  .flex {
7293
7322
  display: flex;
7294
7323
  }
@@ -7360,6 +7389,10 @@
7360
7389
  height: calc(var(--spacing) * 3);
7361
7390
  }
7362
7391
 
7392
+ .h-4 {
7393
+ height: calc(var(--spacing) * 4);
7394
+ }
7395
+
7363
7396
  .h-12 {
7364
7397
  height: calc(var(--spacing) * 12);
7365
7398
  }
@@ -7412,6 +7445,14 @@
7412
7445
  min-height: 100vh;
7413
7446
  }
7414
7447
 
7448
+ .w-2\/3 {
7449
+ width: 66.6667%;
7450
+ }
7451
+
7452
+ .w-5\/6 {
7453
+ width: 83.3333%;
7454
+ }
7455
+
7415
7456
  .w-7 {
7416
7457
  width: calc(var(--spacing) * 7);
7417
7458
  }
@@ -1,5 +1,6 @@
1
1
  (function () {
2
2
  var grid = document.querySelector('[data-dashboard-cards]');
3
+ Array.prototype.forEach.call(document.querySelectorAll('[data-widget-url]'), loadWidget);
3
4
  if (!grid) return;
4
5
  var url = grid.getAttribute('data-layout-url');
5
6
 
@@ -122,6 +123,49 @@
122
123
  });
123
124
  }
124
125
 
126
+ function loadWidget(slot) {
127
+ fetch(slot.getAttribute('data-widget-url'), {
128
+ credentials: 'same-origin',
129
+ redirect: 'manual',
130
+ })
131
+ .then(function (response) {
132
+ if (response.status === 204) return '';
133
+ if (!response.ok) throw new Error(String(response.status));
134
+ return response.text();
135
+ })
136
+ .then(function (html) {
137
+ if (html === '') {
138
+ dropWidget(slot);
139
+ return;
140
+ }
141
+ slot.innerHTML = html;
142
+ slot.hidden = false;
143
+ slot.removeAttribute('aria-busy');
144
+ })
145
+ .catch(function () {
146
+ slot.removeAttribute('aria-busy');
147
+ if (slot.hidden) {
148
+ slot.remove();
149
+ } else if (slot.querySelector('.skeleton')) {
150
+ slot.innerHTML = '<p>These stats are unavailable right now.</p>';
151
+ }
152
+ });
153
+ }
154
+
155
+ function dropWidget(slot) {
156
+ var card = slot.closest('[data-dashboard-card]');
157
+ if (!card) {
158
+ slot.remove();
159
+ return;
160
+ }
161
+ var key = card.getAttribute('data-dashboard-card');
162
+ card.remove();
163
+ Array.prototype.forEach.call(grid.querySelectorAll('input[name="shown"]'), function (input) {
164
+ if (input.value === key) input.remove();
165
+ });
166
+ moveButtons();
167
+ }
168
+
125
169
  function moveButtons() {
126
170
  columns().forEach(function (column) {
127
171
  var side = column.getAttribute('data-dashboard-column');