@acms-subir/core 0.1.0 → 0.3.0

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 (237) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/cli/common.mjs +35 -0
  3. package/cli/legacy.mjs +317 -0
  4. package/cli/main.mjs +66 -0
  5. package/cli/palette.mjs +4 -0
  6. package/cli/preview.mjs +50 -0
  7. package/cli/remote.mjs +55 -0
  8. package/cli/themes.mjs +127 -0
  9. package/cli.mjs +2 -315
  10. package/deploy/Caddyfile +8 -0
  11. package/deploy/Dockerfile +34 -0
  12. package/deploy/compose.https.yml +21 -0
  13. package/deploy/compose.yml +46 -0
  14. package/docs/theme-authoring.md +103 -0
  15. package/email-runner.mjs +32 -0
  16. package/integration.mjs +193 -2
  17. package/ops-check.mjs +27 -0
  18. package/package.json +35 -12
  19. package/src/actions/index.ts +744 -38
  20. package/src/components/AiCleaner.tsx +291 -0
  21. package/src/components/AiSettings.tsx +575 -0
  22. package/src/components/CommandPalette.tsx +200 -0
  23. package/src/components/ContentList.astro +246 -0
  24. package/src/components/DesignAccess.tsx +182 -0
  25. package/src/components/DesignManager.tsx +455 -47
  26. package/src/components/EmailSettings.tsx +521 -0
  27. package/src/components/EventPage.astro +178 -0
  28. package/src/components/LegalPage.astro +27 -0
  29. package/src/components/LinksManager.tsx +216 -97
  30. package/src/components/NavManager.tsx +83 -38
  31. package/src/components/ThemeScript.astro +50 -0
  32. package/src/components/ThemeSections.astro +57 -0
  33. package/src/components/ThemeSectionsEditor.tsx +513 -0
  34. package/src/components/booking/BookingFlow.astro +150 -0
  35. package/src/components/booking/HoursEditor.astro +63 -0
  36. package/src/components/builder/PageBuilder.tsx +10 -2
  37. package/src/components/editor/EventPanel.tsx +401 -0
  38. package/src/components/editor/FormatDock.tsx +81 -0
  39. package/src/components/editor/LivePane.tsx +122 -0
  40. package/src/components/editor/MobileToolbar.tsx +93 -0
  41. package/src/components/editor/PostEditor.tsx +826 -271
  42. package/src/components/editor/PreviewOverlay.tsx +242 -43
  43. package/src/components/editor/extensions/calendar.tsx +51 -7
  44. package/src/components/editor/extensions/cards.tsx +17 -1
  45. package/src/components/editor/extensions/codeBlock.tsx +1 -1
  46. package/src/components/editor/extensions/events.tsx +153 -0
  47. package/src/components/editor/extensions/infoCards.tsx +16 -1
  48. package/src/components/editor/extensions/mediaCards.tsx +36 -2
  49. package/src/components/editor/extensions/slash.tsx +77 -9
  50. package/src/components/editor/extensions/toc.tsx +89 -0
  51. package/src/components/editor/extensions/toggle.tsx +70 -0
  52. package/src/components/site/Pager.astro +24 -0
  53. package/src/components/site/PostCard.astro +64 -0
  54. package/src/components/site/TagLabel.astro +11 -0
  55. package/src/layouts/Admin.astro +289 -49
  56. package/src/layouts/Site.astro +331 -57
  57. package/src/lib/agent-api.ts +13 -0
  58. package/src/lib/agent-discovery.ts +40 -0
  59. package/src/lib/agent.ts +114 -0
  60. package/src/lib/ai-config.ts +58 -0
  61. package/src/lib/ai-schema.ts +22 -0
  62. package/src/lib/ai.ts +90 -0
  63. package/src/lib/analytics.ts +121 -0
  64. package/src/lib/api-keys.ts +65 -0
  65. package/src/lib/api.ts +52 -0
  66. package/src/lib/auth.ts +25 -5
  67. package/src/lib/backup/content.ts +36 -0
  68. package/src/lib/backup/unzip.ts +12 -1
  69. package/src/lib/backup/zip.ts +1 -1
  70. package/src/lib/booking/agent.ts +108 -0
  71. package/src/lib/booking/availability.ts +221 -0
  72. package/src/lib/booking/emails.ts +115 -0
  73. package/src/lib/booking/forms.ts +77 -0
  74. package/src/lib/booking/service.ts +277 -0
  75. package/src/lib/booking/view.ts +54 -0
  76. package/src/lib/calendar/agent-schema.ts +48 -0
  77. package/src/lib/calendar/agent.ts +136 -0
  78. package/src/lib/calendar/api.ts +81 -0
  79. package/src/lib/calendar/cards.ts +102 -0
  80. package/src/lib/calendar/config.ts +52 -0
  81. package/src/lib/calendar/data.ts +130 -0
  82. package/src/lib/calendar/events.ts +261 -0
  83. package/src/lib/calendar/feeds.ts +43 -0
  84. package/src/lib/calendar/hooks.ts +38 -0
  85. package/src/lib/calendar/http.ts +30 -0
  86. package/src/lib/calendar/ics-write.ts +120 -0
  87. package/src/lib/calendar/ics.ts +15 -5
  88. package/src/lib/calendar/import.ts +203 -0
  89. package/src/lib/calendar/render.ts +120 -37
  90. package/src/lib/calendar/rrule.ts +149 -0
  91. package/src/lib/calendar/seo.ts +48 -0
  92. package/src/lib/design-service.ts +58 -0
  93. package/src/lib/designDiff.ts +145 -0
  94. package/src/lib/designPreview.ts +112 -0
  95. package/src/lib/documents/cleanup.ts +31 -0
  96. package/src/lib/documents/extract.ts +154 -0
  97. package/src/lib/documents/vendor.d.ts +4 -0
  98. package/src/lib/drafts.ts +131 -0
  99. package/src/lib/dynamicBlocks.ts +79 -7
  100. package/src/lib/email/accounts.ts +55 -0
  101. package/src/lib/email/config.ts +86 -0
  102. package/src/lib/email/migration.ts +24 -0
  103. package/src/lib/email/providers.ts +89 -0
  104. package/src/lib/email/service.ts +78 -0
  105. package/src/lib/email/store.ts +167 -0
  106. package/src/lib/email/templates.ts +18 -0
  107. package/src/lib/email/types.ts +32 -0
  108. package/src/lib/email/webhooks.ts +87 -0
  109. package/src/lib/email.ts +15 -0
  110. package/src/lib/env.ts +1 -1
  111. package/src/lib/legal/index.ts +25 -0
  112. package/src/lib/mobile/bookings.ts +73 -0
  113. package/src/lib/mobile/calendar.ts +85 -0
  114. package/src/lib/mobile/content.ts +85 -0
  115. package/src/lib/mobile/http.ts +63 -0
  116. package/src/lib/mobile/route.ts +20 -0
  117. package/src/lib/ops.ts +8 -0
  118. package/src/lib/preview.ts +21 -1
  119. package/src/lib/repo/migrations.ts +254 -0
  120. package/src/lib/repo/sql.ts +956 -46
  121. package/src/lib/repo/types.ts +140 -3
  122. package/src/lib/scheduler.ts +25 -0
  123. package/src/lib/schema.ts +362 -0
  124. package/src/lib/search-i18n.ts +3 -0
  125. package/src/lib/socialIcons.ts +32 -0
  126. package/src/lib/tagColor.ts +11 -0
  127. package/src/lib/theme.ts +59 -40
  128. package/src/lib/themeTokens.ts +174 -0
  129. package/src/lib/umami.ts +108 -0
  130. package/src/lib/webhooks.ts +139 -0
  131. package/src/middleware.ts +36 -3
  132. package/src/pages/404.astro +23 -0
  133. package/src/pages/[...slug].astro +10 -5
  134. package/src/pages/account/[action].astro +53 -0
  135. package/src/pages/admin/ai.astro +12 -0
  136. package/src/pages/admin/c/[collection]/[id].astro +14 -4
  137. package/src/pages/admin/c/[collection]/index.astro +127 -91
  138. package/src/pages/admin/calendar/bookings.astro +400 -0
  139. package/src/pages/admin/calendar/calendars.astro +265 -0
  140. package/src/pages/admin/calendar/events/[id].astro +56 -0
  141. package/src/pages/admin/calendar/events/index.astro +408 -0
  142. package/src/pages/admin/calendar/index.ts +4 -0
  143. package/src/pages/admin/calendar/integrations.astro +221 -0
  144. package/src/pages/admin/calendar/resources/[id].astro +180 -0
  145. package/src/pages/admin/calendar/resources/index.astro +106 -0
  146. package/src/pages/admin/calendar/resources/link.astro +196 -0
  147. package/src/pages/admin/design.astro +16 -4
  148. package/src/pages/admin/email.astro +13 -0
  149. package/src/pages/admin/index.astro +237 -87
  150. package/src/pages/admin/links.astro +3 -3
  151. package/src/pages/admin/login.astro +14 -10
  152. package/src/pages/admin/navigation.astro +8 -2
  153. package/src/pages/admin/pages/[id].astro +14 -3
  154. package/src/pages/admin/pages/index.astro +41 -47
  155. package/src/pages/admin/settings.astro +475 -276
  156. package/src/pages/admin/tags.astro +4 -4
  157. package/src/pages/admin/users.astro +38 -28
  158. package/src/pages/api/agent/docs.ts +33 -0
  159. package/src/pages/api/agent/index.ts +21 -0
  160. package/src/pages/api/ai/clean.ts +13 -0
  161. package/src/pages/api/ai/draft.ts +14 -0
  162. package/src/pages/api/ai/settings.ts +53 -0
  163. package/src/pages/api/ai/test.ts +12 -0
  164. package/src/pages/api/backup.ts +8 -21
  165. package/src/pages/api/calendar/availability.ts +35 -0
  166. package/src/pages/api/calendar/bookings/[id].ts +49 -0
  167. package/src/pages/api/calendar/bookings/index.ts +73 -0
  168. package/src/pages/api/calendar/calendars.ts +35 -0
  169. package/src/pages/api/calendar/docs.ts +64 -0
  170. package/src/pages/api/calendar/events/[id].ts +63 -0
  171. package/src/pages/api/calendar/events/index.ts +112 -0
  172. package/src/pages/api/calendar/resources.ts +34 -0
  173. package/src/pages/api/design/capabilities.ts +10 -0
  174. package/src/pages/api/design/index.ts +58 -0
  175. package/src/pages/api/design/keys.ts +24 -0
  176. package/src/pages/api/design/media.ts +32 -0
  177. package/src/pages/api/email/run.ts +11 -0
  178. package/src/pages/api/email/settings.ts +61 -0
  179. package/src/pages/api/email/webhooks/[provider].ts +4 -0
  180. package/src/pages/api/mcp.ts +59 -0
  181. package/src/pages/api/media/upload.ts +2 -2
  182. package/src/pages/api/ops/status.ts +39 -0
  183. package/src/pages/api/restore.ts +27 -37
  184. package/src/pages/api/search.ts +18 -4
  185. package/src/pages/api/v1/availability.ts +7 -0
  186. package/src/pages/api/v1/bookings.ts +17 -0
  187. package/src/pages/api/v1/calendars.ts +7 -0
  188. package/src/pages/api/v1/content/[id].ts +7 -0
  189. package/src/pages/api/v1/content/index.ts +7 -0
  190. package/src/pages/api/v1/events.ts +7 -0
  191. package/src/pages/api/v1/resources.ts +7 -0
  192. package/src/pages/author/[slug].astro +43 -35
  193. package/src/pages/blog/[slug].astro +140 -66
  194. package/src/pages/blog/index.astro +95 -30
  195. package/src/pages/blog/tag/[slug].astro +45 -40
  196. package/src/pages/book/[resource]/[link].astro +70 -0
  197. package/src/pages/book/[resource]/index.astro +63 -0
  198. package/src/pages/book/[resource].ics.ts +38 -0
  199. package/src/pages/book/index.astro +47 -0
  200. package/src/pages/book/manage/[token].astro +108 -0
  201. package/src/pages/calendar/[slug].ics.ts +27 -0
  202. package/src/pages/calendar/feed.ics.ts +15 -0
  203. package/src/pages/calendar/index.astro +191 -0
  204. package/src/pages/embed/book/[resource]/[link].astro +33 -0
  205. package/src/pages/embed/calendar/[slug].astro +43 -0
  206. package/src/pages/events/[slug].astro +74 -0
  207. package/src/pages/events/[slug].ics.ts +25 -0
  208. package/src/pages/index.astro +9 -3
  209. package/src/pages/legal/privacy.astro +4 -0
  210. package/src/pages/legal/terms.astro +4 -0
  211. package/src/pages/links.astro +33 -7
  212. package/src/pages/llms.txt.ts +4 -0
  213. package/src/pages/preview/[type]/[id].astro +34 -8
  214. package/src/pages/search.astro +40 -20
  215. package/src/pages/sitemap.xml.ts +16 -1
  216. package/src/styles/admin.css +928 -105
  217. package/src/styles/cards.css +101 -60
  218. package/src/styles/editor.css +532 -102
  219. package/src/styles/email-settings.css +117 -0
  220. package/src/styles/sections.css +12 -0
  221. package/src/styles/site.css +938 -278
  222. package/src/styles/theme-editor.css +135 -0
  223. package/src/theme-sdk/contract.d.mts +619 -0
  224. package/src/theme-sdk/contract.mjs +80 -0
  225. package/src/theme-sdk/index.ts +15 -0
  226. package/src/theme-sdk/tokens.d.mts +148 -0
  227. package/src/theme-sdk/tokens.mjs +52 -0
  228. package/src/themes/editorial/templates/home.astro +4 -4
  229. package/src/themes/editorial/templates/post-minimal.astro +2 -2
  230. package/src/themes/editorial/theme.css +22 -37
  231. package/src/themes/editorial/theme.json +23 -3
  232. package/src/themes/field/theme.json +26 -9
  233. package/src/themes/ink/theme.json +30 -12
  234. package/src/themes/night/theme.css +4 -7
  235. package/src/themes/night/theme.json +27 -10
  236. package/src/virtual.d.ts +14 -0
  237. package/src/worker.ts +5 -1
@@ -0,0 +1,135 @@
1
+ /* Design screen: control tabs, the Pages (section layout) editor, the Review
2
+ summary and Access keys. Admin tokens only; see DESIGN.md. */
3
+
4
+ /* tabs (a full-width .seg) */
5
+ .te-tabs { display: flex; margin: 16px 0 4px; overflow-x: auto; scrollbar-width: none; }
6
+ .te-tabs::-webkit-scrollbar { display: none; }
7
+ .te-tabs > [role='tab'] { flex: 1 0 auto; min-height: 30px; padding: 5px 12px; }
8
+ .te-tabs > [role='tab']:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
9
+ .te-tab-count { font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
10
+ .te-panel { padding-top: 6px; }
11
+ .te-panel[hidden] { display: none; }
12
+ .te-first { margin-top: 12px; }
13
+ .te-reviewhint { margin-top: 14px; }
14
+
15
+ /* shared bits */
16
+ .te-intro { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 10px 0 14px; }
17
+ .te-intro b { color: var(--text); font-weight: 600; }
18
+ .te-muted { color: var(--muted); font-size: 13px; margin: 8px 0; }
19
+ .te-note { font-size: 13px; color: var(--text-2); margin: 0 0 12px; }
20
+ .te-alert { margin: 12px 0 0; }
21
+ .te-delete.btn, .btn.ghost.te-delete { color: var(--red); }
22
+ .te-delete.btn:hover { background: var(--red-soft); color: var(--red); }
23
+
24
+ /* page picker + mode */
25
+ .te-pagebar { display: flex; align-items: flex-end; gap: 10px; }
26
+ .te-pagepick { flex: 1; min-width: 0; margin-bottom: 0; }
27
+ .te-pagebar .btn { margin-bottom: 4px; flex-shrink: 0; }
28
+ .te-empty {
29
+ margin-top: 14px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
30
+ background: var(--panel-2); font-size: 13.5px;
31
+ }
32
+ .te-empty p { margin: 0 0 6px; }
33
+ .te-empty .btn { margin-top: 8px; }
34
+ .te-mode { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 12px; }
35
+ .te-mode-label { font-size: 12px; color: var(--muted); font-weight: 500; }
36
+ .te-mode .seg > [role='radio'] { min-height: 28px; }
37
+ .te-mode .seg > [role='radio']:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
38
+
39
+ /* section list */
40
+ .te-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
41
+ .te-list.is-inactive { opacity: 0.72; }
42
+ .te-none { padding: 14px 16px; margin: 0; }
43
+ .te-sec + .te-sec { border-top: 1px solid var(--line); }
44
+ .te-sec-head { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 0; }
45
+ .te-sec-toggle {
46
+ flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 40px;
47
+ padding: 6px 8px 6px 12px; border: 0; background: none; font: inherit; color: var(--text); text-align: left;
48
+ cursor: pointer; border-radius: var(--r-md);
49
+ }
50
+ .te-sec-toggle:hover { background: var(--hover); }
51
+ .te-sec-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
52
+ .te-sec-toggle svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--muted); transition: transform 150ms ease-out; }
53
+ .te-sec.is-open .te-sec-toggle svg { transform: rotate(90deg); }
54
+ .te-sec.is-open .te-sec-head { background: var(--sel); }
55
+ .te-sec.is-open .te-sec-name { font-weight: 600; }
56
+ .te-sec-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
57
+ .te-sec-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
58
+ .te-sec.is-hidden .te-sec-name { color: var(--muted); }
59
+ .te-sec-actions { display: flex; gap: 2px; flex-shrink: 0; }
60
+ .te-sec-actions .icon-btn { width: 32px; height: 32px; }
61
+ .te-sec-actions .icon-btn:disabled { opacity: 0.35; cursor: default; background: none; }
62
+ .te-sec-actions .icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
63
+ .te svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
64
+ .te-sec-body { padding: 14px 16px 12px; border-top: 1px solid var(--line); }
65
+ .te-sec-body textarea { resize: vertical; min-height: 84px; }
66
+ .te-sec-foot { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
67
+ .te-sec-foot .te-delete { margin-left: auto; }
68
+
69
+ /* image field */
70
+ .te-image { margin-bottom: 12px; }
71
+ .te-image > label > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
72
+ .te-image-row { display: flex; align-items: center; gap: 8px; }
73
+ .te-image-row input { flex: 1; min-width: 0; }
74
+ .te-thumb {
75
+ width: 40px; height: 32px; object-fit: cover; flex-shrink: 0;
76
+ border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2);
77
+ }
78
+
79
+ /* add + save */
80
+ .te-add { display: flex; align-items: flex-end; gap: 8px; margin-top: 14px; }
81
+ .te-add .field { flex: 1; min-width: 0; margin-bottom: 0; }
82
+ .te-add .btn { margin-bottom: 1px; }
83
+ .te-savebar {
84
+ display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
85
+ margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line);
86
+ }
87
+ .te-savestate { margin-right: auto; font-size: 12px; color: var(--faint); }
88
+ .te-savestate.is-dirty { color: var(--amber); font-weight: 600; }
89
+
90
+ /* review */
91
+ .te-review { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
92
+ .te-review li {
93
+ display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center;
94
+ padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px;
95
+ }
96
+ .te-review-page { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
97
+ .te-review-what { color: var(--muted); font-size: 12.5px; }
98
+
99
+ /* access keys */
100
+ .da-token { flex-direction: column; align-items: stretch; gap: 8px; background: var(--green-soft); border-color: transparent; }
101
+ .da-token p { margin: 0; font-size: 13px; color: var(--text); }
102
+ .da-token-row { display: flex; gap: 6px; }
103
+ .da-token-row input { flex: 1; min-width: 0; }
104
+ .da-keys { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--line); }
105
+ .da-keys li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
106
+ .da-key { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
107
+ .da-key b { font-size: 13.5px; font-weight: 600; color: var(--text); }
108
+ .da-key small { font-size: 12px; color: var(--muted); }
109
+ .da-key code, .da-scopes-set code { font-family: ui-monospace, 'SF Mono', monospace; font-size: 11.5px; }
110
+ .da-scopes { color: var(--text-2) !important; }
111
+ .da-form { margin-top: 18px; padding-top: 4px; }
112
+ .da-title { margin-top: 8px; }
113
+ .da-scopes-set { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
114
+ .da-scopes-set legend { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 8px; padding: 0; }
115
+ .da-scopes-set .check-row { align-items: flex-start; }
116
+ .da-scopes-set .check-row input { margin-top: 2px; flex-shrink: 0; }
117
+ .da-scopes-set .check-row > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 13px; color: var(--text); }
118
+ .da-scopes-set .check-row code { color: var(--muted); }
119
+ .da-scopes-set .check-row small { flex-basis: 100%; font-size: 12px; color: var(--muted); }
120
+
121
+ @media (max-width: 767px) {
122
+ .te-tabs > [role='tab'] { min-height: 36px; font-size: 13px; }
123
+ .te-pagebar { flex-wrap: wrap; }
124
+ .te-pagepick { flex-basis: 100%; }
125
+ .te-mode { flex-wrap: wrap; }
126
+ .te-sec-actions .icon-btn { width: 36px; height: 36px; }
127
+ .te-sec-foot .btn, .te-savebar .btn, .te-add .btn, .da-keys .btn, .da-token-row .btn { min-height: 36px; }
128
+ .te-sec-body input, .te-sec-body select, .te-sec-body textarea,
129
+ .te-pagebar select, .te-add select, .da input[type='text'], .da-token-row input { font-size: 16px; }
130
+ .te-review li { grid-template-columns: minmax(0, 1fr) auto; }
131
+ .te-review-what { grid-column: 1; grid-row: 2; }
132
+ .te-review li .btn { grid-row: 1 / span 2; grid-column: 2; }
133
+ .da-token-row { flex-wrap: wrap; }
134
+ .da-token-row input { flex-basis: 100%; }
135
+ }