@alstar/studio 0.0.0-beta.8 → 0.0.0-beta.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/components/Settings.ts +1 -1
- package/components/SiteLayout.ts +1 -4
- package/index.ts +2 -2
- package/package.json +2 -2
- package/public/studio/{sortable-list.js → js/sortable-list.js} +12 -2
- package/public/studio/main.css +3 -4
- package/public/studio/main.js +4 -5
- package/utils/startup-log.ts +2 -1
- package/public/studio/entry.css +0 -7
- /package/public/studio/{admin-panel.css → css/admin-panel.css} +0 -0
- /package/public/studio/{blocks.css → css/blocks-field.css} +0 -0
- /package/public/studio/{settings.css → css/settings.css} +0 -0
- /package/public/studio/{markdown-editor.js → js/markdown-editor.js} +0 -0
package/components/Settings.ts
CHANGED
package/components/SiteLayout.ts
CHANGED
|
@@ -25,8 +25,6 @@ export default (props: {
|
|
|
25
25
|
|
|
26
26
|
<meta name="color-scheme" content="light dark" />
|
|
27
27
|
|
|
28
|
-
<link rel="stylesheet" href="/studio/main.css" />
|
|
29
|
-
|
|
30
28
|
<script
|
|
31
29
|
type="module"
|
|
32
30
|
src="https://cdn.jsdelivr.net/gh/starfederation/datastar@main/bundles/datastar.js"
|
|
@@ -42,9 +40,8 @@ export default (props: {
|
|
|
42
40
|
}
|
|
43
41
|
</script>
|
|
44
42
|
|
|
45
|
-
<script src="/studio/markdown-editor.js" type="module"></script>
|
|
46
|
-
<script src="/studio/sortable-list.js" type="module"></script>
|
|
47
43
|
<script src="/studio/main.js" type="module"></script>
|
|
44
|
+
<link href="/studio/main.css" rel="stylesheet" />
|
|
48
45
|
</head>
|
|
49
46
|
|
|
50
47
|
<body data-barba="wrapper">
|
package/index.ts
CHANGED
|
@@ -23,7 +23,7 @@ export let studioConfig: types.StudioConfig = {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const createStudio = async (config: types.StudioConfig) => {
|
|
26
|
-
createRefresher({ rootdir: '.' })
|
|
26
|
+
const refresher = await createRefresher({ rootdir: '.' })
|
|
27
27
|
|
|
28
28
|
loadDb('./studio.db')
|
|
29
29
|
createStudioTables()
|
|
@@ -84,7 +84,7 @@ const createStudio = async (config: types.StudioConfig) => {
|
|
|
84
84
|
})
|
|
85
85
|
})
|
|
86
86
|
|
|
87
|
-
startupLog({ port: studioConfig.port || 3000 })
|
|
87
|
+
startupLog({ port: studioConfig.port || 3000, refresherPort: refresher.port })
|
|
88
88
|
|
|
89
89
|
return app
|
|
90
90
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alstar/studio",
|
|
3
|
-
"version": "0.0.0-beta.
|
|
3
|
+
"version": "0.0.0-beta.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@hono/node-server": "^1.18.1",
|
|
8
8
|
"@starfederation/datastar-sdk": "1.0.0-RC.1",
|
|
9
9
|
"hono": "^4.8.12",
|
|
10
|
-
"@alstar/refresher": "0.0.0-beta.
|
|
10
|
+
"@alstar/refresher": "0.0.0-beta.3",
|
|
11
11
|
"@alstar/ui": "0.0.0-beta.1",
|
|
12
12
|
"@alstar/db": "0.0.0-beta.1"
|
|
13
13
|
},
|
|
@@ -3,8 +3,10 @@ import Sortable from 'sortablejs'
|
|
|
3
3
|
class SortableList extends HTMLElement {
|
|
4
4
|
instance = null
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
mutationObserver
|
|
7
|
+
|
|
8
|
+
init() {
|
|
9
|
+
if (this.instance || !this.children.length) return
|
|
8
10
|
|
|
9
11
|
const { id } = this.dataset
|
|
10
12
|
|
|
@@ -32,8 +34,16 @@ class SortableList extends HTMLElement {
|
|
|
32
34
|
})
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
this.mutationObserver = new MutationObserver(this.init.bind(this))
|
|
39
|
+
this.mutationObserver.observe(this, { childList: true })
|
|
40
|
+
|
|
41
|
+
this.init()
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
disconnectedCallback() {
|
|
36
45
|
this.instance?.destroy()
|
|
46
|
+
this.mutationObserver?.disconnect()
|
|
37
47
|
}
|
|
38
48
|
}
|
|
39
49
|
|
package/public/studio/main.css
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/* @import './../node_modules/@alstar/ui/red.css'; */
|
|
2
2
|
@import 'https://esm.sh/@alstar/ui/red.css';
|
|
3
|
-
@import './admin-panel.css';
|
|
4
|
-
@import './
|
|
5
|
-
@import './
|
|
6
|
-
@import './settings.css';
|
|
3
|
+
@import './css/admin-panel.css';
|
|
4
|
+
@import './css/blocks-field.css';
|
|
5
|
+
@import './css/settings.css';
|
|
7
6
|
|
|
8
7
|
body {
|
|
9
8
|
padding: 0;
|
package/public/studio/main.js
CHANGED
package/utils/startup-log.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import packageJSON from '../package.json' with { type: 'json' }
|
|
2
2
|
|
|
3
|
-
export default ({ port }: { port: number }) => {
|
|
3
|
+
export default ({ port, refresherPort }: { port: number, refresherPort: number }) => {
|
|
4
4
|
console.log('\x1b[32m%s\x1b[0m', '╭───────────────────────╮')
|
|
5
5
|
console.log('\x1b[32m%s\x1b[0m', '│ Alstar Studio │')
|
|
6
6
|
console.log('\x1b[32m%s\x1b[0m', `│ ${packageJSON.version}${' '.repeat(22 - packageJSON.version.length)}│`)
|
|
7
7
|
console.log('\x1b[32m%s\x1b[0m', `│ http://localhost:${port} │`)
|
|
8
|
+
console.log('\x1b[32m%s\x1b[0m', `│ Refresher port: ${refresherPort} │`)
|
|
8
9
|
console.log('\x1b[32m%s\x1b[0m', '╰───────────────────────╯')
|
|
9
10
|
}
|
package/public/studio/entry.css
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|