nowebcli 0.2.7 → 0.2.9

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 (208) hide show
  1. package/package.json +4 -1
  2. package/public/fonts/templates/abril-fatface/LICENSE.txt +94 -0
  3. package/public/fonts/templates/abril-fatface/latin-ext.woff2 +0 -0
  4. package/public/fonts/templates/abril-fatface/latin.woff2 +0 -0
  5. package/public/fonts/templates/baloo2/LICENSE.txt +93 -0
  6. package/public/fonts/templates/baloo2/latin-ext.woff2 +0 -0
  7. package/public/fonts/templates/baloo2/latin.woff2 +0 -0
  8. package/public/fonts/templates/bebas-neue/LICENSE.txt +93 -0
  9. package/public/fonts/templates/bebas-neue/latin-ext.woff2 +0 -0
  10. package/public/fonts/templates/bebas-neue/latin.woff2 +0 -0
  11. package/public/fonts/templates/bodoni-moda/LICENSE.txt +93 -0
  12. package/public/fonts/templates/bodoni-moda/latin-ext.woff2 +0 -0
  13. package/public/fonts/templates/bodoni-moda/latin.woff2 +0 -0
  14. package/public/fonts/templates/bungee/LICENSE.txt +93 -0
  15. package/public/fonts/templates/bungee/latin-ext.woff2 +0 -0
  16. package/public/fonts/templates/bungee/latin.woff2 +0 -0
  17. package/public/fonts/templates/caveat/LICENSE.txt +93 -0
  18. package/public/fonts/templates/caveat/latin-ext.woff2 +0 -0
  19. package/public/fonts/templates/caveat/latin.woff2 +0 -0
  20. package/public/fonts/templates/chewy/LICENSE.txt +202 -0
  21. package/public/fonts/templates/chewy/latin.woff2 +0 -0
  22. package/public/fonts/templates/cinzel/LICENSE.txt +93 -0
  23. package/public/fonts/templates/cinzel/latin-ext.woff2 +0 -0
  24. package/public/fonts/templates/cinzel/latin.woff2 +0 -0
  25. package/public/fonts/templates/comfortaa/LICENSE.txt +93 -0
  26. package/public/fonts/templates/comfortaa/latin-ext.woff2 +0 -0
  27. package/public/fonts/templates/comfortaa/latin.woff2 +0 -0
  28. package/public/fonts/templates/cormorant-garamond/LICENSE.txt +93 -0
  29. package/public/fonts/templates/cormorant-garamond/latin-2.woff2 +0 -0
  30. package/public/fonts/templates/cormorant-garamond/latin-ext-2.woff2 +0 -0
  31. package/public/fonts/templates/cormorant-garamond/latin-ext.woff2 +0 -0
  32. package/public/fonts/templates/cormorant-garamond/latin.woff2 +0 -0
  33. package/public/fonts/templates/crimson-pro/LICENSE.txt +93 -0
  34. package/public/fonts/templates/crimson-pro/latin-ext.woff2 +0 -0
  35. package/public/fonts/templates/crimson-pro/latin.woff2 +0 -0
  36. package/public/fonts/templates/dancing-script/LICENSE.txt +93 -0
  37. package/public/fonts/templates/dancing-script/latin-ext.woff2 +0 -0
  38. package/public/fonts/templates/dancing-script/latin.woff2 +0 -0
  39. package/public/fonts/templates/dm-sans/LICENSE.txt +93 -0
  40. package/public/fonts/templates/dm-sans/latin-ext.woff2 +0 -0
  41. package/public/fonts/templates/dm-sans/latin.woff2 +0 -0
  42. package/public/fonts/templates/dm-serif-display/LICENSE.txt +93 -0
  43. package/public/fonts/templates/dm-serif-display/latin-ext.woff2 +0 -0
  44. package/public/fonts/templates/dm-serif-display/latin.woff2 +0 -0
  45. package/public/fonts/templates/eb-garamond/LICENSE.txt +93 -0
  46. package/public/fonts/templates/eb-garamond/latin-ext.woff2 +0 -0
  47. package/public/fonts/templates/eb-garamond/latin.woff2 +0 -0
  48. package/public/fonts/templates/fira-code/LICENSE.txt +93 -0
  49. package/public/fonts/templates/fira-code/latin-ext.woff2 +0 -0
  50. package/public/fonts/templates/fira-code/latin.woff2 +0 -0
  51. package/public/fonts/templates/fonts.css +1275 -0
  52. package/public/fonts/templates/fraunces/LICENSE.txt +93 -0
  53. package/public/fonts/templates/fraunces/latin-ext.woff2 +0 -0
  54. package/public/fonts/templates/fraunces/latin.woff2 +0 -0
  55. package/public/fonts/templates/fredoka/LICENSE.txt +93 -0
  56. package/public/fonts/templates/fredoka/latin-ext.woff2 +0 -0
  57. package/public/fonts/templates/fredoka/latin.woff2 +0 -0
  58. package/public/fonts/templates/grenze-gotisch/LICENSE.txt +93 -0
  59. package/public/fonts/templates/grenze-gotisch/latin-ext.woff2 +0 -0
  60. package/public/fonts/templates/grenze-gotisch/latin.woff2 +0 -0
  61. package/public/fonts/templates/ibm-plex-mono/LICENSE.txt +93 -0
  62. package/public/fonts/templates/ibm-plex-mono/latin-2.woff2 +0 -0
  63. package/public/fonts/templates/ibm-plex-mono/latin-ext-2.woff2 +0 -0
  64. package/public/fonts/templates/ibm-plex-mono/latin-ext.woff2 +0 -0
  65. package/public/fonts/templates/ibm-plex-mono/latin.woff2 +0 -0
  66. package/public/fonts/templates/ibm-plex-sans/LICENSE.txt +93 -0
  67. package/public/fonts/templates/ibm-plex-sans/latin-2.woff2 +0 -0
  68. package/public/fonts/templates/ibm-plex-sans/latin-ext-2.woff2 +0 -0
  69. package/public/fonts/templates/ibm-plex-sans/latin-ext.woff2 +0 -0
  70. package/public/fonts/templates/ibm-plex-sans/latin.woff2 +0 -0
  71. package/public/fonts/templates/inter/LICENSE.txt +93 -0
  72. package/public/fonts/templates/inter/latin-ext.woff2 +0 -0
  73. package/public/fonts/templates/inter/latin.woff2 +0 -0
  74. package/public/fonts/templates/jet-brains-mono/LICENSE.txt +93 -0
  75. package/public/fonts/templates/jet-brains-mono/latin-ext.woff2 +0 -0
  76. package/public/fonts/templates/jet-brains-mono/latin.woff2 +0 -0
  77. package/public/fonts/templates/josefin-sans/LICENSE.txt +93 -0
  78. package/public/fonts/templates/josefin-sans/latin-ext.woff2 +0 -0
  79. package/public/fonts/templates/josefin-sans/latin.woff2 +0 -0
  80. package/public/fonts/templates/karla/LICENSE.txt +93 -0
  81. package/public/fonts/templates/karla/latin-ext.woff2 +0 -0
  82. package/public/fonts/templates/karla/latin.woff2 +0 -0
  83. package/public/fonts/templates/lato/LICENSE.txt +93 -0
  84. package/public/fonts/templates/lato/latin-2.woff2 +0 -0
  85. package/public/fonts/templates/lato/latin-ext-2.woff2 +0 -0
  86. package/public/fonts/templates/lato/latin-ext.woff2 +0 -0
  87. package/public/fonts/templates/lato/latin.woff2 +0 -0
  88. package/public/fonts/templates/libre-baskerville/LICENSE.txt +93 -0
  89. package/public/fonts/templates/libre-baskerville/latin-2.woff2 +0 -0
  90. package/public/fonts/templates/libre-baskerville/latin-ext-2.woff2 +0 -0
  91. package/public/fonts/templates/libre-baskerville/latin-ext.woff2 +0 -0
  92. package/public/fonts/templates/libre-baskerville/latin.woff2 +0 -0
  93. package/public/fonts/templates/lilita-one/LICENSE.txt +94 -0
  94. package/public/fonts/templates/lilita-one/latin-ext.woff2 +0 -0
  95. package/public/fonts/templates/lilita-one/latin.woff2 +0 -0
  96. package/public/fonts/templates/limelight/LICENSE.txt +94 -0
  97. package/public/fonts/templates/limelight/latin-ext.woff2 +0 -0
  98. package/public/fonts/templates/limelight/latin.woff2 +0 -0
  99. package/public/fonts/templates/lora/LICENSE.txt +93 -0
  100. package/public/fonts/templates/lora/latin-ext.woff2 +0 -0
  101. package/public/fonts/templates/lora/latin.woff2 +0 -0
  102. package/public/fonts/templates/manrope/LICENSE.txt +93 -0
  103. package/public/fonts/templates/manrope/latin-ext.woff2 +0 -0
  104. package/public/fonts/templates/manrope/latin.woff2 +0 -0
  105. package/public/fonts/templates/marcellus/LICENSE.txt +93 -0
  106. package/public/fonts/templates/marcellus/latin-ext.woff2 +0 -0
  107. package/public/fonts/templates/marcellus/latin.woff2 +0 -0
  108. package/public/fonts/templates/merriweather/LICENSE.txt +93 -0
  109. package/public/fonts/templates/merriweather/latin-ext.woff2 +0 -0
  110. package/public/fonts/templates/merriweather/latin.woff2 +0 -0
  111. package/public/fonts/templates/monoton/LICENSE.txt +94 -0
  112. package/public/fonts/templates/monoton/latin-ext.woff2 +0 -0
  113. package/public/fonts/templates/monoton/latin.woff2 +0 -0
  114. package/public/fonts/templates/montserrat/LICENSE.txt +93 -0
  115. package/public/fonts/templates/montserrat/latin-ext.woff2 +0 -0
  116. package/public/fonts/templates/montserrat/latin.woff2 +0 -0
  117. package/public/fonts/templates/mulish/LICENSE.txt +93 -0
  118. package/public/fonts/templates/mulish/latin-ext.woff2 +0 -0
  119. package/public/fonts/templates/mulish/latin.woff2 +0 -0
  120. package/public/fonts/templates/newsreader/LICENSE.txt +93 -0
  121. package/public/fonts/templates/newsreader/latin-ext.woff2 +0 -0
  122. package/public/fonts/templates/newsreader/latin.woff2 +0 -0
  123. package/public/fonts/templates/nunito-sans/LICENSE.txt +93 -0
  124. package/public/fonts/templates/nunito-sans/latin-ext.woff2 +0 -0
  125. package/public/fonts/templates/nunito-sans/latin.woff2 +0 -0
  126. package/public/fonts/templates/open-sans/LICENSE.txt +92 -0
  127. package/public/fonts/templates/open-sans/latin-ext.woff2 +0 -0
  128. package/public/fonts/templates/open-sans/latin.woff2 +0 -0
  129. package/public/fonts/templates/outfit/LICENSE.txt +93 -0
  130. package/public/fonts/templates/outfit/latin-ext.woff2 +0 -0
  131. package/public/fonts/templates/outfit/latin.woff2 +0 -0
  132. package/public/fonts/templates/pacifico/LICENSE.txt +93 -0
  133. package/public/fonts/templates/pacifico/latin-ext.woff2 +0 -0
  134. package/public/fonts/templates/pacifico/latin.woff2 +0 -0
  135. package/public/fonts/templates/permanent-marker/LICENSE.txt +202 -0
  136. package/public/fonts/templates/permanent-marker/latin.woff2 +0 -0
  137. package/public/fonts/templates/pixelify-sans/LICENSE.txt +93 -0
  138. package/public/fonts/templates/pixelify-sans/latin-ext.woff2 +0 -0
  139. package/public/fonts/templates/pixelify-sans/latin.woff2 +0 -0
  140. package/public/fonts/templates/playfair-display/LICENSE.txt +93 -0
  141. package/public/fonts/templates/playfair-display/latin-ext.woff2 +0 -0
  142. package/public/fonts/templates/playfair-display/latin.woff2 +0 -0
  143. package/public/fonts/templates/plus-jakarta-sans/LICENSE.txt +93 -0
  144. package/public/fonts/templates/plus-jakarta-sans/latin-ext.woff2 +0 -0
  145. package/public/fonts/templates/plus-jakarta-sans/latin.woff2 +0 -0
  146. package/public/fonts/templates/poppins/LICENSE.txt +93 -0
  147. package/public/fonts/templates/poppins/latin-2.woff2 +0 -0
  148. package/public/fonts/templates/poppins/latin-ext-2.woff2 +0 -0
  149. package/public/fonts/templates/poppins/latin-ext.woff2 +0 -0
  150. package/public/fonts/templates/poppins/latin.woff2 +0 -0
  151. package/public/fonts/templates/quicksand/LICENSE.txt +93 -0
  152. package/public/fonts/templates/quicksand/latin-ext.woff2 +0 -0
  153. package/public/fonts/templates/quicksand/latin.woff2 +0 -0
  154. package/public/fonts/templates/raleway/LICENSE.txt +93 -0
  155. package/public/fonts/templates/raleway/latin-ext.woff2 +0 -0
  156. package/public/fonts/templates/raleway/latin.woff2 +0 -0
  157. package/public/fonts/templates/roboto/LICENSE.txt +93 -0
  158. package/public/fonts/templates/roboto/latin-ext.woff2 +0 -0
  159. package/public/fonts/templates/roboto/latin.woff2 +0 -0
  160. package/public/fonts/templates/rubik-bubbles/LICENSE.txt +93 -0
  161. package/public/fonts/templates/rubik-bubbles/latin-ext.woff2 +0 -0
  162. package/public/fonts/templates/rubik-bubbles/latin.woff2 +0 -0
  163. package/public/fonts/templates/rye/LICENSE.txt +94 -0
  164. package/public/fonts/templates/rye/latin-ext.woff2 +0 -0
  165. package/public/fonts/templates/rye/latin.woff2 +0 -0
  166. package/public/fonts/templates/source-code-pro/LICENSE.txt +93 -0
  167. package/public/fonts/templates/source-code-pro/latin-ext.woff2 +0 -0
  168. package/public/fonts/templates/source-code-pro/latin.woff2 +0 -0
  169. package/public/fonts/templates/source-sans3/LICENSE.txt +93 -0
  170. package/public/fonts/templates/source-sans3/latin-ext.woff2 +0 -0
  171. package/public/fonts/templates/source-sans3/latin.woff2 +0 -0
  172. package/public/fonts/templates/space-grotesk/LICENSE.txt +93 -0
  173. package/public/fonts/templates/space-grotesk/latin-ext.woff2 +0 -0
  174. package/public/fonts/templates/space-grotesk/latin.woff2 +0 -0
  175. package/public/fonts/templates/space-mono/LICENSE.txt +93 -0
  176. package/public/fonts/templates/space-mono/latin-2.woff2 +0 -0
  177. package/public/fonts/templates/space-mono/latin-ext-2.woff2 +0 -0
  178. package/public/fonts/templates/space-mono/latin-ext.woff2 +0 -0
  179. package/public/fonts/templates/space-mono/latin.woff2 +0 -0
  180. package/public/fonts/templates/special-elite/LICENSE.txt +202 -0
  181. package/public/fonts/templates/special-elite/latin-ext.woff2 +0 -0
  182. package/public/fonts/templates/special-elite/latin.woff2 +0 -0
  183. package/public/fonts/templates/spectral/LICENSE.txt +93 -0
  184. package/public/fonts/templates/spectral/latin-2.woff2 +0 -0
  185. package/public/fonts/templates/spectral/latin-ext-2.woff2 +0 -0
  186. package/public/fonts/templates/spectral/latin-ext.woff2 +0 -0
  187. package/public/fonts/templates/spectral/latin.woff2 +0 -0
  188. package/public/fonts/templates/syne/LICENSE.txt +93 -0
  189. package/public/fonts/templates/syne/latin-ext.woff2 +0 -0
  190. package/public/fonts/templates/syne/latin.woff2 +0 -0
  191. package/public/fonts/templates/tenor-sans/LICENSE.txt +94 -0
  192. package/public/fonts/templates/tenor-sans/latin-ext.woff2 +0 -0
  193. package/public/fonts/templates/tenor-sans/latin.woff2 +0 -0
  194. package/public/fonts/templates/unbounded/LICENSE.txt +93 -0
  195. package/public/fonts/templates/unbounded/latin-ext.woff2 +0 -0
  196. package/public/fonts/templates/unbounded/latin.woff2 +0 -0
  197. package/public/fonts/templates/urbanist/LICENSE.txt +93 -0
  198. package/public/fonts/templates/urbanist/latin-ext.woff2 +0 -0
  199. package/public/fonts/templates/urbanist/latin.woff2 +0 -0
  200. package/public/fonts/templates/work-sans/LICENSE.txt +93 -0
  201. package/public/fonts/templates/work-sans/latin-ext.woff2 +0 -0
  202. package/public/fonts/templates/work-sans/latin.woff2 +0 -0
  203. package/public/fonts/templates/yeseva-one/LICENSE.txt +93 -0
  204. package/public/fonts/templates/yeseva-one/latin-ext.woff2 +0 -0
  205. package/public/fonts/templates/yeseva-one/latin.woff2 +0 -0
  206. package/scripts/noweb.mjs +10 -3
  207. package/templates/templateFonts.ts +67 -0
  208. package/templates/templateRuntime.tsx +32 -27
@@ -0,0 +1,93 @@
1
+ Copyright 2012 The Yeseva One Project Authors (lemonad@jovanny.ru), with Reserved Font Name "Yeseva".
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
package/scripts/noweb.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { spawn, spawnSync } from "node:child_process";
4
- import { createHash } from "node:crypto";
4
+ import { createHash, randomBytes } from "node:crypto";
5
5
  import { existsSync } from "node:fs";
6
6
  import { createServer } from "node:http";
7
7
  import { access, chmod, mkdir, readFile, readdir, stat, writeFile } from "node:fs/promises";
@@ -42,7 +42,7 @@ function usage() {
42
42
  }
43
43
 
44
44
  async function createTemplate(value) {
45
- const validSlug = requireSlug(value || basename(root));
45
+ const validSlug = requireSlug(value || `template-${randomBytes(6).toString("hex")}`);
46
46
  const directory = root;
47
47
 
48
48
  for (const file of ["Template.tsx", "customizations.json", "template.json"]) {
@@ -231,7 +231,7 @@ async function listTemplates() {
231
231
  if (projects.length) {
232
232
  if (templates.length) console.log();
233
233
  console.log("Projects");
234
- for (const project of projects) console.log(`${project.id}\t${project.name}`);
234
+ for (const project of projects) console.log(`${project.id}\t${project.domain}`);
235
235
  }
236
236
  }
237
237
 
@@ -440,6 +440,13 @@ async function findTemplates() {
440
440
  }
441
441
 
442
442
  async function servePublic(pathname, response) {
443
+ if (pathname.startsWith("/fonts/templates/")) {
444
+ return serveFile(
445
+ resolve(packageRoot, "public/fonts/templates"),
446
+ decodeURIComponent(pathname.slice("/fonts/templates/".length)),
447
+ response,
448
+ );
449
+ }
443
450
  if (pathname.startsWith("/assets/")) {
444
451
  return serveFile(
445
452
  resolve(root, "public"),
@@ -0,0 +1,67 @@
1
+ export const templateFontCatalog = [
2
+ { key: "inter", family: "Inter", category: "Sans", query: "Inter:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
3
+ { key: "roboto", family: "Roboto", category: "Sans", query: "Roboto:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
4
+ { key: "openSans", family: "Open Sans", category: "Sans", query: "Open Sans:wght@300..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
5
+ { key: "lato", family: "Lato", category: "Sans", query: "Lato:wght@400;700", fallback: "ui-sans-serif, system-ui, sans-serif" },
6
+ { key: "montserrat", family: "Montserrat", category: "Sans", query: "Montserrat:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
7
+ { key: "poppins", family: "Poppins", category: "Sans", query: "Poppins:wght@400;700", fallback: "ui-sans-serif, system-ui, sans-serif" },
8
+ { key: "raleway", family: "Raleway", category: "Sans", query: "Raleway:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
9
+ { key: "nunitoSans", family: "Nunito Sans", category: "Sans", query: "Nunito Sans:wght@200..1000", fallback: "ui-sans-serif, system-ui, sans-serif" },
10
+ { key: "workSans", family: "Work Sans", category: "Sans", query: "Work Sans:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
11
+ { key: "manrope", family: "Manrope", category: "Sans", query: "Manrope:wght@200..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
12
+ { key: "dmSans", family: "DM Sans", category: "Sans", query: "DM Sans:wght@100..1000", fallback: "ui-sans-serif, system-ui, sans-serif" },
13
+ { key: "spaceGrotesk", family: "Space Grotesk", category: "Sans", query: "Space Grotesk:wght@300..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
14
+ { key: "outfit", family: "Outfit", category: "Sans", query: "Outfit:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
15
+ { key: "plusJakartaSans", family: "Plus Jakarta Sans", category: "Sans", query: "Plus Jakarta Sans:wght@200..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
16
+ { key: "urbanist", family: "Urbanist", category: "Sans", query: "Urbanist:wght@100..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
17
+ { key: "ibmPlexSans", family: "IBM Plex Sans", category: "Sans", query: "IBM Plex Sans:wght@400;700", fallback: "ui-sans-serif, system-ui, sans-serif" },
18
+ { key: "sourceSans3", family: "Source Sans 3", category: "Sans", query: "Source Sans 3:wght@200..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
19
+ { key: "quicksand", family: "Quicksand", category: "Calm", query: "Quicksand:wght@300..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
20
+ { key: "comfortaa", family: "Comfortaa", category: "Calm", query: "Comfortaa:wght@300..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
21
+ { key: "josefinSans", family: "Josefin Sans", category: "Calm", query: "Josefin Sans:wght@100..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
22
+ { key: "tenorSans", family: "Tenor Sans", category: "Calm", query: "Tenor Sans", fallback: "ui-sans-serif, system-ui, sans-serif" },
23
+ { key: "marcellus", family: "Marcellus", category: "Calm", query: "Marcellus", fallback: "ui-serif, Georgia, serif" },
24
+ { key: "karla", family: "Karla", category: "Calm", query: "Karla:wght@200..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
25
+ { key: "mulish", family: "Mulish", category: "Calm", query: "Mulish:wght@200..1000", fallback: "ui-sans-serif, system-ui, sans-serif" },
26
+ { key: "playfairDisplay", family: "Playfair Display", category: "Serif", query: "Playfair Display:wght@400..900", fallback: "ui-serif, Georgia, serif" },
27
+ { key: "merriweather", family: "Merriweather", category: "Serif", query: "Merriweather:wght@300..900", fallback: "ui-serif, Georgia, serif" },
28
+ { key: "lora", family: "Lora", category: "Serif", query: "Lora:wght@400..700", fallback: "ui-serif, Georgia, serif" },
29
+ { key: "libreBaskerville", family: "Libre Baskerville", category: "Serif", query: "Libre Baskerville:wght@400;700", fallback: "ui-serif, Georgia, serif" },
30
+ { key: "cormorantGaramond", family: "Cormorant Garamond", category: "Serif", query: "Cormorant Garamond:wght@400;700", fallback: "ui-serif, Georgia, serif" },
31
+ { key: "ebGaramond", family: "EB Garamond", category: "Serif", query: "EB Garamond:wght@400..800", fallback: "ui-serif, Georgia, serif" },
32
+ { key: "fraunces", family: "Fraunces", category: "Serif", query: "Fraunces:opsz,wght@9..144,100..900", fallback: "ui-serif, Georgia, serif" },
33
+ { key: "bodoniModa", family: "Bodoni Moda", category: "Serif", query: "Bodoni Moda:opsz,wght@6..96,400..900", fallback: "ui-serif, Georgia, serif" },
34
+ { key: "dmSerifDisplay", family: "DM Serif Display", category: "Serif", query: "DM Serif Display", fallback: "ui-serif, Georgia, serif" },
35
+ { key: "newsreader", family: "Newsreader", category: "Serif", query: "Newsreader:opsz,wght@6..72,200..800", fallback: "ui-serif, Georgia, serif" },
36
+ { key: "crimsonPro", family: "Crimson Pro", category: "Serif", query: "Crimson Pro:wght@200..900", fallback: "ui-serif, Georgia, serif" },
37
+ { key: "spectral", family: "Spectral", category: "Serif", query: "Spectral:wght@400;700", fallback: "ui-serif, Georgia, serif" },
38
+ { key: "pixelifySans", family: "Pixelify Sans", category: "Playful", query: "Pixelify Sans:wght@400..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
39
+ { key: "fredoka", family: "Fredoka", category: "Playful", query: "Fredoka:wght@300..700", fallback: "ui-sans-serif, system-ui, sans-serif" },
40
+ { key: "baloo2", family: "Baloo 2", category: "Playful", query: "Baloo 2:wght@400..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
41
+ { key: "bungee", family: "Bungee", category: "Playful", query: "Bungee", fallback: "ui-sans-serif, system-ui, sans-serif" },
42
+ { key: "chewy", family: "Chewy", category: "Playful", query: "Chewy", fallback: "ui-sans-serif, system-ui, sans-serif" },
43
+ { key: "lilitaOne", family: "Lilita One", category: "Playful", query: "Lilita One", fallback: "ui-sans-serif, system-ui, sans-serif" },
44
+ { key: "rubikBubbles", family: "Rubik Bubbles", category: "Playful", query: "Rubik Bubbles", fallback: "ui-sans-serif, system-ui, sans-serif" },
45
+ { key: "monoton", family: "Monoton", category: "Playful", query: "Monoton", fallback: "ui-sans-serif, system-ui, sans-serif" },
46
+ { key: "pacifico", family: "Pacifico", category: "Playful", query: "Pacifico", fallback: "cursive" },
47
+ { key: "caveat", family: "Caveat", category: "Playful", query: "Caveat:wght@400..700", fallback: "cursive" },
48
+ { key: "dancingScript", family: "Dancing Script", category: "Playful", query: "Dancing Script:wght@400..700", fallback: "cursive" },
49
+ { key: "permanentMarker", family: "Permanent Marker", category: "Playful", query: "Permanent Marker", fallback: "cursive" },
50
+ { key: "bebasNeue", family: "Bebas Neue", category: "Vintage", query: "Bebas Neue", fallback: "ui-sans-serif, system-ui, sans-serif" },
51
+ { key: "abrilFatface", family: "Abril Fatface", category: "Vintage", query: "Abril Fatface", fallback: "ui-serif, Georgia, serif" },
52
+ { key: "yesevaOne", family: "Yeseva One", category: "Vintage", query: "Yeseva One", fallback: "ui-serif, Georgia, serif" },
53
+ { key: "cinzel", family: "Cinzel", category: "Vintage", query: "Cinzel:wght@400..900", fallback: "ui-serif, Georgia, serif" },
54
+ { key: "rye", family: "Rye", category: "Vintage", query: "Rye", fallback: "ui-serif, Georgia, serif" },
55
+ { key: "limelight", family: "Limelight", category: "Vintage", query: "Limelight", fallback: "ui-serif, Georgia, serif" },
56
+ { key: "specialElite", family: "Special Elite", category: "Vintage", query: "Special Elite", fallback: "ui-monospace, monospace" },
57
+ { key: "grenzeGotisch", family: "Grenze Gotisch", category: "Vintage", query: "Grenze Gotisch:wght@100..900", fallback: "ui-serif, Georgia, serif" },
58
+ { key: "unbounded", family: "Unbounded", category: "Vintage", query: "Unbounded:wght@200..900", fallback: "ui-sans-serif, system-ui, sans-serif" },
59
+ { key: "syne", family: "Syne", category: "Vintage", query: "Syne:wght@400..800", fallback: "ui-sans-serif, system-ui, sans-serif" },
60
+ { key: "jetBrainsMono", family: "JetBrains Mono", category: "Mono", query: "JetBrains Mono:wght@100..800", fallback: "ui-monospace, monospace" },
61
+ { key: "spaceMono", family: "Space Mono", category: "Mono", query: "Space Mono:wght@400;700", fallback: "ui-monospace, monospace" },
62
+ { key: "ibmPlexMono", family: "IBM Plex Mono", category: "Mono", query: "IBM Plex Mono:wght@400;700", fallback: "ui-monospace, monospace" },
63
+ { key: "firaCode", family: "Fira Code", category: "Mono", query: "Fira Code:wght@300..700", fallback: "ui-monospace, monospace" },
64
+ { key: "sourceCodePro", family: "Source Code Pro", category: "Mono", query: "Source Code Pro:wght@200..900", fallback: "ui-monospace, monospace" },
65
+ ] as const;
66
+
67
+ export type TemplateFontKey = (typeof templateFontCatalog)[number]["key"];
@@ -16,6 +16,7 @@ import {
16
16
  normalizeCustomizationValues,
17
17
  type CustomizationValues,
18
18
  } from "../lib/customizations";
19
+ import { templateFontCatalog, type TemplateFontKey } from "./templateFonts";
19
20
 
20
21
  export type { CustomizationValue, CustomizationValues } from "../lib/customizations";
21
22
 
@@ -40,6 +41,26 @@ let currentTemplateRuntime: TemplateRuntimeContextValue = {
40
41
  values: {},
41
42
  };
42
43
 
44
+ const fontStyles = Object.fromEntries(templateFontCatalog.map(({ family, fallback, key }) => [
45
+ key,
46
+ { get fontFamily() { return loadFont(family, fallback); } },
47
+ ])) as Record<TemplateFontKey, { readonly fontFamily: string }>;
48
+
49
+ function loadFont(family: string, fallback: string) {
50
+ if (typeof document !== "undefined" && !document.getElementById("noweb-template-fonts")) {
51
+ const stylesheet = document.createElement("link");
52
+ stylesheet.id = "noweb-template-fonts";
53
+ stylesheet.rel = "stylesheet";
54
+ stylesheet.href = window.location.hostname === "storage.noweb.app"
55
+ ? "https://noweb.app/fonts/templates/fonts.css"
56
+ : "/fonts/templates/fonts.css";
57
+ document.head.append(stylesheet);
58
+ }
59
+ return `"${family}", ${fallback}`;
60
+ }
61
+
62
+ export const font = fontStyles;
63
+
43
64
  export function TemplateRuntimeProvider({
44
65
  children,
45
66
  customizations,
@@ -89,42 +110,27 @@ export type ProjectDataRecord<T extends Record<string, unknown> = Record<string,
89
110
  data: T;
90
111
  };
91
112
 
92
- class ProjectDataRequestError extends Error {
93
- constructor(message: string, readonly status: number) {
94
- super(message);
95
- }
96
- }
97
-
98
113
  export const db = {
99
- async isAdmin(adminName: string) {
100
- try {
101
- await projectDataRequest("?admin=1", { adminName });
102
- return true;
103
- } catch (error) {
104
- if (error instanceof ProjectDataRequestError && error.status === 401) return false;
105
- throw error;
106
- }
107
- },
108
- list<T extends Record<string, unknown> = Record<string, unknown>>(adminName?: string) {
109
- return projectDataRequest<ProjectDataRecord<T>[]>(adminName ? "?admin=1" : "", { adminName });
114
+ list<T extends Record<string, unknown> = Record<string, unknown>>() {
115
+ return projectDataRequest<ProjectDataRecord<T>[]>("");
110
116
  },
111
- create<T extends Record<string, unknown>>(data: T, adminName: string) {
112
- return projectDataRequest<ProjectDataRecord<T>>("", { adminName, body: data, method: "POST" });
117
+ create<T extends Record<string, unknown>>(data: T) {
118
+ return projectDataRequest<ProjectDataRecord<T>>("", { body: data, method: "POST" });
113
119
  },
114
- update<T extends Record<string, unknown>>(id: string | number, data: T, adminName: string) {
115
- return projectDataRequest<ProjectDataRecord<T>>(`?id=${id}`, { adminName, body: data, method: "PATCH" });
120
+ update<T extends Record<string, unknown>>(id: string | number, data: T) {
121
+ return projectDataRequest<ProjectDataRecord<T>>(`?id=${id}`, { body: data, method: "PATCH" });
116
122
  },
117
- remove(id: string | number, adminName: string) {
118
- return projectDataRequest<void>(`?id=${id}`, { adminName, method: "DELETE" });
123
+ remove(id: string | number) {
124
+ return projectDataRequest<void>(`?id=${id}`, { method: "DELETE" });
119
125
  },
120
126
  claim<T extends Record<string, unknown>>(id: string | number, data: T) {
121
- return projectDataRequest<ProjectDataRecord<T>>(`?id=${id}`, { body: { claim: data }, method: "PATCH" });
127
+ return projectDataRequest<ProjectDataRecord<T>>(`?id=${id}&claim=1`, { body: data, method: "PATCH" });
122
128
  },
123
129
  };
124
130
 
125
131
  async function projectDataRequest<T>(
126
132
  path: string,
127
- options: { adminName?: string; body?: Record<string, unknown>; method?: string },
133
+ options: { body?: Record<string, unknown>; method?: string } = {},
128
134
  ) {
129
135
  const { dataApiBase, projectId } = currentTemplateRuntime;
130
136
  if (!projectId) throw new Error("Database access is available inside projects only");
@@ -135,14 +141,13 @@ async function projectDataRequest<T>(
135
141
  method: options.method || "GET",
136
142
  headers: {
137
143
  ...(options.body ? { "Content-Type": "application/json" } : {}),
138
- ...(options.adminName ? { "X-Admin-Name": options.adminName } : {}),
139
144
  },
140
145
  body: options.body ? JSON.stringify(options.body) : undefined,
141
146
  },
142
147
  );
143
148
  const result = response.status === 204 ? null : await response.json().catch(() => null);
144
149
  if (!response.ok) {
145
- throw new ProjectDataRequestError(result?.error || `Database request failed (${response.status})`, response.status);
150
+ throw new Error(result?.error || `Database request failed (${response.status})`);
146
151
  }
147
152
  return result as T;
148
153
  }