@alstar/studio 0.0.0-beta.4 → 0.0.0-beta.6

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.
Files changed (43) hide show
  1. package/api/api-key.ts +74 -0
  2. package/api/block.ts +39 -21
  3. package/api/index.ts +9 -1
  4. package/api/mcp.ts +53 -0
  5. package/bin/alstar.ts +42 -0
  6. package/components/{AdminPanel/AdminPanel.ts → AdminPanel.ts} +22 -27
  7. package/components/Block.ts +51 -112
  8. package/components/Entries.ts +17 -10
  9. package/components/Entry.ts +9 -15
  10. package/components/Settings.ts +98 -0
  11. package/components/fields/Blocks.ts +118 -0
  12. package/components/fields/Text.ts +42 -0
  13. package/components/fields/index.ts +4 -0
  14. package/components/icons.ts +97 -0
  15. package/components/index.ts +1 -1
  16. package/components/layout.ts +8 -5
  17. package/index.ts +48 -20
  18. package/package.json +2 -1
  19. package/public/admin-panel.css +90 -0
  20. package/public/blocks.css +53 -0
  21. package/public/main.css +11 -1
  22. package/public/main.js +4 -0
  23. package/public/settings.css +24 -0
  24. package/queries/block-with-children.ts +74 -0
  25. package/queries/block.ts +287 -0
  26. package/queries/db-types.ts +15 -0
  27. package/queries/getBlockTrees-2.ts +0 -0
  28. package/queries/getBlockTrees.ts +316 -0
  29. package/queries/getBlocks.ts +214 -0
  30. package/queries/index.ts +2 -98
  31. package/queries/structure-types.ts +97 -0
  32. package/schemas.ts +15 -54
  33. package/types.ts +95 -5
  34. package/utils/buildBlocksTree.ts +4 -4
  35. package/utils/define.ts +21 -5
  36. package/utils/file-based-router.ts +9 -1
  37. package/utils/get-config.ts +8 -9
  38. package/utils/get-or-create-row.ts +28 -0
  39. package/utils/startup-log.ts +9 -0
  40. package/components/AdminPanel/AdminPanel.css +0 -59
  41. package/components/Field.ts +0 -164
  42. package/components/Fields.ts +0 -43
  43. /package/{components/Entry.css → public/entry.css} +0 -0
@@ -1,43 +0,0 @@
1
- import { html } from 'hono/html'
2
- import { type Block } from '../types.ts'
3
- import { type HtmlEscapedString } from 'hono/utils/html'
4
- import Field from './Field.ts'
5
- import {
6
- buildStructurePath,
7
- type StructurePath,
8
- } from '../utils/build-structure-path.ts'
9
-
10
- const Fields = (props: {
11
- entryId: string | number
12
- parentId: string | number
13
- blockStructure: Block
14
- structurePath: StructurePath
15
- }): HtmlEscapedString | Promise<HtmlEscapedString> => {
16
- const updatedPath = buildStructurePath(
17
- props.blockStructure,
18
- props.structurePath,
19
- )
20
-
21
- return html`
22
- <div class="fields">
23
- ${props.blockStructure.fields
24
- ? props.blockStructure.fields?.map((field, idx) => {
25
- return Field({
26
- entryId: props.entryId,
27
- parentId: props.parentId,
28
- blockStructure: field,
29
- sortOrder: idx,
30
- structurePath: [...updatedPath, 'fields'],
31
- })
32
- })
33
- : Field({
34
- entryId: props.entryId,
35
- parentId: props.parentId,
36
- blockStructure: props.blockStructure,
37
- structurePath: updatedPath,
38
- })}
39
- </div>
40
- `
41
- }
42
-
43
- export default Fields
File without changes