anentrypoint-design 0.0.262 → 0.0.264
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/README.md +1 -0
- package/app-shell.css +5 -1
- package/dist/247420.css +5 -1
- package/dist/247420.js +13 -13
- package/package.json +1 -1
- package/src/components/files.js +16 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.264",
|
|
4
4
|
"description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/247420.js",
|
package/src/components/files.js
CHANGED
|
@@ -47,7 +47,7 @@ export function FileIcon({ type = 'other' } = {}) {
|
|
|
47
47
|
const FILE_ROW_ACTIONS = ['download', 'rename', 'move', 'delete'];
|
|
48
48
|
|
|
49
49
|
export function FileRow({ name, type = 'other', size, modified, code, onOpen, onAction, active, key, permissions, locked,
|
|
50
|
-
actions = FILE_ROW_ACTIONS, busy = false, selectable = false,
|
|
50
|
+
actions = FILE_ROW_ACTIONS, busy = false, selectable = false, selected = false, onToggleSelect } = {}) {
|
|
51
51
|
// permissions: ['read','write'] | ['read'] | 'EACCES'. A no-access entry can
|
|
52
52
|
// be listed (the dir stat saw it) but not opened — show an ASCII tag and
|
|
53
53
|
// disable the open button so the row reads honestly instead of silently
|
|
@@ -95,12 +95,12 @@ export function FileRow({ name, type = 'other', size, modified, code, onOpen, on
|
|
|
95
95
|
const checkCtl = selectable ? h('button', {
|
|
96
96
|
key: 'mark',
|
|
97
97
|
type: 'button',
|
|
98
|
-
class: 'ds-file-check' + (
|
|
98
|
+
class: 'ds-file-check' + (selected ? ' is-marked' : ''),
|
|
99
99
|
role: 'checkbox',
|
|
100
|
-
'aria-checked':
|
|
101
|
-
'aria-label': (
|
|
100
|
+
'aria-checked': selected ? 'true' : 'false',
|
|
101
|
+
'aria-label': (selected ? 'unselect ' : 'select ') + name,
|
|
102
102
|
disabled: (noAccess || busy) ? true : null,
|
|
103
|
-
onclick:
|
|
103
|
+
onclick: onToggleSelect ? (e) => onToggleSelect({ range: !!e.shiftKey }) : null,
|
|
104
104
|
}, h('span', { class: 'ds-check-box', 'aria-hidden': 'true' })) : null;
|
|
105
105
|
// A role=button row containing real <button> action controls is invalid
|
|
106
106
|
// HTML (interactive nesting). Instead the row is a plain container and the
|
|
@@ -133,7 +133,7 @@ export function FileRow({ name, type = 'other', size, modified, code, onOpen, on
|
|
|
133
133
|
key,
|
|
134
134
|
class: 'ds-file-row row' + (active ? ' active' : '') + (noAccess ? ' is-locked' : '')
|
|
135
135
|
+ (readOnly ? ' is-restricted' : '')
|
|
136
|
-
+ (
|
|
136
|
+
+ (selected ? ' is-marked' : '') + (selectable ? ' is-selectable' : ''),
|
|
137
137
|
'data-file-type': type,
|
|
138
138
|
'aria-busy': busy ? 'true' : null,
|
|
139
139
|
}, ...rowKids);
|
|
@@ -312,8 +312,8 @@ export function FileGrid({ files = [], onOpen, onAction, onUp, emptyText = 'No f
|
|
|
312
312
|
...visible.map((f, i) => isThumb
|
|
313
313
|
? FileCell({
|
|
314
314
|
key: f.path || f.name + i, f,
|
|
315
|
-
selectable,
|
|
316
|
-
|
|
315
|
+
selectable, selected: selSet.has(entryKeyOf(f)),
|
|
316
|
+
onToggleSelect: onMark ? (opts) => onMark(f, opts) : null,
|
|
317
317
|
onOpen,
|
|
318
318
|
thumb: (thumbUrl && f.type === 'image') ? thumbUrl(f) : null,
|
|
319
319
|
})
|
|
@@ -323,8 +323,8 @@ export function FileGrid({ files = [], onOpen, onAction, onUp, emptyText = 'No f
|
|
|
323
323
|
permissions: f.permissions, locked: f.locked,
|
|
324
324
|
actions: actions != null ? actions : undefined,
|
|
325
325
|
busy: busy != null ? !!busy : !!f.busy,
|
|
326
|
-
selectable,
|
|
327
|
-
|
|
326
|
+
selectable, selected: selSet.has(entryKeyOf(f)),
|
|
327
|
+
onToggleSelect: onMark ? (opts) => onMark(f, opts) : null,
|
|
328
328
|
onOpen: onOpen ? () => onOpen(f) : null,
|
|
329
329
|
onAction: onAction ? (act) => onAction(act, f) : null
|
|
330
330
|
}))
|
|
@@ -368,7 +368,7 @@ function rovingRadio(e, idx, items, onSelect) {
|
|
|
368
368
|
// FileCell — the thumbnail-density tile. Image entries show a real (lazy)
|
|
369
369
|
// thumbnail through the host's confined thumbUrl; everything else keeps its
|
|
370
370
|
// type icon. Same open/mark semantics as FileRow, same no-nesting rule.
|
|
371
|
-
function FileCell({ key, f = {}, selectable = false,
|
|
371
|
+
function FileCell({ key, f = {}, selectable = false, selected = false, onToggleSelect, onOpen, thumb } = {}) {
|
|
372
372
|
const noAccess = f.locked || f.permissions === 'EACCES'
|
|
373
373
|
|| (Array.isArray(f.permissions) && f.permissions.length === 0);
|
|
374
374
|
const canOpen = onOpen && !noAccess;
|
|
@@ -376,11 +376,11 @@ function FileCell({ key, f = {}, selectable = false, marked = false, onMark, onO
|
|
|
376
376
|
const kids = [
|
|
377
377
|
selectable ? h('button', {
|
|
378
378
|
key: 'mark', type: 'button',
|
|
379
|
-
class: 'ds-file-check ds-file-cell-check' + (
|
|
380
|
-
role: 'checkbox', 'aria-checked':
|
|
381
|
-
'aria-label': (
|
|
379
|
+
class: 'ds-file-check ds-file-cell-check' + (selected ? ' is-marked' : ''),
|
|
380
|
+
role: 'checkbox', 'aria-checked': selected ? 'true' : 'false',
|
|
381
|
+
'aria-label': (selected ? 'unselect ' : 'select ') + f.name,
|
|
382
382
|
disabled: noAccess ? true : null,
|
|
383
|
-
onclick:
|
|
383
|
+
onclick: onToggleSelect ? (e) => onToggleSelect({ range: !!e.shiftKey }) : null,
|
|
384
384
|
}, h('span', { class: 'ds-check-box', 'aria-hidden': 'true' })) : null,
|
|
385
385
|
h('button', {
|
|
386
386
|
key: 'open', type: 'button', class: 'ds-file-cell-open',
|
|
@@ -397,7 +397,7 @@ function FileCell({ key, f = {}, selectable = false, marked = false, onMark, onO
|
|
|
397
397
|
].filter(Boolean);
|
|
398
398
|
return h('div', {
|
|
399
399
|
key,
|
|
400
|
-
class: 'ds-file-cell' + (
|
|
400
|
+
class: 'ds-file-cell' + (selected ? ' is-marked' : '') + (f.active ? ' active' : '') + (noAccess ? ' is-locked' : ''),
|
|
401
401
|
'data-file-type': f.type,
|
|
402
402
|
}, ...kids);
|
|
403
403
|
}
|