@brightsideoy/kama 0.1.0-alpha.113 → 0.1.0-alpha.115

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 (60) hide show
  1. package/bin/cli.js +172 -379
  2. package/content/definitions/blocks/button.yaml +7 -8
  3. package/content/definitions/blocks/header.yaml +7 -9
  4. package/content/definitions/blocks/header_image.yaml +14 -15
  5. package/content/definitions/blocks/hero.yaml +22 -21
  6. package/content/definitions/blocks/image_card.yaml +46 -47
  7. package/content/definitions/blocks/single_image.yaml +19 -20
  8. package/content/definitions/blocks/text.yaml +8 -9
  9. package/content/definitions/channels/ecommerce.yaml +14 -16
  10. package/content/definitions/channels/website.yaml +20 -21
  11. package/content/definitions/field-sets/access.yaml +3 -5
  12. package/content/definitions/field-sets/channel-base.yaml +25 -25
  13. package/content/definitions/field-sets/content-block.yaml +36 -41
  14. package/content/definitions/field-sets/page-base.yaml +40 -45
  15. package/content/definitions/field-sets/page-meta.yaml +1 -4
  16. package/content/definitions/field-sets/page-social.yaml +6 -8
  17. package/content/definitions/field-sets/tree-base.yaml +25 -25
  18. package/content/definitions/nodes/address.yaml +29 -21
  19. package/content/definitions/nodes/article.yaml +24 -19
  20. package/content/definitions/nodes/event.yaml +32 -26
  21. package/content/definitions/nodes/external-link.yaml +20 -17
  22. package/content/definitions/nodes/page.yaml +38 -35
  23. package/content/definitions/nodes/person.yaml +29 -27
  24. package/content/definitions/nodes/product.yaml +52 -49
  25. package/content/definitions/trees/navigation.yaml +26 -21
  26. package/content/definitions/trees/social-links.yaml +5 -2
  27. package/dist/assets/index-8T39DEP3.js +162 -0
  28. package/dist/assets/index-B9oh2_TL.css +1 -0
  29. package/dist/index.html +2 -2
  30. package/dist/index.js +6492 -4249
  31. package/package.json +5 -6
  32. package/schema.sql +5 -13
  33. package/templates/astro-starter/astro.config.mjs +40 -0
  34. package/templates/astro-starter/package.json.template +20 -0
  35. package/templates/astro-starter/src/components/blocks/BlockRenderer.astro +125 -0
  36. package/templates/astro-starter/src/components/blocks/ColumnLayout.astro +66 -0
  37. package/templates/astro-starter/src/components/blocks/HeaderImage.astro +131 -0
  38. package/templates/astro-starter/src/components/blocks/Hero.astro +218 -0
  39. package/templates/astro-starter/src/components/blocks/ImageBlock.astro +160 -0
  40. package/templates/astro-starter/src/components/blocks/TextBlock.astro +13 -0
  41. package/templates/astro-starter/src/components/global/Breadcrumb.astro +62 -0
  42. package/templates/astro-starter/src/components/global/Footer.astro +48 -0
  43. package/templates/astro-starter/src/components/global/Header.astro +92 -0
  44. package/templates/astro-starter/src/components/global/NavigationMenu.astro +450 -0
  45. package/templates/astro-starter/src/components/ui/KamaImage.astro +148 -0
  46. package/templates/astro-starter/src/kama-image-service.ts +41 -0
  47. package/templates/astro-starter/src/layouts/Layout.astro +280 -0
  48. package/templates/astro-starter/src/lib/cms.ts +149 -0
  49. package/templates/astro-starter/src/lib/media-url.ts +34 -0
  50. package/templates/astro-starter/src/middleware.ts +306 -0
  51. package/templates/astro-starter/src/pages/404.astro +46 -0
  52. package/templates/astro-starter/src/pages/[...slug].astro +234 -0
  53. package/templates/astro-starter/src/pages/media/[...path].ts +113 -0
  54. package/templates/astro-starter/tsconfig.json +0 -0
  55. package/test-local.sh +76 -0
  56. package/dist/assets/index-10GEw0KY.css +0 -1
  57. package/dist/assets/index-THJ6BqPP.js +0 -1394
  58. package/kama-worker/bundled-definitions.js +0 -2394
  59. package/kama-worker/bundled-definitions.ts +0 -2395
  60. package/scripts/bundle-definitions.js +0 -224
@@ -1,6 +1,4 @@
1
- tab:
2
- id: page-social
3
- label: "Social"
1
+ label: "Social"
4
2
 
5
3
  fields:
6
4
  # --- Facebook / Open Graph Texts ---
@@ -14,7 +12,7 @@ fields:
14
12
  fbDescription:
15
13
  label: "Facebook Description (og:description)"
16
14
  type: textarea
17
- inherits: metaDescription # 🔗 Or whatever your main SEO description field is named
15
+ inherits: metaDescription # 🔗 Syncs from main SEO description
18
16
  public: true
19
17
  description: "A 2-4 sentence summary of the content."
20
18
 
@@ -22,7 +20,7 @@ fields:
22
20
  xTitle:
23
21
  label: "X Title (twitter:title)"
24
22
  type: text
25
- inherits: fbTitle # 🔗 Cascades from Facebook Title (which cascades from SEO)
23
+ inherits: fbTitle # 🔗 Cascades from Facebook Title
26
24
  public: true
27
25
  description: "Keep it concise (under 70 characters is ideal for X)."
28
26
 
@@ -51,7 +49,7 @@ fields:
51
49
  label: "Facebook / LinkedIn Image"
52
50
  type: image
53
51
  maxPreviewWidth: 620px
54
- inherits: socialImage # 🔗 Syncs from socialImage
52
+ inherits: socialImage
55
53
  public: true
56
54
  description: "Auto-cropped to 1.91:1. Drop a new image here to override."
57
55
  crops:
@@ -61,7 +59,7 @@ fields:
61
59
  label: "X (Twitter) Image"
62
60
  type: image
63
61
  maxPreviewWidth: 620px
64
- inherits: socialImage # 🔗 Syncs from socialImage
62
+ inherits: socialImage
65
63
  public: true
66
64
  description: "Auto-cropped to 2:1. Drop a new image here to override."
67
65
  crops:
@@ -71,7 +69,7 @@ fields:
71
69
  label: "Messaging / Square Image"
72
70
  type: image
73
71
  maxPreviewWidth: 620px
74
- inherits: socialImage # 🔗 Syncs from socialImage
72
+ inherits: socialImage
75
73
  public: true
76
74
  description: "Auto-cropped to 1:1. Drop a new image here to override."
77
75
  crops:
@@ -2,30 +2,30 @@ id: tree-base
2
2
  label: Tree Base Properties
3
3
 
4
4
  fields:
5
- - id:
6
- label: Internal ID
7
- type: hidden
8
- dbType: integer
9
- primaryKey: true
5
+ id:
6
+ label: Internal ID
7
+ type: hidden
8
+ dbType: integer
9
+ primaryKey: true
10
10
 
11
- - label:
12
- label: "Label"
13
- type: text
14
- dbType: text
15
- public: true
16
- rules:
17
- required: true
11
+ label:
12
+ label: "Label"
13
+ type: text
14
+ dbType: text
15
+ public: true
16
+ rules:
17
+ required: true
18
18
 
19
- - key:
20
- label: "API Identifier"
21
- type: slug
22
- dbType: text
23
- index: true
24
- public: true
25
- linkedTo: label
26
- placeholder: "e.g. main-site, store-eu"
27
- rules:
28
- required: true
29
- unique: true
30
- pattern: "^[a-z0-9-_]+$"
31
- customMessage: "API key must be unique and contain only lowercase letters, numbers, hyphens, or underscores."
19
+ key:
20
+ label: "API Identifier"
21
+ type: slug
22
+ dbType: text
23
+ index: true
24
+ public: true
25
+ linkedTo: label
26
+ placeholder: "e.g. main-site, store-eu"
27
+ rules:
28
+ required: true
29
+ unique: true
30
+ pattern: "^[a-z0-9-_]+$"
31
+ customMessage: "API key must be unique and contain only lowercase letters, numbers, hyphens, or underscores."
@@ -2,31 +2,39 @@ id: address
2
2
  label: Address
3
3
  inTree: false
4
4
 
5
- # 👉 TABS DEFINITION
6
5
  tabs:
7
6
  settings:
8
7
  label: "Address"
9
8
  fields:
10
- - title:
11
- label: Address Title
12
- required: true
13
- - street:
14
- label: Street
15
- - city:
16
- label: City
17
- - area:
18
- label: County / Area
19
- - zip:
20
- label: ZIP
21
- - country:
22
- label: Country
9
+ title:
10
+ label: Address Title
11
+ required: true
12
+
13
+ street:
14
+ label: Street
15
+
16
+ city:
17
+ label: City
18
+
19
+ area:
20
+ label: County / Area
21
+
22
+ zip:
23
+ label: ZIP
24
+
25
+ country:
26
+ label: Country
27
+
23
28
  geolocation:
24
29
  label: "Geolocation"
25
30
  fields:
26
- - lat:
27
- label: Latitude
28
- - lng:
29
- label: Longitude
30
- - timezone:
31
- label: Timezone
32
- - fieldSet: access
31
+ lat:
32
+ label: Latitude
33
+
34
+ lng:
35
+ label: Longitude
36
+
37
+ timezone:
38
+ label: Timezone
39
+
40
+ access: !include ../field-sets/access.yaml
@@ -22,22 +22,27 @@ tabs:
22
22
  settings:
23
23
  label: "Article"
24
24
  fields:
25
- - fieldSet: page-base
26
- - title:
27
- label: Article title
28
- required: true
29
- - slug:
30
- linkedTo: "title"
31
- - articleDate:
32
- type: date
33
- label: Article Date
34
- public: true
35
- default: now
36
- index: true
37
- - abstract:
38
- label: Abstract
39
- type: textarea
40
- public: true
41
- - fieldSet: page-meta
42
- - fieldSet: page-social
43
- - fieldSet: access
25
+ <<: !include ../field-sets/page-base.yaml
26
+
27
+ title:
28
+ label: Article title
29
+ required: true
30
+
31
+ slug:
32
+ linkedTo: "title"
33
+
34
+ articleDate:
35
+ type: date
36
+ label: Article Date
37
+ public: true
38
+ default: now
39
+ index: true
40
+
41
+ abstract:
42
+ label: Abstract
43
+ type: textarea
44
+ public: true
45
+
46
+ meta: !include ../field-sets/page-meta.yaml
47
+ social: !include ../field-sets/page-social.yaml
48
+ access: !include ../field-sets/access.yaml
@@ -20,30 +20,36 @@ allowedBlocks:
20
20
 
21
21
  tabs:
22
22
  settings:
23
- label: Event
23
+ label: "Event"
24
24
  fields:
25
- - fieldSet: page-base
26
- - title:
27
- label: Event Title
28
- required: true
29
- showAsEditorTitle: true
30
- - slug:
31
- linkedTo: "title"
32
- - startTime:
33
- type: datetime
34
- label: Starts
35
- public: true
36
- index: true
37
- showAsEditorTitle: true
38
- - endTime:
39
- type: datetime
40
- label: Finishes
41
- public: true
42
- index: true
43
- - abstract:
44
- label: Abstract
45
- type: textarea
46
- public: true
47
- - fieldSet: page-meta
48
- - fieldSet: page-social
49
- - fieldSet: access
25
+ <<: !include ../field-sets/page-base.yaml
26
+
27
+ title:
28
+ label: Event Title
29
+ required: true
30
+ showAsEditorTitle: true
31
+
32
+ slug:
33
+ linkedTo: "title"
34
+
35
+ startTime:
36
+ type: datetime
37
+ label: Starts
38
+ public: true
39
+ index: true
40
+ showAsEditorTitle: true
41
+
42
+ endTime:
43
+ type: datetime
44
+ label: Finishes
45
+ public: true
46
+ index: true
47
+
48
+ abstract:
49
+ label: Abstract
50
+ type: textarea
51
+ public: true
52
+
53
+ meta: !include ../field-sets/page-meta.yaml
54
+ social: !include ../field-sets/page-social.yaml
55
+ access: !include ../field-sets/access.yaml
@@ -6,21 +6,24 @@ tabs:
6
6
  settings:
7
7
  label: "Link"
8
8
  fields:
9
- - fieldSet: page-base
10
- - nodeType
11
- - title:
12
- label: Link Text
13
- - iconName:
14
- label: Icon
15
- type: icon
16
- dbType: text
17
- packages: ["heroicons", "lucide", "mdi"]
18
- - slug:
19
- label: Slug
20
- linkedTo: "menuTitle, title"
21
- - url:
22
- label: URL
23
- type: text
24
- public: true
9
+ <<: !include ../field-sets/page-base.yaml
25
10
 
26
- - fieldSet: access
11
+ title:
12
+ label: Link Text
13
+
14
+ iconName:
15
+ label: Icon
16
+ type: icon
17
+ dbType: text
18
+ packages: ["heroicons", "lucide", "mdi"]
19
+
20
+ slug:
21
+ label: Slug
22
+ linkedTo: "menuTitle, title"
23
+
24
+ url:
25
+ label: URL
26
+ type: text
27
+ public: true
28
+
29
+ access: !include ../field-sets/access.yaml
@@ -23,43 +23,46 @@ tabs:
23
23
  settings:
24
24
  label: "Page"
25
25
  fields:
26
- - fieldSet: page-base
26
+ # 🎯 1. Merge ONLY page-base fields into the settings tab
27
+ <<: !include ../field-sets/page-base.yaml
27
28
 
28
29
  # 👉 THE CURRENT PAGE'S LAYOUT
29
- - layoutId:
30
- label: Page Layout
31
- type: layout-select
32
- dbType: text
33
- default: "inherit"
34
- inheritsFromParent: true # 👈 Tells the UI to bind to the parent!
35
- allowedLayouts:
36
- - two-column
37
- - single-column
38
- - three-column
39
- - landing-page
40
- options:
41
- - { label: "Inherit Layout", value: "inherit" }
30
+ layoutId:
31
+ label: Page Layout
32
+ type: layout-select
33
+ dbType: text
34
+ default: "inherit"
35
+ inheritsFromParent: true # 👈 Tells the UI to bind to the parent!
36
+ allowedLayouts:
37
+ - two-column
38
+ - single-column
39
+ - three-column
40
+ - landing-page
41
+ options:
42
+ - { label: "Inherit Layout", value: "inherit" }
42
43
 
43
44
  # 👉 THE BEHAVIOR FOR ALL CHILDREN
44
- - subpageLayoutId:
45
- label: Subpages Layout Rule
46
- type: layout-select
47
- dbType: text
48
- default: "inherit"
49
- inheritsFromParent: true # 👈 A child's subpage rules can ALSO inherit!
50
- allowedLayouts:
51
- - two-column
52
- - three-column
53
- - single-column
54
- - landing-page
55
- options:
56
- - { label: "Inherit Layout", value: "inherit" }
45
+ subpageLayoutId:
46
+ label: Subpages Layout Rule
47
+ type: layout-select
48
+ dbType: text
49
+ default: "inherit"
50
+ inheritsFromParent: true # 👈 A child's subpage rules can ALSO inherit!
51
+ allowedLayouts:
52
+ - two-column
53
+ - three-column
54
+ - single-column
55
+ - landing-page
56
+ options:
57
+ - { label: "Inherit Layout", value: "inherit" }
57
58
 
58
- - menuTitle:
59
- label: Menu Title
60
- type: text
61
- dbType: text
62
- public: true
63
- - fieldSet: page-meta
64
- - fieldSet: page-social
65
- - fieldSet: access
59
+ menuTitle:
60
+ label: Menu Title
61
+ type: text
62
+ dbType: text
63
+ public: true
64
+
65
+ # 🎯 2. Mount Meta, Social, and Access as their own dedicated tabs
66
+ meta: !include ../field-sets/page-meta.yaml
67
+ social: !include ../field-sets/page-social.yaml
68
+ access: !include ../field-sets/access.yaml
@@ -4,36 +4,38 @@ inTree: false
4
4
  inVault: true
5
5
  hasCanvas: false
6
6
 
7
- # 👉 TABS DEFINITION
8
7
  tabs:
9
8
  settings:
10
9
  label: "Person"
11
10
  fields:
12
- - image:
13
- label: Image
14
- type: asset
15
- multiple: false
16
- maxSizeMB: 15
17
- allowedTypes: ["image/*"]
18
- maxPreviewWidth: 300
19
- crops:
20
- list_thumb:
21
- label: "List View"
22
- aspectRatio: 1
23
- shape: "circle"
24
- public: true
11
+ image:
12
+ label: Image
13
+ type: asset
14
+ multiple: false
15
+ maxSizeMB: 15
16
+ allowedTypes: ["image/*"]
17
+ maxPreviewWidth: 300
18
+ crops:
19
+ list_thumb:
20
+ label: "List View"
21
+ aspectRatio: 1
22
+ shape: "circle"
23
+ public: true
25
24
 
26
- - title:
27
- label: Title
28
- required: false
29
- - firstName:
30
- label: First Name
31
- showAsEditorTitle: true
32
- - lastName:
33
- label: Last Name
34
- showAsEditorTitle: true
35
- - position:
36
- label: Position
37
- required: false
25
+ title:
26
+ label: Title
27
+ required: false
38
28
 
39
- - fieldSet: access
29
+ firstName:
30
+ label: First Name
31
+ showAsEditorTitle: true
32
+
33
+ lastName:
34
+ label: Last Name
35
+ showAsEditorTitle: true
36
+
37
+ position:
38
+ label: Position
39
+ required: false
40
+
41
+ access: !include ../field-sets/access.yaml
@@ -30,57 +30,60 @@ tabs:
30
30
  settings:
31
31
  label: "Product"
32
32
  fields:
33
- - fieldSet: page-base
34
- - title:
35
- label: Product Name
36
- required: true
37
- public: true
38
- - slug:
39
- linkedTo: "title"
40
- - price:
41
- label: Price (€)
42
- type: number
43
- public: true
44
- - description:
45
- label: Short Abstract
46
- type: textarea
47
- public: true
48
- - fieldSet: meta
49
- - fieldSet: access
33
+ <<: !include ../field-sets/page-base.yaml
34
+
35
+ title:
36
+ label: Product Name
37
+ required: true
38
+ public: true
39
+
40
+ slug:
41
+ linkedTo: "title"
42
+
43
+ price:
44
+ label: Price (€)
45
+ type: number
46
+ public: true
47
+
48
+ description:
49
+ label: Short Abstract
50
+ type: textarea
51
+ public: true
50
52
 
51
53
  media:
52
54
  label: "Media"
53
55
  fields:
54
- # 🎯 ZONE 1: The Main Image (Strict crops for lists/catalogs)
55
- - featuredImage:
56
- label: Main Product Image
57
- description: "This is the primary image used in product grids, search results, and catalogs."
58
- type: asset
59
- multiple: false
60
- maxSizeMB: 15
61
- allowedTypes: ["image/jpeg", "image/png", "image/webp"]
62
- crops:
63
- list_thumb:
64
- label: "List View (4:3)"
65
- aspectRatio: 1.333
66
- catalog_card:
67
- label: "Portrait Card (3:4)"
68
- aspectRatio: 0.75
69
- public: true
56
+ featuredImage:
57
+ label: Main Product Image
58
+ description: "This is the primary image used in product grids, search results, and catalogs."
59
+ type: asset
60
+ multiple: false
61
+ maxSizeMB: 15
62
+ allowedTypes: ["image/jpeg", "image/png", "image/webp"]
63
+ crops:
64
+ list_thumb:
65
+ label: "List View (4:3)"
66
+ aspectRatio: 1.333
67
+ catalog_card:
68
+ label: "Portrait Card (3:4)"
69
+ aspectRatio: 0.75
70
+ public: true
71
+
72
+ gallery:
73
+ label: Product Gallery
74
+ description: "Drag up to 10 images here for the product detail carousel."
75
+ type: asset
76
+ multiple: true
77
+ maxItems: 10
78
+ allowedTypes: ["image/jpeg", "image/png", "image/webp"]
79
+ crops:
80
+ carousel:
81
+ label: "Carousel Hero (16:9)"
82
+ aspectRatio: 1.777
83
+ zoom:
84
+ label: "Detail Zoom (Square)"
85
+ aspectRatio: 1.0
86
+ public: true
70
87
 
71
- # 🎯 ZONE 2: The Gallery (Different crops for the carousel)
72
- - gallery:
73
- label: Product Gallery
74
- description: "Drag up to 10 images here for the product detail carousel."
75
- type: asset
76
- multiple: true
77
- maxItems: 10
78
- allowedTypes: ["image/jpeg", "image/png", "image/webp"]
79
- crops:
80
- carousel:
81
- label: "Carousel Hero (16:9)"
82
- aspectRatio: 1.777
83
- zoom:
84
- label: "Detail Zoom (Square)"
85
- aspectRatio: 1.0
86
- public: true
88
+ meta: !include ../field-sets/page-meta.yaml
89
+ access: !include ../field-sets/access.yaml
@@ -5,25 +5,30 @@ tabs:
5
5
  settings:
6
6
  label: "Tree"
7
7
  fields:
8
- - fieldSet: tree-base
9
- - baseUrl:
10
- label: Base URL
11
- type: text
12
- dbType: text
13
- public: true
14
- - defaultLanguage:
15
- label: Channel Language / Locale
16
- type: language-select
17
- dbType: text
18
- public: true
19
- - maxDepth:
20
- type: select
21
- label: "Maximum Menu Depth"
22
- default: "3"
23
- options:
24
- - "1"
25
- - "2"
26
- - "3"
27
- - "4"
8
+ # 🎯 1. Merge the tree-base fields directly into this dictionary
9
+ <<: !include ../field-sets/tree-base.yaml
28
10
 
29
- - fieldSet: access
11
+ baseUrl:
12
+ label: Base URL
13
+ type: text
14
+ dbType: text
15
+ public: true
16
+
17
+ defaultLanguage:
18
+ label: Channel Language / Locale
19
+ type: language-select
20
+ dbType: text
21
+ public: true
22
+
23
+ maxDepth:
24
+ type: select
25
+ label: "Maximum Menu Depth"
26
+ default: "3"
27
+ options:
28
+ - "1"
29
+ - "2"
30
+ - "3"
31
+ - "4"
32
+
33
+ # 🎯 2. Mount the access file as an entirely separate tab
34
+ access: !include ../field-sets/access.yaml
@@ -5,5 +5,8 @@ tabs:
5
5
  settings:
6
6
  label: "Tree"
7
7
  fields:
8
- - fieldSet: tree-base
9
- - fieldSet: access
8
+ # 🎯 1. Merge the tree-base fields directly into this dictionary
9
+ <<: !include ../field-sets/tree-base.yaml
10
+
11
+ # 🎯 2. Mount the access file as an entirely separate tab
12
+ access: !include ../field-sets/access.yaml