@opnpress/opnpress-cli 0.2.3 → 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 (33) hide show
  1. package/dist/{build.js → cli/buildSite.js} +4 -4
  2. package/dist/{init.js → cli/initProject.js} +2 -2
  3. package/dist/{cli.js → cli/main.js} +2 -2
  4. package/dist/integrations/booking-calendar.js +23 -0
  5. package/dist/integrations/company-info.js +24 -0
  6. package/dist/integrations/contact-form.js +35 -0
  7. package/dist/integrations/contact-links.js +87 -0
  8. package/dist/integrations/index.js +18 -0
  9. package/dist/integrations/maps.js +23 -0
  10. package/dist/integrations/shareable-links.js +58 -0
  11. package/dist/integrations/socials-links.js +198 -0
  12. package/dist/integrations/video.js +74 -0
  13. package/dist/{linkEmbedding.js → renderer/aioHelper.js} +1 -16
  14. package/dist/renderer/footerHtmlBuilder.js +11 -0
  15. package/dist/renderer/headerHtmlBuilder.js +20 -0
  16. package/dist/renderer/mdBodyHtmlBuilder.js +117 -0
  17. package/dist/renderer/pageGenerator.js +204 -0
  18. package/dist/renderer/pageHelpers.js +132 -0
  19. package/dist/renderer/rawBodyHtmlBuilder.js +3 -0
  20. package/dist/{jsEmbedding.js → renderer/scriptBuilder.js} +14 -5
  21. package/dist/renderer/themeBuilder.js +723 -0
  22. package/dist/rendering/contact.js +149 -0
  23. package/dist/rendering/shared.js +75 -0
  24. package/dist/shortcodes/cardrow.js +85 -0
  25. package/dist/shortcodes/contact-card.js +24 -0
  26. package/dist/shortcodes/index.js +14 -0
  27. package/dist/shortcodes/js.js +7 -0
  28. package/dist/shortcodes/mailto.js +31 -0
  29. package/dist/shortcodes/pagelist.js +82 -0
  30. package/dist/shortcodes/tel.js +24 -0
  31. package/package.json +6 -6
  32. package/dist/render.js +0 -2041
  33. /package/dist/{server.js → cli/server.js} +0 -0
@@ -0,0 +1,723 @@
1
+ export function buildThemeCss(theme) {
2
+ const vars = [
3
+ `--color-primary: ${theme.colors.primary};`,
4
+ `--color-accent: ${theme.colors.accent};`,
5
+ `--color-background: ${theme.colors.background};`,
6
+ `--color-surface: ${theme.colors.surface};`,
7
+ `--color-text: ${theme.colors.text};`,
8
+ `--color-muted: ${theme.colors.muted};`,
9
+ `--color-border: ${theme.colors.border};`,
10
+ `--font-heading: ${theme.fonts.heading};`,
11
+ `--font-body: ${theme.fonts.body};`,
12
+ `--font-mono: ${theme.fonts.mono};`,
13
+ `--content-width: ${theme.sizing.contentWidth};`,
14
+ `--radius: ${theme.sizing.radius};`,
15
+ `--spacing: ${theme.sizing.spacing};`
16
+ ].join('\n');
17
+ return `
18
+ :root {
19
+ ${vars}
20
+ }
21
+
22
+ * { box-sizing: border-box; }
23
+
24
+ html, body {
25
+ margin: 0;
26
+ padding: 0;
27
+ min-height: 100%;
28
+ }
29
+
30
+ body {
31
+ font-family: var(--font-body);
32
+ color: var(--color-text);
33
+ background: ${theme.backgrounds.page};
34
+ line-height: 1.6;
35
+ }
36
+
37
+ a {
38
+ color: var(--color-primary);
39
+ text-decoration-thickness: 0.08em;
40
+ text-underline-offset: 0.16em;
41
+ }
42
+
43
+ img {
44
+ max-width: 100%;
45
+ height: auto;
46
+ }
47
+
48
+ .site-shell {
49
+ width: min(var(--content-width), calc(100vw - 2rem));
50
+ margin: 0 auto;
51
+ padding: 1.5rem 0 4rem;
52
+ }
53
+
54
+ .site-header {
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: space-between;
58
+ gap: 1rem;
59
+ margin-bottom: 2rem;
60
+ padding: 1rem 0;
61
+ border-bottom: 1px solid var(--color-border);
62
+ }
63
+
64
+ .site-brand {
65
+ display: inline-flex;
66
+ align-items: center;
67
+ gap: 0.65rem;
68
+ font-family: var(--font-heading);
69
+ font-size: 1.35rem;
70
+ font-weight: 700;
71
+ color: var(--color-text);
72
+ text-decoration: none;
73
+ }
74
+
75
+ .site-logo {
76
+ width: 2.75rem;
77
+ height: 2.75rem;
78
+ object-fit: contain;
79
+ display: block;
80
+ }
81
+
82
+ .site-nav,
83
+ .site-footer-nav {
84
+ display: flex;
85
+ flex-wrap: wrap;
86
+ gap: 0.85rem 1.25rem;
87
+ align-items: center;
88
+ }
89
+
90
+ .site-discovery-nav {
91
+ display: flex;
92
+ flex-wrap: wrap;
93
+ gap: 0.45rem 0.85rem;
94
+ align-items: center;
95
+ font-size: 0.84rem;
96
+ line-height: 1.25;
97
+ }
98
+
99
+ .site-discovery-nav-header {
100
+ margin-top: -0.2rem;
101
+ }
102
+
103
+ .site-discovery-nav-footer {
104
+ justify-content: flex-end;
105
+ }
106
+
107
+ .page-discovery {
108
+ display: grid;
109
+ gap: 0.45rem;
110
+ margin-top: 1.75rem;
111
+ padding-top: 1rem;
112
+ border-top: 1px solid var(--color-border);
113
+ }
114
+
115
+ .page-discovery-label {
116
+ margin: 0;
117
+ color: var(--color-muted);
118
+ font-size: 0.82rem;
119
+ text-transform: uppercase;
120
+ letter-spacing: 0.12em;
121
+ }
122
+
123
+ .page-discovery-links {
124
+ display: flex;
125
+ flex-wrap: wrap;
126
+ gap: 0.45rem 0.85rem;
127
+ align-items: center;
128
+ }
129
+
130
+ .nav-link {
131
+ color: var(--color-muted);
132
+ text-decoration: none;
133
+ font-size: 0.95rem;
134
+ }
135
+
136
+ .discovery-link {
137
+ color: var(--color-muted);
138
+ text-decoration: underline;
139
+ text-decoration-thickness: 0.08em;
140
+ text-underline-offset: 0.16em;
141
+ }
142
+
143
+ .discovery-link:hover {
144
+ color: var(--color-primary);
145
+ }
146
+
147
+ .nav-link:hover {
148
+ color: var(--color-primary);
149
+ }
150
+
151
+ .page-hero {
152
+ display: grid;
153
+ gap: 1rem;
154
+ padding: 2rem;
155
+ margin-bottom: 2rem;
156
+ border: 1px solid var(--color-border);
157
+ border-radius: var(--radius);
158
+ background: color-mix(in srgb, var(--color-surface) 92%, white 8%);
159
+ box-shadow: 0 10px 30px rgba(20, 33, 47, 0.05);
160
+ }
161
+
162
+ .page-hero h1,
163
+ .page-content h1,
164
+ .card h3 {
165
+ font-family: var(--font-heading);
166
+ line-height: 1.1;
167
+ margin: 0;
168
+ }
169
+
170
+ .eyebrow {
171
+ margin: 0;
172
+ text-transform: uppercase;
173
+ letter-spacing: 0.12em;
174
+ font-size: 0.77rem;
175
+ color: var(--color-muted);
176
+ }
177
+
178
+ .page-content {
179
+ display: grid;
180
+ gap: 0.85rem;
181
+ }
182
+
183
+ .page-content > * {
184
+ margin: 0;
185
+ }
186
+
187
+ .page-content h2,
188
+ .page-content h3,
189
+ .page-content h4 {
190
+ font-family: var(--font-heading);
191
+ line-height: 1.2;
192
+ }
193
+
194
+ .page-content h2 {
195
+ margin-top: 1rem;
196
+ }
197
+
198
+ .page-content h3 {
199
+ margin-top: 0.85rem;
200
+ }
201
+
202
+ .page-content h4 {
203
+ margin-top: 0.7rem;
204
+ }
205
+
206
+ .page-content p,
207
+ .page-content ul,
208
+ .page-content ol,
209
+ .page-content blockquote,
210
+ .page-content pre,
211
+ .page-content table {
212
+ margin: 0;
213
+ }
214
+
215
+ .page-content ul,
216
+ .page-content ol {
217
+ padding-left: 1.35rem;
218
+ }
219
+
220
+ .page-content li + li {
221
+ margin-top: 0.25rem;
222
+ }
223
+
224
+ .grid {
225
+ display: grid;
226
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
227
+ gap: 1rem;
228
+ }
229
+
230
+ .card {
231
+ padding: 1.15rem;
232
+ border: 1px solid var(--color-border);
233
+ border-radius: calc(var(--radius) - 8px);
234
+ background: var(--color-surface);
235
+ }
236
+
237
+ .contact-card {
238
+ display: grid;
239
+ gap: 1rem;
240
+ }
241
+
242
+ .contact-card-layout-with-map {
243
+ display: grid;
244
+ grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
245
+ gap: 1rem;
246
+ align-items: start;
247
+ }
248
+
249
+ .contact-card-layout-no-map {
250
+ display: block;
251
+ }
252
+
253
+ .contact-card-main {
254
+ display: grid;
255
+ gap: 0.7rem;
256
+ }
257
+
258
+ .contact-card-header {
259
+ display: flex;
260
+ align-items: center;
261
+ gap: 0.85rem;
262
+ }
263
+
264
+ .contact-card-logo {
265
+ width: 3rem;
266
+ height: 3rem;
267
+ object-fit: contain;
268
+ flex: 0 0 auto;
269
+ }
270
+
271
+ .contact-card-name {
272
+ margin: 0;
273
+ font-family: var(--font-heading);
274
+ line-height: 1.1;
275
+ }
276
+
277
+ .contact-card-name-link {
278
+ color: var(--color-primary);
279
+ text-decoration: underline;
280
+ text-decoration-thickness: 0.08em;
281
+ text-underline-offset: 0.16em;
282
+ }
283
+
284
+ .contact-card-name-link:hover {
285
+ text-decoration: underline;
286
+ }
287
+
288
+ .contact-card-tagline,
289
+ .contact-card-text {
290
+ margin: 0;
291
+ }
292
+
293
+ .contact-card-tagline {
294
+ margin-top: -0.4rem;
295
+ font-size: 0.92rem;
296
+ color: var(--color-muted);
297
+ }
298
+
299
+ .contact-card-row {
300
+ display: flex;
301
+ align-items: center;
302
+ gap: 0.6rem;
303
+ flex-wrap: wrap;
304
+ min-width: 0;
305
+ }
306
+
307
+ .contact-card-map-link,
308
+ .contact-card-link {
309
+ display: inline-flex;
310
+ align-items: center;
311
+ gap: 0.5rem;
312
+ color: var(--color-primary);
313
+ text-decoration: underline;
314
+ text-decoration-thickness: 0.08em;
315
+ text-underline-offset: 0.16em;
316
+ line-height: 1.3;
317
+ max-width: 100%;
318
+ min-width: 0;
319
+ overflow-wrap: anywhere;
320
+ }
321
+
322
+ .contact-card-map-link:hover,
323
+ .contact-card-link:hover {
324
+ text-decoration: underline;
325
+ }
326
+
327
+ .contact-card-map-icon {
328
+ display: inline-flex;
329
+ align-items: center;
330
+ justify-content: center;
331
+ width: 1rem;
332
+ height: 1rem;
333
+ flex: 0 0 auto;
334
+ color: var(--color-primary);
335
+ }
336
+
337
+ .contact-card-separator {
338
+ color: var(--color-muted);
339
+ }
340
+
341
+ .contact-card-map-pane {
342
+ display: flex;
343
+ flex-direction: column;
344
+ align-self: start;
345
+ }
346
+
347
+ .contact-card-map-frame {
348
+ width: 100%;
349
+ height: 220px;
350
+ min-height: 220px;
351
+ flex: 0 0 auto;
352
+ min-width: 0;
353
+ }
354
+
355
+ .contact-card-map-frame iframe {
356
+ width: 100%;
357
+ height: 220px;
358
+ min-height: 220px;
359
+ }
360
+
361
+ .company-info {
362
+ display: grid;
363
+ gap: 0.85rem;
364
+ }
365
+
366
+ .company-info-logo {
367
+ width: 3rem;
368
+ height: 3rem;
369
+ object-fit: contain;
370
+ }
371
+
372
+ .company-info-name {
373
+ margin: 0;
374
+ font-family: var(--font-heading);
375
+ line-height: 1.1;
376
+ }
377
+
378
+ .company-info-tagline {
379
+ margin: 0;
380
+ color: var(--color-muted);
381
+ }
382
+
383
+ .contact-links {
384
+ display: grid;
385
+ gap: 0.75rem;
386
+ }
387
+
388
+ .contact-links-inline .integration-links {
389
+ flex-direction: row;
390
+ }
391
+
392
+ .contact-links-stacked .integration-links {
393
+ flex-direction: column;
394
+ align-items: flex-start;
395
+ }
396
+
397
+ .contact-link {
398
+ justify-content: flex-start;
399
+ text-align: left;
400
+ }
401
+
402
+ .contact-link-icon-wrap {
403
+ display: inline-flex;
404
+ align-items: center;
405
+ justify-content: center;
406
+ width: 1.1rem;
407
+ height: 1.1rem;
408
+ flex: 0 0 auto;
409
+ }
410
+
411
+ .contact-link-icon {
412
+ width: 1.1rem;
413
+ height: 1.1rem;
414
+ display: block;
415
+ color: currentColor;
416
+ }
417
+
418
+ .contact-link-label {
419
+ line-height: 1.25;
420
+ }
421
+
422
+ .integration {
423
+ display: grid;
424
+ gap: 1rem;
425
+ }
426
+
427
+ .integration h2 {
428
+ margin: 0;
429
+ font-family: var(--font-heading);
430
+ }
431
+
432
+ .integration-form {
433
+ display: grid;
434
+ gap: 1rem;
435
+ }
436
+
437
+ .integration-form label {
438
+ display: grid;
439
+ gap: 0.35rem;
440
+ font-size: 0.95rem;
441
+ }
442
+
443
+ .integration-form input,
444
+ .integration-form textarea {
445
+ width: 100%;
446
+ border: 1px solid var(--color-border);
447
+ border-radius: 14px;
448
+ padding: 0.85rem 0.95rem;
449
+ background: var(--color-surface);
450
+ font: inherit;
451
+ color: inherit;
452
+ }
453
+
454
+ .integration-form button {
455
+ justify-self: start;
456
+ border: 0;
457
+ border-radius: 999px;
458
+ padding: 0.85rem 1.2rem;
459
+ background: var(--color-primary);
460
+ color: white;
461
+ font: inherit;
462
+ cursor: pointer;
463
+ }
464
+
465
+ .integration-links {
466
+ display: flex;
467
+ flex-wrap: wrap;
468
+ gap: 0.75rem;
469
+ }
470
+
471
+ .share-link {
472
+ display: inline-flex;
473
+ align-items: center;
474
+ justify-content: center;
475
+ gap: 0.55rem;
476
+ border: 1px solid var(--color-border);
477
+ border-radius: 999px;
478
+ padding: 0.65rem 0.95rem;
479
+ text-decoration: none;
480
+ color: var(--color-text);
481
+ background: color-mix(in srgb, var(--color-surface) 88%, white 12%);
482
+ max-width: 100%;
483
+ min-width: 0;
484
+ overflow-wrap: anywhere;
485
+ }
486
+
487
+ .social-link-icon {
488
+ display: inline-flex;
489
+ align-items: center;
490
+ justify-content: center;
491
+ width: 1.1rem;
492
+ height: 1.1rem;
493
+ flex: 0 0 auto;
494
+ }
495
+
496
+ .social-icon {
497
+ width: 1.1rem;
498
+ height: 1.1rem;
499
+ display: block;
500
+ color: currentColor;
501
+ }
502
+
503
+ .social-link-label {
504
+ line-height: 1;
505
+ }
506
+
507
+ .embed-frame {
508
+ position: relative;
509
+ width: 100%;
510
+ min-height: 320px;
511
+ border-radius: 18px;
512
+ overflow: hidden;
513
+ border: 1px solid var(--color-border);
514
+ }
515
+
516
+ .embed-frame iframe {
517
+ width: 100%;
518
+ height: 100%;
519
+ min-height: 320px;
520
+ border: 0;
521
+ }
522
+
523
+ .embed-frame--map,
524
+ .contact-card-map-frame {
525
+ height: 220px;
526
+ min-height: 220px;
527
+ }
528
+
529
+ .embed-frame--map iframe,
530
+ .contact-card-map-frame iframe {
531
+ height: 220px;
532
+ min-height: 220px;
533
+ }
534
+
535
+ .empty-state {
536
+ color: var(--color-muted);
537
+ font-style: italic;
538
+ }
539
+
540
+ .post-list {
541
+ display: grid;
542
+ gap: 1rem;
543
+ }
544
+
545
+ .site-footer {
546
+ display: flex;
547
+ justify-content: space-between;
548
+ gap: 1rem;
549
+ flex-wrap: wrap;
550
+ margin-top: 3rem;
551
+ padding-top: 1.5rem;
552
+ border-top: 1px solid var(--color-border);
553
+ color: var(--color-muted);
554
+ font-size: 0.95rem;
555
+ }
556
+
557
+ @media (max-width: 720px) {
558
+ .site-shell {
559
+ width: min(100vw - 1rem, var(--content-width));
560
+ padding: 1rem 0 2.5rem;
561
+ }
562
+
563
+ .site-header {
564
+ flex-direction: column;
565
+ align-items: flex-start;
566
+ gap: 0.65rem;
567
+ margin-bottom: 1.25rem;
568
+ }
569
+
570
+ .site-nav,
571
+ .site-footer-nav {
572
+ gap: 0.5rem 0.75rem;
573
+ width: 100%;
574
+ flex-wrap: nowrap;
575
+ overflow-x: auto;
576
+ -webkit-overflow-scrolling: touch;
577
+ scrollbar-width: none;
578
+ padding-bottom: 0.25rem;
579
+ }
580
+
581
+ .site-nav::-webkit-scrollbar,
582
+ .site-footer-nav::-webkit-scrollbar {
583
+ display: none;
584
+ }
585
+
586
+ .site-discovery-nav {
587
+ width: 100%;
588
+ flex-wrap: wrap;
589
+ justify-content: flex-start;
590
+ }
591
+
592
+ .site-discovery-nav-footer {
593
+ justify-content: flex-start;
594
+ }
595
+
596
+ .page-discovery {
597
+ margin-top: 1.25rem;
598
+ padding-top: 0.85rem;
599
+ }
600
+
601
+ .site-brand {
602
+ font-size: 1.15rem;
603
+ }
604
+
605
+ .site-logo {
606
+ width: 2.25rem;
607
+ height: 2.25rem;
608
+ }
609
+
610
+ .page-hero,
611
+ .card {
612
+ padding: 0.95rem;
613
+ }
614
+
615
+ .page-hero h1,
616
+ .page-content h1 {
617
+ font-size: clamp(2.35rem, 9vw, 3rem);
618
+ }
619
+
620
+ .page-content h2 {
621
+ font-size: clamp(1.7rem, 6.4vw, 2.1rem);
622
+ }
623
+
624
+ .page-content h3 {
625
+ font-size: clamp(1.35rem, 5.5vw, 1.6rem);
626
+ }
627
+
628
+ .page-content h4 {
629
+ font-size: 1.05rem;
630
+ }
631
+
632
+ .page-content {
633
+ gap: 0.7rem;
634
+ }
635
+
636
+ .page-content h2 {
637
+ margin-top: 0.85rem;
638
+ }
639
+
640
+ .page-content h3 {
641
+ margin-top: 0.7rem;
642
+ }
643
+
644
+ .page-content h4 {
645
+ margin-top: 0.6rem;
646
+ }
647
+
648
+ .integration-links {
649
+ flex-direction: column;
650
+ align-items: stretch;
651
+ }
652
+
653
+ .share-link {
654
+ width: 100%;
655
+ justify-content: flex-start;
656
+ }
657
+
658
+ .contact-card-map-frame,
659
+ .embed-frame--map {
660
+ height: 200px;
661
+ min-height: 200px;
662
+ }
663
+
664
+ .contact-card-map-frame iframe,
665
+ .embed-frame--map iframe {
666
+ height: 200px;
667
+ min-height: 200px;
668
+ }
669
+
670
+ .contact-card-layout-with-map {
671
+ grid-template-columns: 1fr;
672
+ }
673
+
674
+ .contact-card-header {
675
+ align-items: flex-start;
676
+ }
677
+
678
+ .contact-card-row {
679
+ gap: 0.45rem;
680
+ }
681
+
682
+ .contact-card-map-link,
683
+ .contact-card-link {
684
+ width: 100%;
685
+ }
686
+
687
+ .contact-card-map-pane,
688
+ .company-info-map-pane {
689
+ display: none;
690
+ }
691
+
692
+ .embed-frame {
693
+ min-height: 240px;
694
+ }
695
+
696
+ .embed-frame iframe {
697
+ min-height: 240px;
698
+ }
699
+
700
+ .embed-frame--map {
701
+ height: 180px;
702
+ min-height: 180px;
703
+ }
704
+
705
+ .embed-frame--map iframe {
706
+ height: 180px;
707
+ min-height: 180px;
708
+ }
709
+
710
+ .site-footer {
711
+ flex-direction: column;
712
+ align-items: flex-start;
713
+ margin-top: 2rem;
714
+ padding-top: 1.25rem;
715
+ }
716
+
717
+ .site-footer-nav {
718
+ flex-direction: column;
719
+ align-items: flex-start;
720
+ }
721
+ }
722
+ `;
723
+ }