@rynt/sdk 0.9.53

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 (332) hide show
  1. package/README.md +122 -0
  2. package/REGISTRIES.md +189 -0
  3. package/env.d.ts +11 -0
  4. package/host-shims.d.ts +30 -0
  5. package/package.json +88 -0
  6. package/src/extension-marketplace/api-types.ts +141 -0
  7. package/src/extension-marketplace/client.ts +296 -0
  8. package/src/extension-marketplace/index.ts +22 -0
  9. package/src/extension-marketplace/schemas.ts +178 -0
  10. package/src/extensions/ExtensionRoutePage.vue +17 -0
  11. package/src/extensions/context.ts +37 -0
  12. package/src/extensions/disabled-folder.ts +21 -0
  13. package/src/extensions/extension-expose-map.ts +5 -0
  14. package/src/extensions/extension-expose.ts +48 -0
  15. package/src/extensions/graph.ts +67 -0
  16. package/src/extensions/index.ts +251 -0
  17. package/src/extensions/invite-handler/types.ts +20 -0
  18. package/src/extensions/launcher-entities/create-launcher-entity.ts +25 -0
  19. package/src/extensions/launcher-entities/keys.ts +46 -0
  20. package/src/extensions/launcher-entities/launcher-entity-components.ts +177 -0
  21. package/src/extensions/launcher-entities/props-map.ts +69 -0
  22. package/src/extensions/launcher-entities/registry.ts +32 -0
  23. package/src/extensions/launcher-models/apis/accounts-contracts.ts +102 -0
  24. package/src/extensions/launcher-models/apis/launcher-model-apis.ts +553 -0
  25. package/src/extensions/launcher-models/keys.ts +23 -0
  26. package/src/extensions/launcher-models/public.ts +9 -0
  27. package/src/extensions/launcher-models/registry-core.ts +34 -0
  28. package/src/extensions/manifest-types.ts +22 -0
  29. package/src/extensions/manifest.ts +46 -0
  30. package/src/extensions/marketplace-open-key.ts +26 -0
  31. package/src/extensions/plugin-types.ts +44 -0
  32. package/src/extensions/plugin.ts +62 -0
  33. package/src/extensions/registries/bootstrap.ts +11 -0
  34. package/src/extensions/registries/builtins/account-provider.ts +6 -0
  35. package/src/extensions/registries/builtins/app-topbar-left-widgets.ts +6 -0
  36. package/src/extensions/registries/builtins/app-topbar-right-widgets.ts +6 -0
  37. package/src/extensions/registries/builtins/app-topbar-status-widgets.ts +6 -0
  38. package/src/extensions/registries/builtins/build-card-actions.ts +6 -0
  39. package/src/extensions/registries/builtins/build-card-after-meta.ts +6 -0
  40. package/src/extensions/registries/builtins/build-card-before-media.ts +6 -0
  41. package/src/extensions/registries/builtins/build-card-before-meta.ts +6 -0
  42. package/src/extensions/registries/builtins/build-card-footer-actions.ts +6 -0
  43. package/src/extensions/registries/builtins/build-detail-after-content.ts +6 -0
  44. package/src/extensions/registries/builtins/build-detail-before-content.ts +6 -0
  45. package/src/extensions/registries/builtins/build-detail-before-hero.ts +6 -0
  46. package/src/extensions/registries/builtins/build-detail-header-actions.ts +6 -0
  47. package/src/extensions/registries/builtins/build-detail-mod-row-actions.ts +6 -0
  48. package/src/extensions/registries/builtins/build-detail-resourcepack-row-actions.ts +6 -0
  49. package/src/extensions/registries/builtins/build-detail-right-column-bottom.ts +6 -0
  50. package/src/extensions/registries/builtins/build-detail-right-column-top.ts +6 -0
  51. package/src/extensions/registries/builtins/dialog-footer-actions.ts +6 -0
  52. package/src/extensions/registries/builtins/feed-after-content.ts +6 -0
  53. package/src/extensions/registries/builtins/feed-before-content.ts +6 -0
  54. package/src/extensions/registries/builtins/file-editor.ts +19 -0
  55. package/src/extensions/registries/builtins/friends-after-list.ts +6 -0
  56. package/src/extensions/registries/builtins/friends-before-list.ts +6 -0
  57. package/src/extensions/registries/builtins/index.ts +141 -0
  58. package/src/extensions/registries/builtins/invite-handler.ts +7 -0
  59. package/src/extensions/registries/builtins/library-after-content.ts +6 -0
  60. package/src/extensions/registries/builtins/library-before-content.ts +6 -0
  61. package/src/extensions/registries/builtins/loader.ts +8 -0
  62. package/src/extensions/registries/builtins/map-card-actions.ts +6 -0
  63. package/src/extensions/registries/builtins/map-card-after-meta.ts +6 -0
  64. package/src/extensions/registries/builtins/map-card-before-meta.ts +6 -0
  65. package/src/extensions/registries/builtins/map-card-footer-actions.ts +6 -0
  66. package/src/extensions/registries/builtins/map-detail-after-content.ts +6 -0
  67. package/src/extensions/registries/builtins/map-detail-before-content.ts +6 -0
  68. package/src/extensions/registries/builtins/map-detail-header-actions.ts +6 -0
  69. package/src/extensions/registries/builtins/markdown-editor-tiptap-extensions.ts +7 -0
  70. package/src/extensions/registries/builtins/markdown-editor-toolbar-actions.ts +6 -0
  71. package/src/extensions/registries/builtins/markdown-renderer-after-content.ts +6 -0
  72. package/src/extensions/registries/builtins/markdown-renderer-before-content.ts +6 -0
  73. package/src/extensions/registries/builtins/mod-details-footer-actions.ts +6 -0
  74. package/src/extensions/registries/builtins/mod-manage-actions.ts +6 -0
  75. package/src/extensions/registries/builtins/mod-provider.ts +5 -0
  76. package/src/extensions/registries/builtins/nav.ts +7 -0
  77. package/src/extensions/registries/builtins/page.ts +13 -0
  78. package/src/extensions/registries/builtins/projects-after-content.ts +6 -0
  79. package/src/extensions/registries/builtins/projects-before-content.ts +6 -0
  80. package/src/extensions/registries/builtins/resourcepack-manage-actions.ts +7 -0
  81. package/src/extensions/registries/builtins/server-card-actions.ts +6 -0
  82. package/src/extensions/registries/builtins/server-card-after-meta.ts +6 -0
  83. package/src/extensions/registries/builtins/server-card-before-meta.ts +6 -0
  84. package/src/extensions/registries/builtins/server-card-footer-actions.ts +6 -0
  85. package/src/extensions/registries/builtins/server-detail-after-content.ts +6 -0
  86. package/src/extensions/registries/builtins/server-detail-before-content.ts +6 -0
  87. package/src/extensions/registries/builtins/server-detail-header-actions.ts +6 -0
  88. package/src/extensions/registries/builtins/settings-after-sections.ts +6 -0
  89. package/src/extensions/registries/builtins/settings-before-sections.ts +6 -0
  90. package/src/extensions/registries/builtins/settings-section-widgets.ts +6 -0
  91. package/src/extensions/registries/builtins/shaderpack-manage-actions.ts +7 -0
  92. package/src/extensions/registries/builtins/shell.ts +5 -0
  93. package/src/extensions/registries/builtins/sidebar-after-content.ts +6 -0
  94. package/src/extensions/registries/builtins/sidebar-before-content.ts +6 -0
  95. package/src/extensions/registries/builtins/sidebar-footer-widgets.ts +6 -0
  96. package/src/extensions/registries/builtins/sidebar-header-widgets.ts +6 -0
  97. package/src/extensions/registries/builtins/sidebar.ts +11 -0
  98. package/src/extensions/registries/builtins/theme.ts +5 -0
  99. package/src/extensions/registries/builtins/user-card-after-meta.ts +6 -0
  100. package/src/extensions/registries/builtins/user-card-before-meta.ts +6 -0
  101. package/src/extensions/registries/builtins/user-menu-actions.ts +6 -0
  102. package/src/extensions/registries/builtins/user-menu-after-actions.ts +6 -0
  103. package/src/extensions/registries/builtins/user-menu-before-actions.ts +6 -0
  104. package/src/extensions/registries/builtins/user-strip.ts +5 -0
  105. package/src/extensions/registries/clear-extension-ui-registries.ts +15 -0
  106. package/src/extensions/registries/define-extension-registry.ts +58 -0
  107. package/src/extensions/registries/extension-host-api.ts +41 -0
  108. package/src/extensions/registries/extension-registry-api.ts +103 -0
  109. package/src/extensions/registries/extension-registry-payload-map.ts +9 -0
  110. package/src/extensions/registries/extension-scope.ts +41 -0
  111. package/src/extensions/registries/get-registry.ts +23 -0
  112. package/src/extensions/registries/index.ts +58 -0
  113. package/src/extensions/registries/manifest-rynt.ts +193 -0
  114. package/src/extensions/registries/registry-slot.ts +40 -0
  115. package/src/extensions/registries/registry-value-map.ts +89 -0
  116. package/src/extensions/registries/store.ts +206 -0
  117. package/src/extensions/resolve-extensions.ts +245 -0
  118. package/src/extensions/router-bridge.ts +103 -0
  119. package/src/extensions/session.ts +6 -0
  120. package/src/extensions/slug.ts +23 -0
  121. package/src/extensions/version.ts +147 -0
  122. package/src/host/extensions-composables.ts +33 -0
  123. package/src/host/extensions-init.ts +194 -0
  124. package/src/host/index.ts +11 -0
  125. package/src/host/launcher-models/index.ts +4 -0
  126. package/src/index.ts +229 -0
  127. package/src/minecraft-loader/base-loader.ts +102 -0
  128. package/src/minecraft-loader/index.ts +11 -0
  129. package/src/minecraft-loader/loader-registry.ts +72 -0
  130. package/src/shared/api/assets.ts +112 -0
  131. package/src/shared/api/auth.ts +283 -0
  132. package/src/shared/api/builds.ts +647 -0
  133. package/src/shared/api/config.ts +19 -0
  134. package/src/shared/api/download-stats.ts +103 -0
  135. package/src/shared/api/downloads.ts +36 -0
  136. package/src/shared/api/entity-authorship.ts +60 -0
  137. package/src/shared/api/events.ts +393 -0
  138. package/src/shared/api/friends.ts +140 -0
  139. package/src/shared/api/graphql.ts +87 -0
  140. package/src/shared/api/index.ts +23 -0
  141. package/src/shared/api/invites.ts +262 -0
  142. package/src/shared/api/library.ts +44 -0
  143. package/src/shared/api/maps.ts +385 -0
  144. package/src/shared/api/notify-websocket.ts +140 -0
  145. package/src/shared/api/posts.ts +357 -0
  146. package/src/shared/api/projectServers.ts +379 -0
  147. package/src/shared/api/serverMembers.ts +173 -0
  148. package/src/shared/api/users.ts +294 -0
  149. package/src/shared/composables/buildEditor/useBuildEditor.ts +66 -0
  150. package/src/shared/composables/buildManifest/buildManifest.ts +447 -0
  151. package/src/shared/composables/filesEditor/filesEditor.ts +346 -0
  152. package/src/shared/composables/index.ts +10 -0
  153. package/src/shared/composables/modsEditor/modsEditor.ts +1678 -0
  154. package/src/shared/composables/registrySlot/registry-slot-utils.ts +25 -0
  155. package/src/shared/composables/registrySlot/useRegistrySlotMissing.ts +35 -0
  156. package/src/shared/composables/resourcePacksEditor/resourcePacksEditor.ts +448 -0
  157. package/src/shared/composables/shaderPacksEditor/shaderPacksEditor.ts +395 -0
  158. package/src/shared/composables/useSkinRender.ts +70 -0
  159. package/src/shared/composables/useZlDeepLink.ts +178 -0
  160. package/src/shared/definitions/defineGraphCache.ts +216 -0
  161. package/src/shared/definitions/defineStore.ts +32 -0
  162. package/src/shared/definitions/index.ts +2 -0
  163. package/src/shared/minecraft-types/build-manifest.ts +611 -0
  164. package/src/shared/minecraft-types/index.ts +3 -0
  165. package/src/shared/minecraft-types/launcher-versions.ts +32 -0
  166. package/src/shared/minecraft-types/minecraft-launcher-types.ts +276 -0
  167. package/src/shared/mocks/index.ts +1 -0
  168. package/src/shared/mocks/navigation.ts +17 -0
  169. package/src/shared/mods/http.ts +45 -0
  170. package/src/shared/mods/index.ts +5 -0
  171. package/src/shared/mods/marketplace-editor-search.ts +266 -0
  172. package/src/shared/mods/marketplace-search-utils.ts +42 -0
  173. package/src/shared/mods/mod-marketplace-registry.ts +66 -0
  174. package/src/shared/mods/mod-marketplace-types.ts +28 -0
  175. package/src/shared/mods/providers/curseforge.ts +464 -0
  176. package/src/shared/mods/providers/index.ts +8 -0
  177. package/src/shared/mods/providers/modrinth.ts +402 -0
  178. package/src/shared/mods/resolve-mods-provider-loader-ids.ts +77 -0
  179. package/src/shared/mods/types.ts +76 -0
  180. package/src/shared/styles/index.css +713 -0
  181. package/src/shared/themes/index.ts +23 -0
  182. package/src/shared/themes/theme-tokens-black.json +126 -0
  183. package/src/shared/themes/theme-tokens-classic.json +126 -0
  184. package/src/shared/themes/theme-tokens-pink.json +126 -0
  185. package/src/shared/themes/theme-tokens.json +126 -0
  186. package/src/shared/themes/types.ts +85 -0
  187. package/src/shared/types/API_DOCUMENTATION.md +422 -0
  188. package/src/shared/types/account.ts +40 -0
  189. package/src/shared/types/build.ts +8 -0
  190. package/src/shared/types/entities.ts +181 -0
  191. package/src/shared/types/index.ts +6 -0
  192. package/src/shared/types/invite-payloads.ts +60 -0
  193. package/src/shared/types/navigation.ts +16 -0
  194. package/src/shared/types/running-build.ts +51 -0
  195. package/src/shared/types/serverMember.ts +17 -0
  196. package/src/shared/types/user.ts +55 -0
  197. package/src/shared/ui/base/Avatar.vue +262 -0
  198. package/src/shared/ui/base/Badge.vue +47 -0
  199. package/src/shared/ui/base/Button.vue +78 -0
  200. package/src/shared/ui/base/Divider.vue +42 -0
  201. package/src/shared/ui/base/Icon.vue +597 -0
  202. package/src/shared/ui/base/StatusIndicator.vue +44 -0
  203. package/src/shared/ui/base/index.ts +7 -0
  204. package/src/shared/ui/cards/InviteCard.vue +47 -0
  205. package/src/shared/ui/cards/index.ts +2 -0
  206. package/src/shared/ui/dialog/Dialog.vue +71 -0
  207. package/src/shared/ui/dialog/DialogContent.vue +31 -0
  208. package/src/shared/ui/dialog/DialogFooter.vue +14 -0
  209. package/src/shared/ui/dialog/DialogHeader.vue +41 -0
  210. package/src/shared/ui/dialog/index.ts +5 -0
  211. package/src/shared/ui/editors/AttachmentImagesEditor.vue +133 -0
  212. package/src/shared/ui/editors/ContentAttachmentsDisplay.vue +76 -0
  213. package/src/shared/ui/editors/MarkdownEditor.vue +956 -0
  214. package/src/shared/ui/editors/MarkdownRenderer.vue +299 -0
  215. package/src/shared/ui/editors/RichContentImageViewer.vue +85 -0
  216. package/src/shared/ui/editors/SocialPostMediaZone.vue +320 -0
  217. package/src/shared/ui/editors/index.ts +6 -0
  218. package/src/shared/ui/editors/markdown-editor-gallery.ts +234 -0
  219. package/src/shared/ui/editors/markdown-editor-image.ts +178 -0
  220. package/src/shared/ui/form/Checkbox.vue +38 -0
  221. package/src/shared/ui/form/FormField.vue +30 -0
  222. package/src/shared/ui/form/FormGrid.vue +38 -0
  223. package/src/shared/ui/form/ImageEditor.vue +598 -0
  224. package/src/shared/ui/form/Input.vue +72 -0
  225. package/src/shared/ui/form/Range.vue +65 -0
  226. package/src/shared/ui/form/Select.vue +76 -0
  227. package/src/shared/ui/form/Switch.vue +38 -0
  228. package/src/shared/ui/form/Textarea.vue +144 -0
  229. package/src/shared/ui/form/index.ts +9 -0
  230. package/src/shared/ui/index.ts +9 -0
  231. package/src/shared/ui/layout/BusyOverlay.vue +31 -0
  232. package/src/shared/ui/layout/Callout.vue +44 -0
  233. package/src/shared/ui/layout/Card.vue +38 -0
  234. package/src/shared/ui/layout/Container.vue +36 -0
  235. package/src/shared/ui/layout/EmptyState.vue +99 -0
  236. package/src/shared/ui/layout/EntityMediaRow.vue +54 -0
  237. package/src/shared/ui/layout/FilterResultsLayout.vue +22 -0
  238. package/src/shared/ui/layout/FloatingPanel.vue +37 -0
  239. package/src/shared/ui/layout/FullscreenDimmer.vue +11 -0
  240. package/src/shared/ui/layout/Grid.vue +40 -0
  241. package/src/shared/ui/layout/Inline.vue +59 -0
  242. package/src/shared/ui/layout/LoadingState.vue +39 -0
  243. package/src/shared/ui/layout/MediaBox.vue +47 -0
  244. package/src/shared/ui/layout/OverlayPanel.vue +28 -0
  245. package/src/shared/ui/layout/OverlayWaitPanel.vue +22 -0
  246. package/src/shared/ui/layout/PageSection.vue +43 -0
  247. package/src/shared/ui/layout/PageToolbar.vue +29 -0
  248. package/src/shared/ui/layout/Panel.vue +39 -0
  249. package/src/shared/ui/layout/ProgressBar.vue +49 -0
  250. package/src/shared/ui/layout/Section.vue +30 -0
  251. package/src/shared/ui/layout/SegmentedControl.vue +43 -0
  252. package/src/shared/ui/layout/SelectableCard.vue +46 -0
  253. package/src/shared/ui/layout/SelectableRow.vue +41 -0
  254. package/src/shared/ui/layout/Skeleton.vue +25 -0
  255. package/src/shared/ui/layout/SkeletonAvatar.vue +30 -0
  256. package/src/shared/ui/layout/SkeletonEntityCard.vue +20 -0
  257. package/src/shared/ui/layout/SkeletonFeedPost.vue +22 -0
  258. package/src/shared/ui/layout/SkeletonGrid.vue +18 -0
  259. package/src/shared/ui/layout/SkeletonListRow.vue +31 -0
  260. package/src/shared/ui/layout/SkeletonText.vue +25 -0
  261. package/src/shared/ui/layout/Stack.vue +42 -0
  262. package/src/shared/ui/layout/StateBlock.vue +44 -0
  263. package/src/shared/ui/layout/TwoPaneLayout.vue +35 -0
  264. package/src/shared/ui/layout/VirtualList.vue +160 -0
  265. package/src/shared/ui/layout/index.ts +35 -0
  266. package/src/shared/ui/layout/skeletonSurfaceStyles.ts +24 -0
  267. package/src/shared/ui/navigation/NavItem.vue +139 -0
  268. package/src/shared/ui/navigation/Tab.vue +61 -0
  269. package/src/shared/ui/navigation/Tabs.vue +37 -0
  270. package/src/shared/ui/navigation/index.ts +4 -0
  271. package/src/shared/ui/primitives/Action.vue +19 -0
  272. package/src/shared/ui/primitives/Block.vue +28 -0
  273. package/src/shared/ui/primitives/CanvasView.vue +19 -0
  274. package/src/shared/ui/primitives/Control.vue +24 -0
  275. package/src/shared/ui/primitives/ControlSelect.vue +19 -0
  276. package/src/shared/ui/primitives/ControlTextarea.vue +17 -0
  277. package/src/shared/ui/primitives/FieldLabel.vue +19 -0
  278. package/src/shared/ui/primitives/Form.vue +19 -0
  279. package/src/shared/ui/primitives/Heading.vue +29 -0
  280. package/src/shared/ui/primitives/Image.vue +17 -0
  281. package/src/shared/ui/primitives/LineBreak.vue +3 -0
  282. package/src/shared/ui/primitives/Link.vue +19 -0
  283. package/src/shared/ui/primitives/List.vue +28 -0
  284. package/src/shared/ui/primitives/ListItem.vue +19 -0
  285. package/src/shared/ui/primitives/OptionItem.vue +19 -0
  286. package/src/shared/ui/primitives/Text.vue +28 -0
  287. package/src/shared/ui/primitives/VideoView.vue +19 -0
  288. package/src/shared/ui/primitives/index.ts +19 -0
  289. package/src/shared/ui/primitives/resolveElement.ts +25 -0
  290. package/src/shared/ui/special/AngularAccent.vue +106 -0
  291. package/src/shared/ui/special/ExtensionRegistrySlotButton.vue +143 -0
  292. package/src/shared/ui/special/InfoRow.vue +39 -0
  293. package/src/shared/ui/special/LogViewer.vue +53 -0
  294. package/src/shared/ui/special/PageHeader.vue +23 -0
  295. package/src/shared/ui/special/RegistrySlotMissingCallout.vue +48 -0
  296. package/src/shared/ui/special/WelcomeCard.vue +32 -0
  297. package/src/shared/ui/special/index.ts +9 -0
  298. package/src/shared/utils/app-paths.ts +50 -0
  299. package/src/shared/utils/attachments.ts +16 -0
  300. package/src/shared/utils/autostart.ts +213 -0
  301. package/src/shared/utils/build-files.ts +439 -0
  302. package/src/shared/utils/build-manifest-init.ts +176 -0
  303. package/src/shared/utils/cloudinary.ts +67 -0
  304. package/src/shared/utils/cn.ts +7 -0
  305. package/src/shared/utils/download-stats-week.ts +165 -0
  306. package/src/shared/utils/entity-api-to-cache.ts +84 -0
  307. package/src/shared/utils/entity-build-from-api.ts +1 -0
  308. package/src/shared/utils/entity-display.ts +27 -0
  309. package/src/shared/utils/entity-map-from-api.ts +1 -0
  310. package/src/shared/utils/file-hash.ts +65 -0
  311. package/src/shared/utils/formatSize.ts +5 -0
  312. package/src/shared/utils/formatTime.ts +157 -0
  313. package/src/shared/utils/getAccountSkinRender.ts +32 -0
  314. package/src/shared/utils/index.ts +34 -0
  315. package/src/shared/utils/local-mods.ts +678 -0
  316. package/src/shared/utils/local-settings.ts +217 -0
  317. package/src/shared/utils/member-join-stats.ts +35 -0
  318. package/src/shared/utils/platform.ts +86 -0
  319. package/src/shared/utils/play-host-slug.ts +92 -0
  320. package/src/shared/utils/rich-content.ts +294 -0
  321. package/src/shared/utils/safeRequest.ts +23 -0
  322. package/src/shared/utils/semver.ts +81 -0
  323. package/src/shared/utils/serverPermissions.ts +155 -0
  324. package/src/shared/utils/skin-render-cache.ts +372 -0
  325. package/src/shared/utils/stripMarkdown.ts +45 -0
  326. package/src/shared/utils/transliterate.ts +74 -0
  327. package/src/shared/utils/updateAccountSkinRender.ts +64 -0
  328. package/src/shared/utils/updater.ts +218 -0
  329. package/src/shared/utils/uploadImage.ts +195 -0
  330. package/src/shared/utils/user-status.ts +9 -0
  331. package/src/tiptap/index.ts +7 -0
  332. package/tsconfig.json +13 -0
@@ -0,0 +1,143 @@
1
+ <template>
2
+ <template v-if="missing">
3
+ <Text v-if="lookupLoading" class="text-sm text-subtle-fg">Проверка каталога…</Text>
4
+
5
+ <Text v-else-if="lookupResult?.kind === 'none'" class="text-sm text-subtle-fg">
6
+ В каталоге нет расширения для этого слота.
7
+ </Text>
8
+
9
+ <Button
10
+ v-else-if="lookupResult?.kind === 'one'"
11
+ variant="secondary"
12
+ size="sm"
13
+ :loading="installing"
14
+ @click="installOne"
15
+ >
16
+ Установить «{{ lookupResult.extension.name }}»
17
+ </Button>
18
+
19
+ <Button
20
+ v-else-if="lookupResult?.kind === 'many'"
21
+ variant="secondary"
22
+ size="sm"
23
+ @click="openSlotPicker"
24
+ >
25
+ {{ label ?? 'Выбрать расширение…' }}
26
+ </Button>
27
+
28
+ <Button
29
+ v-else
30
+ variant="secondary"
31
+ size="sm"
32
+ @click="openSlotPicker"
33
+ >
34
+ {{ label ?? 'Добавить расширение…' }}
35
+ </Button>
36
+ </template>
37
+ </template>
38
+
39
+ <script setup lang="ts">
40
+ import { computed, inject, ref, watch } from 'vue';
41
+ import { extensionRegistriesRevision } from '../../../extensions/registries/store';
42
+ import { resolveRegistrySlot } from '../../../extensions/registries/registry-slot';
43
+ import {
44
+ RYNT_EXTENSION_MARKETPLACE_INSTALL,
45
+ RYNT_EXTENSION_MARKETPLACE_OPEN,
46
+ RYNT_EXTENSION_MARKETPLACE_SLOT_RESOLVE,
47
+ } from '../../../extensions/marketplace-open-key';
48
+ import type { MarketplaceSlotLookupResult } from '../../../extension-marketplace/api-types';
49
+ import Button from '../base/Button.vue';
50
+ import Text from '../primitives/Text.vue';
51
+
52
+ const props = withDefaults(
53
+ defineProps<{
54
+ registryId: string;
55
+ registryKey: string;
56
+ label?: string;
57
+ onResolved?: () => void;
58
+ }>(),
59
+ {},
60
+ );
61
+
62
+ const openMarketplace = inject(RYNT_EXTENSION_MARKETPLACE_OPEN, null);
63
+ const resolveSlot = inject(RYNT_EXTENSION_MARKETPLACE_SLOT_RESOLVE, null);
64
+ const installFromMarketplace = inject(RYNT_EXTENSION_MARKETPLACE_INSTALL, null);
65
+
66
+ const lookupResult = ref<MarketplaceSlotLookupResult | null>(null);
67
+ const lookupLoading = ref(false);
68
+ const installing = ref(false);
69
+
70
+ const missing = computed(() => {
71
+ void extensionRegistriesRevision.value;
72
+ return (
73
+ resolveRegistrySlot(props.registryId, props.registryKey).status ===
74
+ 'missing'
75
+ );
76
+ });
77
+
78
+ async function refreshLookup(): Promise<void> {
79
+ if (!missing.value) {
80
+ lookupResult.value = null;
81
+ return;
82
+ }
83
+ if (!resolveSlot) {
84
+ lookupResult.value = null;
85
+ return;
86
+ }
87
+ lookupLoading.value = true;
88
+ try {
89
+ lookupResult.value = await resolveSlot({
90
+ registryId: props.registryId,
91
+ key: props.registryKey,
92
+ });
93
+ } catch (e) {
94
+ console.warn('[rynt/sdk] ExtensionRegistrySlotButton: lookup failed', e);
95
+ lookupResult.value = null;
96
+ } finally {
97
+ lookupLoading.value = false;
98
+ }
99
+ }
100
+
101
+ function openSlotPicker(): void {
102
+ if (openMarketplace) {
103
+ openMarketplace({
104
+ mode: 'slot',
105
+ registryId: props.registryId,
106
+ key: props.registryKey,
107
+ });
108
+ } else {
109
+ console.warn(
110
+ '[rynt/sdk] ExtensionRegistrySlotButton: RYNT_EXTENSION_MARKETPLACE_OPEN не задан в provide',
111
+ );
112
+ }
113
+ }
114
+
115
+ async function installOne(): Promise<void> {
116
+ if (lookupResult.value?.kind !== 'one') {
117
+ openSlotPicker();
118
+ return;
119
+ }
120
+ if (!installFromMarketplace) {
121
+ openSlotPicker();
122
+ return;
123
+ }
124
+ installing.value = true;
125
+ try {
126
+ await installFromMarketplace(lookupResult.value.extension.downloadUrl);
127
+ props.onResolved?.();
128
+ } catch (e) {
129
+ console.error('[rynt/sdk] ExtensionRegistrySlotButton: install failed', e);
130
+ openSlotPicker();
131
+ } finally {
132
+ installing.value = false;
133
+ }
134
+ }
135
+
136
+ watch(
137
+ () => [missing.value, props.registryId, props.registryKey] as const,
138
+ () => {
139
+ void refreshLookup();
140
+ },
141
+ { immediate: true },
142
+ );
143
+ </script>
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div class="space-y-2.5 text-xs">
3
+ <div
4
+ v-for="(item, index) in items"
5
+ :key="index"
6
+ class="flex items-start gap-1"
7
+ >
8
+ <div
9
+ class="text-muted-foreground mb-1 flex-shrink-0"
10
+ :style="{ width: labelWidth }"
11
+ >
12
+ {{ item.label }}
13
+ </div>
14
+ <div class="text-foreground flex-1" :class="item.valueClass">
15
+ <slot :name="`value-${index}`" :item="item">
16
+ {{ item.value }}
17
+ </slot>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <script setup lang="ts">
24
+ interface InfoRowItem {
25
+ label: string;
26
+ value: string | number;
27
+ valueClass?: string;
28
+ }
29
+
30
+ const props = withDefaults(
31
+ defineProps<{
32
+ items: InfoRowItem[];
33
+ labelWidth?: string;
34
+ }>(),
35
+ {
36
+ labelWidth: 'auto',
37
+ },
38
+ );
39
+ </script>
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <div ref="logContainer" :class="viewerClasses" class="h-full grow">
3
+ <div v-for="(log, index) in logs" :key="index" :class="logClasses(log)">
4
+ {{ log }}
5
+ </div>
6
+ </div>
7
+ </template>
8
+
9
+ <script setup lang="ts">
10
+ import { computed, ref, watch, nextTick } from 'vue';
11
+ import { cn } from '../../utils/cn';
12
+
13
+ interface Props {
14
+ logs: string[];
15
+ maxHeight?: string;
16
+ class?: string;
17
+ }
18
+
19
+ const props = withDefaults(defineProps<Props>(), {
20
+ maxHeight: 'max-h-28',
21
+ });
22
+
23
+ const logContainer = ref<HTMLElement | null>(null);
24
+
25
+ const viewerClasses = computed(() => {
26
+ return cn(
27
+ 'bg-surface-list p-2 border border-border overflow-y-auto',
28
+ 'text-[10px] text-muted-foreground font-mono space-y-0.5 grow whitespace-pre-wrap break-all overflow-x-hidden',
29
+ props.class,
30
+ );
31
+ });
32
+
33
+ const logClasses = (log: string) => {
34
+ if (log.includes('[ERROR]') || log.includes('[WARN]')) {
35
+ return 'text-red-400';
36
+ }
37
+ if (log.includes('[INFO]') && log.includes('присоединился')) {
38
+ return 'text-green-400';
39
+ }
40
+ return 'text-muted-foreground';
41
+ };
42
+
43
+ // Автоскролл при добавлении новых логов
44
+ watch(
45
+ () => props.logs.length,
46
+ async () => {
47
+ await nextTick();
48
+ if (logContainer.value) {
49
+ logContainer.value.scrollTop = logContainer.value.scrollHeight;
50
+ }
51
+ },
52
+ );
53
+ </script>
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <div class="flex items-center justify-between mb-5">
3
+ <div>
4
+ <h1 class="text-2xl font-bold text-foreground mb-1">
5
+ <slot name="title">{{ title }}</slot>
6
+ </h1>
7
+ <p v-if="description || $slots.description" class="text-muted-foreground text-sm">
8
+ <slot name="description">{{ description }}</slot>
9
+ </p>
10
+ </div>
11
+ <div v-if="$slots.actions" class="flex items-center gap-2">
12
+ <slot name="actions" />
13
+ </div>
14
+ </div>
15
+ </template>
16
+
17
+ <script setup lang="ts">
18
+ const props = defineProps<{
19
+ title?: string;
20
+ description?: string;
21
+ }>();
22
+ </script>
23
+
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <Callout
3
+ v-if="isMissing"
4
+ :tone="tone"
5
+ :icon="icon"
6
+ :title="title"
7
+ :class="cn('block w-full', props.class)"
8
+ >
9
+ <div class="mt-1.5 flex flex-col gap-2.5">
10
+ <Text v-if="hint" class="text-sm leading-relaxed opacity-90">{{ hint }}</Text>
11
+ <div class="flex flex-wrap items-center gap-2">
12
+ <ExtensionRegistrySlotButton
13
+ :registry-id="registryId"
14
+ :registry-key="registryKey"
15
+ />
16
+ </div>
17
+ </div>
18
+ </Callout>
19
+ </template>
20
+
21
+ <script setup lang="ts">
22
+ import { Callout } from '../layout';
23
+ import { Text } from '../primitives';
24
+ import { cn } from '../../utils/cn';
25
+ import ExtensionRegistrySlotButton from './ExtensionRegistrySlotButton.vue';
26
+ import { useRegistrySlotMissing } from '../../composables/registrySlot/useRegistrySlotMissing';
27
+
28
+ const props = withDefaults(
29
+ defineProps<{
30
+ registryId: string;
31
+ registryKey: string;
32
+ title: string;
33
+ hint?: string;
34
+ tone?: 'info' | 'success' | 'warning' | 'error';
35
+ icon?: string;
36
+ class?: string;
37
+ }>(),
38
+ {
39
+ tone: 'error',
40
+ icon: 'alert-circle',
41
+ },
42
+ );
43
+
44
+ const { isMissing } = useRegistrySlotMissing(
45
+ () => props.registryId,
46
+ () => props.registryKey,
47
+ );
48
+ </script>
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <Card variant="hover" angular class="relative overflow-hidden">
3
+ <AngularAccent :position="accentPosition" :size="accentSize" :color="accentColor || 'indigo'" />
4
+ <div class="p-4 relative z-10">
5
+ <slot>
6
+ <h1 v-if="title" class="text-2xl font-bold text-foreground mb-1">{{ title }}</h1>
7
+ <p v-if="description" class="text-muted-foreground text-sm">{{ description }}</p>
8
+ </slot>
9
+ </div>
10
+ </Card>
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import { Card } from '../layout';
15
+ import AngularAccent from './AngularAccent.vue';
16
+
17
+ const props = withDefaults(
18
+ defineProps<{
19
+ title?: string;
20
+ description?: string;
21
+ accentPosition?: 'left' | 'right' | 'top' | 'bottom';
22
+ accentSize?: 'sm' | 'md' | 'lg';
23
+ accentColor?: InstanceType<typeof AngularAccent>['$props']['color'];
24
+ }>(),
25
+ {
26
+ accentPosition: 'right',
27
+ accentSize: 'lg',
28
+ accentColor: 'indigo',
29
+ }
30
+ );
31
+ </script>
32
+
@@ -0,0 +1,9 @@
1
+ export { default as AngularAccent } from './AngularAccent.vue';
2
+ export { default as LogViewer } from './LogViewer.vue';
3
+ export { default as PageHeader } from './PageHeader.vue';
4
+ export { default as WelcomeCard } from './WelcomeCard.vue';
5
+
6
+ export { default as InfoRow } from './InfoRow.vue';
7
+ export { default as ExtensionRegistrySlotButton } from './ExtensionRegistrySlotButton.vue';
8
+ export { default as RegistrySlotMissingCallout } from './RegistrySlotMissingCallout.vue';
9
+
@@ -0,0 +1,50 @@
1
+ const path = require("path");
2
+ const os = require('os');
3
+
4
+ /**
5
+ * Получить путь к директории приложения в зависимости от ОС
6
+ *
7
+ * Windows: C:\Users\username\AppData\Roaming\.zaklauncher
8
+ * macOS: ~/Library/Application Support/.zaklauncher
9
+ * Linux: ~/.local/share/.zaklauncher
10
+ */
11
+ export function getAppDataPath(): string {
12
+ const platform = process.platform;
13
+ const homeDir = os.homedir();
14
+
15
+ switch (platform) {
16
+ case 'win32':
17
+ // Windows: %APPDATA%\.zaklauncher
18
+ return path.join(process.env.APPDATA || path.join(homeDir, 'AppData', 'Roaming'), '.zaklauncher');
19
+
20
+ case 'darwin':
21
+ // macOS: ~/Library/Application Support/.zaklauncher
22
+ return path.join(homeDir, 'Library', 'Application Support', '.zaklauncher');
23
+
24
+ default:
25
+ // Linux и другие: ~/.local/share/.zaklauncher
26
+ return path.join(process.env.XDG_DATA_HOME || path.join(homeDir, '.local', 'share'), '.zaklauncher');
27
+ }
28
+ }
29
+
30
+ /**
31
+ * Получить путь к директории с версиями Minecraft
32
+ */
33
+ export function getVersionsPath(): string {
34
+ return path.join(getAppDataPath(), 'versions');
35
+ }
36
+
37
+ /**
38
+ * Получить путь к скрытой директории с версиями
39
+ */
40
+ export function getHiddenVersionsPath(): string {
41
+ return path.join(getAppDataPath(), '.versions');
42
+ }
43
+
44
+ /**
45
+ * Получить путь к директории конкретной версии/билда
46
+ */
47
+ export function getBuildPath(buildId: string): string {
48
+ return path.join(getVersionsPath(), buildId);
49
+ }
50
+
@@ -0,0 +1,16 @@
1
+ /** Нормализует attachments из GraphQL JSON в массив URL. */
2
+ export function parseAttachments(value: unknown): string[] {
3
+ if (!value) return [];
4
+ if (Array.isArray(value)) {
5
+ return value.filter((item): item is string => typeof item === 'string' && item.length > 0);
6
+ }
7
+ if (typeof value === 'string') {
8
+ try {
9
+ const parsed = JSON.parse(value) as unknown;
10
+ return parseAttachments(parsed);
11
+ } catch {
12
+ return [];
13
+ }
14
+ }
15
+ return [];
16
+ }
@@ -0,0 +1,213 @@
1
+ import { isDevMode } from './updater';
2
+
3
+ const isNodeEnv = typeof window !== 'undefined' && (window as any).nw;
4
+
5
+ let fs: typeof import('fs') | undefined;
6
+ let path: typeof import('path') | undefined;
7
+ let os: typeof import('os') | undefined;
8
+ let childProcess: typeof import('child_process') | undefined;
9
+
10
+ if (isNodeEnv) {
11
+ try {
12
+ const nw = (window as any).nw;
13
+ fs = nw.require('fs');
14
+ path = nw.require('path');
15
+ os = nw.require('os');
16
+ childProcess = nw.require('child_process');
17
+ } catch (error) {
18
+ console.error('[autostart] Не удалось загрузить Node.js модули:', error);
19
+ }
20
+ }
21
+
22
+ const AUTOSTART_APP_NAME = 'Rynt';
23
+ const MACOS_PLIST_NAME = 'com.rynt.launcher.plist';
24
+ const LINUX_DESKTOP_NAME = 'rynt.desktop';
25
+
26
+ function getMacOsPlistPath(): string | null {
27
+ if (!path || !os) return null;
28
+ return path.join(os.homedir(), 'Library', 'LaunchAgents', MACOS_PLIST_NAME);
29
+ }
30
+
31
+ function getLinuxDesktopPath(): string | null {
32
+ if (!path || !os) return null;
33
+ return path.join(os.homedir(), '.config', 'autostart', LINUX_DESKTOP_NAME);
34
+ }
35
+
36
+ function getExecutablePath(): string | null {
37
+ if (!isNodeEnv) return null;
38
+ try {
39
+ return process.execPath;
40
+ } catch {
41
+ return null;
42
+ }
43
+ }
44
+
45
+ function escapeXml(value: string): string {
46
+ return value
47
+ .replace(/&/g, '&amp;')
48
+ .replace(/</g, '&lt;')
49
+ .replace(/>/g, '&gt;')
50
+ .replace(/"/g, '&quot;');
51
+ }
52
+
53
+ function buildMacOsPlist(execPath: string): string {
54
+ return `<?xml version="1.0" encoding="UTF-8"?>
55
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
56
+ <plist version="1.0">
57
+ <dict>
58
+ <key>Label</key>
59
+ <string>com.rynt.launcher</string>
60
+ <key>ProgramArguments</key>
61
+ <array>
62
+ <string>${escapeXml(execPath)}</string>
63
+ </array>
64
+ <key>RunAtLoad</key>
65
+ <true/>
66
+ </dict>
67
+ </plist>`;
68
+ }
69
+
70
+ function buildLinuxDesktop(execPath: string): string {
71
+ return `[Desktop Entry]
72
+ Type=Application
73
+ Name=${AUTOSTART_APP_NAME}
74
+ Exec=${execPath}
75
+ Hidden=false
76
+ NoDisplay=false
77
+ X-GNOME-Autostart-enabled=true
78
+ `;
79
+ }
80
+
81
+ function isAutostartEnabledWindows(): boolean {
82
+ if (!childProcess) return false;
83
+ try {
84
+ const result = childProcess.execSync(
85
+ `reg query "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run" /v "${AUTOSTART_APP_NAME}"`,
86
+ { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] },
87
+ );
88
+ return result.includes(AUTOSTART_APP_NAME);
89
+ } catch {
90
+ return false;
91
+ }
92
+ }
93
+
94
+ function enableAutostartWindows(execPath: string): void {
95
+ if (!childProcess) return;
96
+ const escapedPath = execPath.replace(/"/g, '\\"');
97
+ childProcess.execSync(
98
+ `reg add "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run" /v "${AUTOSTART_APP_NAME}" /t REG_SZ /d "${escapedPath}" /f`,
99
+ { stdio: 'pipe' },
100
+ );
101
+ }
102
+
103
+ function disableAutostartWindows(): void {
104
+ if (!childProcess) return;
105
+ try {
106
+ childProcess.execSync(
107
+ `reg delete "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run" /v "${AUTOSTART_APP_NAME}" /f`,
108
+ { stdio: 'pipe' },
109
+ );
110
+ } catch {
111
+ // Ключ мог отсутствовать
112
+ }
113
+ }
114
+
115
+ function isAutostartEnabledMacOs(): boolean {
116
+ const plistPath = getMacOsPlistPath();
117
+ return Boolean(plistPath && fs?.existsSync(plistPath));
118
+ }
119
+
120
+ function enableAutostartMacOs(execPath: string): void {
121
+ const plistPath = getMacOsPlistPath();
122
+ if (!plistPath || !fs || !path) return;
123
+ const dir = path.dirname(plistPath);
124
+ if (!fs.existsSync(dir)) {
125
+ fs.mkdirSync(dir, { recursive: true });
126
+ }
127
+ fs.writeFileSync(plistPath, buildMacOsPlist(execPath), 'utf-8');
128
+ }
129
+
130
+ function disableAutostartMacOs(): void {
131
+ const plistPath = getMacOsPlistPath();
132
+ if (!plistPath || !fs?.existsSync(plistPath)) return;
133
+ fs.unlinkSync(plistPath);
134
+ }
135
+
136
+ function isAutostartEnabledLinux(): boolean {
137
+ const desktopPath = getLinuxDesktopPath();
138
+ return Boolean(desktopPath && fs?.existsSync(desktopPath));
139
+ }
140
+
141
+ function enableAutostartLinux(execPath: string): void {
142
+ const desktopPath = getLinuxDesktopPath();
143
+ if (!desktopPath || !fs || !path) return;
144
+ const dir = path.dirname(desktopPath);
145
+ if (!fs.existsSync(dir)) {
146
+ fs.mkdirSync(dir, { recursive: true });
147
+ }
148
+ fs.writeFileSync(desktopPath, buildLinuxDesktop(execPath), 'utf-8');
149
+ }
150
+
151
+ function disableAutostartLinux(): void {
152
+ const desktopPath = getLinuxDesktopPath();
153
+ if (!desktopPath || !fs?.existsSync(desktopPath)) return;
154
+ fs.unlinkSync(desktopPath);
155
+ }
156
+
157
+ /**
158
+ * Проверить, включён ли автозапуск в системе.
159
+ */
160
+ export function isAutostartEnabled(): boolean {
161
+ if (!isNodeEnv || !os) return false;
162
+
163
+ switch (os.platform()) {
164
+ case 'win32':
165
+ return isAutostartEnabledWindows();
166
+ case 'darwin':
167
+ return isAutostartEnabledMacOs();
168
+ default:
169
+ return isAutostartEnabledLinux();
170
+ }
171
+ }
172
+
173
+ /**
174
+ * Синхронизировать автозапуск с настройкой пользователя.
175
+ * В dev-режиме ничего не делает.
176
+ */
177
+ export function syncAutostart(enabled: boolean): void {
178
+ if (!isNodeEnv || isDevMode()) return;
179
+
180
+ const execPath = getExecutablePath();
181
+ if (!execPath || !os) {
182
+ console.warn('[autostart] Не удалось определить путь к исполняемому файлу');
183
+ return;
184
+ }
185
+
186
+ try {
187
+ switch (os.platform()) {
188
+ case 'win32':
189
+ if (enabled) {
190
+ enableAutostartWindows(execPath);
191
+ } else {
192
+ disableAutostartWindows();
193
+ }
194
+ break;
195
+ case 'darwin':
196
+ if (enabled) {
197
+ enableAutostartMacOs(execPath);
198
+ } else {
199
+ disableAutostartMacOs();
200
+ }
201
+ break;
202
+ default:
203
+ if (enabled) {
204
+ enableAutostartLinux(execPath);
205
+ } else {
206
+ disableAutostartLinux();
207
+ }
208
+ break;
209
+ }
210
+ } catch (error) {
211
+ console.error('[autostart] Ошибка синхронизации автозапуска:', error);
212
+ }
213
+ }