@ezpg/app-ui 0.21.0 → 0.23.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 +29 -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-dial.js +2 -2
- package/lib/module/adjust/axis-dial.js.map +1 -1
- 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/dial-strip.js +6 -4
- package/lib/module/adjust/dial-strip.js.map +1 -1
- 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/chat-message/chat-message.js +1 -0
- package/lib/module/blocks/chat-message/chat-message.js.map +1 -1
- package/lib/module/blocks/choice-art/choice-art.js +2 -0
- package/lib/module/blocks/choice-art/choice-art.js.map +1 -1
- package/lib/module/blocks/color-swatch-picker/color-swatch-picker.js +1 -1
- package/lib/module/blocks/color-tune/store-sample.js +13 -6
- package/lib/module/blocks/color-tune/store-sample.js.map +1 -1
- package/lib/module/blocks/color-tune/swatch-card.js +1 -1
- package/lib/module/blocks/color-tune/swatch-card.js.map +1 -1
- package/lib/module/blocks/detail-editor/compare-slider.js +6 -2
- package/lib/module/blocks/detail-editor/compare-slider.js.map +1 -1
- package/lib/module/blocks/detail-editor/detail-canvas.js +195 -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 +195 -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 +73 -0
- package/lib/module/blocks/detail-studio/action-chips.js.map +1 -0
- package/lib/module/blocks/detail-studio/adjust-tiles.js +4 -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 +9 -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 +4 -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 +20 -8
- package/lib/module/blocks/detail-studio/text-format-panel.js.map +1 -1
- package/lib/module/blocks/draft-box/draft-box.js +3 -0
- package/lib/module/blocks/draft-box/draft-box.js.map +1 -1
- package/lib/module/blocks/index.js +1 -0
- package/lib/module/blocks/index.js.map +1 -1
- package/lib/module/blocks/oauth-buttons/oauth-buttons.js +1 -0
- package/lib/module/blocks/oauth-buttons/oauth-buttons.js.map +1 -1
- package/lib/module/blocks/order-block/order-block.js +19 -5
- package/lib/module/blocks/order-block/order-block.js.map +1 -1
- package/lib/module/blocks/product-tile/product-tile.js +4 -1
- package/lib/module/blocks/product-tile/product-tile.js.map +1 -1
- package/lib/module/blocks/question-accordion/question-accordion.js +1 -2
- package/lib/module/blocks/question-accordion/question-accordion.js.map +1 -1
- package/lib/module/blocks/question-pager/question-pager.js +2 -1
- package/lib/module/blocks/question-pager/question-pager.js.map +1 -1
- package/lib/module/blocks/review-card/review-card.js +4 -0
- package/lib/module/blocks/review-card/review-card.js.map +1 -1
- package/lib/module/blocks/send-bar/send-bar.js +1 -0
- package/lib/module/blocks/send-bar/send-bar.js.map +1 -1
- package/lib/module/blocks/stage-bar/stage-bar.js +3 -2
- package/lib/module/blocks/stage-bar/stage-bar.js.map +1 -1
- package/lib/module/blocks/stat-card/stat-card.js +4 -1
- package/lib/module/blocks/stat-card/stat-card.js.map +1 -1
- package/lib/module/blocks/step-screen/step-screen.js +5 -2
- package/lib/module/blocks/step-screen/step-screen.js.map +1 -1
- package/lib/module/blocks/store-top/store-top.js +8 -3
- package/lib/module/blocks/store-top/store-top.js.map +1 -1
- package/lib/module/blocks/summary-cards/summary-cards.js +10 -3
- package/lib/module/blocks/summary-cards/summary-cards.js.map +1 -1
- package/lib/module/blocks/task-tiles/task-tiles.js +3 -2
- package/lib/module/blocks/task-tiles/task-tiles.js.map +1 -1
- package/lib/module/components/amount-summary/amount-summary.js +7 -1
- package/lib/module/components/amount-summary/amount-summary.js.map +1 -1
- package/lib/module/components/button/button.js +19 -5
- package/lib/module/components/button/button.js.map +1 -1
- package/lib/module/components/calendar/calendar.js +7 -4
- package/lib/module/components/calendar/calendar.js.map +1 -1
- package/lib/module/components/chip/chip.js +7 -3
- 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/circle-grid/circle-grid.js +1 -0
- package/lib/module/components/circle-grid/circle-grid.js.map +1 -1
- package/lib/module/components/credit/credit.js +8 -4
- package/lib/module/components/credit/credit.js.map +1 -1
- package/lib/module/components/dialog/dialog.js +2 -0
- package/lib/module/components/dialog/dialog.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/empty-state/empty-state.js +1 -0
- package/lib/module/components/empty-state/empty-state.js.map +1 -1
- package/lib/module/components/fact-list/fact-list.js +1 -0
- package/lib/module/components/fact-list/fact-list.js.map +1 -1
- package/lib/module/components/field/field.js +4 -0
- package/lib/module/components/field/field.js.map +1 -1
- package/lib/module/components/filter-tabs/filter-tabs.js +2 -1
- package/lib/module/components/filter-tabs/filter-tabs.js.map +1 -1
- package/lib/module/components/list-row/list-row.js +23 -6
- package/lib/module/components/list-row/list-row.js.map +1 -1
- package/lib/module/components/page-header/page-header.js +1 -0
- package/lib/module/components/page-header/page-header.js.map +1 -1
- package/lib/module/components/pill/pill.js +1 -0
- package/lib/module/components/pill/pill.js.map +1 -1
- package/lib/module/components/segmented-control/segmented-control.js +5 -1
- package/lib/module/components/segmented-control/segmented-control.js.map +1 -1
- package/lib/module/components/segmented-tabs/segmented-tabs.js +3 -2
- package/lib/module/components/segmented-tabs/segmented-tabs.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/status-steps/status-steps.js +2 -0
- package/lib/module/components/status-steps/status-steps.js.map +1 -1
- package/lib/module/components/text/figures.js +82 -0
- package/lib/module/components/text/figures.js.map +1 -0
- package/lib/module/components/text/index.js +1 -0
- package/lib/module/components/text/index.js.map +1 -1
- package/lib/module/components/text/metrics.js +5 -0
- package/lib/module/components/text/metrics.js.map +1 -0
- package/lib/module/components/text/text.js +31 -2
- package/lib/module/components/text/text.js.map +1 -1
- package/lib/module/components/tile-grid/tile-grid.js +3 -2
- package/lib/module/components/tile-grid/tile-grid.js.map +1 -1
- package/lib/module/components/toast/toast.js +4 -1
- package/lib/module/components/toast/toast.js.map +1 -1
- package/lib/module/components/value-rows/value-rows.js +8 -1
- package/lib/module/components/value-rows/value-rows.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/field-label.js +2 -0
- package/lib/module/internal/field-label.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/roll-text.js +10 -2
- package/lib/module/internal/roll-text.js.map +1 -1
- package/lib/module/internal/sample-tiles.js +2 -0
- package/lib/module/internal/sample-tiles.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 +75 -89
- package/lib/module/sortable/section-board.js.map +1 -1
- package/lib/module/templates/design-pick-template.js +9 -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/preview-edit-template.js +3 -0
- package/lib/module/templates/preview-edit-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/module/templates/scroll-templates.js +12 -2
- package/lib/module/templates/scroll-templates.js.map +1 -1
- package/lib/module/templates/sheet-form-template.js +4 -0
- package/lib/module/templates/sheet-form-template.js.map +1 -1
- package/lib/module/theme/base.js +16 -9
- package/lib/module/theme/base.js.map +1 -1
- package/lib/module/theme/create-theme.js +6 -2
- package/lib/module/theme/create-theme.js.map +1 -1
- package/lib/module/theme/tokens.js +23 -2
- package/lib/module/theme/tokens.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/dial-strip.d.ts.map +1 -1
- 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/chat-message/chat-message.d.ts.map +1 -1
- package/lib/typescript/src/blocks/choice-art/choice-art.d.ts.map +1 -1
- package/lib/typescript/src/blocks/color-tune/store-sample.d.ts.map +1 -1
- 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/adjust-tiles.d.ts.map +1 -1
- 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/draft-box/draft-box.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/blocks/oauth-buttons/oauth-buttons.d.ts.map +1 -1
- package/lib/typescript/src/blocks/order-block/order-block.d.ts.map +1 -1
- package/lib/typescript/src/blocks/product-tile/product-tile.d.ts.map +1 -1
- package/lib/typescript/src/blocks/question-accordion/question-accordion.d.ts.map +1 -1
- package/lib/typescript/src/blocks/question-pager/question-pager.d.ts.map +1 -1
- package/lib/typescript/src/blocks/review-card/review-card.d.ts.map +1 -1
- package/lib/typescript/src/blocks/send-bar/send-bar.d.ts.map +1 -1
- package/lib/typescript/src/blocks/stage-bar/stage-bar.d.ts.map +1 -1
- package/lib/typescript/src/blocks/stat-card/stat-card.d.ts.map +1 -1
- package/lib/typescript/src/blocks/step-screen/step-screen.d.ts.map +1 -1
- package/lib/typescript/src/blocks/store-top/store-top.d.ts.map +1 -1
- package/lib/typescript/src/blocks/summary-cards/summary-cards.d.ts.map +1 -1
- package/lib/typescript/src/blocks/task-tiles/task-tiles.d.ts.map +1 -1
- package/lib/typescript/src/components/amount-summary/amount-summary.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/calendar/calendar.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/circle-grid/circle-grid.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/dialog/dialog.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/empty-state/empty-state.d.ts.map +1 -1
- package/lib/typescript/src/components/fact-list/fact-list.d.ts.map +1 -1
- package/lib/typescript/src/components/field/field.d.ts.map +1 -1
- package/lib/typescript/src/components/filter-tabs/filter-tabs.d.ts.map +1 -1
- package/lib/typescript/src/components/list-row/list-row.d.ts +3 -1
- package/lib/typescript/src/components/list-row/list-row.d.ts.map +1 -1
- package/lib/typescript/src/components/page-header/page-header.d.ts.map +1 -1
- package/lib/typescript/src/components/pill/pill.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/segmented-tabs/segmented-tabs.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/status-steps/status-steps.d.ts.map +1 -1
- package/lib/typescript/src/components/text/figures.d.ts +12 -0
- package/lib/typescript/src/components/text/figures.d.ts.map +1 -0
- package/lib/typescript/src/components/text/index.d.ts +1 -0
- package/lib/typescript/src/components/text/index.d.ts.map +1 -1
- package/lib/typescript/src/components/text/metrics.d.ts +6 -0
- package/lib/typescript/src/components/text/metrics.d.ts.map +1 -0
- package/lib/typescript/src/components/text/text.d.ts +2 -2
- package/lib/typescript/src/components/text/text.d.ts.map +1 -1
- package/lib/typescript/src/components/tile-grid/tile-grid.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/toast.d.ts.map +1 -1
- package/lib/typescript/src/components/value-rows/value-rows.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/field-label.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/roll-text.d.ts +3 -2
- package/lib/typescript/src/internal/roll-text.d.ts.map +1 -1
- package/lib/typescript/src/internal/sample-tiles.d.ts +2 -0
- package/lib/typescript/src/internal/sample-tiles.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/preview-edit-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/lib/typescript/src/templates/scroll-templates.d.ts.map +1 -1
- package/lib/typescript/src/templates/sheet-form-template.d.ts.map +1 -1
- package/lib/typescript/src/theme/base.d.ts +9 -2
- package/lib/typescript/src/theme/base.d.ts.map +1 -1
- package/lib/typescript/src/theme/create-theme.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens.d.ts +3 -1
- package/lib/typescript/src/theme/tokens.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +12 -0
- package/lib/typescript/src/types/index.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-dial.tsx +2 -2
- package/src/adjust/axis-tabs.tsx +81 -0
- package/src/adjust/axis-wheel.tsx +309 -0
- package/src/adjust/dial-strip.tsx +5 -3
- package/src/adjust/index.ts +15 -0
- package/src/adjust/store-sample.tsx +519 -0
- package/src/blocks/chat-message/chat-message.tsx +1 -0
- package/src/blocks/choice-art/choice-art.tsx +2 -0
- package/src/blocks/color-swatch-picker/color-swatch-picker.tsx +1 -1
- package/src/blocks/color-tune/store-sample.tsx +11 -6
- package/src/blocks/color-tune/swatch-card.tsx +1 -1
- package/src/blocks/detail-editor/compare-slider.tsx +4 -1
- package/src/blocks/detail-editor/detail-canvas.tsx +267 -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 +191 -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 +78 -0
- package/src/blocks/detail-studio/adjust-tiles.tsx +4 -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 +7 -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 +4 -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 +30 -14
- package/src/blocks/draft-box/draft-box.tsx +3 -0
- package/src/blocks/index.tsx +1 -0
- package/src/blocks/oauth-buttons/oauth-buttons.tsx +1 -0
- package/src/blocks/order-block/order-block.tsx +20 -4
- package/src/blocks/product-tile/product-tile.tsx +4 -1
- package/src/blocks/question-accordion/question-accordion.tsx +0 -1
- package/src/blocks/question-pager/question-pager.tsx +2 -1
- package/src/blocks/review-card/review-card.tsx +4 -0
- package/src/blocks/send-bar/send-bar.tsx +1 -0
- package/src/blocks/stage-bar/stage-bar.tsx +3 -2
- package/src/blocks/stat-card/stat-card.tsx +2 -1
- package/src/blocks/step-screen/step-screen.tsx +5 -2
- package/src/blocks/store-top/store-top.tsx +7 -2
- package/src/blocks/summary-cards/summary-cards.tsx +4 -3
- package/src/blocks/task-tiles/task-tiles.tsx +2 -1
- package/src/components/amount-summary/amount-summary.tsx +9 -3
- package/src/components/button/button.tsx +18 -5
- package/src/components/calendar/calendar.tsx +5 -2
- package/src/components/chip/chip.tsx +11 -2
- package/src/components/chip-group/chip-group.tsx +2 -0
- package/src/components/circle-grid/circle-grid.tsx +5 -1
- package/src/components/credit/credit.tsx +11 -4
- package/src/components/dialog/dialog.tsx +2 -0
- package/src/components/dropdown-menu/dropdown-menu.tsx +18 -7
- package/src/components/empty-state/empty-state.tsx +1 -0
- package/src/components/fact-list/fact-list.tsx +1 -0
- package/src/components/field/field.tsx +4 -0
- package/src/components/filter-tabs/filter-tabs.tsx +2 -1
- package/src/components/list-row/list-row.tsx +40 -5
- package/src/components/page-header/page-header.tsx +1 -0
- package/src/components/pill/pill.tsx +1 -0
- package/src/components/segmented-control/segmented-control.tsx +12 -2
- package/src/components/segmented-tabs/segmented-tabs.tsx +2 -1
- package/src/components/skeleton/skeleton.tsx +5 -2
- package/src/components/slider/slider.tsx +66 -14
- package/src/components/status-steps/status-steps.tsx +2 -0
- package/src/components/text/figures.tsx +92 -0
- package/src/components/text/index.ts +7 -0
- package/src/components/text/metrics.ts +5 -0
- package/src/components/text/text.tsx +60 -16
- package/src/components/tile-grid/tile-grid.tsx +3 -2
- package/src/components/toast/toast.tsx +7 -1
- package/src/components/value-rows/value-rows.tsx +9 -1
- package/src/index.tsx +1 -0
- package/src/internal/field-label.tsx +2 -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/roll-text.tsx +12 -2
- package/src/internal/sample-tiles.tsx +2 -0
- package/src/internal/undo-glyph.tsx +12 -11
- package/src/sortable/section-board.tsx +73 -76
- package/src/templates/design-pick-template.tsx +10 -1
- package/src/templates/intro-template.tsx +14 -12
- package/src/templates/preview-edit-template.tsx +3 -0
- package/src/templates/result-template.tsx +3 -0
- package/src/templates/scroll-templates.tsx +11 -2
- package/src/templates/sheet-form-template.tsx +4 -0
- package/src/theme/base.ts +9 -2
- package/src/theme/create-theme.ts +9 -2
- package/src/theme/tokens.ts +37 -3
- package/src/types/index.ts +13 -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,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createContext,
|
|
3
|
+
useCallback,
|
|
3
4
|
useContext,
|
|
4
5
|
useEffect,
|
|
5
6
|
useMemo,
|
|
@@ -26,7 +27,13 @@ import { useTheme } from '../../theme/theme-provider';
|
|
|
26
27
|
import { withAlpha } from '../../utils/color';
|
|
27
28
|
import { makeStyles } from '../../utils/styles';
|
|
28
29
|
import { CompareSlider } from './compare-slider';
|
|
29
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
DetailFocusContext,
|
|
32
|
+
DetailPartsContext,
|
|
33
|
+
type DetailFocusRect,
|
|
34
|
+
type DetailPart,
|
|
35
|
+
} from './focus-context';
|
|
36
|
+
import { keepWords } from './keep-words';
|
|
30
37
|
import {
|
|
31
38
|
DETAIL_FONT_FAMILY,
|
|
32
39
|
DETAIL_STEP_COLUMNS,
|
|
@@ -37,6 +44,7 @@ import {
|
|
|
37
44
|
detailSteps,
|
|
38
45
|
detailTableRows,
|
|
39
46
|
detailFontSize,
|
|
47
|
+
detailIsTitle,
|
|
40
48
|
detailLineHeight,
|
|
41
49
|
detailTracking,
|
|
42
50
|
type DetailBlock,
|
|
@@ -86,28 +94,103 @@ export type DetailCanvasProps = {
|
|
|
86
94
|
paper?: string;
|
|
87
95
|
mode?: 'select' | 'edit';
|
|
88
96
|
focus?: DetailCanvasFocus | null;
|
|
97
|
+
onMeasure?: (parts: DetailPart[]) => void;
|
|
89
98
|
};
|
|
90
99
|
|
|
100
|
+
const lay = Platform.OS === 'ios' ? (text: string) => text : keepWords;
|
|
101
|
+
|
|
91
102
|
const HANDLE = 10;
|
|
92
|
-
const BLANK_TITLE = 7;
|
|
93
103
|
const DOT = 6;
|
|
94
104
|
const MAX_TEXT = 2000;
|
|
95
105
|
const RING = 2;
|
|
96
106
|
const HALO = 0.9;
|
|
97
107
|
|
|
108
|
+
type PartSink = {
|
|
109
|
+
root: RefObject<ComponentRef<typeof View> | null>;
|
|
110
|
+
put: (key: string, part: DetailPart | null) => void;
|
|
111
|
+
watch: (key: string, measure: (() => void) | null) => void;
|
|
112
|
+
again: () => void;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const PartsContext = createContext<PartSink | null>(null);
|
|
116
|
+
|
|
117
|
+
type PartSpec = {
|
|
118
|
+
key: string;
|
|
119
|
+
kind: DetailPart['kind'];
|
|
120
|
+
line?: number;
|
|
121
|
+
blank?: boolean;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
function useProbe(spec?: PartSpec) {
|
|
125
|
+
const sink = useContext(PartsContext);
|
|
126
|
+
const node = useRef<ComponentRef<typeof View>>(null);
|
|
127
|
+
const latest = useRef(spec);
|
|
128
|
+
latest.current = spec;
|
|
129
|
+
const measure = useCallback(() => {
|
|
130
|
+
const now = latest.current;
|
|
131
|
+
const root = sink?.root.current;
|
|
132
|
+
const self = node.current;
|
|
133
|
+
if (!sink || !now || !root || !self) return;
|
|
134
|
+
self.measureLayout(
|
|
135
|
+
root,
|
|
136
|
+
(_x, y, _w, height) =>
|
|
137
|
+
sink.put(now.key, {
|
|
138
|
+
key: now.key,
|
|
139
|
+
kind: now.kind,
|
|
140
|
+
y,
|
|
141
|
+
height,
|
|
142
|
+
line: now.line ?? 0,
|
|
143
|
+
...(now.blank ? { blank: true } : {}),
|
|
144
|
+
}),
|
|
145
|
+
() => undefined
|
|
146
|
+
);
|
|
147
|
+
}, [sink]);
|
|
148
|
+
const key = spec?.key;
|
|
149
|
+
const blank = !!spec?.blank;
|
|
150
|
+
const seen = useRef(blank);
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
if (seen.current === blank) return;
|
|
153
|
+
seen.current = blank;
|
|
154
|
+
measure();
|
|
155
|
+
}, [blank, measure]);
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
if (!sink || !key) return;
|
|
158
|
+
sink.watch(key, measure);
|
|
159
|
+
return () => {
|
|
160
|
+
sink.watch(key, null);
|
|
161
|
+
sink.put(key, null);
|
|
162
|
+
};
|
|
163
|
+
}, [sink, key, measure]);
|
|
164
|
+
if (!sink || !spec) return null;
|
|
165
|
+
return { ref: node, onLayout: measure };
|
|
166
|
+
}
|
|
167
|
+
|
|
98
168
|
type TapProps = {
|
|
99
169
|
onPress?: () => void;
|
|
100
170
|
label: string;
|
|
101
171
|
style?: StyleProp<ViewStyle>;
|
|
172
|
+
part?: PartSpec;
|
|
102
173
|
children?: ReactNode;
|
|
103
174
|
};
|
|
104
175
|
|
|
105
|
-
function Tap({ onPress, label, style, children }: TapProps) {
|
|
176
|
+
function Tap({ onPress, label, style, part, children }: TapProps) {
|
|
177
|
+
const probe = useProbe(part);
|
|
106
178
|
if (!onPress) {
|
|
107
|
-
return
|
|
179
|
+
return (
|
|
180
|
+
<View
|
|
181
|
+
ref={probe?.ref}
|
|
182
|
+
onLayout={probe?.onLayout}
|
|
183
|
+
collapsable={probe ? false : undefined}
|
|
184
|
+
style={style}
|
|
185
|
+
>
|
|
186
|
+
{children}
|
|
187
|
+
</View>
|
|
188
|
+
);
|
|
108
189
|
}
|
|
109
190
|
return (
|
|
110
191
|
<PressableBase
|
|
192
|
+
ref={probe?.ref}
|
|
193
|
+
onLayout={probe?.onLayout}
|
|
111
194
|
onPress={onPress}
|
|
112
195
|
accessibilityLabel={label}
|
|
113
196
|
feedback="none"
|
|
@@ -118,6 +201,17 @@ function Tap({ onPress, label, style, children }: TapProps) {
|
|
|
118
201
|
);
|
|
119
202
|
}
|
|
120
203
|
|
|
204
|
+
const textPart = (
|
|
205
|
+
block: DetailBlock,
|
|
206
|
+
layer: DetailLayer,
|
|
207
|
+
style: TextStyle,
|
|
208
|
+
lines = true
|
|
209
|
+
): PartSpec => ({
|
|
210
|
+
key: `${block.id}/${layer.id}`,
|
|
211
|
+
kind: 'text',
|
|
212
|
+
line: lines ? (style.lineHeight ?? 0) : 0,
|
|
213
|
+
});
|
|
214
|
+
|
|
121
215
|
const useStyles = makeStyles((t) => ({
|
|
122
216
|
page: { overflow: 'hidden' },
|
|
123
217
|
texts: { gap: t.space[2] },
|
|
@@ -157,6 +251,8 @@ const useStyles = makeStyles((t) => ({
|
|
|
157
251
|
},
|
|
158
252
|
tagText: {
|
|
159
253
|
fontSize: t.typography.caption.fontSize,
|
|
254
|
+
fontFamily: t.fontFamily,
|
|
255
|
+
letterSpacing: t.typography.caption.letterSpacing,
|
|
160
256
|
fontWeight: '600',
|
|
161
257
|
},
|
|
162
258
|
tag: {
|
|
@@ -210,6 +306,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
210
306
|
focusTagText: {
|
|
211
307
|
fontFamily: t.fontFamily,
|
|
212
308
|
fontSize: t.typography.eyebrow.fontSize,
|
|
309
|
+
letterSpacing: t.typography.eyebrow.letterSpacing,
|
|
213
310
|
lineHeight: t.typography.eyebrow.lineHeight,
|
|
214
311
|
fontWeight: '600',
|
|
215
312
|
color: t.colors.title,
|
|
@@ -218,7 +315,7 @@ const useStyles = makeStyles((t) => ({
|
|
|
218
315
|
flexDirection: 'row',
|
|
219
316
|
justifyContent: 'center',
|
|
220
317
|
gap: t.space[2],
|
|
221
|
-
marginTop: t.space[
|
|
318
|
+
marginTop: t.space[5],
|
|
222
319
|
},
|
|
223
320
|
dotMark: { width: DOT, height: DOT, borderRadius: DOT / 2 },
|
|
224
321
|
field: {
|
|
@@ -392,6 +489,7 @@ type FocusTextProps = {
|
|
|
392
489
|
result?: DetailCanvasResult | null;
|
|
393
490
|
blank: ReactNode;
|
|
394
491
|
style?: StyleProp<ViewStyle>;
|
|
492
|
+
part?: PartSpec;
|
|
395
493
|
};
|
|
396
494
|
|
|
397
495
|
function FocusText({
|
|
@@ -401,9 +499,11 @@ function FocusText({
|
|
|
401
499
|
result,
|
|
402
500
|
blank,
|
|
403
501
|
style,
|
|
502
|
+
part,
|
|
404
503
|
}: FocusTextProps) {
|
|
405
504
|
const t = useTheme();
|
|
406
505
|
const s = useStyles();
|
|
506
|
+
const probe = useProbe(part);
|
|
407
507
|
const target = useContext(FocusTargetContext);
|
|
408
508
|
const ring = useRef<ComponentRef<typeof View>>(null);
|
|
409
509
|
const field = useRef<ComponentRef<typeof TextInput>>(null);
|
|
@@ -435,7 +535,11 @@ function FocusText({
|
|
|
435
535
|
const ready = () => {
|
|
436
536
|
if (laid.current) return;
|
|
437
537
|
laid.current = true;
|
|
438
|
-
|
|
538
|
+
const node = field.current;
|
|
539
|
+
if (!wanted.current || !node) return;
|
|
540
|
+
node.focus();
|
|
541
|
+
const end = input?.value.length ?? 0;
|
|
542
|
+
node.setSelection?.(end, end);
|
|
439
543
|
};
|
|
440
544
|
|
|
441
545
|
const pan = useMemo(
|
|
@@ -457,15 +561,22 @@ function FocusText({
|
|
|
457
561
|
[slop, swipe]
|
|
458
562
|
);
|
|
459
563
|
|
|
460
|
-
const
|
|
564
|
+
const below = shown && shown.count >= 2 ? t.space[5] + DOT : 0;
|
|
565
|
+
const reach = useRef(below);
|
|
566
|
+
reach.current = below;
|
|
567
|
+
const measure = useCallback(() => {
|
|
461
568
|
const root = target?.root.current;
|
|
462
569
|
if (!target || !root || !ring.current) return;
|
|
463
570
|
ring.current.measureLayout(
|
|
464
571
|
root,
|
|
465
|
-
(_x, y, _w, height) =>
|
|
572
|
+
(_x, y, _w, height) =>
|
|
573
|
+
target.report({ y, height: height + reach.current }),
|
|
466
574
|
() => undefined
|
|
467
575
|
);
|
|
468
|
-
};
|
|
576
|
+
}, [target]);
|
|
577
|
+
useEffect(() => {
|
|
578
|
+
measure();
|
|
579
|
+
}, [below, measure]);
|
|
469
580
|
|
|
470
581
|
const line = text.lineHeight ?? 0;
|
|
471
582
|
const fieldStyle: TextStyle = { ...text, alignSelf: undefined };
|
|
@@ -500,15 +611,24 @@ function FocusText({
|
|
|
500
611
|
]}
|
|
501
612
|
/>
|
|
502
613
|
) : shown ? (
|
|
503
|
-
<RNText style={text}>
|
|
614
|
+
<RNText lineBreakStrategyIOS="hangul-word" style={text}>
|
|
615
|
+
{lay(shown.text)}
|
|
616
|
+
</RNText>
|
|
504
617
|
) : layer.text?.trim() ? (
|
|
505
|
-
<RNText style={text}>
|
|
618
|
+
<RNText lineBreakStrategyIOS="hangul-word" style={text}>
|
|
619
|
+
{lay(layer.text)}
|
|
620
|
+
</RNText>
|
|
506
621
|
) : (
|
|
507
622
|
blank
|
|
508
623
|
);
|
|
509
624
|
|
|
510
625
|
return (
|
|
511
|
-
<View
|
|
626
|
+
<View
|
|
627
|
+
ref={probe?.ref}
|
|
628
|
+
onLayout={probe?.onLayout}
|
|
629
|
+
collapsable={probe ? false : undefined}
|
|
630
|
+
style={style}
|
|
631
|
+
>
|
|
512
632
|
<View
|
|
513
633
|
testID="detail-focus-text"
|
|
514
634
|
style={[s.focus, shown && s.focusResult]}
|
|
@@ -570,12 +690,61 @@ export function DetailCanvas({
|
|
|
570
690
|
paper,
|
|
571
691
|
mode = 'select',
|
|
572
692
|
focus,
|
|
693
|
+
onMeasure,
|
|
573
694
|
}: DetailCanvasProps) {
|
|
574
695
|
const t = useTheme();
|
|
575
696
|
const s = useStyles();
|
|
576
697
|
const report = useContext(DetailFocusContext);
|
|
698
|
+
const listen = useContext(DetailPartsContext);
|
|
577
699
|
const root = useRef<ComponentRef<typeof View>>(null);
|
|
578
700
|
const target = useMemo(() => (report ? { root, report } : null), [report]);
|
|
701
|
+
const sink = onMeasure ?? listen;
|
|
702
|
+
const latest = useRef(sink);
|
|
703
|
+
latest.current = sink;
|
|
704
|
+
const measuring = !!sink;
|
|
705
|
+
const store = useRef(new Map<string, DetailPart>());
|
|
706
|
+
const watchers = useRef(new Map<string, () => void>());
|
|
707
|
+
const frame = useRef<number | null>(null);
|
|
708
|
+
useEffect(
|
|
709
|
+
() => () => {
|
|
710
|
+
if (frame.current !== null) cancelAnimationFrame(frame.current);
|
|
711
|
+
},
|
|
712
|
+
[]
|
|
713
|
+
);
|
|
714
|
+
const parts = useMemo<PartSink | null>(() => {
|
|
715
|
+
if (!measuring) return null;
|
|
716
|
+
const flush = () => {
|
|
717
|
+
frame.current = null;
|
|
718
|
+
const list = [...store.current.values()].sort((a, b) => a.y - b.y);
|
|
719
|
+
latest.current?.(list);
|
|
720
|
+
};
|
|
721
|
+
return {
|
|
722
|
+
root,
|
|
723
|
+
put: (key, part) => {
|
|
724
|
+
const now = store.current.get(key);
|
|
725
|
+
if (part) {
|
|
726
|
+
if (
|
|
727
|
+
now &&
|
|
728
|
+
now.y === part.y &&
|
|
729
|
+
now.height === part.height &&
|
|
730
|
+
!!now.blank === !!part.blank
|
|
731
|
+
)
|
|
732
|
+
return;
|
|
733
|
+
store.current.set(key, part);
|
|
734
|
+
} else {
|
|
735
|
+
if (!now) return;
|
|
736
|
+
store.current.delete(key);
|
|
737
|
+
}
|
|
738
|
+
if (frame.current === null)
|
|
739
|
+
frame.current = requestAnimationFrame(flush);
|
|
740
|
+
},
|
|
741
|
+
watch: (key, measure) => {
|
|
742
|
+
if (measure) watchers.current.set(key, measure);
|
|
743
|
+
else watchers.current.delete(key);
|
|
744
|
+
},
|
|
745
|
+
again: () => watchers.current.forEach((measure) => measure()),
|
|
746
|
+
};
|
|
747
|
+
}, [measuring]);
|
|
579
748
|
const pad = t.space[5] * scale;
|
|
580
749
|
const fg = ink ?? t.colors.foreground;
|
|
581
750
|
const bandText = paper ?? t.colors.surface;
|
|
@@ -639,6 +808,7 @@ export function DetailCanvas({
|
|
|
639
808
|
after={compare.after}
|
|
640
809
|
aspectRatio={ratio}
|
|
641
810
|
labels={compare.labels}
|
|
811
|
+
inset={t.space[1] + RING}
|
|
642
812
|
/>
|
|
643
813
|
<PhotoRing />
|
|
644
814
|
</View>
|
|
@@ -653,6 +823,7 @@ export function DetailCanvas({
|
|
|
653
823
|
onPress={press({ block: block.id, layer: layer.id })}
|
|
654
824
|
label={'사진'}
|
|
655
825
|
style={flex ? s.half : undefined}
|
|
826
|
+
part={{ key: `${block.id}/${layer.id}`, kind: 'image', blank: !url }}
|
|
656
827
|
>
|
|
657
828
|
{url ? (
|
|
658
829
|
<Image
|
|
@@ -680,13 +851,14 @@ export function DetailCanvas({
|
|
|
680
851
|
testID="detail-blank-text"
|
|
681
852
|
style={[
|
|
682
853
|
s.blank,
|
|
683
|
-
(l.style
|
|
854
|
+
detailIsTitle(l.style) ? s.blankTitle : s.blankLine,
|
|
684
855
|
{ height: style.lineHeight, alignSelf: alignSelfOf(l.style?.align) },
|
|
685
856
|
]}
|
|
686
857
|
/>
|
|
687
858
|
);
|
|
688
859
|
|
|
689
860
|
const focusText = (
|
|
861
|
+
block: DetailBlock,
|
|
690
862
|
l: DetailLayer,
|
|
691
863
|
style: TextStyle,
|
|
692
864
|
wrap?: StyleProp<ViewStyle>
|
|
@@ -699,6 +871,7 @@ export function DetailCanvas({
|
|
|
699
871
|
result={focus?.result}
|
|
700
872
|
blank={blankBar(l, style)}
|
|
701
873
|
style={wrap}
|
|
874
|
+
part={textPart(block, l, style, false)}
|
|
702
875
|
/>
|
|
703
876
|
);
|
|
704
877
|
|
|
@@ -709,7 +882,7 @@ export function DetailCanvas({
|
|
|
709
882
|
) => {
|
|
710
883
|
if (!l || l.hidden) return <View style={style} />;
|
|
711
884
|
const text = tx(l);
|
|
712
|
-
if (focused(block, l)) return focusText(l, text, style);
|
|
885
|
+
if (focused(block, l)) return focusText(block, l, text, style);
|
|
713
886
|
const blank = !l.text?.trim();
|
|
714
887
|
if (blank && !onSelect) return <View style={style} />;
|
|
715
888
|
return (
|
|
@@ -717,8 +890,15 @@ export function DetailCanvas({
|
|
|
717
890
|
onPress={press({ block: block.id, layer: l.id })}
|
|
718
891
|
label={blank ? '글' : (l.text ?? '')}
|
|
719
892
|
style={style}
|
|
893
|
+
part={textPart(block, l, text)}
|
|
720
894
|
>
|
|
721
|
-
{blank ?
|
|
895
|
+
{blank ? (
|
|
896
|
+
blankBar(l, text)
|
|
897
|
+
) : (
|
|
898
|
+
<RNText lineBreakStrategyIOS="hangul-word" style={text}>
|
|
899
|
+
{lay(l.text ?? '')}
|
|
900
|
+
</RNText>
|
|
901
|
+
)}
|
|
722
902
|
{picked(block, l) ? <Handles /> : null}
|
|
723
903
|
</Tap>
|
|
724
904
|
);
|
|
@@ -802,7 +982,7 @@ export function DetailCanvas({
|
|
|
802
982
|
return (
|
|
803
983
|
<View key={l.id} style={[s.step, { gap }]}>
|
|
804
984
|
{dot}
|
|
805
|
-
{focusText(l, text, s.stretch)}
|
|
985
|
+
{focusText(block, l, text, s.stretch)}
|
|
806
986
|
</View>
|
|
807
987
|
);
|
|
808
988
|
}
|
|
@@ -812,12 +992,18 @@ export function DetailCanvas({
|
|
|
812
992
|
onPress={press({ block: block.id, layer: l.id })}
|
|
813
993
|
label={blank ? '글' : (l.text ?? '')}
|
|
814
994
|
style={[s.step, { gap }]}
|
|
995
|
+
part={textPart(block, l, text, false)}
|
|
815
996
|
>
|
|
816
997
|
{dot}
|
|
817
998
|
{blank ? (
|
|
818
999
|
blankBar(l, text)
|
|
819
1000
|
) : (
|
|
820
|
-
<RNText
|
|
1001
|
+
<RNText
|
|
1002
|
+
lineBreakStrategyIOS="hangul-word"
|
|
1003
|
+
style={[text, s.stretch]}
|
|
1004
|
+
>
|
|
1005
|
+
{lay(l.text ?? '')}
|
|
1006
|
+
</RNText>
|
|
821
1007
|
)}
|
|
822
1008
|
{picked(block, l) ? <Handles /> : null}
|
|
823
1009
|
</Tap>
|
|
@@ -829,27 +1015,36 @@ export function DetailCanvas({
|
|
|
829
1015
|
);
|
|
830
1016
|
};
|
|
831
1017
|
|
|
832
|
-
const texts = (block: DetailBlock, shown: DetailLayer[]) => {
|
|
1018
|
+
const texts = (block: DetailBlock, shown: DetailLayer[], under = false) => {
|
|
833
1019
|
const list = shown.filter(
|
|
834
1020
|
(l) => l.type === 'text' && (l.text || onSelect || focused(block, l))
|
|
835
1021
|
);
|
|
836
1022
|
if (!list.length) return null;
|
|
837
1023
|
return (
|
|
838
|
-
<View
|
|
1024
|
+
<View
|
|
1025
|
+
style={[
|
|
1026
|
+
s.texts,
|
|
1027
|
+
{ padding: pad },
|
|
1028
|
+
under && { paddingTop: pad + t.space[2] * scale },
|
|
1029
|
+
]}
|
|
1030
|
+
>
|
|
839
1031
|
{list.map((l) => {
|
|
840
1032
|
const style = tx(l);
|
|
841
|
-
if (focused(block, l)) return focusText(l, style);
|
|
1033
|
+
if (focused(block, l)) return focusText(block, l, style);
|
|
842
1034
|
const blank = !!onSelect && !l.text?.trim();
|
|
843
1035
|
return (
|
|
844
1036
|
<Tap
|
|
845
1037
|
key={l.id}
|
|
846
1038
|
onPress={press({ block: block.id, layer: l.id })}
|
|
847
1039
|
label={blank ? '글' : (l.text ?? '')}
|
|
1040
|
+
part={textPart(block, l, style)}
|
|
848
1041
|
>
|
|
849
1042
|
{blank ? (
|
|
850
1043
|
blankBar(l, style)
|
|
851
1044
|
) : (
|
|
852
|
-
<RNText style={style}>
|
|
1045
|
+
<RNText lineBreakStrategyIOS="hangul-word" style={style}>
|
|
1046
|
+
{lay(l.text ?? '')}
|
|
1047
|
+
</RNText>
|
|
853
1048
|
)}
|
|
854
1049
|
{picked(block, l) ? <Handles /> : null}
|
|
855
1050
|
</Tap>
|
|
@@ -908,59 +1103,62 @@ export function DetailCanvas({
|
|
|
908
1103
|
return (
|
|
909
1104
|
<>
|
|
910
1105
|
{images.map((l) => image(block, l, false, 4 / 5))}
|
|
911
|
-
{texts(block, shown)}
|
|
1106
|
+
{texts(block, shown, images.length > 0)}
|
|
912
1107
|
</>
|
|
913
1108
|
);
|
|
914
1109
|
}
|
|
915
1110
|
};
|
|
916
1111
|
|
|
917
1112
|
return (
|
|
918
|
-
<
|
|
919
|
-
<
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
<
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1113
|
+
<PartsContext.Provider value={parts}>
|
|
1114
|
+
<FocusTargetContext.Provider value={target}>
|
|
1115
|
+
<View
|
|
1116
|
+
ref={root}
|
|
1117
|
+
style={[
|
|
1118
|
+
s.page,
|
|
1119
|
+
{ backgroundColor: doc.background ?? paper ?? t.colors.surface },
|
|
1120
|
+
]}
|
|
1121
|
+
>
|
|
1122
|
+
{doc.blocks.map((block, index) => (
|
|
1123
|
+
<View
|
|
1124
|
+
key={block.id}
|
|
1125
|
+
onLayout={parts?.again}
|
|
1126
|
+
style={{
|
|
1127
|
+
backgroundColor: block.background?.color ?? undefined,
|
|
1128
|
+
paddingTop: detailBlockSpace(block.space_top) * scale,
|
|
1129
|
+
paddingBottom: detailBlockSpace(block.space_bottom) * scale,
|
|
1130
|
+
}}
|
|
1131
|
+
>
|
|
1132
|
+
{block.background?.url ? (
|
|
1133
|
+
<Image
|
|
1134
|
+
source={{ uri: block.background.url }}
|
|
1135
|
+
resizeMode="cover"
|
|
1136
|
+
style={s.fill}
|
|
1137
|
+
/>
|
|
1138
|
+
) : null}
|
|
1139
|
+
{onSelect && !edit ? (
|
|
1140
|
+
<PressableBase
|
|
1141
|
+
onPress={() => onSelect({ block: block.id })}
|
|
1142
|
+
accessibilityLabel="블록"
|
|
1143
|
+
feedback="none"
|
|
1144
|
+
style={s.fill}
|
|
1145
|
+
/>
|
|
1146
|
+
) : null}
|
|
1147
|
+
{body(block)}
|
|
1148
|
+
{picked(block) ? <Handles /> : null}
|
|
1149
|
+
{!edit && selection?.block === block.id ? (
|
|
1150
|
+
<View pointerEvents="none" style={s.tag}>
|
|
1151
|
+
<RNText
|
|
1152
|
+
style={[s.tagText, { color: t.colors.primaryForeground }]}
|
|
1153
|
+
>
|
|
1154
|
+
{String(index + 1)}
|
|
1155
|
+
</RNText>
|
|
1156
|
+
</View>
|
|
1157
|
+
) : null}
|
|
1158
|
+
</View>
|
|
1159
|
+
))}
|
|
1160
|
+
</View>
|
|
1161
|
+
</FocusTargetContext.Provider>
|
|
1162
|
+
</PartsContext.Provider>
|
|
965
1163
|
);
|
|
966
1164
|
}
|
|
@@ -170,3 +170,40 @@ export const DETAIL_COLORS: readonly { value: string; label: string }[] = [
|
|
|
170
170
|
{ value: '#2F4A2B', label: '초록' },
|
|
171
171
|
{ value: '#1F3A5F', label: '남색' },
|
|
172
172
|
];
|
|
173
|
+
|
|
174
|
+
export const DETAIL_HEAD_SIZE = 7;
|
|
175
|
+
export const DETAIL_TITLE_SIZE = 5;
|
|
176
|
+
|
|
177
|
+
export function detailIsTitle(style?: DetailTextStyle | null): boolean {
|
|
178
|
+
const size = style?.size ?? 5;
|
|
179
|
+
const weight = style?.weight ?? 'regular';
|
|
180
|
+
return (
|
|
181
|
+
size >= DETAIL_HEAD_SIZE ||
|
|
182
|
+
(size >= DETAIL_TITLE_SIZE && weight !== 'regular')
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export const DETAIL_TEXT_COLORS: readonly { value: string; label: string }[] = [
|
|
187
|
+
{ value: '#1A1A1A', label: '검정' },
|
|
188
|
+
{ value: '#626262', label: '회색' },
|
|
189
|
+
{ value: '#FFFFFF', label: '흰색' },
|
|
190
|
+
{ value: '#8A6A4A', label: '갈색' },
|
|
191
|
+
{ value: '#B5651D', label: '황토색' },
|
|
192
|
+
{ value: '#3F5D45', label: '초록' },
|
|
193
|
+
{ value: '#2F4A6B', label: '남색' },
|
|
194
|
+
{ value: '#9A3412', label: '벽돌색' },
|
|
195
|
+
];
|
|
196
|
+
|
|
197
|
+
export const DETAIL_BACKGROUND_COLORS: readonly {
|
|
198
|
+
value: string;
|
|
199
|
+
label: string;
|
|
200
|
+
}[] = [
|
|
201
|
+
{ value: '#FFFFFF', label: '흰색' },
|
|
202
|
+
{ value: '#F3EFE7', label: '크림색' },
|
|
203
|
+
{ value: '#E6E1D8', label: '연회색' },
|
|
204
|
+
{ value: '#D6C7B2', label: '베이지' },
|
|
205
|
+
{ value: '#8A6A4A', label: '갈색' },
|
|
206
|
+
{ value: '#3F5D45', label: '초록' },
|
|
207
|
+
{ value: '#2F4A6B', label: '남색' },
|
|
208
|
+
{ value: '#2A2D33', label: '먹색' },
|
|
209
|
+
];
|
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { makeStyles } from '../../utils/styles';
|
|
4
|
+
import type { DetailPart } from './focus-context';
|
|
5
|
+
|
|
6
|
+
const EPS = 0.5;
|
|
7
|
+
|
|
8
|
+
export function draftPreviewFit(
|
|
9
|
+
parts: readonly DetailPart[],
|
|
10
|
+
room: number
|
|
11
|
+
): number {
|
|
12
|
+
let end = room;
|
|
13
|
+
for (const part of parts) {
|
|
14
|
+
if (part.kind !== 'text') continue;
|
|
15
|
+
if (part.y + part.height <= room + EPS || part.y >= room - EPS) continue;
|
|
16
|
+
end = Math.min(end, part.y);
|
|
17
|
+
}
|
|
18
|
+
const photo = parts
|
|
19
|
+
.filter((p) => p.kind === 'image' && p.y + p.height <= end + EPS)
|
|
20
|
+
.pop();
|
|
21
|
+
if (!photo) return end;
|
|
22
|
+
const below = photo.y + photo.height;
|
|
23
|
+
const words = parts.some(
|
|
24
|
+
(p) => p.kind === 'text' && p.y >= below - EPS && p.y < end - EPS
|
|
25
|
+
);
|
|
26
|
+
return words ? end : below;
|
|
27
|
+
}
|
|
4
28
|
|
|
5
29
|
export type DraftPreviewProps = {
|
|
6
30
|
height: number;
|
|
7
31
|
width: number;
|
|
32
|
+
pageHeight?: number;
|
|
8
33
|
children: ReactNode;
|
|
9
34
|
};
|
|
10
35
|
|
|
@@ -22,13 +47,32 @@ const useStyles = makeStyles((t) => ({
|
|
|
22
47
|
borderTopRightRadius: t.radius.sm,
|
|
23
48
|
backgroundColor: t.colors.surface,
|
|
24
49
|
},
|
|
50
|
+
whole: {
|
|
51
|
+
borderBottomLeftRadius: t.radius.sm,
|
|
52
|
+
borderBottomRightRadius: t.radius.sm,
|
|
53
|
+
},
|
|
25
54
|
}));
|
|
26
55
|
|
|
27
|
-
export function DraftPreview({
|
|
56
|
+
export function DraftPreview({
|
|
57
|
+
height,
|
|
58
|
+
width,
|
|
59
|
+
pageHeight,
|
|
60
|
+
children,
|
|
61
|
+
}: DraftPreviewProps) {
|
|
28
62
|
const s = useStyles();
|
|
63
|
+
const whole = pageHeight !== undefined;
|
|
29
64
|
return (
|
|
30
65
|
<View style={[s.box, { height }]}>
|
|
31
|
-
<View
|
|
66
|
+
<View
|
|
67
|
+
style={[
|
|
68
|
+
s.page,
|
|
69
|
+
{ width },
|
|
70
|
+
whole && s.whole,
|
|
71
|
+
whole && { height: pageHeight },
|
|
72
|
+
]}
|
|
73
|
+
>
|
|
74
|
+
{children}
|
|
75
|
+
</View>
|
|
32
76
|
</View>
|
|
33
77
|
);
|
|
34
78
|
}
|
|
@@ -5,3 +5,16 @@ export type DetailFocusRect = { y: number; height: number };
|
|
|
5
5
|
export const DetailFocusContext = createContext<
|
|
6
6
|
((rect: DetailFocusRect | null) => void) | null
|
|
7
7
|
>(null);
|
|
8
|
+
|
|
9
|
+
export type DetailPart = {
|
|
10
|
+
key: string;
|
|
11
|
+
kind: 'text' | 'image';
|
|
12
|
+
y: number;
|
|
13
|
+
height: number;
|
|
14
|
+
line: number;
|
|
15
|
+
blank?: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const DetailPartsContext = createContext<
|
|
19
|
+
((parts: DetailPart[]) => void) | null
|
|
20
|
+
>(null);
|