@dxtmisha/wiki 0.24.2 → 0.24.3

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 (415) hide show
  1. package/package.json +1 -1
  2. package/src/library.ts +7 -7
  3. package/src/media/descriptions/wikiDescriptionsBars.ts +1 -3
  4. package/src/media/descriptions/wikiDescriptionsCell.ts +1 -2
  5. package/src/media/descriptions/wikiDescriptionsChip.ts +0 -1
  6. package/src/media/descriptions/wikiDescriptionsField.ts +1 -4
  7. package/src/media/descriptions/wikiDescriptionsFieldCounter.ts +6 -6
  8. package/src/media/descriptions/wikiDescriptionsFieldMessage.ts +1 -2
  9. package/src/media/descriptions/wikiDescriptionsImage.ts +2 -2
  10. package/src/media/descriptions/wikiDescriptionsList.ts +1 -5
  11. package/src/media/descriptions/wikiDescriptionsListGroup.ts +2 -3
  12. package/src/media/descriptions/wikiDescriptionsListItem.ts +1 -3
  13. package/src/media/descriptions/wikiDescriptionsListMenu.ts +2 -9
  14. package/src/media/descriptions/wikiDescriptionsMask.ts +12 -0
  15. package/src/media/descriptions/wikiDescriptionsMenu.ts +3 -14
  16. package/src/media/descriptions/wikiDescriptionsMotionTransform.ts +2 -4
  17. package/src/media/descriptions/wikiDescriptionsScrollbar.ts +1 -7
  18. package/src/media/descriptions/wikiDescriptionsSkeleton.ts +1 -0
  19. package/src/media/descriptions/wikiDescriptionsWindow.ts +5 -22
  20. package/src/media/functional/en/broadcastMessage.mdx +307 -0
  21. package/src/media/functional/ru/broadcastMessage.mdx +305 -0
  22. package/src/media/mdx/Badge/badge.en.mdx +85 -7
  23. package/src/media/mdx/Badge/badge.ru.mdx +85 -7
  24. package/src/media/mdx/Badge/dot.en.mdx +16 -12
  25. package/src/media/mdx/Badge/dot.ru.mdx +16 -12
  26. package/src/media/mdx/Badge/outline.en.mdx +12 -13
  27. package/src/media/mdx/Badge/outline.ru.mdx +12 -13
  28. package/src/media/mdx/Badge/primary.en.mdx +12 -12
  29. package/src/media/mdx/Badge/primary.ru.mdx +12 -12
  30. package/src/media/mdx/Badge/secondary.en.mdx +12 -13
  31. package/src/media/mdx/Badge/secondary.ru.mdx +12 -13
  32. package/src/media/mdx/Bars/action.en.mdx +72 -28
  33. package/src/media/mdx/Bars/action.ru.mdx +73 -29
  34. package/src/media/mdx/Bars/bars.en.mdx +90 -15
  35. package/src/media/mdx/Bars/bars.ru.mdx +91 -15
  36. package/src/media/mdx/Bars/slots.en.mdx +33 -0
  37. package/src/media/mdx/Bars/slots.ru.mdx +33 -0
  38. package/src/media/mdx/Bars/v-model.en.mdx +23 -14
  39. package/src/media/mdx/Bars/v-model.ru.mdx +23 -14
  40. package/src/media/mdx/Bars/wikiMdxBars.ts +5 -11
  41. package/src/media/mdx/Button/button.en.mdx +89 -1
  42. package/src/media/mdx/Button/button.ru.mdx +89 -1
  43. package/src/media/mdx/Button/outline.en.mdx +12 -14
  44. package/src/media/mdx/Button/outline.ru.mdx +12 -14
  45. package/src/media/mdx/Button/primary.en.mdx +12 -19
  46. package/src/media/mdx/Button/primary.ru.mdx +12 -19
  47. package/src/media/mdx/Button/secondary.en.mdx +12 -17
  48. package/src/media/mdx/Button/secondary.ru.mdx +12 -17
  49. package/src/media/mdx/Button/text.en.mdx +12 -11
  50. package/src/media/mdx/Button/text.ru.mdx +12 -11
  51. package/src/media/mdx/Cell/cell.en.mdx +50 -9
  52. package/src/media/mdx/Cell/cell.ru.mdx +50 -9
  53. package/src/media/mdx/Cell/slots.en.mdx +82 -0
  54. package/src/media/mdx/Cell/slots.ru.mdx +83 -0
  55. package/src/media/mdx/Cell/wikiMdxCell.ts +6 -12
  56. package/src/media/mdx/Chip/assistive.en.mdx +12 -14
  57. package/src/media/mdx/Chip/assistive.ru.mdx +12 -14
  58. package/src/media/mdx/Chip/chip.en.mdx +69 -9
  59. package/src/media/mdx/Chip/chip.ru.mdx +69 -9
  60. package/src/media/mdx/Chip/input.en.mdx +12 -19
  61. package/src/media/mdx/Chip/input.ru.mdx +12 -19
  62. package/src/media/mdx/Field/arrows.en.mdx +67 -17
  63. package/src/media/mdx/Field/arrows.ru.mdx +67 -17
  64. package/src/media/mdx/Field/cancel.en.mdx +47 -10
  65. package/src/media/mdx/Field/cancel.ru.mdx +47 -10
  66. package/src/media/mdx/Field/field.en.mdx +45 -15
  67. package/src/media/mdx/Field/field.ru.mdx +45 -15
  68. package/src/media/mdx/Field/slots.en.mdx +151 -0
  69. package/src/media/mdx/Field/slots.ru.mdx +151 -0
  70. package/src/media/mdx/Field/value.en.mdx +49 -28
  71. package/src/media/mdx/Field/value.ru.mdx +49 -28
  72. package/src/media/mdx/Field/width.en.mdx +21 -19
  73. package/src/media/mdx/Field/width.ru.mdx +21 -19
  74. package/src/media/mdx/Field/wikiMdxField.ts +14 -26
  75. package/src/media/mdx/FieldCounter/fieldCounter.en.mdx +52 -14
  76. package/src/media/mdx/FieldCounter/fieldCounter.ru.mdx +55 -14
  77. package/src/media/mdx/FieldCounter/templates.en.mdx +26 -6
  78. package/src/media/mdx/FieldCounter/templates.ru.mdx +25 -5
  79. package/src/media/mdx/FieldLabel/fieldLabel.en.mdx +56 -14
  80. package/src/media/mdx/FieldLabel/fieldLabel.ru.mdx +56 -14
  81. package/src/media/mdx/FieldMessage/fieldMessage.en.mdx +58 -14
  82. package/src/media/mdx/FieldMessage/fieldMessage.ru.mdx +58 -14
  83. package/src/media/mdx/FieldMessage/slots.en.mdx +45 -0
  84. package/src/media/mdx/FieldMessage/slots.ru.mdx +45 -0
  85. package/src/media/mdx/FieldMessage/wikiMdxFieldMessage.ts +6 -12
  86. package/src/media/mdx/Icon/expose.isActive.en.mdx +2 -10
  87. package/src/media/mdx/Icon/expose.isActive.ru.mdx +2 -10
  88. package/src/media/mdx/Icon/icon.en.mdx +43 -9
  89. package/src/media/mdx/Icon/icon.ru.mdx +27 -28
  90. package/src/media/mdx/Image/adaptive.en.mdx +63 -20
  91. package/src/media/mdx/Image/adaptive.ru.mdx +62 -25
  92. package/src/media/mdx/Image/event.load.en.mdx +37 -2
  93. package/src/media/mdx/Image/event.load.ru.mdx +34 -7
  94. package/src/media/mdx/Image/{expose.type.ru.mdx → expose.en.mdx} +11 -1
  95. package/src/media/mdx/Image/expose.ru.mdx +31 -0
  96. package/src/media/mdx/Image/image.en.mdx +46 -0
  97. package/src/media/mdx/Image/image.ru.mdx +47 -0
  98. package/src/media/mdx/Image/size.en.mdx +19 -19
  99. package/src/media/mdx/Image/size.ru.mdx +19 -23
  100. package/src/media/mdx/Image/value.en.mdx +10 -27
  101. package/src/media/mdx/Image/value.ru.mdx +10 -29
  102. package/src/media/mdx/Image/wikiMdxImage.ts +11 -11
  103. package/src/media/mdx/List/event.close.en.mdx +5 -8
  104. package/src/media/mdx/List/event.close.ru.mdx +5 -8
  105. package/src/media/mdx/List/list.en.mdx +56 -14
  106. package/src/media/mdx/List/list.ru.mdx +56 -14
  107. package/src/media/mdx/List/lite.en.mdx +17 -12
  108. package/src/media/mdx/List/lite.ru.mdx +17 -12
  109. package/src/media/mdx/List/slot.html.en.mdx +72 -21
  110. package/src/media/mdx/List/slot.html.ru.mdx +72 -21
  111. package/src/media/mdx/ListGroup/listGroup.en.mdx +55 -1
  112. package/src/media/mdx/ListGroup/listGroup.ru.mdx +55 -1
  113. package/src/media/mdx/ListGroup/slots.en.mdx +10 -0
  114. package/src/media/mdx/ListGroup/slots.ru.mdx +10 -0
  115. package/src/media/mdx/ListGroup/wikiMdxListGroup.ts +6 -12
  116. package/src/media/mdx/ListItem/basic.en.mdx +47 -10
  117. package/src/media/mdx/ListItem/basic.ru.mdx +46 -9
  118. package/src/media/mdx/ListItem/fill.en.mdx +22 -8
  119. package/src/media/mdx/ListItem/fill.ru.mdx +22 -8
  120. package/src/media/mdx/ListItem/slots.en.mdx +7 -0
  121. package/src/media/mdx/ListItem/slots.ru.mdx +7 -0
  122. package/src/media/mdx/ListItem/wikiMdxListItem.ts +7 -13
  123. package/src/media/mdx/ListMenu/listMenu.en.mdx +62 -1
  124. package/src/media/mdx/ListMenu/listMenu.ru.mdx +62 -1
  125. package/src/media/mdx/Mask/basic.en.mdx +68 -16
  126. package/src/media/mdx/Mask/basic.ru.mdx +70 -11
  127. package/src/media/mdx/Mask/dateTypes.en.mdx +82 -68
  128. package/src/media/mdx/Mask/dateTypes.ru.mdx +82 -68
  129. package/src/media/mdx/Mask/expose.en.mdx +20 -0
  130. package/src/media/mdx/Mask/expose.ru.mdx +20 -0
  131. package/src/media/mdx/Mask/groupSave.en.mdx +13 -46
  132. package/src/media/mdx/Mask/groupSave.ru.mdx +13 -46
  133. package/src/media/mdx/Mask/mask.en.mdx +12 -66
  134. package/src/media/mdx/Mask/mask.ru.mdx +12 -66
  135. package/src/media/mdx/Mask/match.en.mdx +16 -24
  136. package/src/media/mdx/Mask/match.ru.mdx +16 -24
  137. package/src/media/mdx/Mask/numberTypes.en.mdx +64 -52
  138. package/src/media/mdx/Mask/numberTypes.ru.mdx +64 -52
  139. package/src/media/mdx/Mask/pattern.en.mdx +63 -75
  140. package/src/media/mdx/Mask/pattern.ru.mdx +63 -75
  141. package/src/media/mdx/Mask/special.en.mdx +174 -97
  142. package/src/media/mdx/Mask/special.ru.mdx +174 -97
  143. package/src/media/mdx/Mask/type.en.mdx +12 -36
  144. package/src/media/mdx/Mask/type.ru.mdx +11 -35
  145. package/src/media/mdx/Mask/visible.en.mdx +33 -41
  146. package/src/media/mdx/Mask/visible.ru.mdx +32 -40
  147. package/src/media/mdx/Mask/wikiMdxMask.ts +6 -0
  148. package/src/media/mdx/Menu/ajax.en.mdx +44 -51
  149. package/src/media/mdx/Menu/ajax.ru.mdx +44 -52
  150. package/src/media/mdx/Menu/menu.en.mdx +63 -1
  151. package/src/media/mdx/Menu/menu.ru.mdx +64 -1
  152. package/src/media/mdx/Menu/slots.en.mdx +122 -0
  153. package/src/media/mdx/Menu/slots.ru.mdx +122 -0
  154. package/src/media/mdx/Menu/wikiMdxMenu.ts +7 -32
  155. package/src/media/mdx/MotionTransform/animationHeadPosition.en.mdx +10 -22
  156. package/src/media/mdx/MotionTransform/animationHeadPosition.ru.mdx +10 -22
  157. package/src/media/mdx/MotionTransform/classes.en.mdx +18 -25
  158. package/src/media/mdx/MotionTransform/classes.ru.mdx +18 -25
  159. package/src/media/mdx/MotionTransform/events.en.mdx +31 -43
  160. package/src/media/mdx/MotionTransform/events.ru.mdx +31 -43
  161. package/src/media/mdx/MotionTransform/expose.isShow.en.mdx +2 -4
  162. package/src/media/mdx/MotionTransform/expose.isShow.ru.mdx +2 -4
  163. package/src/media/mdx/MotionTransform/ignore.en.mdx +22 -24
  164. package/src/media/mdx/MotionTransform/ignore.ru.mdx +22 -24
  165. package/src/media/mdx/MotionTransform/motionTransform.en.mdx +44 -15
  166. package/src/media/mdx/MotionTransform/motionTransform.ru.mdx +44 -15
  167. package/src/media/mdx/MotionTransform/slots.en.mdx +92 -0
  168. package/src/media/mdx/MotionTransform/slots.ru.mdx +92 -0
  169. package/src/media/mdx/MotionTransform/v-model.en.mdx +23 -14
  170. package/src/media/mdx/MotionTransform/v-model.ru.mdx +23 -14
  171. package/src/media/mdx/MotionTransform/wikiMdxMotionTransform.ts +5 -17
  172. package/src/media/mdx/Progress/circular.en.mdx +7 -20
  173. package/src/media/mdx/Progress/circular.ru.mdx +7 -20
  174. package/src/media/mdx/Progress/delays.en.mdx +6 -13
  175. package/src/media/mdx/Progress/delays.ru.mdx +6 -13
  176. package/src/media/mdx/Progress/linear.en.mdx +9 -23
  177. package/src/media/mdx/Progress/linear.ru.mdx +9 -23
  178. package/src/media/mdx/Progress/progress.en.mdx +67 -5
  179. package/src/media/mdx/Progress/progress.ru.mdx +67 -5
  180. package/src/media/mdx/Progress/values.en.mdx +6 -28
  181. package/src/media/mdx/Progress/values.ru.mdx +6 -29
  182. package/src/media/mdx/Ripple/ripple.en.mdx +34 -40
  183. package/src/media/mdx/Ripple/ripple.ru.mdx +34 -40
  184. package/src/media/mdx/Scrollbar/emits-include.en.mdx +38 -0
  185. package/src/media/mdx/Scrollbar/emits-include.ru.mdx +38 -0
  186. package/src/media/mdx/Scrollbar/emits.en.mdx +38 -0
  187. package/src/media/mdx/Scrollbar/emits.ru.mdx +38 -0
  188. package/src/media/mdx/Scrollbar/scrollbar.en.mdx +38 -2
  189. package/src/media/mdx/Scrollbar/scrollbar.ru.mdx +38 -2
  190. package/src/media/mdx/Scrollbar/wikiMdxScrollbar.ts +12 -43
  191. package/src/media/mdx/Skeleton/classes.en.mdx +13 -0
  192. package/src/media/mdx/Skeleton/classes.ru.mdx +13 -0
  193. package/src/media/mdx/Skeleton/expose.isActive.en.mdx +7 -28
  194. package/src/media/mdx/Skeleton/expose.isActive.ru.mdx +7 -28
  195. package/src/media/mdx/Skeleton/skeleton.en.mdx +37 -36
  196. package/src/media/mdx/Skeleton/skeleton.ru.mdx +37 -36
  197. package/src/media/mdx/Skeleton/wikiMdxSkeleton.ts +7 -0
  198. package/src/media/mdx/Window/axis.en.mdx +11 -19
  199. package/src/media/mdx/Window/axis.ru.mdx +11 -19
  200. package/src/media/mdx/Window/classes.en.mdx +9 -26
  201. package/src/media/mdx/Window/classes.ru.mdx +9 -26
  202. package/src/media/mdx/Window/event.window.en.mdx +26 -8
  203. package/src/media/mdx/Window/event.window.ru.mdx +26 -8
  204. package/src/media/mdx/Window/expose.en.mdx +44 -0
  205. package/src/media/mdx/Window/expose.ru.mdx +44 -0
  206. package/src/media/mdx/Window/hooks.en.mdx +29 -50
  207. package/src/media/mdx/Window/hooks.ru.mdx +31 -52
  208. package/src/media/mdx/Window/slots.en.mdx +168 -0
  209. package/src/media/mdx/Window/slots.ru.mdx +168 -0
  210. package/src/media/mdx/Window/v-model.en.mdx +20 -11
  211. package/src/media/mdx/Window/v-model.ru.mdx +19 -11
  212. package/src/media/mdx/Window/wikiMdxWindow.ts +11 -41
  213. package/src/media/mdx/Window/window.en.mdx +55 -1
  214. package/src/media/mdx/Window/window.ru.mdx +55 -1
  215. package/src/media/mdx/event/events.bars.en.mdx +50 -0
  216. package/src/media/mdx/event/events.bars.ru.mdx +50 -0
  217. package/src/media/mdx/event/events.beforeinput.en.mdx +13 -0
  218. package/src/media/mdx/event/events.beforeinput.ru.mdx +13 -0
  219. package/src/media/mdx/event/events.click.en.mdx +36 -0
  220. package/src/media/mdx/event/events.click.ru.mdx +36 -0
  221. package/src/media/mdx/event/events.focus.en.mdx +13 -0
  222. package/src/media/mdx/event/events.focus.ru.mdx +13 -0
  223. package/src/media/mdx/event/events.input.en.mdx +89 -0
  224. package/src/media/mdx/event/events.input.ru.mdx +90 -0
  225. package/src/media/mdx/event/events.keyboard.en.mdx +13 -0
  226. package/src/media/mdx/event/events.keyboard.ru.mdx +13 -0
  227. package/src/media/mdx/event/events.paste.en.mdx +6 -0
  228. package/src/media/mdx/event/events.paste.ru.mdx +6 -0
  229. package/src/media/mdx/event/events.reset.en.mdx +6 -0
  230. package/src/media/mdx/event/events.reset.ru.mdx +6 -0
  231. package/src/media/mdx/event/wikiMdxEvent.ts +39 -74
  232. package/src/media/mdx/expose/expose.clear.en.mdx +3 -0
  233. package/src/media/mdx/expose/expose.clear.ru.mdx +3 -0
  234. package/src/media/mdx/expose/expose.detail.en.mdx +5 -0
  235. package/src/media/mdx/expose/{detail.ru.mdx → expose.detail.ru.mdx} +1 -3
  236. package/src/media/mdx/expose/expose.open.en.mdx +5 -0
  237. package/src/media/mdx/expose/expose.open.ru.mdx +5 -0
  238. package/src/media/mdx/expose/expose.selected.en.mdx +23 -0
  239. package/src/media/mdx/expose/expose.selected.ru.mdx +23 -0
  240. package/src/media/mdx/expose/{value.en.mdx → expose.value.en.mdx} +1 -3
  241. package/src/media/mdx/expose/{value.ru.mdx → expose.value.ru.mdx} +1 -3
  242. package/src/media/mdx/expose/wikiMdxExpose.ts +25 -31
  243. package/src/media/mdx/slot/caption.en.mdx +2 -7
  244. package/src/media/mdx/slot/caption.ru.mdx +2 -7
  245. package/src/media/mdx/slot/control.en.mdx +4 -5
  246. package/src/media/mdx/slot/control.ru.mdx +4 -5
  247. package/src/media/mdx/slot/default.en.mdx +2 -7
  248. package/src/media/mdx/slot/default.ru.mdx +2 -7
  249. package/src/media/mdx/slot/description.en.mdx +2 -7
  250. package/src/media/mdx/slot/description.ru.mdx +2 -7
  251. package/src/media/mdx/slot/footer.en.mdx +4 -5
  252. package/src/media/mdx/slot/footer.ru.mdx +4 -5
  253. package/src/media/mdx/slot/label.en.mdx +2 -8
  254. package/src/media/mdx/slot/label.ru.mdx +2 -8
  255. package/src/media/mdx/slot/prefix.en.mdx +1 -4
  256. package/src/media/mdx/slot/prefix.ru.mdx +1 -4
  257. package/src/media/mdx/slot/suffix.en.mdx +1 -4
  258. package/src/media/mdx/slot/suffix.ru.mdx +1 -4
  259. package/src/media/mdx/slot/wikiMdxSlot.ts +0 -6
  260. package/src/media/mdx/style/adaptive.en.mdx +6 -16
  261. package/src/media/mdx/style/adaptive.ru.mdx +6 -16
  262. package/src/media/mdx/style/asPalette.en.mdx +13 -5
  263. package/src/media/mdx/style/asPalette.ru.mdx +13 -5
  264. package/src/media/mdx/style/dir.en.mdx +14 -7
  265. package/src/media/mdx/style/dir.ru.mdx +14 -7
  266. package/src/media/mdx/style/isSkeleton.en.mdx +20 -6
  267. package/src/media/mdx/style/isSkeleton.ru.mdx +19 -5
  268. package/src/media/mdx/value/highlight.en.mdx +19 -12
  269. package/src/media/mdx/value/highlight.ru.mdx +19 -12
  270. package/src/media/mdx/value/labelNumber.en.mdx +39 -20
  271. package/src/media/mdx/value/labelNumber.ru.mdx +39 -20
  272. package/src/media/mdx/value/value.en.mdx +6 -12
  273. package/src/media/mdx/value/value.ru.mdx +6 -12
  274. package/src/media/styles/color.md +1 -0
  275. package/src/media/styles/en/about.mdx +79 -0
  276. package/src/media/styles/en/color.mdx +711 -0
  277. package/src/media/styles/en/content.mdx +29 -0
  278. package/src/media/styles/en/dimension.mdx +233 -0
  279. package/src/media/styles/en/dir.mdx +193 -0
  280. package/src/media/styles/en/flex.mdx +249 -0
  281. package/src/media/styles/en/font.mdx +171 -0
  282. package/src/media/styles/en/margin.mdx +115 -0
  283. package/src/media/styles/en/media.mdx +133 -0
  284. package/src/media/styles/en/padding.mdx +115 -0
  285. package/src/media/styles/en/position.mdx +183 -0
  286. package/src/media/styles/en/rules.mdx +117 -0
  287. package/src/media/styles/en/scrollbar.mdx +27 -0
  288. package/src/media/styles/en/selector.mdx +153 -0
  289. package/src/media/styles/en/transform.mdx +114 -0
  290. package/src/media/styles/ru/about.mdx +78 -0
  291. package/src/media/styles/ru/color.mdx +711 -0
  292. package/src/media/styles/ru/content.mdx +30 -0
  293. package/src/media/styles/ru/dimension.mdx +233 -0
  294. package/src/media/styles/ru/dir.mdx +193 -0
  295. package/src/media/styles/ru/flex.mdx +249 -0
  296. package/src/media/styles/ru/font.mdx +171 -0
  297. package/src/media/styles/ru/margin.mdx +115 -0
  298. package/src/media/styles/ru/media.mdx +133 -0
  299. package/src/media/styles/ru/padding.mdx +115 -0
  300. package/src/media/styles/ru/position.mdx +183 -0
  301. package/src/media/styles/ru/rules.mdx +117 -0
  302. package/src/media/styles/ru/scrollbar.mdx +27 -0
  303. package/src/media/styles/ru/selector.mdx +153 -0
  304. package/src/media/styles/ru/transform.mdx +114 -0
  305. package/src/styles/storybookStyle.scss +1 -0
  306. package/src/media/mdx/Bars/slot.actionBars.en.mdx +0 -12
  307. package/src/media/mdx/Bars/slot.actionBars.ru.mdx +0 -11
  308. package/src/media/mdx/Bars/slot.bars.en.mdx +0 -12
  309. package/src/media/mdx/Bars/slot.bars.ru.mdx +0 -11
  310. package/src/media/mdx/Cell/slot.body.en.mdx +0 -7
  311. package/src/media/mdx/Cell/slot.body.ru.mdx +0 -7
  312. package/src/media/mdx/Cell/slot.trailing.en.mdx +0 -7
  313. package/src/media/mdx/Cell/slot.trailing.ru.mdx +0 -7
  314. package/src/media/mdx/Field/slot.default.en.mdx +0 -9
  315. package/src/media/mdx/Field/slot.default.ru.mdx +0 -9
  316. package/src/media/mdx/Field/slot.leading.en.mdx +0 -10
  317. package/src/media/mdx/Field/slot.leading.ru.mdx +0 -10
  318. package/src/media/mdx/Field/slot.trailing.en.mdx +0 -10
  319. package/src/media/mdx/Field/slot.trailing.ru.mdx +0 -10
  320. package/src/media/mdx/FieldMessage/slot.helper.en.mdx +0 -12
  321. package/src/media/mdx/FieldMessage/slot.helper.ru.mdx +0 -12
  322. package/src/media/mdx/FieldMessage/slot.validation.en.mdx +0 -12
  323. package/src/media/mdx/FieldMessage/slot.validation.ru.mdx +0 -12
  324. package/src/media/mdx/Image/expose.data.en.mdx +0 -13
  325. package/src/media/mdx/Image/expose.data.ru.mdx +0 -13
  326. package/src/media/mdx/Image/expose.type.en.mdx +0 -21
  327. package/src/media/mdx/ListGroup/slot.head.en.mdx +0 -8
  328. package/src/media/mdx/ListGroup/slot.head.ru.mdx +0 -8
  329. package/src/media/mdx/ListGroup/slot.list.en.mdx +0 -8
  330. package/src/media/mdx/ListGroup/slot.list.ru.mdx +0 -8
  331. package/src/media/mdx/ListItem/slot.body.en.mdx +0 -7
  332. package/src/media/mdx/ListItem/slot.body.ru.mdx +0 -7
  333. package/src/media/mdx/ListItem/slot.trailing.en.mdx +0 -7
  334. package/src/media/mdx/ListItem/slot.trailing.ru.mdx +0 -7
  335. package/src/media/mdx/Menu/slot.contextBottom.en.mdx +0 -9
  336. package/src/media/mdx/Menu/slot.contextBottom.ru.mdx +0 -9
  337. package/src/media/mdx/Menu/slot.contextTop.en.mdx +0 -9
  338. package/src/media/mdx/Menu/slot.contextTop.ru.mdx +0 -9
  339. package/src/media/mdx/Menu/slot.control.en.mdx +0 -9
  340. package/src/media/mdx/Menu/slot.control.ru.mdx +0 -9
  341. package/src/media/mdx/Menu/slot.footer.en.mdx +0 -9
  342. package/src/media/mdx/Menu/slot.footer.ru.mdx +0 -9
  343. package/src/media/mdx/Menu/slot.title.en.mdx +0 -9
  344. package/src/media/mdx/Menu/slot.title.ru.mdx +0 -9
  345. package/src/media/mdx/MotionTransform/slot.body.en.mdx +0 -11
  346. package/src/media/mdx/MotionTransform/slot.body.ru.mdx +0 -11
  347. package/src/media/mdx/MotionTransform/slot.head.en.mdx +0 -11
  348. package/src/media/mdx/MotionTransform/slot.head.ru.mdx +0 -11
  349. package/src/media/mdx/MotionTransform/slot.params.en.mdx +0 -61
  350. package/src/media/mdx/MotionTransform/slot.params.ru.mdx +0 -61
  351. package/src/media/mdx/Scrollbar/event.bottom.en.mdx +0 -12
  352. package/src/media/mdx/Scrollbar/event.bottom.ru.mdx +0 -12
  353. package/src/media/mdx/Scrollbar/event.edge.en.mdx +0 -14
  354. package/src/media/mdx/Scrollbar/event.edge.ru.mdx +0 -14
  355. package/src/media/mdx/Scrollbar/event.leaveBottom.en.mdx +0 -11
  356. package/src/media/mdx/Scrollbar/event.leaveBottom.ru.mdx +0 -11
  357. package/src/media/mdx/Scrollbar/event.leaveTop.en.mdx +0 -11
  358. package/src/media/mdx/Scrollbar/event.leaveTop.ru.mdx +0 -11
  359. package/src/media/mdx/Scrollbar/event.reachBottom.en.mdx +0 -11
  360. package/src/media/mdx/Scrollbar/event.reachBottom.ru.mdx +0 -11
  361. package/src/media/mdx/Scrollbar/event.reachTop.en.mdx +0 -11
  362. package/src/media/mdx/Scrollbar/event.reachTop.ru.mdx +0 -11
  363. package/src/media/mdx/Scrollbar/event.top.en.mdx +0 -12
  364. package/src/media/mdx/Scrollbar/event.top.ru.mdx +0 -12
  365. package/src/media/mdx/Window/expose.control.en.mdx +0 -15
  366. package/src/media/mdx/Window/expose.control.ru.mdx +0 -15
  367. package/src/media/mdx/Window/expose.id.en.mdx +0 -7
  368. package/src/media/mdx/Window/expose.id.ru.mdx +0 -7
  369. package/src/media/mdx/Window/expose.open.en.mdx +0 -7
  370. package/src/media/mdx/Window/expose.open.ru.mdx +0 -7
  371. package/src/media/mdx/Window/expose.setOpen.en.mdx +0 -7
  372. package/src/media/mdx/Window/expose.setOpen.ru.mdx +0 -7
  373. package/src/media/mdx/Window/expose.toClose.en.mdx +0 -7
  374. package/src/media/mdx/Window/expose.toClose.ru.mdx +0 -7
  375. package/src/media/mdx/Window/expose.toOpen.en.mdx +0 -7
  376. package/src/media/mdx/Window/expose.toOpen.ru.mdx +0 -7
  377. package/src/media/mdx/Window/expose.toggle.en.mdx +0 -7
  378. package/src/media/mdx/Window/expose.toggle.ru.mdx +0 -7
  379. package/src/media/mdx/event/bars.en.mdx +0 -17
  380. package/src/media/mdx/event/bars.ru.mdx +0 -14
  381. package/src/media/mdx/event/barsBack.en.mdx +0 -14
  382. package/src/media/mdx/event/barsBack.ru.mdx +0 -16
  383. package/src/media/mdx/event/barsLite.en.mdx +0 -14
  384. package/src/media/mdx/event/barsLite.ru.mdx +0 -14
  385. package/src/media/mdx/event/click.en.mdx +0 -18
  386. package/src/media/mdx/event/click.ru.mdx +0 -18
  387. package/src/media/mdx/event/clickLite.en.mdx +0 -18
  388. package/src/media/mdx/event/clickLite.ru.mdx +0 -18
  389. package/src/media/mdx/event/scrollbarBottom.en.mdx +0 -13
  390. package/src/media/mdx/event/scrollbarBottom.ru.mdx +0 -13
  391. package/src/media/mdx/event/scrollbarEdge.en.mdx +0 -15
  392. package/src/media/mdx/event/scrollbarEdge.ru.mdx +0 -15
  393. package/src/media/mdx/event/scrollbarLeaveBottom.en.mdx +0 -12
  394. package/src/media/mdx/event/scrollbarLeaveBottom.ru.mdx +0 -12
  395. package/src/media/mdx/event/scrollbarLeaveTop.en.mdx +0 -12
  396. package/src/media/mdx/event/scrollbarLeaveTop.ru.mdx +0 -12
  397. package/src/media/mdx/event/scrollbarReachBottom.en.mdx +0 -12
  398. package/src/media/mdx/event/scrollbarReachBottom.ru.mdx +0 -12
  399. package/src/media/mdx/event/scrollbarReachTop.en.mdx +0 -12
  400. package/src/media/mdx/event/scrollbarReachTop.ru.mdx +0 -12
  401. package/src/media/mdx/event/scrollbarTop.en.mdx +0 -13
  402. package/src/media/mdx/event/scrollbarTop.ru.mdx +0 -13
  403. package/src/media/mdx/event/window.en.mdx +0 -20
  404. package/src/media/mdx/event/window.ru.mdx +0 -20
  405. package/src/media/mdx/expose/detail.en.mdx +0 -7
  406. package/src/media/mdx/expose/isSelected.en.mdx +0 -8
  407. package/src/media/mdx/expose/isSelected.ru.mdx +0 -8
  408. package/src/media/mdx/expose/selectedList.en.mdx +0 -7
  409. package/src/media/mdx/expose/selectedList.ru.mdx +0 -7
  410. package/src/media/mdx/expose/selectedNames.en.mdx +0 -7
  411. package/src/media/mdx/expose/selectedNames.ru.mdx +0 -7
  412. package/src/media/mdx/expose/selectedValues.en.mdx +0 -8
  413. package/src/media/mdx/expose/selectedValues.ru.mdx +0 -8
  414. package/src/media/mdx/slot/title.en.mdx +0 -9
  415. package/src/media/mdx/slot/title.ru.mdx +0 -9
@@ -0,0 +1,307 @@
1
+ import {Meta} from '@storybook/addon-docs/blocks'
2
+
3
+ <Meta title='@dxtmisha/functional/en/Classes/BroadcastMessage'/>
4
+
5
+ # BroadcastMessage Class
6
+
7
+ A class for handling BroadcastChannel messaging between browser tabs/windows. Enables real-time communication across different contexts of the same origin with automatic channel naming and message handling.
8
+
9
+ ## Key Features
10
+
11
+ - **Cross-tab communication** — send and receive messages between browser tabs and windows
12
+ - **Automatic channel naming** — unique channel names per browser instance stored in localStorage
13
+ - **Type-safe messaging** — full TypeScript support with generic message types
14
+ - **Callback-based handling** — flexible message handling through callback functions
15
+ - **Error handling** — graceful error handling with console logging
16
+ - **SSR-safe** — automatically detects DOM runtime environment
17
+
18
+ ## Basic Usage
19
+
20
+ ### Constructor
21
+
22
+ Creates a new BroadcastMessage instance with specified channel name and optional callback.
23
+
24
+ **Parameters:**
25
+ - `name: string` — channel name identifier
26
+ - `callback?: (event: MessageEvent<Message>) => void` — optional callback for received messages
27
+
28
+ ```javascript
29
+ import { BroadcastMessage } from '@dxtmisha/functional'
30
+
31
+ // Create channel with callback
32
+ const channel = new BroadcastMessage('user-updates', (event) => {
33
+ console.log('Received message:', event.data)
34
+ })
35
+
36
+ // Create channel without callback (can be set later)
37
+ const notifications = new BroadcastMessage('notifications')
38
+ ```
39
+
40
+ ### `post`
41
+
42
+ Sends a message to all connected tabs/windows on the same channel.
43
+
44
+ **Parameters:**
45
+ - `message: Message` — message to broadcast
46
+
47
+ **Returns:** `this` — for method chaining
48
+
49
+ ```javascript
50
+ import { BroadcastMessage } from '@dxtmisha/functional'
51
+
52
+ const userChannel = new BroadcastMessage('user-updates')
53
+
54
+ // Send simple message
55
+ userChannel.post({ type: 'login', userId: 123 })
56
+
57
+ // Method chaining
58
+ userChannel
59
+ .post({ type: 'status', value: 'online' })
60
+ .post({ type: 'activity', timestamp: Date.now() })
61
+ ```
62
+
63
+ ### `setCallback`
64
+
65
+ Sets or updates the callback function for handling received messages.
66
+
67
+ **Parameters:**
68
+ - `callback: (event: MessageEvent<Message>) => void` — callback function
69
+
70
+ **Returns:** `this` — for method chaining
71
+
72
+ ```javascript
73
+ import { BroadcastMessage } from '@dxtmisha/functional'
74
+
75
+ const channel = new BroadcastMessage('app-events')
76
+
77
+ // Set callback later
78
+ channel.setCallback((event) => {
79
+ console.log('Event received:', event.data)
80
+ })
81
+
82
+ // Update callback
83
+ channel.setCallback((event) => {
84
+ if (event.data.type === 'refresh') {
85
+ location.reload()
86
+ }
87
+ })
88
+ ```
89
+
90
+ ## Advanced Examples
91
+
92
+ ### Cross-Tab State Synchronization
93
+
94
+ ```javascript
95
+ import { BroadcastMessage } from '@dxtmisha/functional'
96
+ import { ref } from 'vue'
97
+
98
+ // Create reactive state
99
+ const userStatus = ref('offline')
100
+
101
+ // Create broadcast channel
102
+ const statusChannel = new BroadcastMessage('user-status', (event) => {
103
+ // Update local state when other tabs broadcast changes
104
+ userStatus.value = event.data.status
105
+ console.log('Status updated from another tab:', event.data.status)
106
+ })
107
+
108
+ // Function to update status and broadcast to other tabs
109
+ function updateStatus(newStatus) {
110
+ userStatus.value = newStatus
111
+ statusChannel.post({ status: newStatus, timestamp: Date.now() })
112
+ }
113
+
114
+ // Usage
115
+ updateStatus('online') // Updates this tab and notifies others
116
+ ```
117
+
118
+ ### Multi-Tab Shopping Cart
119
+
120
+ ```javascript
121
+ import { BroadcastMessage } from '@dxtmisha/functional'
122
+
123
+ // Define message types
124
+ interface CartMessage {
125
+ action: 'add' | 'remove' | 'clear'
126
+ productId?: number
127
+ quantity?: number
128
+ }
129
+
130
+ // Create channel with typed messages
131
+ const cartChannel = new BroadcastMessage<CartMessage>('shopping-cart')
132
+
133
+ // Set up message handler
134
+ cartChannel.setCallback((event) => {
135
+ const { action, productId, quantity } = event.data
136
+
137
+ switch (action) {
138
+ case 'add':
139
+ console.log(`Adding ${quantity} of product ${productId}`)
140
+ addToCart(productId, quantity)
141
+ break
142
+ case 'remove':
143
+ console.log(`Removing product ${productId}`)
144
+ removeFromCart(productId)
145
+ break
146
+ case 'clear':
147
+ console.log('Clearing cart')
148
+ clearCart()
149
+ break
150
+ }
151
+ })
152
+
153
+ // Broadcast cart updates
154
+ function addProduct(productId, quantity) {
155
+ addToCart(productId, quantity)
156
+ cartChannel.post({ action: 'add', productId, quantity })
157
+ }
158
+ ```
159
+
160
+ ### Authentication State Sync
161
+
162
+ ```javascript
163
+ import { BroadcastMessage } from '@dxtmisha/functional'
164
+
165
+ interface AuthMessage {
166
+ type: 'login' | 'logout' | 'token-refresh'
167
+ userId?: number
168
+ token?: string
169
+ }
170
+
171
+ const authChannel = new BroadcastMessage<AuthMessage>('auth-events', (event) => {
172
+ switch (event.data.type) {
173
+ case 'login':
174
+ console.log('User logged in:', event.data.userId)
175
+ location.reload()
176
+ break
177
+
178
+ case 'logout':
179
+ console.log('User logged out, redirecting...')
180
+ localStorage.removeItem('auth-token')
181
+ window.location.href = '/login'
182
+ break
183
+
184
+ case 'token-refresh':
185
+ console.log('Token refreshed')
186
+ localStorage.setItem('auth-token', event.data.token)
187
+ break
188
+ }
189
+ })
190
+
191
+ // Broadcast login
192
+ function handleLogin(userId, token) {
193
+ localStorage.setItem('auth-token', token)
194
+ authChannel.post({ type: 'login', userId, token })
195
+ }
196
+
197
+ // Broadcast logout
198
+ function handleLogout() {
199
+ localStorage.removeItem('auth-token')
200
+ authChannel.post({ type: 'logout' })
201
+ }
202
+ ```
203
+
204
+ ### Real-Time Notifications
205
+
206
+ ```javascript
207
+ import { BroadcastMessage } from '@dxtmisha/functional'
208
+
209
+ interface Notification {
210
+ id: string
211
+ title: string
212
+ message: string
213
+ type: 'info' | 'warning' | 'error' | 'success'
214
+ timestamp: number
215
+ }
216
+
217
+ const notificationChannel = new BroadcastMessage<Notification>('notifications')
218
+
219
+ // Set up notification handler
220
+ notificationChannel.setCallback((event) => {
221
+ const notification = event.data
222
+
223
+ // Display notification in all tabs
224
+ showNotification(notification.title, notification.message, notification.type)
225
+
226
+ if (notification.type === 'error') {
227
+ playErrorSound()
228
+ }
229
+ })
230
+
231
+ // Send notification to all tabs
232
+ function broadcastNotification(title, message, type = 'info') {
233
+ const notification = {
234
+ id: crypto.randomUUID(),
235
+ title,
236
+ message,
237
+ type,
238
+ timestamp: Date.now()
239
+ }
240
+
241
+ notificationChannel.post(notification)
242
+ }
243
+
244
+ // Usage
245
+ broadcastNotification('New Message', 'You have a new message from John', 'info')
246
+ ```
247
+
248
+ ## Implementation Details
249
+
250
+ ### Unique Channel Naming
251
+
252
+ Each browser instance generates a unique identifier stored in localStorage (`__broadcast-name`). This ensures that channels are isolated between different browser instances while allowing communication within the same instance across tabs.
253
+
254
+ ```javascript
255
+ // Channel name format: name_{random_7_digits}__your-channel-name
256
+ // Example: name_1234567__user-updates
257
+ ```
258
+
259
+ ### Error Handling
260
+
261
+ BroadcastMessage gracefully handles errors and logs them to console:
262
+
263
+ ```javascript
264
+ const channel = new BroadcastMessage('my-channel')
265
+ // If BroadcastChannel is not supported or initialization fails,
266
+ // error is logged: "BroadcastMessage my-channel: [error details]"
267
+ ```
268
+
269
+ ### SSR Compatibility
270
+
271
+ The class automatically detects DOM runtime environment using `isDomRuntime()`, making it safe to use in SSR/SSG contexts where BroadcastChannel API is not available.
272
+
273
+ ## Type Safety
274
+
275
+ ```typescript
276
+ import { BroadcastMessage } from '@dxtmisha/functional'
277
+
278
+ // Define your message structure
279
+ interface UserUpdate {
280
+ userId: number
281
+ action: 'online' | 'offline' | 'typing'
282
+ timestamp: number
283
+ }
284
+
285
+ // Create typed channel
286
+ const channel = new BroadcastMessage<UserUpdate>('users')
287
+
288
+ // TypeScript ensures type safety
289
+ channel.post({
290
+ userId: 123,
291
+ action: 'online',
292
+ timestamp: Date.now()
293
+ }) // ✓ Valid
294
+
295
+ channel.post({ invalid: 'data' }) // ✗ TypeScript error
296
+ ```
297
+
298
+ ## Browser Compatibility
299
+
300
+ BroadcastChannel API is supported in:
301
+ - Chrome/Edge 54+
302
+ - Firefox 38+
303
+ - Safari 15.4+
304
+ - Opera 41+
305
+
306
+ For older browsers, consider using a polyfill or fallback mechanism.
307
+
@@ -0,0 +1,305 @@
1
+ import {Meta} from '@storybook/addon-docs/blocks'
2
+
3
+ <Meta title='@dxtmisha/functional/ru/Classes/BroadcastMessage'/>
4
+
5
+ # Класс BroadcastMessage
6
+
7
+ Класс для работы с сообщениями BroadcastChannel между вкладками/окнами браузера. Обеспечивает коммуникацию в реальном времени между различными контекстами одного источника с автоматическим именованием каналов и обработкой сообщений.
8
+
9
+ ## Основные возможности
10
+
11
+ - **Межвкладочная коммуникация** — отправка и получение сообщений между вкладками и окнами браузера
12
+ - **Автоматическое именование каналов** — уникальные имена каналов для каждого экземпляра браузера, сохраняемые в localStorage
13
+ - **Типобезопасная передача сообщений** — полная поддержка TypeScript с генерик-типами сообщений
14
+ - **Обработка через callback** — гибкая обработка сообщений через callback-функции
15
+ - **Обработка ошибок** — корректная обработка ошибок с логированием в консоль
16
+ - **Безопасность SSR** — автоматическое определение окружения DOM runtime
17
+
18
+ ## Основное использование
19
+
20
+ ### Конструктор
21
+
22
+ Создаёт новый экземпляр BroadcastMessage с указанным именем канала и опциональным callback.
23
+
24
+ **Параметры:**
25
+ - `name: string` — идентификатор имени канала
26
+ - `callback?: (event: MessageEvent<Message>) => void` — опциональный callback для получаемых сообщений
27
+
28
+ ```javascript
29
+ import { BroadcastMessage } from '@dxtmisha/functional'
30
+
31
+ // Создание канала с callback
32
+ const channel = new BroadcastMessage('user-updates', (event) => {
33
+ console.log('Получено сообщение:', event.data)
34
+ })
35
+
36
+ // Создание канала без callback (можно установить позже)
37
+ const notifications = new BroadcastMessage('notifications')
38
+ ```
39
+
40
+ ### `post`
41
+
42
+ Отправляет сообщение всем подключённым вкладкам/окнам на том же канале.
43
+
44
+ **Параметры:**
45
+ - `message: Message` — сообщение для отправки
46
+
47
+ **Возвращает:** `this` — для цепочки вызовов
48
+
49
+ ```javascript
50
+ import { BroadcastMessage } from '@dxtmisha/functional'
51
+
52
+ const userChannel = new BroadcastMessage('user-updates')
53
+
54
+ // Отправка простого сообщения
55
+ userChannel.post({ type: 'login', userId: 123 })
56
+
57
+ // Цепочка вызовов
58
+ userChannel
59
+ .post({ type: 'status', value: 'online' })
60
+ .post({ type: 'activity', timestamp: Date.now() })
61
+ ```
62
+
63
+ ### `setCallback`
64
+
65
+ Устанавливает или обновляет callback-функцию для обработки получаемых сообщений.
66
+
67
+ **Параметры:**
68
+ - `callback: (event: MessageEvent<Message>) => void` — callback-функция
69
+
70
+ **Возвращает:** `this` — для цепочки вызовов
71
+
72
+ ```javascript
73
+ import { BroadcastMessage } from '@dxtmisha/functional'
74
+
75
+ const channel = new BroadcastMessage('app-events')
76
+
77
+ // Установка callback позже
78
+ channel.setCallback((event) => {
79
+ console.log('Получено событие:', event.data)
80
+ })
81
+
82
+ // Обновление callback
83
+ channel.setCallback((event) => {
84
+ if (event.data.type === 'refresh') {
85
+ location.reload()
86
+ }
87
+ })
88
+ ```
89
+
90
+ ## Расширенные примеры
91
+
92
+ ### Синхронизация состояния между вкладками
93
+
94
+ ```javascript
95
+ import { BroadcastMessage } from '@dxtmisha/functional'
96
+ import { ref } from 'vue'
97
+
98
+ // Создание реактивного состояния
99
+ const userStatus = ref('offline')
100
+
101
+ // Создание канала broadcast
102
+ const statusChannel = new BroadcastMessage('user-status', (event) => {
103
+ // Обновление локального состояния при изменениях из других вкладок
104
+ userStatus.value = event.data.status
105
+ console.log('Статус обновлён из другой вкладки:', event.data.status)
106
+ })
107
+
108
+ // Функция для обновления статуса и оповещения других вкладок
109
+ function updateStatus(newStatus) {
110
+ userStatus.value = newStatus
111
+ statusChannel.post({ status: newStatus, timestamp: Date.now() })
112
+ }
113
+
114
+ // Использование
115
+ updateStatus('online') // Обновляет эту вкладку и уведомляет другие
116
+ ```
117
+
118
+ ### Корзина покупок в нескольких вкладках
119
+
120
+ ```javascript
121
+ import { BroadcastMessage } from '@dxtmisha/functional'
122
+
123
+ // Определение типов сообщений
124
+ interface CartMessage {
125
+ action: 'add' | 'remove' | 'clear'
126
+ productId?: number
127
+ quantity?: number
128
+ }
129
+
130
+ // Создание канала с типизированными сообщениями
131
+ const cartChannel = new BroadcastMessage<CartMessage>('shopping-cart')
132
+
133
+ // Настройка обработчика сообщений
134
+ cartChannel.setCallback((event) => {
135
+ const { action, productId, quantity } = event.data
136
+
137
+ switch (action) {
138
+ case 'add':
139
+ console.log(`Добавление ${quantity} товара ${productId}`)
140
+ addToCart(productId, quantity)
141
+ break
142
+ case 'remove':
143
+ console.log(`Удаление товара ${productId}`)
144
+ removeFromCart(productId)
145
+ break
146
+ case 'clear':
147
+ console.log('Очистка корзины')
148
+ clearCart()
149
+ break
150
+ }
151
+ })
152
+
153
+ // Трансляция обновлений корзины
154
+ function addProduct(productId, quantity) {
155
+ addToCart(productId, quantity)
156
+ cartChannel.post({ action: 'add', productId, quantity })
157
+ }
158
+ ```
159
+
160
+ ### Синхронизация состояния аутентификации
161
+
162
+ ```javascript
163
+ import { BroadcastMessage } from '@dxtmisha/functional'
164
+
165
+ interface AuthMessage {
166
+ type: 'login' | 'logout' | 'token-refresh'
167
+ userId?: number
168
+ token?: string
169
+ }
170
+
171
+ const authChannel = new BroadcastMessage<AuthMessage>('auth-events', (event) => {
172
+ switch (event.data.type) {
173
+ case 'login':
174
+ console.log('Пользователь вошёл:', event.data.userId)
175
+ location.reload()
176
+ break
177
+
178
+ case 'logout':
179
+ console.log('Пользователь вышел, перенаправление...')
180
+ localStorage.removeItem('auth-token')
181
+ window.location.href = '/login'
182
+ break
183
+
184
+ case 'token-refresh':
185
+ console.log('Токен обновлён')
186
+ localStorage.setItem('auth-token', event.data.token)
187
+ break
188
+ }
189
+ })
190
+
191
+ // Трансляция входа
192
+ function handleLogin(userId, token) {
193
+ localStorage.setItem('auth-token', token)
194
+ authChannel.post({ type: 'login', userId, token })
195
+ }
196
+
197
+ // Трансляция выхода
198
+ function handleLogout() {
199
+ localStorage.removeItem('auth-token')
200
+ authChannel.post({ type: 'logout' })
201
+ }
202
+ ```
203
+
204
+ ### Уведомления в реальном времени
205
+
206
+ ```javascript
207
+ import { BroadcastMessage } from '@dxtmisha/functional'
208
+
209
+ interface Notification {
210
+ id: string
211
+ title: string
212
+ message: string
213
+ type: 'info' | 'warning' | 'error' | 'success'
214
+ timestamp: number
215
+ }
216
+
217
+ const notificationChannel = new BroadcastMessage<Notification>('notifications')
218
+
219
+ // Настройка обработчика уведомлений
220
+ notificationChannel.setCallback((event) => {
221
+ const notification = event.data
222
+
223
+ showNotification(notification.title, notification.message, notification.type)
224
+
225
+ if (notification.type === 'error') {
226
+ playErrorSound()
227
+ }
228
+ })
229
+
230
+ // Отправка уведомления всем вкладкам
231
+ function broadcastNotification(title, message, type = 'info') {
232
+ const notification = {
233
+ id: crypto.randomUUID(),
234
+ title,
235
+ message,
236
+ type,
237
+ timestamp: Date.now()
238
+ }
239
+
240
+ notificationChannel.post(notification)
241
+ }
242
+
243
+ // Использование
244
+ broadcastNotification('Новое сообщение', 'У вас новое сообщение от Ивана', 'info')
245
+ ```
246
+
247
+ ## Детали реализации
248
+
249
+ ### Уникальное именование каналов
250
+
251
+ Каждый экземпляр браузера генерирует уникальный идентификатор, сохраняемый в localStorage (`__broadcast-name`). Это гарантирует изоляцию каналов между различными экземплярами браузера, при этом позволяя коммуникацию внутри одного экземпляра между вкладками.
252
+
253
+ ```javascript
254
+ // Формат имени канала: name_{случайные_7_цифр}__ваше-имя-канала
255
+ // Пример: name_1234567__user-updates
256
+ ```
257
+
258
+ ### Обработка ошибок
259
+
260
+ BroadcastMessage корректно обрабатывает ошибки и логирует их в консоль:
261
+
262
+ ```javascript
263
+ const channel = new BroadcastMessage('my-channel')
264
+ // Если BroadcastChannel не поддерживается или инициализация не удалась,
265
+ // ошибка логируется: "BroadcastMessage my-channel: [детали ошибки]"
266
+ ```
267
+
268
+ ### Совместимость с SSR
269
+
270
+ Класс автоматически определяет окружение DOM runtime с помощью `isDomRuntime()`, что делает его безопасным для использования в контекстах SSR/SSG, где BroadcastChannel API недоступен.
271
+
272
+ ## Типобезопасность
273
+
274
+ ```typescript
275
+ import { BroadcastMessage } from '@dxtmisha/functional'
276
+
277
+ // Определение структуры сообщения
278
+ interface UserUpdate {
279
+ userId: number
280
+ action: 'online' | 'offline' | 'typing'
281
+ timestamp: number
282
+ }
283
+
284
+ // Создание типизированного канала
285
+ const channel = new BroadcastMessage<UserUpdate>('users')
286
+
287
+ // TypeScript обеспечивает типобезопасность
288
+ channel.post({
289
+ userId: 123,
290
+ action: 'online',
291
+ timestamp: Date.now()
292
+ }) // ✓ Валидно
293
+
294
+ channel.post({ invalid: 'data' }) // ✗ Ошибка TypeScript
295
+ ```
296
+
297
+ ## Совместимость с браузерами
298
+
299
+ BroadcastChannel API поддерживается в:
300
+ - Chrome/Edge 54+
301
+ - Firefox 38+
302
+ - Safari 15.4+
303
+ - Opera 41+
304
+
305
+ Для старых браузеров рассмотрите использование полифилла или механизма запасного варианта.
@@ -1,11 +1,89 @@
1
1
  ## Description
2
2
 
3
- The Badge component is a small visual indicator used to display status, count, or notifications on interface elements. It provides a compact way to convey important information without taking up much space.
3
+ Compact visual indicator for displaying status, notification counts, or markers on interface elements with support for various display modes and automatic overflow management.
4
4
 
5
- ### Key Features
5
+ Badge provides a universal solution for creating informative indicators with flexible content configuration, positioning, and appearance. The component supports displaying text, numbers with maximum value limits, icons, and dot indicators, automatically hides when content is absent, and integrates with the slot system for customization.
6
6
 
7
- - **Status indication**: Display different states with color variants
8
- - **Content flexibility**: Show text, numbers, or leave empty for dot indicator
9
- - **Smart overflow**: Automatically handle large numbers with max value display
10
- - **Positioning**: Flexible placement relative to parent elements
11
- - **Accessibility**: Built-in support for screen readers and keyboard navigation
7
+ **Key features:**
8
+
9
+ - Multiple display modes (text, numbers, icons, dot indicator)
10
+ - Automatic overflow management with maximum value configuration
11
+ - Flexible positioning relative to parent elements (overlap, vertical, horizontal)
12
+ - Automatic hiding when content is absent (dot, icon, label)
13
+ - Integration with LabelNumberInclude for numeric value processing
14
+ - Icon support through IconInclude
15
+ - Color variants for different status types
16
+ - Visibility control via hide property
17
+ - Customization through slots for complete content control
18
+
19
+ **Common use cases:**
20
+
21
+ - Unread notification count indicators
22
+ - Status markers on user avatars (online/offline)
23
+ - Item counters in shopping carts or lists
24
+ - New message indicators in chats
25
+ - Status markers on product cards
26
+ - Visual hints about available updates
27
+ - Numeric indicators on tabs and menu items
28
+
29
+ ```html
30
+ <script setup>
31
+ import { ref } from 'vue'
32
+
33
+ const cartCount = ref(5)
34
+ const unreadMessages = ref(127)
35
+ const isOnline = ref(true)
36
+
37
+ const addToCart = () => {
38
+ cartCount.value++
39
+ }
40
+ </script>
41
+
42
+ <template>
43
+ <div class="badge-examples">
44
+ <!-- Basic badge with number -->
45
+ <div style="position: relative; display: inline-block;">
46
+ <IconButton icon="shopping_cart" @click="addToCart"/>
47
+ <Badge :label="cartCount"/>
48
+ </div>
49
+
50
+ <!-- Badge with maximum value limit -->
51
+ <div style="position: relative; display: inline-block;">
52
+ <IconButton icon="notifications"/>
53
+ <Badge :label="unreadMessages" :label-max="99"/>
54
+ </div>
55
+
56
+ <!-- Dot status indicator -->
57
+ <div style="position: relative; display: inline-block;">
58
+ <Avatar src="/user-avatar.jpg"/>
59
+ <Badge
60
+ dot
61
+ :selected="isOnline"
62
+ overlap="circular"
63
+ />
64
+ </div>
65
+
66
+ <!-- Badge with icon and text -->
67
+ <div style="position: relative; display: inline-block;">
68
+ <Button>Profile</Button>
69
+ <Badge
70
+ icon="verified"
71
+ label="Pro"
72
+ overlap="static"
73
+ />
74
+ </div>
75
+
76
+ <!-- Badge with custom positioning -->
77
+ <div style="position: relative; display: inline-block;">
78
+ <Card>Content</Card>
79
+ <Badge
80
+ label="New"
81
+ vertical="bottom"
82
+ horizontal="left"
83
+ />
84
+ </div>
85
+ </div>
86
+ </template>
87
+ ```
88
+
89
+ > Badge is designed as a universal UI component for creating compact visual indicators with comprehensive support for various content types, automatic display management, and flexible positioning settings.