@ezpg/app-ui 0.21.0 → 0.22.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 (279) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/lib/module/adjust/adjust-template.js +1 -0
  3. package/lib/module/adjust/adjust-template.js.map +1 -1
  4. package/lib/module/adjust/axis-adjust.js +181 -0
  5. package/lib/module/adjust/axis-adjust.js.map +1 -0
  6. package/lib/module/adjust/axis-tabs.js +81 -0
  7. package/lib/module/adjust/axis-tabs.js.map +1 -0
  8. package/lib/module/adjust/axis-wheel.js +286 -0
  9. package/lib/module/adjust/axis-wheel.js.map +1 -0
  10. package/lib/module/adjust/index.js +4 -0
  11. package/lib/module/adjust/index.js.map +1 -1
  12. package/lib/module/adjust/store-sample.js +436 -0
  13. package/lib/module/adjust/store-sample.js.map +1 -0
  14. package/lib/module/blocks/color-swatch-picker/color-swatch-picker.js +1 -1
  15. package/lib/module/blocks/detail-editor/compare-slider.js +5 -2
  16. package/lib/module/blocks/detail-editor/compare-slider.js.map +1 -1
  17. package/lib/module/blocks/detail-editor/detail-canvas.js +192 -61
  18. package/lib/module/blocks/detail-editor/detail-canvas.js.map +1 -1
  19. package/lib/module/blocks/detail-editor/detail-types.js +57 -0
  20. package/lib/module/blocks/detail-editor/detail-types.js.map +1 -1
  21. package/lib/module/blocks/detail-editor/draft-preview.js +22 -0
  22. package/lib/module/blocks/detail-editor/draft-preview.js.map +1 -1
  23. package/lib/module/blocks/detail-editor/focus-context.js +1 -0
  24. package/lib/module/blocks/detail-editor/focus-context.js.map +1 -1
  25. package/lib/module/blocks/detail-editor/index.js +2 -2
  26. package/lib/module/blocks/detail-editor/index.js.map +1 -1
  27. package/lib/module/blocks/detail-editor/keep-words.js +34 -0
  28. package/lib/module/blocks/detail-editor/keep-words.js.map +1 -0
  29. package/lib/module/blocks/detail-editor/layout-picker.js +192 -8
  30. package/lib/module/blocks/detail-editor/layout-picker.js.map +1 -1
  31. package/lib/module/blocks/detail-request/detail-request.js +213 -0
  32. package/lib/module/blocks/detail-request/detail-request.js.map +1 -0
  33. package/lib/module/blocks/detail-request/index.js +4 -0
  34. package/lib/module/blocks/detail-request/index.js.map +1 -0
  35. package/lib/module/blocks/detail-studio/action-chips.js +72 -0
  36. package/lib/module/blocks/detail-studio/action-chips.js.map +1 -0
  37. package/lib/module/blocks/detail-studio/adjust-tiles.js +3 -3
  38. package/lib/module/blocks/detail-studio/adjust-tiles.js.map +1 -1
  39. package/lib/module/blocks/detail-studio/asset-grid.js +33 -16
  40. package/lib/module/blocks/detail-studio/asset-grid.js.map +1 -1
  41. package/lib/module/blocks/detail-studio/confirm-row.js +3 -0
  42. package/lib/module/blocks/detail-studio/confirm-row.js.map +1 -1
  43. package/lib/module/blocks/detail-studio/detail-studio-template.js +2 -6
  44. package/lib/module/blocks/detail-studio/detail-studio-template.js.map +1 -1
  45. package/lib/module/blocks/detail-studio/edge-fade.js +74 -0
  46. package/lib/module/blocks/detail-studio/edge-fade.js.map +1 -0
  47. package/lib/module/blocks/detail-studio/image-prompt.js +8 -10
  48. package/lib/module/blocks/detail-studio/image-prompt.js.map +1 -1
  49. package/lib/module/blocks/detail-studio/index.js +7 -5
  50. package/lib/module/blocks/detail-studio/index.js.map +1 -1
  51. package/lib/module/blocks/detail-studio/rewrite-tray.js +17 -64
  52. package/lib/module/blocks/detail-studio/rewrite-tray.js.map +1 -1
  53. package/lib/module/blocks/detail-studio/section-cover.js +41 -0
  54. package/lib/module/blocks/detail-studio/section-cover.js.map +1 -0
  55. package/lib/module/blocks/detail-studio/section-edit-template.js +103 -12
  56. package/lib/module/blocks/detail-studio/section-edit-template.js.map +1 -1
  57. package/lib/module/blocks/detail-studio/section-kind-grid.js +2 -3
  58. package/lib/module/blocks/detail-studio/section-kind-grid.js.map +1 -1
  59. package/lib/module/blocks/detail-studio/section-settings.js +127 -61
  60. package/lib/module/blocks/detail-studio/section-settings.js.map +1 -1
  61. package/lib/module/blocks/detail-studio/studio-bar.js +46 -25
  62. package/lib/module/blocks/detail-studio/studio-bar.js.map +1 -1
  63. package/lib/module/blocks/detail-studio/studio-dock.js +21 -39
  64. package/lib/module/blocks/detail-studio/studio-dock.js.map +1 -1
  65. package/lib/module/blocks/detail-studio/studio-glyphs.js +92 -0
  66. package/lib/module/blocks/detail-studio/studio-glyphs.js.map +1 -0
  67. package/lib/module/blocks/detail-studio/studio-sheet.js +5 -3
  68. package/lib/module/blocks/detail-studio/studio-sheet.js.map +1 -1
  69. package/lib/module/blocks/detail-studio/studio-steps.js +60 -0
  70. package/lib/module/blocks/detail-studio/studio-steps.js.map +1 -0
  71. package/lib/module/blocks/detail-studio/studio-toggle.js +130 -0
  72. package/lib/module/blocks/detail-studio/studio-toggle.js.map +1 -0
  73. package/lib/module/blocks/detail-studio/{photo-tool-bar.js → studio-tools.js} +63 -42
  74. package/lib/module/blocks/detail-studio/studio-tools.js.map +1 -0
  75. package/lib/module/blocks/detail-studio/text-format-panel.js +16 -8
  76. package/lib/module/blocks/detail-studio/text-format-panel.js.map +1 -1
  77. package/lib/module/blocks/index.js +1 -0
  78. package/lib/module/blocks/index.js.map +1 -1
  79. package/lib/module/components/button/button.js +13 -5
  80. package/lib/module/components/button/button.js.map +1 -1
  81. package/lib/module/components/chip/chip.js +5 -1
  82. package/lib/module/components/chip/chip.js.map +1 -1
  83. package/lib/module/components/chip-group/chip-group.js +1 -0
  84. package/lib/module/components/chip-group/chip-group.js.map +1 -1
  85. package/lib/module/components/credit/credit.js +6 -2
  86. package/lib/module/components/credit/credit.js.map +1 -1
  87. package/lib/module/components/dropdown-menu/dropdown-menu.js +9 -4
  88. package/lib/module/components/dropdown-menu/dropdown-menu.js.map +1 -1
  89. package/lib/module/components/segmented-control/segmented-control.js +3 -1
  90. package/lib/module/components/segmented-control/segmented-control.js.map +1 -1
  91. package/lib/module/components/skeleton/skeleton.js +4 -2
  92. package/lib/module/components/skeleton/skeleton.js.map +1 -1
  93. package/lib/module/components/slider/slider.js +53 -16
  94. package/lib/module/components/slider/slider.js.map +1 -1
  95. package/lib/module/index.js +1 -1
  96. package/lib/module/index.js.map +1 -1
  97. package/lib/module/internal/glyphs.js +2 -1
  98. package/lib/module/internal/glyphs.js.map +1 -1
  99. package/lib/module/internal/line-icons.js +1 -0
  100. package/lib/module/internal/line-icons.js.map +1 -1
  101. package/lib/module/internal/retry-glyph.js +5 -2
  102. package/lib/module/internal/retry-glyph.js.map +1 -1
  103. package/lib/module/internal/undo-glyph.js +11 -8
  104. package/lib/module/internal/undo-glyph.js.map +1 -1
  105. package/lib/module/sortable/section-board.js +73 -89
  106. package/lib/module/sortable/section-board.js.map +1 -1
  107. package/lib/module/templates/design-pick-template.js +8 -1
  108. package/lib/module/templates/design-pick-template.js.map +1 -1
  109. package/lib/module/templates/intro-template.js +3 -3
  110. package/lib/module/templates/intro-template.js.map +1 -1
  111. package/lib/module/templates/result-template.js +2 -1
  112. package/lib/module/templates/result-template.js.map +1 -1
  113. package/lib/typescript/src/adjust/adjust-template.d.ts.map +1 -1
  114. package/lib/typescript/src/adjust/axis-adjust.d.ts +25 -0
  115. package/lib/typescript/src/adjust/axis-adjust.d.ts.map +1 -0
  116. package/lib/typescript/src/adjust/axis-tabs.d.ts +15 -0
  117. package/lib/typescript/src/adjust/axis-tabs.d.ts.map +1 -0
  118. package/lib/typescript/src/adjust/axis-wheel.d.ts +15 -0
  119. package/lib/typescript/src/adjust/axis-wheel.d.ts.map +1 -0
  120. package/lib/typescript/src/adjust/index.d.ts +4 -0
  121. package/lib/typescript/src/adjust/index.d.ts.map +1 -1
  122. package/lib/typescript/src/adjust/store-sample.d.ts +46 -0
  123. package/lib/typescript/src/adjust/store-sample.d.ts.map +1 -0
  124. package/lib/typescript/src/blocks/detail-editor/compare-slider.d.ts +2 -1
  125. package/lib/typescript/src/blocks/detail-editor/compare-slider.d.ts.map +1 -1
  126. package/lib/typescript/src/blocks/detail-editor/detail-canvas.d.ts +3 -1
  127. package/lib/typescript/src/blocks/detail-editor/detail-canvas.d.ts.map +1 -1
  128. package/lib/typescript/src/blocks/detail-editor/detail-types.d.ts +11 -0
  129. package/lib/typescript/src/blocks/detail-editor/detail-types.d.ts.map +1 -1
  130. package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts +4 -1
  131. package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts.map +1 -1
  132. package/lib/typescript/src/blocks/detail-editor/focus-context.d.ts +9 -0
  133. package/lib/typescript/src/blocks/detail-editor/focus-context.d.ts.map +1 -1
  134. package/lib/typescript/src/blocks/detail-editor/index.d.ts +3 -2
  135. package/lib/typescript/src/blocks/detail-editor/index.d.ts.map +1 -1
  136. package/lib/typescript/src/blocks/detail-editor/keep-words.d.ts +2 -0
  137. package/lib/typescript/src/blocks/detail-editor/keep-words.d.ts.map +1 -0
  138. package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts +6 -1
  139. package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts.map +1 -1
  140. package/lib/typescript/src/blocks/detail-request/detail-request.d.ts +24 -0
  141. package/lib/typescript/src/blocks/detail-request/detail-request.d.ts.map +1 -0
  142. package/lib/typescript/src/blocks/detail-request/index.d.ts +2 -0
  143. package/lib/typescript/src/blocks/detail-request/index.d.ts.map +1 -0
  144. package/lib/typescript/src/blocks/detail-studio/action-chips.d.ts +12 -0
  145. package/lib/typescript/src/blocks/detail-studio/action-chips.d.ts.map +1 -0
  146. package/lib/typescript/src/blocks/detail-studio/asset-grid.d.ts.map +1 -1
  147. package/lib/typescript/src/blocks/detail-studio/confirm-row.d.ts.map +1 -1
  148. package/lib/typescript/src/blocks/detail-studio/detail-studio-template.d.ts.map +1 -1
  149. package/lib/typescript/src/blocks/detail-studio/edge-fade.d.ts +10 -0
  150. package/lib/typescript/src/blocks/detail-studio/edge-fade.d.ts.map +1 -0
  151. package/lib/typescript/src/blocks/detail-studio/image-prompt.d.ts.map +1 -1
  152. package/lib/typescript/src/blocks/detail-studio/index.d.ts +7 -5
  153. package/lib/typescript/src/blocks/detail-studio/index.d.ts.map +1 -1
  154. package/lib/typescript/src/blocks/detail-studio/rewrite-tray.d.ts +3 -3
  155. package/lib/typescript/src/blocks/detail-studio/rewrite-tray.d.ts.map +1 -1
  156. package/lib/typescript/src/blocks/detail-studio/section-cover.d.ts +7 -0
  157. package/lib/typescript/src/blocks/detail-studio/section-cover.d.ts.map +1 -0
  158. package/lib/typescript/src/blocks/detail-studio/section-edit-template.d.ts +9 -0
  159. package/lib/typescript/src/blocks/detail-studio/section-edit-template.d.ts.map +1 -1
  160. package/lib/typescript/src/blocks/detail-studio/section-kind-grid.d.ts.map +1 -1
  161. package/lib/typescript/src/blocks/detail-studio/section-settings.d.ts +11 -13
  162. package/lib/typescript/src/blocks/detail-studio/section-settings.d.ts.map +1 -1
  163. package/lib/typescript/src/blocks/detail-studio/studio-bar.d.ts +6 -2
  164. package/lib/typescript/src/blocks/detail-studio/studio-bar.d.ts.map +1 -1
  165. package/lib/typescript/src/blocks/detail-studio/studio-dock.d.ts +0 -2
  166. package/lib/typescript/src/blocks/detail-studio/studio-dock.d.ts.map +1 -1
  167. package/lib/typescript/src/blocks/detail-studio/studio-glyphs.d.ts +6 -0
  168. package/lib/typescript/src/blocks/detail-studio/studio-glyphs.d.ts.map +1 -0
  169. package/lib/typescript/src/blocks/detail-studio/studio-sheet.d.ts.map +1 -1
  170. package/lib/typescript/src/blocks/detail-studio/studio-steps.d.ts +11 -0
  171. package/lib/typescript/src/blocks/detail-studio/studio-steps.d.ts.map +1 -0
  172. package/lib/typescript/src/blocks/detail-studio/studio-toggle.d.ts +14 -0
  173. package/lib/typescript/src/blocks/detail-studio/studio-toggle.d.ts.map +1 -0
  174. package/lib/typescript/src/blocks/detail-studio/studio-tools.d.ts +19 -0
  175. package/lib/typescript/src/blocks/detail-studio/studio-tools.d.ts.map +1 -0
  176. package/lib/typescript/src/blocks/detail-studio/text-format-panel.d.ts +2 -1
  177. package/lib/typescript/src/blocks/detail-studio/text-format-panel.d.ts.map +1 -1
  178. package/lib/typescript/src/blocks/index.d.ts +1 -0
  179. package/lib/typescript/src/blocks/index.d.ts.map +1 -1
  180. package/lib/typescript/src/components/button/button.d.ts +3 -1
  181. package/lib/typescript/src/components/button/button.d.ts.map +1 -1
  182. package/lib/typescript/src/components/chip/chip.d.ts +2 -1
  183. package/lib/typescript/src/components/chip/chip.d.ts.map +1 -1
  184. package/lib/typescript/src/components/chip-group/chip-group.d.ts +1 -0
  185. package/lib/typescript/src/components/chip-group/chip-group.d.ts.map +1 -1
  186. package/lib/typescript/src/components/credit/credit.d.ts +1 -0
  187. package/lib/typescript/src/components/credit/credit.d.ts.map +1 -1
  188. package/lib/typescript/src/components/dropdown-menu/dropdown-menu.d.ts +2 -0
  189. package/lib/typescript/src/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  190. package/lib/typescript/src/components/segmented-control/segmented-control.d.ts +2 -0
  191. package/lib/typescript/src/components/segmented-control/segmented-control.d.ts.map +1 -1
  192. package/lib/typescript/src/components/skeleton/skeleton.d.ts +2 -1
  193. package/lib/typescript/src/components/skeleton/skeleton.d.ts.map +1 -1
  194. package/lib/typescript/src/components/slider/slider.d.ts +2 -1
  195. package/lib/typescript/src/components/slider/slider.d.ts.map +1 -1
  196. package/lib/typescript/src/index.d.ts +1 -1
  197. package/lib/typescript/src/index.d.ts.map +1 -1
  198. package/lib/typescript/src/internal/glyphs.d.ts +1 -0
  199. package/lib/typescript/src/internal/glyphs.d.ts.map +1 -1
  200. package/lib/typescript/src/internal/line-icons.d.ts +1 -0
  201. package/lib/typescript/src/internal/line-icons.d.ts.map +1 -1
  202. package/lib/typescript/src/internal/retry-glyph.d.ts.map +1 -1
  203. package/lib/typescript/src/internal/undo-glyph.d.ts.map +1 -1
  204. package/lib/typescript/src/sortable/section-board.d.ts.map +1 -1
  205. package/lib/typescript/src/templates/design-pick-template.d.ts.map +1 -1
  206. package/lib/typescript/src/templates/intro-template.d.ts.map +1 -1
  207. package/lib/typescript/src/templates/result-template.d.ts +2 -1
  208. package/lib/typescript/src/templates/result-template.d.ts.map +1 -1
  209. package/package.json +1 -1
  210. package/src/adjust/adjust-template.tsx +1 -0
  211. package/src/adjust/axis-adjust.tsx +206 -0
  212. package/src/adjust/axis-tabs.tsx +81 -0
  213. package/src/adjust/axis-wheel.tsx +309 -0
  214. package/src/adjust/index.ts +15 -0
  215. package/src/adjust/store-sample.tsx +519 -0
  216. package/src/blocks/color-swatch-picker/color-swatch-picker.tsx +1 -1
  217. package/src/blocks/detail-editor/compare-slider.tsx +3 -1
  218. package/src/blocks/detail-editor/detail-canvas.tsx +264 -69
  219. package/src/blocks/detail-editor/detail-types.ts +37 -0
  220. package/src/blocks/detail-editor/draft-preview.tsx +46 -2
  221. package/src/blocks/detail-editor/focus-context.ts +13 -0
  222. package/src/blocks/detail-editor/index.ts +11 -1
  223. package/src/blocks/detail-editor/keep-words.ts +36 -0
  224. package/src/blocks/detail-editor/layout-picker.tsx +188 -6
  225. package/src/blocks/detail-request/detail-request.tsx +198 -0
  226. package/src/blocks/detail-request/index.ts +11 -0
  227. package/src/blocks/detail-studio/action-chips.tsx +77 -0
  228. package/src/blocks/detail-studio/adjust-tiles.tsx +3 -3
  229. package/src/blocks/detail-studio/asset-grid.tsx +30 -16
  230. package/src/blocks/detail-studio/confirm-row.tsx +3 -0
  231. package/src/blocks/detail-studio/detail-studio-template.tsx +2 -6
  232. package/src/blocks/detail-studio/edge-fade.tsx +76 -0
  233. package/src/blocks/detail-studio/image-prompt.tsx +6 -9
  234. package/src/blocks/detail-studio/index.ts +19 -16
  235. package/src/blocks/detail-studio/rewrite-tray.tsx +16 -56
  236. package/src/blocks/detail-studio/section-cover.tsx +44 -0
  237. package/src/blocks/detail-studio/section-edit-template.tsx +138 -13
  238. package/src/blocks/detail-studio/section-kind-grid.tsx +2 -2
  239. package/src/blocks/detail-studio/section-settings.tsx +124 -69
  240. package/src/blocks/detail-studio/studio-bar.tsx +61 -41
  241. package/src/blocks/detail-studio/studio-dock.tsx +19 -37
  242. package/src/blocks/detail-studio/studio-glyphs.tsx +77 -0
  243. package/src/blocks/detail-studio/studio-sheet.tsx +7 -3
  244. package/src/blocks/detail-studio/studio-steps.tsx +58 -0
  245. package/src/blocks/detail-studio/studio-toggle.tsx +130 -0
  246. package/src/blocks/detail-studio/studio-tools.tsx +126 -0
  247. package/src/blocks/detail-studio/text-format-panel.tsx +26 -14
  248. package/src/blocks/index.tsx +1 -0
  249. package/src/components/button/button.tsx +12 -5
  250. package/src/components/chip/chip.tsx +9 -1
  251. package/src/components/chip-group/chip-group.tsx +2 -0
  252. package/src/components/credit/credit.tsx +9 -2
  253. package/src/components/dropdown-menu/dropdown-menu.tsx +18 -7
  254. package/src/components/segmented-control/segmented-control.tsx +10 -2
  255. package/src/components/skeleton/skeleton.tsx +5 -2
  256. package/src/components/slider/slider.tsx +66 -14
  257. package/src/index.tsx +1 -0
  258. package/src/internal/glyphs.tsx +2 -0
  259. package/src/internal/line-icons.ts +2 -0
  260. package/src/internal/retry-glyph.tsx +7 -2
  261. package/src/internal/undo-glyph.tsx +12 -11
  262. package/src/sortable/section-board.tsx +71 -76
  263. package/src/templates/design-pick-template.tsx +9 -1
  264. package/src/templates/intro-template.tsx +14 -12
  265. package/src/templates/result-template.tsx +3 -0
  266. package/lib/module/blocks/detail-studio/keyboard-bar.js +0 -67
  267. package/lib/module/blocks/detail-studio/keyboard-bar.js.map +0 -1
  268. package/lib/module/blocks/detail-studio/photo-tool-bar.js.map +0 -1
  269. package/lib/module/blocks/detail-studio/section-thumb.js +0 -49
  270. package/lib/module/blocks/detail-studio/section-thumb.js.map +0 -1
  271. package/lib/typescript/src/blocks/detail-studio/keyboard-bar.d.ts +0 -18
  272. package/lib/typescript/src/blocks/detail-studio/keyboard-bar.d.ts.map +0 -1
  273. package/lib/typescript/src/blocks/detail-studio/photo-tool-bar.d.ts +0 -19
  274. package/lib/typescript/src/blocks/detail-studio/photo-tool-bar.d.ts.map +0 -1
  275. package/lib/typescript/src/blocks/detail-studio/section-thumb.d.ts +0 -14
  276. package/lib/typescript/src/blocks/detail-studio/section-thumb.d.ts.map +0 -1
  277. package/src/blocks/detail-studio/keyboard-bar.tsx +0 -73
  278. package/src/blocks/detail-studio/photo-tool-bar.tsx +0 -100
  279. package/src/blocks/detail-studio/section-thumb.tsx +0 -41
@@ -7,8 +7,14 @@ export {
7
7
  type DetailCanvasProps,
8
8
  type DetailCanvasResult,
9
9
  } from './detail-canvas';
10
+ export type { DetailPart } from './focus-context';
10
11
  export {
12
+ DETAIL_BACKGROUND_COLORS,
11
13
  DETAIL_COLORS,
14
+ DETAIL_HEAD_SIZE,
15
+ DETAIL_TEXT_COLORS,
16
+ DETAIL_TITLE_SIZE,
17
+ detailIsTitle,
12
18
  DETAIL_FONT_FAMILY,
13
19
  DETAIL_LAYOUTS,
14
20
  DETAIL_LIST_LAYOUTS,
@@ -36,4 +42,8 @@ export {
36
42
  type StructureOption,
37
43
  type StructurePickerProps,
38
44
  } from './structure-picker';
39
- export { DraftPreview, type DraftPreviewProps } from './draft-preview';
45
+ export {
46
+ DraftPreview,
47
+ draftPreviewFit,
48
+ type DraftPreviewProps,
49
+ } from './draft-preview';
@@ -0,0 +1,36 @@
1
+ const JOIN = '\u2060';
2
+ const STICK = '\u00A0';
3
+ const HANGUL =
4
+ /[\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF]/;
5
+ const SPACE = /\s/;
6
+ const DOT_BEFORE = / (?=[\u00B7\u2022\u318D](?:\s|$))/g;
7
+ const WORD_BEFORE_NUMBER = /([\uAC00-\uD7A3]) (?=[0-9])/g;
8
+
9
+ function joinWord(word: string): string {
10
+ const chars = Array.from(word);
11
+ let out = chars[0] ?? '';
12
+ for (let i = 1; i < chars.length; i += 1) {
13
+ const prev = chars[i - 1]!;
14
+ const next = chars[i]!;
15
+ out += HANGUL.test(prev) || HANGUL.test(next) ? JOIN + next : next;
16
+ }
17
+ return out;
18
+ }
19
+
20
+ export function keepWords(text: string): string {
21
+ if (!HANGUL.test(text)) return text;
22
+ const glued = text
23
+ .replace(DOT_BEFORE, STICK)
24
+ .replace(WORD_BEFORE_NUMBER, `$1${STICK}`);
25
+ let out = '';
26
+ let word = '';
27
+ for (const ch of glued) {
28
+ if (SPACE.test(ch) && ch !== STICK) {
29
+ out += joinWord(word) + ch;
30
+ word = '';
31
+ } else {
32
+ word += ch;
33
+ }
34
+ }
35
+ return out + joinWord(word);
36
+ }
@@ -10,9 +10,10 @@ export type LayoutPickerProps = {
10
10
  onValueChange: (layout: DetailLayout) => void;
11
11
  labels?: Partial<Record<DetailLayout, string>>;
12
12
  items?: readonly DetailLayout[];
13
+ variant?: 'default' | 'soft';
13
14
  };
14
15
 
15
- const LABELS: Record<DetailLayout, string> = {
16
+ export const LABELS: Record<DetailLayout, string> = {
16
17
  image_top: '사진 위 · 글 아래',
17
18
  text_top: '글 위 · 사진 아래',
18
19
  side: '나란히',
@@ -25,6 +26,10 @@ const LABELS: Record<DetailLayout, string> = {
25
26
  };
26
27
 
27
28
  const DIAGRAM_ROWS = [0, 1, 2];
29
+ const SOFT_TITLE = 6;
30
+ const SOFT_LINE = 4;
31
+ const SOFT_LABEL = 11;
32
+ const SOFT_LABEL_LINE = 1.35;
28
33
 
29
34
  const useStyles = makeStyles((t) => ({
30
35
  row: { gap: t.space[2], paddingHorizontal: t.space[3] },
@@ -93,8 +98,179 @@ const useStyles = makeStyles((t) => ({
93
98
  padding: t.space[1],
94
99
  gap: t.space[1],
95
100
  },
101
+ softRow: { gap: t.space[2], paddingHorizontal: t.space[4] },
102
+ softItem: { width: t.space[16] + t.space[6], gap: t.space[2] },
103
+ softFrame: {
104
+ height: t.space[12] * 2,
105
+ overflow: 'hidden',
106
+ alignItems: 'center',
107
+ justifyContent: 'center',
108
+ gap: t.space[1],
109
+ paddingVertical: t.space[2],
110
+ paddingHorizontal: t.space[3],
111
+ borderRadius: t.radius.md,
112
+ backgroundColor: t.colors.background,
113
+ },
114
+ softLabel: {
115
+ textAlign: 'center',
116
+ color: t.colors.title,
117
+ fontSize: SOFT_LABEL,
118
+ lineHeight: SOFT_LABEL * SOFT_LABEL_LINE,
119
+ },
120
+ softTitle: {
121
+ width: '56%',
122
+ height: SOFT_TITLE,
123
+ borderRadius: t.radius.full,
124
+ backgroundColor: t.colors.input,
125
+ },
126
+ softLine: {
127
+ width: '70%',
128
+ height: SOFT_LINE,
129
+ borderRadius: t.radius.full,
130
+ backgroundColor: t.colors.border,
131
+ },
132
+ softPhoto: {
133
+ alignSelf: 'stretch',
134
+ flex: 1,
135
+ borderRadius: t.radius.sm,
136
+ backgroundColor: t.colors.border,
137
+ },
138
+ softFull: {
139
+ position: 'absolute',
140
+ top: 0,
141
+ right: 0,
142
+ bottom: 0,
143
+ left: 0,
144
+ backgroundColor: t.colors.border,
145
+ },
146
+ softSplit: {
147
+ alignSelf: 'stretch',
148
+ flex: 1,
149
+ flexDirection: 'row',
150
+ alignItems: 'center',
151
+ gap: t.space[1],
152
+ },
153
+ softSide: { width: '44%', alignSelf: 'stretch' },
154
+ softSideText: { flex: 1, gap: t.space[1] },
155
+ softWide: { width: '100%' },
156
+ softCard: {
157
+ alignSelf: 'stretch',
158
+ flex: 1,
159
+ alignItems: 'center',
160
+ gap: t.space[1],
161
+ padding: t.space[1],
162
+ borderRadius: t.radius.sm,
163
+ backgroundColor: t.colors.surface,
164
+ },
165
+ softTableRow: {
166
+ alignSelf: 'stretch',
167
+ flexDirection: 'row',
168
+ gap: t.space[1],
169
+ paddingVertical: t.space[1],
170
+ borderTopWidth: 1,
171
+ borderColor: t.colors.border,
172
+ },
173
+ softDot: {
174
+ width: t.space[2],
175
+ height: t.space[2],
176
+ borderRadius: t.radius.full,
177
+ borderWidth: 1,
178
+ borderColor: t.colors.input,
179
+ },
96
180
  }));
97
181
 
182
+ export function SoftDiagram({ layout }: { layout: DetailLayout }) {
183
+ const s = useStyles();
184
+ const title = <View style={s.softTitle} />;
185
+ const line = <View style={s.softLine} />;
186
+ const photo = <View style={s.softPhoto} />;
187
+ switch (layout) {
188
+ case 'image_top':
189
+ return (
190
+ <>
191
+ {photo}
192
+ {title}
193
+ {line}
194
+ </>
195
+ );
196
+ case 'text_top':
197
+ return (
198
+ <>
199
+ {title}
200
+ {line}
201
+ {photo}
202
+ </>
203
+ );
204
+ case 'side':
205
+ return (
206
+ <View style={s.softSplit}>
207
+ <View style={[s.softPhoto, s.softSide]} />
208
+ <View style={s.softSideText}>
209
+ <View style={[s.softTitle, s.softWide]} />
210
+ <View style={[s.softLine, s.softWide]} />
211
+ {line}
212
+ </View>
213
+ </View>
214
+ );
215
+ case 'image':
216
+ return <View style={s.softFull} />;
217
+ case 'two_images':
218
+ return (
219
+ <>
220
+ {title}
221
+ <View style={s.softSplit}>
222
+ {photo}
223
+ {photo}
224
+ </View>
225
+ </>
226
+ );
227
+ case 'card':
228
+ return (
229
+ <View style={s.softCard}>
230
+ {photo}
231
+ {title}
232
+ {line}
233
+ </View>
234
+ );
235
+ case 'text':
236
+ return (
237
+ <>
238
+ {title}
239
+ {line}
240
+ {line}
241
+ {line}
242
+ </>
243
+ );
244
+ case 'table':
245
+ return (
246
+ <>
247
+ {title}
248
+ {DIAGRAM_ROWS.map((row) => (
249
+ <View key={row} style={s.softTableRow}>
250
+ <View style={[s.softLine, s.cellShort]} />
251
+ <View style={[s.softLine, s.cellLong]} />
252
+ </View>
253
+ ))}
254
+ </>
255
+ );
256
+ case 'steps':
257
+ return (
258
+ <>
259
+ {title}
260
+ <View style={s.steps}>
261
+ {DIAGRAM_ROWS.map((row) => (
262
+ <View key={row} style={s.step}>
263
+ <View style={s.softDot} />
264
+ </View>
265
+ ))}
266
+ </View>
267
+ </>
268
+ );
269
+ default:
270
+ return photo;
271
+ }
272
+ }
273
+
98
274
  export function Diagram({ layout }: { layout: DetailLayout }) {
99
275
  const t = useTheme();
100
276
  const s = useStyles();
@@ -206,13 +382,15 @@ export function LayoutPicker({
206
382
  onValueChange,
207
383
  labels,
208
384
  items = DETAIL_LAYOUTS,
385
+ variant = 'default',
209
386
  }: LayoutPickerProps) {
210
387
  const s = useStyles();
388
+ const soft = variant === 'soft';
211
389
  return (
212
390
  <ScrollView
213
391
  horizontal
214
392
  showsHorizontalScrollIndicator={false}
215
- contentContainerStyle={s.row}
393
+ contentContainerStyle={soft ? s.softRow : s.row}
216
394
  accessibilityRole="radiogroup"
217
395
  >
218
396
  {items.map((layout) => {
@@ -225,11 +403,15 @@ export function LayoutPicker({
225
403
  accessibilityState={{ selected: on }}
226
404
  accessibilityLabel={label}
227
405
  onPress={() => onValueChange(layout)}
228
- style={s.item}
406
+ style={soft ? s.softItem : s.item}
229
407
  >
230
408
  <View>
231
- <View style={s.frame}>
232
- <Diagram layout={layout} />
409
+ <View style={soft ? s.softFrame : s.frame}>
410
+ {soft ? (
411
+ <SoftDiagram layout={layout} />
412
+ ) : (
413
+ <Diagram layout={layout} />
414
+ )}
233
415
  </View>
234
416
  {on ? <View pointerEvents="none" style={s.on} /> : null}
235
417
  </View>
@@ -238,7 +420,7 @@ export function LayoutPicker({
238
420
  tone="muted"
239
421
  weight={on ? 'semibold' : undefined}
240
422
  numberOfLines={1}
241
- style={on && s.onLabel}
423
+ style={[soft && s.softLabel, on && s.onLabel]}
242
424
  >
243
425
  {label}
244
426
  </Text>
@@ -0,0 +1,198 @@
1
+ import { useState } from 'react';
2
+ import {
3
+ View,
4
+ type LayoutChangeEvent,
5
+ type StyleProp,
6
+ type ViewStyle,
7
+ } from 'react-native';
8
+ import { Button, type ButtonProps } from '../../components/button/button';
9
+ import { Photo } from '../../components/photo/photo';
10
+ import { Text } from '../../components/text/text';
11
+ import { ImageGlyph, PlusGlyph } from '../../internal/glyphs';
12
+ import { PressableBase } from '../../internal/pressable-base';
13
+ import { useTheme } from '../../theme/theme-provider';
14
+ import { withAlpha } from '../../utils/color';
15
+ import { makeStyles } from '../../utils/styles';
16
+
17
+ export type PhotoMosaicProps = {
18
+ images: readonly string[];
19
+ onPress?: () => void;
20
+ accessibilityLabel?: string;
21
+ };
22
+
23
+ export type FactRow = { label: string; value: string };
24
+
25
+ export type FactRowsProps = {
26
+ rows: readonly FactRow[];
27
+ };
28
+
29
+ export type AddThumbsProps = {
30
+ images: readonly string[];
31
+ onAdd: () => void;
32
+ addLabel: string;
33
+ };
34
+
35
+ export type TintButtonProps = Omit<ButtonProps, 'variant' | 'point' | 'pill'>;
36
+
37
+ const SCRIM = 0.45;
38
+
39
+ const useStyles = makeStyles((t) => ({
40
+ mosaic: { flexDirection: 'row', gap: t.space[2] },
41
+ side: { gap: t.space[2] },
42
+ more: {
43
+ position: 'absolute',
44
+ top: 0,
45
+ right: 0,
46
+ bottom: 0,
47
+ left: 0,
48
+ alignItems: 'center',
49
+ justifyContent: 'center',
50
+ borderRadius: t.radius.md,
51
+ backgroundColor: withAlpha(t.colors.foreground, SCRIM),
52
+ },
53
+ moreLabel: { color: t.colors.surface },
54
+ facts: { borderTopWidth: 1, borderTopColor: t.colors.line },
55
+ fact: {
56
+ flexDirection: 'row',
57
+ gap: t.space[4],
58
+ paddingVertical: t.space[3],
59
+ borderBottomWidth: 1,
60
+ borderBottomColor: t.colors.line,
61
+ },
62
+ factLabel: { width: t.space[16] },
63
+ factValue: { flex: 1 },
64
+ thumbs: { flexDirection: 'row', flexWrap: 'wrap', gap: t.space[2] },
65
+ add: {
66
+ width: t.space[16],
67
+ height: t.space[16],
68
+ alignItems: 'center',
69
+ justifyContent: 'center',
70
+ borderRadius: t.radius.md,
71
+ borderWidth: 1,
72
+ borderStyle: 'dashed',
73
+ borderColor: t.colors.input,
74
+ },
75
+ thumb: { width: t.space[16] },
76
+ tint: {
77
+ paddingHorizontal: t.space[4],
78
+ backgroundColor: t.colors.primaryTint,
79
+ },
80
+ }));
81
+
82
+ function Cell({ uri, style }: { uri?: string; style?: StyleProp<ViewStyle> }) {
83
+ const t = useTheme();
84
+ return (
85
+ <Photo
86
+ source={{ uri: uri ?? '' }}
87
+ radius={t.radius.md}
88
+ fallback={
89
+ <ImageGlyph color={t.colors.mutedForeground} size={t.iconSize.md} />
90
+ }
91
+ style={style}
92
+ />
93
+ );
94
+ }
95
+
96
+ export function PhotoMosaic({
97
+ images,
98
+ onPress,
99
+ accessibilityLabel = '사진',
100
+ }: PhotoMosaicProps) {
101
+ const t = useTheme();
102
+ const s = useStyles();
103
+ const [width, setWidth] = useState(0);
104
+ const gap = t.space[2];
105
+ const small = Math.max(0, (width - gap * 2) / 3);
106
+ const big = small * 2 + gap;
107
+ const extra = images.length - 3;
108
+ return (
109
+ <View
110
+ onLayout={(event: LayoutChangeEvent) =>
111
+ setWidth(event.nativeEvent.layout.width)
112
+ }
113
+ >
114
+ {width > 0 ? (
115
+ <PressableBase
116
+ accessibilityRole="button"
117
+ accessibilityLabel={accessibilityLabel}
118
+ onPress={onPress}
119
+ feedback="small"
120
+ style={s.mosaic}
121
+ >
122
+ <Cell uri={images[0]} style={{ width: big }} />
123
+ <View style={[s.side, { width: small }]}>
124
+ <Cell uri={images[1]} />
125
+ <View>
126
+ <Cell uri={images[2]} />
127
+ {extra > 0 ? (
128
+ <View pointerEvents="none" style={s.more}>
129
+ <Text variant="label" weight="semibold" style={s.moreLabel}>
130
+ {`+${extra}`}
131
+ </Text>
132
+ </View>
133
+ ) : null}
134
+ </View>
135
+ </View>
136
+ </PressableBase>
137
+ ) : null}
138
+ </View>
139
+ );
140
+ }
141
+
142
+ export function FactRows({ rows }: FactRowsProps) {
143
+ const s = useStyles();
144
+ if (!rows.length) return null;
145
+ return (
146
+ <View style={s.facts}>
147
+ {rows.map((row, index) => (
148
+ <View key={`${row.label}-${index}`} style={s.fact}>
149
+ <Text
150
+ variant="label"
151
+ tone="muted"
152
+ numberOfLines={1}
153
+ style={s.factLabel}
154
+ >
155
+ {row.label}
156
+ </Text>
157
+ <Text variant="label" numberOfLines={2} style={s.factValue}>
158
+ {row.value}
159
+ </Text>
160
+ </View>
161
+ ))}
162
+ </View>
163
+ );
164
+ }
165
+
166
+ export function AddThumbs({ images, onAdd, addLabel }: AddThumbsProps) {
167
+ const t = useTheme();
168
+ const s = useStyles();
169
+ return (
170
+ <View style={s.thumbs}>
171
+ <PressableBase
172
+ accessibilityRole="button"
173
+ accessibilityLabel={addLabel}
174
+ onPress={onAdd}
175
+ feedback="small"
176
+ style={s.add}
177
+ >
178
+ <PlusGlyph color={t.colors.mutedForeground} size={t.iconSize.md} />
179
+ </PressableBase>
180
+ {images.map((uri, index) => (
181
+ <PressableBase
182
+ key={`${uri}-${index}`}
183
+ accessibilityRole="imagebutton"
184
+ accessibilityLabel={`${addLabel} ${index + 1}`}
185
+ onPress={onAdd}
186
+ feedback="small"
187
+ >
188
+ <Photo source={{ uri }} radius={t.radius.md} style={s.thumb} />
189
+ </PressableBase>
190
+ ))}
191
+ </View>
192
+ );
193
+ }
194
+
195
+ export function TintButton({ style, ...rest }: TintButtonProps) {
196
+ const s = useStyles();
197
+ return <Button {...rest} variant="secondary" point style={[s.tint, style]} />;
198
+ }
@@ -0,0 +1,11 @@
1
+ export {
2
+ AddThumbs,
3
+ FactRows,
4
+ PhotoMosaic,
5
+ TintButton,
6
+ type AddThumbsProps,
7
+ type FactRow,
8
+ type FactRowsProps,
9
+ type PhotoMosaicProps,
10
+ type TintButtonProps,
11
+ } from './detail-request';
@@ -0,0 +1,77 @@
1
+ import { ScrollView, Text as RNText, type ViewStyle } from 'react-native';
2
+ import { haptic } from '../../internal/haptics';
3
+ import { PressableBase } from '../../internal/pressable-base';
4
+ import { useTheme } from '../../theme/theme-provider';
5
+ import { makeStyles } from '../../utils/styles';
6
+
7
+ export type ActionChipsProps<T extends string> = {
8
+ items: readonly { value: T; label: string }[];
9
+ onPick: (value: T) => void;
10
+ disabled?: boolean;
11
+ inset?: ViewStyle;
12
+ };
13
+
14
+ const useStyles = makeStyles((t) => ({
15
+ scroll: { flexGrow: 0 },
16
+ track: { flexDirection: 'row', alignItems: 'center', gap: t.space[2] },
17
+ chip: {
18
+ height: t.space[8] + t.space[1],
19
+ justifyContent: 'center',
20
+ paddingHorizontal: t.space[3],
21
+ borderRadius: t.radius.md,
22
+ borderWidth: 1,
23
+ borderColor: t.colors.border,
24
+ backgroundColor: t.colors.surface,
25
+ },
26
+ label: {
27
+ fontFamily: t.fontFamily,
28
+ fontSize: t.typography.eyebrow.fontSize,
29
+ lineHeight: t.typography.eyebrow.lineHeight,
30
+ fontWeight: t.typography.body.fontWeight,
31
+ },
32
+ }));
33
+
34
+ export function ActionChips<T extends string>({
35
+ items,
36
+ onPick,
37
+ disabled,
38
+ inset,
39
+ }: ActionChipsProps<T>) {
40
+ const t = useTheme();
41
+ const s = useStyles();
42
+ const color = disabled ? t.colors.disabledForeground : t.colors.title;
43
+ return (
44
+ <ScrollView
45
+ horizontal
46
+ showsHorizontalScrollIndicator={false}
47
+ keyboardShouldPersistTaps="handled"
48
+ style={s.scroll}
49
+ contentContainerStyle={[s.track, inset]}
50
+ >
51
+ {items.map((item) => (
52
+ <PressableBase
53
+ key={item.value}
54
+ onPress={() => {
55
+ haptic('select');
56
+ onPick(item.value);
57
+ }}
58
+ disabled={disabled}
59
+ disabledStyle={{}}
60
+ feedback="small"
61
+ accessibilityRole="button"
62
+ accessibilityLabel={item.label}
63
+ touchHeight={t.space[8] + t.space[1]}
64
+ style={s.chip}
65
+ >
66
+ <RNText
67
+ numberOfLines={1}
68
+ maxFontSizeMultiplier={t.maxFontScale}
69
+ style={[s.label, { color }]}
70
+ >
71
+ {item.label}
72
+ </RNText>
73
+ </PressableBase>
74
+ ))}
75
+ </ScrollView>
76
+ );
77
+ }
@@ -31,7 +31,7 @@ const useStyles = makeStyles((t) => ({
31
31
  height: t.space[16] + t.space[2],
32
32
  alignItems: 'center',
33
33
  justifyContent: 'center',
34
- borderRadius: t.radius.lg,
34
+ borderRadius: t.radius.md * 2,
35
35
  backgroundColor: t.colors.background,
36
36
  },
37
37
  cost: { position: 'absolute', top: t.space[2], right: t.space[2] },
@@ -39,7 +39,7 @@ const useStyles = makeStyles((t) => ({
39
39
  fontFamily: t.fontFamily,
40
40
  fontSize: t.typography.eyebrow.fontSize,
41
41
  lineHeight: t.typography.eyebrow.lineHeight,
42
- fontWeight: t.typography.eyebrow.fontWeight,
42
+ fontWeight: t.typography.body.fontWeight,
43
43
  color: t.colors.title,
44
44
  },
45
45
  }));
@@ -66,7 +66,7 @@ export function AdjustTiles<T extends string>({
66
66
  <View style={s.box}>
67
67
  {renderIcon(item.icon, {
68
68
  color: t.colors.title,
69
- size: t.iconSize.md,
69
+ size: t.space[6],
70
70
  })}
71
71
  {cost != null ? (
72
72
  <View pointerEvents="none" style={s.cost}>
@@ -1,4 +1,4 @@
1
- import { Fragment } from 'react';
1
+ import { Fragment, useState } from 'react';
2
2
  import { FlatList, Image, View, type ViewStyle } from 'react-native';
3
3
  import { Skeleton } from '../../components/skeleton/skeleton';
4
4
  import { CheckGlyph, PlusGlyph, SparklesGlyph } from '../../internal/glyphs';
@@ -6,6 +6,7 @@ import { PressableBase } from '../../internal/pressable-base';
6
6
  import { useTheme } from '../../theme/theme-provider';
7
7
  import { withAlpha } from '../../utils/color';
8
8
  import { makeStyles } from '../../utils/styles';
9
+ import { EdgeFade, hasMore } from './edge-fade';
9
10
 
10
11
  export type AssetGridItem = {
11
12
  key: string;
@@ -112,6 +113,10 @@ export function AssetGrid({
112
113
  const t = useTheme();
113
114
  const s = useStyles();
114
115
  const picking = !!onValueChange;
116
+ const [view, setView] = useState(0);
117
+ const [content, setContent] = useState(0);
118
+ const [offset, setOffset] = useState(0);
119
+ const more = hasMore(offset, view, content);
115
120
 
116
121
  const cells: Cell[] = [
117
122
  ...(onAdd ? [{ kind: 'add', key: '__add' } as const] : []),
@@ -139,7 +144,7 @@ export function AssetGrid({
139
144
  if (item.pending) {
140
145
  return (
141
146
  <View style={[s.cell, slot]}>
142
- <Skeleton width="100%" height="100%" radius={t.radius.md} />
147
+ <Skeleton width="100%" height="100%" radius={t.radius.md} sheen />
143
148
  </View>
144
149
  );
145
150
  }
@@ -220,19 +225,28 @@ export function AssetGrid({
220
225
  ) : undefined;
221
226
 
222
227
  return (
223
- <FlatList
224
- data={cells}
225
- keyExtractor={(cell) => cell.key}
226
- numColumns={COLUMNS}
227
- renderItem={({ item }) => render(item)}
228
- accessibilityRole={picking ? 'radiogroup' : undefined}
229
- style={s.root}
230
- contentContainerStyle={s.list}
231
- columnWrapperStyle={s.line}
232
- showsVerticalScrollIndicator={false}
233
- onEndReached={onEndReached}
234
- onEndReachedThreshold={0.5}
235
- ListFooterComponent={footer}
236
- />
228
+ <View style={s.root}>
229
+ <FlatList
230
+ data={cells}
231
+ keyExtractor={(cell) => cell.key}
232
+ numColumns={COLUMNS}
233
+ renderItem={({ item }) => render(item)}
234
+ accessibilityRole={picking ? 'radiogroup' : undefined}
235
+ style={s.root}
236
+ contentContainerStyle={s.list}
237
+ columnWrapperStyle={s.line}
238
+ showsVerticalScrollIndicator={false}
239
+ onEndReached={onEndReached}
240
+ onEndReachedThreshold={0.5}
241
+ ListFooterComponent={footer}
242
+ scrollEventThrottle={16}
243
+ onLayout={(e) => setView(e.nativeEvent.layout.height)}
244
+ onContentSizeChange={(_, h) => setContent(h)}
245
+ onScroll={(e) => setOffset(e.nativeEvent.contentOffset.y)}
246
+ />
247
+ {more ? (
248
+ <EdgeFade side="bottom" size={t.space[12]} color={t.colors.surface} />
249
+ ) : null}
250
+ </View>
237
251
  );
238
252
  }