@ezpg/app-ui 0.20.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 +37 -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/choice-art/choice-art.js +589 -0
- package/lib/module/blocks/choice-art/choice-art.js.map +1 -0
- package/lib/module/blocks/choice-art/index.js +4 -0
- package/lib/module/blocks/choice-art/index.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 +2 -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/page-header/page-header.js +25 -1
- package/lib/module/components/page-header/page-header.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/components/toast/index.js.map +1 -1
- package/lib/module/components/toast/toast.js +8 -4
- package/lib/module/components/toast/toast.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 +459 -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/index.js +1 -0
- package/lib/module/templates/index.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/preview-edit-template.js +422 -0
- package/lib/module/templates/preview-edit-template.js.map +1 -0
- 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/choice-art/choice-art.d.ts +73 -0
- package/lib/typescript/src/blocks/choice-art/choice-art.d.ts.map +1 -0
- package/lib/typescript/src/blocks/choice-art/index.d.ts +2 -0
- package/lib/typescript/src/blocks/choice-art/index.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 +2 -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/page-header/page-header.d.ts +1 -0
- package/lib/typescript/src/components/page-header/page-header.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/components/toast/index.d.ts +1 -1
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/toast.d.ts +4 -1
- package/lib/typescript/src/components/toast/toast.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 +13 -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/index.d.ts +2 -0
- package/lib/typescript/src/templates/index.d.ts.map +1 -1
- package/lib/typescript/src/templates/intro-template.d.ts.map +1 -1
- package/lib/typescript/src/templates/preview-edit-template.d.ts +39 -0
- package/lib/typescript/src/templates/preview-edit-template.d.ts.map +1 -0
- 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/choice-art/choice-art.tsx +500 -0
- package/src/blocks/choice-art/index.ts +29 -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 +2 -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/page-header/page-header.tsx +28 -1
- 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/components/toast/index.ts +1 -0
- package/src/components/toast/toast.tsx +12 -4
- package/src/index.tsx +13 -0
- package/src/internal/glyphs.tsx +411 -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/index.ts +7 -0
- package/src/templates/intro-template.tsx +14 -12
- package/src/templates/preview-edit-template.tsx +467 -0
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-template.d.ts","sourceRoot":"","sources":["../../../../src/templates/result-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAcjD,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,YAAS,CAAC;AAEjB,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,KAAK,SAAS,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAChD,CAAC;AAsGF,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,QAAe,EACf,QAAQ,EACR,KAAK,EACL,aAAa,EACb,QAAQ,EACR,MAAM,EACN,aAAa,EACb,eAAe,EACf,SAAmB,EACnB,UAAiB,EACjB,WAAe,EACf,YAAY,GACb,EAAE,mBAAmB,+
|
|
1
|
+
{"version":3,"file":"result-template.d.ts","sourceRoot":"","sources":["../../../../src/templates/result-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAcjD,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,YAAS,CAAC;AAEjB,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,KAAK,SAAS,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAChD,CAAC;AAsGF,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,QAAe,EACf,QAAQ,EACR,KAAK,EACL,aAAa,EACb,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,aAAa,EACb,eAAe,EACf,SAAmB,EACnB,UAAiB,EACjB,WAAe,EACf,YAAY,GACb,EAAE,mBAAmB,+BA8GrB"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { useRef, useState, type ComponentRef, type ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Platform,
|
|
4
|
+
Pressable,
|
|
5
|
+
ScrollView,
|
|
6
|
+
View,
|
|
7
|
+
type LayoutChangeEvent,
|
|
8
|
+
type NativeScrollEvent,
|
|
9
|
+
type NativeSyntheticEvent,
|
|
10
|
+
type StyleProp,
|
|
11
|
+
type ViewStyle,
|
|
12
|
+
} from 'react-native';
|
|
13
|
+
import { Text } from '../components/text/text';
|
|
14
|
+
import { useTheme } from '../theme/theme-provider';
|
|
15
|
+
import { makeStyles } from '../utils/styles';
|
|
16
|
+
import { AxisTabs } from './axis-tabs';
|
|
17
|
+
import { AxisWheel, type AxisLevel } from './axis-wheel';
|
|
18
|
+
|
|
19
|
+
export type AxisLevels = Readonly<Record<string, AxisLevel>>;
|
|
20
|
+
|
|
21
|
+
export type AxisAdjustItem = {
|
|
22
|
+
key: string;
|
|
23
|
+
label: string;
|
|
24
|
+
title: string;
|
|
25
|
+
startLabel: string;
|
|
26
|
+
endLabel: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type AxisAdjustProps = {
|
|
30
|
+
items: readonly AxisAdjustItem[];
|
|
31
|
+
levels: AxisLevels;
|
|
32
|
+
onChange: (key: string, level: AxisLevel) => void;
|
|
33
|
+
renderPreview: (
|
|
34
|
+
key: string | null,
|
|
35
|
+
levels: AxisLevels,
|
|
36
|
+
size: { width: number; height: number }
|
|
37
|
+
) => ReactNode;
|
|
38
|
+
wholeLabel?: string;
|
|
39
|
+
centerLabel?: string;
|
|
40
|
+
style?: StyleProp<ViewStyle>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const PEEK = 38;
|
|
44
|
+
const LOCK = 700;
|
|
45
|
+
const TITLE_SIZE = 22;
|
|
46
|
+
const TITLE_LEADING = 30;
|
|
47
|
+
const TITLE_TRACKING = -0.7;
|
|
48
|
+
|
|
49
|
+
const useStyles = makeStyles((t) => ({
|
|
50
|
+
root: { flex: 1, marginHorizontal: -t.layout.screenX },
|
|
51
|
+
title: {
|
|
52
|
+
paddingHorizontal: t.layout.screenX,
|
|
53
|
+
paddingBottom: t.space[4],
|
|
54
|
+
fontSize: TITLE_SIZE,
|
|
55
|
+
lineHeight: TITLE_LEADING,
|
|
56
|
+
letterSpacing: TITLE_TRACKING,
|
|
57
|
+
fontWeight: '600',
|
|
58
|
+
color: t.colors.title,
|
|
59
|
+
},
|
|
60
|
+
rail: { flex: 1, minHeight: 0 },
|
|
61
|
+
pager: { flexGrow: 0 },
|
|
62
|
+
card: {
|
|
63
|
+
overflow: 'hidden',
|
|
64
|
+
borderRadius: t.radius.xl,
|
|
65
|
+
backgroundColor: t.colors.surface,
|
|
66
|
+
boxShadow: t.shadow.liftSm,
|
|
67
|
+
},
|
|
68
|
+
wheel: { marginTop: t.space[6] },
|
|
69
|
+
tabs: { marginTop: t.space[4], marginBottom: t.space[2] },
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
const snap = (
|
|
73
|
+
Platform.OS === 'web'
|
|
74
|
+
? { scrollSnapType: 'x mandatory', scrollPaddingLeft: 20 }
|
|
75
|
+
: null
|
|
76
|
+
) as ViewStyle | null;
|
|
77
|
+
|
|
78
|
+
const snapped = (
|
|
79
|
+
Platform.OS === 'web' ? { scrollSnapAlign: 'start' } : null
|
|
80
|
+
) as ViewStyle | null;
|
|
81
|
+
|
|
82
|
+
export function AxisAdjust({
|
|
83
|
+
items,
|
|
84
|
+
levels,
|
|
85
|
+
onChange,
|
|
86
|
+
renderPreview,
|
|
87
|
+
wholeLabel = '전체',
|
|
88
|
+
centerLabel,
|
|
89
|
+
style,
|
|
90
|
+
}: AxisAdjustProps) {
|
|
91
|
+
const t = useTheme();
|
|
92
|
+
const s = useStyles();
|
|
93
|
+
const scroll = useRef<ComponentRef<typeof ScrollView>>(null);
|
|
94
|
+
const lock = useRef(0);
|
|
95
|
+
const [size, setSize] = useState({ width: 0, height: 0 });
|
|
96
|
+
const [selected, setSelected] = useState(items[0]?.key ?? '');
|
|
97
|
+
const [whole, setWhole] = useState(false);
|
|
98
|
+
const [plain, setPlain] = useState(false);
|
|
99
|
+
const item = items.find((i) => i.key === selected) ?? items[0];
|
|
100
|
+
if (!item) return null;
|
|
101
|
+
const gap = t.space[3];
|
|
102
|
+
const card = Math.max(0, size.width - t.layout.screenX - gap - PEEK - 8);
|
|
103
|
+
const step = card + gap;
|
|
104
|
+
const pages: readonly (string | null)[] = [...items.map((i) => i.key), null];
|
|
105
|
+
const neutral = Object.fromEntries(
|
|
106
|
+
items.map((i) => [i.key, 0])
|
|
107
|
+
) as AxisLevels;
|
|
108
|
+
|
|
109
|
+
const select = (key: string) => {
|
|
110
|
+
const index = items.findIndex((i) => i.key === key);
|
|
111
|
+
setSelected(key);
|
|
112
|
+
setWhole(false);
|
|
113
|
+
lock.current = Date.now() + LOCK;
|
|
114
|
+
scroll.current?.scrollTo({ x: index * step, animated: true });
|
|
115
|
+
};
|
|
116
|
+
const follow = (e: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
117
|
+
if (!step || Date.now() < lock.current) return;
|
|
118
|
+
const { contentOffset, contentSize, layoutMeasurement } = e.nativeEvent;
|
|
119
|
+
const last =
|
|
120
|
+
contentOffset.x + layoutMeasurement.width >= contentSize.width - 4;
|
|
121
|
+
const index = last
|
|
122
|
+
? pages.length - 1
|
|
123
|
+
: Math.min(pages.length - 1, Math.round(contentOffset.x / step));
|
|
124
|
+
const key = pages[index];
|
|
125
|
+
if (key === null) {
|
|
126
|
+
setWhole(true);
|
|
127
|
+
} else if (key !== undefined) {
|
|
128
|
+
setWhole(false);
|
|
129
|
+
setSelected(key);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
<View style={[s.root, style]}>
|
|
135
|
+
<Text accessibilityRole="header" numberOfLines={1} style={s.title}>
|
|
136
|
+
{item.title}
|
|
137
|
+
</Text>
|
|
138
|
+
<View
|
|
139
|
+
style={s.rail}
|
|
140
|
+
onLayout={(e: LayoutChangeEvent) => {
|
|
141
|
+
const { width, height } = e.nativeEvent.layout;
|
|
142
|
+
setSize({ width, height });
|
|
143
|
+
}}
|
|
144
|
+
>
|
|
145
|
+
{card > 0 && size.height > 0 ? (
|
|
146
|
+
<ScrollView
|
|
147
|
+
ref={scroll}
|
|
148
|
+
horizontal
|
|
149
|
+
showsHorizontalScrollIndicator={false}
|
|
150
|
+
snapToInterval={step}
|
|
151
|
+
decelerationRate="fast"
|
|
152
|
+
scrollEventThrottle={16}
|
|
153
|
+
onScroll={follow}
|
|
154
|
+
contentContainerStyle={{
|
|
155
|
+
gap,
|
|
156
|
+
paddingHorizontal: t.layout.screenX,
|
|
157
|
+
}}
|
|
158
|
+
style={[s.pager, { height: size.height }, snap]}
|
|
159
|
+
>
|
|
160
|
+
{pages.map((key) => (
|
|
161
|
+
<Pressable
|
|
162
|
+
key={key ?? 'whole'}
|
|
163
|
+
onLongPress={() => setPlain(true)}
|
|
164
|
+
onPressOut={() => setPlain(false)}
|
|
165
|
+
accessibilityLabel={
|
|
166
|
+
items.find((i) => i.key === key)?.label ?? wholeLabel
|
|
167
|
+
}
|
|
168
|
+
style={[
|
|
169
|
+
s.card,
|
|
170
|
+
{ width: card, height: size.height - t.space[1] },
|
|
171
|
+
snapped,
|
|
172
|
+
]}
|
|
173
|
+
>
|
|
174
|
+
{renderPreview(key, plain ? neutral : levels, {
|
|
175
|
+
width: card,
|
|
176
|
+
height: size.height - t.space[1],
|
|
177
|
+
})}
|
|
178
|
+
</Pressable>
|
|
179
|
+
))}
|
|
180
|
+
</ScrollView>
|
|
181
|
+
) : null}
|
|
182
|
+
</View>
|
|
183
|
+
<AxisWheel
|
|
184
|
+
key={item.key}
|
|
185
|
+
level={levels[item.key] ?? 0}
|
|
186
|
+
onChange={(level) => onChange(item.key, level)}
|
|
187
|
+
startLabel={item.startLabel}
|
|
188
|
+
endLabel={item.endLabel}
|
|
189
|
+
centerLabel={centerLabel}
|
|
190
|
+
nudge={item.key === items[0]?.key}
|
|
191
|
+
accessibilityLabel={item.label}
|
|
192
|
+
style={s.wheel}
|
|
193
|
+
/>
|
|
194
|
+
<AxisTabs
|
|
195
|
+
items={items.map((i) => ({
|
|
196
|
+
key: i.key,
|
|
197
|
+
label: i.label,
|
|
198
|
+
changed: (levels[i.key] ?? 0) !== 0,
|
|
199
|
+
}))}
|
|
200
|
+
selected={whole ? null : item.key}
|
|
201
|
+
onSelect={select}
|
|
202
|
+
style={s.tabs}
|
|
203
|
+
/>
|
|
204
|
+
</View>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { View, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import { Text } from '../components/text/text';
|
|
3
|
+
import { PressableBase } from '../internal/pressable-base';
|
|
4
|
+
import { useTheme } from '../theme/theme-provider';
|
|
5
|
+
import { makeStyles } from '../utils/styles';
|
|
6
|
+
|
|
7
|
+
export type AxisTab = { key: string; label: string; changed?: boolean };
|
|
8
|
+
|
|
9
|
+
export type AxisTabsProps = {
|
|
10
|
+
items: readonly AxisTab[];
|
|
11
|
+
selected: string | null;
|
|
12
|
+
onSelect: (key: string) => void;
|
|
13
|
+
style?: StyleProp<ViewStyle>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const AXIS_TAB_SIZE = 62;
|
|
17
|
+
|
|
18
|
+
const DOT = 4;
|
|
19
|
+
|
|
20
|
+
const useStyles = makeStyles((t) => ({
|
|
21
|
+
root: {
|
|
22
|
+
flexDirection: 'row',
|
|
23
|
+
justifyContent: 'space-between',
|
|
24
|
+
paddingHorizontal: t.space[4],
|
|
25
|
+
},
|
|
26
|
+
tab: {
|
|
27
|
+
width: AXIS_TAB_SIZE,
|
|
28
|
+
height: AXIS_TAB_SIZE,
|
|
29
|
+
borderRadius: AXIS_TAB_SIZE / 2,
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
justifyContent: 'center',
|
|
32
|
+
backgroundColor: t.colors.recess,
|
|
33
|
+
},
|
|
34
|
+
on: { backgroundColor: t.colors.raised, boxShadow: t.shadow.lift },
|
|
35
|
+
label: { letterSpacing: -0.5 },
|
|
36
|
+
dot: {
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
bottom: t.space[2],
|
|
39
|
+
width: DOT,
|
|
40
|
+
height: DOT,
|
|
41
|
+
borderRadius: DOT / 2,
|
|
42
|
+
backgroundColor: t.colors.arc,
|
|
43
|
+
},
|
|
44
|
+
dotOn: { backgroundColor: t.colors.primary },
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
export function AxisTabs({ items, selected, onSelect, style }: AxisTabsProps) {
|
|
48
|
+
const t = useTheme();
|
|
49
|
+
const s = useStyles();
|
|
50
|
+
return (
|
|
51
|
+
<View accessibilityRole="tablist" style={[s.root, style]}>
|
|
52
|
+
{items.map((item) => {
|
|
53
|
+
const on = item.key === selected;
|
|
54
|
+
return (
|
|
55
|
+
<PressableBase
|
|
56
|
+
key={item.key}
|
|
57
|
+
onPress={() => onSelect(item.key)}
|
|
58
|
+
accessibilityRole="tab"
|
|
59
|
+
accessibilityLabel={item.label}
|
|
60
|
+
accessibilityState={{ selected: on }}
|
|
61
|
+
style={[s.tab, on && s.on]}
|
|
62
|
+
>
|
|
63
|
+
<Text
|
|
64
|
+
variant="body"
|
|
65
|
+
weight={on ? 'semibold' : 'medium'}
|
|
66
|
+
numberOfLines={1}
|
|
67
|
+
maxFontSizeMultiplier={1}
|
|
68
|
+
style={[
|
|
69
|
+
s.label,
|
|
70
|
+
{ color: on ? t.colors.title : t.colors.mutedForeground },
|
|
71
|
+
]}
|
|
72
|
+
>
|
|
73
|
+
{item.label}
|
|
74
|
+
</Text>
|
|
75
|
+
{item.changed ? <View style={[s.dot, on && s.dotOn]} /> : null}
|
|
76
|
+
</PressableBase>
|
|
77
|
+
);
|
|
78
|
+
})}
|
|
79
|
+
</View>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
PanResponder,
|
|
4
|
+
Platform,
|
|
5
|
+
View,
|
|
6
|
+
type LayoutChangeEvent,
|
|
7
|
+
type StyleProp,
|
|
8
|
+
type ViewStyle,
|
|
9
|
+
} from 'react-native';
|
|
10
|
+
import Svg, { Line } from 'react-native-svg';
|
|
11
|
+
import { Text } from '../components/text/text';
|
|
12
|
+
import { PressableBase } from '../internal/pressable-base';
|
|
13
|
+
import { useReducedMotion } from '../internal/use-reduced-motion';
|
|
14
|
+
import { useTheme } from '../theme/theme-provider';
|
|
15
|
+
import { makeStyles } from '../utils/styles';
|
|
16
|
+
import { clamp } from './hsl';
|
|
17
|
+
|
|
18
|
+
export type AxisLevel = -1 | 0 | 1;
|
|
19
|
+
|
|
20
|
+
export type AxisWheelProps = {
|
|
21
|
+
level: AxisLevel;
|
|
22
|
+
onChange: (level: AxisLevel) => void;
|
|
23
|
+
startLabel: string;
|
|
24
|
+
endLabel: string;
|
|
25
|
+
centerLabel?: string;
|
|
26
|
+
nudge?: boolean;
|
|
27
|
+
accessibilityLabel: string;
|
|
28
|
+
style?: StyleProp<ViewStyle>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const AXIS_WHEEL_HEIGHT = 112;
|
|
32
|
+
|
|
33
|
+
const HEIGHT = 96;
|
|
34
|
+
const TOP = AXIS_WHEEL_HEIGHT - HEIGHT;
|
|
35
|
+
const STOP = 40;
|
|
36
|
+
const UNIT = 4;
|
|
37
|
+
const GAP = 13;
|
|
38
|
+
const BEND = 0.72;
|
|
39
|
+
const SIDE = 52;
|
|
40
|
+
const TICK = 2.2;
|
|
41
|
+
const STOP_TICK = 3;
|
|
42
|
+
const NEEDLE = 3;
|
|
43
|
+
const EDGE = 0.34;
|
|
44
|
+
const REST = 0.94;
|
|
45
|
+
const SHORT = 0.84;
|
|
46
|
+
const DIM = 0.72;
|
|
47
|
+
const OUT = 0.36;
|
|
48
|
+
const TAP = 5;
|
|
49
|
+
const TWICE = 320;
|
|
50
|
+
const EASE = 280;
|
|
51
|
+
const FLING = 90;
|
|
52
|
+
const NUDGE_AT = 600;
|
|
53
|
+
const NUDGE_FOR = 1300;
|
|
54
|
+
const NUDGE_BY = 6;
|
|
55
|
+
|
|
56
|
+
const rad = (deg: number) => (deg * Math.PI) / 180;
|
|
57
|
+
|
|
58
|
+
const levelAt = (position: number): AxisLevel => {
|
|
59
|
+
const step = clamp(Math.round(position / STOP), -1, 1);
|
|
60
|
+
return step < 0 ? -1 : step > 0 ? 1 : 0;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const useStyles = makeStyles((t) => ({
|
|
64
|
+
root: { height: AXIS_WHEEL_HEIGHT },
|
|
65
|
+
stage: {
|
|
66
|
+
position: 'absolute',
|
|
67
|
+
left: 0,
|
|
68
|
+
right: 0,
|
|
69
|
+
top: TOP,
|
|
70
|
+
height: HEIGHT,
|
|
71
|
+
overflow: 'hidden',
|
|
72
|
+
},
|
|
73
|
+
ends: {
|
|
74
|
+
position: 'absolute',
|
|
75
|
+
left: t.layout.screenX - t.space[2],
|
|
76
|
+
right: t.layout.screenX - t.space[2],
|
|
77
|
+
top: -t.space[3],
|
|
78
|
+
flexDirection: 'row',
|
|
79
|
+
justifyContent: 'space-between',
|
|
80
|
+
},
|
|
81
|
+
end: {
|
|
82
|
+
height: t.controlSize.sm,
|
|
83
|
+
paddingHorizontal: t.space[2],
|
|
84
|
+
justifyContent: 'center',
|
|
85
|
+
},
|
|
86
|
+
}));
|
|
87
|
+
|
|
88
|
+
const noScroll = (
|
|
89
|
+
Platform.OS === 'web' ? { touchAction: 'none', cursor: 'grab' } : null
|
|
90
|
+
) as ViewStyle | null;
|
|
91
|
+
|
|
92
|
+
export function AxisWheel({
|
|
93
|
+
level,
|
|
94
|
+
onChange,
|
|
95
|
+
startLabel,
|
|
96
|
+
endLabel,
|
|
97
|
+
centerLabel = '중간',
|
|
98
|
+
nudge = false,
|
|
99
|
+
accessibilityLabel,
|
|
100
|
+
style,
|
|
101
|
+
}: AxisWheelProps) {
|
|
102
|
+
const t = useTheme();
|
|
103
|
+
const s = useStyles();
|
|
104
|
+
const reduced = useReducedMotion();
|
|
105
|
+
const [width, setWidth] = useState(0);
|
|
106
|
+
const [held, setHeld] = useState(false);
|
|
107
|
+
const [position, setPosition] = useState(level * STOP);
|
|
108
|
+
const at = useRef(position);
|
|
109
|
+
const frame = useRef(0);
|
|
110
|
+
const touched = useRef(false);
|
|
111
|
+
const tapped = useRef(0);
|
|
112
|
+
const latest = useRef({ level, onChange, width });
|
|
113
|
+
latest.current = { level, onChange, width };
|
|
114
|
+
|
|
115
|
+
const move = (next: number) => {
|
|
116
|
+
at.current = next;
|
|
117
|
+
setPosition(next);
|
|
118
|
+
};
|
|
119
|
+
const ease = (to: number) => {
|
|
120
|
+
cancelAnimationFrame(frame.current);
|
|
121
|
+
const from = at.current;
|
|
122
|
+
const started = Date.now();
|
|
123
|
+
const run = () => {
|
|
124
|
+
const k = Math.min(1, (Date.now() - started) / EASE);
|
|
125
|
+
move(from + (to - from) * (1 - Math.pow(1 - k, 3)));
|
|
126
|
+
if (k < 1) frame.current = requestAnimationFrame(run);
|
|
127
|
+
};
|
|
128
|
+
run();
|
|
129
|
+
};
|
|
130
|
+
const tell = (next: AxisLevel) => {
|
|
131
|
+
if (next !== latest.current.level) latest.current.onChange(next);
|
|
132
|
+
};
|
|
133
|
+
const go = (next: AxisLevel) => {
|
|
134
|
+
touched.current = true;
|
|
135
|
+
tell(next);
|
|
136
|
+
ease(next * STOP);
|
|
137
|
+
};
|
|
138
|
+
const actions = useRef({ move, ease, tell, go });
|
|
139
|
+
actions.current = { move, ease, tell, go };
|
|
140
|
+
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
if (levelAt(at.current) === level) return;
|
|
143
|
+
if (reduced) {
|
|
144
|
+
actions.current.move(level * STOP);
|
|
145
|
+
} else {
|
|
146
|
+
actions.current.ease(level * STOP);
|
|
147
|
+
}
|
|
148
|
+
}, [level, reduced]);
|
|
149
|
+
|
|
150
|
+
useEffect(() => {
|
|
151
|
+
if (!nudge || reduced) return undefined;
|
|
152
|
+
let started = 0;
|
|
153
|
+
const run = () => {
|
|
154
|
+
if (touched.current) return;
|
|
155
|
+
const k = Math.min(1, (Date.now() - started) / NUDGE_FOR);
|
|
156
|
+
const base = latest.current.level * STOP;
|
|
157
|
+
actions.current.move(
|
|
158
|
+
base + Math.sin(k * Math.PI * 2) * NUDGE_BY * (1 - k)
|
|
159
|
+
);
|
|
160
|
+
if (k < 1) frame.current = requestAnimationFrame(run);
|
|
161
|
+
};
|
|
162
|
+
const timer = setTimeout(() => {
|
|
163
|
+
started = Date.now();
|
|
164
|
+
run();
|
|
165
|
+
}, NUDGE_AT);
|
|
166
|
+
return () => clearTimeout(timer);
|
|
167
|
+
}, [nudge, reduced]);
|
|
168
|
+
|
|
169
|
+
useEffect(() => () => cancelAnimationFrame(frame.current), []);
|
|
170
|
+
|
|
171
|
+
const pan = useMemo(() => {
|
|
172
|
+
let from = 0;
|
|
173
|
+
let left = 0;
|
|
174
|
+
const perUnit = GAP / UNIT;
|
|
175
|
+
return PanResponder.create({
|
|
176
|
+
onStartShouldSetPanResponder: () => true,
|
|
177
|
+
onMoveShouldSetPanResponder: (_, g) => Math.abs(g.dx) > Math.abs(g.dy),
|
|
178
|
+
onPanResponderTerminationRequest: () => false,
|
|
179
|
+
onPanResponderGrant: (e) => {
|
|
180
|
+
cancelAnimationFrame(frame.current);
|
|
181
|
+
touched.current = true;
|
|
182
|
+
from = at.current;
|
|
183
|
+
left = e.nativeEvent.locationX;
|
|
184
|
+
setHeld(true);
|
|
185
|
+
},
|
|
186
|
+
onPanResponderMove: (_, g) => {
|
|
187
|
+
const raw = from - g.dx / perUnit;
|
|
188
|
+
const soft =
|
|
189
|
+
raw > STOP
|
|
190
|
+
? STOP + (raw - STOP) * 0.3
|
|
191
|
+
: raw < -STOP
|
|
192
|
+
? -STOP + (raw + STOP) * 0.3
|
|
193
|
+
: raw;
|
|
194
|
+
actions.current.move(soft);
|
|
195
|
+
actions.current.tell(levelAt(soft));
|
|
196
|
+
},
|
|
197
|
+
onPanResponderRelease: (_, g) => {
|
|
198
|
+
setHeld(false);
|
|
199
|
+
if (Math.abs(g.dx) < TAP && Math.abs(g.dy) < TAP) {
|
|
200
|
+
const now = Date.now();
|
|
201
|
+
const twice = now - tapped.current < TWICE;
|
|
202
|
+
tapped.current = twice ? 0 : now;
|
|
203
|
+
const side = left / Math.max(1, latest.current.width) - 0.5;
|
|
204
|
+
const step = Math.abs(side) > 0.14 ? Math.sign(side) : 0;
|
|
205
|
+
const base = twice && !step ? 0 : levelAt(at.current) + step;
|
|
206
|
+
actions.current.go(levelAt(base * STOP));
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
actions.current.go(levelAt(at.current - (g.vx * FLING) / perUnit));
|
|
210
|
+
},
|
|
211
|
+
onPanResponderTerminate: () => {
|
|
212
|
+
setHeld(false);
|
|
213
|
+
actions.current.go(levelAt(at.current));
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
}, []);
|
|
217
|
+
|
|
218
|
+
const lines = [];
|
|
219
|
+
if (width > 0) {
|
|
220
|
+
const mid = width / 2;
|
|
221
|
+
const r = width * BEND;
|
|
222
|
+
const turn = (GAP * 180) / (Math.PI * r * UNIT);
|
|
223
|
+
const tall = (HEIGHT / 2 - 3) * (held ? 1 : REST);
|
|
224
|
+
const span = Math.ceil(SIDE / turn / UNIT) * UNIT;
|
|
225
|
+
const first = UNIT * Math.round(position / UNIT);
|
|
226
|
+
for (let n = first - span; n <= first + span; n += UNIT) {
|
|
227
|
+
const x = mid + r * Math.sin(rad((n - position) * turn));
|
|
228
|
+
if (x < -6 || x > width + 6 || Math.abs(x - mid) < GAP * 0.42) continue;
|
|
229
|
+
const u = Math.min(1, Math.abs(x - mid) / mid);
|
|
230
|
+
const stop = n === 0 || Math.abs(n) === STOP;
|
|
231
|
+
const env = tall * (1 - (1 - EDGE) * u * u) * (stop ? 1 : SHORT);
|
|
232
|
+
const inside = Math.abs(n) <= STOP ? 1 : OUT;
|
|
233
|
+
lines.push(
|
|
234
|
+
<Line
|
|
235
|
+
key={n}
|
|
236
|
+
x1={x}
|
|
237
|
+
x2={x}
|
|
238
|
+
y1={HEIGHT / 2 - env}
|
|
239
|
+
y2={HEIGHT / 2 + env}
|
|
240
|
+
stroke={t.colors.title}
|
|
241
|
+
strokeOpacity={(1 - DIM * Math.pow(u, 1.5)) * inside * 0.9}
|
|
242
|
+
strokeWidth={stop ? STOP_TICK : TICK}
|
|
243
|
+
strokeLinecap="round"
|
|
244
|
+
/>
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const word = level < 0 ? startLabel : level > 0 ? endLabel : centerLabel;
|
|
249
|
+
|
|
250
|
+
return (
|
|
251
|
+
<View
|
|
252
|
+
style={[s.root, style]}
|
|
253
|
+
onLayout={(e: LayoutChangeEvent) => setWidth(e.nativeEvent.layout.width)}
|
|
254
|
+
>
|
|
255
|
+
<View
|
|
256
|
+
{...pan.panHandlers}
|
|
257
|
+
accessible
|
|
258
|
+
accessibilityRole="adjustable"
|
|
259
|
+
accessibilityLabel={accessibilityLabel}
|
|
260
|
+
accessibilityValue={{ min: -1, max: 1, now: level, text: word }}
|
|
261
|
+
accessibilityActions={[{ name: 'increment' }, { name: 'decrement' }]}
|
|
262
|
+
onAccessibilityAction={(e) =>
|
|
263
|
+
go(
|
|
264
|
+
levelAt(
|
|
265
|
+
(level + (e.nativeEvent.actionName === 'increment' ? 1 : -1)) *
|
|
266
|
+
STOP
|
|
267
|
+
)
|
|
268
|
+
)
|
|
269
|
+
}
|
|
270
|
+
style={[s.stage, noScroll]}
|
|
271
|
+
>
|
|
272
|
+
{width > 0 ? (
|
|
273
|
+
<Svg width={width} height={HEIGHT} pointerEvents="none">
|
|
274
|
+
{lines}
|
|
275
|
+
<Line
|
|
276
|
+
x1={width / 2}
|
|
277
|
+
x2={width / 2}
|
|
278
|
+
y1={NEEDLE / 2}
|
|
279
|
+
y2={HEIGHT - NEEDLE / 2}
|
|
280
|
+
stroke={t.colors.primary}
|
|
281
|
+
strokeWidth={held ? NEEDLE + 0.8 : NEEDLE}
|
|
282
|
+
strokeLinecap="round"
|
|
283
|
+
/>
|
|
284
|
+
</Svg>
|
|
285
|
+
) : null}
|
|
286
|
+
</View>
|
|
287
|
+
<View style={s.ends} pointerEvents="box-none">
|
|
288
|
+
{([-1, 1] as const).map((side) => (
|
|
289
|
+
<PressableBase
|
|
290
|
+
key={side}
|
|
291
|
+
onPress={() => go(side)}
|
|
292
|
+
accessibilityState={{ selected: level === side }}
|
|
293
|
+
style={s.end}
|
|
294
|
+
>
|
|
295
|
+
<Text
|
|
296
|
+
variant="bodyLg"
|
|
297
|
+
weight={level === side ? 'semibold' : 'medium'}
|
|
298
|
+
style={{
|
|
299
|
+
color: level === side ? t.colors.title : t.colors.faint,
|
|
300
|
+
}}
|
|
301
|
+
>
|
|
302
|
+
{side < 0 ? startLabel : endLabel}
|
|
303
|
+
</Text>
|
|
304
|
+
</PressableBase>
|
|
305
|
+
))}
|
|
306
|
+
</View>
|
|
307
|
+
</View>
|
|
308
|
+
);
|
|
309
|
+
}
|
package/src/adjust/index.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
export { AdjustTemplate, type AdjustTemplateProps } from './adjust-template';
|
|
2
|
+
export {
|
|
3
|
+
AxisAdjust,
|
|
4
|
+
type AxisAdjustItem,
|
|
5
|
+
type AxisAdjustProps,
|
|
6
|
+
type AxisLevels,
|
|
7
|
+
} from './axis-adjust';
|
|
2
8
|
export { AxisDial, type AxisDialProps } from './axis-dial';
|
|
3
9
|
export {
|
|
4
10
|
AxisDialGroup,
|
|
5
11
|
type AxisDialGroupItem,
|
|
6
12
|
type AxisDialGroupProps,
|
|
7
13
|
} from './axis-dial-group';
|
|
14
|
+
export { AxisTabs, type AxisTab, type AxisTabsProps } from './axis-tabs';
|
|
15
|
+
export { AxisWheel, type AxisLevel, type AxisWheelProps } from './axis-wheel';
|
|
8
16
|
export {
|
|
9
17
|
ColorAdjustNote,
|
|
10
18
|
type ColorAdjustNoteProps,
|
|
@@ -29,4 +37,11 @@ export {
|
|
|
29
37
|
type FontLevel,
|
|
30
38
|
} from './font-controls';
|
|
31
39
|
export { ScrubRuler, type ScrubRulerProps } from './scrub-ruler';
|
|
40
|
+
export {
|
|
41
|
+
StoreSample,
|
|
42
|
+
type StoreSampleCopy,
|
|
43
|
+
type StoreSampleLook,
|
|
44
|
+
type StoreSampleProps,
|
|
45
|
+
type StoreSampleScene,
|
|
46
|
+
} from './store-sample';
|
|
32
47
|
export { hexToHsl, hslToHex } from './hsl';
|