@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
@@ -19,6 +19,7 @@ const useStyles = makeStyles((t) => ({
19
19
  row: {
20
20
  flexDirection: 'row',
21
21
  gap: t.space[2],
22
+ paddingTop: t.space[5],
22
23
  paddingHorizontal: t.space[4],
23
24
  },
24
25
  item: { flex: 1 },
@@ -30,6 +31,8 @@ export function ConfirmRow({ secondary, primary }: ConfirmRowProps) {
30
31
  <Button
31
32
  variant={variant}
32
33
  size="md"
34
+ pill
35
+ steady
33
36
  cost={action.cost}
34
37
  disabled={action.disabled}
35
38
  loading={action.loading}
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import { ScrollView, StyleSheet, View } from 'react-native';
2
+ import { ScrollView, View } from 'react-native';
3
3
  import { useTheme } from '../../theme/theme-provider';
4
4
  import { makeStyles } from '../../utils/styles';
5
5
 
@@ -41,11 +41,7 @@ export function DetailStudioTemplate({
41
41
  ) : (
42
42
  <View style={s.body}>{children}</View>
43
43
  )}
44
- {dock ? (
45
- <View pointerEvents="box-none" style={StyleSheet.absoluteFill}>
46
- {dock}
47
- </View>
48
- ) : null}
44
+ {dock}
49
45
  </View>
50
46
  );
51
47
  }
@@ -0,0 +1,76 @@
1
+ import { View } from 'react-native';
2
+ import { withAlpha } from '../../utils/color';
3
+ import { makeStyles } from '../../utils/styles';
4
+
5
+ export type EdgeFadeProps = {
6
+ side: 'right' | 'bottom';
7
+ size: number;
8
+ color: string;
9
+ steps?: number;
10
+ };
11
+
12
+ const STEPS = 12;
13
+
14
+ const useStyles = makeStyles(() => ({
15
+ right: {
16
+ position: 'absolute',
17
+ top: 0,
18
+ right: 0,
19
+ bottom: 0,
20
+ flexDirection: 'row',
21
+ },
22
+ bottom: {
23
+ position: 'absolute',
24
+ left: 0,
25
+ right: 0,
26
+ bottom: 0,
27
+ },
28
+ band: { position: 'absolute', top: 0, right: 0, bottom: 0, left: 0 },
29
+ }));
30
+
31
+ export function fadeLayers(steps: number): number[] {
32
+ const out: number[] = [];
33
+ let shown = 0;
34
+ for (let i = 0; i < steps; i++) {
35
+ const goal = (i + 1) / (steps + 1);
36
+ out.push(1 - (1 - goal) / (1 - shown));
37
+ shown = goal;
38
+ }
39
+ return out;
40
+ }
41
+
42
+ export function EdgeFade({ side, size, color, steps = STEPS }: EdgeFadeProps) {
43
+ const s = useStyles();
44
+ const across = side === 'right';
45
+ const layers = fadeLayers(steps);
46
+ return (
47
+ <View
48
+ pointerEvents="none"
49
+ testID="edge-fade"
50
+ style={[s[side], across ? { width: size } : { height: size }]}
51
+ >
52
+ {layers.map((alpha, i) => {
53
+ const start = (size * i) / steps;
54
+ return (
55
+ <View
56
+ key={i}
57
+ style={[
58
+ s.band,
59
+ across ? { left: start } : { top: start },
60
+ { backgroundColor: withAlpha(color, alpha) },
61
+ ]}
62
+ />
63
+ );
64
+ })}
65
+ </View>
66
+ );
67
+ }
68
+
69
+ export function hasMore(
70
+ offset: number,
71
+ view: number,
72
+ content: number,
73
+ slack = 1
74
+ ): boolean {
75
+ return content - (offset + view) > slack;
76
+ }
@@ -1,9 +1,9 @@
1
1
  import { Image, Text, TextInput, View } from 'react-native';
2
- import { ChipGroup } from '../../components/chip-group/chip-group';
3
2
  import { PencilGlyph } from '../../internal/glyphs';
4
3
  import { PressableBase } from '../../internal/pressable-base';
5
4
  import { useTheme } from '../../theme/theme-provider';
6
5
  import { makeStyles } from '../../utils/styles';
6
+ import { ActionChips } from './action-chips';
7
7
 
8
8
  export type ImagePromptProps = {
9
9
  source: string | null;
@@ -61,7 +61,8 @@ const useStyles = makeStyles((t) => ({
61
61
  justifyContent: 'center',
62
62
  borderRadius: t.radius.full,
63
63
  },
64
- chips: { paddingTop: t.space[1], paddingHorizontal: t.space[5] },
64
+ chips: { paddingTop: t.space[1] },
65
+ track: { paddingHorizontal: t.space[5] },
65
66
  }));
66
67
 
67
68
  export function ImagePrompt({
@@ -133,14 +134,10 @@ export function ImagePrompt({
133
134
  </View>
134
135
  {suggestions?.length ? (
135
136
  <View style={s.chips}>
136
- <ChipGroup
137
- scroll
138
- size="md"
139
- value={null}
140
- onValueChange={(word) => {
141
- if (word) onChangeText(word);
142
- }}
137
+ <ActionChips
143
138
  items={suggestions.map((word) => ({ value: word, label: word }))}
139
+ onPick={onChangeText}
140
+ inset={s.track}
144
141
  />
145
142
  </View>
146
143
  ) : null}
@@ -7,11 +7,6 @@ export {
7
7
  type SectionKindGridProps,
8
8
  type SectionKindItem,
9
9
  } from './section-kind-grid';
10
- export {
11
- SECTION_THUMB,
12
- SectionThumb,
13
- type SectionThumbProps,
14
- } from './section-thumb';
15
10
  export {
16
11
  StudioBar,
17
12
  type StudioBarProps,
@@ -19,7 +14,6 @@ export {
19
14
  } from './studio-bar';
20
15
  export {
21
16
  StudioDock,
22
- studioDockSpace,
23
17
  type StudioDockItem,
24
18
  type StudioDockProps,
25
19
  } from './studio-dock';
@@ -28,20 +22,16 @@ export {
28
22
  type ConfirmAction,
29
23
  type ConfirmRowProps,
30
24
  } from './confirm-row';
31
- export {
32
- KeyboardBar,
33
- type KeyboardBarItem,
34
- type KeyboardBarProps,
35
- } from './keyboard-bar';
36
25
  export { RewriteTray, type RewriteTrayProps } from './rewrite-tray';
37
26
  export {
38
27
  SectionEditTemplate,
39
28
  type SectionEditTemplateProps,
40
29
  } from './section-edit-template';
41
30
  export {
31
+ SECTION_SPACES,
42
32
  SectionSettings,
43
33
  type SectionSettingsProps,
44
- type SectionSettingsTab,
34
+ type SectionSpace,
45
35
  } from './section-settings';
46
36
  export { StudioSheet, type StudioSheetProps } from './studio-sheet';
47
37
  export {
@@ -50,10 +40,17 @@ export {
50
40
  type TextFormatTab,
51
41
  } from './text-format-panel';
52
42
  export {
53
- PhotoToolBar,
54
- type PhotoToolBarProps,
55
- type PhotoToolItem,
56
- } from './photo-tool-bar';
43
+ StudioTools,
44
+ type StudioToolItem,
45
+ type StudioToolsProps,
46
+ } from './studio-tools';
47
+ export {
48
+ StudioSteps,
49
+ type StudioStep,
50
+ type StudioStepsProps,
51
+ } from './studio-steps';
52
+ export { SectionCover, type SectionCoverProps } from './section-cover';
53
+ export { DotsGlyph, MinusGlyph, RetryGlyph, WaveGlyph } from './studio-glyphs';
57
54
  export {
58
55
  AdjustTiles,
59
56
  type AdjustTile,
@@ -65,3 +62,9 @@ export {
65
62
  type AssetGridProps,
66
63
  } from './asset-grid';
67
64
  export { ImagePrompt, type ImagePromptProps } from './image-prompt';
65
+ export {
66
+ StudioToggle,
67
+ StudioToggleList,
68
+ type StudioToggleListProps,
69
+ type StudioToggleProps,
70
+ } from './studio-toggle';
@@ -1,85 +1,45 @@
1
1
  import { View } from 'react-native';
2
- import { ChipGroup } from '../../components/chip-group/chip-group';
3
2
  import { CreditCost } from '../../components/credit/credit';
4
- import { KeyboardGlyph } from '../../internal/glyphs';
5
- import { PressableBase } from '../../internal/pressable-base';
6
- import { useTheme } from '../../theme/theme-provider';
3
+ import type { IconSlot } from '../../internal/icon';
7
4
  import { makeStyles } from '../../utils/styles';
5
+ import { StudioTools } from './studio-tools';
8
6
 
9
7
  export type RewriteTrayProps<T extends string> = {
10
- items: readonly { value: T; label: string }[];
8
+ items: readonly { value: T; label: string; icon: IconSlot }[];
11
9
  onPick: (value: T) => void;
12
- onKeyboard: () => void;
13
10
  cost?: number | null;
14
11
  disabled?: boolean;
15
- keyboardLabel?: string;
16
12
  };
17
13
 
18
- const SEP = 20;
19
-
20
14
  const useStyles = makeStyles((t) => ({
21
- row: {
22
- height: t.space[12] + t.space[2],
23
- flexDirection: 'row',
24
- alignItems: 'center',
25
- paddingLeft: t.space[2],
26
- },
27
- key: {
28
- width: t.minTouchSize,
29
- height: t.minTouchSize,
30
- alignItems: 'center',
31
- justifyContent: 'center',
32
- borderRadius: t.radius.md,
33
- },
34
- sep: {
35
- width: 1,
36
- height: SEP,
37
- marginLeft: t.space[1],
38
- marginRight: t.space[2],
39
- backgroundColor: t.colors.border,
40
- },
41
- cost: { marginRight: t.space[2] },
42
- chips: { flex: 1, overflow: 'hidden' },
43
- track: { marginLeft: -t.layout.screenX, marginRight: 0 },
15
+ root: { gap: t.space[2], paddingTop: t.space[1] },
16
+ cost: { alignItems: 'center' },
44
17
  }));
45
18
 
46
19
  export function RewriteTray<T extends string>({
47
20
  items,
48
21
  onPick,
49
- onKeyboard,
50
22
  cost,
51
23
  disabled,
52
- keyboardLabel = '직접 고치기',
53
24
  }: RewriteTrayProps<T>) {
54
- const t = useTheme();
55
25
  const s = useStyles();
56
26
  return (
57
- <View style={s.row}>
58
- <PressableBase
59
- onPress={onKeyboard}
60
- accessibilityLabel={keyboardLabel}
61
- style={s.key}
62
- >
63
- <KeyboardGlyph color={t.colors.title} size={t.iconSize.md} />
64
- </PressableBase>
65
- <View style={s.sep} />
27
+ <View style={s.root}>
66
28
  {cost != null ? (
67
29
  <View style={s.cost}>
68
30
  <CreditCost value={cost} />
69
31
  </View>
70
32
  ) : null}
71
- <View style={s.chips}>
72
- <ChipGroup
73
- scroll
74
- size="md"
75
- value={null}
76
- onValueChange={(v) => {
77
- if (v) onPick(v);
78
- }}
79
- items={items.map((item) => ({ ...item, disabled }))}
80
- style={s.track}
81
- />
82
- </View>
33
+ <StudioTools
34
+ docked={false}
35
+ items={items.map((item) => ({
36
+ key: item.value,
37
+ icon: item.icon,
38
+ label: item.label,
39
+ disabled,
40
+ onPress: () => onPick(item.value),
41
+ }))}
42
+ />
83
43
  </View>
84
44
  );
85
45
  }
@@ -0,0 +1,44 @@
1
+ import { Image, StyleSheet, View } from 'react-native';
2
+ import { renderIcon, type IconSlot } from '../../internal/icon';
3
+ import { useTheme } from '../../theme/theme-provider';
4
+ import { makeStyles } from '../../utils/styles';
5
+
6
+ export type SectionCoverProps = {
7
+ uri?: string | null;
8
+ icon: IconSlot;
9
+ };
10
+
11
+ const useStyles = makeStyles((t) => ({
12
+ box: {
13
+ position: 'absolute',
14
+ top: 0,
15
+ right: 0,
16
+ bottom: 0,
17
+ left: 0,
18
+ alignItems: 'center',
19
+ justifyContent: 'center',
20
+ backgroundColor: t.colors.muted,
21
+ },
22
+ }));
23
+
24
+ export function SectionCover({ uri, icon }: SectionCoverProps) {
25
+ const t = useTheme();
26
+ const s = useStyles();
27
+ return (
28
+ <View style={s.box}>
29
+ {uri ? (
30
+ <Image
31
+ source={{ uri }}
32
+ resizeMode="cover"
33
+ style={StyleSheet.absoluteFill}
34
+ accessibilityIgnoresInvertColors
35
+ />
36
+ ) : (
37
+ renderIcon(icon, {
38
+ color: t.colors.mutedForeground,
39
+ size: t.iconSize.md,
40
+ })
41
+ )}
42
+ </View>
43
+ );
44
+ }
@@ -10,7 +10,9 @@ import { useTheme } from '../../theme/theme-provider';
10
10
  import { makeStyles } from '../../utils/styles';
11
11
  import {
12
12
  DetailFocusContext,
13
+ DetailPartsContext,
13
14
  type DetailFocusRect,
15
+ type DetailPart,
14
16
  } from '../detail-editor/focus-context';
15
17
 
16
18
  export type SectionEditTemplateProps = {
@@ -25,10 +27,74 @@ export type SectionEditTemplateProps = {
25
27
  const useStyles = makeStyles((t) => ({
26
28
  root: { flex: 1, backgroundColor: t.colors.surface },
27
29
  scroll: { flex: 1 },
28
- accessory: { backgroundColor: t.colors.background },
30
+ accessory: { backgroundColor: t.colors.surface },
29
31
  sheet: { position: 'absolute', left: 0, right: 0, bottom: 0 },
30
32
  }));
31
33
 
34
+ const EPS = 0.5;
35
+
36
+ function lineStop(part: DetailPart, at: number): boolean {
37
+ if (part.line <= 0) return false;
38
+ const steps = (at - part.y) / part.line;
39
+ const k = Math.round(steps);
40
+ return (
41
+ k >= 1 &&
42
+ part.y + k * part.line < part.y + part.height - EPS &&
43
+ Math.abs(steps - k) * part.line < EPS
44
+ );
45
+ }
46
+
47
+ export function sheetEdge(
48
+ edge: number,
49
+ parts: readonly DetailPart[],
50
+ gap: number,
51
+ reach?: { min: number; max: number }
52
+ ): number {
53
+ const texts = parts.filter((p) => p.kind === 'text' && p.height > 0);
54
+ const cuts = (at: number) =>
55
+ texts.some(
56
+ (p) =>
57
+ at > p.y - gap + EPS &&
58
+ at < p.y + p.height + gap - EPS &&
59
+ !lineStop(p, at)
60
+ );
61
+ if (!cuts(edge)) return edge;
62
+ const stops = texts.flatMap((p) => {
63
+ const list = [p.y - gap, p.y + p.height + gap];
64
+ if (p.line > 0) {
65
+ for (let at = p.y + p.line; at < p.y + p.height - EPS; at += p.line) {
66
+ list.push(at);
67
+ }
68
+ }
69
+ return list;
70
+ });
71
+ let best = edge;
72
+ let far = Infinity;
73
+ for (const at of stops) {
74
+ if (cuts(at)) continue;
75
+ if (reach && (at < reach.min - EPS || at > reach.max + EPS)) continue;
76
+ const away = Math.abs(at - edge);
77
+ if (away < far) {
78
+ far = away;
79
+ best = at;
80
+ }
81
+ }
82
+ return best;
83
+ }
84
+
85
+ export function typingOffset(
86
+ box: { top: number; bottom: number },
87
+ viewport: number,
88
+ gap: number,
89
+ margin: number
90
+ ): number {
91
+ const next =
92
+ box.bottom - box.top + gap + margin > viewport
93
+ ? box.top - margin
94
+ : box.bottom + gap - viewport;
95
+ return Math.max(0, next);
96
+ }
97
+
32
98
  function useKeyboardShown() {
33
99
  const [shown, setShown] = useState(false);
34
100
  useEffect(() => {
@@ -56,7 +122,12 @@ export function SectionEditTemplate({
56
122
  const scroller = useRef<ComponentRef<typeof ScrollView>>(null);
57
123
  const offset = useRef(0);
58
124
  const pageTop = useRef(0);
125
+ const [content, setContent] = useState(0);
59
126
  const [height, setHeight] = useState(0);
127
+ const [pageHeight, setPageHeight] = useState(0);
128
+ const fresh = useRef(true);
129
+ const [parts, setParts] = useState<DetailPart[]>([]);
130
+ const listen = useRef((list: DetailPart[]) => setParts(list)).current;
60
131
  const [sheetHeight, setSheetHeight] = useState(0);
61
132
  const [focus, setFocus] = useState<DetailFocusRect | null>(null);
62
133
  const report = useRef((rect: DetailFocusRect | null) =>
@@ -68,13 +139,27 @@ export function SectionEditTemplate({
68
139
  )
69
140
  ).current;
70
141
  const margin = t.space[4];
142
+ const gap = t.space[1];
71
143
  const viewport = height - sheetHeight;
144
+ const pinned = keyboard || !!panel;
72
145
 
73
146
  useEffect(() => {
74
147
  if (!focus || viewport <= 0) return;
75
- const top = pageTop.current + focus.y - margin;
76
- const end = pageTop.current + focus.y + focus.height + margin;
77
148
  const now = offset.current;
149
+ const box = {
150
+ top: pageTop.current + focus.y,
151
+ bottom: pageTop.current + focus.y + focus.height,
152
+ };
153
+ if (pinned) {
154
+ const most = Math.max(0, content - height);
155
+ const next = Math.min(most, typingOffset(box, viewport, gap, margin));
156
+ if (Math.abs(next - now) > EPS) {
157
+ scroller.current?.scrollTo({ y: next, animated: true });
158
+ }
159
+ return;
160
+ }
161
+ const top = box.top - margin;
162
+ const end = box.bottom + margin;
78
163
  const next =
79
164
  end - top > viewport || top < now
80
165
  ? top
@@ -84,7 +169,43 @@ export function SectionEditTemplate({
84
169
  if (next !== now) {
85
170
  scroller.current?.scrollTo({ y: Math.max(0, next), animated: true });
86
171
  }
87
- }, [focus, viewport, margin]);
172
+ }, [focus, viewport, margin, gap, pinned, content, height]);
173
+
174
+ useEffect(() => {
175
+ if (sheetHeight <= 0) {
176
+ fresh.current = true;
177
+ return;
178
+ }
179
+ if (focus || keyboard || viewport <= 0) return;
180
+ if (!parts.length) return;
181
+ const now = offset.current;
182
+ const page = pageTop.current;
183
+ const most = Math.max(0, content - height);
184
+ const bottom = page + pageHeight;
185
+ const rest = bottom - viewport;
186
+ if (fresh.current && rest > 0 && most < rest - EPS) return;
187
+ const base = fresh.current && rest > 0 ? rest : now;
188
+ fresh.current = false;
189
+ const edge =
190
+ sheetEdge(base + viewport - page, parts, margin / 2, {
191
+ min: viewport - page,
192
+ max: most + viewport - page,
193
+ }) + page;
194
+ const next = Math.min(most, Math.max(0, edge - viewport));
195
+ if (Math.abs(next - now) > EPS) {
196
+ scroller.current?.scrollTo({ y: next, animated: true });
197
+ }
198
+ }, [
199
+ focus,
200
+ keyboard,
201
+ sheetHeight,
202
+ viewport,
203
+ parts,
204
+ margin,
205
+ height,
206
+ content,
207
+ pageHeight,
208
+ ]);
88
209
 
89
210
  const docked = !!accessory || !!panel;
90
211
  const below = !panel && !keyboard ? bottomInset : 0;
@@ -104,16 +225,20 @@ export function SectionEditTemplate({
104
225
  offset.current = e.nativeEvent.contentOffset.y;
105
226
  }}
106
227
  onLayout={(e) => setHeight(e.nativeEvent.layout.height)}
228
+ onContentSizeChange={(_w, h) => setContent(h)}
107
229
  >
108
- <DetailFocusContext.Provider value={report}>
109
- <View
110
- onLayout={(e) => {
111
- pageTop.current = e.nativeEvent.layout.y;
112
- }}
113
- >
114
- {children}
115
- </View>
116
- </DetailFocusContext.Provider>
230
+ <DetailPartsContext.Provider value={listen}>
231
+ <DetailFocusContext.Provider value={report}>
232
+ <View
233
+ onLayout={(e) => {
234
+ pageTop.current = e.nativeEvent.layout.y;
235
+ setPageHeight(e.nativeEvent.layout.height);
236
+ }}
237
+ >
238
+ {children}
239
+ </View>
240
+ </DetailFocusContext.Provider>
241
+ </DetailPartsContext.Provider>
117
242
  </ScrollView>
118
243
  {accessory ? (
119
244
  <View style={[s.accessory, { paddingBottom: below }]}>{accessory}</View>
@@ -5,6 +5,7 @@ import { PressableBase } from '../../internal/pressable-base';
5
5
  import { makeStyles } from '../../utils/styles';
6
6
  import {
7
7
  DETAIL_STEP_COLUMNS,
8
+ detailIsTitle,
8
9
  type DetailBlock,
9
10
  type DetailLayer,
10
11
  } from '../detail-editor/detail-types';
@@ -24,7 +25,6 @@ const COLUMNS = 3;
24
25
  const ART = 128;
25
26
  const TITLE_BAR = 6;
26
27
  const LINE_BAR = 4;
27
- const TITLE_SIZE = 7;
28
28
  const DOT = 10;
29
29
  const MAX_ROWS = 6;
30
30
 
@@ -142,7 +142,7 @@ function bars(s: Styles, layers: readonly DetailLayer[], prefix: string) {
142
142
  .map((l) => (
143
143
  <View
144
144
  key={`${prefix}${l.id}`}
145
- style={(l.style?.size ?? 5) >= TITLE_SIZE ? s.title : s.line}
145
+ style={detailIsTitle(l.style) ? s.title : s.line}
146
146
  />
147
147
  ));
148
148
  }