@ozdao/martyrs 0.2.576 → 0.2.578

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 (155) hide show
  1. package/dist/builder.js +33 -33
  2. package/dist/{main-BfEQkhXS.js → main-EZaj64lH.js} +1204 -1208
  3. package/dist/martyrs/dist/{main-BfEQkhXS.js → main-EZaj64lH.js} +78 -78
  4. package/dist/martyrs/dist/main-EZaj64lH.js.map +1 -0
  5. package/dist/martyrs/dist/{web-BqTV9va1.js → web-ClbcbWYJ.js} +2 -2
  6. package/dist/martyrs/dist/{web-BqTV9va1.js.map → web-ClbcbWYJ.js.map} +1 -1
  7. package/dist/martyrs/src/components/BottomSheet/BottomSheet.vue.js +1 -1
  8. package/dist/martyrs/src/components/BottomSheet/BottomSheet.vue.js.map +1 -1
  9. package/dist/martyrs/src/components/Button/{Button.vue.js → Button.vue2.js} +3 -3
  10. package/dist/martyrs/src/components/Button/Button.vue2.js.map +1 -0
  11. package/dist/martyrs/src/components/Dropdown/{Dropdown.vue2.js → Dropdown.vue.js} +2 -2
  12. package/dist/martyrs/src/components/Dropdown/Dropdown.vue.js.map +1 -0
  13. package/dist/martyrs/src/components/EditImages/{EditImages.vue2.js → EditImages.vue.js} +2 -2
  14. package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +1 -0
  15. package/dist/martyrs/src/components/Feed/Carousel.vue.js +1 -1
  16. package/dist/martyrs/src/components/Feed/Feed.vue.js +3 -3
  17. package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
  18. package/dist/martyrs/src/components/Loader/{Loader.vue2.js → Loader.vue.js} +2 -2
  19. package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -0
  20. package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue.js +1 -1
  21. package/dist/martyrs/src/components/Media/Media.vue.js +1 -1
  22. package/dist/martyrs/src/components/Menu/{Menu.vue2.js → Menu.vue.js} +2 -2
  23. package/dist/martyrs/src/components/Menu/Menu.vue.js.map +1 -0
  24. package/dist/martyrs/src/components/Slider/Slider.vue.js +91 -97
  25. package/dist/martyrs/src/components/Slider/Slider.vue.js.map +1 -1
  26. package/dist/martyrs/src/components/Spoiler/{Spoiler.vue.js → Spoiler.vue2.js} +2 -2
  27. package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +1 -0
  28. package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js +1 -1
  29. package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
  30. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +1 -1
  31. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
  32. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +3 -3
  33. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +1 -1
  34. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +1 -1
  35. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
  36. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +1 -1
  37. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +1 -1
  38. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +1 -1
  39. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +1 -1
  40. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +2 -2
  41. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  42. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +2 -2
  43. package/dist/martyrs/src/modules/core/views/components/blocks/PopupAuth.vue.js +1 -1
  44. package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +2 -2
  45. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +2 -2
  46. package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +1 -1
  47. package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +2 -2
  48. package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
  49. package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue2.js → Filters.vue.js} +2 -2
  50. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +1 -0
  51. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  52. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  53. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  54. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  55. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +3 -3
  56. package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
  57. package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
  58. package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
  59. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  60. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +1 -1
  61. package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
  62. package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
  63. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +1 -1
  64. package/dist/martyrs/src/modules/inventory/components/pages/Inventory.vue.js +1 -1
  65. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +2 -2
  66. package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
  67. package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
  68. package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
  69. package/dist/martyrs/src/modules/music/components/blocks/ActionButtons.vue.js +2 -2
  70. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
  71. package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
  72. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
  73. package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
  74. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +1 -1
  75. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +2 -2
  76. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
  77. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
  78. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +1 -1
  79. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +3 -3
  80. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +2 -2
  81. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
  82. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +3 -3
  83. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +2 -2
  84. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +3 -3
  85. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
  86. package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js +1 -1
  87. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
  88. package/dist/martyrs/src/modules/music/components/player/PlayerControls.vue.js +1 -1
  89. package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +1 -1
  90. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
  91. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +1 -1
  92. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +2 -2
  93. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  94. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
  95. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  96. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
  97. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
  98. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +3 -3
  99. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  100. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  101. package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
  102. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +2 -2
  103. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
  104. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
  105. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +2 -2
  106. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  107. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  108. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  109. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  110. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  111. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
  112. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  113. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
  114. package/dist/martyrs/src/modules/products/components/elements/Image360.vue.js +1 -1
  115. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
  116. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +4 -4
  117. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -1
  118. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  119. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +2 -2
  120. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
  121. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +1 -1
  122. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +2 -2
  123. package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  124. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
  125. package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
  126. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  127. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +2 -2
  128. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
  129. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  130. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +2 -2
  131. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
  132. package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
  133. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +1 -1
  134. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +1 -1
  135. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  136. package/dist/martyrs.css +1 -1
  137. package/dist/martyrs.es.js +1 -1
  138. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -1
  139. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -1
  140. package/dist/style.css +3 -5
  141. package/dist/{web-BqTV9va1.js → web-ClbcbWYJ.js} +1 -1
  142. package/package.json +1 -1
  143. package/src/components/BottomSheet/BottomSheet.vue +1 -1
  144. package/src/components/Slider/Slider.vue +111 -150
  145. package/src/jit/rules.js +42 -41
  146. package/src/styles/layout.scss +0 -3
  147. package/src/styles/reset.scss +5 -2
  148. package/dist/martyrs/dist/main-BfEQkhXS.js.map +0 -1
  149. package/dist/martyrs/src/components/Button/Button.vue.js.map +0 -1
  150. package/dist/martyrs/src/components/Dropdown/Dropdown.vue2.js.map +0 -1
  151. package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +0 -1
  152. package/dist/martyrs/src/components/Loader/Loader.vue2.js.map +0 -1
  153. package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +0 -1
  154. package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +0 -1
  155. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/martyrs",
3
- "version": "0.2.576",
3
+ "version": "0.2.578",
4
4
  "description": "Fullstack framework focused on user experience and ease of development.",
5
5
  "author": "OZ DAO <hello@ozdao.dev>",
6
6
  "license": "GPL-3.0-or-later",
@@ -3,7 +3,7 @@
3
3
  <section
4
4
  v-if="show"
5
5
  ref="wrapper"
6
- class="w-100 bs-black rows-1 h-100 pos-absolute pos-t-0 pos-l-0 z-index-9999"
6
+ class="w-100 bs-black flex flex-column h-100 pos-absolute pos-t-0 pos-l-0 z-index-9999"
7
7
  :class="{
8
8
  'pd-t-extra': MOBILE_APP === 'ios',
9
9
  }"
@@ -1,14 +1,19 @@
1
1
  <template>
2
- <!-- Native Carousel -->
3
- <div class="carousel" ref="carouselRef">
2
+ <div
3
+ class="carousel"
4
+ ref="carouselRef"
5
+ @mouseenter="onHoverStart"
6
+ @mouseleave="onHoverEnd"
7
+ @touchstart="onTouchStart"
8
+ @touchend="onTouchEnd"
9
+ >
4
10
  <div class="carousel__container" @scroll="handleScroll">
5
11
  <slot></slot>
6
12
  </div>
7
-
8
- <!-- Navigation Dots (optional) -->
13
+
9
14
  <div class="carousel__dots" v-if="showDots && slideCount > 1">
10
- <button
11
- v-for="index in slideCount"
15
+ <button
16
+ v-for="index in slideCount"
12
17
  :key="index - 1"
13
18
  class="carousel__dot"
14
19
  :class="{ 'carousel__dot--active': selectedIndex === index - 1 }"
@@ -19,187 +24,144 @@
19
24
  </template>
20
25
 
21
26
  <script setup>
22
- import { ref, onMounted, onBeforeUnmount, computed } from 'vue'
27
+ import { ref, onMounted, onBeforeUnmount, watch } from 'vue'
23
28
 
24
- // Props for customization
25
29
  const props = defineProps({
26
30
  showDots: Boolean,
27
31
  slideCount: {
28
32
  type: Number,
29
33
  default: 0
34
+ },
35
+ autoplay: {
36
+ type: Object,
37
+ default: null
30
38
  }
31
39
  });
32
40
 
41
+ // autoplay: { enabled, interval, hover, touch, resume, delay }
42
+
33
43
  const carouselRef = ref(null)
34
44
  const selectedIndex = ref(0)
35
- const autoplayInterval = ref(null)
45
+ const intervalId = ref(null)
36
46
  const scrollTimeout = ref(null)
47
+ const resumeTimeout = ref(null)
48
+ const paused = ref(false)
37
49
 
38
- // Scroll to specific slide
39
50
  const scrollTo = (index) => {
40
51
  if (!carouselRef.value) return
41
-
42
52
  const container = carouselRef.value.querySelector('.carousel__container')
43
53
  const slides = container.querySelectorAll('.carousel__slide')
44
-
45
54
  if (slides[index]) {
46
- container.scrollTo({
47
- left: slides[index].offsetLeft,
48
- behavior: 'smooth'
49
- })
50
-
55
+ container.scrollTo({ left: slides[index].offsetLeft, behavior: 'smooth' })
51
56
  selectedIndex.value = index
52
57
  }
53
58
  }
54
59
 
55
- // Handle scroll event with debounce
56
60
  const handleScroll = () => {
57
- // Clear previous timeout
58
- if (scrollTimeout.value) {
59
- clearTimeout(scrollTimeout.value)
60
- }
61
-
62
- // Set a timeout to update the index when scrolling stops
63
- scrollTimeout.value = setTimeout(() => {
64
- updateSelectedIndex()
65
- }, 50) // Small delay to ensure scroll has completed
61
+ if (scrollTimeout.value) clearTimeout(scrollTimeout.value)
62
+ scrollTimeout.value = setTimeout(updateSelectedIndex, 50)
66
63
  }
67
64
 
68
- // Update selected index when scrolling
69
65
  const updateSelectedIndex = () => {
70
66
  if (!carouselRef.value) return
71
-
72
67
  const container = carouselRef.value.querySelector('.carousel__container')
73
68
  const slides = container.querySelectorAll('.carousel__slide')
74
-
75
69
  if (!slides.length) return
76
-
77
- const scrollPosition = container.scrollLeft
78
- const slideWidth = slides[0].offsetWidth
79
-
80
- // Find current slide index based on scroll position
81
- const index = Math.round(scrollPosition / slideWidth)
82
-
83
- // Ensure index is within bounds
84
- const boundedIndex = Math.max(0, Math.min(index, slides.length - 1))
85
-
86
- // Update selected index
87
- selectedIndex.value = boundedIndex
88
- }
89
-
90
- // Setup autoplay functionality
91
- const setupAutoplay = () => {
92
- if (autoplayInterval.value) {
93
- clearInterval(autoplayInterval.value)
70
+ const index = Math.round(container.scrollLeft / slides[0].offsetWidth)
71
+ selectedIndex.value = Math.max(0, Math.min(index, slides.length - 1))
72
+ }
73
+
74
+ const clearTimers = () => {
75
+ if (intervalId.value) { clearInterval(intervalId.value); intervalId.value = null }
76
+ if (resumeTimeout.value) { clearTimeout(resumeTimeout.value); resumeTimeout.value = null }
77
+ }
78
+
79
+ const startAutoplay = () => {
80
+ clearTimers()
81
+ const a = props.autoplay
82
+ if (!a?.enabled || paused.value) return
83
+ intervalId.value = setInterval(() => {
84
+ scrollTo((selectedIndex.value + 1) % props.slideCount)
85
+ }, a.interval ?? 2000)
86
+ }
87
+
88
+ const pause = () => {
89
+ paused.value = true
90
+ clearTimers()
91
+ }
92
+
93
+ const resume = () => {
94
+ const a = props.autoplay
95
+ if (!a?.enabled || a.resume === false) return
96
+ clearTimers()
97
+ const delay = a.delay ?? 0
98
+ if (delay > 0) {
99
+ resumeTimeout.value = setTimeout(() => {
100
+ paused.value = false
101
+ startAutoplay()
102
+ }, delay)
103
+ } else {
104
+ paused.value = false
105
+ startAutoplay()
94
106
  }
95
-
96
- autoplayInterval.value = setInterval(() => {
97
- const nextIndex = (selectedIndex.value + 1) % props.slideCount
98
- scrollTo(nextIndex)
99
- }, 2000) // 2 seconds interval like in original
100
107
  }
101
108
 
109
+ const onHoverStart = () => {
110
+ if (props.autoplay?.hover !== false) pause()
111
+ }
112
+
113
+ const onHoverEnd = () => {
114
+ if (props.autoplay?.hover !== false) resume()
115
+ }
116
+
117
+ const onTouchStart = () => {
118
+ if (props.autoplay?.touch !== false) pause()
119
+ }
120
+
121
+ const onTouchEnd = () => {
122
+ if (props.autoplay?.touch !== false) resume()
123
+ }
124
+
125
+ watch(() => props.autoplay, () => {
126
+ if (props.autoplay?.enabled) {
127
+ paused.value = false
128
+ startAutoplay()
129
+ } else {
130
+ pause()
131
+ }
132
+ }, { deep: true })
133
+
102
134
  onMounted(() => {
103
- // Initialize native carousel after component is mounted
104
- if (carouselRef.value) {
105
- // Listen for scroll end using intersection observer for better performance
106
- const container = carouselRef.value.querySelector('.carousel__container')
107
- const slides = container.querySelectorAll('.carousel__slide')
108
-
109
- // Create intersection observer to detect when slides are visible
110
- const observer = new IntersectionObserver((entries) => {
111
- entries.forEach(entry => {
112
- if (entry.isIntersecting) {
113
- // Find the index of the visible slide
114
- const slideIndex = Array.from(slides).indexOf(entry.target)
115
- if (slideIndex !== -1) {
116
- selectedIndex.value = slideIndex
117
- }
118
- }
119
- })
120
- }, {
121
- root: container,
122
- threshold: 0.7 // Consider slide visible when 70% is in view
123
- })
124
-
125
- // Observe all slides
126
- slides.forEach(slide => {
127
- observer.observe(slide)
128
- })
129
-
130
- // Add focus/blur events to pause autoplay on focus
131
- container.addEventListener('focusin', () => {
132
- if (autoplayInterval.value) {
133
- clearInterval(autoplayInterval.value)
134
- }
135
- })
136
-
137
- container.addEventListener('focusout', () => {
138
- setupAutoplay()
139
- })
140
-
141
- // Stop autoplay on touch/mouse interaction
142
- container.addEventListener('mousedown', () => {
143
- if (autoplayInterval.value) {
144
- clearInterval(autoplayInterval.value)
145
- }
146
- })
147
-
148
- container.addEventListener('touchstart', () => {
149
- if (autoplayInterval.value) {
150
- clearInterval(autoplayInterval.value)
135
+ if (!carouselRef.value) return
136
+ const container = carouselRef.value.querySelector('.carousel__container')
137
+ const slides = container.querySelectorAll('.carousel__slide')
138
+
139
+ const observer = new IntersectionObserver((entries) => {
140
+ entries.forEach(entry => {
141
+ if (entry.isIntersecting) {
142
+ const idx = Array.from(slides).indexOf(entry.target)
143
+ if (idx !== -1) selectedIndex.value = idx
151
144
  }
152
145
  })
153
-
154
- // Resume autoplay after interaction ends
155
- container.addEventListener('mouseup', () => {
156
- setupAutoplay()
157
- })
158
-
159
- container.addEventListener('touchend', () => {
160
- setupAutoplay()
161
- })
162
-
163
- // Initialize autoplay
164
- setupAutoplay()
165
-
166
- // Store observer for cleanup
167
- carouselRef.value._observer = observer
168
- }
146
+ }, { root: container, threshold: 0.7 })
147
+
148
+ slides.forEach(slide => observer.observe(slide))
149
+ carouselRef.value._observer = observer
150
+
151
+ container.addEventListener('focusin', pause)
152
+ container.addEventListener('focusout', resume)
153
+
154
+ if (props.autoplay?.enabled) startAutoplay()
169
155
  })
170
156
 
171
157
  onBeforeUnmount(() => {
172
- // Clean up all resources
173
- if (carouselRef.value) {
174
- // Clean up intersection observer
175
- if (carouselRef.value._observer) {
176
- carouselRef.value._observer.disconnect()
177
- }
178
-
179
- // Clean up event listeners
180
- const container = carouselRef.value.querySelector('.carousel__container')
181
- if (container) {
182
- container.removeEventListener('focusin', () => {})
183
- container.removeEventListener('focusout', () => {})
184
- container.removeEventListener('mousedown', () => {})
185
- container.removeEventListener('touchstart', () => {})
186
- container.removeEventListener('mouseup', () => {})
187
- container.removeEventListener('touchend', () => {})
188
- }
189
- }
190
-
191
- // Clear all timeouts and intervals
192
- if (autoplayInterval.value) {
193
- clearInterval(autoplayInterval.value)
194
- }
195
-
196
- if (scrollTimeout.value) {
197
- clearTimeout(scrollTimeout.value)
198
- }
158
+ if (carouselRef.value?._observer) carouselRef.value._observer.disconnect()
159
+ clearTimers()
160
+ if (scrollTimeout.value) clearTimeout(scrollTimeout.value)
199
161
  })
200
162
  </script>
201
163
 
202
- <style >
164
+ <style>
203
165
  .carousel {
204
166
  position: relative;
205
167
  width: 100%;
@@ -210,13 +172,13 @@ onBeforeUnmount(() => {
210
172
  display: flex;
211
173
  scroll-snap-type: x mandatory;
212
174
  overflow-x: scroll;
213
- scrollbar-width: none; /* Firefox */
214
- -ms-overflow-style: none; /* IE and Edge */
175
+ scrollbar-width: none;
176
+ -ms-overflow-style: none;
215
177
  scroll-behavior: smooth;
216
178
  }
217
179
 
218
180
  .carousel__container::-webkit-scrollbar {
219
- display: none; /* Chrome, Safari, Opera */
181
+ display: none;
220
182
  }
221
183
 
222
184
  .carousel__slide {
@@ -226,7 +188,6 @@ onBeforeUnmount(() => {
226
188
  scroll-snap-stop: always;
227
189
  }
228
190
 
229
- /* Navigation dots */
230
191
  .carousel__dots {
231
192
  display: flex;
232
193
  justify-content: center;
@@ -248,4 +209,4 @@ onBeforeUnmount(() => {
248
209
  .carousel__dot--active {
249
210
  background-color: rgba(0, 0, 0, 0.6);
250
211
  }
251
- </style>
212
+ </style>
package/src/jit/rules.js CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  const sizeVars = ['extra', 'big', 'semi', 'medium', 'regular', 'small', 'thin', 'micro', 'nano'];
9
-
9
+ const colorVariants = ['extra', 'big', 'semi', 'medium', 'regular', 'small', 'thin', 'micro', 'nano'];
10
10
  // Цвета для bg-*, t-*, fill-*, stroke-*
11
11
  const colorNames = [
12
12
  'main', 'second', 'third', 'fourth', 'fifth',
@@ -14,7 +14,47 @@ const colorNames = [
14
14
  'red', 'red-nice', 'green', 'green-nice', 'orange', 'orange-nice', 'yellow', 'yellow-nice',
15
15
  'youtube', 'telegram', 'twitter', 'instagram', 'reddit', 'transparent'
16
16
  ];
17
- const colorVariants = ['extra', 'big', 'semi', 'medium', 'regular', 'small', 'thin', 'micro', 'nano'];
17
+
18
+ const dir = { t: 'top', r: 'right', b: 'bottom', l: 'left' };
19
+
20
+ // Easing functions map
21
+ const easings = {
22
+ 'linear': 'linear',
23
+ 'ease': 'ease',
24
+ 'ease-in': 'ease-in',
25
+ 'ease-out': 'ease-out',
26
+ 'ease-in-out': 'ease-in-out',
27
+ // Standard easings
28
+ 'sine-in': 'cubic-bezier(0.12,0,0.39,0)',
29
+ 'sine-out': 'cubic-bezier(0.61,1,0.88,1)',
30
+ 'sine-in-out': 'cubic-bezier(0.37,0,0.63,1)',
31
+ 'quad-in': 'cubic-bezier(0.11,0,0.5,0)',
32
+ 'quad-out': 'cubic-bezier(0.5,1,0.89,1)',
33
+ 'quad-in-out': 'cubic-bezier(0.45,0,0.55,1)',
34
+ 'cubic': 'cubic-bezier(0.65,0,0.35,1)',
35
+ 'cubic-in': 'cubic-bezier(0.32,0,0.67,0)',
36
+ 'cubic-out': 'cubic-bezier(0.33,1,0.68,1)',
37
+ 'cubic-in-out': 'cubic-bezier(0.65,0,0.35,1)',
38
+ 'quart-in': 'cubic-bezier(0.5,0,0.75,0)',
39
+ 'quart-out': 'cubic-bezier(0.25,1,0.5,1)',
40
+ 'quart-in-out': 'cubic-bezier(0.76,0,0.24,1)',
41
+ 'quint-in': 'cubic-bezier(0.64,0,0.78,0)',
42
+ 'quint-out': 'cubic-bezier(0.22,1,0.36,1)',
43
+ 'quint-in-out': 'cubic-bezier(0.83,0,0.17,1)',
44
+ 'expo-in': 'cubic-bezier(0.7,0,0.84,0)',
45
+ 'expo-out': 'cubic-bezier(0.16,1,0.3,1)',
46
+ 'expo-in-out': 'cubic-bezier(0.87,0,0.13,1)',
47
+ 'circ-in': 'cubic-bezier(0.55,0,1,0.45)',
48
+ 'circ-out': 'cubic-bezier(0,0.55,0.45,1)',
49
+ 'circ-in-out': 'cubic-bezier(0.85,0,0.15,1)',
50
+ 'back-in': 'cubic-bezier(0.36,0,0.66,-0.56)',
51
+ 'back-out': 'cubic-bezier(0.34,1.56,0.64,1)',
52
+ 'back-in-out': 'cubic-bezier(0.68,-0.6,0.32,1.6)',
53
+ 'elastic': 'cubic-bezier(0.17,0.67,0.33,0.94)',
54
+ 'spring': 'cubic-bezier(0.23,1,0.32,1.01)',
55
+ 'bounce': 'cubic-bezier(0.71,-0.46,0.88,0.6)',
56
+ };
57
+
18
58
 
19
59
  // Проверяет цвет и возвращает CSS значение
20
60
  function resolveColor(name) {
@@ -65,45 +105,6 @@ export function resolveValue(value, jit) {
65
105
  return null;
66
106
  }
67
107
 
68
- const dir = { t: 'top', r: 'right', b: 'bottom', l: 'left' };
69
-
70
- // Easing functions map
71
- const easings = {
72
- 'linear': 'linear',
73
- 'ease': 'ease',
74
- 'ease-in': 'ease-in',
75
- 'ease-out': 'ease-out',
76
- 'ease-in-out': 'ease-in-out',
77
- // Standard easings
78
- 'sine-in': 'cubic-bezier(0.12,0,0.39,0)',
79
- 'sine-out': 'cubic-bezier(0.61,1,0.88,1)',
80
- 'sine-in-out': 'cubic-bezier(0.37,0,0.63,1)',
81
- 'quad-in': 'cubic-bezier(0.11,0,0.5,0)',
82
- 'quad-out': 'cubic-bezier(0.5,1,0.89,1)',
83
- 'quad-in-out': 'cubic-bezier(0.45,0,0.55,1)',
84
- 'cubic': 'cubic-bezier(0.65,0,0.35,1)',
85
- 'cubic-in': 'cubic-bezier(0.32,0,0.67,0)',
86
- 'cubic-out': 'cubic-bezier(0.33,1,0.68,1)',
87
- 'cubic-in-out': 'cubic-bezier(0.65,0,0.35,1)',
88
- 'quart-in': 'cubic-bezier(0.5,0,0.75,0)',
89
- 'quart-out': 'cubic-bezier(0.25,1,0.5,1)',
90
- 'quart-in-out': 'cubic-bezier(0.76,0,0.24,1)',
91
- 'quint-in': 'cubic-bezier(0.64,0,0.78,0)',
92
- 'quint-out': 'cubic-bezier(0.22,1,0.36,1)',
93
- 'quint-in-out': 'cubic-bezier(0.83,0,0.17,1)',
94
- 'expo-in': 'cubic-bezier(0.7,0,0.84,0)',
95
- 'expo-out': 'cubic-bezier(0.16,1,0.3,1)',
96
- 'expo-in-out': 'cubic-bezier(0.87,0,0.13,1)',
97
- 'circ-in': 'cubic-bezier(0.55,0,1,0.45)',
98
- 'circ-out': 'cubic-bezier(0,0.55,0.45,1)',
99
- 'circ-in-out': 'cubic-bezier(0.85,0,0.15,1)',
100
- 'back-in': 'cubic-bezier(0.36,0,0.66,-0.56)',
101
- 'back-out': 'cubic-bezier(0.34,1.56,0.64,1)',
102
- 'back-in-out': 'cubic-bezier(0.68,-0.6,0.32,1.6)',
103
- 'elastic': 'cubic-bezier(0.17,0.67,0.33,0.94)',
104
- 'spring': 'cubic-bezier(0.23,1,0.32,1.01)',
105
- 'bounce': 'cubic-bezier(0.71,-0.46,0.88,0.6)',
106
- };
107
108
 
108
109
  function handleNegative(val, jit) {
109
110
  const isNeg = val.endsWith('-negative');
@@ -26,9 +26,6 @@ body,
26
26
 
27
27
  }
28
28
 
29
- span, p {
30
- line-height: 1;
31
- }
32
29
 
33
30
  .field-wrapper {
34
31
  transition: border-width .2s, box-shadow .2s ease;
@@ -1,4 +1,5 @@
1
1
  @charset "UTF-8";
2
+ @layer reset {
2
3
  html, button, body, div, span, applet, object, iframe,
3
4
  h1, h2, h3, h4, h5, h6, p, blockquote, pre,
4
5
  a, abbr, acronym, address, big, cite, code,
@@ -17,11 +18,12 @@ time, mark, audio, video, textarea, input {
17
18
  border: 0;
18
19
  font-size: 100%;
19
20
  font: inherit;
20
- vertical-align: baseline;
21
+ vertical-align: baseline;
21
22
  color: inherit;
22
23
  background: transparent;
23
- text-decoration: none;
24
+ text-decoration: none;
24
25
  -webkit-tap-highlight-color: transparent;
26
+ line-height: inherit;
25
27
  }
26
28
 
27
29
  a:link, a:visited, a:hover {
@@ -81,4 +83,5 @@ input::-webkit-outer-spin-button,
81
83
  input::-webkit-inner-spin-button {
82
84
  -webkit-appearance: none;
83
85
  margin: 0;
86
+ }
84
87
  }