@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.
@@ -95,7 +95,7 @@ export default () => {
95
95
  </dialog>
96
96
  </article>
97
97
 
98
- ${Backup()}
98
+ <!-- {Backup()} -->
99
99
  </div>
100
100
  `
101
101
  }
@@ -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.8",
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.2",
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
- connectedCallback() {
7
- if (!this.children.length) return
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
 
@@ -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 './entry.css';
5
- @import './blocks.css';
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;
@@ -1,10 +1,9 @@
1
1
  import barba from '@barba/core'
2
2
 
3
+ import './js/markdown-editor.js'
4
+ import './js/sortable-list.js'
5
+
3
6
  barba.init({
4
7
  cacheIgnore: true,
5
- views: [
6
- {
7
- namespace: 'default',
8
- },
9
- ],
8
+ views: [{ namespace: 'default' }],
10
9
  })
@@ -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
  }
@@ -1,7 +0,0 @@
1
- .entry {
2
- form {
3
- display: flex;
4
- flex-direction: column;
5
- align-items: flex-start;
6
- }
7
- }