@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.
- package/CHANGELOG.md +23 -0
- package/lib/module/adjust/adjust-template.js +1 -0
- package/lib/module/adjust/adjust-template.js.map +1 -1
- package/lib/module/adjust/axis-adjust.js +181 -0
- package/lib/module/adjust/axis-adjust.js.map +1 -0
- package/lib/module/adjust/axis-tabs.js +81 -0
- package/lib/module/adjust/axis-tabs.js.map +1 -0
- package/lib/module/adjust/axis-wheel.js +286 -0
- package/lib/module/adjust/axis-wheel.js.map +1 -0
- package/lib/module/adjust/index.js +4 -0
- package/lib/module/adjust/index.js.map +1 -1
- package/lib/module/adjust/store-sample.js +436 -0
- package/lib/module/adjust/store-sample.js.map +1 -0
- package/lib/module/blocks/color-swatch-picker/color-swatch-picker.js +1 -1
- package/lib/module/blocks/detail-editor/compare-slider.js +5 -2
- package/lib/module/blocks/detail-editor/compare-slider.js.map +1 -1
- package/lib/module/blocks/detail-editor/detail-canvas.js +192 -61
- package/lib/module/blocks/detail-editor/detail-canvas.js.map +1 -1
- package/lib/module/blocks/detail-editor/detail-types.js +57 -0
- package/lib/module/blocks/detail-editor/detail-types.js.map +1 -1
- package/lib/module/blocks/detail-editor/draft-preview.js +22 -0
- package/lib/module/blocks/detail-editor/draft-preview.js.map +1 -1
- package/lib/module/blocks/detail-editor/focus-context.js +1 -0
- package/lib/module/blocks/detail-editor/focus-context.js.map +1 -1
- package/lib/module/blocks/detail-editor/index.js +2 -2
- package/lib/module/blocks/detail-editor/index.js.map +1 -1
- package/lib/module/blocks/detail-editor/keep-words.js +34 -0
- package/lib/module/blocks/detail-editor/keep-words.js.map +1 -0
- package/lib/module/blocks/detail-editor/layout-picker.js +192 -8
- package/lib/module/blocks/detail-editor/layout-picker.js.map +1 -1
- package/lib/module/blocks/detail-request/detail-request.js +213 -0
- package/lib/module/blocks/detail-request/detail-request.js.map +1 -0
- package/lib/module/blocks/detail-request/index.js +4 -0
- package/lib/module/blocks/detail-request/index.js.map +1 -0
- package/lib/module/blocks/detail-studio/action-chips.js +72 -0
- package/lib/module/blocks/detail-studio/action-chips.js.map +1 -0
- package/lib/module/blocks/detail-studio/adjust-tiles.js +3 -3
- package/lib/module/blocks/detail-studio/adjust-tiles.js.map +1 -1
- package/lib/module/blocks/detail-studio/asset-grid.js +33 -16
- package/lib/module/blocks/detail-studio/asset-grid.js.map +1 -1
- package/lib/module/blocks/detail-studio/confirm-row.js +3 -0
- package/lib/module/blocks/detail-studio/confirm-row.js.map +1 -1
- package/lib/module/blocks/detail-studio/detail-studio-template.js +2 -6
- package/lib/module/blocks/detail-studio/detail-studio-template.js.map +1 -1
- package/lib/module/blocks/detail-studio/edge-fade.js +74 -0
- package/lib/module/blocks/detail-studio/edge-fade.js.map +1 -0
- package/lib/module/blocks/detail-studio/image-prompt.js +8 -10
- package/lib/module/blocks/detail-studio/image-prompt.js.map +1 -1
- package/lib/module/blocks/detail-studio/index.js +7 -5
- package/lib/module/blocks/detail-studio/index.js.map +1 -1
- package/lib/module/blocks/detail-studio/rewrite-tray.js +17 -64
- package/lib/module/blocks/detail-studio/rewrite-tray.js.map +1 -1
- package/lib/module/blocks/detail-studio/section-cover.js +41 -0
- package/lib/module/blocks/detail-studio/section-cover.js.map +1 -0
- package/lib/module/blocks/detail-studio/section-edit-template.js +103 -12
- package/lib/module/blocks/detail-studio/section-edit-template.js.map +1 -1
- package/lib/module/blocks/detail-studio/section-kind-grid.js +2 -3
- package/lib/module/blocks/detail-studio/section-kind-grid.js.map +1 -1
- package/lib/module/blocks/detail-studio/section-settings.js +127 -61
- package/lib/module/blocks/detail-studio/section-settings.js.map +1 -1
- package/lib/module/blocks/detail-studio/studio-bar.js +46 -25
- package/lib/module/blocks/detail-studio/studio-bar.js.map +1 -1
- package/lib/module/blocks/detail-studio/studio-dock.js +21 -39
- package/lib/module/blocks/detail-studio/studio-dock.js.map +1 -1
- package/lib/module/blocks/detail-studio/studio-glyphs.js +92 -0
- package/lib/module/blocks/detail-studio/studio-glyphs.js.map +1 -0
- package/lib/module/blocks/detail-studio/studio-sheet.js +5 -3
- package/lib/module/blocks/detail-studio/studio-sheet.js.map +1 -1
- package/lib/module/blocks/detail-studio/studio-steps.js +60 -0
- package/lib/module/blocks/detail-studio/studio-steps.js.map +1 -0
- package/lib/module/blocks/detail-studio/studio-toggle.js +130 -0
- package/lib/module/blocks/detail-studio/studio-toggle.js.map +1 -0
- package/lib/module/blocks/detail-studio/{photo-tool-bar.js → studio-tools.js} +63 -42
- package/lib/module/blocks/detail-studio/studio-tools.js.map +1 -0
- package/lib/module/blocks/detail-studio/text-format-panel.js +16 -8
- package/lib/module/blocks/detail-studio/text-format-panel.js.map +1 -1
- package/lib/module/blocks/index.js +1 -0
- package/lib/module/blocks/index.js.map +1 -1
- package/lib/module/components/button/button.js +13 -5
- package/lib/module/components/button/button.js.map +1 -1
- package/lib/module/components/chip/chip.js +5 -1
- package/lib/module/components/chip/chip.js.map +1 -1
- package/lib/module/components/chip-group/chip-group.js +1 -0
- package/lib/module/components/chip-group/chip-group.js.map +1 -1
- package/lib/module/components/credit/credit.js +6 -2
- package/lib/module/components/credit/credit.js.map +1 -1
- package/lib/module/components/dropdown-menu/dropdown-menu.js +9 -4
- package/lib/module/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/lib/module/components/segmented-control/segmented-control.js +3 -1
- package/lib/module/components/segmented-control/segmented-control.js.map +1 -1
- package/lib/module/components/skeleton/skeleton.js +4 -2
- package/lib/module/components/skeleton/skeleton.js.map +1 -1
- package/lib/module/components/slider/slider.js +53 -16
- package/lib/module/components/slider/slider.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/glyphs.js +2 -1
- package/lib/module/internal/glyphs.js.map +1 -1
- package/lib/module/internal/line-icons.js +1 -0
- package/lib/module/internal/line-icons.js.map +1 -1
- package/lib/module/internal/retry-glyph.js +5 -2
- package/lib/module/internal/retry-glyph.js.map +1 -1
- package/lib/module/internal/undo-glyph.js +11 -8
- package/lib/module/internal/undo-glyph.js.map +1 -1
- package/lib/module/sortable/section-board.js +73 -89
- package/lib/module/sortable/section-board.js.map +1 -1
- package/lib/module/templates/design-pick-template.js +8 -1
- package/lib/module/templates/design-pick-template.js.map +1 -1
- package/lib/module/templates/intro-template.js +3 -3
- package/lib/module/templates/intro-template.js.map +1 -1
- package/lib/module/templates/result-template.js +2 -1
- package/lib/module/templates/result-template.js.map +1 -1
- package/lib/typescript/src/adjust/adjust-template.d.ts.map +1 -1
- package/lib/typescript/src/adjust/axis-adjust.d.ts +25 -0
- package/lib/typescript/src/adjust/axis-adjust.d.ts.map +1 -0
- package/lib/typescript/src/adjust/axis-tabs.d.ts +15 -0
- package/lib/typescript/src/adjust/axis-tabs.d.ts.map +1 -0
- package/lib/typescript/src/adjust/axis-wheel.d.ts +15 -0
- package/lib/typescript/src/adjust/axis-wheel.d.ts.map +1 -0
- package/lib/typescript/src/adjust/index.d.ts +4 -0
- package/lib/typescript/src/adjust/index.d.ts.map +1 -1
- package/lib/typescript/src/adjust/store-sample.d.ts +46 -0
- package/lib/typescript/src/adjust/store-sample.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-editor/compare-slider.d.ts +2 -1
- package/lib/typescript/src/blocks/detail-editor/compare-slider.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/detail-canvas.d.ts +3 -1
- package/lib/typescript/src/blocks/detail-editor/detail-canvas.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/detail-types.d.ts +11 -0
- package/lib/typescript/src/blocks/detail-editor/detail-types.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts +4 -1
- package/lib/typescript/src/blocks/detail-editor/draft-preview.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/focus-context.d.ts +9 -0
- package/lib/typescript/src/blocks/detail-editor/focus-context.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/index.d.ts +3 -2
- package/lib/typescript/src/blocks/detail-editor/index.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-editor/keep-words.d.ts +2 -0
- package/lib/typescript/src/blocks/detail-editor/keep-words.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts +6 -1
- package/lib/typescript/src/blocks/detail-editor/layout-picker.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-request/detail-request.d.ts +24 -0
- package/lib/typescript/src/blocks/detail-request/detail-request.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-request/index.d.ts +2 -0
- package/lib/typescript/src/blocks/detail-request/index.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/action-chips.d.ts +12 -0
- package/lib/typescript/src/blocks/detail-studio/action-chips.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/asset-grid.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/confirm-row.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/detail-studio-template.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/edge-fade.d.ts +10 -0
- package/lib/typescript/src/blocks/detail-studio/edge-fade.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/image-prompt.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/index.d.ts +7 -5
- package/lib/typescript/src/blocks/detail-studio/index.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/rewrite-tray.d.ts +3 -3
- package/lib/typescript/src/blocks/detail-studio/rewrite-tray.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/section-cover.d.ts +7 -0
- package/lib/typescript/src/blocks/detail-studio/section-cover.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/section-edit-template.d.ts +9 -0
- package/lib/typescript/src/blocks/detail-studio/section-edit-template.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/section-kind-grid.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/section-settings.d.ts +11 -13
- package/lib/typescript/src/blocks/detail-studio/section-settings.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/studio-bar.d.ts +6 -2
- package/lib/typescript/src/blocks/detail-studio/studio-bar.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/studio-dock.d.ts +0 -2
- package/lib/typescript/src/blocks/detail-studio/studio-dock.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/studio-glyphs.d.ts +6 -0
- package/lib/typescript/src/blocks/detail-studio/studio-glyphs.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/studio-sheet.d.ts.map +1 -1
- package/lib/typescript/src/blocks/detail-studio/studio-steps.d.ts +11 -0
- package/lib/typescript/src/blocks/detail-studio/studio-steps.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/studio-toggle.d.ts +14 -0
- package/lib/typescript/src/blocks/detail-studio/studio-toggle.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/studio-tools.d.ts +19 -0
- package/lib/typescript/src/blocks/detail-studio/studio-tools.d.ts.map +1 -0
- package/lib/typescript/src/blocks/detail-studio/text-format-panel.d.ts +2 -1
- package/lib/typescript/src/blocks/detail-studio/text-format-panel.d.ts.map +1 -1
- package/lib/typescript/src/blocks/index.d.ts +1 -0
- package/lib/typescript/src/blocks/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/button.d.ts +3 -1
- package/lib/typescript/src/components/button/button.d.ts.map +1 -1
- package/lib/typescript/src/components/chip/chip.d.ts +2 -1
- package/lib/typescript/src/components/chip/chip.d.ts.map +1 -1
- package/lib/typescript/src/components/chip-group/chip-group.d.ts +1 -0
- package/lib/typescript/src/components/chip-group/chip-group.d.ts.map +1 -1
- package/lib/typescript/src/components/credit/credit.d.ts +1 -0
- package/lib/typescript/src/components/credit/credit.d.ts.map +1 -1
- package/lib/typescript/src/components/dropdown-menu/dropdown-menu.d.ts +2 -0
- package/lib/typescript/src/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/lib/typescript/src/components/segmented-control/segmented-control.d.ts +2 -0
- package/lib/typescript/src/components/segmented-control/segmented-control.d.ts.map +1 -1
- package/lib/typescript/src/components/skeleton/skeleton.d.ts +2 -1
- package/lib/typescript/src/components/skeleton/skeleton.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/slider.d.ts +2 -1
- package/lib/typescript/src/components/slider/slider.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/internal/glyphs.d.ts +1 -0
- package/lib/typescript/src/internal/glyphs.d.ts.map +1 -1
- package/lib/typescript/src/internal/line-icons.d.ts +1 -0
- package/lib/typescript/src/internal/line-icons.d.ts.map +1 -1
- package/lib/typescript/src/internal/retry-glyph.d.ts.map +1 -1
- package/lib/typescript/src/internal/undo-glyph.d.ts.map +1 -1
- package/lib/typescript/src/sortable/section-board.d.ts.map +1 -1
- package/lib/typescript/src/templates/design-pick-template.d.ts.map +1 -1
- package/lib/typescript/src/templates/intro-template.d.ts.map +1 -1
- package/lib/typescript/src/templates/result-template.d.ts +2 -1
- package/lib/typescript/src/templates/result-template.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adjust/adjust-template.tsx +1 -0
- package/src/adjust/axis-adjust.tsx +206 -0
- package/src/adjust/axis-tabs.tsx +81 -0
- package/src/adjust/axis-wheel.tsx +309 -0
- package/src/adjust/index.ts +15 -0
- package/src/adjust/store-sample.tsx +519 -0
- package/src/blocks/color-swatch-picker/color-swatch-picker.tsx +1 -1
- package/src/blocks/detail-editor/compare-slider.tsx +3 -1
- package/src/blocks/detail-editor/detail-canvas.tsx +264 -69
- package/src/blocks/detail-editor/detail-types.ts +37 -0
- package/src/blocks/detail-editor/draft-preview.tsx +46 -2
- package/src/blocks/detail-editor/focus-context.ts +13 -0
- package/src/blocks/detail-editor/index.ts +11 -1
- package/src/blocks/detail-editor/keep-words.ts +36 -0
- package/src/blocks/detail-editor/layout-picker.tsx +188 -6
- package/src/blocks/detail-request/detail-request.tsx +198 -0
- package/src/blocks/detail-request/index.ts +11 -0
- package/src/blocks/detail-studio/action-chips.tsx +77 -0
- package/src/blocks/detail-studio/adjust-tiles.tsx +3 -3
- package/src/blocks/detail-studio/asset-grid.tsx +30 -16
- package/src/blocks/detail-studio/confirm-row.tsx +3 -0
- package/src/blocks/detail-studio/detail-studio-template.tsx +2 -6
- package/src/blocks/detail-studio/edge-fade.tsx +76 -0
- package/src/blocks/detail-studio/image-prompt.tsx +6 -9
- package/src/blocks/detail-studio/index.ts +19 -16
- package/src/blocks/detail-studio/rewrite-tray.tsx +16 -56
- package/src/blocks/detail-studio/section-cover.tsx +44 -0
- package/src/blocks/detail-studio/section-edit-template.tsx +138 -13
- package/src/blocks/detail-studio/section-kind-grid.tsx +2 -2
- package/src/blocks/detail-studio/section-settings.tsx +124 -69
- package/src/blocks/detail-studio/studio-bar.tsx +61 -41
- package/src/blocks/detail-studio/studio-dock.tsx +19 -37
- package/src/blocks/detail-studio/studio-glyphs.tsx +77 -0
- package/src/blocks/detail-studio/studio-sheet.tsx +7 -3
- package/src/blocks/detail-studio/studio-steps.tsx +58 -0
- package/src/blocks/detail-studio/studio-toggle.tsx +130 -0
- package/src/blocks/detail-studio/studio-tools.tsx +126 -0
- package/src/blocks/detail-studio/text-format-panel.tsx +26 -14
- package/src/blocks/index.tsx +1 -0
- package/src/components/button/button.tsx +12 -5
- package/src/components/chip/chip.tsx +9 -1
- package/src/components/chip-group/chip-group.tsx +2 -0
- package/src/components/credit/credit.tsx +9 -2
- package/src/components/dropdown-menu/dropdown-menu.tsx +18 -7
- package/src/components/segmented-control/segmented-control.tsx +10 -2
- package/src/components/skeleton/skeleton.tsx +5 -2
- package/src/components/slider/slider.tsx +66 -14
- package/src/index.tsx +1 -0
- package/src/internal/glyphs.tsx +2 -0
- package/src/internal/line-icons.ts +2 -0
- package/src/internal/retry-glyph.tsx +7 -2
- package/src/internal/undo-glyph.tsx +12 -11
- package/src/sortable/section-board.tsx +71 -76
- package/src/templates/design-pick-template.tsx +9 -1
- package/src/templates/intro-template.tsx +14 -12
- package/src/templates/result-template.tsx +3 -0
- package/lib/module/blocks/detail-studio/keyboard-bar.js +0 -67
- package/lib/module/blocks/detail-studio/keyboard-bar.js.map +0 -1
- package/lib/module/blocks/detail-studio/photo-tool-bar.js.map +0 -1
- package/lib/module/blocks/detail-studio/section-thumb.js +0 -49
- package/lib/module/blocks/detail-studio/section-thumb.js.map +0 -1
- package/lib/typescript/src/blocks/detail-studio/keyboard-bar.d.ts +0 -18
- package/lib/typescript/src/blocks/detail-studio/keyboard-bar.d.ts.map +0 -1
- package/lib/typescript/src/blocks/detail-studio/photo-tool-bar.d.ts +0 -19
- package/lib/typescript/src/blocks/detail-studio/photo-tool-bar.d.ts.map +0 -1
- package/lib/typescript/src/blocks/detail-studio/section-thumb.d.ts +0 -14
- package/lib/typescript/src/blocks/detail-studio/section-thumb.d.ts.map +0 -1
- package/src/blocks/detail-studio/keyboard-bar.tsx +0 -73
- package/src/blocks/detail-studio/photo-tool-bar.tsx +0 -100
- package/src/blocks/detail-studio/section-thumb.tsx +0 -41
|
@@ -20,11 +20,14 @@ export type SliderProps = {
|
|
|
20
20
|
start?: ReactNode;
|
|
21
21
|
end?: ReactNode;
|
|
22
22
|
accessibilityLabel: string;
|
|
23
|
+
size?: 'md' | 'sm';
|
|
23
24
|
style?: StyleProp<ViewStyle>;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
const TRACK = 6;
|
|
27
28
|
const THUMB = 28;
|
|
29
|
+
const TRACK_SM = 4;
|
|
30
|
+
const THUMB_SM = 24;
|
|
28
31
|
const TICK_WIDTH = 2;
|
|
29
32
|
const TICK_HEIGHT = 16;
|
|
30
33
|
const NUDGE = 10;
|
|
@@ -74,6 +77,25 @@ const useStyles = makeStyles((t) => ({
|
|
|
74
77
|
t.scheme === 'dark' ? t.colors.foreground : t.colors.surface,
|
|
75
78
|
boxShadow: t.shadow.md,
|
|
76
79
|
},
|
|
80
|
+
rootSm: { gap: t.space[3] },
|
|
81
|
+
trackSm: {
|
|
82
|
+
top: (t.minTouchSize - TRACK_SM) / 2,
|
|
83
|
+
height: TRACK_SM,
|
|
84
|
+
backgroundColor: t.colors.border,
|
|
85
|
+
},
|
|
86
|
+
fillSm: { top: (t.minTouchSize - TRACK_SM) / 2, height: TRACK_SM },
|
|
87
|
+
thumbSm: {
|
|
88
|
+
top: (t.minTouchSize - THUMB_SM) / 2,
|
|
89
|
+
width: THUMB_SM,
|
|
90
|
+
height: THUMB_SM,
|
|
91
|
+
},
|
|
92
|
+
slotSm: { width: 'auto' },
|
|
93
|
+
labelSm: { width: t.space[8] },
|
|
94
|
+
valueSm: {
|
|
95
|
+
width: t.space[8],
|
|
96
|
+
textAlign: 'right',
|
|
97
|
+
color: t.colors.title,
|
|
98
|
+
},
|
|
77
99
|
}));
|
|
78
100
|
|
|
79
101
|
export function Slider({
|
|
@@ -87,13 +109,32 @@ export function Slider({
|
|
|
87
109
|
start,
|
|
88
110
|
end,
|
|
89
111
|
accessibilityLabel,
|
|
112
|
+
size = 'md',
|
|
90
113
|
style,
|
|
91
114
|
}: SliderProps) {
|
|
92
115
|
const s = useStyles();
|
|
116
|
+
const sm = size === 'sm';
|
|
117
|
+
const thumb = sm ? THUMB_SM : THUMB;
|
|
93
118
|
const [width, setWidth] = useState(0);
|
|
94
119
|
const span = max - min;
|
|
95
|
-
const latest = useRef({
|
|
96
|
-
|
|
120
|
+
const latest = useRef({
|
|
121
|
+
value,
|
|
122
|
+
onChange,
|
|
123
|
+
onSlidingStart,
|
|
124
|
+
min,
|
|
125
|
+
span,
|
|
126
|
+
width,
|
|
127
|
+
thumb,
|
|
128
|
+
});
|
|
129
|
+
latest.current = {
|
|
130
|
+
value,
|
|
131
|
+
onChange,
|
|
132
|
+
onSlidingStart,
|
|
133
|
+
min,
|
|
134
|
+
span,
|
|
135
|
+
width,
|
|
136
|
+
thumb,
|
|
137
|
+
};
|
|
97
138
|
const origin = useRef(0);
|
|
98
139
|
const pick = (x: number) => {
|
|
99
140
|
const {
|
|
@@ -102,10 +143,11 @@ export function Slider({
|
|
|
102
143
|
span: n,
|
|
103
144
|
value: now,
|
|
104
145
|
onChange: change,
|
|
146
|
+
thumb: knob,
|
|
105
147
|
} = latest.current;
|
|
106
148
|
if (w <= 0 || n <= 0) return;
|
|
107
|
-
const room = w -
|
|
108
|
-
const at = Math.max(0, Math.min(room, x -
|
|
149
|
+
const room = w - knob;
|
|
150
|
+
const at = Math.max(0, Math.min(room, x - knob / 2));
|
|
109
151
|
const next = lo + (at / room) * n;
|
|
110
152
|
if (next !== now) change(next);
|
|
111
153
|
};
|
|
@@ -128,16 +170,21 @@ export function Slider({
|
|
|
128
170
|
span > 0 ? (Math.min(max, Math.max(min, value)) - min) / span : 0;
|
|
129
171
|
const base = sliderOrigin(min, max);
|
|
130
172
|
const baseRatio = span > 0 ? (base - min) / span : 0;
|
|
131
|
-
const room = Math.max(0, width -
|
|
173
|
+
const room = Math.max(0, width - thumb);
|
|
132
174
|
const left = ratio * room;
|
|
133
|
-
const center = left +
|
|
134
|
-
const baseCenter = base === min ? 0 : baseRatio * room +
|
|
175
|
+
const center = left + thumb / 2;
|
|
176
|
+
const baseCenter = base === min ? 0 : baseRatio * room + thumb / 2;
|
|
135
177
|
return (
|
|
136
|
-
<View style={[s.root, style]}>
|
|
178
|
+
<View style={[s.root, sm && s.rootSm, style]}>
|
|
137
179
|
{start ? (
|
|
138
|
-
<View style={s.slotStart}>{start}</View>
|
|
180
|
+
<View style={[s.slotStart, sm && s.slotSm]}>{start}</View>
|
|
139
181
|
) : startLabel ? (
|
|
140
|
-
<Text
|
|
182
|
+
<Text
|
|
183
|
+
variant="caption"
|
|
184
|
+
tone="muted"
|
|
185
|
+
numberOfLines={1}
|
|
186
|
+
style={[s.end, sm && s.labelSm]}
|
|
187
|
+
>
|
|
141
188
|
{startLabel}
|
|
142
189
|
</Text>
|
|
143
190
|
) : null}
|
|
@@ -160,13 +207,14 @@ export function Slider({
|
|
|
160
207
|
}
|
|
161
208
|
style={s.area}
|
|
162
209
|
>
|
|
163
|
-
<View style={s.track} pointerEvents="none" />
|
|
210
|
+
<View style={[s.track, sm && s.trackSm]} pointerEvents="none" />
|
|
164
211
|
{width > 0 ? (
|
|
165
212
|
<>
|
|
166
213
|
<View
|
|
167
214
|
testID="slider-fill"
|
|
168
215
|
style={[
|
|
169
216
|
s.fill,
|
|
217
|
+
sm && s.fillSm,
|
|
170
218
|
{
|
|
171
219
|
left: Math.min(baseCenter, center),
|
|
172
220
|
width: Math.abs(center - baseCenter),
|
|
@@ -181,18 +229,22 @@ export function Slider({
|
|
|
181
229
|
pointerEvents="none"
|
|
182
230
|
/>
|
|
183
231
|
) : null}
|
|
184
|
-
<View
|
|
232
|
+
<View
|
|
233
|
+
style={[s.thumb, sm && s.thumbSm, { left }]}
|
|
234
|
+
pointerEvents="none"
|
|
235
|
+
/>
|
|
185
236
|
</>
|
|
186
237
|
) : null}
|
|
187
238
|
</View>
|
|
188
239
|
{end ? (
|
|
189
|
-
<View style={s.slotEnd}>{end}</View>
|
|
240
|
+
<View style={[s.slotEnd, sm && s.slotSm]}>{end}</View>
|
|
190
241
|
) : endLabel ? (
|
|
191
242
|
<Text
|
|
192
243
|
variant="caption"
|
|
193
244
|
tone="muted"
|
|
245
|
+
weight={sm ? 'semibold' : undefined}
|
|
194
246
|
numberOfLines={1}
|
|
195
|
-
style={s.endRight}
|
|
247
|
+
style={[s.endRight, sm && s.valueSm]}
|
|
196
248
|
>
|
|
197
249
|
{endLabel}
|
|
198
250
|
</Text>
|
package/src/index.tsx
CHANGED
package/src/internal/glyphs.tsx
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
EYE,
|
|
17
17
|
EYE_OFF,
|
|
18
18
|
FILE,
|
|
19
|
+
FOCUS,
|
|
19
20
|
GLOBE,
|
|
20
21
|
IMAGES,
|
|
21
22
|
KEYBOARD,
|
|
@@ -320,6 +321,7 @@ export const SlidersGlyph = imageGlyph(SLIDERS);
|
|
|
320
321
|
export const CropGlyph = imageGlyph(CROP);
|
|
321
322
|
export const EraserGlyph = imageGlyph(ERASER);
|
|
322
323
|
export const BucketGlyph = imageGlyph(BUCKET);
|
|
324
|
+
export const FocusGlyph = imageGlyph(FOCUS);
|
|
323
325
|
|
|
324
326
|
function lineOf(size: number) {
|
|
325
327
|
return Math.max(1.5, size / 12);
|
|
@@ -105,3 +105,5 @@ export const ERASER =
|
|
|
105
105
|
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAAAsTAAALEwEAmpwYAAADVklEQVR42u2dy2oUQRSGa1ZqdOHG6Au470xGn0ESfQHNCwhidIII4sadtyS4cOvKCOLWVRIF3ajPYbLTURzBhWA8DdWiwXRXd9flnFP/Dz8ETdIz39e36a7qGIMgCIIgCIIgCCI/A+qQukQd2y7ZfxsAT7jMUlepu9S9A7prv2cWuPyu8SvUaQ34/Z3an8EW0TOHqRstwO/vM+oRYOyWEtxWD/hV31CPAmca+JDQEf6mR/hVt7A78gv/nT3jWbVfQ0Ik+F+oC//5+UX7f5AQcJ//lXq25vfMUT/hmJAGPiQwgA8JDOBDAgP4kMAAPiQwgA8JDOBDAgP4WUvgAj9LCdzgZyWBK/y/JXzWKoE7fNUSpMBXKUEafFUSpMJXIUE6fNEStMAXKaHNbcSRoLO4kePtzU07dglrfsIt4YVJMAJP65rfdUsYA35aCdNYA4Jzg99GwsMY8LczhO8qYSfkseA49WPG8Kucb3j/Rag1fwfw/+R9DYOLIeC/Bvx/shbrbKjNQNn7Jp9EEdB2iPgv6pVMBHwIvQvqOj4/BwkXQh+E+06OKCVcVQp/PvRpqK+ZKRollPAnDe/7QaxPuI8yk+AC/xv1RMzLCzcykeACv+x102MebtdrO9oluMJ/anrMQN/o+SFLqwRX+L1uyKx4+oSrTUIb+J0n+500z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DClgo/vYanzyUIB7fvDWI0meHpi1EL86tRK1nHEfjy94tjbTsqPH0j8JOB+LzC0/uOH03Fpagwjt9E936bIBlRURs0jkIlwlhEeLqcRg4iZ6D4icurmXfeTzv0xDV/tHJsz0Dxozv6FocmtStD3k8zt08RK1tReUcz4ycur2bReT/LoA0mwc9eolfkYpE2htqM7UU0ospGTSMCuZ7gbk4WAsRpDlMEG5Grmi8oLl9SN6m+XVbDbKgN09obWBIZVkNNgJoAaaDOFzTgfEFxMEKyUJFhhdGs/W9kpPCoYSdUTRsyd3e69PxYDokjwDjwX4g+64mlN4aKaOgSbKBIUsquVsaVEenzUtS6he/o1z4H/nrijvdxJ6j2UZnH56Sou2zJu3u16JsEuzJdybu/iLKCIVn6+s2oNDHdkAb4KI/fR8BDqAxRnRiKTxNEJJfxHLHRGA5poIIHHgcuIYgtDbN+txi4arsqjGvYUlQArUuEmPnz9yQwyQ8CX1HOc8RWxPluBOaH9D0MJxeiUr6lPl/Mdrn28wiT2XyOWNiufVv89MVVrxt5Ciqso01/D/Ep6zliWQ/xaZPg+JJeG3on2c8PG9ZzxHSfdBzTA/1Cvj1ZP0L44WVVP0fMjFt6OoGCk4kT7hFxZGamavfAvsNwjpgWNaY0mAYe7PfIdzV6GfBORpadzeeI2WUjKWNOsx5nez5wHeowm8Wo8JCOS+cl2Iv1DfAw8GlJ1NDzgCcFiS2CzLdhorgp1u0O4eA3CU5L6lndzHKgMxbiDkfF6ujzhM0Ts/VvfaDzzpIaYjrvZ1T7R4QA4yEuDL+IxqdJFTwM54h5xMcpDYwDohxZSZxOZV1D8BI+U/V1kBpqqKGGGmqY/fA/cw+DCyjZ5tIAAAAASUVORK5CYII=';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { StyleSheet, View } from 'react-native';
|
|
2
2
|
|
|
3
|
+
const OPEN = 'transparent';
|
|
4
|
+
|
|
3
5
|
const g = StyleSheet.create({
|
|
4
6
|
center: { alignItems: 'center', justifyContent: 'center' },
|
|
5
|
-
open: {
|
|
7
|
+
open: { transform: [{ rotate: '45deg' }] },
|
|
6
8
|
head: { position: 'absolute' },
|
|
7
9
|
});
|
|
8
10
|
|
|
@@ -19,7 +21,10 @@ export function RetryGlyph({ color, size }: { color: string; size: number }) {
|
|
|
19
21
|
height: ring,
|
|
20
22
|
borderRadius: ring / 2,
|
|
21
23
|
borderWidth: stroke,
|
|
22
|
-
|
|
24
|
+
borderTopColor: OPEN,
|
|
25
|
+
borderRightColor: color,
|
|
26
|
+
borderBottomColor: color,
|
|
27
|
+
borderLeftColor: color,
|
|
23
28
|
},
|
|
24
29
|
]}
|
|
25
30
|
/>
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { StyleSheet, View } from 'react-native';
|
|
2
2
|
|
|
3
|
+
const OPEN = 'transparent';
|
|
4
|
+
|
|
3
5
|
const g = StyleSheet.create({
|
|
4
|
-
arc: {
|
|
5
|
-
|
|
6
|
-
borderTopColor: 'transparent',
|
|
7
|
-
transform: [{ rotate: '-45deg' }],
|
|
8
|
-
},
|
|
9
|
-
head: { position: 'absolute', transform: [{ rotate: '-6deg' }] },
|
|
6
|
+
arc: { position: 'absolute', transform: [{ rotate: '-55deg' }] },
|
|
7
|
+
head: { position: 'absolute', transform: [{ rotate: '45deg' }] },
|
|
10
8
|
});
|
|
11
9
|
|
|
12
10
|
export function UndoGlyph({ color, size }: { color: string; size: number }) {
|
|
13
11
|
const unit = size / 18;
|
|
14
12
|
const stroke = Math.max(1.5, unit * 1.7);
|
|
15
13
|
const ring = unit * 13;
|
|
16
|
-
const head = unit *
|
|
14
|
+
const head = unit * 4.8;
|
|
17
15
|
return (
|
|
18
16
|
<View style={{ width: size, height: size }}>
|
|
19
17
|
<View
|
|
@@ -26,7 +24,10 @@ export function UndoGlyph({ color, size }: { color: string; size: number }) {
|
|
|
26
24
|
height: ring,
|
|
27
25
|
borderRadius: ring / 2,
|
|
28
26
|
borderWidth: stroke,
|
|
29
|
-
|
|
27
|
+
borderTopColor: OPEN,
|
|
28
|
+
borderRightColor: color,
|
|
29
|
+
borderBottomColor: color,
|
|
30
|
+
borderLeftColor: color,
|
|
30
31
|
},
|
|
31
32
|
]}
|
|
32
33
|
/>
|
|
@@ -34,14 +35,14 @@ export function UndoGlyph({ color, size }: { color: string; size: number }) {
|
|
|
34
35
|
style={[
|
|
35
36
|
g.head,
|
|
36
37
|
{
|
|
37
|
-
left: unit *
|
|
38
|
-
top: unit * 1.
|
|
38
|
+
left: unit * 6.6,
|
|
39
|
+
top: unit * 1.45,
|
|
39
40
|
width: head,
|
|
40
41
|
height: head,
|
|
41
42
|
borderLeftWidth: stroke,
|
|
42
43
|
borderBottomWidth: stroke,
|
|
43
44
|
borderColor: color,
|
|
44
|
-
borderRadius: unit * 0.
|
|
45
|
+
borderRadius: unit * 0.5,
|
|
45
46
|
},
|
|
46
47
|
]}
|
|
47
48
|
/>
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
import { View } from 'react-native';
|
|
11
11
|
import Animated, { useAnimatedRef } from 'react-native-reanimated';
|
|
12
12
|
import Sortable from 'react-native-sortables';
|
|
13
|
-
import { SECTION_THUMB } from '../blocks/detail-studio/section-thumb';
|
|
14
13
|
import { Skeleton } from '../components/skeleton/skeleton';
|
|
15
14
|
import { Text } from '../components/text/text';
|
|
16
15
|
import type { SectionAnchor } from '../components/dropdown-menu/dropdown-menu';
|
|
@@ -46,42 +45,46 @@ export type SectionBoardProps = {
|
|
|
46
45
|
const MOVE_LABELS: [string, string] = ['위로 이동', '아래로 이동'];
|
|
47
46
|
const WAIT_LINE = 120;
|
|
48
47
|
|
|
49
|
-
const rowHeight = (t: Theme) =>
|
|
48
|
+
const rowHeight = (t: Theme) => t.listRow.threeLine;
|
|
49
|
+
|
|
50
|
+
const thumbSize = (t: Theme) => t.space[16];
|
|
50
51
|
|
|
51
52
|
const useStyles = makeStyles((t) => ({
|
|
52
53
|
scroll: { flex: 1 },
|
|
54
|
+
content: { paddingTop: t.space[1], paddingBottom: t.space[4] },
|
|
53
55
|
card: {
|
|
54
56
|
marginHorizontal: t.space[4],
|
|
55
|
-
borderRadius: t.radius.
|
|
57
|
+
borderRadius: t.radius.md * 2,
|
|
56
58
|
backgroundColor: t.colors.surface,
|
|
57
59
|
},
|
|
58
60
|
row: {
|
|
59
61
|
height: rowHeight(t),
|
|
60
62
|
flexDirection: 'row',
|
|
61
63
|
alignItems: 'center',
|
|
62
|
-
|
|
64
|
+
paddingLeft: t.space[3],
|
|
65
|
+
paddingRight: t.space[1],
|
|
63
66
|
backgroundColor: t.colors.surface,
|
|
64
67
|
},
|
|
65
68
|
first: {
|
|
66
|
-
borderTopLeftRadius: t.radius.
|
|
67
|
-
borderTopRightRadius: t.radius.
|
|
69
|
+
borderTopLeftRadius: t.radius.md * 2,
|
|
70
|
+
borderTopRightRadius: t.radius.md * 2,
|
|
68
71
|
},
|
|
69
72
|
last: {
|
|
70
|
-
borderBottomLeftRadius: t.radius.
|
|
71
|
-
borderBottomRightRadius: t.radius.
|
|
73
|
+
borderBottomLeftRadius: t.radius.md * 2,
|
|
74
|
+
borderBottomRightRadius: t.radius.md * 2,
|
|
72
75
|
},
|
|
73
76
|
pressed: { backgroundColor: t.colors.background },
|
|
74
|
-
lifted: { borderRadius: t.radius.
|
|
77
|
+
lifted: { borderRadius: t.radius.md * 2, boxShadow: t.shadow.lift },
|
|
75
78
|
line: {
|
|
76
79
|
position: 'absolute',
|
|
77
80
|
top: 0,
|
|
78
81
|
right: 0,
|
|
79
|
-
left:
|
|
82
|
+
left: 0,
|
|
80
83
|
height: 1,
|
|
81
84
|
backgroundColor: t.colors.border,
|
|
82
85
|
},
|
|
83
86
|
grip: {
|
|
84
|
-
width: t.
|
|
87
|
+
width: t.minTouchSize,
|
|
85
88
|
height: t.minTouchSize,
|
|
86
89
|
alignItems: 'center',
|
|
87
90
|
justifyContent: 'center',
|
|
@@ -93,21 +96,11 @@ const useStyles = makeStyles((t) => ({
|
|
|
93
96
|
alignItems: 'center',
|
|
94
97
|
},
|
|
95
98
|
thumb: {
|
|
96
|
-
width:
|
|
97
|
-
height:
|
|
99
|
+
width: thumbSize(t),
|
|
100
|
+
height: thumbSize(t),
|
|
98
101
|
overflow: 'hidden',
|
|
99
|
-
borderRadius: t.radius.
|
|
100
|
-
backgroundColor: t.colors.
|
|
101
|
-
},
|
|
102
|
-
ring: {
|
|
103
|
-
position: 'absolute',
|
|
104
|
-
left: 0,
|
|
105
|
-
right: 0,
|
|
106
|
-
top: 0,
|
|
107
|
-
bottom: 0,
|
|
108
|
-
borderRadius: t.radius.md,
|
|
109
|
-
borderWidth: 1,
|
|
110
|
-
borderColor: t.colors.border,
|
|
102
|
+
borderRadius: t.radius.lg,
|
|
103
|
+
backgroundColor: t.colors.muted,
|
|
111
104
|
},
|
|
112
105
|
text: { flex: 1, paddingLeft: t.space[3], paddingRight: t.space[1] },
|
|
113
106
|
snippet: {
|
|
@@ -124,8 +117,9 @@ const useStyles = makeStyles((t) => ({
|
|
|
124
117
|
justifyContent: 'center',
|
|
125
118
|
},
|
|
126
119
|
wait: { marginTop: t.space[2] },
|
|
127
|
-
flag: { marginRight: -t.space[
|
|
120
|
+
flag: { marginRight: -t.space[3] },
|
|
128
121
|
turn: { transform: [{ rotate: '90deg' }] },
|
|
122
|
+
space: { width: t.minTouchSize * 2 },
|
|
129
123
|
}));
|
|
130
124
|
|
|
131
125
|
type RowProps = {
|
|
@@ -135,7 +129,7 @@ type RowProps = {
|
|
|
135
129
|
active: boolean;
|
|
136
130
|
lifted: boolean;
|
|
137
131
|
onPress: (key: string) => void;
|
|
138
|
-
onMore: (key: string,
|
|
132
|
+
onMore: (key: string, index: number) => void;
|
|
139
133
|
onMove: (from: number, to: number) => void;
|
|
140
134
|
hiddenLabel: string;
|
|
141
135
|
moreLabel: string;
|
|
@@ -157,7 +151,6 @@ const Row = memo(function SectionRow({
|
|
|
157
151
|
}: RowProps) {
|
|
158
152
|
const t = useTheme();
|
|
159
153
|
const s = useStyles();
|
|
160
|
-
const more = useRef<ComponentRef<typeof View>>(null);
|
|
161
154
|
const hidden = !!item.hidden;
|
|
162
155
|
if (item.pending) {
|
|
163
156
|
return (
|
|
@@ -165,17 +158,15 @@ const Row = memo(function SectionRow({
|
|
|
165
158
|
style={[s.row, index === 0 && s.first, index === count - 1 && s.last]}
|
|
166
159
|
>
|
|
167
160
|
{index > 0 ? <View pointerEvents="none" style={s.line} /> : null}
|
|
168
|
-
<Sortable.Handle mode="fixed-order">
|
|
169
|
-
<View style={s.grip} />
|
|
170
|
-
</Sortable.Handle>
|
|
171
161
|
<View style={s.main} accessible accessibilityLabel={item.title}>
|
|
172
162
|
<View style={s.thumb}>
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
163
|
+
{item.thumb ?? (
|
|
164
|
+
<Skeleton
|
|
165
|
+
width={thumbSize(t)}
|
|
166
|
+
height={thumbSize(t)}
|
|
167
|
+
radius={t.radius.lg}
|
|
168
|
+
/>
|
|
169
|
+
)}
|
|
179
170
|
</View>
|
|
180
171
|
<View style={s.text}>
|
|
181
172
|
<Text weight="semibold" tone="muted" numberOfLines={1}>
|
|
@@ -189,17 +180,12 @@ const Row = memo(function SectionRow({
|
|
|
189
180
|
/>
|
|
190
181
|
</View>
|
|
191
182
|
</View>
|
|
192
|
-
<
|
|
183
|
+
<Sortable.Handle mode="fixed-order">
|
|
184
|
+
<View style={s.space} />
|
|
185
|
+
</Sortable.Handle>
|
|
193
186
|
</View>
|
|
194
187
|
);
|
|
195
188
|
}
|
|
196
|
-
const openMore = () => {
|
|
197
|
-
const box = more.current;
|
|
198
|
-
if (!box) return;
|
|
199
|
-
box.measureInWindow((x, y, width, height) =>
|
|
200
|
-
onMore(item.key, { x, y, width, height })
|
|
201
|
-
);
|
|
202
|
-
};
|
|
203
189
|
return (
|
|
204
190
|
<View
|
|
205
191
|
style={[
|
|
@@ -213,18 +199,6 @@ const Row = memo(function SectionRow({
|
|
|
213
199
|
{index > 0 && !lifted ? (
|
|
214
200
|
<View pointerEvents="none" style={s.line} />
|
|
215
201
|
) : null}
|
|
216
|
-
<Sortable.Handle>
|
|
217
|
-
<View
|
|
218
|
-
style={s.grip}
|
|
219
|
-
accessibilityElementsHidden
|
|
220
|
-
importantForAccessibility="no-hide-descendants"
|
|
221
|
-
>
|
|
222
|
-
<GripGlyph
|
|
223
|
-
color={lifted ? t.colors.title : t.colors.faint}
|
|
224
|
-
size={t.iconSize.md}
|
|
225
|
-
/>
|
|
226
|
-
</View>
|
|
227
|
-
</Sortable.Handle>
|
|
228
202
|
<PressableBase
|
|
229
203
|
onPress={() => onPress(item.key)}
|
|
230
204
|
accessibilityLabel={item.title}
|
|
@@ -241,10 +215,7 @@ const Row = memo(function SectionRow({
|
|
|
241
215
|
feedback="none"
|
|
242
216
|
style={s.main}
|
|
243
217
|
>
|
|
244
|
-
<View style={[s.thumb, hidden && s.faded]}>
|
|
245
|
-
{item.thumb}
|
|
246
|
-
<View pointerEvents="none" style={s.ring} />
|
|
247
|
-
</View>
|
|
218
|
+
<View style={[s.thumb, hidden && s.faded]}>{item.thumb}</View>
|
|
248
219
|
<View style={s.text}>
|
|
249
220
|
<Text weight="semibold" numberOfLines={1} style={hidden && s.faded}>
|
|
250
221
|
{item.title}
|
|
@@ -269,18 +240,28 @@ const Row = memo(function SectionRow({
|
|
|
269
240
|
<EyeOffGlyph color={t.colors.mutedForeground} size={t.iconSize.md} />
|
|
270
241
|
</View>
|
|
271
242
|
) : null}
|
|
272
|
-
<
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
243
|
+
<PressableBase
|
|
244
|
+
onPress={() => onMore(item.key, index)}
|
|
245
|
+
accessibilityLabel={moreLabel}
|
|
246
|
+
feedback="small"
|
|
247
|
+
style={s.icon}
|
|
248
|
+
>
|
|
249
|
+
<View style={s.turn}>
|
|
250
|
+
<MoreGlyph color={t.colors.mutedForeground} size={t.iconSize.md} />
|
|
251
|
+
</View>
|
|
252
|
+
</PressableBase>
|
|
253
|
+
<Sortable.Handle>
|
|
254
|
+
<View
|
|
255
|
+
style={s.grip}
|
|
256
|
+
accessibilityElementsHidden
|
|
257
|
+
importantForAccessibility="no-hide-descendants"
|
|
278
258
|
>
|
|
279
|
-
<
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
259
|
+
<GripGlyph
|
|
260
|
+
color={lifted ? t.colors.title : t.colors.faint}
|
|
261
|
+
size={t.iconSize.md}
|
|
262
|
+
/>
|
|
263
|
+
</View>
|
|
264
|
+
</Sortable.Handle>
|
|
284
265
|
</View>
|
|
285
266
|
);
|
|
286
267
|
});
|
|
@@ -300,6 +281,7 @@ export function SectionBoard({
|
|
|
300
281
|
const t = useTheme();
|
|
301
282
|
const s = useStyles();
|
|
302
283
|
const scroller = useAnimatedRef<Animated.ScrollView>();
|
|
284
|
+
const card = useRef<ComponentRef<typeof View>>(null);
|
|
303
285
|
const [lifted, setLifted] = useState<string | null>(null);
|
|
304
286
|
const live = useRef({ items, onPress, onMore, onReorder, bottomSpace });
|
|
305
287
|
live.current = { items, onPress, onMore, onReorder, bottomSpace };
|
|
@@ -311,8 +293,17 @@ export function SectionBoard({
|
|
|
311
293
|
|
|
312
294
|
const press = useCallback((key: string) => live.current.onPress(key), []);
|
|
313
295
|
const openMore = useCallback(
|
|
314
|
-
(key: string,
|
|
315
|
-
|
|
296
|
+
(key: string, index: number) =>
|
|
297
|
+
card.current?.measureInWindow((x, y, width) =>
|
|
298
|
+
live.current.onMore(key, {
|
|
299
|
+
x,
|
|
300
|
+
y: y + index * row,
|
|
301
|
+
width,
|
|
302
|
+
height: row,
|
|
303
|
+
pitch: row,
|
|
304
|
+
})
|
|
305
|
+
),
|
|
306
|
+
[row]
|
|
316
307
|
);
|
|
317
308
|
const move = useCallback((from: number, to: number) => {
|
|
318
309
|
const list = live.current.items;
|
|
@@ -348,7 +339,7 @@ export function SectionBoard({
|
|
|
348
339
|
<Animated.ScrollView
|
|
349
340
|
ref={scroller}
|
|
350
341
|
style={s.scroll}
|
|
351
|
-
contentContainerStyle={
|
|
342
|
+
contentContainerStyle={s.content}
|
|
352
343
|
scrollEventThrottle={16}
|
|
353
344
|
onScroll={(e) => {
|
|
354
345
|
offset.current = e.nativeEvent.contentOffset.y;
|
|
@@ -363,7 +354,11 @@ export function SectionBoard({
|
|
|
363
354
|
}}
|
|
364
355
|
>
|
|
365
356
|
{items.length ? (
|
|
366
|
-
<View
|
|
357
|
+
<View
|
|
358
|
+
ref={card}
|
|
359
|
+
collapsable={false}
|
|
360
|
+
style={[s.card, { paddingBottom: bottomSpace }]}
|
|
361
|
+
>
|
|
367
362
|
<Sortable.Grid
|
|
368
363
|
data={[...items]}
|
|
369
364
|
keyExtractor={(item) => item.key}
|
|
@@ -44,6 +44,7 @@ export type DesignPickTemplateProps<T extends string> = {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
const BAR_BORDER = 1;
|
|
47
|
+
const ROOMY = 3;
|
|
47
48
|
|
|
48
49
|
export function designPickBarSpace(bottomInset = 0): number {
|
|
49
50
|
const gap = tokens.space[2];
|
|
@@ -78,6 +79,10 @@ const useStyles = makeStyles((t) => ({
|
|
|
78
79
|
paddingHorizontal: t.space[3],
|
|
79
80
|
borderRadius: t.radius.full,
|
|
80
81
|
},
|
|
82
|
+
tight: {
|
|
83
|
+
minWidth: t.space[10],
|
|
84
|
+
paddingHorizontal: t.space[2],
|
|
85
|
+
},
|
|
81
86
|
thumb: {
|
|
82
87
|
position: 'absolute',
|
|
83
88
|
left: 0,
|
|
@@ -134,11 +139,13 @@ const useStyles = makeStyles((t) => ({
|
|
|
134
139
|
function Option({
|
|
135
140
|
label,
|
|
136
141
|
selected,
|
|
142
|
+
tight,
|
|
137
143
|
onPress,
|
|
138
144
|
onLayout,
|
|
139
145
|
}: {
|
|
140
146
|
label: string;
|
|
141
147
|
selected: boolean;
|
|
148
|
+
tight: boolean;
|
|
142
149
|
onPress: () => void;
|
|
143
150
|
onLayout: (event: LayoutChangeEvent) => void;
|
|
144
151
|
}) {
|
|
@@ -158,7 +165,7 @@ function Option({
|
|
|
158
165
|
feedback="none"
|
|
159
166
|
onPress={onPress}
|
|
160
167
|
onLayout={onLayout}
|
|
161
|
-
style={s.option}
|
|
168
|
+
style={[s.option, tight && s.tight]}
|
|
162
169
|
>
|
|
163
170
|
<SteadyText
|
|
164
171
|
selected={selected}
|
|
@@ -236,6 +243,7 @@ export function DesignPickTemplate<T extends string>({
|
|
|
236
243
|
key={option.value}
|
|
237
244
|
label={option.label}
|
|
238
245
|
selected={selected}
|
|
246
|
+
tight={options.length > ROOMY}
|
|
239
247
|
onPress={() => {
|
|
240
248
|
if (selected) return;
|
|
241
249
|
haptic('select');
|
|
@@ -109,18 +109,20 @@ export function IntroTemplate({
|
|
|
109
109
|
}
|
|
110
110
|
style={s.pager}
|
|
111
111
|
>
|
|
112
|
-
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
112
|
+
{width
|
|
113
|
+
? pages.map((page) => (
|
|
114
|
+
<View key={page.key} style={[s.page, { width }]}>
|
|
115
|
+
{page.art(art)}
|
|
116
|
+
<Text
|
|
117
|
+
variant="screenTitle"
|
|
118
|
+
accessibilityRole="header"
|
|
119
|
+
style={s.title}
|
|
120
|
+
>
|
|
121
|
+
{page.title}
|
|
122
|
+
</Text>
|
|
123
|
+
</View>
|
|
124
|
+
))
|
|
125
|
+
: null}
|
|
124
126
|
</ScrollView>
|
|
125
127
|
<View
|
|
126
128
|
style={[
|
|
@@ -34,6 +34,7 @@ export type ResultTemplateProps = {
|
|
|
34
34
|
index: number;
|
|
35
35
|
onIndexChange: (index: number) => void;
|
|
36
36
|
progress?: ReactNode;
|
|
37
|
+
tray?: ReactNode;
|
|
37
38
|
notice?: TemplateNotice;
|
|
38
39
|
primaryAction?: TemplateAction;
|
|
39
40
|
secondaryAction?: TemplateAction;
|
|
@@ -150,6 +151,7 @@ export function ResultTemplate({
|
|
|
150
151
|
index,
|
|
151
152
|
onIndexChange,
|
|
152
153
|
progress,
|
|
154
|
+
tray,
|
|
153
155
|
notice,
|
|
154
156
|
primaryAction,
|
|
155
157
|
secondaryAction,
|
|
@@ -235,6 +237,7 @@ export function ResultTemplate({
|
|
|
235
237
|
</>
|
|
236
238
|
)}
|
|
237
239
|
</View>
|
|
240
|
+
{tray ?? null}
|
|
238
241
|
{notice ? (
|
|
239
242
|
<View style={s.notice}>
|
|
240
243
|
<Notice notice={notice} />
|