Skip to content

Commit deb84dc

Browse files
authored
Docs: sync widget previews and add an accessibility page (#11)
Refresh public/widgets/ and public/js/ from the application repository. Replace the GitHub pull request stubs' "label" key with "filters", matching the field the widget now reads. Add /docs/accessibility/, generated from ACCESSIBILITY.md in the application repository at build time. Gate it in scripts/check-dist.mjs alongside the development and changelog pages, and link it from the sidebar and the landing footer.
1 parent 159556b commit deb84dc

59 files changed

Lines changed: 227 additions & 97 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎astro.config.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export default defineConfig({
9797
],
9898
},
9999
{ label: 'Security', link: '/docs/security/' },
100+
{ label: 'Accessibility', link: '/docs/accessibility/' },
100101
{ label: 'Troubleshooting', link: '/docs/troubleshooting/' },
101102
{ label: 'Support', link: '/docs/support/' },
102103
{ label: 'Development', link: '/docs/development/' },

‎public/api/widget-data/gh-github-prs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"view": "prs",
33
"totalCount": 4,
4-
"label": "created",
4+
"filters": ["created"],
55
"allUrl": "https://github.com/pulls",
66
"items": [
77
{

‎public/api/widget-data/gh-github-prs-md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"view": "prs",
33
"totalCount": 4,
4-
"label": "created",
4+
"filters": ["created"],
55
"allUrl": "https://github.com/pulls",
66
"items": [
77
{

‎public/js/admin-app-form.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import {
1313
initInlineEdit,
1414
setTogDisabled,
1515
wireChecklist,
16-
} from '/js/admin-shared.js?v=d96fc091';
17-
import { renderColorControl, BADGE_SWATCHES } from '/js/admin-color-control.js?v=89eee5e8';
16+
} from '/js/admin-shared.js?v=8f69dad6';
17+
import { renderColorControl, BADGE_SWATCHES } from '/js/admin-color-control.js?v=984a0b69';
1818
import { badgeErrorAdvice, TONE } from '/js/admin-error.js?v=10f3cdb1';
1919

2020
export function buildFolderForm(body, item) {

‎public/js/admin-auth.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ag, ap } from '/js/admin-shared.js?v=d96fc091';
1+
import { ag, ap } from '/js/admin-shared.js?v=8f69dad6';
22
import { t } from '/js/i18n.js?v=d056c9c5';
33
import { pwStrength } from '/js/password-strength.js?v=42f45ac7';
44
import { el, inp as inpById, qa } from '/js/utils.js?v=b18c93ed';

‎public/js/admin-color-control.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PE_SVG, initInlineEdit, toast } from '/js/admin-shared.js?v=d96fc091';
1+
import { PE_SVG, initInlineEdit, toast } from '/js/admin-shared.js?v=8f69dad6';
22
import { t } from '/js/i18n.js?v=d056c9c5';
33
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
44
import { qa, q } from '/js/utils.js?v=b18c93ed';

‎public/js/admin-settings.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { toast, ag, ap } from '/js/admin-shared.js?v=d96fc091';
1+
import { toast, ag, ap } from '/js/admin-shared.js?v=8f69dad6';
22
import { pwStrength } from '/js/password-strength.js?v=42f45ac7';
33
import { t } from '/js/i18n.js?v=d056c9c5';
44
import { shouldWritePassword, settingsSaveBlocker, clearsStoredPassword, BLOCK } from '/js/admin-logic.js?v=ddfc6f80';

‎public/js/admin-shared.js‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,13 @@ export const CHEV_SVG =
129129
'<svg class="dd-chev" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 10.5 12 6.5 16 10.5"/><path d="M8 13.5 12 17.5 16 13.5"/></svg>';
130130

131131
/* `root` lets a caller wire a subtree that is not in the document yet. */
132-
/** @param {string} rowId @param {string} inputId
133-
@param {{ type?: string, placeholder?: string,
132+
/** A function placeholder is resolved on use, not at wiring time: this runs
133+
before the catalog is fetched, so a translated one has to be read later.
134+
@param {string} rowId @param {string} inputId
135+
@param {{ type?: string, placeholder?: string | (() => string),
134136
onCommit?: (value: string) => void, root?: ParentNode }} [opts] */
135137
export function initInlineEdit(rowId, inputId, { type = 'text', placeholder = '', onCommit, root = document } = {}) {
138+
const ph = () => (typeof placeholder === 'function' ? placeholder() : placeholder);
136139
const byId = id => (root === document ? el(id) : root.querySelector('#' + CSS.escape(id)));
137140
const row = byId(rowId);
138141
const inp = /** @type {HTMLInputElement} */ (byId(inputId));
@@ -142,15 +145,23 @@ export function initInlineEdit(rowId, inputId, { type = 'text', placeholder = ''
142145
if (!valEl || !pen) return;
143146

144147
inp.type = type;
145-
inp.placeholder = placeholder;
148+
inp.placeholder = ph();
146149
inp.className = 'row-inp';
147150
inp.style.display = '';
148151
inp.style.cssText = '';
152+
/* The row's own label carries the translation. A placeholder is a hint, not a
153+
name, and several readers drop it once the field holds a value. */
154+
const labelEl = q('.rl', row);
155+
if (labelEl) {
156+
if (!labelEl.id) labelEl.id = `${rowId}-rl`;
157+
inp.setAttribute('aria-labelledby', labelEl.id);
158+
}
149159
row.insertBefore(inp, pen);
150160

151161
function open() {
152162
if (row.classList.contains('editing')) return;
153163
row.classList.add('editing');
164+
inp.placeholder = ph();
154165
inp.value = valEl.classList.contains('is-ph') ? '' : valEl.textContent;
155166
inp.focus();
156167
inp.select?.();
@@ -163,7 +174,7 @@ export function initInlineEdit(rowId, inputId, { type = 'text', placeholder = ''
163174
valEl.textContent = v;
164175
valEl.classList.remove('is-ph');
165176
} else {
166-
valEl.textContent = placeholder || '';
177+
valEl.textContent = ph() || '';
167178
valEl.classList.add('is-ph');
168179
}
169180
onCommit?.(v);

‎public/js/admin-widget-form.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { state } from '/js/admin-state.js?v=b7731aa4';
2-
import { PE_SVG, CHEV_SVG, initInlineEdit } from '/js/admin-shared.js?v=d96fc091';
3-
import { renderWidgetConfigForm } from '/js/widget-config-form.js?v=71fe9a70';
2+
import { PE_SVG, CHEV_SVG, initInlineEdit } from '/js/admin-shared.js?v=8f69dad6';
3+
import { renderWidgetConfigForm } from '/js/widget-config-form.js?v=45bbb2b7';
44
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
55
import {
66
sizesForView,

‎public/js/admin.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { buildAppForm, buildFolderForm, serializeKvRows } from '/js/admin-app-form.js?v=f87415c7';
2-
import { checkAuth, requireLogin, wirePasswordStrength } from '/js/admin-auth.js?v=589ad7b9';
1+
import { buildAppForm, buildFolderForm, serializeKvRows } from '/js/admin-app-form.js?v=f236bd68';
2+
import { checkAuth, requireLogin, wirePasswordStrength } from '/js/admin-auth.js?v=5e6450f0';
33
import { applyDrop, canJoinFolder, folderRowZone } from '/js/admin-drag-logic.js?v=ebe3e806';
44
import { reorderItems, resolveAdminSection } from '/js/admin-logic.js?v=ddfc6f80';
55
import {
@@ -10,10 +10,10 @@ import {
1010
snapshotItems,
1111
upsertItem,
1212
} from '/js/admin-save-logic.js?v=52a970d3';
13-
import { loadSettings, showBgFields, showBgFit, showWallpaperFile } from '/js/admin-settings.js?v=b2b67c47';
14-
import { ag, ap, initInlineEdit, setReauthHandler, toast } from '/js/admin-shared.js?v=d96fc091';
13+
import { loadSettings, showBgFields, showBgFit, showWallpaperFile } from '/js/admin-settings.js?v=f7078bc0';
14+
import { ag, ap, initInlineEdit, setReauthHandler, toast } from '/js/admin-shared.js?v=8f69dad6';
1515
import { state } from '/js/admin-state.js?v=b7731aa4';
16-
import { buildWidgetForm } from '/js/admin-widget-form.js?v=55e0396a';
16+
import { buildWidgetForm } from '/js/admin-widget-form.js?v=15aad905';
1717
import { html, raw, setHtml } from '/js/html.js?v=c71f8903';
1818
import { initI18n, LANGUAGES, t } from '/js/i18n.js?v=d056c9c5';
1919
import { iconChain, loadLocalIcons, resolveIcon } from '/js/icons.js?v=69c2b9bd';
@@ -30,7 +30,7 @@ import { isMobileLayout, onLayoutChange } from '/js/layout.js?v=28416a75';
3030
import { confirmModal, openModal as openDialog, promptModal } from '/js/modal.js?v=ff76dc56';
3131
import { readMode, watchSystemTheme, writeMode } from '/js/theme.js?v=fbd2d2ef';
3232
import { el, inp, q, qa, clr as rc, sanitizeCssUrl, setUserText, tgt } from '/js/utils.js?v=b18c93ed';
33-
import { normalizeColorInput } from '/js/admin-color-control.js?v=89eee5e8';
33+
import { normalizeColorInput } from '/js/admin-color-control.js?v=984a0b69';
3434
import { parseYamlTolerant, YamlLiteError } from '/js/yaml-lite.js?v=cceca788';
3535

3636
/* A class rather than a bare media query. Some phones report a wider CSS
@@ -319,7 +319,7 @@ function mkRow(item, idx, { indent = false, childIdx = null, folderId = null } =
319319
const mkMove = (dir, can) => {
320320
const b = document.createElement('button');
321321
b.className = 'btn bg sm ic';
322-
const lbl = dir < 0 ? 'Move up' : 'Move down';
322+
const lbl = t(dir < 0 ? 'common.moveUp' : 'common.moveDown');
323323
b.title = lbl;
324324
b.setAttribute('aria-label', lbl + ': ' + (item.label || item.id || 'item'));
325325
b.textContent = dir < 0 ? '↑' : '↓';
@@ -1043,7 +1043,7 @@ function initAllInlineEdits() {
10431043

10441044
initInlineEdit('ie-pw', 'sec-pw', {
10451045
type: 'password',
1046-
placeholder: t('general.passwordPh'),
1046+
placeholder: () => t('general.passwordPh'),
10471047
onCommit() {
10481048
const bars = el('sec-pw-bars');
10491049
const hint = el('sec-pw-hint');

0 commit comments

Comments
 (0)