@ampless/admin 0.2.0-alpha.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.
@@ -0,0 +1,738 @@
1
+ var common = {
2
+ save: "Save",
3
+ saving: "Saving...",
4
+ cancel: "Cancel",
5
+ "delete": "Delete",
6
+ edit: "Edit",
7
+ back: "Back",
8
+ loading: "Loading...",
9
+ "default": "Default",
10
+ remove: "Remove",
11
+ create: "Create",
12
+ yes: "Yes",
13
+ no: "No",
14
+ confirm: "Confirm",
15
+ title: "Title",
16
+ name: "Name",
17
+ description: "Description",
18
+ url: "URL",
19
+ tags: "Tags",
20
+ status: "Status",
21
+ actions: "Actions",
22
+ draft: "Draft",
23
+ published: "Published",
24
+ preview: "Preview",
25
+ active: "Active",
26
+ siteId: "siteId",
27
+ updated: "Updated"
28
+ };
29
+ var sidebar = {
30
+ brand: "ampless",
31
+ dashboard: "Dashboard",
32
+ posts: "Posts",
33
+ media: "Media",
34
+ sites: "Sites",
35
+ viewSite: "View site",
36
+ signOut: "Sign out",
37
+ site: "Site"
38
+ };
39
+ var dashboard = {
40
+ title: "Dashboard",
41
+ newPost: "New post",
42
+ totalPosts: "Posts",
43
+ totalLabel: "total",
44
+ published: "Published",
45
+ drafts: "Drafts"
46
+ };
47
+ var posts = {
48
+ list: {
49
+ title: "Posts",
50
+ newButton: "New post",
51
+ empty: "No posts yet.",
52
+ createFirst: "Create your first post",
53
+ columnTitle: "Title",
54
+ columnStatus: "Status",
55
+ columnSlug: "Slug",
56
+ columnUpdated: "Updated"
57
+ },
58
+ form: {
59
+ newTitle: "New post",
60
+ editTitle: "Edit post",
61
+ title: "Title",
62
+ slug: "Slug",
63
+ slugPlaceholder: "my-post-slug",
64
+ excerpt: "Excerpt",
65
+ body: "Body",
66
+ format: "Format",
67
+ formatHint: "Tiptap is the rich editor. Markdown / HTML use a plain textarea. Tip: a slug ending in .html (e.g. promo.html) serves the post as a bare HTML response with no theme chrome.",
68
+ insertMedia: "Insert media",
69
+ tabEdit: "Edit",
70
+ tabPreview: "Preview",
71
+ previewNoTitle: "(no title yet)",
72
+ previewHint: "Preview reflects your current draft, including unsaved edits. On the public site the active theme adds its header / footer / typography around this content.",
73
+ tags: "Tags",
74
+ tagsPlaceholder: "comma, separated, tags",
75
+ tagsHint: "Used to group posts on tag pages (e.g. /tag/tech).",
76
+ status: "Status",
77
+ saveChanges: "Save changes",
78
+ createPost: "Create post",
79
+ "delete": "Delete",
80
+ deleteConfirm: "Delete \"{title}\"?"
81
+ }
82
+ };
83
+ var media = {
84
+ title: "Media",
85
+ uploading: "Uploading...",
86
+ queued: "{count} file(s) queued",
87
+ deleteConfirm: "Delete this file?",
88
+ copyUrl: "Copy URL",
89
+ copyTag: "Copy as HTML tag",
90
+ "delete": "Delete",
91
+ empty: "No media yet.",
92
+ dialog: {
93
+ remaining: "{count} file(s) remaining",
94
+ uploading: " · uploading…",
95
+ useOriginal: "Upload as original",
96
+ passthroughNote: "(GIF/SVG/AVIF/HEIC/BMP/TIFF are passed through automatically)",
97
+ aspectRatio: "Aspect ratio",
98
+ outputFormat: "Output format",
99
+ losslessWebp: "Lossless WebP",
100
+ quality: "Quality: {value}",
101
+ maxDimension: "Max dimension (px)",
102
+ cancelAll: "Cancel all",
103
+ skip: "Skip",
104
+ upload: "Upload",
105
+ uploadingButton: "Uploading…"
106
+ }
107
+ };
108
+ var mediaPicker = {
109
+ title: "Insert image",
110
+ description: "Pick from your media library or upload a new file.",
111
+ uploadNew: "Upload new",
112
+ empty: "No media yet.",
113
+ emptyHint: "Click {action} to add the first image.",
114
+ emptyAction: "Upload new"
115
+ };
116
+ var sites = {
117
+ list: {
118
+ title: "Sites",
119
+ description: "Per-site settings stored in DynamoDB. Adding sites and binding domains is done in cms.config.ts.",
120
+ columnSiteId: "Site ID",
121
+ columnName: "Name",
122
+ columnUrl: "URL",
123
+ columnDomains: "Domains",
124
+ edit: "Edit"
125
+ },
126
+ edit: {
127
+ themeLink: "Theme settings →",
128
+ site: "Site",
129
+ media: "Media",
130
+ imageDisplay: "Image display",
131
+ imageMaxWidth: "Image max width (CSS)",
132
+ dateDisplay: "Date display",
133
+ dateFormat: "Format",
134
+ timezone: "Timezone (IANA)",
135
+ saved: "Saved. The public site refreshes within ~1 minute (S3 cache + Next.js fetch cache).",
136
+ saveButton: "Save settings",
137
+ imageDisplayInline: "Inline",
138
+ imageDisplayLightbox: "Lightbox",
139
+ dateFormatIso: "ISO (YYYY-MM-DD)",
140
+ dateFormatLong: "Long (April 27, 2026)",
141
+ dateFormatLocale: "Locale",
142
+ defaultPlaceholder: "Default ({value})"
143
+ },
144
+ selector: {
145
+ label: "Site"
146
+ }
147
+ };
148
+ var theme = {
149
+ title: "Theme",
150
+ activeLabel: "Active theme",
151
+ currentlyActive: "Currently active: {theme}",
152
+ propagating: " (just switched — propagating)",
153
+ switchButton: "Switch theme",
154
+ switching: "Switching...",
155
+ switched: "Switched to {theme}. Public site refreshes within ~10 seconds (S3 cache rebuild).",
156
+ previewLabel: "Preview",
157
+ previewHint: "Live preview of the selected theme using the public site. Reflects values currently saved in S3 — Save first to preview unsaved manifest edits.",
158
+ saveButton: "Save theme",
159
+ saving: "Saving...",
160
+ saved: "Saved. Public site refreshes within ~10 seconds (S3 cache rebuild).",
161
+ invalidValues: "One or more values are invalid — fix highlighted fields and try again.",
162
+ customizationHeading: "{theme} customization",
163
+ customizationHint: "Empty input resets to the manifest default.",
164
+ lengthHelp: "CSS length, e.g. 0.5rem, 4px.",
165
+ imagePlaceholder: "https://… or /media/…"
166
+ };
167
+ var editor = {
168
+ linkPrompt: "URL",
169
+ altPrompt: "Alt text",
170
+ image: {
171
+ inline: "Inline",
172
+ inlineTitle: "Force inline display",
173
+ lightbox: "Lightbox",
174
+ lightboxTitle: "Force click-to-enlarge",
175
+ alt: "Alt",
176
+ "delete": "Delete"
177
+ }
178
+ };
179
+ var auth = {
180
+ common: {
181
+ email: "Email",
182
+ password: "Password",
183
+ newPassword: "New password",
184
+ code: "Verification code",
185
+ passwordHint: "Minimum 8 characters.",
186
+ working: "Working..."
187
+ },
188
+ signIn: {
189
+ title: "Sign in",
190
+ description: "Sign in to manage your site.",
191
+ submit: "Sign in",
192
+ forgotPassword: "Forgot password?",
193
+ createAccount: "Create admin account"
194
+ },
195
+ signUp: {
196
+ title: "Create admin account",
197
+ description: "The first user becomes the site admin.",
198
+ submit: "Sign up",
199
+ backToSignIn: "Back to sign in"
200
+ },
201
+ confirm: {
202
+ title: "Confirm email",
203
+ description: "Enter the verification code sent to your email.",
204
+ submit: "Confirm"
205
+ },
206
+ forgot: {
207
+ title: "Reset password",
208
+ description: "We'll email you a verification code.",
209
+ submit: "Send code",
210
+ codeSent: "Verification code sent. Check your email."
211
+ },
212
+ reset: {
213
+ title: "Set new password",
214
+ description: "Enter the code from your email and a new password.",
215
+ submit: "Update password",
216
+ resendCode: "Resend code",
217
+ passwordUpdated: "Password updated. Please sign in."
218
+ },
219
+ additionalStep: "Sign-in needs additional step: {step}",
220
+ errors: {
221
+ invalidCredentials: "Invalid email or password.",
222
+ passwordTooShort: "Password must be at least 8 characters.",
223
+ userExists: "An account with this email already exists."
224
+ }
225
+ };
226
+ var en = {
227
+ common: common,
228
+ sidebar: sidebar,
229
+ dashboard: dashboard,
230
+ posts: posts,
231
+ media: media,
232
+ mediaPicker: mediaPicker,
233
+ sites: sites,
234
+ theme: theme,
235
+ editor: editor,
236
+ auth: auth,
237
+ "public": {
238
+ back: "← Back",
239
+ home: "← Home",
240
+ noPosts: "No posts published yet.",
241
+ tagLabel: "Tag"
242
+ }
243
+ };
244
+
245
+ declare const dictionaries: {
246
+ readonly en: {
247
+ common: {
248
+ save: string;
249
+ saving: string;
250
+ cancel: string;
251
+ delete: string;
252
+ edit: string;
253
+ back: string;
254
+ loading: string;
255
+ default: string;
256
+ remove: string;
257
+ create: string;
258
+ yes: string;
259
+ no: string;
260
+ confirm: string;
261
+ title: string;
262
+ name: string;
263
+ description: string;
264
+ url: string;
265
+ tags: string;
266
+ status: string;
267
+ actions: string;
268
+ draft: string;
269
+ published: string;
270
+ preview: string;
271
+ active: string;
272
+ siteId: string;
273
+ updated: string;
274
+ };
275
+ sidebar: {
276
+ brand: string;
277
+ dashboard: string;
278
+ posts: string;
279
+ media: string;
280
+ sites: string;
281
+ viewSite: string;
282
+ signOut: string;
283
+ site: string;
284
+ };
285
+ dashboard: {
286
+ title: string;
287
+ newPost: string;
288
+ totalPosts: string;
289
+ totalLabel: string;
290
+ published: string;
291
+ drafts: string;
292
+ };
293
+ posts: {
294
+ list: {
295
+ title: string;
296
+ newButton: string;
297
+ empty: string;
298
+ createFirst: string;
299
+ columnTitle: string;
300
+ columnStatus: string;
301
+ columnSlug: string;
302
+ columnUpdated: string;
303
+ };
304
+ form: {
305
+ newTitle: string;
306
+ editTitle: string;
307
+ title: string;
308
+ slug: string;
309
+ slugPlaceholder: string;
310
+ excerpt: string;
311
+ body: string;
312
+ format: string;
313
+ formatHint: string;
314
+ insertMedia: string;
315
+ tabEdit: string;
316
+ tabPreview: string;
317
+ previewNoTitle: string;
318
+ previewHint: string;
319
+ tags: string;
320
+ tagsPlaceholder: string;
321
+ tagsHint: string;
322
+ status: string;
323
+ saveChanges: string;
324
+ createPost: string;
325
+ delete: string;
326
+ deleteConfirm: string;
327
+ };
328
+ };
329
+ media: {
330
+ title: string;
331
+ uploading: string;
332
+ queued: string;
333
+ deleteConfirm: string;
334
+ copyUrl: string;
335
+ copyTag: string;
336
+ delete: string;
337
+ empty: string;
338
+ dialog: {
339
+ remaining: string;
340
+ uploading: string;
341
+ useOriginal: string;
342
+ passthroughNote: string;
343
+ aspectRatio: string;
344
+ outputFormat: string;
345
+ losslessWebp: string;
346
+ quality: string;
347
+ maxDimension: string;
348
+ cancelAll: string;
349
+ skip: string;
350
+ upload: string;
351
+ uploadingButton: string;
352
+ };
353
+ };
354
+ mediaPicker: {
355
+ title: string;
356
+ description: string;
357
+ uploadNew: string;
358
+ empty: string;
359
+ emptyHint: string;
360
+ emptyAction: string;
361
+ };
362
+ sites: {
363
+ list: {
364
+ title: string;
365
+ description: string;
366
+ columnSiteId: string;
367
+ columnName: string;
368
+ columnUrl: string;
369
+ columnDomains: string;
370
+ edit: string;
371
+ };
372
+ edit: {
373
+ themeLink: string;
374
+ site: string;
375
+ media: string;
376
+ imageDisplay: string;
377
+ imageMaxWidth: string;
378
+ dateDisplay: string;
379
+ dateFormat: string;
380
+ timezone: string;
381
+ saved: string;
382
+ saveButton: string;
383
+ imageDisplayInline: string;
384
+ imageDisplayLightbox: string;
385
+ dateFormatIso: string;
386
+ dateFormatLong: string;
387
+ dateFormatLocale: string;
388
+ defaultPlaceholder: string;
389
+ };
390
+ selector: {
391
+ label: string;
392
+ };
393
+ };
394
+ theme: {
395
+ title: string;
396
+ activeLabel: string;
397
+ currentlyActive: string;
398
+ propagating: string;
399
+ switchButton: string;
400
+ switching: string;
401
+ switched: string;
402
+ previewLabel: string;
403
+ previewHint: string;
404
+ saveButton: string;
405
+ saving: string;
406
+ saved: string;
407
+ invalidValues: string;
408
+ customizationHeading: string;
409
+ customizationHint: string;
410
+ lengthHelp: string;
411
+ imagePlaceholder: string;
412
+ };
413
+ editor: {
414
+ linkPrompt: string;
415
+ altPrompt: string;
416
+ image: {
417
+ inline: string;
418
+ inlineTitle: string;
419
+ lightbox: string;
420
+ lightboxTitle: string;
421
+ alt: string;
422
+ delete: string;
423
+ };
424
+ };
425
+ auth: {
426
+ common: {
427
+ email: string;
428
+ password: string;
429
+ newPassword: string;
430
+ code: string;
431
+ passwordHint: string;
432
+ working: string;
433
+ };
434
+ signIn: {
435
+ title: string;
436
+ description: string;
437
+ submit: string;
438
+ forgotPassword: string;
439
+ createAccount: string;
440
+ };
441
+ signUp: {
442
+ title: string;
443
+ description: string;
444
+ submit: string;
445
+ backToSignIn: string;
446
+ };
447
+ confirm: {
448
+ title: string;
449
+ description: string;
450
+ submit: string;
451
+ };
452
+ forgot: {
453
+ title: string;
454
+ description: string;
455
+ submit: string;
456
+ codeSent: string;
457
+ };
458
+ reset: {
459
+ title: string;
460
+ description: string;
461
+ submit: string;
462
+ resendCode: string;
463
+ passwordUpdated: string;
464
+ };
465
+ additionalStep: string;
466
+ errors: {
467
+ invalidCredentials: string;
468
+ passwordTooShort: string;
469
+ userExists: string;
470
+ };
471
+ };
472
+ public: {
473
+ back: string;
474
+ home: string;
475
+ noPosts: string;
476
+ tagLabel: string;
477
+ };
478
+ };
479
+ readonly ja: {
480
+ common: {
481
+ save: string;
482
+ saving: string;
483
+ cancel: string;
484
+ delete: string;
485
+ edit: string;
486
+ back: string;
487
+ loading: string;
488
+ default: string;
489
+ remove: string;
490
+ create: string;
491
+ yes: string;
492
+ no: string;
493
+ confirm: string;
494
+ title: string;
495
+ name: string;
496
+ description: string;
497
+ url: string;
498
+ tags: string;
499
+ status: string;
500
+ actions: string;
501
+ draft: string;
502
+ published: string;
503
+ preview: string;
504
+ active: string;
505
+ siteId: string;
506
+ updated: string;
507
+ };
508
+ sidebar: {
509
+ brand: string;
510
+ dashboard: string;
511
+ posts: string;
512
+ media: string;
513
+ sites: string;
514
+ viewSite: string;
515
+ signOut: string;
516
+ site: string;
517
+ };
518
+ dashboard: {
519
+ title: string;
520
+ newPost: string;
521
+ totalPosts: string;
522
+ totalLabel: string;
523
+ published: string;
524
+ drafts: string;
525
+ };
526
+ posts: {
527
+ list: {
528
+ title: string;
529
+ newButton: string;
530
+ empty: string;
531
+ createFirst: string;
532
+ columnTitle: string;
533
+ columnStatus: string;
534
+ columnSlug: string;
535
+ columnUpdated: string;
536
+ };
537
+ form: {
538
+ newTitle: string;
539
+ editTitle: string;
540
+ title: string;
541
+ slug: string;
542
+ slugPlaceholder: string;
543
+ excerpt: string;
544
+ body: string;
545
+ format: string;
546
+ formatHint: string;
547
+ insertMedia: string;
548
+ tabEdit: string;
549
+ tabPreview: string;
550
+ previewNoTitle: string;
551
+ previewHint: string;
552
+ tags: string;
553
+ tagsPlaceholder: string;
554
+ tagsHint: string;
555
+ status: string;
556
+ saveChanges: string;
557
+ createPost: string;
558
+ delete: string;
559
+ deleteConfirm: string;
560
+ };
561
+ };
562
+ media: {
563
+ title: string;
564
+ uploading: string;
565
+ queued: string;
566
+ deleteConfirm: string;
567
+ copyUrl: string;
568
+ copyTag: string;
569
+ delete: string;
570
+ empty: string;
571
+ dialog: {
572
+ remaining: string;
573
+ uploading: string;
574
+ useOriginal: string;
575
+ passthroughNote: string;
576
+ aspectRatio: string;
577
+ outputFormat: string;
578
+ losslessWebp: string;
579
+ quality: string;
580
+ maxDimension: string;
581
+ cancelAll: string;
582
+ skip: string;
583
+ upload: string;
584
+ uploadingButton: string;
585
+ };
586
+ };
587
+ mediaPicker: {
588
+ title: string;
589
+ description: string;
590
+ uploadNew: string;
591
+ empty: string;
592
+ emptyHint: string;
593
+ emptyAction: string;
594
+ };
595
+ sites: {
596
+ list: {
597
+ title: string;
598
+ description: string;
599
+ columnSiteId: string;
600
+ columnName: string;
601
+ columnUrl: string;
602
+ columnDomains: string;
603
+ edit: string;
604
+ };
605
+ edit: {
606
+ themeLink: string;
607
+ site: string;
608
+ media: string;
609
+ imageDisplay: string;
610
+ imageMaxWidth: string;
611
+ dateDisplay: string;
612
+ dateFormat: string;
613
+ timezone: string;
614
+ saved: string;
615
+ saveButton: string;
616
+ imageDisplayInline: string;
617
+ imageDisplayLightbox: string;
618
+ dateFormatIso: string;
619
+ dateFormatLong: string;
620
+ dateFormatLocale: string;
621
+ defaultPlaceholder: string;
622
+ };
623
+ selector: {
624
+ label: string;
625
+ };
626
+ };
627
+ theme: {
628
+ title: string;
629
+ activeLabel: string;
630
+ currentlyActive: string;
631
+ propagating: string;
632
+ switchButton: string;
633
+ switching: string;
634
+ switched: string;
635
+ previewLabel: string;
636
+ previewHint: string;
637
+ saveButton: string;
638
+ saving: string;
639
+ saved: string;
640
+ invalidValues: string;
641
+ customizationHeading: string;
642
+ customizationHint: string;
643
+ lengthHelp: string;
644
+ imagePlaceholder: string;
645
+ };
646
+ editor: {
647
+ linkPrompt: string;
648
+ altPrompt: string;
649
+ image: {
650
+ inline: string;
651
+ inlineTitle: string;
652
+ lightbox: string;
653
+ lightboxTitle: string;
654
+ alt: string;
655
+ delete: string;
656
+ };
657
+ };
658
+ auth: {
659
+ common: {
660
+ email: string;
661
+ password: string;
662
+ newPassword: string;
663
+ code: string;
664
+ passwordHint: string;
665
+ working: string;
666
+ };
667
+ signIn: {
668
+ title: string;
669
+ description: string;
670
+ submit: string;
671
+ forgotPassword: string;
672
+ createAccount: string;
673
+ };
674
+ signUp: {
675
+ title: string;
676
+ description: string;
677
+ submit: string;
678
+ backToSignIn: string;
679
+ };
680
+ confirm: {
681
+ title: string;
682
+ description: string;
683
+ submit: string;
684
+ };
685
+ forgot: {
686
+ title: string;
687
+ description: string;
688
+ submit: string;
689
+ codeSent: string;
690
+ };
691
+ reset: {
692
+ title: string;
693
+ description: string;
694
+ submit: string;
695
+ resendCode: string;
696
+ passwordUpdated: string;
697
+ };
698
+ additionalStep: string;
699
+ errors: {
700
+ invalidCredentials: string;
701
+ passwordTooShort: string;
702
+ userExists: string;
703
+ };
704
+ };
705
+ public: {
706
+ back: string;
707
+ home: string;
708
+ noPosts: string;
709
+ tagLabel: string;
710
+ };
711
+ };
712
+ };
713
+ type Locale = keyof typeof dictionaries;
714
+ type Dictionary = typeof en;
715
+ type AdminLocaleStrings = Partial<Dictionary> & Record<string, unknown>;
716
+ /**
717
+ * Resolve the active locale from a `createAdmin` `locale` option.
718
+ *
719
+ * - `undefined` → fallback English.
720
+ * - string code in `dictionaries` → that built-in dictionary.
721
+ * - object → custom dictionary (no fallback merge here; lookups still
722
+ * fall back to English via `translate` if a key is missing).
723
+ */
724
+ interface ResolvedLocale {
725
+ locale: Locale;
726
+ dict: Dictionary;
727
+ }
728
+ declare function resolveLocale(input: string | AdminLocaleStrings | undefined): ResolvedLocale;
729
+ declare function getDictionary(locale?: Locale): Dictionary;
730
+ /**
731
+ * Translate a key using the given dictionary, with `{var}` interpolation.
732
+ * Falls back: requested dict → English dict → the key itself. The key
733
+ * fallback makes missing translations visible in the UI rather than
734
+ * silently rendering an empty string.
735
+ */
736
+ declare function translate(dict: Dictionary, key: string, vars?: Record<string, string | number>): string;
737
+
738
+ export { type AdminLocaleStrings as A, type Dictionary as D, type Locale as L, getDictionary as g, resolveLocale as r, translate as t };