@oktis-works/cms 0.13.24 → 0.14.5

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/README.md +101 -0
  2. package/dist/extension-scaffold.d.ts.map +1 -1
  3. package/dist/extension-scaffold.js +17 -8
  4. package/dist/extension-scaffold.js.map +1 -1
  5. package/dist/generated/app-versions.js +7 -7
  6. package/dist/generated/app-versions.js.map +1 -1
  7. package/dist/generated/theme-assets.d.ts +14 -0
  8. package/dist/generated/theme-assets.d.ts.map +1 -0
  9. package/dist/generated/theme-assets.js +2660 -0
  10. package/dist/generated/theme-assets.js.map +1 -0
  11. package/dist/scaffold.d.ts +28 -0
  12. package/dist/scaffold.d.ts.map +1 -1
  13. package/dist/scaffold.js +71 -60
  14. package/dist/scaffold.js.map +1 -1
  15. package/dist/theme-assets.d.ts +7 -11
  16. package/dist/theme-assets.d.ts.map +1 -1
  17. package/dist/theme-assets.js +25 -827
  18. package/dist/theme-assets.js.map +1 -1
  19. package/dist/themes/default/404.astro +3 -3
  20. package/dist/themes/default/archive.astro +5 -5
  21. package/dist/themes/default/page-blog.astro +5 -5
  22. package/dist/themes/default/page-home.astro +2 -2
  23. package/dist/themes/default/page.astro +4 -0
  24. package/dist/themes/default/single.astro +9 -5
  25. package/dist/themes/default/theme.json +2 -2
  26. package/migrations/V027__core__content_parent_and_hub.sql +32 -0
  27. package/migrations/mariadb/V001__core__add_core_fields_support.sql +2 -4
  28. package/migrations/mariadb/V005__core__add_user_locale.sql +1 -1
  29. package/migrations/mariadb/V006__core__expand_media_metadata.sql +2 -2
  30. package/migrations/mariadb/V007__core__expand_menus.sql +1 -2
  31. package/migrations/mariadb/V017__core__lazy_field_types.sql +1 -1
  32. package/migrations/mariadb/V018__core__timezone_system.sql +1 -1
  33. package/migrations/mariadb/V026__core__content_types_source_admin.sql +4 -0
  34. package/migrations/mariadb/V027__core__content_parent_and_hub.sql +4 -0
  35. package/migrations/mysql/V001__core__add_core_fields_support.sql +2 -4
  36. package/migrations/mysql/V005__core__add_user_locale.sql +1 -1
  37. package/migrations/mysql/V006__core__expand_media_metadata.sql +2 -2
  38. package/migrations/mysql/V007__core__expand_menus.sql +1 -2
  39. package/migrations/mysql/V017__core__lazy_field_types.sql +1 -1
  40. package/migrations/mysql/V018__core__timezone_system.sql +1 -1
  41. package/migrations/mysql/V026__core__content_types_source_admin.sql +4 -0
  42. package/migrations/mysql/V027__core__content_parent_and_hub.sql +4 -0
  43. package/package.json +9 -9
@@ -1,833 +1,31 @@
1
- // @oktis-works/cms - Default theme templates embedded in the CLI
1
+ // @oktis-works/cms - Default theme embedded in the CLI
2
+ //
3
+ // `okcms init` must write a `themes/default/` identical to the monorepo's
4
+ // `themes/default/`. The published package cannot read that directory at
5
+ // runtime (it ships only `dist/`), so the files travel as strings:
6
+ //
7
+ // * preferred source — the REAL directory copied into `dist/themes/default`
8
+ // by `scripts/copy-theme-assets.mjs` (see `getThemeAssetDir` in
9
+ // `scaffold.ts`), used whenever it resolves;
10
+ // * generated fallback — `src/generated/theme-assets.ts`, produced from the
11
+ // same directory by `scripts/generate-theme-assets.mjs`.
12
+ //
13
+ // Both are derived from `themes/default/`, which is the single source of
14
+ // truth: editing the theme and running `bun run build` keeps them in step,
15
+ // and `theme-assets.test.ts` fails if the generated copy drifts.
2
16
  //
3
- // `okcms init` writes these files into the new project's `themes/default/`:
4
- // the site renders out of the box (root-level .astro templates + dist/theme.css
5
- // served directly). Kept as strings because the package publishes only `dist/`.
6
17
  // The renderer supports: {{var}} / {{{raw}}} / {{#if x}} / {{#each path}} —
7
- // no {{else}} and no @index, so templates are written within that syntax.
8
- import { CMS_VERSION } from '@oktis-works/validation';
9
- /** Default theme manifest (`theme.json` = canonical name read by runtime, service and CLI). */
10
- export const DEFAULT_THEME_MANIFEST = `${JSON.stringify({
11
- name: 'default',
12
- version: '0.2.0',
13
- description: 'OkCMS default theme — responsive hierarchical templates with real content interpolation',
14
- type: 'theme',
15
- author: 'Oktis Works',
16
- // BUSI-022 contract: required by theme:install through the API. Without the
17
- // range the default theme would be rejected on explicit install. Derived
18
- // from CMS_VERSION (single source) — never a literal.
19
- compatibility: { okcms: `^${CMS_VERSION}` },
20
- // Preview card on the admin Themes screen (served from /themes/default/).
21
- screenshots: ['screenshot.png'],
22
- provides: {
23
- layouts: ['front-page', 'home', 'posts', 'index', 'single', 'page', 'archive', '404', 'page-about', 'page-contact', 'post-first-post', 'post-second-post'],
24
- assets: ['dist/theme.css'],
25
- },
26
- stylesConfig: {
27
- engine: 'css',
28
- // Committed CSS already scoped — the theme owns its isolation (BUSI-040)
29
- isolation: 'manual',
30
- },
31
- settings: [
32
- { name: 'siteTitle', type: 'text', label: 'Site title', default: 'OkCMS' },
33
- { name: 'siteDescription', type: 'text', label: 'Site description', default: '' },
34
- ],
35
- }, null, 2)}
36
- `;
37
- /** Default theme design system — served straight from dist/theme.css (no build). */
38
- export const DEFAULT_THEME_CSS = `/* OkCMS default theme — design system (served straight from dist/theme.css) */
39
- [data-theme="default"]{
40
- --brand: #4f46e5;
41
- --brand-strong: #4338ca;
42
- --brand-soft: #eef2ff;
43
- --text: #111827;
44
- --muted: #6b7280;
45
- --surface: #ffffff;
46
- --bg: #f9fafb;
47
- --border: #e5e7eb;
48
- --border-strong: #d1d5db;
49
- --radius: 12px;
50
- --radius-sm: 8px;
51
- --shadow-sm: 0 1px 2px rgba(17,24,39,.06);
52
- --shadow-md: 0 6px 20px rgba(17,24,39,.08);
53
- --shadow-lg: 0 16px 40px rgba(17,24,39,.14);
54
- }
55
-
56
- [data-theme="default"] *,[data-theme="default"] *::before,[data-theme="default"] *::after{ box-sizing: border-box; }
57
-
58
- /* Page-level reset: the UA default body margin (8px) would frame the whole
59
- site in white on every side (top/left/right/bottom). Scoped with :has so
60
- this stylesheet — also the last fallback of the project chain — never
61
- changes the page box of another theme. */
62
- body:has([data-theme="default"]){ margin: 0; padding: 0; }
63
-
64
- [data-theme="default"]{
65
- margin: 0;
66
- font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
67
- color: var(--text);
68
- background: var(--bg);
69
- line-height: 1.65;
70
- -webkit-font-smoothing: antialiased;
71
- }
72
-
73
- [data-theme="default"] a{ color: var(--brand); text-decoration: none; }
74
- [data-theme="default"] a:hover{ color: var(--brand-strong); }
75
- [data-theme="default"] img{ max-width: 100%; border-radius: var(--radius-sm); }
76
-
77
- /* ---------- Layout container ---------- */
78
- [data-theme="default"] .container{ max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
79
-
80
- /* ---------- Header ---------- */
81
- [data-theme="default"] .site-header{
82
- position: sticky; top: 0; z-index: 20;
83
- background: rgba(255,255,255,.86);
84
- backdrop-filter: blur(10px);
85
- border-bottom: 1px solid var(--border);
86
- }
87
- [data-theme="default"] .site-header__inner{
88
- display: flex; align-items: center; justify-content: space-between;
89
- gap: 1rem; min-height: 3.75rem; flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem;
90
- }
91
- [data-theme="default"] .site-brand{
92
- font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--text);
93
- display: inline-flex; align-items: center; gap: .5rem;
94
- }
95
- [data-theme="default"] .site-brand::before{
96
- content: ""; width: .65rem; height: .65rem; border-radius: 999px;
97
- background: linear-gradient(135deg, var(--brand), #8b5cf6);
98
- }
99
- [data-theme="default"] .site-brand:hover{ color: var(--text); }
100
- [data-theme="default"] .site-nav{ display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
101
- [data-theme="default"] .site-nav__link{
102
- padding: .45rem .85rem; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: .95rem;
103
- }
104
- [data-theme="default"] .site-nav__link:hover{ color: var(--brand); background: var(--brand-soft); }
105
-
106
- /* ---------- Hero ---------- */
107
- [data-theme="default"] .hero{
108
- position: relative; overflow: hidden;
109
- background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 55%, #7c3aed 100%);
110
- color: #fff; text-align: center;
111
- padding: 5rem 1.5rem 5.5rem;
112
- }
113
- [data-theme="default"] .hero::after{
114
- content: ""; position: absolute; inset: auto -10% -60% -10%; height: 70%;
115
- background: var(--bg); border-radius: 50% 50% 0 0;
116
- }
117
- [data-theme="default"] .hero > *{ position: relative; z-index: 1; }
118
- [data-theme="default"] .hero__kicker{
119
- margin: 0 0 .75rem; text-transform: uppercase; letter-spacing: .18em;
120
- font-size: .78rem; font-weight: 700; color: rgba(255,255,255,.75);
121
- }
122
- [data-theme="default"] .hero__title{
123
- margin: 0 0 1rem; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.12; letter-spacing: -.03em; font-weight: 800;
124
- }
125
- [data-theme="default"] .hero__description{
126
- margin: 0 auto 1.75rem; max-width: 42rem; font-size: 1.1rem; color: rgba(255,255,255,.85);
127
- }
128
- [data-theme="default"] .hero__actions{ display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
129
- [data-theme="default"] .hero--compact{ padding: 3.25rem 1.5rem 4rem; }
130
-
131
- /* ---------- Buttons ---------- */
132
- [data-theme="default"] .btn{
133
- display: inline-flex; align-items: center; gap: .5rem;
134
- padding: .7rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: .98rem;
135
- border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
136
- }
137
- [data-theme="default"] .btn:hover{ transform: translateY(-1px); }
138
- [data-theme="default"] .btn--primary{ background: #fff; color: var(--brand-strong); box-shadow: var(--shadow-md); }
139
- [data-theme="default"] .btn--primary:hover{ background: var(--brand-soft); color: var(--brand-strong); }
140
- [data-theme="default"] .btn--ghost{ background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.45); }
141
- [data-theme="default"] .btn--ghost:hover{ background: rgba(255,255,255,.22); color: #fff; }
142
- [data-theme="default"] .btn--outline{ background: transparent; color: var(--brand); border-color: var(--border-strong); }
143
- [data-theme="default"] .btn--outline:hover{ background: var(--brand-soft); border-color: var(--brand); }
144
-
145
- /* ---------- Generic section wrapper (keeps content centered) ---------- */
146
- [data-theme="default"] .section{
147
- max-width: 72rem; margin: 0 auto; padding: 3.5rem 1.25rem;
148
- }
149
- [data-theme="default"] .section__kicker{
150
- margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .16em;
151
- font-size: .74rem; font-weight: 700; color: var(--brand);
152
- }
153
- [data-theme="default"] .section__title{
154
- margin: 0 0 .75rem; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; font-weight: 800;
155
- }
156
- [data-theme="default"] .section__lead{ margin: 0 0 1rem; color: var(--muted); font-size: 1.05rem; max-width: 46rem; }
157
- [data-theme="default"] .section__more{ font-weight: 600; }
158
- [data-theme="default"] .section--tight{ padding: 2.25rem 1.25rem; }
159
- [data-theme="default"] .section__head{
160
- display: flex; align-items: baseline; justify-content: space-between;
161
- gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem;
162
- }
163
-
164
- /* ---------- Home-specific sections ---------- */
165
- [data-theme="default"] .about-preview{
166
- display: grid; gap: 1.5rem; grid-template-columns: 1.2fr .8fr; align-items: start;
167
- }
168
- [data-theme="default"] .about-content{ max-width: 46rem; margin: 0 auto; }
169
- [data-theme="default"] .about-preview .section__more{ display: inline-block; }
170
- [data-theme="default"] .contact{
171
- background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
172
- box-shadow: var(--shadow-sm);
173
- }
174
- [data-theme="default"] .contact .section__lead a{ font-weight: 600; }
175
- [data-theme="default"] .contact-intro{ max-width: 46rem; margin: 0 auto var(--space-8, 2rem); color: var(--muted); text-align: center; }
176
- [data-theme="default"] .contact-form{ max-width: 46rem; margin: 0 auto; }
177
- [data-theme="default"] .contact-form .form-group{ margin-bottom: 1rem; }
178
- [data-theme="default"] .contact-form label{ display: block; margin-bottom: .25rem; font-weight: 500; color: var(--text); font-size: .95rem; }
179
- [data-theme="default"] .contact-form input, [data-theme="default"] .contact-form textarea{
180
- width: 100%; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
181
- font-size: 1rem; font-family: inherit; box-sizing: border-box;
182
- }
183
- [data-theme="default"] .contact-form button{ cursor: pointer; }
184
-
185
- /* ---------- Posts grid (home latest posts) ---------- */
186
- [data-theme="default"] .posts-grid{
187
- display: grid; gap: 1.5rem;
188
- grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
189
- }
190
- [data-theme="default"] .post-card{
191
- background: var(--surface); border: 1px solid var(--border);
192
- border-radius: var(--radius); box-shadow: var(--shadow-sm);
193
- transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
194
- overflow: hidden; display: flex; flex-direction: column;
195
- }
196
- [data-theme="default"] .post-card:hover{ transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
197
- [data-theme="default"] .post-card__image{
198
- margin: 0; aspect-ratio: 16/9; overflow: hidden;
199
- }
200
- [data-theme="default"] .post-card__image img{ width: 100%; height: 100%; object-fit: cover; }
201
- [data-theme="default"] .post-card__content{ padding: 1rem 1rem 1.2rem; display: flex; flex-direction: column; }
202
- [data-theme="default"] .post-card__title{ margin: 0 0 .5rem; font-size: 1.12rem; line-height: 1.35; }
203
- [data-theme="default"] .post-card__title a{ color: var(--text); text-decoration: none; }
204
- [data-theme="default"] .post-card__title a:hover{ color: var(--brand); }
205
- [data-theme="default"] .post-card__excerpt{ margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
206
- [data-theme="default"] .no-posts{ text-align: center; color: var(--muted); padding: 2rem 0; }
207
-
208
- /* ---------- Entries (single / page) ---------- */
209
- [data-theme="default"] .entry{
210
- max-width: 46rem; margin: 0 auto; padding: 3rem 1.25rem 4rem;
211
- }
212
- [data-theme="default"] .entry__header{ margin-bottom: 1.75rem; }
213
- [data-theme="default"] .entry__kicker{
214
- margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .16em;
215
- font-size: .74rem; font-weight: 700; color: var(--brand);
216
- }
217
- [data-theme="default"] .entry__title{
218
- margin: 0 0 .5rem; font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -.025em; line-height: 1.15; font-weight: 800;
219
- }
220
- [data-theme="default"] .entry__meta{ display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
221
- [data-theme="default"] .entry__cover{ width: 100%; border-radius: var(--radius); margin: 1rem 0; box-shadow: var(--shadow-sm); }
222
- [data-theme="default"] .entry__body{ font-size: 1.06rem; }
223
- [data-theme="default"] .entry__body h2{ font-size: 1.5rem; letter-spacing: -.01em; margin: 2rem 0 .75rem; }
224
- [data-theme="default"] .entry__body h3{ font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
225
- [data-theme="default"] .entry__body p{ margin: 0 0 1rem; color: #374151; }
226
- [data-theme="default"] .entry__body a{ text-decoration: underline; text-underline-offset: 3px; }
227
- [data-theme="default"] .entry__body blockquote{
228
- margin: 1.5rem 0; padding: .75rem 1.25rem; border-left: 3px solid var(--brand);
229
- background: var(--brand-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: #374151;
230
- }
231
- [data-theme="default"] .entry__body pre{
232
- background: #0f172a; color: #e2e8f0; padding: 1rem 1.25rem; border-radius: var(--radius-sm);
233
- overflow: auto; font-size: .9rem;
234
- }
235
- [data-theme="default"] .entry__body code{ background: var(--brand-soft); border-radius: 4px; padding: .1rem .35rem; }
236
- [data-theme="default"] .entry__body pre code{ background: transparent; padding: 0; }
237
- [data-theme="default"] .entry__terms{ display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
238
- [data-theme="default"] .badge{
239
- display: inline-block; padding: .25rem .7rem; border-radius: 999px;
240
- background: var(--brand-soft); color: var(--brand-strong); font-size: .8rem; font-weight: 600;
241
- }
242
- [data-theme="default"] .entry__footer{
243
- margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
244
- display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
245
- color: var(--muted); font-size: .92rem;
246
- }
247
- [data-theme="default"] .entry__back{ font-weight: 600; }
248
-
249
- /* ---------- Cards / listings (archive, posts listing) ---------- */
250
- [data-theme="default"] .cards{
251
- display: grid; gap: 1.25rem;
252
- grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
253
- }
254
- [data-theme="default"] .card{
255
- display: flex; flex-direction: column; gap: .5rem;
256
- background: var(--surface); border: 1px solid var(--border);
257
- border-radius: var(--radius); padding: 1.4rem 1.4rem 1.2rem; box-shadow: var(--shadow-sm);
258
- transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
259
- }
260
- [data-theme="default"] .card:hover{ transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
261
- [data-theme="default"] .card__date{ font-size: .8rem; color: var(--muted); }
262
- [data-theme="default"] .card__title{ margin: 0; font-size: 1.12rem; line-height: 1.35; }
263
- [data-theme="default"] .card__title a{ color: var(--text); }
264
- [data-theme="default"] .card__title a:hover{ color: var(--brand); }
265
- [data-theme="default"] .card__excerpt{ margin: 0; color: var(--muted); font-size: .95rem; }
266
- [data-theme="default"] .card__more{
267
- margin-top: auto; padding-top: .4rem; font-weight: 600; font-size: .92rem; color: var(--brand);
268
- }
269
- [data-theme="default"] .listing{ display: grid; gap: 1rem; }
270
-
271
- /* ---------- Archive ---------- */
272
- [data-theme="default"] .archive-header{
273
- background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 60%, #7c3aed 100%);
274
- color: #fff; text-align: center; padding: 3.25rem 1.5rem 4rem;
275
- }
276
- [data-theme="default"] .archive-header__title{ margin: 0 0 .4rem; font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.02em; font-weight: 800; }
277
- [data-theme="default"] .archive-header__description{ margin: 0; color: rgba(255,255,255,.85); }
278
- [data-theme="default"] .archive-header + .section{ margin-top: -1.5rem; }
279
- [data-theme="default"] .archive-header + .section .card{ background: var(--surface); }
280
-
281
- /* ---------- Empty state ---------- */
282
- [data-theme="default"] .empty{
283
- text-align: center; color: var(--muted); padding: 2.5rem 1rem;
284
- border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface);
285
- }
286
-
287
- /* ---------- 404 ---------- */
288
- [data-theme="default"] .not-found{ text-align: center; padding: 5rem 1.5rem; }
289
- [data-theme="default"] .not-found__code{
290
- margin: 0 0 .5rem; font-size: 5rem; font-weight: 800; letter-spacing: -.04em;
291
- background: linear-gradient(135deg, var(--brand), #8b5cf6);
292
- -webkit-background-clip: text; background-clip: text; color: transparent;
293
- }
294
- [data-theme="default"] .not-found__message{ margin: 0 0 1.5rem; color: var(--muted); font-size: 1.1rem; }
295
-
296
- /* ---------- Footer ---------- */
297
- [data-theme="default"] .site-footer{
298
- background: #111827; color: #d1d5db; margin-top: 4rem;
299
- }
300
- [data-theme="default"] .site-footer .container{
301
- display: flex; flex-direction: column; align-items: center; gap: 2rem;
302
- padding-top: 2.75rem; padding-bottom: 1.5rem;
303
- }
304
- [data-theme="default"] .site-footer__title{ margin: 0 0 .35rem; color: #fff; font-weight: 700; font-size: 1.05rem; }
305
- [data-theme="default"] .site-footer__description{ margin: 0; max-width: 24rem; color: #9ca3af; font-size: .93rem; }
306
- [data-theme="default"] .site-footer__nav{ display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 1.5rem; margin: 0; padding: 0; list-style: none; }
307
- [data-theme="default"] .site-footer__nav a{ color: #d1d5db; font-size: .95rem; }
308
- [data-theme="default"] .site-footer__nav a:hover{ color: #fff; }
309
- [data-theme="default"] .site-footer__bottom{ border-top: 1px solid rgba(255,255,255,.1); }
310
- [data-theme="default"] .site-footer__copyright{
311
- margin: 0; padding: 1.1rem 0; text-align: center; color: #9ca3af; font-size: .85rem;
312
- }
313
-
314
- /* ---------- Pagination ---------- */
315
- [data-theme="default"] .pagination{ display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; }
316
- [data-theme="default"] .pagination a{ color: var(--brand); font-weight: 600; }
317
-
318
- /* ---------- Responsive ---------- */
319
- @media (max-width: 860px){
320
- [data-theme="default"] .about-preview{ grid-template-columns: 1fr; }
321
- [data-theme="default"] .hero{ padding: 4rem 1.25rem 4.5rem; }
322
- [data-theme="default"] .posts-grid{ grid-template-columns: 1fr; }
323
- }
324
- @media (max-width: 560px){
325
- [data-theme="default"] .site-header__inner{ justify-content: center; }
326
- [data-theme="default"] .site-nav{ justify-content: center; }
327
- [data-theme="default"] .hero{ padding: 3.25rem 1rem 3.75rem; }
328
- [data-theme="default"] .section{ padding: 2.5rem 1rem; }
329
- [data-theme="default"] .cards{ grid-template-columns: 1fr; }
330
- }
331
- `;
18
+ // templates are written within that syntax.
19
+ export { DEFAULT_THEME_FILES, DEFAULT_THEME_BINARY_FILES, DEFAULT_THEME_MANIFEST, DEFAULT_THEME_CSS, THEME_TEMPLATE_FILES, } from './generated/theme-assets.js';
20
+ import { DEFAULT_THEME_BINARY_FILES } from './generated/theme-assets.js';
332
21
  /**
333
- * Templates of the hierarchy (runtime format: `*.astro` at the theme root,
334
- * syntax `{{var}}` / `{{{raw}}}` / `{{#each}}` / `{{#if}}`).
22
+ * True when a theme asset must be written as raw bytes (PNG and friends).
335
23
  *
336
- * Shared shell: every template renders the same header (brand + `menus.header`)
337
- * and footer (`menus.footer`) around its own content, all scoped by the
338
- * `[data-theme]` wrapper the stylesheet targets.
24
+ * Classification lives in the generated binary map — the generator decides
25
+ * once, from `themes/default/`, so the disk copy and the embedded fallback
26
+ * always write the same file the same way.
339
27
  */
340
- /** Header shell (brand + main menu). */
341
- const HEADER = `<header class="site-header">
342
- <div class="container site-header__inner">
343
- <a class="site-brand" href="/">{{site.title}}</a>
344
- {{#if menus.header}}
345
- <nav class="site-nav" aria-label="Main navigation">
346
- {{#each menus.header.items}}<a class="site-nav__link" href="{{url}}">{{label}}</a>{{/each}}
347
- </nav>
348
- {{/if}}
349
- </div>
350
- </header>
351
- `;
352
- /** Footer shell (brand + description + footer menu + copyright). */
353
- const FOOTER = `<footer class="site-footer">
354
- <div class="container site-footer__inner">
355
- <div class="site-footer__info">
356
- <p class="site-footer__title">{{site.title}}</p>
357
- {{#if site.description}}<p class="site-footer__description">{{site.description}}</p>{{/if}}
358
- </div>
359
- {{#if menus.footer}}
360
- <nav class="site-footer__nav" aria-label="Footer navigation">
361
- {{#each menus.footer.items}}<a class="site-footer__link" href="{{url}}">{{label}}</a>{{/each}}
362
- </nav>
363
- {{/if}}
364
- </div>
365
- <div class="container site-footer__bottom">
366
- <p class="site-footer__copyright">© {{site.title}} · Powered by OkCMS</p>
367
- </div>
368
- </footer>
369
- `;
370
- /** Latest posts grid — fed by `items` (fetched for home/front-page/posts page). */
371
- const POSTS_SECTION = `{{#if items}}
372
- <section class="section" id="posts">
373
- <div class="section__head">
374
- <div>
375
- <p class="section__kicker">Blog</p>
376
- <h2 class="section__title">Latest posts</h2>
377
- </div>
378
- </div>
379
- <div class="cards">
380
- {{#each items}}
381
- <article class="card">
382
- {{#if published_at}}<time class="card__date" datetime="{{published_at}}">{{published_at}}</time>{{/if}}
383
- <h3 class="card__title"><a href="/{{slug}}">{{title}}</a></h3>
384
- {{#if excerpt}}<p class="card__excerpt">{{excerpt}}</p>{{/if}}
385
- <a class="card__more" href="/{{slug}}">Read more →</a>
386
- </article>
387
- {{/each}}
388
- </div>
389
- </section>
390
- {{/if}}
391
- `;
392
- const PAGINATION = `{{#if pagination.pages}}
393
- <nav class="pagination" aria-label="Pagination">
394
- {{#if pagination.hasPrevious}}<a href="?page={{pagination.previousPage}}">Previous</a>{{/if}}
395
- <span>Page {{pagination.page}} of {{pagination.pages}}</span>
396
- {{#if pagination.hasNext}}<a href="?page={{pagination.nextPage}}">Next</a>{{/if}}
397
- </nav>
398
- {{/if}}
399
- `;
400
- export const THEME_TEMPLATE_FILES = {
401
- // Static front page (Reading Settings → homepage): renders the page body
402
- // (seeded hero/about/contact sections) plus the latest posts grid.
403
- 'front-page.astro': `<div class="site" data-theme="{{site.theme}}" data-template="front-page">
404
- ${HEADER}
405
- <main class="site-main">
406
- {{#if content.html}}
407
- {{{content.html}}}
408
- {{/if}}
409
- ${POSTS_SECTION} </main>
410
- ${FOOTER}</div>
411
- `,
412
- // Non-static home (no front page configured): hero + latest posts.
413
- 'home.astro': `<div class="site" data-theme="{{site.theme}}" data-template="home">
414
- ${HEADER}
415
- <main class="site-main">
416
- <section class="hero">
417
- <p class="hero__kicker">Welcome</p>
418
- <h1 class="hero__title">{{site.title}}</h1>
419
- {{#if site.description}}
420
- <p class="hero__description">{{site.description}}</p>
421
- {{/if}}
422
- <div class="hero__actions">
423
- <a class="btn btn--primary" href="#posts">Browse posts</a>
424
- </div>
425
- </section>
426
- ${POSTS_SECTION} </main>
427
- ${FOOTER}</div>
428
- `,
429
- // Generic fallback: page-ish content + items listing.
430
- 'index.astro': `<div class="site" data-theme="{{site.theme}}" data-template="index" data-type="{{page.type}}">
431
- ${HEADER}
432
- <main class="site-main">
433
- <article class="entry">
434
- <header class="entry__header">
435
- <p class="entry__kicker">{{page.type}}</p>
436
- <h1 class="entry__title">{{page.title}}</h1>
437
- {{#if site.description}}
438
- <p class="entry__meta">{{site.description}}</p>
439
- {{/if}}
440
- </header>
441
- <div class="entry__body">
442
- {{#if content.html}}{{{content.html}}}{{/if}}
443
- {{#if content.content}}{{{content.content}}}{{/if}}
444
- {{#if content.text}}<p>{{content.text}}</p>{{/if}}
445
- </div>
446
- </article>
447
- ${POSTS_SECTION} </main>
448
- ${FOOTER}</div>
449
- `,
450
- // Single post: title, date, categories, cover, body, back link.
451
- 'single.astro': `<div class="site" data-theme="{{site.theme}}" data-template="single" data-type="{{page.type}}">
452
- ${HEADER}
453
- <main class="site-main">
454
- <article class="entry">
455
- <header class="entry__header">
456
- <p class="entry__kicker">Post</p>
457
- <h1 class="entry__title">{{content.title}}</h1>
458
- <div class="entry__meta">
459
- {{#if content.published_at}}<time datetime="{{content.published_at}}">{{content.published_at}}</time>{{/if}}
460
- {{#if _terms.category}}
461
- <span class="entry__terms">
462
- {{#each _terms.category}}<span class="badge">{{name}}</span>{{/each}}
463
- </span>
464
- {{/if}}
465
- </div>
466
- </header>
467
- {{#if content.cover.url}}
468
- <img class="entry__cover" src="{{content.cover.url}}" alt="{{content.cover.alt}}" loading="lazy" />
469
- {{/if}}
470
- {{#if content.thumbnail.url}}
471
- <img class="entry__cover" src="{{content.thumbnail.url}}" alt="{{content.thumbnail.alt}}" loading="lazy" />
472
- {{/if}}
473
- <div class="entry__body">
474
- {{#if content.html}}{{{content.html}}}{{/if}}
475
- {{#if content.content}}{{{content.content}}}{{/if}}
476
- {{#if content.text}}<p>{{content.text}}</p>{{/if}}
477
- </div>
478
- <footer class="entry__footer">
479
- <a class="entry__back" href="/blog">← Back to the blog</a>
480
- {{#if content.updated_at}}<span>Updated {{content.updated_at}}</span>{{/if}}
481
- </footer>
482
- </article>
483
- </main>
484
- ${FOOTER}</div>
485
- `,
486
- // Static page (also the front-page fallback when front-page.astro is absent).
487
- 'page.astro': `<div class="site" data-theme="{{site.theme}}" data-template="page" data-type="{{page.type}}">
488
- ${HEADER}
489
- <main class="site-main">
490
- <article class="entry">
491
- <header class="entry__header">
492
- <p class="entry__kicker">Page</p>
493
- <h1 class="entry__title">{{content.title}}</h1>
494
- </header>
495
- <div class="entry__body">
496
- {{#if content.html}}{{{content.html}}}{{/if}}
497
- {{#if content.content}}{{{content.content}}}{{/if}}
498
- {{#if content.text}}<p>{{content.text}}</p>{{/if}}
499
- </div>
500
- </article>
501
- </main>
502
- ${FOOTER}</div>
503
- `,
504
- // Posts page (Reading Settings → posts page, WP `home.php`): title + intro
505
- // from the page body, then the latest posts grid fed by `items`.
506
- 'posts.astro': `<div class="site" data-theme="{{site.theme}}" data-template="posts">
507
- ${HEADER}
508
- <main class="site-main">
509
- <header class="archive-header">
510
- <h1 class="archive-header__title">{{page.title}}</h1>
511
- {{#if content.html}}
512
- <div class="archive-header__description">{{{content.html}}}</div>
513
- {{/if}}
514
- </header>
515
-
516
- <section class="section section--tight">
517
- {{#if items}}
518
- <div class="cards">
519
- {{#each items}}
520
- <article class="card">
521
- {{#if published_at}}<time class="card__date" datetime="{{published_at}}">{{published_at}}</time>{{/if}}
522
- <h2 class="card__title"><a href="/{{slug}}">{{title}}</a></h2>
523
- {{#if excerpt}}<p class="card__excerpt">{{excerpt}}</p>{{/if}}
524
- <a class="card__more" href="/{{slug}}">Read more →</a>
525
- </article>
526
- {{/each}}
527
- </div>
528
- {{/if}}
529
- ${PAGINATION}
530
- </section>
531
- </main>
532
- ${FOOTER}</div>
533
- `,
534
- // Archive (post type listing — e.g. /post when the type has an archive).
535
- 'archive.astro': `<div class="site" data-theme="{{site.theme}}" data-template="archive" data-type="{{page.type}}">
536
- ${HEADER}
537
- <main class="site-main">
538
- <header class="archive-header">
539
- <h1 class="archive-header__title">{{page.title}}</h1>
540
- {{#if site.description}}
541
- <p class="archive-header__description">{{site.description}}</p>
542
- {{/if}}
543
- </header>
544
-
545
- <section class="section section--tight">
546
- {{#if items}}
547
- <div class="cards">
548
- {{#each items}}
549
- <article class="card">
550
- {{#if published_at}}<time class="card__date" datetime="{{published_at}}">{{published_at}}</time>{{/if}}
551
- <h2 class="card__title"><a href="/{{slug}}">{{title}}</a></h2>
552
- {{#if excerpt}}<p class="card__excerpt">{{excerpt}}</p>{{/if}}
553
- <a class="card__more" href="/{{slug}}">Read more →</a>
554
- </article>
555
- {{/each}}
556
- </div>
557
- {{/if}}
558
- ${PAGINATION}
559
- </section>
560
- </main>
561
- ${FOOTER}</div>
562
- `,
563
- '404.astro': `<div class="site" data-theme="{{site.theme}}" data-template="404">
564
- ${HEADER}
565
- <main class="site-main">
566
- <section class="not-found">
567
- <h1 class="not-found__code">404</h1>
568
- <p class="not-found__message">Page not found. It may have been moved or deleted.</p>
569
- <a class="btn btn--outline" href="/">{{site.title}}</a>
570
- </section>
571
- </main>
572
- ${FOOTER}</div>
573
- `,
574
- // Page: About (English slug fallback for page-{slug}.astro hierarchy)
575
- 'page-about.astro': `<main data-template="page-about" data-type="page" class="page-about">
576
- <header class="site-header">
577
- <nav class="nav" role="navigation" aria-label="Main navigation">
578
- <a href="/" class="site-brand" aria-label="Home">
579
- {{site.title}}
580
- </a>
581
- <ul class="nav-menu">
582
- <li><a href="/about">{{#if menus.header.bySlug.about}}{{menus.header.bySlug.about.label}}{{else}}About{{/if}}</a></li>
583
- <li><a href="#contact">Contact</a></li>
584
- <li><a href="/blog">{{#if menus.header.bySlug.blog}}{{menus.header.bySlug.blog.label}}{{else}}Blog{{/if}}</a></li>
585
- </ul>
586
- </nav>
587
- </header>
588
-
589
- <section class="page-header">
590
- <div class="container">
591
- <h1>{{field "title"}}</h1>
592
- {{#if (field "excerpt")}}
593
- <p class="page-excerpt">{{field "excerpt"}}</p>
594
- {{/if}}
595
- </div>
596
- </header>
597
-
598
- <div class="page-content container">
599
- {{#if (field "content")}}
600
- <div class="entry-content">{{{field "content"}}}</div>
601
- {{else if (field "blocks")}}
602
- <div class="entry-content">
603
- {{#each fields.blocks}}
604
- {{#if (eq type 'heading')}}
605
- <h{{level}}>{{content}}</h{{level}}>
606
- {{else if (eq type 'paragraph')}}
607
- <p>{{content}}</p>
608
- {{else if (eq type 'image')}}
609
- <figure><img src="{{content.url}}" alt="{{content.alt}}" /></figure>
610
- {{/if}}
611
- {{/each}}
612
- </div>
613
- {{/if}}
614
- </div>
615
- </main>
616
-
617
- <footer class="site-footer" role="contentinfo">
618
- <div class="container">
619
- <nav class="footer-nav" aria-label="Footer navigation">
620
- {{#each menus.footer.items}}
621
- <a href="{{url}}">{{label}}</a>
622
- {{/each}}
623
- </nav>
624
- <p class="copyright">&copy; {{new Date().getFullYear()}} {{site.title}}. All rights reserved.</p>
625
- </div>
626
- </footer>
627
- `,
628
- // Page: Contact (English slug fallback for page-{slug}.astro hierarchy)
629
- 'page-contact.astro': `<main data-template="page-contact" data-type="page" class="page-contact">
630
- <header class="site-header">
631
- <nav class="nav" role="navigation" aria-label="Main navigation">
632
- <a href="/" class="site-brand" aria-label="Home">
633
- {{site.title}}
634
- </a>
635
- <ul class="nav-menu">
636
- <li><a href="/about">{{#if menus.header.bySlug.about}}{{menus.header.bySlug.about.label}}{{else}}About{{/if}}</a></li>
637
- <li><a href="#contact">Contact</a></li>
638
- <li><a href="/blog">{{#if menus.header.bySlug.blog}}{{menus.header.bySlug.blog.label}}{{else}}Blog{{/if}}</a></li>
639
- </ul>
640
- </nav>
641
- </header>
642
-
643
- <section class="page-header">
644
- <div class="container">
645
- <h1>{{field "title"}}</h1>
646
- {{#if (field "excerpt")}}
647
- <p class="page-excerpt">{{field "excerpt"}}</p>
648
- {{/if}}
649
- </div>
650
- </section>
651
-
652
- <section class="contact" id="contact" aria-labelledby="contact-title">
653
- <div class="container">
654
- <h2 id="contact-title">Get in Touch</h2>
655
- <p class="contact-intro">{{settings.contactText || 'Fill out the form or send us an email at hello@example.com — we would love to hear from you.'}}</p>
656
- <form class="contact-form" action="mailto:hello@example.com" method="POST" enctype="text/plain">
657
- <div class="form-group">
658
- <label for="contact-name">Name</label>
659
- <input type="text" id="contact-name" name="name" required />
660
- </div>
661
- <div class="form-group">
662
- <label for="contact-email">E-mail</label>
663
- <input type="email" id="contact-email" name="email" required />
664
- </div>
665
- <div class="form-group">
666
- <label for="contact-message">Message</label>
667
- <textarea id="contact-message" name="message" rows="5" required></textarea>
668
- </div>
669
- <button type="submit" class="btn btn-primary">Send</button>
670
- </form>
671
- </div>
672
- </section>
673
- </main>
674
-
675
- <footer class="site-footer" role="contentinfo">
676
- <div class="container">
677
- <nav class="footer-nav" aria-label="Footer navigation">
678
- {{#each menus.footer.items}}
679
- <a href="{{url}}">{{label}}</a>
680
- {{/each}}
681
- </nav>
682
- <p class="copyright">&copy; {{new Date().getFullYear()}} {{site.title}}. All rights reserved.</p>
683
- </div>
684
- </footer>
685
- `,
686
- // Post: first post (English slug fallback for post-{slug}.astro hierarchy)
687
- 'post-first-post.astro': `<article data-template="post-first-post" data-type="post" class="post post-single">
688
- <header class="post-header">
689
- <div class="container">
690
- <h1 class="post-title">{{field "title"}}</h1>
691
- <div class="post-meta">
692
- <time datetime="{{content.published_at}}" class="post-date">
693
- {{#if content.published_at}}
694
- {{formatDate content.published_at}}
695
- {{/if}}
696
- </time>
697
- </div>
698
- </div>
699
- </header>
700
-
701
- <div class="post-body container">
702
- {{#if (field "content")}}
703
- <div class="entry-content">{{{field "content"}}}</div>
704
- {{else if (field "blocks")}}
705
- <div class="entry-content">
706
- {{#each fields.blocks}}
707
- {{#if (eq type 'heading')}}
708
- <h{{level}}>{{content}}</h{{level}}>
709
- {{else if (eq type 'paragraph')}}
710
- <p>{{content}}</p>
711
- {{else if (eq type 'image')}}
712
- <figure><img src="{{content.url}}" alt="{{content.alt}}" /></figure>
713
- {{/if}}
714
- {{/each}}
715
- </div>
716
- {{/if}}
717
- </div>
718
-
719
- <footer class="post-footer">
720
- <div class="container">
721
- <nav class="post-nav" aria-label="Post navigation">
722
- {{#if prevPost}}
723
- <a href="/{{page.type}}/{{prevPost.slug}}" class="post-nav__prev" rel="prev">
724
- <span class="post-nav__label">Previous article</span>
725
- <span class="post-nav__title">{{prevPost.title}}</span>
726
- </a>
727
- {{/if}}
728
- {{#if nextPost}}
729
- <a href="/{{page.type}}/{{nextPost.slug}}" class="post-nav__next" rel="next">
730
- <span class="post-nav__label">Next article</span>
731
- <span class="post-nav__title">{{nextPost.title}}</span>
732
- </a>
733
- {{/if}}
734
- </nav>
735
- </div>
736
- </footer>
737
- </article>
738
- `,
739
- // Post: second post (English slug fallback for post-{slug}.astro hierarchy)
740
- 'post-second-post.astro': `<article data-template="post-second-post" data-type="post" class="post post-single">
741
- <header class="post-header">
742
- <div class="container">
743
- <h1 class="post-title">{{field "title"}}</h1>
744
- <div class="post-meta">
745
- <time datetime="{{content.published_at}}" class="post-date">
746
- {{#if content.published_at}}
747
- {{formatDate content.published_at}}
748
- {{/if}}
749
- </time>
750
- </div>
751
- </div>
752
- </header>
753
-
754
- <div class="post-body container">
755
- {{#if (field "content")}}
756
- <div class="entry-content">{{{field "content"}}}</div>
757
- {{else if (field "blocks")}}
758
- <div class="entry-content">
759
- {{#each fields.blocks}}
760
- {{#if (eq type 'heading')}}
761
- <h{{level}}>{{content}}</h{{level}}>
762
- {{else if (eq type 'paragraph')}}
763
- <p>{{content}}</p>
764
- {{else if (eq type 'image')}}
765
- <figure><img src="{{content.url}}" alt="{{content.alt}}" /></figure>
766
- {{/if}}
767
- {{/each}}
768
- </div>
769
- {{/if}}
770
- </div>
771
-
772
- <footer class="post-footer">
773
- <div class="container">
774
- <nav class="post-nav" aria-label="Post navigation">
775
- {{#if prevPost}}
776
- <a href="/{{page.type}}/{{prevPost.slug}}" class="post-nav__prev" rel="prev">
777
- <span class="post-nav__label">Previous article</span>
778
- <span class="post-nav__title">{{prevPost.title}}</span>
779
- </a>
780
- {{/if}}
781
- {{#if nextPost}}
782
- <a href="/{{page.type}}/{{nextPost.slug}}" class="post-nav__next" rel="next">
783
- <span class="post-nav__label">Next article</span>
784
- <span class="post-nav__title">{{nextPost.title}}</span>
785
- </a>
786
- {{/if}}
787
- </nav>
788
- </div>
789
- </footer>
790
- </article>
791
- `,
792
- };
793
- /** Real default theme screenshot (PNG 600×400 — preview card in the admin). */
794
- const DEFAULT_THEME_SCREENSHOT_BASE64 = 'iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQCAYAAAByNR6YAAAIT0lEQVR4nO3WsU0EQQAEwYsOl9gxsLBfGARxJNHPa9gqqf0x57oBAEhdrx4AAPDfOFgAADEH' +
795
- 'CwAg5mABAMQcLACAmIMFABBzsAAAYg4WAEDMwQIAiDlYAAAxBwsAIOZgAQDEHCwAgJiDBQAQc7AAAGIOFgBAzMECAIg5WAAAMQcLACDmYAEAxBwsAICYgwUA' +
796
- 'EHOwAABiDhYAQMzBAgCIOVgAADEHCwAg5mABAMQcLACAmIMFABBzsAAAYg4WAEDMwQIAiDlYAAAxBwsAIOZgAQDEHCwAgJiDBQAQc7AAAGIOFgBAzMECAIg5' +
797
- 'WAAAMQcLACDmYAEAxBwsAICYgwUAEHOwAABiDhYAQMzBAgCIOVgAADEHCwAg5mABAMQcLACAmIMFABBzsAAAYg4WAEDMwQIAiDlYAAAxBwsAIOZgAQDEHCwA' +
798
- 'gJiDBQAQc7AAAGIOFgBAzMECAIg5WAAAMQcLACDmYAEAxBwsAICYgwUAEHOwAABiDhYAQMzBAgCIOVgAADEHCwAg5mABAMQcLACAmIMFABBzsAAAYg4WAEDM' +
799
- 'wQIAiDlYAAAxBwsAIOZgAQDEHCwAgJiDBQAQc7AAAGIOFgBAzMECAIg5WAAAMQcLACDmYAEAxBwsAICYgwUAEHOwAABixx2s97eHpOEAFjhYkqYCWOBgSZoK' +
800
- 'YIGDJWkqgAUOlqSpABY4WJKmAljgYEmaCmCBgyVpKoAFDpakqQAWOFiSpgJY4GBJmgpggYMlaSqABQ6WpKkAFjhYkqYCWOBgSZoKYIGDJWkqgAUOlqSpABY4' +
801
- 'WJKmAljgYEmaCmCBgyVpKoAFDpakqQAWOFiSpgJY4GBJmgpggYMlaSqABQ6WpKkAFjhYkqYCWOBgSZoKYIGDJWkqgAUOlqSpABY4WJKmAljgYEmaCmCBgyVp' +
802
- 'KoAFDpakqQAWOFiSpgJY4GBJmgpggYMlaSqABQ6WpKkAFjhYkqYCWOBgSZoKYIGDJWkqgAUOlqSpABY4WJKmAljgYEmaCmCBgyVpKoAFDpakqQAWOFiSpgJY' +
803
- '4GBJmgpggYMlaSqABQ6WpKkAFjhYkqYCWOBgSZoKYIGDJWkqgAUOlqSpABY4WJKmAljgYEmaCmCBgyVpKoAFDpakqQAWOFiSpgJY4GBJmgpggYMlaSqABQ6W' +
804
- 'pKkAFjhYkqYCWOBgSZoKYIGDJWkqgAUOlqSpABY4WJKmAljgYEmaCmCBgyVpKoAFDpakqQAWOFiSpgJY4GBJmgpggYMlaSqABQ6WpKkAFhx3sAAAns3BAgCI' +
805
- 'OVgAADEHCwAg5mABAMQcLACAmIMFABBzsAAAYg4WAEDMwQIAiDlYAAAxBwsAIOZgAQDEHCwAgJiDBQAQc7AAAGIOFgBAzMECAIg5WAAAMQcLACDmYAEAxBws' +
806
- 'AICYgwUAEHOwAABiDhYAQMzBAgCIOVgAADEHCwAg5mABAMQcLACAmIMFABC7Ht8/tyRJkrocLEmSpDgHS5IkKc7BkiRJinOwJEmS4hwsSZKkOAdLkiQpzsGS' +
807
- 'JEmKc7AkSZLiHCxJkqQ4B0uSJCnOwZIkSYpzsCRJkuIcLEmSpDgHS5IkKc7BkiRJinOwJEmS4hwsSZKkOAdLkiQpzsGSJEmKc7AkSZLiHCxJkqQ4B0uSJCnO' +
808
- 'wZIkSYpzsCRJkuIcLEmSpDgHS5IkKc7BkiRJinOwJEmS4hwsSZKkOAdLkiQpzsGSJEmKc7AkSZLiHCxJkqQ4B0uSJCnOwZIkSYpzsCRJkuIcLEmSpDgHS5Ik' +
809
- 'Kc7BkiRJinOwJEmS4hwsSZKkOAdLkiQpzsGSJEmKc7AkSZLiHCxJkqQ4B0uSJCnOwZIkSYpzsCRJkuIcLEmSpDgHS5IkKc7BkiRJinOwJEmS4hwsSZKkOAdL' +
810
- 'kiQpzsGSJEmKc7AkSZLiHCxJkqQ4B0uSJCnOwZIkSYpzsCRJkuIcLEmSpDgHS5IkKc7BkiRJinOwJEmS4hwsSZKkOAdLkiQpzsGSJEmKc7AkSZLiHCxJkqQ4' +
811
- 'B0uSJCnOwZIkSYpzsCRJkuIcLEmSpDgHS5IkKc7BkiRJinOwJEmS4hwsSZKkOAdLkiQpzsGSJEmKc7AkSZLiHCxJkqQ4B0uSJCnOwZIkSYpzsCRJkuIcLEmS' +
812
- 'pDgHS5IkKc7BkiRJirtuAABSDhYAQMzBAgCIOVgAADEHCwAg5mABAMQcLACAmIMFABA77mB9fH5JkqQXdBIHS5Ik/UknOe5gAQA8m4MFABBzsAAAYg4WAEDM' +
813
- 'wQIAiDlYAAAxBwsAIOZgAQDEHCwAgJiDBQAQc7AAAGIOFgBAzMECAIg5WAAAMQcLACDmYAEAxBwsAICYgwUAEHOwAABiDhYAQMzBAgCIOVgAADEHCwAg5mAB' +
814
- 'AMQcLACAmIMFABBzsAAAYg4WAEDMwQIAiDlYAAAxBwsAIOZgAQDEHCwAgJiDBQAQc7AAAGIOFgBAzMECAIg5WAAAMQcLACDmYAEAxBwsAICYgwUAEHOwAABi' +
815
- 'DhYAQMzBAgCIOVgAADEHCwAg5mABAMQcLACAmIMFABBzsAAAYg4WAEDMwQIAiDlYAAAxBwsAIOZgAQDEHCwAgJiDBQAQc7AAAGIOFgBAzMECAIg5WAAAMQcL' +
816
- 'ACDmYAEAxBwsAICYgwUAEHOwAABiDhYAQMzBAgCIOVgAADEHCwAg5mABAMQcLACAmIMFABBzsAAAYg4WAEDMwQIAiDlYAAAxBwsAIOZgAQDEHCwAgJiDBQAQ' +
817
- 'c7AAAGIOFgBAzMECAIg5WAAAMQcLACDmYAEAxBwsAICYgwUAEHOwAABiDhYAQMzBAgCIOVgAADEHCwAg5mABAMQcLACAmIMFABBzsAAAYg4WAEDMwQIAiDlY' +
818
- 'AACxXxc1EEhePb4DAAAAAElFTkSuQmCC';
819
- /** Complete default theme written by `okcms init` (paths relative to themes/default/). */
820
- export const DEFAULT_THEME_FILES = {
821
- 'theme.json': DEFAULT_THEME_MANIFEST,
822
- ...THEME_TEMPLATE_FILES,
823
- 'dist/theme.css': DEFAULT_THEME_CSS,
824
- };
825
- /**
826
- * BINARY files of the default theme: written with a Buffer decoded from
827
- * base64 (writing a string would corrupt the PNG). Same re-init rule —
828
- * never overwrites a file that is already present.
829
- */
830
- export const DEFAULT_THEME_BINARY_FILES = {
831
- 'screenshot.png': DEFAULT_THEME_SCREENSHOT_BASE64,
832
- };
28
+ export function isBinaryThemeAsset(relativePath) {
29
+ return Object.prototype.hasOwnProperty.call(DEFAULT_THEME_BINARY_FILES, relativePath);
30
+ }
833
31
  //# sourceMappingURL=theme-assets.js.map