@dotss/tictoccroc 0.4.1 → 0.5.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.
Files changed (205) hide show
  1. package/dist/Calendar-BOLCHnjh.js +97 -0
  2. package/dist/TimePicker-BwACyeBR.js +120 -0
  3. package/dist/convertMdToHtml-Bmk0brLK.js +1431 -0
  4. package/dist/index.mjs +105 -200
  5. package/dist/parent/b2b/components/ActionButtons/ActionButtons.mjs +26 -29
  6. package/dist/parent/b2b/components/ActionButtons/index.mjs +5 -4
  7. package/dist/parent/b2b/components/BottomNotes/BottomNotes.mjs +37 -35
  8. package/dist/parent/b2b/components/BottomNotes/index.mjs +5 -4
  9. package/dist/parent/b2b/components/EmployeeNumberField/EmployeeNumberField.mjs +12 -15
  10. package/dist/parent/b2b/components/EmployeeNumberField/index.mjs +5 -4
  11. package/dist/parent/b2b/components/NameField/NameField.mjs +12 -7
  12. package/dist/parent/b2b/components/NameField/index.mjs +5 -4
  13. package/dist/parent/b2b/components/PhoneNumberField/PhoneNumberField.mjs +27 -30
  14. package/dist/parent/b2b/components/PhoneNumberField/PhoneNumberField.utils.mjs +7 -8
  15. package/dist/parent/b2b/components/PhoneNumberField/index.mjs +6 -7
  16. package/dist/parent/b2b/components/Title/Title.mjs +22 -16
  17. package/dist/parent/b2b/components/Title/index.mjs +4 -3
  18. package/dist/parent/b2b/components/TopLogo/TopLogo.mjs +55 -93
  19. package/dist/parent/b2b/components/TopLogo/index.mjs +5 -4
  20. package/dist/parent/b2b/components/index.mjs +9 -19
  21. package/dist/parent/b2b/utils/convertMdToHtml/convertMdToHtml.mjs +2 -1143
  22. package/dist/parent/b2b/utils/index.mjs +2 -4
  23. package/dist/parent/notification/components/NotificationCard/NotificationCard.d.ts +3 -1
  24. package/dist/parent/notification/components/NotificationCard/NotificationCard.mjs +90 -105
  25. package/dist/parent/notification/components/NotificationCard/index.mjs +5 -4
  26. package/dist/parent/notification/components/index.mjs +2 -4
  27. package/dist/parent/notification/utils/index.mjs +2 -4
  28. package/dist/parent/notification/utils/sanitize/sanitize.mjs +6 -6
  29. package/dist/purify.es-D3W4zDrg.js +549 -0
  30. package/dist/shared/components/Calendar/Calendar.mjs +2 -80
  31. package/dist/shared/components/Calendar/index.mjs +5 -4
  32. package/dist/shared/components/Carousel/Carousel.mjs +184 -210
  33. package/dist/shared/components/Carousel/CarouselSlide/CarouselSlide.mjs +10 -7
  34. package/dist/shared/components/Carousel/CarouselSlide/index.mjs +5 -4
  35. package/dist/shared/components/Carousel/index.mjs +6 -6
  36. package/dist/shared/components/ChatKit/BotMessage/BotMessage.mjs +151 -183
  37. package/dist/shared/components/ChatKit/BotMessage/BotMessage.utils.mjs +30 -50
  38. package/dist/shared/components/ChatKit/BotMessage/index.mjs +6 -8
  39. package/dist/shared/components/ChatKit/InputBar/InputBar.fallback.mjs +64 -84
  40. package/dist/shared/components/ChatKit/InputBar/InputBar.mjs +105 -130
  41. package/dist/shared/components/ChatKit/InputBar/index.mjs +6 -6
  42. package/dist/shared/components/ChatKit/Message/Message.fallback.mjs +50 -66
  43. package/dist/shared/components/ChatKit/Message/Message.mjs +178 -276
  44. package/dist/shared/components/ChatKit/Message/Message.utils.mjs +20 -31
  45. package/dist/shared/components/ChatKit/Message/index.mjs +7 -9
  46. package/dist/shared/components/ChatKit/Seperator/Seperator.mjs +31 -27
  47. package/dist/shared/components/ChatKit/Seperator/index.mjs +4 -3
  48. package/dist/shared/components/ChatKit/SystemMessage/(Actions)/DirectTrageRiskInfoBottomSheet/DirectTrageRiskInfoBottomSheet.mjs +183 -153
  49. package/dist/shared/components/ChatKit/SystemMessage/SystemMessage.mjs +83 -108
  50. package/dist/shared/components/ChatKit/SystemMessage/SystemMessage.utils.mjs +5 -5
  51. package/dist/shared/components/ChatKit/SystemMessage/index.mjs +7 -8
  52. package/dist/shared/components/ChatKit/UnreadMessagePill/UnreadMessagePill.mjs +49 -54
  53. package/dist/shared/components/ChatKit/UnreadMessagePill/index.mjs +5 -4
  54. package/dist/shared/components/ChatKit/index.mjs +13 -29
  55. package/dist/shared/components/Image/Image.d.ts +2 -0
  56. package/dist/shared/components/Image/Image.error.mjs +34 -40
  57. package/dist/shared/components/Image/Image.mjs +247 -289
  58. package/dist/shared/components/Image/index.mjs +6 -6
  59. package/dist/shared/components/LoadingAnnouncer/LoadingAnnouncer.mjs +19 -18
  60. package/dist/shared/components/LoadingAnnouncer/index.mjs +5 -4
  61. package/dist/shared/components/Masonry/Masonry.mjs +240 -276
  62. package/dist/shared/components/Masonry/Masonry.utils.mjs +62 -81
  63. package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.mjs +111 -144
  64. package/dist/shared/components/Masonry/MasonryBlock/index.mjs +5 -4
  65. package/dist/shared/components/Masonry/index.mjs +6 -6
  66. package/dist/shared/components/MediaDialog/MediaBlock/MediaBlock.mjs +54 -69
  67. package/dist/shared/components/MediaDialog/MediaBlock/index.mjs +5 -4
  68. package/dist/shared/components/MediaDialog/MediaDialog.mjs +216 -330
  69. package/dist/shared/components/MediaDialog/MediaDialogContent/MediaDialogContent.mjs +18 -21
  70. package/dist/shared/components/MediaDialog/MediaDialogContent/index.mjs +5 -4
  71. package/dist/shared/components/MediaDialog/MediaDialogFooter/MediaDialogFooter.mjs +22 -27
  72. package/dist/shared/components/MediaDialog/MediaDialogFooter/index.mjs +5 -4
  73. package/dist/shared/components/MediaDialog/MediaDialogToolbar/MediaDialogToolbar.mjs +15 -21
  74. package/dist/shared/components/MediaDialog/MediaDialogToolbar/index.mjs +5 -4
  75. package/dist/shared/components/MediaDialog/index.mjs +9 -12
  76. package/dist/shared/components/Roller/Roller.mjs +99 -132
  77. package/dist/shared/components/Roller/RollerBlock/RollerBlock.mjs +9 -6
  78. package/dist/shared/components/Roller/RollerBlock/index.mjs +5 -4
  79. package/dist/shared/components/Roller/index.mjs +6 -6
  80. package/dist/shared/components/Scheduler/ScheduleBlock/ScheduleBlock.mjs +22 -30
  81. package/dist/shared/components/Scheduler/ScheduleBlock/index.mjs +5 -4
  82. package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.mjs +25 -35
  83. package/dist/shared/components/Scheduler/ScheduleEvent/index.mjs +5 -4
  84. package/dist/shared/components/Scheduler/Scheduler.mjs +472 -567
  85. package/dist/shared/components/Scheduler/Scheduler.utils.mjs +78 -101
  86. package/dist/shared/components/Scheduler/index.mjs +8 -10
  87. package/dist/shared/components/Swiper/Swiper.mjs +238 -283
  88. package/dist/shared/components/Swiper/Swiper.utils.mjs +19 -24
  89. package/dist/shared/components/Swiper/SwiperBlock/SwiperBlock.mjs +14 -17
  90. package/dist/shared/components/Swiper/SwiperBlock/index.mjs +5 -4
  91. package/dist/shared/components/Swiper/index.mjs +6 -6
  92. package/dist/shared/components/TextField/TextField.mjs +44 -55
  93. package/dist/shared/components/TextField/index.mjs +5 -4
  94. package/dist/shared/components/TimePicker/TimePicker.mjs +2 -120
  95. package/dist/shared/components/TimePicker/index.mjs +5 -4
  96. package/dist/shared/components/index.mjs +36 -75
  97. package/dist/shared/hooks/index.mjs +4 -8
  98. package/dist/shared/hooks/useCombineRef/index.mjs +5 -4
  99. package/dist/shared/hooks/useCombineRef/useCombineRef.mjs +7 -7
  100. package/dist/shared/hooks/useInView/index.mjs +5 -4
  101. package/dist/shared/hooks/useInView/useInView.d.ts +2 -1
  102. package/dist/shared/hooks/useInView/useInView.mjs +37 -47
  103. package/dist/shared/hooks/useIsomorphicLayoutEffect/index.mjs +5 -4
  104. package/dist/shared/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs +6 -6
  105. package/dist/shared/typings/common.mjs +6 -4
  106. package/dist/shared/typings/index.mjs +2 -4
  107. package/dist/shared/utils/ageToBirthDate/ageToBirthDate.mjs +17 -9
  108. package/dist/shared/utils/ageToBirthDate/index.mjs +5 -4
  109. package/dist/shared/utils/birthDateToAge/birthDateToAge.mjs +9 -10
  110. package/dist/shared/utils/birthDateToAge/index.mjs +4 -3
  111. package/dist/shared/utils/combineRef/combineRef.mjs +20 -23
  112. package/dist/shared/utils/combineRef/index.mjs +5 -4
  113. package/dist/shared/utils/dayFlagToDay/dayFlagToDay.mjs +15 -23
  114. package/dist/shared/utils/dayFlagToDay/index.mjs +5 -4
  115. package/dist/shared/utils/getCareTypeLabel/getCareTypeLabel.mjs +13 -20
  116. package/dist/shared/utils/getCareTypeLabel/index.mjs +5 -4
  117. package/dist/shared/utils/getDateRange/getDateRange.mjs +15 -20
  118. package/dist/shared/utils/getDateRange/index.mjs +5 -4
  119. package/dist/shared/utils/getImageUrl/getImageUrl.mjs +7 -17
  120. package/dist/shared/utils/getImageUrl/index.mjs +5 -6
  121. package/dist/shared/utils/getTimeRange/getTimeRange.mjs +19 -21
  122. package/dist/shared/utils/getTimeRange/index.mjs +5 -4
  123. package/dist/shared/utils/getVimeoId/getVimeoId.mjs +11 -11
  124. package/dist/shared/utils/getVimeoId/index.mjs +5 -4
  125. package/dist/shared/utils/index.mjs +18 -36
  126. package/dist/shared/utils/isAndroid/index.mjs +5 -4
  127. package/dist/shared/utils/isAndroid/isAndroid.mjs +5 -5
  128. package/dist/shared/utils/isApp/index.mjs +5 -4
  129. package/dist/shared/utils/isApp/isApp.mjs +4 -4
  130. package/dist/shared/utils/isDesktop/index.mjs +5 -4
  131. package/dist/shared/utils/isDesktop/isDesktop.mjs +15 -15
  132. package/dist/shared/utils/isIos/index.mjs +5 -4
  133. package/dist/shared/utils/isIos/isIos.mjs +5 -5
  134. package/dist/shared/utils/isServer/index.mjs +4 -3
  135. package/dist/shared/utils/isServer/isServer.mjs +4 -4
  136. package/dist/shared/utils/objectToQueryString/index.mjs +5 -4
  137. package/dist/shared/utils/objectToQueryString/objectToQueryString.mjs +7 -8
  138. package/dist/shared/utils/parseQueryString/index.mjs +4 -3
  139. package/dist/shared/utils/parseQueryString/parseQueryString.mjs +5 -5
  140. package/dist/shared/utils/share/index.mjs +5 -4
  141. package/dist/shared/utils/share/share.mjs +12 -14
  142. package/dist/teacher/home/components/BannerAccount/BannerAccount.fallback.mjs +19 -11
  143. package/dist/teacher/home/components/BannerAccount/BannerAccount.mjs +83 -99
  144. package/dist/teacher/home/components/BannerAccount/index.mjs +6 -7
  145. package/dist/teacher/home/components/Carousel1Account/Carousel1Account.fallback.mjs +127 -67
  146. package/dist/teacher/home/components/Carousel1Account/Carousel1Account.mjs +68 -82
  147. package/dist/teacher/home/components/Carousel1Account/index.mjs +6 -7
  148. package/dist/teacher/home/components/Carousel2Account/Carousel2Account.fallback.mjs +112 -94
  149. package/dist/teacher/home/components/Carousel2Account/Carousel2Account.mjs +79 -85
  150. package/dist/teacher/home/components/Carousel2Account/index.mjs +6 -7
  151. package/dist/teacher/home/components/TextAccount/TextAccount.fallback.mjs +119 -108
  152. package/dist/teacher/home/components/TextAccount/TextAccount.mjs +91 -111
  153. package/dist/teacher/home/components/TextAccount/index.mjs +6 -7
  154. package/dist/teacher/home/components/index.mjs +9 -18
  155. package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/AbilityBadge.mjs +345 -442
  156. package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/index.mjs +5 -5
  157. package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.mjs +106 -109
  158. package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.utils.mjs +54 -58
  159. package/dist/teacher/profile/components/AbilityCollection/index.mjs +7 -8
  160. package/dist/teacher/profile/components/ActivityGallery/ActivityGallery.mjs +73 -104
  161. package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.mjs +81 -95
  162. package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/index.mjs +4 -3
  163. package/dist/teacher/profile/components/ActivityGallery/index.mjs +6 -6
  164. package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.mjs +148 -194
  165. package/dist/teacher/profile/components/AvailableScheduleSection/index.mjs +5 -4
  166. package/dist/teacher/profile/components/CareNoteSection/CareNote/CareNote.mjs +61 -53
  167. package/dist/teacher/profile/components/CareNoteSection/CareNote/index.mjs +5 -4
  168. package/dist/teacher/profile/components/CareNoteSection/CareNoteSection.mjs +72 -81
  169. package/dist/teacher/profile/components/CareNoteSection/CareNoteSection.utils.mjs +17 -12
  170. package/dist/teacher/profile/components/CareNoteSection/index.mjs +6 -6
  171. package/dist/teacher/profile/components/CareerSection/CareerItem/CareerItem.mjs +108 -134
  172. package/dist/teacher/profile/components/CareerSection/CareerItem/index.mjs +5 -4
  173. package/dist/teacher/profile/components/CareerSection/CareerSection.mjs +133 -176
  174. package/dist/teacher/profile/components/CareerSection/index.mjs +6 -6
  175. package/dist/teacher/profile/components/CertificateSection/CertificateItem/CertificateItem.mjs +82 -88
  176. package/dist/teacher/profile/components/CertificateSection/CertificateItem/index.mjs +4 -3
  177. package/dist/teacher/profile/components/CertificateSection/CertificateSection.mjs +112 -141
  178. package/dist/teacher/profile/components/CertificateSection/index.mjs +6 -6
  179. package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.mjs +96 -111
  180. package/dist/teacher/profile/components/EducationSection/EducationItem/index.mjs +5 -4
  181. package/dist/teacher/profile/components/EducationSection/EducationSection.mjs +112 -141
  182. package/dist/teacher/profile/components/EducationSection/index.mjs +6 -6
  183. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/ParentReviewCard.mjs +107 -102
  184. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/index.mjs +5 -4
  185. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.mjs +85 -81
  186. package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.utils.mjs +17 -12
  187. package/dist/teacher/profile/components/ParentReviewSection/index.mjs +7 -8
  188. package/dist/teacher/profile/components/PreferredActivityKeywordGroup/PreferredActivityKeywordGroup.mjs +43 -36
  189. package/dist/teacher/profile/components/PreferredActivityKeywordGroup/index.mjs +4 -3
  190. package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.mjs +44 -31
  191. package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.utils.mjs +11 -12
  192. package/dist/teacher/profile/components/PreferredAgeGroup/index.mjs +5 -5
  193. package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.mjs +348 -433
  194. package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.utils.mjs +7 -7
  195. package/dist/teacher/profile/components/ProfileSummary/index.mjs +5 -4
  196. package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/StatBadge.mjs +80 -105
  197. package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/index.mjs +5 -4
  198. package/dist/teacher/profile/components/StatBadgeCollection/StatBadgeCollection.mjs +34 -27
  199. package/dist/teacher/profile/components/StatBadgeCollection/index.mjs +6 -6
  200. package/dist/teacher/profile/components/index.mjs +24 -48
  201. package/dist/teacher/profile/utils/index.mjs +2 -4
  202. package/dist/teacher/profile/utils/sortItems/index.mjs +5 -4
  203. package/dist/teacher/profile/utils/sortItems/sortItems.mjs +48 -48
  204. package/package.json +1 -1
  205. package/dist/purify.es-BGaRrCfO.js +0 -553
@@ -1,284 +1,239 @@
1
- import { jsxs as S } from "react/jsx-runtime";
2
- import { useState as w, useRef as m, Children as X, isValidElement as G, useCallback as dr, useEffect as M, cloneElement as vr } from "react";
3
- import { Flexbox as rr } from "@dotss/ui";
4
- import U from "../MediaDialog/MediaBlock/MediaBlock.mjs";
5
- import { createSwipeEvent as C } from "./Swiper.utils.mjs";
6
- import j from "./SwiperBlock/SwiperBlock.mjs";
7
- function Pr({
8
- children: B,
9
- initialPage: T = 0,
10
- onSwipe: s,
11
- onSwiping: W,
12
- loop: h = !1,
13
- disableSwipe: tr = !1,
14
- renderPagination: q,
15
- inlineCSS: er,
16
- autoSwipe: H = !1,
17
- autoSwipeInterval: J = 3e3,
18
- autoSwipeDuration: Q = 1e3,
19
- ...nr
20
- }) {
21
- const [k, $] = w(T), [c, cr] = w(1), t = m(null), A = m(0), Y = m(0), V = m(0), N = m(0), u = m(!1), f = m(!0), F = m(""), n = m(T), Z = m(!1), l = m(null), p = X.count(B), d = X.toArray(B).filter(G).filter((r) => r.type === j || r.type === U), D = p > 1 && !tr, sr = X.toArray(d == null ? void 0 : d[0]).filter(G).filter((r) => r.type === j || r.type === U), ur = X.toArray(d == null ? void 0 : d[(d == null ? void 0 : d.length) - 1]).filter(G).filter((r) => r.type === j || r.type === U), _ = (r, e, i) => {
22
- !t.current || !D || (F.current = t.current.style.transform, Y.current = r, A.current = r + t.current.offsetWidth * (i + 1), V.current = e);
23
- }, P = dr(
24
- (r, e, i, {
25
- isAutoSwiped: v = !1,
26
- shouldFocus: a = !1
27
- } = {}) => {
28
- if (!t.current || !D || !u.current || !f.current)
29
- return;
30
- f.current = !1, t.current.style.transition = v ? `transform ${Q}ms` : "transform 0.2s", t.current.style.cursor = "grab", l.current && (t.current.removeEventListener("transitionend", l.current), l.current = null);
31
- const o = e || k, y = i || A.current - t.current.offsetWidth * (o + 1) - r, g = t.current.offsetWidth * 0.1;
32
- if (Math.abs(y) < g && !e) {
33
- t.current.style.transform = F.current, u.current = !1, f.current = !0, s == null || s(
34
- C({
35
- realPage: n.current,
36
- totalPages: c,
37
- lastPage: n.current,
38
- isLoop: !1
39
- })
40
- );
41
- return;
42
- }
43
- const I = y <= -g && o - 1 < 0, z = y >= g && o + 1 === c, fr = y >= g && o + 1 < c, mr = y <= -g && o - 1 >= 0;
44
- if (I) {
45
- n.current = c - 1, s == null || s(
46
- C({ realPage: n.current, totalPages: c, lastPage: 0, isLoop: !0 })
47
- ), t.current.style.transform = "translate3d(0, 0, 0)", l.current = (x) => {
48
- var b, E, L, R;
49
- if (x.propertyName === "transform") {
50
- if (!t.current) return;
51
- if (t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${c}), 0, 0)`, $(c - 1), u.current = !1, f.current = !0, a)
52
- (L = (E = (b = t.current) == null ? void 0 : b.children) == null ? void 0 : E[c]) == null || L.focus();
53
- else {
54
- if (v) return;
55
- (R = document.activeElement) == null || R.blur();
56
- }
57
- }
58
- }, t.current.addEventListener("transitionend", l.current);
59
- return;
60
- } else if (z) {
61
- n.current = 0, s == null || s(
62
- C({
63
- realPage: n.current,
64
- totalPages: c,
65
- lastPage: c - 1,
66
- isLoop: !0
67
- })
68
- ), t.current.style.transform = `translate3d(calc(-100% * ${o + 2}), 0, 0)`, l.current = (x) => {
69
- var b, E, L, R;
70
- if (x.propertyName === "transform") {
71
- if (!t.current) return;
72
- if (t.current.style.transition = "none", t.current.style.transform = "translate3d(-100%, 0, 0)", $(0), u.current = !1, f.current = !0, a)
73
- (L = (E = (b = t.current) == null ? void 0 : b.children) == null ? void 0 : E[1]) == null || L.focus();
74
- else {
75
- if (v) return;
76
- (R = document.activeElement) == null || R.blur();
77
- }
78
- }
79
- }, t.current.addEventListener("transitionend", l.current);
80
- return;
81
- }
82
- fr ? (n.current = o + 1, s == null || s(
83
- C({
84
- realPage: n.current,
85
- totalPages: c,
86
- lastPage: o,
87
- isLoop: !0
88
- })
89
- ), $(n.current), t.current.style.transform = `translate3d(calc(-100% * ${o + 2}), 0, 0)`) : mr ? (n.current = o - 1, s == null || s(
90
- C({
91
- realPage: n.current,
92
- totalPages: c,
93
- lastPage: o,
94
- isLoop: !1
95
- })
96
- ), $(n.current), t.current.style.transform = `translate3d(calc(-100% * ${o}), 0, 0)`) : (s == null || s(
97
- C({
98
- realPage: n.current,
99
- totalPages: c,
100
- lastPage: n.current,
101
- isLoop: !1
102
- })
103
- ), t.current.style.transform = F.current), l.current = (x) => {
104
- var b, E;
105
- if (x.propertyName === "transform") {
106
- u.current = !1, f.current = !0;
107
- const L = Array.from(((b = t.current) == null ? void 0 : b.children) ?? []).find(
108
- (R) => R.getAttribute("aria-current") === "page"
109
- );
110
- if (a && L)
111
- L.focus();
112
- else {
113
- if (v) return;
114
- (E = document.activeElement) == null || E.blur();
115
- }
116
- }
117
- }, t.current.addEventListener("transitionend", l.current);
118
- },
119
- [k, c, s, D, Q]
120
- ), ar = (r) => {
121
- u.current = !0, _(r.clientX, r.clientY, n.current);
122
- }, K = (r) => P(r.clientX), or = (r) => {
123
- _(r.touches[0].clientX, r.touches[0].clientY, n.current);
124
- }, O = (r) => P(r.changedTouches[0].clientX), lr = (r) => {
125
- u.current = !0;
126
- const e = r - 1;
127
- $(e <= 0 ? 0 : e), P(0, r);
128
- }, ir = (r) => (e) => {
129
- var i, v;
130
- switch (e.key) {
131
- case "ArrowRight": {
132
- if (e.preventDefault(), u.current || !f.current) return;
133
- const a = n.current === c - 1;
134
- if (!h && a)
135
- return;
136
- u.current = !0, P(0, n.current, (((i = t.current) == null ? void 0 : i.offsetWidth) ?? 0) * 0.1, {
137
- shouldFocus: !0
138
- });
139
- break;
140
- }
141
- case "ArrowLeft": {
142
- if (e.preventDefault(), u.current || !f.current) return;
143
- const a = n.current === 0;
144
- if (!h && a)
145
- return;
146
- u.current = !0, P(0, n.current, -((((v = t.current) == null ? void 0 : v.offsetWidth) ?? 0) * 0.1), {
147
- shouldFocus: !0
148
- });
149
- break;
150
- }
151
- case "Enter": {
152
- e.preventDefault(), e.currentTarget.click();
153
- break;
154
- }
155
- case " ": {
156
- e.preventDefault(), e.currentTarget.click();
157
- break;
158
- }
159
- }
160
- r == null || r(e);
161
- };
162
- return M(() => {
163
- const r = t.current, e = (a, o, y) => {
164
- if (!t.current || !D || !f.current) return;
165
- N.current = a - A.current;
166
- const g = 5;
167
- if (u.current = u.current || Math.abs(N.current) > g && Math.abs(o - V.current) < g, u.current) {
168
- const I = Y.current < a, z = Y.current > a;
169
- if (!h && I && n.current === 0) {
170
- u.current = !1;
171
- return;
172
- }
173
- if (!h && z && n.current === c - 1) {
174
- u.current = !1;
175
- return;
176
- }
177
- y.cancelable && y.preventDefault(), W == null || W(
178
- C({
179
- realPage: n.current,
180
- totalPages: c,
181
- lastPage: n.current,
182
- isLoop: !1
183
- })
184
- ), t.current.style.transition = "none", t.current.style.cursor = "grabbing", t.current.style.transform = `translate3d(${N.current}px, 0, 0)`;
185
- }
186
- }, i = (a) => {
187
- u.current && e(a.clientX, a.clientY, a);
188
- }, v = (a) => e(a.touches[0].clientX, a.touches[0].clientY, a);
189
- return r && (r.addEventListener("mousemove", i), r.addEventListener("touchmove", v)), () => {
190
- r && (r.removeEventListener("mousemove", i), r.removeEventListener("touchmove", v));
191
- };
192
- }, [D, W, h, c]), M(() => {
193
- const r = t.current, e = (i) => {
194
- f.current || (i.stopPropagation(), i.preventDefault());
195
- };
196
- return r == null || r.addEventListener("click", e), () => {
197
- r == null || r.removeEventListener("click", e);
198
- };
199
- }, []), M(() => {
200
- const r = t.current;
201
- return () => {
202
- l.current && r && (r.removeEventListener("transitionend", l.current), l.current = null);
203
- };
204
- }, []), M(() => {
205
- cr(p);
206
- }, [p]), M(() => {
207
- t.current && !Z.current && (Z.current = !0, t.current.style.transition = "none", t.current.style.transform = `translate3d(calc(-100% * ${p < T + 1 ? p : T + 1}), 0, 0)`);
208
- }, [T, p]), M(() => {
209
- if (H) {
210
- const r = setInterval(() => {
211
- u.current || !f.current || t.current && (!h && n.current === c - 1 || document.activeElement && t.current && t.current.contains(document.activeElement) || (u.current = !0, P(0, n.current, (t.current.offsetWidth ?? 0) * 0.1, {
212
- isAutoSwiped: !0
213
- })));
214
- }, J);
215
- return () => {
216
- clearInterval(r);
217
- };
218
- }
219
- }, [H, J, h, c, P]), /* @__PURE__ */ S(
220
- rr,
221
- {
222
- flexGrow: 1,
223
- role: "list",
224
- "aria-roledescription": "carousel",
225
- "aria-label": "슬라이더",
226
- ...nr,
227
- inlineCSS: {
228
- width: "100%",
229
- position: "relative",
230
- ...er
231
- },
232
- children: [
233
- /* @__PURE__ */ S(
234
- rr,
235
- {
236
- ref: t,
237
- flexGrow: 1,
238
- onMouseDown: ar,
239
- onMouseUp: K,
240
- onMouseLeave: K,
241
- onTouchStart: or,
242
- onTouchEnd: O,
243
- onTouchCancel: O,
244
- inlineCSS: {
245
- "& > div:first-of-type": {
246
- visibility: h ? "visible" : "hidden"
247
- },
248
- "& > div:last-of-type": {
249
- visibility: h ? "visible" : "hidden"
250
- }
251
- },
252
- style: {
253
- transition: "transform 0.2s",
254
- transform: "translate3d(-100%, 0, 0)",
255
- cursor: "grab"
256
- },
257
- children: [
258
- ur,
259
- d.map(
260
- (r, e) => vr(r, {
261
- role: "listitem",
262
- tabIndex: e === k ? 0 : -1,
263
- onKeyDown: ir(r.props.onKeyDown),
264
- "aria-roledescription": "slide",
265
- "aria-hidden": e !== k,
266
- "aria-current": e === k ? "page" : void 0,
267
- "aria-label": `${c}개 중 ${e + 1}번째 슬라이드`,
268
- "aria-posinset": e + 1,
269
- "aria-setsize": c,
270
- ...r.props
271
- })
272
- ),
273
- sr
274
- ]
275
- }
276
- ),
277
- typeof q == "function" && q({ page: k, totalPages: c, onChange: lr })
278
- ]
279
- }
280
- );
1
+ import e from "./SwiperBlock/index.mjs";
2
+ import t from "../MediaDialog/MediaBlock/index.mjs";
3
+ import { createSwipeEvent as n } from "./Swiper.utils.mjs";
4
+ import { Children as r, cloneElement as i, isValidElement as a, useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
5
+ import { Flexbox as u } from "@dotss/ui";
6
+ import { jsxs as d } from "react/jsx-runtime";
7
+ //#region shared/components/Swiper/Swiper.tsx
8
+ function f({ children: f, initialPage: p = 0, onSwipe: m, onSwiping: h, loop: g = !1, disableSwipe: _ = !1, renderPagination: v, inlineCSS: y, autoSwipe: b = !1, autoSwipeInterval: x = 3e3, autoSwipeDuration: S = 1e3, ...C }) {
9
+ let [w, T] = l(p), [E, D] = l(1), O = c(null), k = c(0), A = c(0), j = c(0), M = c(0), N = c(!1), P = c(!0), F = c(""), I = c(p), L = c(!1), R = c(null), z = r.count(f), B = r.toArray(f).filter(a).filter((n) => n.type === e || n.type === t), V = z > 1 && !_, H = r.toArray(B?.[0]).filter(a).filter((n) => n.type === e || n.type === t), U = r.toArray(B?.[B?.length - 1]).filter(a).filter((n) => n.type === e || n.type === t), W = (e, t, n) => {
10
+ !O.current || !V || (F.current = O.current.style.transform, A.current = e, k.current = e + O.current.offsetWidth * (n + 1), j.current = t);
11
+ }, G = o((e, t, r, { isAutoSwiped: i = !1, shouldFocus: a = !1 } = {}) => {
12
+ if (!O.current || !V || !N.current || !P.current) return;
13
+ P.current = !1, O.current.style.transition = i ? `transform ${S}ms` : "transform 0.2s", O.current.style.cursor = "grab", R.current &&= (O.current.removeEventListener("transitionend", R.current), null);
14
+ let o = t || w, s = r || k.current - O.current.offsetWidth * (o + 1) - e, c = O.current.offsetWidth * .1;
15
+ if (Math.abs(s) < c && !t) {
16
+ O.current.style.transform = F.current, N.current = !1, P.current = !0, m?.(n({
17
+ realPage: I.current,
18
+ totalPages: E,
19
+ lastPage: I.current,
20
+ isLoop: !1
21
+ }));
22
+ return;
23
+ }
24
+ let l = s <= -c && o - 1 < 0, u = s >= c && o + 1 === E, d = s >= c && o + 1 < E, f = s <= -c && o - 1 >= 0;
25
+ if (l) {
26
+ I.current = E - 1, m?.(n({
27
+ realPage: I.current,
28
+ totalPages: E,
29
+ lastPage: 0,
30
+ isLoop: !0
31
+ })), O.current.style.transform = "translate3d(0, 0, 0)", R.current = (e) => {
32
+ if (e.propertyName === "transform") {
33
+ if (!O.current) return;
34
+ if (O.current.style.transition = "none", O.current.style.transform = `translate3d(calc(-100% * ${E}), 0, 0)`, T(E - 1), N.current = !1, P.current = !0, a) (O.current?.children)?.[E]?.focus();
35
+ else {
36
+ if (i) return;
37
+ document.activeElement?.blur();
38
+ }
39
+ }
40
+ }, O.current.addEventListener("transitionend", R.current);
41
+ return;
42
+ } else if (u) {
43
+ I.current = 0, m?.(n({
44
+ realPage: I.current,
45
+ totalPages: E,
46
+ lastPage: E - 1,
47
+ isLoop: !0
48
+ })), O.current.style.transform = `translate3d(calc(-100% * ${o + 2}), 0, 0)`, R.current = (e) => {
49
+ if (e.propertyName === "transform") {
50
+ if (!O.current) return;
51
+ if (O.current.style.transition = "none", O.current.style.transform = "translate3d(-100%, 0, 0)", T(0), N.current = !1, P.current = !0, a) (O.current?.children)?.[1]?.focus();
52
+ else {
53
+ if (i) return;
54
+ document.activeElement?.blur();
55
+ }
56
+ }
57
+ }, O.current.addEventListener("transitionend", R.current);
58
+ return;
59
+ }
60
+ d ? (I.current = o + 1, m?.(n({
61
+ realPage: I.current,
62
+ totalPages: E,
63
+ lastPage: o,
64
+ isLoop: !0
65
+ })), T(I.current), O.current.style.transform = `translate3d(calc(-100% * ${o + 2}), 0, 0)`) : f ? (I.current = o - 1, m?.(n({
66
+ realPage: I.current,
67
+ totalPages: E,
68
+ lastPage: o,
69
+ isLoop: !1
70
+ })), T(I.current), O.current.style.transform = `translate3d(calc(-100% * ${o}), 0, 0)`) : (m?.(n({
71
+ realPage: I.current,
72
+ totalPages: E,
73
+ lastPage: I.current,
74
+ isLoop: !1
75
+ })), O.current.style.transform = F.current), R.current = (e) => {
76
+ if (e.propertyName === "transform") {
77
+ N.current = !1, P.current = !0;
78
+ let e = Array.from(O.current?.children ?? []).find((e) => e.getAttribute("aria-current") === "page");
79
+ if (a && e) e.focus();
80
+ else {
81
+ if (i) return;
82
+ document.activeElement?.blur();
83
+ }
84
+ }
85
+ }, O.current.addEventListener("transitionend", R.current);
86
+ }, [
87
+ w,
88
+ E,
89
+ m,
90
+ V,
91
+ S
92
+ ]), K = (e) => {
93
+ N.current = !0, W(e.clientX, e.clientY, I.current);
94
+ }, q = (e) => G(e.clientX), J = (e) => {
95
+ W(e.touches[0].clientX, e.touches[0].clientY, I.current);
96
+ }, Y = (e) => G(e.changedTouches[0].clientX), X = (e) => {
97
+ N.current = !0;
98
+ let t = e - 1;
99
+ T(t <= 0 ? 0 : t), G(0, e);
100
+ }, Z = (e) => (t) => {
101
+ switch (t.key) {
102
+ case "ArrowRight": {
103
+ if (t.preventDefault(), N.current || !P.current) return;
104
+ let e = I.current === E - 1;
105
+ if (!g && e) return;
106
+ N.current = !0, G(0, I.current, (O.current?.offsetWidth ?? 0) * .1, { shouldFocus: !0 });
107
+ break;
108
+ }
109
+ case "ArrowLeft": {
110
+ if (t.preventDefault(), N.current || !P.current) return;
111
+ let e = I.current === 0;
112
+ if (!g && e) return;
113
+ N.current = !0, G(0, I.current, -((O.current?.offsetWidth ?? 0) * .1), { shouldFocus: !0 });
114
+ break;
115
+ }
116
+ case "Enter":
117
+ t.preventDefault(), t.currentTarget.click();
118
+ break;
119
+ case " ":
120
+ t.preventDefault(), t.currentTarget.click();
121
+ break;
122
+ }
123
+ e?.(t);
124
+ };
125
+ return s(() => {
126
+ let e = O.current, t = (e, t, r) => {
127
+ if (!(!O.current || !V || !P.current) && (M.current = e - k.current, N.current = N.current || Math.abs(M.current) > 5 && Math.abs(t - j.current) < 5, N.current)) {
128
+ let t = A.current < e, i = A.current > e;
129
+ if (!g && t && I.current === 0) {
130
+ N.current = !1;
131
+ return;
132
+ }
133
+ if (!g && i && I.current === E - 1) {
134
+ N.current = !1;
135
+ return;
136
+ }
137
+ r.cancelable && r.preventDefault(), h?.(n({
138
+ realPage: I.current,
139
+ totalPages: E,
140
+ lastPage: I.current,
141
+ isLoop: !1
142
+ })), O.current.style.transition = "none", O.current.style.cursor = "grabbing", O.current.style.transform = `translate3d(${M.current}px, 0, 0)`;
143
+ }
144
+ }, r = (e) => {
145
+ N.current && t(e.clientX, e.clientY, e);
146
+ }, i = (e) => t(e.touches[0].clientX, e.touches[0].clientY, e);
147
+ return e && (e.addEventListener("mousemove", r), e.addEventListener("touchmove", i)), () => {
148
+ e && (e.removeEventListener("mousemove", r), e.removeEventListener("touchmove", i));
149
+ };
150
+ }, [
151
+ V,
152
+ h,
153
+ g,
154
+ E
155
+ ]), s(() => {
156
+ let e = O.current, t = (e) => {
157
+ P.current || (e.stopPropagation(), e.preventDefault());
158
+ };
159
+ return e?.addEventListener("click", t), () => {
160
+ e?.removeEventListener("click", t);
161
+ };
162
+ }, []), s(() => {
163
+ let e = O.current;
164
+ return () => {
165
+ R.current && e && (e.removeEventListener("transitionend", R.current), R.current = null);
166
+ };
167
+ }, []), s(() => {
168
+ D(z);
169
+ }, [z]), s(() => {
170
+ O.current && !L.current && (L.current = !0, O.current.style.transition = "none", O.current.style.transform = `translate3d(calc(-100% * ${z < p + 1 ? z : p + 1}), 0, 0)`);
171
+ }, [p, z]), s(() => {
172
+ if (b) {
173
+ let e = setInterval(() => {
174
+ N.current || !P.current || O.current && (!g && I.current === E - 1 || document.activeElement && O.current && O.current.contains(document.activeElement) || (N.current = !0, G(0, I.current, (O.current.offsetWidth ?? 0) * .1, { isAutoSwiped: !0 })));
175
+ }, x);
176
+ return () => {
177
+ clearInterval(e);
178
+ };
179
+ }
180
+ }, [
181
+ b,
182
+ x,
183
+ g,
184
+ E,
185
+ G
186
+ ]), /* @__PURE__ */ d(u, {
187
+ flexGrow: 1,
188
+ role: "list",
189
+ "aria-roledescription": "carousel",
190
+ "aria-label": "슬라이더",
191
+ ...C,
192
+ inlineCSS: {
193
+ width: "100%",
194
+ position: "relative",
195
+ ...y
196
+ },
197
+ children: [/* @__PURE__ */ d(u, {
198
+ ref: O,
199
+ flexGrow: 1,
200
+ onMouseDown: K,
201
+ onMouseUp: q,
202
+ onMouseLeave: q,
203
+ onTouchStart: J,
204
+ onTouchEnd: Y,
205
+ onTouchCancel: Y,
206
+ inlineCSS: {
207
+ "& > div:first-of-type": { visibility: g ? "visible" : "hidden" },
208
+ "& > div:last-of-type": { visibility: g ? "visible" : "hidden" }
209
+ },
210
+ style: {
211
+ transition: "transform 0.2s",
212
+ transform: "translate3d(-100%, 0, 0)",
213
+ cursor: "grab"
214
+ },
215
+ children: [
216
+ U,
217
+ B.map((e, t) => i(e, {
218
+ role: "listitem",
219
+ tabIndex: t === w ? 0 : -1,
220
+ onKeyDown: Z(e.props.onKeyDown),
221
+ "aria-roledescription": "slide",
222
+ "aria-hidden": t !== w,
223
+ "aria-current": t === w ? "page" : void 0,
224
+ "aria-label": `${E}개 중 ${t + 1}번째 슬라이드`,
225
+ "aria-posinset": t + 1,
226
+ "aria-setsize": E,
227
+ ...e.props
228
+ })),
229
+ H
230
+ ]
231
+ }), typeof v == "function" && v({
232
+ page: w,
233
+ totalPages: E,
234
+ onChange: X
235
+ })]
236
+ });
281
237
  }
282
- export {
283
- Pr as default
284
- };
238
+ //#endregion
239
+ export { f as default };
@@ -1,25 +1,20 @@
1
- function p({
2
- realPage: i,
3
- totalPages: n,
4
- lastPage: u,
5
- isLoop: c
6
- }) {
7
- return c ? {
8
- isFirstPage: i === 0,
9
- isLastPage: i === n - 1,
10
- prevPage: i - 2 < 0 ? 0 : i - 2,
11
- currentPage: i,
12
- nextPage: i + 2 >= n ? n - 1 : i + 2,
13
- lastPage: u
14
- } : {
15
- isFirstPage: i === 0,
16
- isLastPage: i === n - 1,
17
- prevPage: i - 1 < 0 ? 0 : i - 1,
18
- currentPage: i,
19
- nextPage: i + 1 >= n ? n - 1 : i + 1,
20
- lastPage: u
21
- };
1
+ //#region shared/components/Swiper/Swiper.utils.ts
2
+ function e({ realPage: e, totalPages: t, lastPage: n, isLoop: r }) {
3
+ return r ? {
4
+ isFirstPage: e === 0,
5
+ isLastPage: e === t - 1,
6
+ prevPage: e - 2 < 0 ? 0 : e - 2,
7
+ currentPage: e,
8
+ nextPage: e + 2 >= t ? t - 1 : e + 2,
9
+ lastPage: n
10
+ } : {
11
+ isFirstPage: e === 0,
12
+ isLastPage: e === t - 1,
13
+ prevPage: e - 1 < 0 ? 0 : e - 1,
14
+ currentPage: e,
15
+ nextPage: e + 1 >= t ? t - 1 : e + 1,
16
+ lastPage: n
17
+ };
22
18
  }
23
- export {
24
- p as createSwipeEvent
25
- };
19
+ //#endregion
20
+ export { e as createSwipeEvent };
@@ -1,19 +1,16 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
1
  import { Flexbox as e } from "@dotss/ui";
3
- function r({ children: n, ...i }) {
4
- return /* @__PURE__ */ t(
5
- e,
6
- {
7
- ...i,
8
- inlineCSS: {
9
- minWidth: "100%",
10
- transform: "translate3d(0, 0, 0)",
11
- ...i == null ? void 0 : i.inlineCSS
12
- },
13
- children: n
14
- }
15
- );
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ //#region shared/components/Swiper/SwiperBlock/SwiperBlock.tsx
4
+ function n({ children: n, ...r }) {
5
+ return /* @__PURE__ */ t(e, {
6
+ ...r,
7
+ inlineCSS: {
8
+ minWidth: "100%",
9
+ transform: "translate3d(0, 0, 0)",
10
+ ...r?.inlineCSS
11
+ },
12
+ children: n
13
+ });
16
14
  }
17
- export {
18
- r as default
19
- };
15
+ //#endregion
16
+ export { n as default };
@@ -1,4 +1,5 @@
1
- import r from "./SwiperBlock.mjs";
2
- export {
3
- r as default
4
- };
1
+ import e from "./SwiperBlock.mjs";
2
+ //#region shared/components/Swiper/SwiperBlock/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,6 +1,6 @@
1
- import e from "./Swiper.mjs";
2
- import { default as t } from "./SwiperBlock/SwiperBlock.mjs";
3
- export {
4
- t as SwiperBlock,
5
- e as default
6
- };
1
+ import e from "./SwiperBlock/index.mjs";
2
+ import t from "./Swiper.mjs";
3
+ //#region shared/components/Swiper/index.ts
4
+ var n = t;
5
+ //#endregion
6
+ export { e as SwiperBlock, n as default };