@e280/quay 0.0.0-2 → 0.0.0-9
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 +28 -0
- package/package.json +13 -10
- 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 +1 -1
- package/s/dom/components/dropzone/component.ts +6 -4
- package/s/dom/components/dropzone/style.css.ts +1 -1
- package/s/dom/components/filter/component.ts +11 -6
- package/s/dom/components/outliner/component.ts +8 -5
- package/s/dom/components/searchbar/component.ts +8 -5
- package/s/dom/components/sort/component.ts +10 -6
- package/s/dom/theme.css.ts +2 -1
- package/s/dom/views/tree/component.ts +10 -8
- package/s/dom/views/tree/style.css.ts +1 -1
- 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/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 +7 -7
- package/s/logic/presets/media/group.ts +5 -4
- package/s/logic/presets/media/schema.ts +4 -1
- package/s/logic/presets/media/store.test.ts +41 -0
- package/s/logic/presets/media/store.ts +163 -0
- 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/demo/main.bundle.js +2 -2
- package/x/demo/main.bundle.js.map +1 -1
- package/x/demo/main.bundle.min.js +105 -142
- 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 +1 -1
- 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 +1 -1
- 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 +8 -6
- 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 +7 -5
- 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 +8 -6
- 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 +1 -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 +1 -1
- package/x/dom/views/tree/style.css.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/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 +4 -4
- package/x/logic/group.js +6 -6
- 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/schema.d.ts +4 -1
- package/x/logic/presets/media/store.d.ts +92 -0
- package/x/logic/presets/media/store.js +129 -0
- package/x/logic/presets/media/store.js.map +1 -0
- package/x/logic/presets/media/store.test.d.ts +7 -0
- package/x/logic/presets/media/store.test.js +31 -0
- package/x/logic/presets/media/store.test.js.map +1 -0
- 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/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
package/README.md
CHANGED
|
@@ -115,3 +115,31 @@ new Quay.Brain({
|
|
|
115
115
|
|
|
116
116
|
In this way, you can setup sophisticated rules about what actions are permitted, and under whatever changing circumstances.
|
|
117
117
|
|
|
118
|
+
<br/>
|
|
119
|
+
|
|
120
|
+
## MediaStore
|
|
121
|
+
|
|
122
|
+
`MediaStore` is a small persistent media-bin preset.
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import {MediaStore, brain, register, components} from "@e280/quay"
|
|
126
|
+
|
|
127
|
+
const media = await MediaStore.open("my-project")
|
|
128
|
+
brain.setGroup("media", media)
|
|
129
|
+
|
|
130
|
+
register(components)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<div group="media">
|
|
135
|
+
<quay-dropzone></quay-dropzone>
|
|
136
|
+
<quay-browser></quay-browser>
|
|
137
|
+
</div>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The scope passed to `open()` separates media libraries.
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
const projectA = await MediaStore.open("project-a")
|
|
144
|
+
const projectB = await MediaStore.open("project-b")
|
|
145
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e280/quay",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-9",
|
|
4
4
|
"description": "File-browser and outliner UI for the web",
|
|
5
5
|
"author": "Przemysław Gałęzki",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,28 +11,31 @@
|
|
|
11
11
|
"s"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@benev/slate": "^0.3.5",
|
|
15
14
|
"@e280/kv": "^0.0.0-7",
|
|
16
|
-
"@e280/
|
|
15
|
+
"@e280/scute": "^0.4.0-next.4",
|
|
16
|
+
"@e280/sly": "^0.4.0-next.5",
|
|
17
|
+
"@e280/strata": "^0.4.0-next.8",
|
|
18
|
+
"@e280/stz": "^0.0.0-22",
|
|
19
|
+
"lit": "^3.3.1"
|
|
17
20
|
},
|
|
18
21
|
"devDependencies": {
|
|
19
|
-
"@
|
|
22
|
+
"@e280/hottie": "^0.1.1",
|
|
20
23
|
"@e280/science": "^0.0.5",
|
|
21
24
|
"@shoelace-style/shoelace": "^2.20.1",
|
|
22
|
-
"http-server": "^14.1.1",
|
|
23
25
|
"npm-run-all": "^4.1.5",
|
|
24
26
|
"typescript": "^5.8.3"
|
|
25
27
|
},
|
|
26
28
|
"scripts": {
|
|
27
29
|
"build": "rm -rf x && mkdir x && run-s _code _ssg _ln",
|
|
28
|
-
"start": "run-p _http
|
|
30
|
+
"start": "run-p _http _tscwatch _scutewatch",
|
|
29
31
|
"test": "node x/tests.test.js",
|
|
30
32
|
"test-watch": "node --watch x/tests.test.js",
|
|
31
33
|
"test-inspect": "node inspect x/tests.test.js",
|
|
32
|
-
"_code": "
|
|
33
|
-
"_ssg": "
|
|
34
|
-
"_http": "
|
|
35
|
-
"
|
|
34
|
+
"_code": "tsc",
|
|
35
|
+
"_ssg": "scute --in=s,x --out=x",
|
|
36
|
+
"_http": "hottie x",
|
|
37
|
+
"_tscwatch": "tsc -w",
|
|
38
|
+
"_scutewatch": "scute --in=s,x --out=x -vw",
|
|
36
39
|
"_ln": "run-s _ln:s _ln:assets",
|
|
37
40
|
"_ln:s": "ln -s \"$(realpath s)\" x/s",
|
|
38
41
|
"_ln:assets": "ln -s \"$(realpath assets)\" x/assets",
|
package/s/demo/main.bundle.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import {dom} from "@e280/sly"
|
|
3
3
|
import {brain} from "../dom/context.js"
|
|
4
4
|
import {MediaGroup} from "../logic/presets/media/group.js"
|
|
5
5
|
import {MediaFormat} from "../logic/presets/media/schema.js"
|
|
@@ -35,5 +35,4 @@ group.on.upload.sub(({files, target}) => {
|
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
setShoelaceDarkTheme()
|
|
38
|
-
register(components)
|
|
39
|
-
|
|
38
|
+
dom.register(components)
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
import {html
|
|
2
|
+
import {html} from "lit"
|
|
3
|
+
import {shadowElement, useHost, useStyles} from "@e280/sly"
|
|
3
4
|
|
|
4
5
|
import themeCss from "../../theme.css.js"
|
|
5
6
|
|
|
6
7
|
import {findLocalGroup} from "../../utils/find-local-group.js"
|
|
7
8
|
import {CodexItem} from "../../../logic/aspects/codex/parts/codex-item.js"
|
|
8
9
|
|
|
9
|
-
export const QuayBreadcrumb =
|
|
10
|
-
|
|
10
|
+
export const QuayBreadcrumb = shadowElement(() => {
|
|
11
|
+
useStyles(themeCss)
|
|
11
12
|
|
|
12
|
-
const group = findLocalGroup(
|
|
13
|
+
const group = findLocalGroup(useHost())
|
|
13
14
|
const {trail, config: {codex, renderLabel}} = group
|
|
14
15
|
|
|
15
16
|
const click = (item: CodexItem) => (e: Event) => group.trail.setTrail(e, item)
|
|
16
17
|
|
|
17
18
|
return html`
|
|
18
19
|
<sl-breadcrumb>
|
|
19
|
-
${trail.signal.
|
|
20
|
+
${trail.signal().map(item => html`
|
|
20
21
|
<sl-breadcrumb-item @click="${click(item)}">
|
|
21
22
|
${item === null
|
|
22
23
|
? "root"
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import {html} from "lit"
|
|
3
|
+
import {shadowElement, useHost, useMount, useRender, useState, useStyles} from "@e280/sly"
|
|
2
4
|
|
|
3
5
|
import styleCss from "./style.css.js"
|
|
4
6
|
import themeCss from "../../theme.css.js"
|
|
@@ -6,15 +8,17 @@ import themeCss from "../../theme.css.js"
|
|
|
6
8
|
import {findLocalGroup} from "../../utils/find-local-group.js"
|
|
7
9
|
import {CodexItem} from "../../../logic/aspects/codex/parts/codex-item.js"
|
|
8
10
|
|
|
9
|
-
export const QuayBrowser =
|
|
10
|
-
|
|
11
|
+
export const QuayBrowser = shadowElement(() => {
|
|
12
|
+
useStyles(themeCss, styleCss)
|
|
13
|
+
const host = useHost()
|
|
14
|
+
const render = useRender()
|
|
11
15
|
|
|
12
|
-
const group = findLocalGroup(
|
|
16
|
+
const group = findLocalGroup(host)
|
|
13
17
|
const {trail, config} = group
|
|
14
|
-
const [viewMode, setViewMode] =
|
|
18
|
+
const [viewMode, setViewMode] = useState<'details' | 'tiles'>('tiles')
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
const dispose = group.on.upload.sub(() =>
|
|
20
|
+
useMount(() => {
|
|
21
|
+
const dispose = group.on.upload.sub(() => render())
|
|
18
22
|
return () => dispose()
|
|
19
23
|
})
|
|
20
24
|
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
import {html
|
|
2
|
+
import {html} from "lit"
|
|
3
|
+
import {shadowElement, useHost, useStyles} from "@e280/sly"
|
|
3
4
|
|
|
4
5
|
import styleCss from "./style.css.js"
|
|
5
6
|
import themeCss from "../../theme.css.js"
|
|
6
7
|
|
|
7
8
|
import {findLocalGroup} from "../../utils/find-local-group.js"
|
|
8
9
|
|
|
9
|
-
export const QuayDropzone =
|
|
10
|
-
|
|
10
|
+
export const QuayDropzone = shadowElement(() => {
|
|
11
|
+
useStyles(themeCss, styleCss)
|
|
12
|
+
const host = useHost()
|
|
11
13
|
|
|
12
|
-
const group = findLocalGroup(
|
|
14
|
+
const group = findLocalGroup(host)
|
|
13
15
|
const {dropzone, config: {root}} = group
|
|
14
16
|
|
|
15
17
|
return html`
|
|
@@ -1,12 +1,16 @@
|
|
|
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
15
|
margin-top: 0.3em;
|
|
12
16
|
|
|
@@ -20,7 +24,7 @@ export const QuayFilter = shadowComponent(use => {
|
|
|
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,5 +1,7 @@
|
|
|
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'
|
|
@@ -10,9 +12,10 @@ const styleCss = css`
|
|
|
10
12
|
}
|
|
11
13
|
`
|
|
12
14
|
|
|
13
|
-
export const QuaySearchbar =
|
|
14
|
-
|
|
15
|
-
const
|
|
15
|
+
export const QuaySearchbar = shadowElement(() => {
|
|
16
|
+
useStyles(themeCss, styleCss)
|
|
17
|
+
const host = useHost()
|
|
18
|
+
const group = findLocalGroup(host)
|
|
16
19
|
|
|
17
20
|
return html`
|
|
18
21
|
<sl-input
|
|
@@ -20,7 +23,7 @@ export const QuaySearchbar = shadowComponent(use => {
|
|
|
20
23
|
pill
|
|
21
24
|
placeholder='Search'
|
|
22
25
|
clearable
|
|
23
|
-
@sl-input=${(e: CustomEvent) => group.searchText
|
|
26
|
+
@sl-input=${(e: CustomEvent) => group.searchText((e.target as HTMLInputElement).value)}
|
|
24
27
|
>
|
|
25
28
|
<sl-icon name='search' slot='prefix'></sl-icon>
|
|
26
29
|
</sl-input>
|
|
@@ -1,12 +1,16 @@
|
|
|
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
15
|
font-size: 14px;
|
|
12
16
|
}
|
|
@@ -24,7 +28,7 @@ export const QuaySort = shadowComponent(use => {
|
|
|
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,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
|
|
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/store.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
|
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
import "@benev/slate/x/node.js"
|
|
3
|
-
import {repeat_string} from "@benev/turtle"
|
|
4
|
-
|
|
5
2
|
import {Codex} from "./codex.js"
|
|
6
3
|
import {AsSchema, Taxon} from "./parts/types.js"
|
|
7
4
|
|
|
@@ -48,7 +45,7 @@ src
|
|
|
48
45
|
// we can crawl any folder!
|
|
49
46
|
// 👇
|
|
50
47
|
for (const [item, ancestors] of folder.crawl()) {
|
|
51
|
-
const indent =
|
|
48
|
+
const indent = " ".repeat(ancestors.length)
|
|
52
49
|
const specimen = item.specimen
|
|
53
50
|
const label = item.kind === "folder"
|
|
54
51
|
? specimen.label + "/"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import {signal} from "@
|
|
2
|
+
import {signal} from "@e280/strata"
|
|
3
3
|
import {Codex} from "../codex.js"
|
|
4
4
|
import {Id, Kind, Schema} from "./types.js"
|
|
5
5
|
|
|
@@ -52,14 +52,14 @@ export class CodexItem<Sc extends Schema = any, K extends Kind<Sc> = Kind<Sc>> {
|
|
|
52
52
|
/** add items as children */
|
|
53
53
|
attach(...items: CodexItem<Sc>[]) {
|
|
54
54
|
this.codex.hierarchy.attach(this.id, ...items.map(i => i.id))
|
|
55
|
-
this.signal
|
|
55
|
+
this.signal(this)
|
|
56
56
|
return this
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/** detach this item from the hierarchy completely */
|
|
60
60
|
detach() {
|
|
61
61
|
this.codex.hierarchy.detach(this.id)
|
|
62
|
-
this.signal
|
|
62
|
+
this.signal(this)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/** create a new item that will be a child */
|
|
@@ -72,7 +72,7 @@ export class CodexItem<Sc extends Schema = any, K extends Kind<Sc> = Kind<Sc>> {
|
|
|
72
72
|
/** create a new item that will be a child */
|
|
73
73
|
destroy() {
|
|
74
74
|
this.codex.hierarchy.destroy(this.id)
|
|
75
|
-
this.signal
|
|
75
|
+
this.signal(this)
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/** iterate over this item and all its descendants */
|