Skip to content

Conversation

@cjw783
Copy link
Contributor

@cjw783 cjw783 commented Jun 13, 2025

Issue

Flicking state api implementation

Details

  • implemented states
    • indexProgress
    • progress
    • totalPanelCount
    • currentPanelIndex
    • isReachStart
    • isReachEnd
  • implemented methods
    • moveTo
  • implemented framework support
    • react
    • vue2
    • vue3

malangfox and others added 8 commits May 16, 2025 14:54
* fix: apply ResizeObserver to camera and panels

* fix: unobserve removed panel when panel change

* fix: add defense code to check if element exists

* feat: add resizeObservePanel option

* fix: add defensive logic to getStyle

* chore: change resizeObservePanel to resizePanelObserve

* fix: add unobserve panel logic

* chore: update setup-node to v4
* fix: infinite resize

* chore: remove route for removed demo

* fix: prevent calling viewport.resize() when isResizing

* chore: add type info

* chore: add script to link core and framework for debug

* chore: create reference demo page

* fix: calculate resized size using getElementSize

* feat: add optimizeSizeUpdate option

* chore: disable eslint for helper script

* refactor: declare variable for resizeTarget

* test: changed import path to relative path

* fix: changed viewport resize condition

* chore: add comments

---------

Co-authored-by: jinwoo-choi-05 <[email protected]>
@cjw783 cjw783 requested a review from daybrush June 13, 2025 07:29
@cjw783 cjw783 marked this pull request as ready for review June 16, 2025 01:49
return percent;
};

export type FlickingStateApi = ReactiveObject<{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아래 상태 interface가 있기도 하고, 메서드 interface를 만들고 Intersection 타입으로 만드시는게 좋을 것 같습니다.

scrollProgress: number;
}

const flickingStateApiAdapter: ReactiveSetupAdapter<FlickingStateApi, FlickingReactiveState, "moveTo"> = ({ onInit, onDestroy }) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data 타입도 있을거에요.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

말씀주신 data 타입이라는 게 어떤 걸 말씀하시는 걸까요?

currentPanelIndex: number;
indexProgress: number;
scrollProgress: number;
moveTo: (i: number) => Promise<void> | undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flicking instance가 없는 경우 Promise.reject를 호출해도 괜찮을 것 같습니다.

@cjw783 cjw783 merged commit 153db86 into naver:master Jun 17, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants