@e280/quay 0.0.0-2 → 0.0.0-20
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 +98 -0
- package/package.json +17 -11
- package/s/cellar/cask.ts +1 -13
- package/s/cellar/cellar.test.ts +25 -42
- package/s/cellar/cellar.ts +16 -20
- package/s/cellar/index.ts +0 -4
- package/s/cellar/mammoth.ts +50 -0
- package/s/cellar/mammoth.worker.bundle.ts +30 -0
- package/s/demo/main.bundle.ts +2 -3
- package/s/dom/components/breadcrumb/component.ts +6 -5
- package/s/dom/components/browser/component.ts +11 -7
- package/s/dom/components/browser/style.css.ts +31 -31
- package/s/dom/components/dropzone/component.ts +6 -4
- package/s/dom/components/dropzone/style.css.ts +12 -13
- package/s/dom/components/filter/component.ts +13 -8
- package/s/dom/components/outliner/component.ts +8 -5
- package/s/dom/components/searchbar/component.ts +13 -7
- package/s/dom/components/sort/component.ts +13 -9
- package/s/dom/theme.css.ts +66 -2
- package/s/dom/views/tree/component.ts +10 -8
- package/s/dom/views/tree/style.css.ts +10 -10
- package/s/genius/parts/hy-tree.ts +10 -9
- package/s/index.html.ts +68 -73
- package/s/index.ts +6 -1
- package/s/logic/aspects/codex/codex.ts +3 -3
- package/s/logic/aspects/codex/example.ts +1 -4
- package/s/logic/aspects/codex/parts/codex-item.ts +4 -4
- package/s/logic/aspects/codex/parts/hierarchy.ts +1 -0
- package/s/logic/aspects/codex/parts/types.ts +1 -1
- package/s/logic/aspects/dropzone.ts +20 -16
- package/s/logic/aspects/tree-trail.ts +5 -4
- package/s/logic/brain.ts +5 -3
- package/s/logic/group.ts +13 -10
- package/s/logic/presets/media/group.ts +5 -4
- package/s/logic/presets/media/library.test.ts +82 -0
- package/s/logic/presets/media/library.ts +249 -0
- package/s/logic/presets/media/schema.ts +10 -1
- package/s/logic/presets/opfs/schema.ts +1 -1
- package/s/logic/presets/plain/group.ts +2 -2
- package/s/logic/presets/plain/schema.ts +1 -1
- package/s/logic/types.ts +1 -1
- package/s/tests.test.ts +2 -0
- package/x/cellar/cask.d.ts +2 -4
- package/x/cellar/cask.js +3 -12
- package/x/cellar/cask.js.map +1 -1
- package/x/cellar/cellar.d.ts +9 -7
- package/x/cellar/cellar.js +17 -22
- package/x/cellar/cellar.js.map +1 -1
- package/x/cellar/cellar.test.d.ts +2 -3
- package/x/cellar/cellar.test.js +24 -39
- package/x/cellar/cellar.test.js.map +1 -1
- package/x/cellar/index.d.ts +0 -3
- package/x/cellar/index.js +0 -3
- package/x/cellar/index.js.map +1 -1
- package/x/cellar/mammoth.d.ts +23 -0
- package/x/cellar/mammoth.js +34 -0
- package/x/cellar/mammoth.js.map +1 -0
- package/x/cellar/mammoth.worker.bundle.d.ts +1 -0
- package/x/cellar/mammoth.worker.bundle.js +20 -0
- package/x/cellar/mammoth.worker.bundle.js.map +1 -0
- package/x/cellar/mammoth.worker.bundle.min.js +8 -0
- package/x/cellar/mammoth.worker.bundle.min.js.map +7 -0
- package/x/demo/main.bundle.js +2 -2
- package/x/demo/main.bundle.js.map +1 -1
- package/x/demo/main.bundle.min.js +229 -197
- package/x/demo/main.bundle.min.js.LEGAL.txt +33 -0
- package/x/demo/main.bundle.min.js.map +7 -0
- package/x/dom/components/breadcrumb/component.d.ts +1 -1
- package/x/dom/components/breadcrumb/component.js +6 -5
- package/x/dom/components/breadcrumb/component.js.map +1 -1
- package/x/dom/components/browser/component.d.ts +1 -1
- package/x/dom/components/browser/component.js +10 -7
- package/x/dom/components/browser/component.js.map +1 -1
- package/x/dom/components/browser/style.css.d.ts +1 -1
- package/x/dom/components/browser/style.css.js +31 -30
- package/x/dom/components/browser/style.css.js.map +1 -1
- package/x/dom/components/dropzone/component.d.ts +1 -1
- package/x/dom/components/dropzone/component.js +6 -4
- package/x/dom/components/dropzone/component.js.map +1 -1
- package/x/dom/components/dropzone/style.css.d.ts +1 -1
- package/x/dom/components/dropzone/style.css.js +12 -12
- package/x/dom/components/dropzone/style.css.js.map +1 -1
- package/x/dom/components/filter/component.d.ts +1 -1
- package/x/dom/components/filter/component.js +10 -8
- package/x/dom/components/filter/component.js.map +1 -1
- package/x/dom/components/outliner/component.d.ts +1 -1
- package/x/dom/components/outliner/component.js +7 -5
- package/x/dom/components/outliner/component.js.map +1 -1
- package/x/dom/components/searchbar/component.d.ts +1 -1
- package/x/dom/components/searchbar/component.js +12 -6
- package/x/dom/components/searchbar/component.js.map +1 -1
- package/x/dom/components/sort/component.d.ts +1 -1
- package/x/dom/components/sort/component.js +11 -9
- package/x/dom/components/sort/component.js.map +1 -1
- package/x/dom/components.d.ts +7 -7
- package/x/dom/theme.css.d.ts +1 -1
- package/x/dom/theme.css.js +65 -1
- package/x/dom/theme.css.js.map +1 -1
- package/x/dom/views/tree/component.d.ts +1 -6
- package/x/dom/views/tree/component.js +10 -8
- package/x/dom/views/tree/component.js.map +1 -1
- package/x/dom/views/tree/style.css.d.ts +1 -1
- package/x/dom/views/tree/style.css.js +10 -10
- package/x/dom/views/tree/style.css.js.map +1 -1
- package/x/genius/parts/hy-tree.js +9 -8
- package/x/genius/parts/hy-tree.js.map +1 -1
- package/x/index.d.ts +6 -1
- package/x/index.html +70 -167
- package/x/index.html.d.ts +1 -2
- package/x/index.html.js +67 -73
- package/x/index.html.js.map +1 -1
- package/x/index.js +6 -1
- package/x/index.js.map +1 -1
- package/x/logic/aspects/codex/codex.js +3 -3
- package/x/logic/aspects/codex/codex.js.map +1 -1
- package/x/logic/aspects/codex/example.d.ts +0 -1
- package/x/logic/aspects/codex/example.js +1 -3
- package/x/logic/aspects/codex/example.js.map +1 -1
- package/x/logic/aspects/codex/parts/codex-item.d.ts +1 -1
- package/x/logic/aspects/codex/parts/codex-item.js +4 -4
- package/x/logic/aspects/codex/parts/codex-item.js.map +1 -1
- package/x/logic/aspects/codex/parts/hierarchy.js +1 -0
- package/x/logic/aspects/codex/parts/hierarchy.js.map +1 -1
- package/x/logic/aspects/codex/parts/types.d.ts +1 -1
- package/x/logic/aspects/dropzone.d.ts +1 -1
- package/x/logic/aspects/dropzone.js +19 -15
- package/x/logic/aspects/dropzone.js.map +1 -1
- package/x/logic/aspects/tree-trail.d.ts +1 -1
- package/x/logic/aspects/tree-trail.js +4 -4
- package/x/logic/aspects/tree-trail.js.map +1 -1
- package/x/logic/brain.d.ts +4 -2
- package/x/logic/brain.js.map +1 -1
- package/x/logic/group.d.ts +7 -7
- package/x/logic/group.js +10 -8
- package/x/logic/group.js.map +1 -1
- package/x/logic/presets/media/group.d.ts +1 -1
- package/x/logic/presets/media/group.js +3 -3
- package/x/logic/presets/media/group.js.map +1 -1
- package/x/logic/presets/media/library.d.ts +59 -0
- package/x/logic/presets/media/library.js +201 -0
- package/x/logic/presets/media/library.js.map +1 -0
- package/x/logic/presets/media/library.test.d.ts +9 -0
- package/x/logic/presets/media/library.test.js +62 -0
- package/x/logic/presets/media/library.test.js.map +1 -0
- package/x/logic/presets/media/schema.d.ts +10 -1
- package/x/logic/presets/opfs/schema.d.ts +1 -1
- package/x/logic/presets/plain/group.js +2 -2
- package/x/logic/presets/plain/group.js.map +1 -1
- package/x/logic/presets/plain/schema.d.ts +1 -1
- package/x/logic/types.d.ts +1 -1
- package/x/tests.test.js +2 -0
- package/x/tests.test.js.map +1 -1
- package/s/cellar/forklift.ts +0 -9
- package/s/cellar/memory-forklift.ts +0 -29
- package/s/cellar/opfs-forklift.ts +0 -49
- package/x/cellar/forklift.d.ts +0 -7
- package/x/cellar/forklift.js +0 -2
- package/x/cellar/forklift.js.map +0 -1
- package/x/cellar/memory-forklift.d.ts +0 -9
- package/x/cellar/memory-forklift.js +0 -21
- package/x/cellar/memory-forklift.js.map +0 -1
- package/x/cellar/opfs-forklift.d.ts +0 -11
- package/x/cellar/opfs-forklift.js +0 -44
- package/x/cellar/opfs-forklift.js.map +0 -1
- package/x/genius/folio.md +0 -29
- package/x/genius/quay.md +0 -13
- package/x/genius/turbo.md +0 -21
- package/x/importmap.json +0 -47
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {css} from "
|
|
2
|
+
import {css} from "lit"
|
|
3
3
|
export default css`
|
|
4
4
|
|
|
5
5
|
.dropzone {
|
|
@@ -9,16 +9,16 @@ export default css`
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
position: relative;
|
|
12
|
-
border:
|
|
13
|
-
border-radius:
|
|
14
|
-
transition: background
|
|
12
|
+
border: var(--border-width) dashed var(--border-muted);
|
|
13
|
+
border-radius: var(--radius);
|
|
14
|
+
transition: background var(--transition), border-color var(--transition), color var(--transition);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.dz-input {
|
|
18
18
|
width: 100%;
|
|
19
19
|
height: 100%;
|
|
20
|
-
z-index:
|
|
21
|
-
font-size:
|
|
20
|
+
z-index: var(--z-overlay);
|
|
21
|
+
font-size: var(--font-size-sm);
|
|
22
22
|
cursor: pointer;
|
|
23
23
|
opacity: 0;
|
|
24
24
|
|
|
@@ -28,15 +28,15 @@ export default css`
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.dropzone:hover {
|
|
31
|
-
background: var(--
|
|
31
|
+
background: var(--surface-hover);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.dropzone[data-hovering] {
|
|
35
|
-
background: var(--
|
|
36
|
-
border-color: var(--
|
|
35
|
+
background: var(--surface-hover);
|
|
36
|
+
border-color: var(--primary);
|
|
37
37
|
|
|
38
38
|
& .dz-info {
|
|
39
|
-
color: var(--
|
|
39
|
+
color: var(--primary-soft);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -46,9 +46,8 @@ export default css`
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
justify-content: center;
|
|
49
|
-
gap:
|
|
50
|
-
color: var(--
|
|
49
|
+
gap: var(--space-sm);
|
|
50
|
+
color: var(--text-muted);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
`
|
|
54
|
-
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import {html, css} from "lit"
|
|
3
|
+
import {shadowElement, useHost, useStyles} from "@e280/sly"
|
|
4
|
+
|
|
2
5
|
import themeCss from "../../theme.css.js"
|
|
3
6
|
import {findLocalGroup} from "../../utils/find-local-group.js"
|
|
4
7
|
import type SlMenuItem from "@shoelace-style/shoelace/dist/components/menu-item/menu-item.js"
|
|
5
8
|
|
|
6
|
-
export const QuayFilter =
|
|
7
|
-
const
|
|
9
|
+
export const QuayFilter = shadowElement(() => {
|
|
10
|
+
const host = useHost()
|
|
11
|
+
const group = findLocalGroup(host)
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
useStyles(themeCss, css`
|
|
10
14
|
sl-menu {
|
|
11
|
-
margin-top:
|
|
15
|
+
margin-top: var(--space-xs);
|
|
12
16
|
|
|
13
17
|
.item {
|
|
14
18
|
display: flex;
|
|
15
19
|
align-items: center;
|
|
16
|
-
gap:
|
|
20
|
+
gap: var(--space-sm);
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
23
|
`)
|
|
20
24
|
|
|
21
25
|
const onSelectFilter = (e: CustomEvent<{item: SlMenuItem}>) => {
|
|
22
26
|
const value = e.detail.item.value
|
|
23
|
-
group.selectedFilter
|
|
27
|
+
group.selectedFilter(value)
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
return html`
|
|
@@ -33,7 +37,7 @@ export const QuayFilter = shadowComponent(use => {
|
|
|
33
37
|
${[...group.config.filters?.keys()].map(filter => html`
|
|
34
38
|
<sl-menu-item value=${filter}>
|
|
35
39
|
<div class=item>
|
|
36
|
-
<sl-icon name="check" slot="prefix" style="visibility: ${filter === group.selectedFilter
|
|
40
|
+
<sl-icon name="check" slot="prefix" style="visibility: ${filter === group.selectedFilter() ? 'visible' : 'hidden'}"></sl-icon>
|
|
37
41
|
<span>${filter}</span>
|
|
38
42
|
</div>
|
|
39
43
|
</sl-menu-item>
|
|
@@ -42,3 +46,4 @@ export const QuayFilter = shadowComponent(use => {
|
|
|
42
46
|
</sl-dropdown>
|
|
43
47
|
</div>`
|
|
44
48
|
})
|
|
49
|
+
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
import {html
|
|
2
|
+
import {html} from "lit"
|
|
3
|
+
import {shadowElement, useHost, useStyles} from "@e280/sly"
|
|
4
|
+
|
|
3
5
|
import themeCss from "../../theme.css.js"
|
|
4
6
|
import {Tree} from "../../views/tree/component.js"
|
|
5
7
|
import {findLocalGroup} from "../../utils/find-local-group.js"
|
|
6
8
|
|
|
7
|
-
export const QuayOutliner =
|
|
8
|
-
|
|
9
|
-
const
|
|
9
|
+
export const QuayOutliner = shadowElement(() => {
|
|
10
|
+
useStyles(themeCss)
|
|
11
|
+
const host = useHost()
|
|
12
|
+
const group = findLocalGroup(host)
|
|
10
13
|
|
|
11
14
|
return html`
|
|
12
15
|
<div class="panel">
|
|
13
|
-
${Tree(
|
|
16
|
+
${Tree(group)}
|
|
14
17
|
</div>`
|
|
15
18
|
})
|
|
16
19
|
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
|
|
2
|
-
import {html,
|
|
2
|
+
import {html, css} from "lit"
|
|
3
|
+
import {shadowElement, useHost, useStyles} from "@e280/sly"
|
|
4
|
+
|
|
3
5
|
import themeCss from '../../theme.css.js'
|
|
4
6
|
|
|
5
7
|
import {findLocalGroup} from '../../utils/find-local-group.js'
|
|
6
8
|
|
|
7
9
|
const styleCss = css`
|
|
10
|
+
sl-input::part(base) {
|
|
11
|
+
border-radius: var(--radius);
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
sl-input::part(prefix) {
|
|
9
|
-
padding-left:
|
|
15
|
+
padding-left: var(--space-sm);
|
|
10
16
|
}
|
|
11
17
|
`
|
|
12
18
|
|
|
13
|
-
export const QuaySearchbar =
|
|
14
|
-
|
|
15
|
-
const
|
|
19
|
+
export const QuaySearchbar = shadowElement(() => {
|
|
20
|
+
useStyles(themeCss, styleCss)
|
|
21
|
+
const host = useHost()
|
|
22
|
+
const group = findLocalGroup(host)
|
|
16
23
|
|
|
17
24
|
return html`
|
|
18
25
|
<sl-input
|
|
@@ -20,10 +27,9 @@ export const QuaySearchbar = shadowComponent(use => {
|
|
|
20
27
|
pill
|
|
21
28
|
placeholder='Search'
|
|
22
29
|
clearable
|
|
23
|
-
@sl-input=${(e: CustomEvent) => group.searchText
|
|
30
|
+
@sl-input=${(e: CustomEvent) => group.searchText((e.target as HTMLInputElement).value)}
|
|
24
31
|
>
|
|
25
32
|
<sl-icon name='search' slot='prefix'></sl-icon>
|
|
26
33
|
</sl-input>
|
|
27
34
|
`
|
|
28
35
|
})
|
|
29
|
-
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import {html, css} from "lit"
|
|
3
|
+
import {shadowElement, useHost, useStyles} from "@e280/sly"
|
|
4
|
+
|
|
2
5
|
import themeCss from "../../theme.css.js"
|
|
3
6
|
import {findLocalGroup} from "../../utils/find-local-group.js"
|
|
4
7
|
import type SlMenuItem from "@shoelace-style/shoelace/dist/components/menu-item/menu-item.js"
|
|
5
8
|
|
|
6
|
-
export const QuaySort =
|
|
7
|
-
const
|
|
9
|
+
export const QuaySort = shadowElement(() => {
|
|
10
|
+
const host = useHost()
|
|
11
|
+
const group = findLocalGroup(host)
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
useStyles(themeCss, css`
|
|
10
14
|
sl-button sl-icon {
|
|
11
|
-
font-size:
|
|
15
|
+
font-size: var(--font-size-sm);
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
sl-menu {
|
|
15
|
-
margin-top:
|
|
19
|
+
margin-top: var(--space-xs);
|
|
16
20
|
|
|
17
21
|
.item {
|
|
18
22
|
display: flex;
|
|
19
23
|
align-items: center;
|
|
20
|
-
gap:
|
|
24
|
+
gap: var(--space-sm);
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
`)
|
|
24
28
|
|
|
25
29
|
const onSelectSort = (e: CustomEvent<{item: SlMenuItem}>) => {
|
|
26
30
|
const value = e.detail.item.value
|
|
27
|
-
group.selectedSort
|
|
31
|
+
group.selectedSort(value)
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
return html`
|
|
@@ -37,7 +41,7 @@ export const QuaySort = shadowComponent(use => {
|
|
|
37
41
|
${[...group.config.sorts?.keys()].map(sort => html`
|
|
38
42
|
<sl-menu-item value=${sort}>
|
|
39
43
|
<div class=item>
|
|
40
|
-
<sl-icon name="check" slot="prefix" style="visibility: ${sort === group.selectedSort
|
|
44
|
+
<sl-icon name="check" slot="prefix" style="visibility: ${sort === group.selectedSort() ? 'visible' : 'hidden'}"></sl-icon>
|
|
41
45
|
<span>${sort}</span>
|
|
42
46
|
</div>
|
|
43
47
|
</sl-menu-item>
|
package/s/dom/theme.css.ts
CHANGED
|
@@ -1,11 +1,75 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import {css} from "lit"
|
|
2
3
|
export default css`@layer theme, view; @layer theme {
|
|
3
4
|
|
|
5
|
+
:host {
|
|
6
|
+
--surface: var(--quay-surface, #0f0f11);
|
|
7
|
+
--surface-active: var(--quay-surface-hover, var(--sl-color-neutral-0, #fff));
|
|
8
|
+
--surface-hover: var(--quay-surface-hover, var(--sl-color-gray-50, #f8f9fa));
|
|
9
|
+
--surface-selected: var(--quay-surface-selected, rgb(0 0 0 / 40%));
|
|
10
|
+
--border: var(--quay-border, #0d0d0e);
|
|
11
|
+
--border-muted: var(--quay-border, var(--sl-color-neutral-300, #d0d0d0));
|
|
12
|
+
--border-width: 1px;
|
|
13
|
+
--text: var(--quay-text, var(--sl-color-neutral-800, #333));
|
|
14
|
+
--text-muted: var(--quay-muted, var(--sl-color-neutral-700, #555));
|
|
15
|
+
--text-subtle: var(--quay-muted, var(--sl-color-neutral-500, #777));
|
|
16
|
+
--icon: var(--quay-muted, var(--sl-color-neutral-300, #d0d0d0));
|
|
17
|
+
--primary: var(--quay-accent, var(--sl-color-primary-500, #0ea5e9));
|
|
18
|
+
--primary-soft: color-mix(in srgb, var(--primary), white 65%);
|
|
19
|
+
--radius: var(--quay-radius, var(--sl-border-radius-medium, 6px));
|
|
20
|
+
--radius-small: var(--sl-border-radius-small, var(--radius));
|
|
21
|
+
--space-xs: var(--sl-spacing-2x-small, 0.3em);
|
|
22
|
+
--space-sm: var(--sl-spacing-x-small, 0.5rem);
|
|
23
|
+
--space-md: var(--sl-spacing-medium, 1rem);
|
|
24
|
+
--font-size-xs: var(--sl-font-size-x-small, 0.75rem);
|
|
25
|
+
--font-size-sm: var(--sl-font-size-small, 0.85rem);
|
|
26
|
+
--control-height: 30px;
|
|
27
|
+
--control-width: 40px;
|
|
28
|
+
--icon-size: 2rem;
|
|
29
|
+
--z-overlay: 999;
|
|
30
|
+
--transition: 0.2s ease;
|
|
31
|
+
}
|
|
32
|
+
|
|
4
33
|
* {
|
|
5
34
|
margin: 0;
|
|
6
35
|
padding: 0;
|
|
7
36
|
box-sizing: border-box;
|
|
8
37
|
}
|
|
9
38
|
|
|
10
|
-
|
|
39
|
+
sl-button::part(base) {
|
|
40
|
+
border-color: var(--border);
|
|
41
|
+
color: var(--text-muted);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
sl-button:hover::part(base),
|
|
45
|
+
sl-button:focus-within::part(base),
|
|
46
|
+
sl-button:active::part(base) {
|
|
47
|
+
background: var(--surface-hover);
|
|
48
|
+
border-color: var(--border);
|
|
49
|
+
color: var(--text);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
sl-menu-item::part(base) {
|
|
53
|
+
color: var(--text-muted);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
sl-menu-item:hover::part(base),
|
|
57
|
+
sl-menu-item:focus-visible::part(base) {
|
|
58
|
+
background: var(--surface-hover);
|
|
59
|
+
color: var(--text);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
sl-input::part(base) {
|
|
63
|
+
border-color: var(--border);
|
|
64
|
+
color: var(--text);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
sl-input:hover::part(base),
|
|
68
|
+
sl-input:focus-within::part(base) {
|
|
69
|
+
background: var(--surface);
|
|
70
|
+
border-color: var(--border);
|
|
71
|
+
box-shadow: 0 0 0 1px var(--surface-hover);
|
|
72
|
+
color: var(--text);
|
|
73
|
+
}
|
|
11
74
|
|
|
75
|
+
}`
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {html,
|
|
2
|
+
import {html, TemplateResult} from "lit"
|
|
3
|
+
import {shadow, useMount, useRender, useStyles} from "@e280/sly"
|
|
3
4
|
|
|
4
5
|
import styleCss from "./style.css.js"
|
|
5
6
|
import themeCss from "../../theme.css.js"
|
|
@@ -7,14 +8,15 @@ import themeCss from "../../theme.css.js"
|
|
|
7
8
|
import {Group} from "../../../logic/group.js"
|
|
8
9
|
import {CodexItem} from "../../../logic/aspects/codex/parts/codex-item.js"
|
|
9
10
|
|
|
10
|
-
export const Tree =
|
|
11
|
-
|
|
11
|
+
export const Tree = shadow((group: Group) => {
|
|
12
|
+
useStyles(themeCss, styleCss)
|
|
13
|
+
const render = useRender()
|
|
12
14
|
|
|
13
15
|
const {config} = group
|
|
14
16
|
const {dropzone, trail, config: {root}} = group
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
const dispose = group.on.upload.sub(() =>
|
|
18
|
+
useMount(() => {
|
|
19
|
+
const dispose = group.on.upload.sub(() => render())
|
|
18
20
|
return () => dispose()
|
|
19
21
|
})
|
|
20
22
|
|
|
@@ -38,7 +40,7 @@ export const Tree = shadowView(use => (group: Group) => {
|
|
|
38
40
|
${config.renderLabel(item)}
|
|
39
41
|
`
|
|
40
42
|
|
|
41
|
-
const
|
|
43
|
+
const renderTree = (item: CodexItem): TemplateResult => {
|
|
42
44
|
return html`
|
|
43
45
|
<sl-tree-item
|
|
44
46
|
draggable="true"
|
|
@@ -51,14 +53,14 @@ export const Tree = shadowView(use => (group: Group) => {
|
|
|
51
53
|
${item.kind === "folder"
|
|
52
54
|
? renderFolderItem(item)
|
|
53
55
|
: renderItem(item)}
|
|
54
|
-
${group.sort(item.children).map((item) => group.matches(item) ?
|
|
56
|
+
${group.sort(item.children).map((item) => group.matches(item) ? renderTree(item) : null)}
|
|
55
57
|
</sl-tree-item>
|
|
56
58
|
`
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
return html`
|
|
60
62
|
<sl-tree selection=leaf>
|
|
61
|
-
${
|
|
63
|
+
${renderTree(root)}
|
|
62
64
|
</sl-tree>`
|
|
63
65
|
})
|
|
64
66
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {css} from "
|
|
2
|
+
import {css} from "lit"
|
|
3
3
|
export default css`
|
|
4
4
|
|
|
5
5
|
sl-tree-item::part(expand-button) {
|
|
@@ -7,12 +7,12 @@ sl-tree-item::part(expand-button) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
sl-tree-item::part(base) {
|
|
10
|
-
min-height:
|
|
10
|
+
min-height: var(--control-height);
|
|
11
11
|
justify-content: center;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
sl-icon:is(.item) {
|
|
15
|
-
padding:
|
|
15
|
+
padding: var(--space-sm);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
sl-tree-item:not([data-type=folder])::part(expand-button) {
|
|
@@ -35,11 +35,11 @@ sl-tree-item:not([data-type=folder])::part(expand-button) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
sl-tree-item {
|
|
38
|
-
min-height:
|
|
39
|
-
transition: background
|
|
38
|
+
min-height: var(--control-height);
|
|
39
|
+
transition: background var(--transition), border-radius var(--transition);
|
|
40
40
|
|
|
41
41
|
::part(label) {
|
|
42
|
-
gap:
|
|
42
|
+
gap: var(--space-sm);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.folder {
|
|
@@ -49,15 +49,15 @@ sl-tree-item {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
::part(item--selected) {
|
|
52
|
-
background:
|
|
53
|
-
min-height:
|
|
52
|
+
background: var(--surface-selected);
|
|
53
|
+
min-height: var(--control-height);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
sl-tree-item[data-hover] {
|
|
59
|
-
border-radius:
|
|
60
|
-
background:
|
|
59
|
+
border-radius: var(--radius-small);
|
|
60
|
+
background: var(--surface-selected);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
`
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import {collect} from "@e280/stz"
|
|
3
|
+
import {Kv} from "@e280/kv"
|
|
3
4
|
|
|
4
5
|
export type HyId = string
|
|
5
6
|
export type HyItem = {parent: HyId | null, children: HyId[]}
|
|
@@ -27,7 +28,7 @@ export class HyTree {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
async gets(...ids: HyId[]): Promise<(HyItem | undefined)[]> {
|
|
30
|
-
const records = await this.records.
|
|
31
|
+
const records = await this.records.getMany(ids)
|
|
31
32
|
return records.map(r => {
|
|
32
33
|
if (!r) return undefined
|
|
33
34
|
const [parent, children] = r
|
|
@@ -36,13 +37,13 @@ export class HyTree {
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
async require(id: HyId): Promise<HyItem> {
|
|
39
|
-
const record = await this.records.
|
|
40
|
+
const record = await this.records.need(id)
|
|
40
41
|
const [parent, children] = record
|
|
41
42
|
return {parent, children}
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
async requires(...ids: HyId[]): Promise<HyItem[]> {
|
|
45
|
-
const records = await this.records.
|
|
46
|
+
const records = await this.records.needMany(ids)
|
|
46
47
|
return records.map(([parent, children]) => ({parent, children}))
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -73,10 +74,10 @@ export class HyTree {
|
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
// save all new children
|
|
76
|
-
await this.records.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
await this.records.commit([
|
|
78
|
+
...newcomers.map(([id, record]) => this.records.op.set(id, record)),
|
|
79
|
+
this.records.op.set(parent, [parentItem.parent, [...siblings]]),
|
|
80
|
+
])
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
/** detach this id from its parent in the hierarchy */
|
|
@@ -102,7 +103,7 @@ export class HyTree {
|
|
|
102
103
|
await this.detach(id)
|
|
103
104
|
const tree = await collect(this.crawl(id))
|
|
104
105
|
const ids = tree.map(({id}) => id)
|
|
105
|
-
await this.records.
|
|
106
|
+
await this.records.commit(ids.map(id => this.records.op.delete(id)))
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
/** delete absolutely everything */
|
package/s/index.html.ts
CHANGED
|
@@ -1,89 +1,84 @@
|
|
|
1
|
-
import "@
|
|
2
|
-
import {template, html, easypage, headScripts, git_commit_hash, read_file, renderSocialCard, read_json} from "@benev/turtle"
|
|
1
|
+
import {darkreaderDisable, favicon, html, socialCard, template, utf8, viewport} from "@e280/scute"
|
|
3
2
|
|
|
4
3
|
const domain = "quay.e280.org"
|
|
5
|
-
const
|
|
4
|
+
const faviconUrl = "/assets/favicon.png"
|
|
6
5
|
|
|
7
|
-
export default template(async
|
|
8
|
-
const
|
|
9
|
-
const hash = await git_commit_hash()
|
|
10
|
-
const version = (await read_json("package.json")).version as string
|
|
6
|
+
export default template(import.meta.url, async orb => {
|
|
7
|
+
const version = await orb.packageVersion()
|
|
11
8
|
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
return html`
|
|
10
|
+
<!doctype html>
|
|
11
|
+
<html>
|
|
12
|
+
<head>
|
|
13
|
+
${utf8()}
|
|
14
|
+
${viewport()}
|
|
15
|
+
${darkreaderDisable()}
|
|
16
|
+
<title>Quay</title>
|
|
17
|
+
${favicon(faviconUrl)}
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
${socialCard({
|
|
20
|
+
themeColor: "#eb6f1d",
|
|
21
|
+
siteName: domain,
|
|
22
|
+
title: "Quay - File-browser UI Framework",
|
|
23
|
+
description: "Customizable outliner web ui toolkit for nested things",
|
|
24
|
+
image: `https://${domain}${faviconUrl}`,
|
|
25
|
+
url: `https://${domain}/`,
|
|
26
|
+
})}
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
prodModulePath: await path.version.root("demo/main.bundle.min.js"),
|
|
33
|
-
importmapContent: await read_file("x/importmap.json"),
|
|
34
|
-
})}
|
|
28
|
+
<link rel="stylesheet" href="${orb.hashurl("demo/main.css")}"/>
|
|
29
|
+
<script type="module" src="${orb.hashurl("demo/main.bundle.min.js")}"></script>
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
31
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/themes/dark.css"/>
|
|
32
|
+
<!-- loading every shoelace component for now (should be cherry picked instead) -->
|
|
33
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.0/cdn/shoelace.js"></script>
|
|
34
|
+
</head>
|
|
35
|
+
<body>
|
|
36
|
+
<header class=title>
|
|
37
|
+
<img alt="" src="/assets/favicon.png"/>
|
|
38
|
+
<div>
|
|
39
|
+
<h1>Quay</h1>
|
|
40
|
+
<span class=version>v${version}</span>
|
|
41
|
+
</div>
|
|
42
|
+
</header>
|
|
48
43
|
|
|
49
|
-
|
|
44
|
+
<div class=components>
|
|
45
|
+
<div class="component dropzone">
|
|
46
|
+
<h4>quay-dropzone</h4>
|
|
47
|
+
<quay-dropzone></quay-dropzone>
|
|
48
|
+
</div>
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
<div class="component outliner">
|
|
51
|
+
<h4>quay-outliner</h4>
|
|
52
|
+
<quay-outliner></quay-outliner>
|
|
53
|
+
</div>
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<div class="component searchbar">
|
|
62
|
-
<h4>quay-searchbar</h2>
|
|
63
|
-
<quay-searchbar></quay-searchbar>
|
|
64
|
-
</div>
|
|
55
|
+
<div class="component searchbar">
|
|
56
|
+
<h4>quay-searchbar</h4>
|
|
57
|
+
<quay-searchbar></quay-searchbar>
|
|
58
|
+
</div>
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
<div class="component breadcrumb">
|
|
61
|
+
<h4>quay-breadcrumb</h4>
|
|
62
|
+
<quay-breadcrumb></quay-breadcrumb>
|
|
63
|
+
</div>
|
|
70
64
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
<div class="component filter">
|
|
66
|
+
<h4>quay-filter</h4>
|
|
67
|
+
<quay-filter></quay-filter>
|
|
68
|
+
</div>
|
|
75
69
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
<div class="component sort">
|
|
71
|
+
<h4>quay-sort</h4>
|
|
72
|
+
<quay-sort></quay-sort>
|
|
73
|
+
</div>
|
|
80
74
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
<div class="component browser">
|
|
76
|
+
<h4>quay-browser</h4>
|
|
77
|
+
<quay-browser></quay-browser>
|
|
78
|
+
</div>
|
|
84
79
|
</div>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
})
|
|
80
|
+
</body>
|
|
81
|
+
</html>
|
|
82
|
+
`
|
|
89
83
|
})
|
|
84
|
+
|
package/s/index.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
export {
|
|
2
|
+
export {css} from "lit"
|
|
3
|
+
export {dom} from "@e280/sly"
|
|
3
4
|
|
|
4
5
|
export * from "./cellar/index.js"
|
|
5
6
|
|
|
6
7
|
export * from "./dom/components.js"
|
|
8
|
+
export {brain} from "./dom/context.js"
|
|
9
|
+
export * from "./logic/presets/media/schema.js"
|
|
10
|
+
export * from "./logic/presets/media/group.js"
|
|
11
|
+
export * from "./logic/presets/media/library.js"
|
|
7
12
|
import {Permissions} from "./logic/permissions.js"
|
|
8
13
|
|
|
9
14
|
const Quay = {
|
|
@@ -29,18 +29,18 @@ export class Codex<Sc extends Schema> {
|
|
|
29
29
|
this.clade.setSpecimen(id, kind, specimen)
|
|
30
30
|
const item = new CodexItem(this, id)
|
|
31
31
|
this.#items.set(id, item)
|
|
32
|
-
return item.signal
|
|
32
|
+
return item.signal()
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/** add an item to the hierachy as a root root */
|
|
36
36
|
root<I extends CodexItem<Sc>>(item: I) {
|
|
37
37
|
this.hierarchy.establishRoot(item.id)
|
|
38
|
-
return item.signal
|
|
38
|
+
return item.signal()
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/** get an item by its id */
|
|
42
42
|
require(id: Id): CodexItem<Sc> {
|
|
43
|
-
return this.#items.require(id).signal
|
|
43
|
+
return this.#items.require(id).signal()
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|