Skip to content

Commit

Permalink
Feat UIKit Hint (#273)
Browse files Browse the repository at this point in the history
* Add Tooltip view

* Refactor Tooltip style

* Can adjust tooltip position

* Add tooltip playground for testing

* Refine layout tips logic

* Refine layout logic

* Update CharcoalTooltip.swift

* Refine tooltip spacing

* Add CharcoalIdentifiableOverlayView

* Use Actor to prevent Data Race

* Remove CharcoalIdentifiableOverlayView out

* Clean code

* Only update view when it is isPresenting

* Clean access control

* Add TooltipsView

* Fix tooltipY layout logic

* Use main actor and remove CharcoalContainerManagerKey

* Fix access control on CharcoalContainerManager

* Make viewID as @State

* Use EnviromentObject to create CharcoalContainerManager for each container

* Use ObservedObject on  CharcoalContainerManager

* Add use charcoal button as demo trigger

* Add arrow logic on tooltip

* Refine arrow logic

* Refine arrow layout logic

* Use StateObject to prevent unexpected reinit

* Refactor TooltipBubbleShape

* Fix edge layout logic

* Add comment

* Format code

* Use new approach to remove adaptiveMaxWidth

* Fix the tip bubble's position latency

* Add dismiss when interaction

* Reformat

* Add initial Snackbar

* Add thumbnail image

* Add support for thumbnailImage and action

* Clean code

* Reformat code

* Rename ActionContent

* Replace thumbnailImage type

* Add dismissOnTouchOutside control

* Add comment on CharcoalIdentifiableOverlayView

* Update CharcoalTooltip.swift

* Add SnackBar demo

* Replace thumbnail with charcoal logo

* Use @ViewBuilder

* Clean Code

* Made code more readable

* Update ToastsView.swift

* Add auto dismiss logic

* Fix dismiss comment

* Add Identifiable to CharcoalIdentifiableOverlayView

* Make all CharcoalPopupView identifiable

* Move all control logic into CharcoalPopupView

* Reformat

* Refine CharcoalOverlayContainerChild logic of updating view

* Rename to CharcoalOverlayUpdaterContainer

* Add CharcoalToast

* Refine toast control

* Refine screen edge of toast

* Refine comments

* Rename CharcoalPopupProtocol

* Refine isActuallyPresenting logic

* Clean animation

* Add animation configuration

* Add custom animation

* Add CharcoalToastProtocol

* Makes CharcoalSnackBar adapt CharcoalToastProtocol

* Remove time delay

* Refine SnackBar Animation logic

* Add CharcoalToastAnimationModifier

* Reformat code

* Update CharcoalPopupViewEdge of direction

* Refine demo

* Fix missing animation

* Rename charcoalAnimatedToast to charcoalAnimatableToast

* Rename CharcoalAnimatableToastProtocol

* Rename for clean

* Simplify protocols

* Add drag control

* Add Dismiss timer control logic

* Refine drag damping logic

* Add CharcoalToastDraggable

* Use CharcoalToastDraggableModifier on CharcoalSnackBar

* Format code

* Add init structure

* Add action button

* Replace placeholder with ja text

* Use CGPath union for iOS 16

* Update TooltipBubbleShape.swift

* Update CharcoalTooltip.swift

* Use GeometryReader on overlay

* Use new path draw logic

* Refine arrow width

* Refine arrow width

* Clean Code

* Refine preview

* Use timer instead of DispatchQueue

* Refine layout logic

* Refine arrow logic

* Refine layout logic

* Add missing charcoalOverlayContainer

* Add Balloon to examples

* Add default tutorials

* Remove overlay when disappear

* Refine charcoalOverlayContainer place

* Refine

* Update CharcoalSnackBar.swift

* Add Charcoal Hint

* Use surface 3

* Add isPresenting

* Add hints to sample

* Format code

* Init CharcoalTooltipView

* Init Bubble shape

* Refine tooltip preview

* Rename as Charcoal Bubble Shape

* Add Label to tooltip

* Update text frame when traitCollection did change

* Update CharcoalTooltipView.swift

* Add CharcoalTooltip

* Can debug show on method

* Can layout point

* Can redraw target point

* Update CharcoalTooltip.swift

* Refine tooltip display

* Share the logic

* Use interaction mode

* Use CharcoalOverlayContainerView

* Update CharcoalOverlay.swift

* Refactor to ChacoalOverlayManager

* Makes CharcoalIdentifiableOverlayView  Identifiable

* Refine layout logic

* Add display(view: CharcoalIdentifiableOverlayView)

* Add tooltip to uikit example

* Update Tooltips.swift

* Add CharcoalIdentifiableOverlayDelegate

* Reformat

* Update StringExtension.swift

* Add to UIKitSample

* Fix public requirements

* Reformat

* Use touch began to handle dismiss on touch

* Update CharcoalIdentifiableOverlayView.swift

* Add CharcoalToastView

* change cornerRadius

* Add CharcoalToast

* Move show logic out

* Reformat

* Refine dismiss method

* Update CharcoalToast.swift

* Add ActionContent and ActionComplete callback

* Update CharcoalToast.swift

* Update CharcoalBubbleShape_UIKit.swift

* Refine layout animation logic

* Refine animation

* Add dismiss

* Add example

* Reformat

* Add toasts example

* Add CharcoalSnackBarView

* Update project.pbxproj

* Clean code

* Refine layout logic

* Add CharcoalSnackBar

* Update CharcoalSnackBar.swift

* Update CharcoalSnackBar.swift

* Refine layout logic

* Refine toasts text

* Update CharcoalToastDraggableModifier.swift

* Add CharcoalRubberGesture

* use id to notify did dismiss

* Add rubber gesture

* Refactor

* Refactor

* Fix memory leak

* Format

* Fix memory leak

* Add example

* Refine snackbar

* Update project.pbxproj

* Add CharcoalHintView

* Update HintView.swift

* Update HintView.swift

* Add example

* Refine swift lint

* Refactor CharcoalToastView

* Refactor CharcoalSnackBarView

* Reformat

* Refine self logic

* Squashed commit of the following:

commit 0efc40ac426ae76ced5adf27f28e8b16cbad494f
Author: Kevin <[email protected]>
Date:   Wed Oct 9 15:07:36 2024 +0900

    Remove duplicated balloons

commit 962da310ea212c193e4063176e79849d853a1cfc
Author: Kevin <[email protected]>
Date:   Wed Oct 9 15:06:42 2024 +0900

    Delete スクリーンショット 2024-02-21 17.28.10.png

commit f535373c15eaa80032b3fa59ff015dc311068ae1
Merge: 6333a452d a24e6adb0
Author: Kevin <[email protected]>
Date:   Wed Oct 9 15:02:23 2024 +0900

    Merge branch 'main' into feat-swiftui-hint

commit a24e6adb058fe6ddf8a4c0391821657bd88998a9
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Oct 9 13:43:19 2024 +0900

    Bump @babel/runtime from 7.25.6 to 7.25.7 in /scripts/xcasset-gen (#268)

    Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.25.6 to 7.25.7.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.25.7/packages/babel-runtime)

    ---
    updated-dependencies:
    - dependency-name: "@babel/runtime"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit af55efc1b7544619c88cc6349bc1e81e62152d7e
Author: Kevin <[email protected]>
Date:   Wed Oct 9 13:42:52 2024 +0900

    Feat UIKit Balloon (#252)

    * Add Tooltip view

    * Refactor Tooltip style

    * Can adjust tooltip position

    * Add tooltip playground for testing

    * Refine layout tips logic

    * Refine layout logic

    * Update CharcoalTooltip.swift

    * Refine tooltip spacing

    * Add CharcoalIdentifiableOverlayView

    * Use Actor to prevent Data Race

    * Remove CharcoalIdentifiableOverlayView out

    * Clean code

    * Only update view when it is isPresenting

    * Clean access control

    * Add TooltipsView

    * Fix tooltipY layout logic

    * Use main actor and remove CharcoalContainerManagerKey

    * Fix access control on CharcoalContainerManager

    * Make viewID as @State

    * Use EnviromentObject to create CharcoalContainerManager for each container

    * Use ObservedObject on  CharcoalContainerManager

    * Add use charcoal button as demo trigger

    * Add arrow logic on tooltip

    * Refine arrow logic

    * Refine arrow layout logic

    * Use StateObject to prevent unexpected reinit

    * Refactor TooltipBubbleShape

    * Fix edge layout logic

    * Add comment

    * Format code

    * Use new approach to remove adaptiveMaxWidth

    * Fix the tip bubble's position latency

    * Add dismiss when interaction

    * Reformat

    * Add initial Snackbar

    * Add thumbnail image

    * Add support for thumbnailImage and action

    * Clean code

    * Reformat code

    * Rename ActionContent

    * Replace thumbnailImage type

    * Add dismissOnTouchOutside control

    * Add comment on CharcoalIdentifiableOverlayView

    * Update CharcoalTooltip.swift

    * Add SnackBar demo

    * Replace thumbnail with charcoal logo

    * Use @ViewBuilder

    * Clean Code

    * Made code more readable

    * Update ToastsView.swift

    * Add auto dismiss logic

    * Fix dismiss comment

    * Add Identifiable to CharcoalIdentifiableOverlayView

    * Make all CharcoalPopupView identifiable

    * Move all control logic into CharcoalPopupView

    * Reformat

    * Refine CharcoalOverlayContainerChild logic of updating view

    * Rename to CharcoalOverlayUpdaterContainer

    * Add CharcoalToast

    * Refine toast control

    * Refine screen edge of toast

    * Refine comments

    * Rename CharcoalPopupProtocol

    * Refine isActuallyPresenting logic

    * Clean animation

    * Add animation configuration

    * Add custom animation

    * Add CharcoalToastProtocol

    * Makes CharcoalSnackBar adapt CharcoalToastProtocol

    * Remove time delay

    * Refine SnackBar Animation logic

    * Add CharcoalToastAnimationModifier

    * Reformat code

    * Update CharcoalPopupViewEdge of direction

    * Refine demo

    * Fix missing animation

    * Rename charcoalAnimatedToast to charcoalAnimatableToast

    * Rename CharcoalAnimatableToastProtocol

    * Rename for clean

    * Simplify protocols

    * Add drag control

    * Add Dismiss timer control logic

    * Refine drag damping logic

    * Add CharcoalToastDraggable

    * Use CharcoalToastDraggableModifier on CharcoalSnackBar

    * Format code

    * Add init structure

    * Add action button

    * Replace placeholder with ja text

    * Use CGPath union for iOS 16

    * Update TooltipBubbleShape.swift

    * Update CharcoalTooltip.swift

    * Use GeometryReader on overlay

    * Use new path draw logic

    * Refine arrow width

    * Refine arrow width

    * Clean Code

    * Refine preview

    * Use timer instead of DispatchQueue

    * Refine layout logic

    * Refine arrow logic

    * Refine layout logic

    * Add missing charcoalOverlayContainer

    * Add Balloon to examples

    * Add default tutorials

    * Remove overlay when disappear

    * Refine charcoalOverlayContainer place

    * Refine

    * Update CharcoalSnackBar.swift

    * Init CharcoalTooltipView

    * Init Bubble shape

    * Refine tooltip preview

    * Rename as Charcoal Bubble Shape

    * Add Label to tooltip

    * Update text frame when traitCollection did change

    * Update CharcoalTooltipView.swift

    * Add CharcoalTooltip

    * Can debug show on method

    * Can layout point

    * Can redraw target point

    * Update CharcoalTooltip.swift

    * Refine tooltip display

    * Share the logic

    * Use interaction mode

    * Use CharcoalOverlayContainerView

    * Update CharcoalOverlay.swift

    * Refactor to ChacoalOverlayManager

    * Makes CharcoalIdentifiableOverlayView  Identifiable

    * Refine layout logic

    * Add display(view: CharcoalIdentifiableOverlayView)

    * Add tooltip to uikit example

    * Update Tooltips.swift

    * Add CharcoalIdentifiableOverlayDelegate

    * Reformat

    * Update StringExtension.swift

    * Add to UIKitSample

    * Fix public requirements

    * Reformat

    * Use touch began to handle dismiss on touch

    * Update CharcoalIdentifiableOverlayView.swift

    * Add CharcoalToastView

    * change cornerRadius

    * Add CharcoalToast

    * Move show logic out

    * Reformat

    * Refine dismiss method

    * Update CharcoalToast.swift

    * Add ActionContent and ActionComplete callback

    * Update CharcoalToast.swift

    * Update CharcoalBubbleShape_UIKit.swift

    * Refine layout animation logic

    * Refine animation

    * Add dismiss

    * Add example

    * Reformat

    * Add toasts example

    * Add CharcoalSnackBarView

    * Update project.pbxproj

    * Clean code

    * Refine layout logic

    * Add CharcoalSnackBar

    * Update CharcoalSnackBar.swift

    * Update CharcoalSnackBar.swift

    * Refine layout logic

    * Refine toasts text

    * Update CharcoalToastDraggableModifier.swift

    * Add CharcoalRubberGesture

    * use id to notify did dismiss

    * Add rubber gesture

    * Refactor

    * Refactor

    * Fix memory leak

    * Format

    * Fix memory leak

    * Add example

    * Refine snackbar

    * Refine swift lint

    * Refactor CharcoalToastView

    * Refactor CharcoalSnackBarView

    * Reformat

    * Refine self logic

    * Add initial Balloon

    * Add line stroke

    * Refine radius

    * Fix the baseline alignment

    * Layout balloon elements

    * Clean

    * Add balloon view

    * Update layout logic

    * Refine balloon layout logic

    * Update CharcoalBalloonView.swift

    * Add demo

    * Add anchor view tracking

    * Move logics into updateConstraint

    * Update CharcoalBalloon.swift

    * Reformat code

    * reformat

    * Update formats and documents

    * Clean code

    * Refine documents

    * Update CharcoalBalloon.swift

    * Update CharcoalBalloon.swift

    * Reformat

    * Fix name

    * Fix geometry

    * Revert "Fix geometry"

    This reverts commit a89bf66feb82de8b2da1ba8c242ef4ac09d8f99c.

    * Fix proxy name

    * Adjust unused text

    * Replace charcoal logo

    * Remove conditional modifier

    * Add default dismiss time to toasts

    * Reformat

    * Reformat

    * Fix logo image

    * Fix balloon name

    * Update Balloons.swift

    * Remove CharcoalRubberGesture

    * Remove unused UIColor Extension

    * Clean Code

    * Clean proxy usage

    * Update Package.resolved

    * Add example to dismiss balloons with view

commit 5fdd8e93904ca61461de3de2407cddb2db119e9c
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Sep 24 17:00:40 2024 +0900

    Bump github.com/nicklockwood/swiftformat in /BuildTools (#267)

    Bumps [github.com/nicklockwood/swiftformat](https://github.com/nicklockwood/SwiftFormat) from 0.54.4 to 0.54.5.
    - [Release notes](https://github.com/nicklockwood/SwiftFormat/releases)
    - [Commits](https://github.com/nicklockwood/SwiftFormat/compare/0.54.4...0.54.5)

    ---
    updated-dependencies:
    - dependency-name: github.com/nicklockwood/swiftformat
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 5ccd42a771c78ada65f9df4d2ab9a59afe813639
Author: Kevin <[email protected]>
Date:   Tue Sep 10 16:39:50 2024 +0900

    Clean @warn_unqualified_access (#265)

    * clean warn_unqualified_access

    * Revert "clean warn_unqualified_access"

    This reverts commit 9613620b0a69ebbe68f921eccbecb8848c6658b5.

    * Reformat

commit f5c671070279e1c7d13152776a0d5e479b4a30d8
Author: Kevin <[email protected]>
Date:   Tue Sep 10 15:49:51 2024 +0900

    Revert "Clean Xcode 16 warning"

    This reverts commit 7168c655bf805ecb18615eacb48c3886daed3498.

commit 7168c655bf805ecb18615eacb48c3886daed3498
Author: Kevin <[email protected]>
Date:   Tue Sep 10 15:46:16 2024 +0900

    Clean Xcode 16 warning

commit 3725d99ac16403c4239895831180e5ab54977993
Author: Kevin <[email protected]>
Date:   Tue Sep 10 15:05:55 2024 +0900

    Feat SwiftUI Balloon (#251)

    * Add Tooltip view

    * Refactor Tooltip style

    * Can adjust tooltip position

    * Add tooltip playground for testing

    * Refine layout tips logic

    * Refine layout logic

    * Update CharcoalTooltip.swift

    * Refine tooltip spacing

    * Add CharcoalIdentifiableOverlayView

    * Use Actor to prevent Data Race

    * Remove CharcoalIdentifiableOverlayView out

    * Clean code

    * Only update view when it is isPresenting

    * Clean access control

    * Add TooltipsView

    * Fix tooltipY layout logic

    * Use main actor and remove CharcoalContainerManagerKey

    * Fix access control on CharcoalContainerManager

    * Make viewID as @State

    * Use EnviromentObject to create CharcoalContainerManager for each container

    * Use ObservedObject on  CharcoalContainerManager

    * Add use charcoal button as demo trigger

    * Add arrow logic on tooltip

    * Refine arrow logic

    * Refine arrow layout logic

    * Use StateObject to prevent unexpected reinit

    * Refactor TooltipBubbleShape

    * Fix edge layout logic

    * Add comment

    * Format code

    * Use new approach to remove adaptiveMaxWidth

    * Fix the tip bubble's position latency

    * Add dismiss when interaction

    * Reformat

    * Add initial Snackbar

    * Add thumbnail image

    * Add support for thumbnailImage and action

    * Clean code

    * Reformat code

    * Rename ActionContent

    * Replace thumbnailImage type

    * Add dismissOnTouchOutside control

    * Add comment on CharcoalIdentifiableOverlayView

    * Update CharcoalTooltip.swift

    * Add SnackBar demo

    * Replace thumbnail with charcoal logo

    * Use @ViewBuilder

    * Clean Code

    * Made code more readable

    * Update ToastsView.swift

    * Add auto dismiss logic

    * Fix dismiss comment

    * Add Identifiable to CharcoalIdentifiableOverlayView

    * Make all CharcoalPopupView identifiable

    * Move all control logic into CharcoalPopupView

    * Reformat

    * Refine CharcoalOverlayContainerChild logic of updating view

    * Rename to CharcoalOverlayUpdaterContainer

    * Add CharcoalToast

    * Refine toast control

    * Refine screen edge of toast

    * Refine comments

    * Rename CharcoalPopupProtocol

    * Refine isActuallyPresenting logic

    * Clean animation

    * Add animation configuration

    * Add custom animation

    * Add CharcoalToastProtocol

    * Makes CharcoalSnackBar adapt CharcoalToastProtocol

    * Remove time delay

    * Refine SnackBar Animation logic

    * Add CharcoalToastAnimationModifier

    * Reformat code

    * Update CharcoalPopupViewEdge of direction

    * Refine demo

    * Fix missing animation

    * Rename charcoalAnimatedToast to charcoalAnimatableToast

    * Rename CharcoalAnimatableToastProtocol

    * Rename for clean

    * Simplify protocols

    * Add drag control

    * Add Dismiss timer control logic

    * Refine drag damping logic

    * Add CharcoalToastDraggable

    * Use CharcoalToastDraggableModifier on CharcoalSnackBar

    * Format code

    * Add init structure

    * Add action button

    * Replace placeholder with ja text

    * Use CGPath union for iOS 16

    * Update TooltipBubbleShape.swift

    * Update CharcoalTooltip.swift

    * Use GeometryReader on overlay

    * Use new path draw logic

    * Refine arrow width

    * Refine arrow width

    * Clean Code

    * Refine preview

    * Use timer instead of DispatchQueue

    * Refine layout logic

    * Refine arrow logic

    * Refine layout logic

    * Add missing charcoalOverlayContainer

    * Add Balloon to examples

    * Add default tutorials

    * Remove overlay when disappear

    * Refine charcoalOverlayContainer place

    * Refine

    * Update CharcoalSnackBar.swift

    * Init CharcoalTooltipView

    * Init Bubble shape

    * Refine tooltip preview

    * Rename as Charcoal Bubble Shape

    * Add Label to tooltip

    * Update text frame when traitCollection did change

    * Update CharcoalTooltipView.swift

    * Add CharcoalTooltip

    * Can debug show on method

    * Can layout point

    * Can redraw target point

    * Update CharcoalTooltip.swift

    * Refine tooltip display

    * Share the logic

    * Use interaction mode

    * Use CharcoalOverlayContainerView

    * Update CharcoalOverlay.swift

    * Refactor to ChacoalOverlayManager

    * Makes CharcoalIdentifiableOverlayView  Identifiable

    * Refine layout logic

    * Add display(view: CharcoalIdentifiableOverlayView)

    * Add tooltip to uikit example

    * Update Tooltips.swift

    * Add CharcoalIdentifiableOverlayDelegate

    * Reformat

    * Update StringExtension.swift

    * Add to UIKitSample

    * Fix public requirements

    * Reformat

    * Use touch began to handle dismiss on touch

    * Update CharcoalIdentifiableOverlayView.swift

    * Add CharcoalToastView

    * change cornerRadius

    * Add CharcoalToast

    * Move show logic out

    * Reformat

    * Refine dismiss method

    * Update CharcoalToast.swift

    * Add ActionContent and ActionComplete callback

    * Update CharcoalToast.swift

    * Update CharcoalBubbleShape_UIKit.swift

    * Refine layout animation logic

    * Refine animation

    * Add dismiss

    * Add example

    * Reformat

    * Add toasts example

    * Add CharcoalSnackBarView

    * Update project.pbxproj

    * Clean code

    * Refine layout logic

    * Add CharcoalSnackBar

    * Update CharcoalSnackBar.swift

    * Update CharcoalSnackBar.swift

    * Refine layout logic

    * Refine toasts text

    * Update CharcoalToastDraggableModifier.swift

    * Add CharcoalRubberGesture

    * use id to notify did dismiss

    * Add rubber gesture

    * Refactor

    * Refactor

    * Fix memory leak

    * Format

    * Fix memory leak

    * Add example

    * Refine snackbar

    * Refine swift lint

    * Refactor CharcoalToastView

    * Refactor CharcoalSnackBarView

    * Reformat

    * Refine self logic

    * Reformat

    * Fix name

    * Fix geometry

    * Revert "Fix geometry"

    This reverts commit a89bf66feb82de8b2da1ba8c242ef4ac09d8f99c.

    * Fix proxy name

    * Adjust unused text

    * Replace charcoal logo

    * Remove conditional modifier

    * Add default dismiss time to toasts

    * Reformat

    * Reformat

    * Fix logo image

    * Fix balloon name

    * Remove CharcoalRubberGesture

    * Remove unused UIColor Extension

    * Clean Code

    * Clean proxy usage

    * Update Package.resolved

commit 40a982f5a87d1c4bb5b1f4fc292c2f49963e3e6d
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Sep 10 14:54:24 2024 +0900

    Bump github.com/nicklockwood/swiftformat in /BuildTools (#264)

    Bumps [github.com/nicklockwood/swiftformat](https://github.com/nicklockwood/SwiftFormat) from 0.54.3 to 0.54.4.
    - [Release notes](https://github.com/nicklockwood/SwiftFormat/releases)
    - [Commits](https://github.com/nicklockwood/SwiftFormat/compare/0.54.3...0.54.4)

    ---
    updated-dependencies:
    - dependency-name: github.com/nicklockwood/swiftformat
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit f2990c90cc26cb5e027dac06e62c627388bac91e
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Sep 10 14:54:12 2024 +0900

    Bump github.com/realm/swiftlint from 0.56.2 to 0.57.0 in /BuildTools (#263)

    Bumps [github.com/realm/swiftlint](https://github.com/realm/SwiftLint) from 0.56.2 to 0.57.0.
    - [Release notes](https://github.com/realm/SwiftLint/releases)
    - [Commits](https://github.com/realm/SwiftLint/compare/0.56.2...0.57.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/realm/swiftlint
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e5f593223f269fbbea277feeb5d261a6719fe26b
Author: Kevin <[email protected]>
Date:   Wed Sep 4 14:56:00 2024 +0900

    Fix dark mode support (#261)

    * Fix tooltip demo cell label dark mode

    * Fix dark mode enable logic

    * Use color to fix dynmaic color on iOS 17

    * Fix iOS 17 cgColor manually update

    * Fix traitCollectionDidChange

    * Fix cgColorUsage

    * Clean code

    * Reformat code

commit 1e0a061df0eb62bfd9beb4c0ab78405686545616
Author: Kevin <[email protected]>
Date:   Tue Sep 3 16:23:31 2024 +0800

    Refine auto dismiss to make it easier to test (#262)

    * Makes toast shows longer

    * Increase to 4 seconds

commit 23b472b7e128286f0ec1b98102973307c41f3eb2
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Sep 3 14:44:06 2024 +0900

    Bump @babel/runtime from 7.25.4 to 7.25.6 in /scripts/xcasset-gen (#260)

    Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.25.4 to 7.25.6.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.25.6/packages/babel-runtime)

    ---
    updated-dependencies:
    - dependency-name: "@babel/runtime"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 55a9659bb86ba0b900e18933796f1054438adb95
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Aug 30 15:54:02 2024 +0900

    Bump micromatch from 4.0.5 to 4.0.8 in /scripts/xcasset-gen (#259)

    Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5 to 4.0.8.
    - [Release notes](https://github.com/micromatch/micromatch/releases)
    - [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/micromatch/micromatch/compare/4.0.5...4.0.8)

    ---
    updated-dependencies:
    - dependency-name: micromatch
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 387fe9217b96c6321a8b5766e18cbbdcf531ac26
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Aug 27 10:18:54 2024 +0800

    Bump github.com/realm/swiftlint from 0.56.1 to 0.56.2 in /BuildTools (#258)

    Bumps [github.com/realm/swiftlint](https://github.com/realm/SwiftLint) from 0.56.1 to 0.56.2.
    - [Release notes](https://github.com/realm/SwiftLint/releases)
    - [Commits](https://github.com/realm/SwiftLint/compare/0.56.1...0.56.2)

    ---
    updated-dependencies:
    - dependency-name: github.com/realm/swiftlint
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit b56f347aff10f91815c7e52a50a3694abbab3a0c
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Aug 27 10:18:44 2024 +0800

    Bump @babel/runtime from 7.25.0 to 7.25.4 in /scripts/xcasset-gen (#257)

    Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.25.0 to 7.25.4.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.25.4/packages/babel-runtime)

    ---
    updated-dependencies:
    - dependency-name: "@babel/runtime"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 3ef31c3c3d50b0dd3e5c19bd858738ca942a2a68
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Aug 27 10:18:33 2024 +0800

    Bump @octokit/rest from 21.0.1 to 21.0.2 in /scripts/create-pull-request (#256)

    Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 21.0.1 to 21.0.2.
    - [Release notes](https://github.com/octokit/rest.js/releases)
    - [Commits](https://github.com/octokit/rest.js/compare/v21.0.1...v21.0.2)

    ---
    updated-dependencies:
    - dependency-name: "@octokit/rest"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit a4d9c27441f1414e41d62c38fe524152a1d6b47e
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Aug 14 13:49:31 2024 +0800

    Bump github.com/realm/swiftlint from 0.55.1 to 0.56.1 in /BuildTools (#255)

    Bumps [github.com/realm/swiftlint](https://github.com/realm/SwiftLint) from 0.55.1 to 0.56.1.
    - [Release notes](https://github.com/realm/SwiftLint/releases)
    - [Commits](https://github.com/realm/SwiftLint/compare/0.55.1...0.56.1)

    ---
    updated-dependencies:
    - dependency-name: github.com/realm/swiftlint
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit ce38d640e33c6fc3756fe605a7748485aff663eb
Author: Kevin <[email protected]>
Date:   Wed Aug 7 15:24:27 2024 +0800

    Feat UIKit Toast (#250)

    * Add Tooltip view

    * Refactor Tooltip style

    * Can adjust tooltip position

    * Add tooltip playground for testing

    * Refine layout tips logic

    * Refine layout logic

    * Update CharcoalTooltip.swift

    * Refine tooltip spacing

    * Add CharcoalIdentifiableOverlayView

    * Use Actor to prevent Data Race

    * Remove CharcoalIdentifiableOverlayView out

    * Clean code

    * Only update view when it is isPresenting

    * Clean access control

    * Add TooltipsView

    * Fix tooltipY layout logic

    * Use main actor and remove CharcoalContainerManagerKey

    * Fix access control on CharcoalContainerManager

    * Make viewID as @State

    * Use EnviromentObject to create CharcoalContainerManager for each container

    * Use ObservedObject on  CharcoalContainerManager

    * Add use charcoal button as demo trigger

    * Add arrow logic on tooltip

    * Refine arrow logic

    * Refine arrow layout logic

    * Use StateObject to prevent unexpected reinit

    * Refactor TooltipBubbleShape

    * Fix edge layout logic

    * Add comment

    * Format code

    * Use new approach to remove adaptiveMaxWidth

    * Fix the tip bubble's position latency

    * Add dismiss when interaction

    * Reformat

    * Add initial Snackbar

    * Add thumbnail image

    * Add support for thumbnailImage and action

    * Clean code

    * Reformat code

    * Rename ActionContent

    * Replace thumbnailImage type

    * Add dismissOnTouchOutside control

    * Add comment on CharcoalIdentifiableOverlayView

    * Update CharcoalTooltip.swift

    * Add SnackBar demo

    * Replace thumbnail with charcoal logo

    * Use @ViewBuilder

    * Clean Code

    * Made code more readable

    * Update ToastsView.swift

    * Add auto dismiss logic

    * Fix dismiss comment

    * Add Identifiable to CharcoalIdentifiableOverlayView

    * Make all CharcoalPopupView identifiable

    * Move all control logic into CharcoalPopupView

    * Reformat

    * Refine CharcoalOverlayContainerChild logic of updating view

    * Rename to CharcoalOverlayUpdaterContainer

    * Add CharcoalToast

    * Refine toast control

    * Refine screen edge of toast

    * Refine comments

    * Rename CharcoalPopupProtocol

    * Refine isActuallyPresenting logic

    * Clean animation

    * Add animation configuration

    * Add custom animation

    * Add CharcoalToastProtocol

    * Makes CharcoalSnackBar adapt CharcoalToastProtocol

    * Remove time delay

    * Refine SnackBar Animation logic

    * Add CharcoalToastAnimationModifier

    * Reformat code

    * Update CharcoalPopupViewEdge of direction

    * Refine demo

    * Fix missing animation

    * Rename charcoalAnimatedToast to charcoalAnimatableToast

    * Rename CharcoalAnimatableToastProtocol

    * Rename for clean

    * Simplify protocols

    * Add drag control

    * Add Dismiss timer control logic

    * Refine drag damping logic

    * Add CharcoalToastDraggable

    * Use CharcoalToastDraggableModifier on CharcoalSnackBar

    * Format code

    * Init CharcoalTooltipView

    * Init Bubble shape

    * Refine tooltip preview

    * Rename as Charcoal Bubble Shape

    * Add Label to tooltip

    * Update text frame when traitCollection did change

    * Update CharcoalTooltipView.swift

    * Add CharcoalTooltip

    * Can debug show on method

    * Can layout point

    * Can redraw target point

    * Update CharcoalTooltip.swift

    * Refine tooltip display

    * Share the logic

    * Use interaction mode

    * Use CharcoalOverlayContainerView

    * Update CharcoalOverlay.swift

    * Refactor to ChacoalOverlayManager

    * Makes CharcoalIdentifiableOverlayView  Identifiable

    * Refine layout logic

    * Add display(view: CharcoalIdentifiableOverlayView)

    * Add tooltip to uikit example

    * Update Tooltips.swift

    * Add CharcoalIdentifiableOverlayDelegate

    * Reformat

    * Update StringExtension.swift

    * Add to UIKitSample

    * Fix public requirements

    * Reformat

    * Use touch began to handle dismiss on touch

    * Update CharcoalIdentifiableOverlayView.swift

    * Add CharcoalToastView

    * change cornerRadius

    * Add CharcoalToast

    * Move show logic out

    * Reformat

    * Refine dismiss method

    * Update CharcoalToast.swift

    * Add ActionContent and ActionComplete callback

    * Update CharcoalToast.swift

    * Update CharcoalBubbleShape_UIKit.swift

    * Refine layout animation logic

    * Refine animation

    * Add dismiss

    * Add example

    * Reformat

    * Add toasts example

    * Add CharcoalSnackBarView

    * Update project.pbxproj

    * Clean code

    * Refine layout logic

    * Add CharcoalSnackBar

    * Update CharcoalSnackBar.swift

    * Update CharcoalSnackBar.swift

    * Refine layout logic

    * Refine toasts text

    * Update CharcoalToastDraggableModifier.swift

    * Add CharcoalRubberGesture

    * use id to notify did dismiss

    * Add rubber gesture

    * Refactor

    * Refactor

    * Fix memory leak

    * Format

    * Fix memory leak

    * Add example

    * Refine snackbar

    * Refine swift lint

    * Refactor CharcoalToastView

    * Refactor CharcoalSnackBarView

    * Reformat

    * Refine self logic

    * Reformat

    * Fix name

    * Fix geometry

    * Revert "Fix geometry"

    This reverts commit a89bf66feb82de8b2da1ba8c242ef4ac09d8f99c.

    * Fix proxy name

    * Adjust unused text

    * Replace charcoal logo

    * Remove conditional modifier

    * Add default dismiss time to toasts

    * Reformat

    * Fix logo image

    * Move imageWithColor out of shared

    * Refine toast with action callback

    * Clean code

    * Refine toasts looking

    * Reformat

    * Update CharcoalToast.swift

    * Refine gesture animator

    * Rename toast as snackbar

    * Remove deinit

commit 5c0761b147c2f7c60737c211930ef38ed5c052ee
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Aug 6 14:52:23 2024 +0800

    Bump @babel/runtime from 7.24.8 to 7.25.0 in /scripts/xcasset-gen (#253)

    Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.24.8 to 7.25.0.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.25.0/packages/babel-runtime)

    ---
    updated-dependencies:
    - dependency-name: "@babel/runtime"
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 5a64efd6f7117faa4a212f0986b7f7e54434bbb9
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Aug 6 14:51:54 2024 +0800

    Bump github.com/nicklockwood/swiftformat in /BuildTools (#254)

    Bumps [github.com/nicklockwood/swiftformat](https://github.com/nicklockwood/SwiftFormat) from 0.54.1 to 0.54.3.
    - [Release notes](https://github.com/nicklockwood/SwiftFormat/releases)
    - [Commits](https://github.com/nicklockwood/SwiftFormat/compare/0.54.1...0.54.3)

    ---
    updated-dependencies:
    - dependency-name: github.com/nicklockwood/swiftformat
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit b238c37e0cbcebccaf2e5be4cdaad466624f73f3
Author: Kevin <[email protected]>
Date:   Wed Jul 24 14:03:52 2024 +0800

    Feat SwiftUI Toast (#245)

    * Add Tooltip view

    * Refactor Tooltip style

    * Can adjust tooltip position

    * Add tooltip playground for testing

    * Refine layout tips logic

    * Refine layout logic

    * Update CharcoalTooltip.swift

    * Refine tooltip spacing

    * Add CharcoalIdentifiableOverlayView

    * Use Actor to prevent Data Race

    * Remove CharcoalIdentifiableOverlayView out

    * Clean code

    * Only update view when it is isPresenting

    * Clean access control

    * Add TooltipsView

    * Fix tooltipY layout logic

    * Use main actor and remove CharcoalContainerManagerKey

    * Fix access control on CharcoalContainerManager

    * Make viewID as @State

    * Use EnviromentObject to create CharcoalContainerManager for each container

    * Use ObservedObject on  CharcoalContainerManager

    * Add use charcoal button as demo trigger

    * Add arrow logic on tooltip

    * Refine arrow logic

    * Refine arrow layout logic

    * Use StateObject to prevent unexpected reinit

    * Refactor TooltipBubbleShape

    * Fix edge layout logic

    * Add comment

    * Format code

    * Use new approach to remove adaptiveMaxWidth

    * Fix the tip bubble's position latency

    * Add dismiss when interaction

    * Reformat

    * Add initial Snackbar

    * Add thumbnail image

    * Add support for thumbnailImage and action

    * Clean code

    * Reformat code

    * Rename ActionContent

    * Replace thumbnailImage type

    * Add dismissOnTouchOutside control

    * Add comment on CharcoalIdentifiableOverlayView

    * Update CharcoalTooltip.swift

    * Add SnackBar demo

    * Replace thumbnail with charcoal logo

    * Use @ViewBuilder

    * Clean Code

    * Made code more readable

    * Update ToastsView.swift

    * Add auto dismiss logic

    * Fix dismiss comment

    * Add Identifiable to CharcoalIdentifiableOverlayView

    * Make all CharcoalPopupView identifiable

    * Move all control logic into CharcoalPopupView

    * Reformat

    * Refine CharcoalOverlayContainerChild logic of updating view

    * Rename to CharcoalOverlayUpdaterContainer

    * Add CharcoalToast

    * Refine toast control

    * Refine screen edge of toast

    * Refine comments

    * Rename CharcoalPopupProtocol

    * Refine isActuallyPresenting logic

    * Clean animation

    * Add animation configuration

    * Add custom animation

    * Add CharcoalToastProtocol

    * Makes CharcoalSnackBar adapt CharcoalToastProtocol

    * Remove time delay

    * Refine SnackBar Animation logic

    * Add CharcoalToastAnimationModifier

    * Reformat code

    * Update CharcoalPopupViewEdge of direction

    * Refine demo

    * Fix missing animation

    * Rename charcoalAnimatedToast to charcoalAnimatableToast

    * Rename CharcoalAnimatableToastProtocol

    * Rename for clean

    * Simplify protocols

    * Add drag control

    * Add Dismiss timer control logic

    * Refine drag damping logic

    * Add CharcoalToastDraggable

    * Use CharcoalToastDraggableModifier on CharcoalSnackBar

    * Format code

    * Init CharcoalTooltipView

    * Init Bubble shape

    * Refine tooltip preview

    * Rename as Charcoal Bubble Shape

    * Add Label to tooltip

    * Update text frame when traitCollection did change

    * Update CharcoalTooltipView.swift

    * Add CharcoalTooltip

    * Can debug show on method

    * Can layout point

    * Can redraw target point

    * Update CharcoalTooltip.swift

    * Refine tooltip display

    * Share the logic

    * Use interaction mode

    * Use CharcoalOverlayContainerView

    * Update CharcoalOverlay.swift

    * Refactor to ChacoalOverlayManager

    * Makes CharcoalIdentifiableOverlayView  Identifiable

    * Refine layout logic

    * Add display(view: CharcoalIdentifiableOverlayView)

    * Add tooltip to uikit example

    * Update Tooltips.swift

    * Add CharcoalIdentifiableOverlayDelegate

    * Reformat

    * Update StringExtension.swift

    * Add to UIKitSample

    * Fix public requirements

    * Reformat

    * Use touch began to handle dismiss on touch

    * Update CharcoalIdentifiableOverlayView.swift

    * Move show logic out

    * Reformat

    * Refine dismiss method

    * Add ActionContent and ActionComplete callback

    * Update CharcoalBubbleShape_UIKit.swift

    * Reformat

    * Fix name

    * Fix geometry

    * Revert "Fix geometry"

    This reverts commit a89bf66feb82de8b2da1ba8c242ef4ac09d8f99c.

    * Fix proxy name

    * Adjust unused text

    * Replace charcoal logo

    * Remove conditional modifier

    * Add default dismiss time to toasts

    * Reformat

commit 5cfd721f2d891de56496de3e953f6b5819279899
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 23 12:41:23 2024 +0800

    Bump @octokit/rest from 21.0.0 to 21.0.1 in /scripts/create-pull-request (#249)

    Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 21.0.0 to 21.0.1.
    - [Release notes](https://github.com/octokit/rest.js/releases)
    - [Commits](https://github.com/octokit/rest.js/compare/v21.0.0...v21.0.1)

    ---
    updated-dependencies:
    - dependency-name: "@octokit/rest"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 9e3a42da1f52f70c9d0a68f2af5d43972da5a934
Author: Kevin <[email protected]>
Date:   Tue Jul 23 13:41:03 2024 +0900

    Feat tooltip unit test (#246)

    * Add tooltip unit test

    * Reformat

commit dc8b1de207b5c1ffe7aee4ee7d67b31f1ec8f900
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 16 13:10:22 2024 +0800

    Bump github.com/nicklockwood/swiftformat in /BuildTools (#248)

    Bumps [github.com/nicklockwood/swiftformat](https://github.com/nicklockwood/SwiftFormat) from 0.54.0 to 0.54.1.
    - [Release notes](https://github.com/nicklockwood/SwiftFormat/releases)
    - [Commits](https://github.com/nicklockwood/SwiftFormat/compare/0.54.0...0.54.1)

    ---
    updated-dependencies:
    - dependency-name: github.com/nicklockwood/swiftformat
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit d79cae70c5255b904db21f6942d39a09d6bf94ce
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 16 13:10:11 2024 +0800

    Bump @babel/runtime from 7.24.7 to 7.24.8 in /scripts/xcasset-gen (#247)

    Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.24.7 to 7.24.8.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.24.8/packages/babel-runtime)

    ---
    updated-dependencies:
    - dependency-name: "@babel/runtime"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit babc0d47b6a25af5c75677274a4c4090865ad5fc
Author: Kevin <[email protected]>
Date:   Wed Jul 10 16:43:29 2024 +0900

    Feat UIKit Tooltip (#232)

    * Add Tooltip view

    * Refactor Tooltip style

    * Can adjust tooltip position

    * Add tooltip playground for testing

    * Refine layout tips logic

    * Refine layout logic

    * Update CharcoalTooltip.swift

    * Refine tooltip spacing

    * Add CharcoalIdentifiableOverlayView

    * Use Actor to prevent Data Race

    * Remove CharcoalIdentifiableOverlayView out

    * Clean code

    * Only update view when it is isPresenting

    * Clean access control

    * Add TooltipsView

    * Fix tooltipY layout logic

    * Use main actor and remove CharcoalContainerManagerKey

    * Fix access control on CharcoalContainerManager

    * Make viewID as @State

    * Use EnviromentObject to create CharcoalContainerManager for each container

    * Use ObservedObject on  CharcoalContainerManager

    * Add use charcoal button as demo trigger

    * Add arrow logic on tooltip

    * Refine arrow logic

    * Refine arrow layout logic

    * Use StateObject to prevent unexpected reinit

    * Refactor TooltipBubbleShape

    * Fix edge layout logic

    * Add comment

    * Format code

    * Use new approach to remove adaptiveMaxWidth

    * Fix the tip bubble's position latency

    * Add dismiss when interaction

    * Reformat

    * Init CharcoalTooltipView

    * Init Bubble shape

    * Refine tooltip preview

    * Rename as Charcoal Bubble Shape

    * Add Label to tooltip

    * Update text frame when traitCollection did change

    * Update CharcoalTooltipView.swift

    * Add CharcoalTooltip

    * Can debug show on method

    * Can layout point

    * Can redraw target point

    * Update CharcoalTooltip.swift

    * Refine tooltip display

    * Share the logic

    * Use interaction mode

    * Use CharcoalOverlayContainerView

    * Update CharcoalOverlay.swift

    * Refactor to ChacoalOverlayManager

    * Makes CharcoalIdentifiableOverlayView  Identifiable

    * Refine layout logic

    * Add display(view: CharcoalIdentifiableOverlayView)

    * Add tooltip to uikit example

    * Update Tooltips.swift

    * Add CharcoalIdentifiableOverlayDelegate

    * Reformat

    * Update StringExtension.swift

    * Add to UIKitSample

    * Fix public requirements

    * Reformat

    * Use touch began to handle dismiss on touch

    * Update CharcoalIdentifiableOverlayView.swift

    * Move show logic out

    * Reformat

    * Refine dismiss method

    * Add ActionContent and ActionComplete callback

    * Update CharcoalBubbleShape_UIKit.swift

    * Make use of Autolayout logic

    * Reformat

    * Refine deinit

    * Move config cell to TooltipTableViewCell

    * guard backgroundView == nil

    * Remove public of ChacoalOverlayManager

    * Make tooltipXY private

    * Reformat

    * refactor backgroundView

commit 5da0586ec659d14f048cd46f29eb75c329f59ea4
Author: Kevin <[email protected]>
Date:   Tue Jul 9 15:45:14 2024 +0900

    Update swiftlint from kwzr (#244)

commit 7f77d3f77e9e3abb3a08a9c12542e987f81d59d8
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jul 3 16:48:37 2024 +0900

    Bump globby from 14.0.1 to 14.0.2 in /scripts/xcasset-gen (#242)

    Bumps [globby](https://github.com/sindresorhus/globby) from 14.0.1 to 14.0.2.
    - [Release notes](https://github.com/sindresorhus/globby/releases)
    - [Commits](https://github.com/sindresorhus/globby/compare/v14.0.1...v14.0.2)

    ---
    updated-dependencies:
    - dependency-name: globby
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 4f48445bf6a0ca4cf5d0033cabf5c8095e085e04
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jun 25 14:39:18 2024 +0900

    Bump @octokit/rest from 20.1.1 to 21.0.0 in /scripts/create-pull-request (#241)

    Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 20.1.1 to 21.0.0.
    - [Release notes](https://github.com/octokit/rest.js/releases)
    - [Commits](https://github.com/octokit/rest.js/compare/v20.1.1...v21.0.0)

    ---
    updated-dependencies:
    - dependency-name: "@octokit/rest"
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 9e4120412ee234d1298524bbad63b28a03b323d0
Author: Kevin <[email protected]>
Date:   Tue Jun 25 14:08:01 2024 +0900

    Feat SwiftUI Tooltip (#231)

    * Add Tooltip view

    * Refactor Tooltip style

    * Can adjust tooltip position

    * Add tooltip playground for testing

    * Refine layout tips logic

    * Refine layout logic

    * Update CharcoalTooltip.swift

    * Refine tooltip spacing

    * Add CharcoalIdentifiableOverlayView

    * Use Actor to prevent Data Race

    * Remove CharcoalIdentifiableOverlayView out

    * Clean code

    * Only update view when it is isPresenting

    * Clean access control

    * Add TooltipsView

    * Fix tooltipY layout logic

    * Use main actor and remove CharcoalContainerManagerKey

    * Fix access control on CharcoalContainerManager

    * Make viewID as @State

    * Use EnviromentObject to create CharcoalContainerManager for each container

    * Use ObservedObject on  CharcoalContainerManager

    * Add use charcoal button as demo trigger

    * Add arrow logic on tooltip

    * Refine arrow logic

    * Refine arrow layout logic

    * Use StateObject to prevent unexpected reinit

    * Refactor TooltipBubbleShape

    * Fix edge layout logic

    * Add comment

    * Format code

    * Use new approach to remove adaptiveMaxWidth

    * Fix the tip bubble's position latency

    * Add dismiss when interaction

    * Reformat

    * Fix public requirements

    * Rename all as proxy

commit 8ca7890cb6329782cb7aac5672cf00c85bf3bcaf
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jun 18 17:32:19 2024 +0900

    Bump github.com/nicklockwood/swiftformat in /BuildTools (#239)

    Bumps [github.com/nicklockwood/swiftformat](https://github.com/nicklockwood/SwiftFormat) from 0.53.10 to 0.54.0.
    - [Release notes](https://github.com/nicklockwood/SwiftFormat/releases)
    - [Commits](https://github.com/nicklockwood/SwiftFormat/compare/0.53.10...0.54.0)

    ---
    updated-dependencies:
    - dependency-name: github.com/nicklockwood/swiftformat
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 09d369d79a099d8495d4712683e5f6eefdf978e3
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jun 18 14:39:42 2024 +0900

    Bump @babel/runtime from 7.24.6 to 7.24.7 in /scripts/xcasset-gen (#240)

    Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.24.6 to 7.24.7.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.24.7/packages/babel-runtime)

    ---
    updated-dependencies:
    - dependency-name: "@babel/runtime"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit b7b97a914fdd36141f460b22308545146199f89f
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jun 18 14:39:11 2024 +0900

    Bump braces from 3.0.2 to 3.0.3 in /scripts/xcasset-gen (#235)

    Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
    - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

    ---
    updated-dependencies:
    - dependency-name: braces
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit fd813f45d4162a4fca5b5108e38837f90d974b92
Author: Kevin <[email protected]>
Date:   Tue Jun 18 14:38:45 2024 +0900

    override overrideUserInterfaceStyle (#236)

commit 5f670cadeb5e34889ab621ecd9b8b642a39ef864
Author: Kevin <[email protected]>
Date:   Wed Jun 12 21:13:25 2024 +0900

    Revert "Bump @babel/runtime from 7.24.6 to 7.24.7 in /scripts/xcasset-gen (#234)"

    This reverts commit ab74d37b75fc502595b8564f7fa2d0acc8c2aab3.

commit ab74d37b75fc502595b8564f7fa2d0acc8c2aab3
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Jun 12 15:37:37 2024 +0900

    Bump @babel/runtime from 7.24.6 to 7.24.7 in /scripts/xcasset-gen (#234)

    Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.24.6 to 7.24.7.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.24.7/packages/babel-runtime)

    ---
    updated-dependencies:
    - dependency-name: "@babel/runtime"
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e4b6a2cfe63cfb1e11272344a500f7e6004ea8fe
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jun 4 14:05:48 2024 +0900

    Bump quicktype-core from 23.0.168 to 23.0.170 in /scripts/foundation-gen (#233)

    Bumps [quicktype-core](https://github.com/quicktype/quicktype) from 23.0.168 to 23.0.170.
    - [Commits](https://github.com/quicktype/quicktype/commits)

    ---
    updated-dependencies:
    - dependency-name: quicktype-core
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Delete スクリーンショット 2024-02-21 17.28.10.png

* Fixed icon and refine spacing

* Clean files

* Use shared CharcoalAction
  • Loading branch information
kevinneko authored Oct 22, 2024
1 parent 9bd2671 commit 5eb0378
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public final class ContentViewController: UIViewController {
case tooltips = "Tooltips"
case toasts = "Toasts"
case spinners = "Spinners"
case hints = "Hints"
case balloons = "Balloons"

var viewController: UIViewController {
Expand All @@ -74,6 +75,8 @@ public final class ContentViewController: UIViewController {
return ToastsViewController()
case .spinners:
return SpinnersViewController()
case .hints:
return HintsViewController()
case .balloons:
return BalloonsViewController()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import Charcoal
import UIKit

final class HintsViewController: UIViewController {
private lazy var scrollView: UIScrollView = {
let view = UIScrollView(frame: .zero)
view.bounces = true
view.translatesAutoresizingMaskIntoConstraints = false
return view
}()

private lazy var stackView: UIStackView = {
let view = UIStackView(frame: .zero)
view.axis = .vertical
view.spacing = 16
view.alignment = .center
view.distribution = .equalSpacing
view.translatesAutoresizingMaskIntoConstraints = false
return view
}()

let cellReuseIdentifier = "cell"

private var hints: [CharcoalHintView] = [
CharcoalHintView(text: "Hello World"),
CharcoalHintView(text: "ブックマークしました"),
CharcoalHintView(text: "ブックマークしました", action: CharcoalAction(title: "Button", actionCallback: {
print("Button taped")
})),
CharcoalHintView(
text: "こんにちは",
action: CharcoalAction(title: "Button", actionCallback: {
print("Button taped")
})
)
]

private var switchingButton: CharcoalSwitchingButton!

override func viewDidLoad() {
super.viewDidLoad()
setupUI()
addHintViews()
}

private func setupUI() {
view.backgroundColor = UIColor.systemBackground

view.addSubview(scrollView)

NSLayoutConstraint.activate([
scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
scrollView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
scrollView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor)
])

scrollView.addSubview(stackView)

NSLayoutConstraint.activate([
stackView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16),
stackView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -16),
stackView.topAnchor.constraint(equalTo: scrollView.topAnchor),
stackView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor)
])
}

private func addHintViews() {
for example in hints {
let hint = example
hint.translatesAutoresizingMaskIntoConstraints = false
stackView.addArrangedSubview(hint)
hint.widthAnchor.constraint(equalTo: stackView.widthAnchor).isActive = true
}
}

}

@available(iOS 17.0, *)
#Preview {
let viewController = HintsViewController()
return viewController
}
154 changes: 154 additions & 0 deletions Sources/CharcoalUIKit/Components/Hints/HintView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
import UIKit

public class CharcoalHintView: UIView {
lazy var hStackView: UIStackView = {
let stackView = UIStackView()
stackView.axis = .horizontal
stackView.alignment = .center
stackView.spacing = 0
stackView.translatesAutoresizingMaskIntoConstraints = false
return stackView
}()

lazy var label: CharcoalTypography14 = {
let label = CharcoalTypography14()
label.numberOfLines = 0
label.translatesAutoresizingMaskIntoConstraints = false
label.textAlignment = .left
label.textColor = CharcoalAsset.ColorPaletteGenerated.text1.color
return label
}()

lazy var thumbnailImageView: UIImageView = {
let imageView = UIImageView()
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.contentMode = .scaleAspectFill
return imageView
}()

lazy var actionButton: CharcoalPrimarySButton = {
let button = CharcoalPrimarySButton()
return button
}()

let thumbnailImage: UIImage = CharcoalAsset.Images.info16.image

var action: CharcoalAction?

let text: String

/// The corner radius of the snackbar
let cornerRadius: CGFloat = 8

/// Padding around the bubble
let padding = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)

public init(text: String, action: CharcoalAction? = nil) {
self.action = action
self.text = text
super.init(frame: .zero)
self.hStackView.spacing = 4
if let action = action {
actionButton.setTitle(action.title, for: .normal)
}
setupLayer()
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

private func setupCapsuleShape() {
layer.backgroundColor = CharcoalAsset.ColorPaletteGenerated.surface3.color.cgColor
layer.masksToBounds = true
layer.cornerRadius = cornerRadius
layer.cornerCurve = .continuous
}

private func addThumbnailView() {
thumbnailImageView.image = thumbnailImage
hStackView.addArrangedSubview(thumbnailImageView)
NSLayoutConstraint.activate([
thumbnailImageView.widthAnchor.constraint(equalToConstant: 16),
thumbnailImageView.heightAnchor.constraint(equalToConstant: 16)
])
}

private func addTextLabel() {
hStackView.addArrangedSubview(label)
label.text = text
label.setContentHuggingPriority(.defaultLow, for: .horizontal)
label.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
}

private func addActionButton() {
if let _ = action {
actionButton.addTarget(self, action: #selector(actionButtonTapped), for: .touchUpInside)
hStackView.addArrangedSubview(actionButton)
actionButton.widthAnchor.constraint(equalToConstant: actionButton.intrinsicContentSize.width).isActive = true
}
}

private func setupLayer() {
// Setup Bubble Shape
setupCapsuleShape()

// Add HStack
addSubview(hStackView)
NSLayoutConstraint.activate([
hStackView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: padding.left),
hStackView.topAnchor.constraint(equalTo: topAnchor, constant: padding.top),
hStackView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -padding.bottom),
hStackView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -padding.right)
])


// Add thumbnail view
addThumbnailView()

// Add text label with padding view
addTextLabel()

// Add action button
addActionButton()
}

@objc func actionButtonTapped() {
action?.actionCallback()
}
}

@available(iOS 17.0, *)
#Preview(traits: .sizeThatFitsLayout) {
let stackView = UIStackView()
stackView.axis = .vertical
stackView.distribution = .fill
stackView.alignment = .center
stackView.spacing = 8.0

stackView.widthAnchor.constraint(equalToConstant: 300).isActive = true

let snackbar = CharcoalHintView(text: "Hello World")
stackView.addArrangedSubview(snackbar)

let snackbar2 = CharcoalHintView(text: "ブックマークしました")
stackView.addArrangedSubview(snackbar2)
snackbar2.widthAnchor.constraint(equalTo: stackView.widthAnchor).isActive = true

let snackbar3 = CharcoalHintView(text: "ブックマークしました", action: CharcoalAction(title: "編集", actionCallback: {
print("編集 taped")
}))
stackView.addArrangedSubview(snackbar3)

let snackbar4 = CharcoalHintView(
text: "こんにちは",
action: CharcoalAction(title: "編集", actionCallback: {
print("編集 taped")
})
)
stackView.addArrangedSubview(snackbar4)
snackbar4.widthAnchor.constraint(equalTo: stackView.widthAnchor).isActive = true

return stackView
}

0 comments on commit 5eb0378

Please sign in to comment.