@uyghurcommunity/ui 0.0.0-stage → 0.4.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 (215) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +223 -2
  3. package/THIRD_PARTY_NOTICES.md +28 -0
  4. package/assets/flags/east-turkistan.svg +1 -0
  5. package/assets/icon-catalog.json +1514 -0
  6. package/assets/icons/almond.svg +1 -0
  7. package/assets/icons/ancient-ruins.svg +1 -0
  8. package/assets/icons/apricot.svg +1 -0
  9. package/assets/icons/archway.svg +1 -0
  10. package/assets/icons/arrow-down.svg +1 -0
  11. package/assets/icons/arrow-left.svg +1 -0
  12. package/assets/icons/arrow-right.svg +1 -0
  13. package/assets/icons/arrow-up.svg +1 -0
  14. package/assets/icons/atlas.svg +1 -0
  15. package/assets/icons/aywan.svg +1 -0
  16. package/assets/icons/book.svg +1 -0
  17. package/assets/icons/boots.svg +1 -0
  18. package/assets/icons/calendar.svg +1 -0
  19. package/assets/icons/calligraphy.svg +1 -0
  20. package/assets/icons/camel.svg +1 -0
  21. package/assets/icons/carpet.svg +1 -0
  22. package/assets/icons/carved-door.svg +1 -0
  23. package/assets/icons/ceramic-vase.svg +1 -0
  24. package/assets/icons/chapan.svg +1 -0
  25. package/assets/icons/check-circle.svg +1 -0
  26. package/assets/icons/check.svg +1 -0
  27. package/assets/icons/chevron-down.svg +1 -0
  28. package/assets/icons/chevron-left.svg +1 -0
  29. package/assets/icons/chevron-right.svg +1 -0
  30. package/assets/icons/chevron-up.svg +1 -0
  31. package/assets/icons/city-gate.svg +1 -0
  32. package/assets/icons/close.svg +1 -0
  33. package/assets/icons/code.svg +1 -0
  34. package/assets/icons/color/almond.svg +1 -0
  35. package/assets/icons/color/ancient-ruins.svg +1 -0
  36. package/assets/icons/color/apricot.svg +1 -0
  37. package/assets/icons/color/archway.svg +1 -0
  38. package/assets/icons/color/atlas.svg +1 -0
  39. package/assets/icons/color/aywan.svg +1 -0
  40. package/assets/icons/color/boots.svg +1 -0
  41. package/assets/icons/color/calligraphy.svg +1 -0
  42. package/assets/icons/color/camel.svg +1 -0
  43. package/assets/icons/color/carpet.svg +1 -0
  44. package/assets/icons/color/carved-door.svg +1 -0
  45. package/assets/icons/color/ceramic-vase.svg +1 -0
  46. package/assets/icons/color/chapan.svg +1 -0
  47. package/assets/icons/color/city-gate.svg +1 -0
  48. package/assets/icons/color/cotton.svg +1 -0
  49. package/assets/icons/color/crescent.svg +1 -0
  50. package/assets/icons/color/dap.svg +1 -0
  51. package/assets/icons/color/doppa-top.svg +1 -0
  52. package/assets/icons/color/doppa.svg +1 -0
  53. package/assets/icons/color/dove.svg +1 -0
  54. package/assets/icons/color/dutar.svg +1 -0
  55. package/assets/icons/color/embroidery.svg +1 -0
  56. package/assets/icons/color/floral-rosette.svg +1 -0
  57. package/assets/icons/color/flower.svg +1 -0
  58. package/assets/icons/color/fur-hat.svg +1 -0
  59. package/assets/icons/color/ghijek.svg +1 -0
  60. package/assets/icons/color/grapes.svg +1 -0
  61. package/assets/icons/color/horse.svg +1 -0
  62. package/assets/icons/color/jewelry.svg +1 -0
  63. package/assets/icons/color/laghman.svg +1 -0
  64. package/assets/icons/color/landscape.svg +1 -0
  65. package/assets/icons/color/lattice-window.svg +1 -0
  66. package/assets/icons/color/loom.svg +1 -0
  67. package/assets/icons/color/madrasa.svg +1 -0
  68. package/assets/icons/color/mausoleum.svg +1 -0
  69. package/assets/icons/color/melon.svg +1 -0
  70. package/assets/icons/color/mens-coat.svg +1 -0
  71. package/assets/icons/color/minaret.svg +1 -0
  72. package/assets/icons/color/mosque.svg +1 -0
  73. package/assets/icons/color/nan-stack.svg +1 -0
  74. package/assets/icons/color/nan.svg +1 -0
  75. package/assets/icons/color/ornamental-border.svg +1 -0
  76. package/assets/icons/color/polo.svg +1 -0
  77. package/assets/icons/color/pomegranate.svg +1 -0
  78. package/assets/icons/color/rawap.svg +1 -0
  79. package/assets/icons/color/samsa.svg +1 -0
  80. package/assets/icons/color/sash.svg +1 -0
  81. package/assets/icons/color/satar.svg +1 -0
  82. package/assets/icons/color/spindle.svg +1 -0
  83. package/assets/icons/color/star-eight.svg +1 -0
  84. package/assets/icons/color/surnai.svg +1 -0
  85. package/assets/icons/color/tambur.svg +1 -0
  86. package/assets/icons/color/tea-bowl.svg +1 -0
  87. package/assets/icons/color/tea-set.svg +1 -0
  88. package/assets/icons/color/teapot.svg +1 -0
  89. package/assets/icons/color/traditional-house.svg +1 -0
  90. package/assets/icons/color/traditional-shoes.svg +1 -0
  91. package/assets/icons/color/tree-of-life.svg +1 -0
  92. package/assets/icons/color/unity.svg +1 -0
  93. package/assets/icons/color/uyghur-medallion.svg +1 -0
  94. package/assets/icons/color/womens-dress.svg +1 -0
  95. package/assets/icons/color/womens-headdress.svg +1 -0
  96. package/assets/icons/color/yurt.svg +1 -0
  97. package/assets/icons/copy.svg +1 -0
  98. package/assets/icons/cotton.svg +1 -0
  99. package/assets/icons/crescent.svg +1 -0
  100. package/assets/icons/dap.svg +1 -0
  101. package/assets/icons/direction-ltr.svg +1 -0
  102. package/assets/icons/direction-rtl.svg +1 -0
  103. package/assets/icons/doppa-top.svg +1 -0
  104. package/assets/icons/doppa.svg +1 -0
  105. package/assets/icons/dove.svg +1 -0
  106. package/assets/icons/download.svg +1 -0
  107. package/assets/icons/dutar.svg +1 -0
  108. package/assets/icons/edit.svg +1 -0
  109. package/assets/icons/embroidery.svg +1 -0
  110. package/assets/icons/external-link.svg +1 -0
  111. package/assets/icons/floral-rosette.svg +1 -0
  112. package/assets/icons/flower.svg +1 -0
  113. package/assets/icons/fur-hat.svg +1 -0
  114. package/assets/icons/ghijek.svg +1 -0
  115. package/assets/icons/globe.svg +1 -0
  116. package/assets/icons/grapes.svg +1 -0
  117. package/assets/icons/heart.svg +1 -0
  118. package/assets/icons/home.svg +1 -0
  119. package/assets/icons/horse.svg +1 -0
  120. package/assets/icons/image.svg +1 -0
  121. package/assets/icons/info.svg +1 -0
  122. package/assets/icons/jewelry.svg +1 -0
  123. package/assets/icons/keyboard.svg +1 -0
  124. package/assets/icons/laghman.svg +1 -0
  125. package/assets/icons/landscape.svg +1 -0
  126. package/assets/icons/language.svg +1 -0
  127. package/assets/icons/lattice-window.svg +1 -0
  128. package/assets/icons/link.svg +1 -0
  129. package/assets/icons/loom.svg +1 -0
  130. package/assets/icons/madrasa.svg +1 -0
  131. package/assets/icons/mail.svg +1 -0
  132. package/assets/icons/mausoleum.svg +1 -0
  133. package/assets/icons/melon.svg +1 -0
  134. package/assets/icons/mens-coat.svg +1 -0
  135. package/assets/icons/menu.svg +1 -0
  136. package/assets/icons/minaret.svg +1 -0
  137. package/assets/icons/minus.svg +1 -0
  138. package/assets/icons/moon.svg +1 -0
  139. package/assets/icons/mosque.svg +1 -0
  140. package/assets/icons/nan-stack.svg +1 -0
  141. package/assets/icons/nan.svg +1 -0
  142. package/assets/icons/ornamental-border.svg +1 -0
  143. package/assets/icons/palette.svg +1 -0
  144. package/assets/icons/pause.svg +1 -0
  145. package/assets/icons/play.svg +1 -0
  146. package/assets/icons/plus.svg +1 -0
  147. package/assets/icons/polo.svg +1 -0
  148. package/assets/icons/pomegranate.svg +1 -0
  149. package/assets/icons/rawap.svg +1 -0
  150. package/assets/icons/redo.svg +1 -0
  151. package/assets/icons/samsa.svg +1 -0
  152. package/assets/icons/sash.svg +1 -0
  153. package/assets/icons/satar.svg +1 -0
  154. package/assets/icons/search.svg +1 -0
  155. package/assets/icons/settings.svg +1 -0
  156. package/assets/icons/spindle.svg +1 -0
  157. package/assets/icons/star-eight.svg +1 -0
  158. package/assets/icons/star.svg +1 -0
  159. package/assets/icons/sun.svg +1 -0
  160. package/assets/icons/surnai.svg +1 -0
  161. package/assets/icons/tambur.svg +1 -0
  162. package/assets/icons/tea-bowl.svg +1 -0
  163. package/assets/icons/tea-set.svg +1 -0
  164. package/assets/icons/teapot.svg +1 -0
  165. package/assets/icons/traditional-house.svg +1 -0
  166. package/assets/icons/traditional-shoes.svg +1 -0
  167. package/assets/icons/trash.svg +1 -0
  168. package/assets/icons/tree-of-life.svg +1 -0
  169. package/assets/icons/undo.svg +1 -0
  170. package/assets/icons/unity.svg +1 -0
  171. package/assets/icons/upload.svg +1 -0
  172. package/assets/icons/user.svg +1 -0
  173. package/assets/icons/users.svg +1 -0
  174. package/assets/icons/uyghur-medallion.svg +1 -0
  175. package/assets/icons/warning.svg +1 -0
  176. package/assets/icons/womens-dress.svg +1 -0
  177. package/assets/icons/womens-headdress.svg +1 -0
  178. package/assets/icons/yurt.svg +1 -0
  179. package/assets/maps/README.md +27 -0
  180. package/assets/maps/east-turkistan-filled.svg +1 -0
  181. package/assets/maps/east-turkistan-outline.svg +1 -0
  182. package/assets/maps/east-turkistan.metadata.json +64 -0
  183. package/assets/maps/east-turkistan.source.geojson +1 -0
  184. package/package.json +93 -4
  185. package/src/application.css +4 -0
  186. package/src/application.d.ts +7 -0
  187. package/src/application.js +120 -0
  188. package/src/blocks.css +1 -0
  189. package/src/font.css +8 -0
  190. package/src/heritage-color.js +30 -0
  191. package/src/icon-labels.js +98 -0
  192. package/src/icons.d.ts +13 -0
  193. package/src/icons.js +102 -0
  194. package/src/index.d.ts +17 -0
  195. package/src/index.js +201 -0
  196. package/src/interactions.css +15 -0
  197. package/src/interactions.d.ts +10 -0
  198. package/src/interactions.js +183 -0
  199. package/src/map-data.js +68 -0
  200. package/src/maps.d.ts +11 -0
  201. package/src/maps.js +17 -0
  202. package/src/reference-clothing.js +51 -0
  203. package/src/reference-places.js +43 -0
  204. package/src/styles.css +20 -0
  205. package/src/themes.d.ts +7 -0
  206. package/src/themes.js +36 -0
  207. package/src/traditional-drawings.js +42 -0
  208. package/src/vendor/README.md +17 -0
  209. package/src/vendor/keyboard/LICENSE +21 -0
  210. package/src/vendor/keyboard/index.js +248 -0
  211. package/src/vendor/keyboard/style.js +22 -0
  212. package/src/vendor/text/LICENSE +21 -0
  213. package/src/vendor/text/index.js +275 -0
  214. package/src/writing.d.ts +17 -0
  215. package/src/writing.js +111 -0
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Original 24×24 cultural pictograms, drawn from the supplied motif references.
3
+ * These are simplified contemporary symbols, not historical reproductions.
4
+ * Markup fragments inherit the renderer's stroke, caps, joins and viewBox.
5
+ */
6
+ export const referenceClothingOutline = Object.freeze({
7
+ 'fur-hat': '<path d="M6 10V8c0-5 12-5 12 0v2M3 12c0-2 2-3 4-2 1-2 3-2 5-1 2-1 4-1 5 1 2-1 4 0 4 2v4c0 2-2 3-4 2-1 2-3 2-5 1-2 1-4 1-5-1-2 1-4 0-4-2Z"/><path d="m6 13 1 1m3-3 1 1m4 0 1 1m2 2 1 1M6 17l1-1m5 2 1-1"/>',
8
+ 'womens-headdress': '<path d="M6 8 4 20l5 1 3-11 3 11 5-1-2-12M6 8c0-7 12-7 12 0ZM8 6l2-1 2 1 2-1 2 1M7 12l-1 6m11-6 1 6"/>',
9
+ 'mens-coat': '<path d="m9 3-5 2-1 9 4 1 1-5-1 11h10l-1-11 1 5 4-1-1-9-5-2-3 4ZM9 3l3 4v14M8 11h8M7 18h3m4 0h3"/>',
10
+ 'womens-dress': '<path d="M9 3h6l4 5-2 3-2-3-1 4 5 9H5l5-9-1-4-2 3-2-3Zm0 0 3 3 3-3M10 12h4M9 18l3 1 3-1M8 21l2-6m6 6-2-6"/>',
11
+ chapan: '<path d="m9 3-5 3-1 10 4 1 1-7-1 11h10l-1-11 1 7 4-1-1-10-5-3-3 5ZM9 3l1 7 2 3 2-3 1-7M8 13h8m-4 0v8"/>',
12
+ sash: '<path d="m10 7-7-2v7l7-2m4-3 7-2v7l-7-2M10 6h4v5h-4Zm0 5L7 20l4-2 2-7m1 0 3 8-3 2-3-8M5 8l3 1m8 0 3-1M8 17l3-1m3 0 2 1"/>',
13
+ boots: '<path d="M5 3h5v12c0 3-4 5-6 5H2v-3l3-3Zm9 0h5v12c0 3-4 5-6 5h-2v-3l3-3ZM5 6h5m4 0h5M2 18h5m4 0h5M7.5 8v5m9-5v5"/>',
14
+ 'traditional-shoes': '<path d="m4 11 5-7 3 2-4 9c-1.5 2-5 3-6 1-.8-2 .5-4 2-5Zm10 2 5-7 3 2-4 9c-1.5 2-5 3-6 1-.8-2 .5-4 2-5ZM6 9l3-4 2 2-3 4Zm10 2 3-4 2 2-3 4ZM4 14h.01m2-1h.01m8 3h.01m2-1h.01"/>',
15
+ 'ceramic-vase': '<path d="M9 3h6l-1 5c0 2 5 4 5 8 0 3-3 5-7 5s-7-2-7-5c0-4 5-6 5-8ZM8 3h8M9 6h6M7 19h10"/><path d="M12 16c-4-1-3-5 0-3 3-2 4 2 0 3Zm0 0c-2 3-5 0-2-1m2 1c2 3 5 0 2-1"/>',
16
+ jewelry: '<circle cx="12" cy="4" r="1.5"/><path d="M12 6c3 3 6 4 6 8a6 6 0 0 1-12 0c0-4 3-5 6-8Zm0 3c-4 4-4 7 0 9 4-2 4-5 0-9ZM8 19l-1 2m5-1v2m4-3 1 2"/>',
17
+ 'doppa-top': '<circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="7"/><path d="M12 10c-3-2-3-4 0-5 3 1 3 3 0 5Zm2 2c2-3 4-3 5 0-1 3-3 3-5 0Zm-2 2c3 2 3 4 0 5-3-1-3-3 0-5Zm-2-2c-2 3-4 3-5 0 1-3 3-3 5 0Z"/><circle cx="12" cy="12" r="1"/>',
18
+ 'uyghur-medallion': '<path d="M12 4c2-2 5 0 5 3 3 0 5 3 3 5 2 2 0 5-3 5 0 3-3 5-5 3-2 2-5 0-5-3-3 0-5-3-3-5-2-2 0-5 3-5 0-3 3-5 5-3Z"/><circle cx="12" cy="12" r="4"/><path d="m12 9 3 3-3 3-3-3ZM12 4v2m0 12v2M4 12h2m12 0h2"/>',
19
+ 'floral-rosette': '<path d="M12 10C7 6 10 2 12 4c2-2 5 2 0 6Zm2 2c4-5 8-2 6 0 2 2-2 5-6 0Zm-2 2c5 4 2 8 0 6-2 2-5-2 0-6Zm-2-2c-4 5-8 2-6 0-2-2 2-5 6 0ZM7 8C3 8 3 3 8 6Zm9-1c0-4 5-4 2 1Zm1 9c4 0 4 5-1 2Zm-9 1c0 4-5 4-2-1Z"/><circle cx="12" cy="12" r="2"/>',
20
+ 'ornamental-border': '<path d="M3 6h18v12H3ZM3 8h18M3 16h18M10 12c-2-3-5-3-6 0 1 3 4 3 6 0Zm4 0c2-3 5-3 6 0-1 3-4 3-6 0ZM12 10c-2-2-4 0-2 2-2 2 0 4 2 2 2 2 4 0 2-2 2-2 0-4-2-2Z"/>',
21
+ calligraphy: '<path d="m14 3 4 2-8 13-5 3 1-6ZM7 18l3-5M12 6l4 2m-3 12c3 0 7-1 7-3m-5-3c2 1 5 0 5-2"/>',
22
+ 'star-eight': '<path d="m12 2 2.4 4.2L19 5l-1.2 4.6L22 12l-4.2 2.4L19 19l-4.6-1.2L12 22l-2.4-4.2L5 19l1.2-4.6L2 12l4.2-2.4L5 5l4.6 1.2Z"/><path d="m12 8 4 4-4 4-4-4Z"/>',
23
+ crescent: '<path d="M13 3a9 9 0 1 0 7.5 14A8 8 0 0 1 13 3Z"/><path d="m18 3 1 2.3 2.5.2-2 1.6.7 2.4L18 8l-2.2 1.5.7-2.4-2-1.6 2.5-.2Z"/>',
24
+ 'tree-of-life': '<path d="M12 20V7m0 7-5-4m5 1 5-4m-5 10 5-4m-5 4-5-3m1 7 4-2 4 2M12 7c-4-2-3-5 0-5 3 0 4 3 0 5ZM7 10c-4 1-5-3-5-5 4 0 6 2 5 5Zm10-3c-1-4 2-5 5-5 0 4-2 6-5 5ZM7 15c-4 1-5-2-4-5 3 0 5 2 4 5Zm10-2c0-4 3-5 5-4 0 3-2 5-5 4Z"/>',
25
+ unity: '<path d="m2 7 3-1 3 4-3 6-3-1Zm20 0-2-1-3 4 2 6 3-1ZM6 10l3-3h3l6 6-4 5c-.6.6-1.5.8-2 .4l-6-4m12-4-3-3h-3l-3 3a1.4 1.4 0 0 0 2 2l1-1 5 5 2-2M10 15l3 3m0-5 3 3"/>',
26
+ dove: '<path d="M4 14c4 1 6 0 8-3l2-3c1-2 4-2 5 0l2 1-3 1c0 4-3 7-7 7H6l-3 3Zm7 0C6 12 3 8 3 4c5 0 9 4 10 8M17 8h.01m2 4 2 6m-1-3c-3 0-3-2-2-3 2 0 3 1 2 3Zm1 2c-1-3 1-4 2-3 0 2 0 3-2 3Z"/>',
27
+ });
28
+
29
+ /** Fixed heritage palette: navy, gold, jade, red and cream. */
30
+ export const referenceClothingColor = Object.freeze({
31
+ 'fur-hat': '<path fill="#b54c3b" d="M6 10V8c0-5 12-5 12 0v2Z"/><path fill="#bc8d43" d="M3 12c0-2 2-3 4-2 1-2 3-2 5-1 2-1 4-1 5 1 2-1 4 0 4 2v4c0 2-2 3-4 2-1 2-3 2-5 1-2 1-4 1-5-1-2 1-4 0-4-2Z"/><path d="m6 13 1 1m3-3 1 1m4 0 1 1m2 2 1 1M6 17l1-1m5 2 1-1"/>',
32
+ 'womens-headdress': '<path fill="#f4e4c8" d="m6 8 6 2-3 11-5-1Zm12 0-6 2 3 11 5-1Z"/><path fill="#3f7d6a" d="M6 8c0-7 12-7 12 0Z"/><path stroke="#bc8d43" d="m8 6 2-1 2 1 2-1 2 1"/><path d="m7 12-1 6m11-6 1 6"/>',
33
+ 'mens-coat': '<path fill="#3f7d6a" d="m9 3-5 2-1 9 4 1 1-5-1 11h10l-1-11 1 5 4-1-1-9-5-2-3 4Z"/><path fill="#f4e4c8" d="m9 3 3 4 3-4-3 11Z"/><path d="M12 14v7"/><path fill="#b54c3b" d="M8 10h8v3H8Z"/><path stroke="#bc8d43" d="M7 18h3m4 0h3"/>',
34
+ 'womens-dress': '<path fill="#b54c3b" d="M9 3h6l4 5-2 3-2-3-1 4 5 9H5l5-9-1-4-2 3-2-3Z"/><path fill="#f4e4c8" d="m9 3 3 3 3-3Z"/><path fill="#bc8d43" d="M10 11h4v2h-4Z"/><path stroke="#bc8d43" d="m9 18 3 1 3-1M8 21l2-6m6 6-2-6"/>',
35
+ chapan: '<path fill="#bc8d43" d="m9 3-5 3-1 10 4 1 1-7-1 11h10l-1-11 1 7 4-1-1-10-5-3-3 5Z"/><path fill="#17364b" d="m9 3 1 7 2 3 2-3 1-7-3 5Z"/><path fill="#3f7d6a" d="M8 12h8v3H8Z"/><path d="M12 15v6"/>',
36
+ sash: '<path fill="#b54c3b" d="m10 7-7-2v7l7-2Zm4 0 7-2v7l-7-2ZM10 11 7 20l4-2 2-7Zm4 0 3 8-3 2-3-8Z"/><path fill="#bc8d43" d="M10 6h4v5h-4Z"/><path stroke="#bc8d43" d="m5 8 3 1m8 0 3-1M8 17l3-1m3 0 2 1"/>',
37
+ boots: '<path fill="#f4e4c8" d="M5 3h5v12c0 3-4 5-6 5H2v-3l3-3Zm9 0h5v12c0 3-4 5-6 5h-2v-3l3-3Z"/><path fill="#bc8d43" d="M5 3h5v3H5Zm9 0h5v3h-5Z"/><path d="M2 18h5m4 0h5M7.5 8v5m9-5v5"/>',
38
+ 'traditional-shoes': '<path fill="#b54c3b" d="m4 11 5-7 3 2-4 9c-1.5 2-5 3-6 1-.8-2 .5-4 2-5Zm10 2 5-7 3 2-4 9c-1.5 2-5 3-6 1-.8-2 .5-4 2-5Z"/><path fill="#f4e4c8" d="m6 9 3-4 2 2-3 4Zm10 2 3-4 2 2-3 4Z"/><path stroke="#bc8d43" d="M4 14h.01m2-1h.01m8 3h.01m2-1h.01"/>',
39
+ 'ceramic-vase': '<path fill="#f4e4c8" d="M9 3h6l-1 5c0 2 5 4 5 8 0 3-3 5-7 5s-7-2-7-5c0-4 5-6 5-8Z"/><path fill="#bc8d43" d="M9 3h6v3H9Z"/><path d="M8 3h8M7 19h10"/><path fill="#3f7d6a" d="M12 16c-4-1-3-5 0-3 3-2 4 2 0 3Zm0 0c-2 3-5 0-2-1m2 1c2 3 5 0 2-1"/>',
40
+ jewelry: '<circle fill="#bc8d43" cx="12" cy="4" r="1.5"/><path fill="#bc8d43" d="M12 6c3 3 6 4 6 8a6 6 0 0 1-12 0c0-4 3-5 6-8Z"/><path fill="#b54c3b" d="M12 9c-4 4-4 7 0 9 4-2 4-5 0-9Z"/><path d="m8 19-1 2m5-1v2m4-3 1 2"/>',
41
+ 'doppa-top': '<circle fill="#17364b" cx="12" cy="12" r="9"/><circle fill="none" stroke="#bc8d43" cx="12" cy="12" r="7"/><path fill="#f4e4c8" d="M12 10c-3-2-3-4 0-5 3 1 3 3 0 5Zm2 2c2-3 4-3 5 0-1 3-3 3-5 0Zm-2 2c3 2 3 4 0 5-3-1-3-3 0-5Zm-2-2c-2 3-4 3-5 0 1-3 3-3 5 0Z"/><circle fill="#bc8d43" cx="12" cy="12" r="1"/>',
42
+ 'uyghur-medallion': '<path fill="#bc8d43" d="M12 4c2-2 5 0 5 3 3 0 5 3 3 5 2 2 0 5-3 5 0 3-3 5-5 3-2 2-5 0-5-3-3 0-5-3-3-5-2-2 0-5 3-5 0-3 3-5 5-3Z"/><circle fill="#17364b" cx="12" cy="12" r="4"/><path fill="#f4e4c8" d="m12 9 3 3-3 3-3-3Z"/><path d="M12 4v2m0 12v2M4 12h2m12 0h2"/>',
43
+ 'floral-rosette': '<path fill="#3f7d6a" d="M7 8C3 8 3 3 8 6Zm9-1c0-4 5-4 2 1Zm1 9c4 0 4 5-1 2Zm-9 1c0 4-5 4-2-1Z"/><path fill="#b54c3b" d="M12 10C7 6 10 2 12 4c2-2 5 2 0 6Zm2 2c4-5 8-2 6 0 2 2-2 5-6 0Zm-2 2c5 4 2 8 0 6-2 2-5-2 0-6Zm-2-2c-4 5-8 2-6 0-2-2 2-5 6 0Z"/><circle fill="#bc8d43" cx="12" cy="12" r="2"/>',
44
+ 'ornamental-border': '<path fill="#17364b" d="M3 6h18v12H3Z"/><path stroke="#bc8d43" d="M3 8h18M3 16h18"/><path fill="#3f7d6a" d="M10 12c-2-3-5-3-6 0 1 3 4 3 6 0Zm4 0c2-3 5-3 6 0-1 3-4 3-6 0Z"/><path fill="#bc8d43" d="M12 10c-2-2-4 0-2 2-2 2 0 4 2 2 2 2 4 0 2-2 2-2 0-4-2-2Z"/>',
45
+ calligraphy: '<path fill="#bc8d43" d="m14 3 4 2-8 13-5 3 1-6Z"/><path fill="#17364b" d="m6 15 4 3-5 3Z"/><path d="m7 18 3-5M12 6l4 2"/><path stroke="#b54c3b" d="M13 20c3 0 7-1 7-3m-5-3c2 1 5 0 5-2"/>',
46
+ 'star-eight': '<path fill="#bc8d43" d="m12 2 2.4 4.2L19 5l-1.2 4.6L22 12l-4.2 2.4L19 19l-4.6-1.2L12 22l-2.4-4.2L5 19l1.2-4.6L2 12l4.2-2.4L5 5l4.6 1.2Z"/><path fill="#3f7d6a" d="m12 8 4 4-4 4-4-4Z"/>',
47
+ crescent: '<path fill="#3f7d6a" d="M13 3a9 9 0 1 0 7.5 14A8 8 0 0 1 13 3Z"/><path fill="#bc8d43" d="m18 3 1 2.3 2.5.2-2 1.6.7 2.4L18 8l-2.2 1.5.7-2.4-2-1.6 2.5-.2Z"/>',
48
+ 'tree-of-life': '<path stroke="#bc8d43" d="M12 20V7m0 7-5-4m5 1 5-4m-5 10 5-4m-5 4-5-3m1 7 4-2 4 2"/><path fill="#b54c3b" d="M12 7c-4-2-3-5 0-5 3 0 4 3 0 5Z"/><path fill="#3f7d6a" d="M7 10c-4 1-5-3-5-5 4 0 6 2 5 5Zm10-3c-1-4 2-5 5-5 0 4-2 6-5 5ZM7 15c-4 1-5-2-4-5 3 0 5 2 4 5Zm10-2c0-4 3-5 5-4 0 3-2 5-5 4Z"/>',
49
+ unity: '<path fill="#f4e4c8" d="m6 10 3-3h3l6 6-4 5c-.6.6-1.5.8-2 .4l-6-4Z"/><path fill="#f4e4c8" d="m18 10-3-3h-3l-3 3a1.4 1.4 0 0 0 2 2l1-1 5 5 2-2Z"/><path fill="#17364b" d="m2 7 3-1 3 4-3 6-3-1Z"/><path fill="#3f7d6a" d="m22 7-2-1-3 4 2 6 3-1Z"/><path d="m10 15 3 3m0-5 3 3"/>',
50
+ dove: '<path fill="#f4e4c8" d="M4 14c4 1 6 0 8-3l2-3c1-2 4-2 5 0l2 1-3 1c0 4-3 7-7 7H6l-3 3Z"/><path fill="#f4e4c8" d="M11 14C6 12 3 8 3 4c5 0 9 4 10 8Z"/><circle fill="#17364b" cx="17" cy="8" r=".45" stroke="none"/><path d="m19 12 2 6"/><path fill="#3f7d6a" d="M20 15c-3 0-3-2-2-3 2 0 3 1 2 3Zm1 2c-1-3 1-4 2-3 0 2 0 3-2 3Z"/>',
51
+ });
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Original 24×24 cultural pictograms drawn for Uyghur UI.
3
+ * These are simplified contemporary interpretations, not monument surveys,
4
+ * historical reconstructions, or copies of the supplied painted references.
5
+ * The camel has two humps; the surnai is a flared wind instrument.
6
+ */
7
+ export const referencePlacesOutline = Object.freeze({
8
+ surnai: '<path d="M11 3h2v4l1 7c.5 2.5 2 4.2 4 6H6c2-1.8 3.5-3.5 4-6l1-7ZM10.8 7h2.4M8 18h8M6 21h12"/><path d="M12 9.5h.01M12 12h.01M12 14.5h.01"/>',
9
+ mosque: '<path d="M3 21V9h2v12m14 0V9h2v12M2.5 9h3L4 5ZM18.5 9h3L20 5ZM6.5 21v-9.5h11V21M7.5 11.5c0-3 2-3.7 4.5-6 2.5 2.3 4.5 3 4.5 6M12 5.5V3m-1.5 0h3M9.5 21v-4c0-1.4 1.2-2.4 2.5-3.5 1.3 1.1 2.5 2.1 2.5 3.5v4M2.5 21h19"/>',
10
+ mausoleum: '<path d="M4 21V8l2-2h12l2 2v13M8 6c0-2 2-3.5 4-4 2 1 4 2 4 4M7 21v-9c0-3 3-5 5-7 2 2 5 4 5 7v9M9.5 21v-8c0-1.7 1.1-2.8 2.5-4.3 1.4 1.5 2.5 2.6 2.5 4.3v8M5.5 10v8m13-8v8M3 21h18"/>',
11
+ minaret: '<path d="M8.5 21 10 8h4l1.5 13M8.5 6h7v2h-7ZM9 6V4.5L12 2l3 2.5V6M7 21h10M9.7 11h4.6M9.3 15h5.4M9 18h6M12 8v3m-1.5 0v4m3 0v3m-3 0v3"/>',
12
+ madrasa: '<path d="M3 21V9h4V4h10v5h4v12M7 9v12m10-12v12M9.5 21v-8c0-1.8 1.1-3 2.5-4.5 1.4 1.5 2.5 2.7 2.5 4.5v8M10 6.5h4M4.8 12v3m0 3v1m14.4-7v3m0 3v1M2.5 21h19"/>',
13
+ 'traditional-house': '<path d="M3 21V10h7V4h8v7h3v10M10 10h5v11M3 13h7m5-2h3M12.5 7h3v3h-3ZM5 15h2v2H5ZM17.5 14h1v3h-1ZM9 21v-3a2 2 0 0 1 4 0v3M2.5 21h19"/>',
14
+ yurt: '<path d="m3 11 9-7 9 7v10H3ZM3 11h18M7 10l5-6 5 6M10 21v-7h4v7M3 14h7m4 0h7M3 18h7m4 0h7M4 16l1.5-1 1.5 2 1.5-1m7 0 1.5-1 1.5 2 1.5-1M10.5 3h3"/>',
15
+ 'city-gate': '<path d="M3 21V4h2v2h1V4h2v4h8V4h2v2h1V4h2v17M8 8v13m8-13v13M8 21v-7c0-2.5 2.3-4.4 4-6 1.7 1.6 4 3.5 4 6v7M5.5 11v3m13-3v3M3 18h5m8 0h5M2.5 21h19"/>',
16
+ 'ancient-ruins': '<path d="M3 21v-8l2-1 2 2V8l3 1V5l3-1 2 1v7l3-1 1-5h2v15M7 14v7m8-9v9M10 14v3m7-1h1M5 18h2M3 21h18"/><path d="m4 9 1-1m12-5h1"/>',
17
+ landscape: '<circle cx="5" cy="4.5" r="1.5"/><path d="m2.7 16 5.8-8 3 4 4.2-7 5.6 11M6.7 10.5l1.8 1.8 1.2-1.3m3.9-2.3 2.1 2.2 1.3-1.4M2.5 17c4-2 7 2 11 0s5-1 8-.5M3 21c3-1.8 6 .8 9-.2s5-1.5 9-.3M10 14l-2 2m9-3 2 3"/>',
18
+ 'tea-set': '<path d="M6 9h8l1.2 4.5c.8 3-1.2 5.5-5.2 5.5s-6-2.5-5.2-5.5ZM5 11 2.5 8.5v5L5 16m9.5-6c4-1 5 4 1 5.5M6 6.5h8M10 4v2.5M7 21h6m-3-9 2 2-2 2-2-2ZM16 17c.2 3 1 4 2.8 4s2.6-1 2.7-4"/><ellipse cx="18.8" cy="17" rx="2.7" ry=".8"/>',
19
+ cotton: '<path d="M5.5 12c-3-1-2.5-5.5.5-5.5C5 2.5 10 2 12 5c2-3 7-2.5 6 1.5 3 0 3.5 4.5 1 5.5-.5 3-4.5 3-7 0-2 3-6 3-6.5 0ZM12 12v9m0-9V5m0 13c-3-5-6-3-7-3 1 3 3 4 7 3Zm0 1c3-5 6-3 7-3-1 3-3 4-7 3Z"/>',
20
+ melon: '<ellipse cx="12" cy="8" rx="8" ry="5"/><path d="M5 5c1 3 1 5 0 6m7-8v9m7-7c-1 3-1 5 0 6M3 10h18c0 6-3.5 11-9 11S3 16 3 10Zm1 4c3 5 13 5 16 0M8.5 12.5l.5 1m3-.5v1m3-.5.5-1"/>',
21
+ horse: '<path d="M6 10c2-2 6-2 8 0l2-5 3-1 2 3-2 2-1 4-3 1-1 7h-2l-.7-7H9l-1 7H6l.6-8-2.1 2L3 13l2-3ZM6 10C3 7 3 8 3 13M18 4l.5-1.5L20 5M8 9v4h5l1-3M9.5 15l.5 5m6-6 1 6M18.5 6.5h.01"/>',
22
+ camel: '<path d="m5 12 1.5-6c.4-1.8 2.5-1.8 3 0l1.5 4 1.5-4c.6-1.8 2.6-1.8 3 0l1 6h1l1-6c.2-2 1.5-3 3.5-2.5L22 5v2l-2 .5-.5 6-3 2L16 21h-2l-.5-6H9l-1 6H6l.5-8-2 3H3ZM5 12c-2 0-2 2-2 4m6-6v3h5v-3M9.5 15l.5 5m6-5 1 5M20.5 5.5h.01"/>',
23
+ 'nan-stack': '<ellipse cx="13" cy="16" rx="8.5" ry="4"/><path d="M4.5 16v1c0 2.2 3.8 4 8.5 4s8.5-1.8 8.5-4v-1M2.5 10v2c0 3 3.6 5.5 8 5.5s8-2.5 8-5.5v-2"/><ellipse cx="10.5" cy="10" rx="8" ry="5.5"/><path d="M7 8.5h.01m3.5-1h.01m3.5 1h.01m-7 3h.01m3.5 1h.01m3.5-1h.01m-3.5-1.5h.01"/>',
24
+ });
25
+
26
+ export const referencePlacesColor = Object.freeze({
27
+ surnai: '<g stroke="#17364b"><path fill="#bc8d43" d="M11 3h2v4l1 7c.5 2.5 2 4.2 4 6H6c2-1.8 3.5-3.5 4-6l1-7Z"/><path fill="#b54c3b" d="M8 18h8l2 2H6Z"/><path d="M10.8 7h2.4M6 21h12M12 9.5h.01M12 12h.01M12 14.5h.01"/></g>',
28
+ mosque: '<g stroke="#17364b"><path fill="#f4e4c8" d="M3 9h2v12H3ZM19 9h2v12h-2ZM6.5 11.5h11V21h-11Z"/><path fill="#3f7d6a" d="m2.5 9 1.5-4 1.5 4ZM18.5 9 20 5l1.5 4ZM7.5 11.5c0-3 2-3.7 4.5-6 2.5 2.3 4.5 3 4.5 6Z"/><path fill="#bc8d43" d="M9.5 21v-4c0-1.4 1.2-2.4 2.5-3.5 1.3 1.1 2.5 2.1 2.5 3.5v4Z"/><path d="M12 5.5V3m-1.5 0h3M2.5 21h19"/></g>',
29
+ mausoleum: '<g stroke="#17364b"><path fill="#3f7d6a" d="M8 6c0-2 2-3.5 4-4 2 1 4 2 4 4Z"/><path fill="#bc8d43" d="M4 21V8l2-2h12l2 2v13Z"/><path fill="#3f7d6a" d="M7 21v-9c0-3 3-5 5-7 2 2 5 4 5 7v9Z"/><path fill="#f4e4c8" d="M9.5 21v-8c0-1.7 1.1-2.8 2.5-4.3 1.4 1.5 2.5 2.6 2.5 4.3v8Z"/><path stroke="#f4e4c8" d="M5.5 10v8m13-8v8"/><path d="M3 21h18"/></g>',
30
+ minaret: '<g stroke="#17364b"><path fill="#bc8d43" d="M8.5 21 10 8h4l1.5 13Z"/><path fill="#3f7d6a" d="M8.5 6h7v2h-7ZM9 6V4.5L12 2l3 2.5V6Z"/><path d="M7 21h10M9.7 11h4.6M9.3 15h5.4M9 18h6M12 8v3m-1.5 0v4m3 0v3m-3 0v3"/></g>',
31
+ madrasa: '<g stroke="#17364b"><path fill="#bc8d43" d="M3 21V9h4V4h10v5h4v12Z"/><path fill="#3f7d6a" d="M7 4h10v17H7Z"/><path fill="#f4e4c8" d="M9.5 21v-8c0-1.8 1.1-3 2.5-4.5 1.4 1.5 2.5 2.7 2.5 4.5v8Z"/><path stroke="#f4e4c8" d="M10 6.5h4"/><path d="M4.8 12v3m0 3v1m14.4-7v3m0 3v1M2.5 21h19"/></g>',
32
+ 'traditional-house': '<g stroke="#17364b"><path fill="#bc8d43" d="M3 21V10h7V4h8v7h3v10Z"/><path fill="#f4e4c8" d="M3 10h12v11H3Z"/><path fill="#3f7d6a" d="M12.5 7h3v3h-3ZM5 15h2v2H5ZM17.5 14h1v3h-1Z"/><path fill="#b54c3b" d="M9 21v-3a2 2 0 0 1 4 0v3Z"/><path d="M3 13h7m5-2h3M2.5 21h19"/></g>',
33
+ yurt: '<g stroke="#17364b"><path fill="#f4e4c8" d="M3 11h18v10H3Z"/><path fill="#bc8d43" d="m3 11 9-7 9 7Z"/><path fill="#3f7d6a" d="M3 14h18v4H3Z"/><path fill="#b54c3b" d="M10 14h4v7h-4Z"/><path d="M7 10l5-6 5 6M10.5 3h3"/><path stroke="#f4e4c8" d="m4 16 1.5-1 1.5 2 1.5-1m7 0 1.5-1 1.5 2 1.5-1"/></g>',
34
+ 'city-gate': '<g stroke="#17364b"><path fill="#bc8d43" d="M3 21V4h2v2h1V4h2v4h8V4h2v2h1V4h2v17Z"/><path fill="#f4e4c8" d="M8 21v-7c0-2.5 2.3-4.4 4-6 1.7 1.6 4 3.5 4 6v7Z"/><path d="M8 8v5m8-5v5M5.5 11v3m13-3v3M3 18h5m8 0h5M2.5 21h19"/></g>',
35
+ 'ancient-ruins': '<g stroke="#17364b"><path fill="#bc8d43" d="M3 21v-8l2-1 2 2V8l3 1V5l3-1 2 1v7l3-1 1-5h2v15Z"/><path fill="#f4e4c8" d="M3 21v-8l2-1 2 2v7Zm12 0v-9l3-1 1-5h2v15Z"/><path d="M10 14v3m7-1h1M5 18h2M3 21h18m-17-12 1-1m12-5h1"/></g>',
36
+ landscape: '<g stroke="#17364b"><circle cx="5" cy="4.5" r="1.5" fill="#bc8d43"/><path fill="#bc8d43" d="m2.7 16 5.8-8 3 4 4.2-7 5.6 11Z"/><path fill="#f4e4c8" d="m6.7 10.5 1.8-2.5 1.2 3-1.2 1.3Zm6.9-1.8 2.1-3.7 1.3 4.5-1.3 1.4Z"/><path fill="#3f7d6a" d="M2.5 17c4-2 7 2 11 0s5-1 8-.5V22h-19Z"/><path stroke="#f4e4c8" d="M3.5 20c3-1.8 5.5.8 8.5-.2s4.5-1.5 8-.3"/></g>',
37
+ 'tea-set': '<g stroke="#17364b"><path fill="#3f7d6a" d="M6 9h8l1.2 4.5c.8 3-1.2 5.5-5.2 5.5s-6-2.5-5.2-5.5Z"/><path fill="#bc8d43" d="M5 11 2.5 8.5v5L5 16Z"/><path d="M14.5 10c4-1 5 4 1 5.5M6 6.5h8M10 4v2.5M7 21h6"/><path fill="#f4e4c8" d="m10 12 2 2-2 2-2-2ZM16 17h5.5c-.1 3-.9 4-2.7 4s-2.6-1-2.8-4Z"/><ellipse cx="18.8" cy="17" rx="2.7" ry=".8" fill="#bc8d43"/></g>',
38
+ cotton: '<g stroke="#17364b"><path fill="#f4e4c8" d="M5.5 12c-3-1-2.5-5.5.5-5.5C5 2.5 10 2 12 5c2-3 7-2.5 6 1.5 3 0 3.5 4.5 1 5.5-.5 3-4.5 3-7 0-2 3-6 3-6.5 0Z"/><path d="M12 12v9m0-9V5"/><path fill="#3f7d6a" d="M12 18c-3-5-6-3-7-3 1 3 3 4 7 3Zm0 1c3-5 6-3 7-3-1 3-3 4-7 3Z"/></g>',
39
+ melon: '<g stroke="#17364b"><ellipse cx="12" cy="8" rx="8" ry="5" fill="#3f7d6a"/><path stroke="#f4e4c8" d="M5 5c1 3 1 5 0 6m7-8v9m7-7c-1 3-1 5 0 6"/><path fill="#3f7d6a" d="M3 10h18c0 6-3.5 11-9 11S3 16 3 10Z"/><path fill="#bc8d43" d="M3 10h18l-1 4c-3 5-13 5-16 0Z"/><path stroke="#f4e4c8" d="m8.5 12.5.5 1m3-.5v1m3-.5.5-1"/></g>',
40
+ horse: '<g stroke="#17364b"><path fill="#bc8d43" d="M6 10c2-2 6-2 8 0l2-5 3-1 2 3-2 2-1 4-3 1-1 7h-2l-.7-7H9l-1 7H6l.6-8-2.1 2L3 13l2-3Z"/><path d="M6 10C3 7 3 8 3 13M18 4l.5-1.5L20 5M9.5 15l.5 5m6-6 1 6M18.5 6.5h.01"/><path fill="#b54c3b" d="M8 9v4h5l1-3-3-1Z"/><path stroke="#f4e4c8" d="M9.5 10.5h2"/></g>',
41
+ camel: '<g stroke="#17364b"><path fill="#bc8d43" d="m5 12 1.5-6c.4-1.8 2.5-1.8 3 0l1.5 4 1.5-4c.6-1.8 2.6-1.8 3 0l1 6h1l1-6c.2-2 1.5-3 3.5-2.5L22 5v2l-2 .5-.5 6-3 2L16 21h-2l-.5-6H9l-1 6H6l.5-8-2 3H3Z"/><path d="M5 12c-2 0-2 2-2 4m6.5-1 .5 5m6-5 1 5M20.5 5.5h.01"/><path fill="#b54c3b" d="M9 10h5v3H9Z"/><path stroke="#f4e4c8" d="M10.5 11.5h2"/></g>',
42
+ 'nan-stack': '<g stroke="#17364b"><path fill="#bc8d43" d="M4.5 16v1c0 2.2 3.8 4 8.5 4s8.5-1.8 8.5-4v-1Z"/><ellipse cx="13" cy="16" rx="8.5" ry="4" fill="#f4e4c8"/><path fill="#bc8d43" d="M2.5 10v2c0 3 3.6 5.5 8 5.5s8-2.5 8-5.5v-2Z"/><ellipse cx="10.5" cy="10" rx="8" ry="5.5" fill="#f4e4c8"/><path stroke="#b54c3b" d="M7 8.5h.01m3.5-1h.01m3.5 1h.01m-7 3h.01m3.5 1h.01m3.5-1h.01m-3.5-1.5h.01"/></g>',
43
+ });
package/src/styles.css ADDED
@@ -0,0 +1,20 @@
1
+ @import url('./font.css');
2
+ @import url('./application.css');
3
+ @import url('./blocks.css');
4
+ :root{--ug-font:"ALKATIP Basma",Tahoma,serif;--ug-surface:#fff;--ug-bg:#f4f7f9;--ug-text:#152d3d;--ug-muted:#566b78;--ug-line:#c9d7df;--ug-blue:#086aa7;--ug-blue-hover:#075687;--ug-accent:#559ee2;--ug-soft:#e8f3fc;--ug-danger:#b43137;--ug-radius:10px;--ug-focus:#126ca4}
5
+ [data-ug-theme=dark]{--ug-surface:#172d3b;--ug-bg:#10212d;--ug-text:#e9f3fa;--ug-muted:#acc0cd;--ug-line:#415868;--ug-blue:#80c5ff;--ug-blue-hover:#a9d8ff;--ug-soft:#233f53;--ug-danger:#ffafb2;--ug-focus:#92cfff}
6
+ .ug-ui{font-family:var(--ug-font);color:var(--ug-text);line-height:2.2}
7
+ .ug-ui *{box-sizing:border-box}.ug-ui [hidden]{display:none!important}.ug-ui :is(button,input,select,textarea){font:inherit}.ug-ui :focus-visible{outline:3px solid var(--ug-focus);outline-offset:3px}.ug-ui svg{flex-shrink:0;vertical-align:middle}.ug-ui [lang=en],.ug-ui [lang=ug-Latn]{font-family:system-ui,Arial,"ALKATIP Basma",sans-serif}
8
+ .ug-ui .ug-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.ug-ui .ug-row+.ug-row{margin-block-start:15px}.ug-ui .ug-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.ug-ui .ug-button svg{width:1.1em;height:1.1em}
9
+ .ug-button{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:43px;padding:7px 18px;border:1px solid transparent;border-radius:var(--ug-radius);background:var(--ug-blue);color:var(--ug-surface);font:inherit;line-height:1.8;text-decoration:none;cursor:pointer;transition:background .16s,transform .16s,box-shadow .16s}
10
+ .ug-button:hover{background:var(--ug-blue-hover);box-shadow:0 4px 14px #086aa71a}.ug-button:active{transform:translateY(1px)}.ug-button:disabled,.ug-button[aria-disabled=true]{opacity:.5;cursor:not-allowed;box-shadow:none;transform:none}.ug-button--secondary{border-color:var(--ug-line);background:var(--ug-surface);color:var(--ug-text)}.ug-button--secondary:hover{background:var(--ug-soft)}.ug-button--ghost{background:transparent;color:var(--ug-link,var(--ug-blue))}.ug-button--ghost:hover{background:var(--ug-soft)}.ug-button--danger{background:var(--ug-danger);color:var(--ug-surface)}.ug-button--icon{width:43px;padding:8px}.ug-button--small{min-height:34px;padding:4px 12px;font-size:.85em}.ug-button[aria-pressed=true]{background:var(--ug-text);color:var(--ug-surface)}
11
+ .ug-field{display:grid;gap:6px;margin-block:15px}.ug-label{display:block;font-weight:normal;font-size:.95em}.ug-input,.ug-select,.ug-textarea{display:block;width:100%;min-width:0;padding:9px 12px;min-height:43px;background:var(--ug-surface);color:var(--ug-text);border:1px solid var(--ug-line);border-radius:var(--ug-radius);line-height:1.8;font:inherit}.ug-input::placeholder,.ug-textarea::placeholder{color:var(--ug-muted)}.ug-textarea{min-height:120px;resize:vertical}.ug-input[aria-invalid=true],.ug-textarea[aria-invalid=true],.ug-select[aria-invalid=true]{border-color:var(--ug-danger)}.ug-error{color:var(--ug-danger);font-size:.82em;min-height:1.5em;line-height:1.7}.ug-hint{color:var(--ug-muted);font-size:.82em;line-height:1.8}.ug-check{display:inline-flex;gap:9px;align-items:center;cursor:pointer}.ug-check input{accent-color:var(--ug-blue);width:18px;height:18px}.ug-fieldset{border:1px solid var(--ug-line);border-radius:var(--ug-radius);padding:15px 18px}.ug-fieldset legend{padding-inline:8px}.ug-range{width:100%;accent-color:var(--ug-blue)}.ug-switch{display:inline-flex;gap:10px;align-items:center;cursor:pointer}.ug-switch input{appearance:none;width:42px;height:24px;border:1px solid var(--ug-line);background:var(--ug-line);border-radius:15px;position:relative;cursor:pointer;margin:0}.ug-switch input:before{content:'';position:absolute;inset-inline-start:3px;top:3px;width:16px;height:16px;border-radius:50%;background:var(--ug-surface);transition:inset-inline-start .15s}.ug-switch input:checked{background:var(--ug-blue)}.ug-switch input:checked:before{inset-inline-start:21px}.ug-switch input:disabled{opacity:.5;cursor:default}
12
+ .ug-card{border:1px solid var(--ug-line);background:var(--ug-surface);border-radius:calc(var(--ug-radius) + 4px);padding:22px;min-width:0}.ug-card--interactive{transition:border-color .2s,transform .2s,box-shadow .2s}.ug-card--interactive:hover,.ug-card--interactive:focus-within{border-color:var(--ug-accent);transform:translateY(-3px);box-shadow:0 12px 30px #163e5010}.ug-badge{display:inline-flex;align-items:center;gap:5px;border-radius:20px;background:var(--ug-soft);color:var(--ug-link,var(--ug-blue));border:1px solid color-mix(in srgb,var(--ug-blue) 20%,transparent);font-size:.76em;padding:2px 10px;line-height:1.8}.ug-badge--success{background:#e8f7ee;color:#19603d;border-color:#9fc8ae}.ug-badge--warning{background:#fff4dc;color:#75500b;border-color:#d9bf80}.ug-avatar{width:46px;height:46px;border-radius:50%;background:var(--ug-soft);color:var(--ug-blue);display:inline-grid;place-items:center;font-size:22px;overflow:hidden}.ug-divider{border:0;border-top:1px solid var(--ug-line);margin-block:20px}
13
+ .ug-alert{display:flex;align-items:flex-start;gap:12px;background:var(--ug-soft);border:1px solid var(--ug-line);border-inline-start:3px solid var(--ug-blue);border-radius:var(--ug-radius);padding:14px 18px;line-height:1.9}.ug-alert svg{margin-top:5px}.ug-alert p{margin:0}.ug-alert--danger{border-inline-start-color:var(--ug-danger)}
14
+ .ug-dialog{width:min(520px,calc(100% - 32px));padding:26px;border:1px solid var(--ug-line);border-radius:18px;color:var(--ug-text);background:var(--ug-surface);font:inherit;max-height:calc(100dvh - 40px);overflow:auto;box-shadow:0 30px 100px #10212d44}.ug-dialog::backdrop{background:#10253588;backdrop-filter:blur(4px)}.ug-dialog h2{font-size:26px;font-weight:normal;margin:0 0 10px}.ug-dialog p{margin-block:12px;color:var(--ug-muted)}.ug-dialog-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:24px}
15
+ .ug-tabs [role=tablist]{display:flex;gap:4px;border-bottom:1px solid var(--ug-line);overflow:auto;padding:3px}.ug-tabs [role=tab]{font:inherit;border:0;border-bottom:2px solid transparent;padding:8px 17px;background:transparent;color:var(--ug-muted);cursor:pointer;white-space:nowrap}.ug-tabs [role=tab][aria-selected=true]{color:var(--ug-blue);border-bottom-color:var(--ug-blue);background:var(--ug-soft)}.ug-tabs [role=tabpanel]{padding:20px 5px;line-height:2.1}.ug-tabs [role=tab]:disabled{opacity:.5;cursor:default}
16
+ .ug-accordion{border:1px solid var(--ug-line);border-radius:var(--ug-radius);background:var(--ug-surface);overflow:hidden}.ug-accordion details+details{border-top:1px solid var(--ug-line)}.ug-accordion summary{padding:13px 18px;cursor:pointer;color:var(--ug-text)}.ug-accordion details>div{padding:0 18px 18px;color:var(--ug-muted)}
17
+ .ug-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px;border:1px solid var(--ug-line);border-radius:var(--ug-radius);background:var(--ug-surface)}.ug-nav a{color:var(--ug-muted);text-decoration:none;padding:4px 14px;border-radius:8px}.ug-nav a:hover,.ug-nav a[aria-current=page]{background:var(--ug-soft);color:var(--ug-blue)}
18
+ .ug-toast-region{position:fixed;inset-inline-end:20px;bottom:20px;z-index:100;display:grid;gap:10px;width:min(390px,calc(100vw - 40px));pointer-events:none}.ug-toast{display:flex;gap:15px;align-items:center;justify-content:space-between;padding:14px 18px;border:1px solid var(--ug-line);border-radius:var(--ug-radius);background:var(--ug-surface);color:var(--ug-text);box-shadow:0 8px 35px #10212d33;pointer-events:auto}.ug-toast button{font:22px/1 Arial,sans-serif;border:0;background:transparent;color:var(--ug-muted);cursor:pointer;padding:4px}.ug-progress{width:100%;height:8px;border:0;border-radius:8px;overflow:hidden;accent-color:var(--ug-blue)}.ug-progress::-webkit-progress-bar{background:var(--ug-soft)}.ug-progress::-webkit-progress-value{background:var(--ug-blue)}.ug-progress::-moz-progress-bar{background:var(--ug-blue)}
19
+ @media(prefers-reduced-motion:reduce){.ug-ui *,.ug-ui *:before{transition:none!important;animation:none!important}.ug-card--interactive:hover,.ug-card--interactive:focus-within,.ug-button:active{transform:none}}
20
+ @media(max-width:720px){.ug-ui .ug-columns{grid-template-columns:minmax(0,1fr);gap:0}}
@@ -0,0 +1,7 @@
1
+ export type ThemePreset = 'doppa' | 'atlas' | 'desert' | 'ceramic';
2
+ export interface CulturalTheme { readonly id: ThemePreset; readonly name: { readonly ug:string; readonly en:string }; readonly mode:'light'|'dark'; readonly tokens: Readonly<Record<string,string>>; readonly contrast: { readonly button:number; readonly text:number; readonly link:number } }
3
+ export declare const themePresets: readonly { readonly id:ThemePreset; readonly name:{readonly ug:string;readonly en:string};readonly accent:string;readonly bg:string;readonly surface:string;readonly soft:string }[];
4
+ export declare function createTheme(preset?:ThemePreset, options?:{accent?:string;radius?:number;fontSize?:number;lineHeight?:number;mode?:'light'|'dark'}):CulturalTheme;
5
+ export declare function contrastRatio(a:string,b:string):number;
6
+ export declare function exportThemeCSS(theme:CulturalTheme, options?:{selector?:string}):string;
7
+ export declare function exportThemeJSON(theme:CulturalTheme):string;
package/src/themes.js ADDED
@@ -0,0 +1,36 @@
1
+ const freeze = (value) => { if (value && typeof value === 'object') { Object.values(value).forEach(freeze); Object.freeze(value); } return value; };
2
+ export const themePresets = freeze([
3
+ { id: 'doppa', name: { ug: 'دوپپا', en: 'Doppa' }, accent: '#27654b', bg: '#f5f2e9', surface: '#fffdf6', soft: '#e7eee4' },
4
+ { id: 'atlas', name: { ug: 'ئەتلەس', en: 'Atlas' }, accent: '#9a3f49', bg: '#fbf3ef', surface: '#fffaf7', soft: '#f3e3e0' },
5
+ { id: 'desert', name: { ug: 'قۇملۇق', en: 'Desert' }, accent: '#855b22', bg: '#f7efde', surface: '#fffcf5', soft: '#efe1c7' },
6
+ { id: 'ceramic', name: { ug: 'ساپال', en: 'Ceramic' }, accent: '#176487', bg: '#eff5f6', surface: '#fbffff', soft: '#deedf1' },
7
+ ]);
8
+ const hex = (value) => typeof value === 'string' && /^#[\da-f]{6}$/i.test(value);
9
+ function luminance(color) { const values = color.slice(1).match(/../g).map((c) => parseInt(c, 16) / 255).map((c) => c <= .04045 ? c / 12.92 : ((c + .055) / 1.055) ** 2.4); return values[0] * .2126 + values[1] * .7152 + values[2] * .0722; }
10
+ export function contrastRatio(a, b) { if (!hex(a) || !hex(b)) throw new TypeError('Use six-digit hex colors'); const x = luminance(a), y = luminance(b); return (Math.max(x, y) + .05) / (Math.min(x, y) + .05); }
11
+ export function createTheme(preset = 'doppa', options = {}) {
12
+ const selected = themePresets.find(({ id }) => id === preset);
13
+ if (!selected) throw new RangeError('Unknown cultural theme');
14
+ if (!options || typeof options !== 'object' || Array.isArray(options)) throw new TypeError('Theme options must be an object');
15
+ for (const key of Object.keys(options)) if (!['accent','radius','fontSize','lineHeight','mode'].includes(key)) throw new TypeError('Unknown theme option');
16
+ const { accent = selected.accent, radius = 10, fontSize = 17, lineHeight = 2.2, mode = 'light' } = options;
17
+ if (!hex(accent)) throw new TypeError('Accent must be a six-digit hex color');
18
+ for (const [key, value, min, max] of [['radius',radius,0,24],['fontSize',fontSize,14,24],['lineHeight',lineHeight,1.6,2.6]]) if (!Number.isFinite(value) || value < min || value > max) throw new RangeError(`Invalid ${key}`);
19
+ if (!['light','dark'].includes(mode)) throw new RangeError('Mode must be light or dark');
20
+ const dark = mode === 'dark', surface = dark ? '#172d3b' : selected.surface;
21
+ // Button foreground and surface are separate tokens so every chosen accent remains legible.
22
+ const foreground = contrastRatio(accent, '#ffffff') >= contrastRatio(accent, '#000000') ? '#ffffff' : '#000000';
23
+ const link = dark ? '#a6d7fc' : (Math.min(contrastRatio(accent, selected.bg), contrastRatio(accent, selected.soft)) >= 4.5 ? accent : '#17364b');
24
+ return freeze({ id: selected.id, name: { ...selected.name }, mode, tokens: {
25
+ '--ug-bg': dark ? '#10212d' : selected.bg, '--ug-surface': surface,
26
+ '--ug-soft': dark ? '#233f53' : selected.soft, '--ug-text': dark ? '#edf6fa' : '#17364b',
27
+ '--ug-muted': dark ? '#b6cbd5' : '#526673', '--ug-line': dark ? '#536e7d' : '#b7c7cc',
28
+ '--ug-blue': accent.toLowerCase(), '--ug-blue-hover': accent.toLowerCase(), '--ug-accent': accent.toLowerCase(),
29
+ '--ug-button-text': foreground, '--ug-link': link, '--ug-focus': dark ? '#a6d7fc' : '#176487',
30
+ '--ug-danger': dark ? '#ffb9b0' : '#a62833', '--ug-radius': `${radius}px`,
31
+ '--ug-font-size': `${fontSize}px`, '--ug-line-height': String(lineHeight), '--ug-font': '"ALKATIP Basma",Tahoma,serif',
32
+ }, contrast: { button: contrastRatio(accent, foreground), text: contrastRatio(dark ? '#edf6fa' : '#17364b', surface), link: contrastRatio(link, dark ? '#10212d' : selected.bg) } });
33
+ }
34
+ function verify(theme) { if (!theme || !theme.tokens || !themePresets.some(({ id }) => theme.id === id)) throw new TypeError('Use a generated theme'); for (const [key,value] of Object.entries(theme.tokens)) if (!/^--ug-[a-z-]+$/.test(key) || typeof value !== 'string' || /[{};<>\n\r]/.test(value)) throw new TypeError('Unsafe theme token'); }
35
+ export function exportThemeCSS(theme, { selector = '.ug-ui' } = {}) { verify(theme); if (typeof selector !== 'string' || !/^(?:\.[a-zA-Z][\w-]*|:root|\[data-ug-theme="(?:light|dark)"\])$/.test(selector)) throw new TypeError('Use a single class, :root, or theme selector'); return `${selector}{\n${Object.entries(theme.tokens).map(([key,value]) => ` ${key}: ${value};`).join('\n')}\n font-size:var(--ug-font-size);\n line-height:var(--ug-line-height);\n}\n${selector} .ug-button:not(.ug-button--secondary):not(.ug-button--ghost):not(.ug-button--danger){color:var(--ug-button-text)}\n${selector} a:not(.ug-button){color:var(--ug-link)}\n`; }
36
+ export function exportThemeJSON(theme) { verify(theme); return JSON.stringify({ schemaVersion: 1, ...theme }, null, 2) + '\n'; }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Original 24×24 pictograms inspired by Uyghur music, craft and everyday life.
3
+ * Simplified symbols, not historical reproductions or instrument diagrams.
4
+ * Instrument silhouettes were checked against the Wende Museum collection:
5
+ * https://wendemuseum.org/traditional-central-asian-musical-instruments-from-the-collection-of-ian-price/
6
+ */
7
+ export const traditionalDrawings = Object.freeze({
8
+ // Long-necked plucked lutes: paired strings, small tambur body, rawap horns.
9
+ dutar: '<path d="M10.5 3h3v8.5c1.1 1.8 4 3.1 4 5.6a5.5 4 0 0 1-11 0c0-2.5 2.9-3.8 4-5.6ZM9 5h1.5m3-1H15m-4 8v6.5m2-6.5v6.5M9.5 19h5"/>',
10
+ tambur: '<path d="M11 3h2v12c1.7.8 3 1.9 3 3.6a4 2.4 0 0 1-8 0c0-1.7 1.3-2.8 3-3.6ZM9 5h2m2 2h2M11 10h2m-2 3h2m-1 2v4"/>',
11
+ rawap: '<path d="M11 11V5c0-1.7 3-2.5 3-1s-1 2-1 2v5M11 10C7 8 5 10 7 13l3-1m3-2c4-2 6 0 4 3l-3-1"/><circle cx="12" cy="17" r="4"/><path d="M12 7v12M10 18h4"/>',
12
+ // Bowed instruments retain a separate bow; the ghijek also has an end spike.
13
+ ghijek: '<path d="M9 3h2v8M7 5h2m2 2h2M10 11v8m0 0v2"/><circle cx="10" cy="15" r="4"/><path d="m17 4 3 15m-1-15c-1 5 0 10 2 14M8 16h4"/>',
14
+ satar: '<path d="M8 3h2v9c1.6 1.9 3.5 3.4 3.5 5.8a4.5 3.2 0 0 1-9 0c0-2.4 1.9-3.9 3.5-5.8ZM6 5h2m2 3h2M9 5v13m-2 1h4m6-15 3 16m-1-16c-1 5 0 11 2 15"/>',
15
+ dap: '<circle cx="12" cy="12" r="8.5"/><path d="M7 6.5a7 7 0 0 1 10 0M7 17.5a7 7 0 0 0 10 0"/><circle cx="6.5" cy="12" r="1"/><circle cx="17.5" cy="12" r="1"/><path d="M12 4v2m0 12v2"/>',
16
+
17
+ // Cloth, weaving and needlework use their own silhouettes and repeat patterns.
18
+ atlas: '<path d="M4 3h16v18H4ZM7 6l3 3-3 3 3 3-3 3m7-12 3 3-3 3 3 3-3 3M4 3l2 2m14 16-2-2"/>',
19
+ carpet: '<path d="M5 5h14v14H5ZM7 3v2m5-2v2m5-2v2M7 19v2m5-2v2m5-2v2m-5-13 4 4-4 4-4-4Z"/>',
20
+ embroidery: '<circle cx="11" cy="13" r="8"/><path d="M9 5V3h4v2m-6 9 3 3 5-7m1-1 4-4m-1 3c2 0 2 3 0 4"/><path d="m7 10 2 2m2-4 2 2"/>',
21
+ loom: '<path d="M5 3v18m14-18v18M5 6h14M5 18h14M8 6v5m4-5v5m4-5v5M8 15v3m4-3v3m4-3v3M3 13l4-2h10l4 2-4 2H7Z"/>',
22
+ spindle: '<path d="M12 3v18m-5-5c0-3 2-6 5-8 3 2 5 5 5 8Zm0 0c2 2 8 2 10 0M9 11l6 2m-8 2 10 2M12 8c0-4 6-4 8-1"/>',
23
+
24
+ // A covered aywan/veranda is distinct from a pointed arch and carved joinery.
25
+ aywan: '<path d="m3 7 3-3h12l3 3ZM5 7v14m14-14v14M3 21h18M5 10h14M9 10v11m6-11v11M7 7v3m10-3v3"/>',
26
+ archway: '<path d="M4 21V11c0-4 5-6 8-8 3 2 8 4 8 8v10M8 21V12c0-2 2-3.7 4-5 2 1.3 4 3 4 5v9M3 21h18"/>',
27
+ 'carved-door': '<path d="M5 3h14v18H5Zm7 0v18M8.5 6l2 3-2 3-2-3Zm7 0 2 3-2 3-2-3ZM7 16h3m4 0h3"/>',
28
+ 'lattice-window': '<rect x="4" y="4" width="16" height="16" rx="1"/><path d="m4 10 6-6M4 16 16 4M8 20 20 8m-6 12 6-6M4 8l12 12M4 14l6 6M8 4l12 12M14 4l6 6"/>',
29
+
30
+ // Foods and serving objects are shared cultural forms, shown without text.
31
+ nan: '<circle cx="12" cy="12" r="8.5"/><circle cx="12" cy="12" r="3.5"/><path d="M12 6h.01M12 18h.01M6 12h.01M18 12h.01M7.8 7.8h.01m8.4 0h.01m-8.4 8.4h.01m8.4 0h.01"/>',
32
+ samsa: '<path d="m12 4 8.5 15.5c.4.7 0 1.5-.8 1.5H4.3c-.8 0-1.2-.8-.8-1.5ZM8 17l2-3 2 3 2-3 2 3"/>',
33
+ polo: '<ellipse cx="12" cy="16.5" rx="8.5" ry="4"/><path d="M5 14c1-4 4-5 7-4 3-1 6 0 7 4M7 13l2-1m6 0 2 1m-6 0 2 1m-5 3 2-1m5 1 2-1M9 9l1-3m4 3 1-3"/>',
34
+ laghman: '<ellipse cx="12" cy="13" rx="8.5" ry="2.5"/><path d="M3.5 13c.5 5 3.5 7.5 8.5 7.5s8-2.5 8.5-7.5M9 9c-3-3 2-5 1-6m3 7c-2-3 3-4 2-6m2 7c3-1 1-3 3-4M8 21h8"/>',
35
+ teapot: '<path d="M8 9h9l1.5 4a5.5 5.5 0 0 1-11 0ZM9 6h7m-3.5-3v3M7.5 13 3 9v6l4.5 3M18 10h1a3 3 0 0 1 0 6h-1M9 20h7"/>',
36
+ 'tea-bowl': '<ellipse cx="12" cy="10" rx="8.5" ry="2.5"/><path d="M3.5 10c.5 6 3.5 9 8.5 9s8-3 8.5-9M8 21h8M8 15l2 1m4 0 2-1M9 5c-2-1 1-1 0-2m6 2c-2-1 1-1 0-2"/>',
37
+ pomegranate: '<path d="m9 7-2-3 5 2 5-2-2 3c3 1.3 4.5 3.7 4.5 6.5A7.5 7.5 0 0 1 12 21a7.5 7.5 0 0 1-7.5-7.5C4.5 10.7 6 8.3 9 7Z"/><path d="M9 12h.01m6 0h.01M12 15h.01m-3 3h.01m6 0h.01"/>',
38
+
39
+ // Orchard produce often seen in Uyghur tables and ornament.
40
+ grapes: '<circle cx="7.5" cy="9" r="2.2"/><circle cx="12" cy="9" r="2.2"/><circle cx="16.5" cy="9" r="2.2"/><circle cx="9.8" cy="13.5" r="2.2"/><circle cx="14.2" cy="13.5" r="2.2"/><circle cx="12" cy="18" r="2.2"/><path d="M12 6V3m0 3c1-3 4-3 7-2-1 2-3 3-7 2"/>',
41
+ apricot: '<path d="M12 8C7 5 3.5 9 4 14c.4 4 3.6 7 8 7s7.6-3 8-7c.5-5-3-9-8-6Zm0 1c-1.5 3-1.5 7 0 10M12 7c0-3 3-4 7-3-1 3-3 4-7 3Zm-1 0-1-3"/>',
42
+ });
@@ -0,0 +1,17 @@
1
+ # Vendored UyghurCommunity modules
2
+
3
+ These MIT-licensed files are exact, unmodified copies of the sibling projects used by the writing controller. Local imports keep the UI package free of runtime package dependencies. Font URLs remain external; no font binaries are included.
4
+
5
+ | Project/version | Upstream file | Local file | SHA-256 |
6
+ | --- | --- | --- | --- |
7
+ | `uyghur-keyboard@0.1.1` | [src/index.js](https://github.com/UyghurCommunity/uyghur-keyboard/blob/v0.1.1/src/index.js) | `keyboard/index.js` | `775549e55727aaad3803a470eec67261ddf6c18b685d0959b134111a0fdb749c` |
8
+ | `uyghur-keyboard@0.1.1` | [src/style.js](https://github.com/UyghurCommunity/uyghur-keyboard/blob/v0.1.1/src/style.js) | `keyboard/style.js` | `c2e67c42c7506bb41b68070010c09b1d2d8744407cfb6603a161822dfb5556a4` |
9
+ | `uyghur-keyboard@0.1.1` | [LICENSE](https://github.com/UyghurCommunity/uyghur-keyboard/blob/v0.1.1/LICENSE) | `keyboard/LICENSE` | `20f65d63d0ebb714cf4ebe5fd0d541d8f25eff5662dba5bbca2fc2c3fa4cbcde` |
10
+ | `uyghur-text@0.1.0` | [src/index.js](https://github.com/UyghurCommunity/uyghur-text/blob/v0.1.0/src/index.js) | `text/index.js` | `b878905644a6d1bbbbca746e8bd5fc806dce9c3175ef554101bc56c6053df81c` |
11
+ | `uyghur-text@0.1.0` | [LICENSE](https://github.com/UyghurCommunity/uyghur-text/blob/v0.1.0/LICENSE) | `text/LICENSE` | `20f65d63d0ebb714cf4ebe5fd0d541d8f25eff5662dba5bbca2fc2c3fa4cbcde` |
12
+
13
+ Source versions: `@uyghurcommunity/keyboard` 0.1.1 and `@uyghurcommunity/text` 0.1.0. Copied on 2026-11-07. Each project’s complete MIT notice is preserved in its local `LICENSE`.
14
+
15
+ The keyboard supplies the actual alphabet layout, selection-aware editing, cancelable beforeinput events and composition handling. The text module supplies explicit cleanup previews and diffs. UI-specific limits, confirmation, preview, undo and lifecycle behavior live in `../writing.js`.
16
+
17
+ To update a vendor copy, review the upstream change, copy its corresponding license, record the new version and exact file hash here, and rerun the writing tests.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 UyghurCommunity
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,248 @@
1
+ import { alkatipFontFace, alkatipHelperStyles, keyboardStyles } from './style.js';
2
+
3
+ const fontStyleId = 'uyghur-keyboard-alkatip-font';
4
+ const fontRegistrations = new WeakMap();
5
+ function acquireFont(document) {
6
+ let registration = fontRegistrations.get(document);
7
+ if (!registration) {
8
+ const parent = document.head || document.documentElement;
9
+ if (!parent) return () => {};
10
+ let element = document.getElementById(fontStyleId);
11
+ const owned = !element;
12
+ if (!element) {
13
+ element = document.createElement('style');
14
+ element.id = fontStyleId;
15
+ element.textContent = alkatipFontFace + '\n' + alkatipHelperStyles;
16
+ parent.appendChild(element);
17
+ }
18
+ registration = { element, owned, count: 0 };
19
+ fontRegistrations.set(document, registration);
20
+ }
21
+ registration.count++;
22
+ let released = false;
23
+ return () => {
24
+ if (released) return;
25
+ released = true;
26
+ if (--registration.count === 0) {
27
+ if (registration.owned) registration.element.remove();
28
+ fontRegistrations.delete(document);
29
+ }
30
+ };
31
+ }
32
+
33
+ /** The complete 32-letter alphabet is represented across these virtual rows. */
34
+ export const KEY_LAYOUT = Object.freeze([
35
+ Object.freeze(['چ', 'ۋ', 'ې', 'ر', 'ت', 'ي', 'ۇ', 'ڭ', 'و', 'پ']),
36
+ Object.freeze(['ھ', 'س', 'د', 'ا', 'ە', 'ى', 'ق', 'ك', 'ل', 'ژ']),
37
+ Object.freeze(['ز', 'ش', 'غ', 'ۈ', 'ب', 'ن', 'م', 'ۆ', 'گ', 'خ', 'ف', 'ج']),
38
+ Object.freeze(['ئ', 'ئا', 'ئە', 'ئې', 'ئى', 'ئو', 'ئۇ', 'ئۆ', 'ئۈ']),
39
+ ]);
40
+
41
+ /** An explicit, optional phonetic map. This is not an operating-system layout. */
42
+ export const PHONETIC_MAP = Object.freeze({
43
+ a: 'ا', b: 'ب', c: 'چ', d: 'د', e: 'ە', f: 'ف', g: 'گ', h: 'ھ', i: 'ى', j: 'ج',
44
+ k: 'ك', l: 'ل', m: 'م', n: 'ن', o: 'و', p: 'پ', q: 'ق', r: 'ر', s: 'س', t: 'ت',
45
+ u: 'ۇ', v: 'ۆ', w: 'ۋ', x: 'خ', y: 'ي', z: 'ز',
46
+ Z: 'ژ', A: 'ئا', E: 'ئە', I: 'ئى', O: 'ئو', U: 'ئۇ', G: 'غ', N: 'ڭ', S: 'ش', V: 'ئۆ', W: 'ئۈ', C: 'ج', Y: 'ې',
47
+ });
48
+
49
+ function selection(value, start, end) {
50
+ const length = value.length;
51
+ const first = Number.isFinite(start) ? Math.max(0, Math.min(length, Math.trunc(start))) : length;
52
+ const last = Number.isFinite(end) ? Math.max(0, Math.min(length, Math.trunc(end))) : first;
53
+ return [Math.min(first, last), Math.max(first, last)];
54
+ }
55
+
56
+ /** Pure UTF-16 selection replacement, using the same offsets as HTML inputs. */
57
+ export function replaceSelection(value, start, end, text) {
58
+ if (typeof value !== 'string' || typeof text !== 'string') throw new TypeError('value and text must be strings');
59
+ const [a, b] = selection(value, start, end);
60
+ return { value: value.slice(0, a) + text + value.slice(b), start: a + text.length, end: a + text.length };
61
+ }
62
+
63
+ /** Remove a selected range or the preceding complete grapheme. */
64
+ export function deleteSelectionBackward(value, start, end) {
65
+ if (typeof value !== 'string') throw new TypeError('value must be a string');
66
+ const [a, b] = selection(value, start, end);
67
+ if (a !== b) return replaceSelection(value, a, b, '');
68
+ if (!a) return { value, start: 0, end: 0 };
69
+ let previous = 0;
70
+ if (typeof Intl.Segmenter === 'function') {
71
+ for (const part of new Intl.Segmenter('ug', { granularity: 'grapheme' }).segment(value)) {
72
+ if (part.index >= a) break;
73
+ previous = part.index;
74
+ }
75
+ } else {
76
+ previous = a - 1;
77
+ const code = value.charCodeAt(previous);
78
+ if (previous && code >= 0xdc00 && code <= 0xdfff) previous--;
79
+ }
80
+ return replaceSelection(value, previous, a, '');
81
+ }
82
+
83
+ function makeEvent(target, name, type, text, cancelable) {
84
+ const view = target.ownerDocument?.defaultView || globalThis;
85
+ if (typeof view.InputEvent === 'function') {
86
+ return new view.InputEvent(name, { bubbles: true, composed: true, cancelable, inputType: type, data: text });
87
+ }
88
+ const event = new view.Event(name, { bubbles: true, composed: true, cancelable });
89
+ Object.defineProperties(event, { inputType: { value: type }, data: { value: text } });
90
+ return event;
91
+ }
92
+
93
+ /** Mount a virtual keyboard next to a text input/textarea, or in options.container. */
94
+ export function createKeyboard(target, options = {}) {
95
+ if (!target || typeof target.value !== 'string' || typeof target.setSelectionRange !== 'function' || !target.ownerDocument) {
96
+ throw new TypeError('createKeyboard needs a text input or textarea');
97
+ }
98
+ if (target.tagName === 'INPUT' && !['text', 'search', 'tel', 'url', 'password'].includes(target.type || 'text')) {
99
+ throw new TypeError('The input type must support text selection');
100
+ }
101
+ const doc = target.ownerDocument;
102
+ const root = doc.createElement('div');
103
+ root.className = 'ug-keyboard alkatip-basma';
104
+ root.lang = 'ug';
105
+ root.setAttribute('role', 'group');
106
+ root.setAttribute('aria-label', options.label || 'ئۇيغۇرچە كۇنۇپكا تاختىسى');
107
+ const style = doc.createElement('style');
108
+ style.textContent = keyboardStyles;
109
+ root.appendChild(style);
110
+ let physical = options.physical === true;
111
+ let destroyed = false;
112
+ let composing = false;
113
+ const originalDirection = target.getAttribute('dir');
114
+ const direction = options.direction || 'rtl';
115
+ if (!['rtl', 'auto', 'preserve'].includes(direction)) throw new TypeError('direction must be rtl, auto, or preserve');
116
+ if (direction !== 'preserve') target.setAttribute('dir', direction);
117
+
118
+ function keyButton(text, action) {
119
+ const button = doc.createElement('button');
120
+ button.type = 'button';
121
+ button.className = 'ug-keyboard__key';
122
+ button.textContent = text;
123
+ if (action) button.dataset.action = action;
124
+ else button.dataset.text = text;
125
+ button.setAttribute('aria-label', action === 'backspace' ? 'ئالدىنقى ھەرپنى ئۆچۈرۈش' : action === 'space' ? 'بوشلۇق' : text);
126
+ return button;
127
+ }
128
+ KEY_LAYOUT.forEach((keys) => {
129
+ const row = doc.createElement('div');
130
+ row.className = 'ug-keyboard__row';
131
+ keys.forEach((key) => row.appendChild(keyButton(key)));
132
+ root.appendChild(row);
133
+ });
134
+ const actions = doc.createElement('div');
135
+ actions.className = 'ug-keyboard__row';
136
+ actions.appendChild(keyButton('بوشلۇق', 'space'));
137
+ actions.appendChild(keyButton('⌫ ئۆچۈرۈش', 'backspace'));
138
+ root.appendChild(actions);
139
+
140
+ if (options.container) options.container.appendChild(root);
141
+ else if (target.parentNode) target.parentNode.insertBefore(root, target.nextSibling);
142
+ else throw new Error('Attach the target to a document or provide a container');
143
+ // Font faces must be registered in the owner document, including when keys
144
+ // themselves live in a Web Component's shadow root.
145
+ const releaseFont = acquireFont(doc);
146
+
147
+ function commit(result, inputType, text) {
148
+ if (destroyed || target.disabled || target.readOnly || composing) return false;
149
+ if (!target.dispatchEvent(makeEvent(target, 'beforeinput', inputType, text, true))) return false;
150
+ target.value = result.value;
151
+ target.focus({ preventScroll: true });
152
+ target.setSelectionRange(result.start, result.end);
153
+ target.dispatchEvent(makeEvent(target, 'input', inputType, text, false));
154
+ const view = doc.defaultView || globalThis;
155
+ if (typeof view.CustomEvent === 'function') {
156
+ root.dispatchEvent(new view.CustomEvent('uyghur-input', { bubbles: true, composed: true, detail: { value: target.value, inputType, text } }));
157
+ }
158
+ return true;
159
+ }
160
+ function insert(text) {
161
+ if (typeof text !== 'string') throw new TypeError('insert expects a string');
162
+ return commit(replaceSelection(target.value, target.selectionStart, target.selectionEnd, text), 'insertText', text);
163
+ }
164
+ function backspace() {
165
+ return commit(deleteSelectionBackward(target.value, target.selectionStart, target.selectionEnd), 'deleteContentBackward', null);
166
+ }
167
+ function onClick(event) {
168
+ const button = event.target.closest?.('button.ug-keyboard__key');
169
+ if (!button || !root.contains(button)) return;
170
+ if (button.dataset.action === 'backspace') backspace();
171
+ else insert(button.dataset.action === 'space' ? ' ' : button.dataset.text);
172
+ }
173
+ function onPointerDown(event) {
174
+ // Keep the selection in the target while clicking the virtual keys.
175
+ if (event.target.closest?.('button.ug-keyboard__key')) event.preventDefault();
176
+ }
177
+ function onKeyDown(event) {
178
+ if (!physical || composing || event.isComposing || event.defaultPrevented || event.ctrlKey || event.metaKey || event.altKey) return;
179
+ const mapped = PHONETIC_MAP[event.key];
180
+ if (mapped) { event.preventDefault(); insert(mapped); }
181
+ }
182
+ const beginComposition = () => { composing = true; };
183
+ const endComposition = () => { composing = false; };
184
+ root.addEventListener('click', onClick);
185
+ root.addEventListener('pointerdown', onPointerDown);
186
+ target.addEventListener('keydown', onKeyDown);
187
+ target.addEventListener('compositionstart', beginComposition);
188
+ target.addEventListener('compositionend', endComposition);
189
+
190
+ return {
191
+ element: root,
192
+ insert,
193
+ backspace,
194
+ setPhysicalMapping(enabled) { physical = Boolean(enabled); },
195
+ setVisible(visible) { root.hidden = !visible; },
196
+ destroy() {
197
+ if (destroyed) return;
198
+ destroyed = true;
199
+ root.removeEventListener('click', onClick);
200
+ root.removeEventListener('pointerdown', onPointerDown);
201
+ target.removeEventListener('keydown', onKeyDown);
202
+ target.removeEventListener('compositionstart', beginComposition);
203
+ target.removeEventListener('compositionend', endComposition);
204
+ root.remove();
205
+ releaseFont();
206
+ if (direction !== 'preserve' && target.getAttribute('dir') === direction) {
207
+ if (originalDirection === null) target.removeAttribute('dir');
208
+ else target.setAttribute('dir', originalDirection);
209
+ }
210
+ },
211
+ };
212
+ }
213
+
214
+ /** Define the optional Web Component. Safe to import the package in Node/SSR. */
215
+ export function defineUyghurKeyboard(name = 'uyghur-keyboard', registry = globalThis.customElements) {
216
+ if (!registry || typeof globalThis.HTMLElement !== 'function') return null;
217
+ if (registry.get(name)) return registry.get(name);
218
+ class UyghurKeyboardElement extends HTMLElement {
219
+ static get observedAttributes() { return ['for', 'physical']; }
220
+ connectedCallback() {
221
+ if (!this.shadowRoot) this.attachShadow({ mode: 'open' });
222
+ this.mountKeyboard();
223
+ this.readyListener = () => this.mountKeyboard();
224
+ if (this.ownerDocument.readyState === 'loading') this.ownerDocument.addEventListener('DOMContentLoaded', this.readyListener, { once: true });
225
+ }
226
+ attributeChangedCallback() { if (this.isConnected) this.mountKeyboard(); }
227
+ disconnectedCallback() {
228
+ this.controller?.destroy();
229
+ this.controller = null;
230
+ if (this.readyListener) this.ownerDocument.removeEventListener('DOMContentLoaded', this.readyListener);
231
+ }
232
+ mountKeyboard() {
233
+ this.controller?.destroy();
234
+ this.controller = null;
235
+ this.shadowRoot?.replaceChildren();
236
+ const hostStyle = this.ownerDocument.createElement('style');
237
+ hostStyle.textContent = ':host { display: block; }';
238
+ this.shadowRoot?.appendChild(hostStyle);
239
+ const target = this.ownerDocument.getElementById(this.getAttribute('for') || '');
240
+ if (!target) return;
241
+ this.controller = createKeyboard(target, { container: this.shadowRoot, physical: this.hasAttribute('physical') });
242
+ }
243
+ insert(text) { return this.controller?.insert(text) || false; }
244
+ backspace() { return this.controller?.backspace() || false; }
245
+ }
246
+ registry.define(name, UyghurKeyboardElement);
247
+ return UyghurKeyboardElement;
248
+ }
@@ -0,0 +1,22 @@
1
+ export const alkatipFontFace = `@font-face {
2
+ font-family: "ALKATIP Basma";
3
+ src: url("https://db.onlinewebfonts.com/t/3c16518f40da2fc2901f37666c0556a7.woff2") format("woff2"),
4
+ url("https://db.onlinewebfonts.com/t/3c16518f40da2fc2901f37666c0556a7.woff") format("woff"),
5
+ url("https://db.onlinewebfonts.com/t/3c16518f40da2fc2901f37666c0556a7.ttf") format("truetype");
6
+ font-weight: normal;
7
+ font-style: normal;
8
+ font-display: swap;
9
+ }`;
10
+ export const alkatipHelperStyles = `.alkatip-basma {
11
+ font-family: "ALKATIP Basma", serif;
12
+ direction: rtl;
13
+ unicode-bidi: embed;
14
+ line-height: 2.2;
15
+ }`;
16
+ export const keyboardStyles = `
17
+ ${alkatipHelperStyles}
18
+ .ug-keyboard{--ug-bg:#f1f3ef;--ug-key:#fff;--ug-ink:#17362f;--ug-line:#ccd7cf;box-sizing:border-box;width:100%;padding:12px;border:1px solid var(--ug-line);border-radius:16px;background:var(--ug-bg);color:var(--ug-ink);font-family:"ALKATIP Basma",Tahoma,Arial,sans-serif;direction:rtl}
19
+ .ug-keyboard *{box-sizing:border-box}.ug-keyboard__row{display:flex;justify-content:center;gap:6px;margin-block:6px}.ug-keyboard__key{display:inline-flex;align-items:center;justify-content:center;flex:1;min-width:0;min-height:46px;padding:8px 4px;background:var(--ug-key);color:inherit;border:1px solid var(--ug-line);border-radius:8px;font:22px/1.5 "ALKATIP Basma",Tahoma,Arial,sans-serif;cursor:pointer;box-shadow:0 2px 0 #17362f0a}.ug-keyboard__key:hover{background:#e3ede5}.ug-keyboard__key:active{transform:translateY(1px)}.ug-keyboard__key:focus-visible{outline:2px solid #087866;outline-offset:2px}.ug-keyboard__key[data-action]{font-size:14px}.ug-keyboard__key[data-action=space]{flex:4}.ug-keyboard[hidden]{display:none}.ug-keyboard__key:disabled{opacity:.45;cursor:default}
20
+ @media(max-width:420px){.ug-keyboard{padding:8px}.ug-keyboard__row{gap:4px}.ug-keyboard__key{font-size:20px;min-height:42px;padding-inline:2px}}
21
+ @media(prefers-reduced-motion:reduce){.ug-keyboard__key:active{transform:none}}
22
+ `;
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 UyghurCommunity
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.