@bettertogether/community-engine-vue 0.1.6 → 0.2.2

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 (229) hide show
  1. package/README.md +140 -1
  2. package/dist/assets/BBadge.vue_vue_type_script_setup_true_lang-IIZ8QpjG-Z9WDKHqT.js +1 -0
  3. package/dist/assets/BCardText.vue_vue_type_script_setup_true_lang-Be6CD36N-B5JCTdmm.js +3 -0
  4. package/dist/assets/BFormSelect.vue_vue_type_script_setup_true_lang-BigptVap-B_HbOOZR.js +1 -0
  5. package/dist/assets/BRow.vue_vue_type_script_setup_true_lang-69TY75-8-DJdEdyx7.js +1 -0
  6. package/dist/assets/Communities-Cx4tT-bx.js +1 -0
  7. package/dist/assets/Communities-n33ssuUH.css +1 -0
  8. package/dist/assets/CommunityConversation-bBkYBs2k.css +1 -0
  9. package/dist/assets/CommunityConversation-jHAnv_Ps.js +1 -0
  10. package/dist/assets/CommunityConversations-rEDGS7To.js +1 -0
  11. package/dist/assets/CommunityEvent-CUdT0aT4.js +1 -0
  12. package/dist/assets/CommunityEvents-rsOgcxQr.js +1 -0
  13. package/dist/assets/CommunityHome-ChuTE2Nz.js +1 -0
  14. package/dist/assets/CommunityJoaTu-CpLIY_83.js +1 -0
  15. package/dist/assets/CommunityMembers-C3UtzQGp.css +1 -0
  16. package/dist/assets/CommunityMembers-DKf74ltl.js +1 -0
  17. package/dist/assets/CommunityPage-C5x23iQl.css +1 -0
  18. package/dist/assets/CommunityPage-CRYg9-rW.js +1 -0
  19. package/dist/assets/CommunityPages-IsLTNFC3.js +1 -0
  20. package/dist/assets/CommunityPost-BOnqqxVs.js +1 -0
  21. package/dist/assets/CommunityPost-BRYtkDSY.css +1 -0
  22. package/dist/assets/CommunityPosts-DY1olmcU.js +1 -0
  23. package/dist/assets/Error404-D10VQARe.js +1 -0
  24. package/dist/assets/EventCard-vfutXTdg.js +1 -0
  25. package/dist/assets/EventList-ChtehYcJ.js +1 -0
  26. package/dist/assets/ExtensionSlot-DJKbrq4c.js +1 -0
  27. package/dist/assets/PostList-BuHrBBqX.css +1 -0
  28. package/dist/assets/PostList-DYFgxlE8.js +1 -0
  29. package/dist/assets/SyncBadge-B1JBsdUk.js +1 -0
  30. package/dist/assets/SyncBadge-FNO-QLuu.css +1 -0
  31. package/dist/assets/UserPasswordNew-D_Djldm9.css +1 -0
  32. package/dist/assets/UserPasswordNew-al9bNBTZ.js +1 -0
  33. package/dist/assets/UserPasswordReset-42zs98RW.js +1 -0
  34. package/dist/assets/UserPasswordReset-D_6OQDZY.css +1 -0
  35. package/dist/assets/UserResendConfirmation-CGavYB81.js +1 -0
  36. package/dist/assets/UserResendConfirmation-DNTHcaar.css +1 -0
  37. package/dist/assets/UserSignIn-BIRb0HkV.js +1 -0
  38. package/dist/assets/UserSignIn-C-Pol8OD.css +1 -0
  39. package/dist/assets/UserSignUp-ChkKQAd2.css +1 -0
  40. package/dist/assets/UserSignUp-Df6o3vlO.js +1 -0
  41. package/dist/assets/better-together-logo-61cxo5d5.png +0 -0
  42. package/dist/assets/index-BFt-JKVh.css +5 -0
  43. package/dist/assets/index-COo3Jb7v.js +1088 -0
  44. package/dist/assets/nodefs-Bfyh92qg.js +1 -0
  45. package/dist/assets/opfs-ahp-BLzlXf6u.js +3 -0
  46. package/dist/assets/pglite-BdRI_ZYT.wasm +0 -0
  47. package/dist/assets/pglite-COscPi1Y.data +0 -0
  48. package/dist/assets/usePages-DDjDQRCy.js +1 -0
  49. package/dist/assets/usePosts-Bf2Ccwr4.js +1 -0
  50. package/{public → dist}/index.html +9 -19
  51. package/package.json +57 -45
  52. package/src/BtApp.vue +34 -43
  53. package/src/components/BtBrandingLogo.vue +10 -18
  54. package/src/components/BtHeader.vue +34 -84
  55. package/src/components/BtMainContent.vue +12 -43
  56. package/src/components/BtNavBar.vue +25 -38
  57. package/src/components/BtNavItem.vue +25 -58
  58. package/src/components/BtNavUser.vue +65 -86
  59. package/src/components/BtProfileForm.vue +48 -39
  60. package/src/components/BtUserNewPasswordForm.vue +52 -74
  61. package/src/components/BtUserResendConfirmationForm.vue +45 -83
  62. package/src/components/BtUserResetPasswordForm.vue +45 -77
  63. package/src/components/BtUserSignInForm.vue +59 -75
  64. package/src/components/BtUserSignUpForm.vue +90 -103
  65. package/src/components/CommunityForm.vue +47 -39
  66. package/src/components/community/CommunityCard.vue +113 -0
  67. package/src/components/community/CommunityHeader.vue +91 -0
  68. package/src/components/community/CommunityList.vue +59 -0
  69. package/src/components/community/MemberRoleRow.vue +107 -0
  70. package/src/components/conversation/ConversationCard.vue +49 -0
  71. package/src/components/conversation/ConversationDetail.vue +53 -0
  72. package/src/components/conversation/ConversationList.vue +51 -0
  73. package/src/components/conversation/MessageForm.vue +45 -0
  74. package/src/components/conversation/MessageItem.vue +43 -0
  75. package/src/components/conversation/MessageList.vue +39 -0
  76. package/src/components/event/EventCard.vue +82 -0
  77. package/src/components/event/EventForm.vue +99 -0
  78. package/src/components/event/EventList.vue +47 -0
  79. package/src/components/invitation/InvitationCard.vue +56 -0
  80. package/src/components/invitation/InvitationForm.vue +70 -0
  81. package/src/components/invitation/InvitationList.vue +51 -0
  82. package/src/components/joatu/AgreementCard.vue +57 -0
  83. package/src/components/joatu/AgreementList.vue +51 -0
  84. package/src/components/joatu/OfferCard.vue +65 -0
  85. package/src/components/joatu/OfferForm.vue +82 -0
  86. package/src/components/joatu/OfferList.vue +51 -0
  87. package/src/components/joatu/RequestCard.vue +65 -0
  88. package/src/components/joatu/RequestForm.vue +82 -0
  89. package/src/components/joatu/RequestList.vue +51 -0
  90. package/src/components/page/PageCard.vue +55 -0
  91. package/src/components/page/PageDetail.vue +35 -0
  92. package/src/components/page/PageList.vue +51 -0
  93. package/src/components/person/MemberList.vue +61 -0
  94. package/src/components/person/PersonAvatar.vue +54 -0
  95. package/src/components/person/PersonCard.vue +47 -0
  96. package/src/components/post/PostCard.vue +105 -0
  97. package/src/components/post/PostDetail.vue +98 -0
  98. package/src/components/post/PostForm.vue +84 -0
  99. package/src/components/post/PostList.vue +53 -0
  100. package/src/components/role/BlockButton.vue +44 -0
  101. package/src/components/role/RoleBadge.vue +19 -0
  102. package/src/components/role/RoleGate.vue +62 -0
  103. package/src/components/role/RoleSelector.vue +29 -0
  104. package/src/components/shared/ExtensionSlot.vue +27 -0
  105. package/src/components/sync/OfflineBanner.vue +49 -0
  106. package/src/components/sync/SyncBadge.vue +108 -0
  107. package/src/components/sync/SyncStatusBar.vue +121 -0
  108. package/src/composables/useCommunities.js +19 -0
  109. package/src/composables/useConversations.js +5 -0
  110. package/src/composables/useEvents.js +28 -0
  111. package/src/composables/useInvitations.js +10 -0
  112. package/src/composables/useJoaTuAgreements.js +11 -0
  113. package/src/composables/useJoaTuOffers.js +10 -0
  114. package/src/composables/useJoaTuRequests.js +10 -0
  115. package/src/composables/useMembers.js +30 -0
  116. package/src/composables/useMessages.js +5 -0
  117. package/src/composables/useNotifications.js +5 -0
  118. package/src/composables/usePages.js +6 -0
  119. package/src/composables/usePersonBlocks.js +65 -0
  120. package/src/composables/usePosts.js +27 -0
  121. package/src/composables/useResource.js +137 -0
  122. package/src/composables/useRoles.js +94 -0
  123. package/src/composables/useSyncStatus.js +22 -0
  124. package/src/composables/useToaster.js +20 -0
  125. package/src/context.js +18 -0
  126. package/src/db/client.js +343 -0
  127. package/src/db/migrations/001_initial.sql +131 -0
  128. package/src/db/migrations/003_conversations_invitations_pages_joatu.sql +76 -0
  129. package/src/db/sync.js +276 -0
  130. package/src/endpoints/BtApiAuth.js +1 -1
  131. package/src/endpoints/BtApiV1.js +1 -1
  132. package/src/extension.js +45 -0
  133. package/src/i18n/index.js +103 -0
  134. package/src/i18n/locales/en.json +275 -0
  135. package/src/i18n/locales/es.json +275 -0
  136. package/src/i18n/locales/fr.json +223 -0
  137. package/src/i18n/locales/uk.json +275 -0
  138. package/src/index.js +168 -22
  139. package/src/layouts/CommunityLayout.vue +89 -0
  140. package/src/main.js +16 -12
  141. package/src/mixins/error-handling.js +6 -15
  142. package/src/mixins/toaster.js +15 -10
  143. package/src/pages/Communities.vue +59 -0
  144. package/src/pages/Error404.vue +10 -14
  145. package/src/pages/Home.vue +11 -18
  146. package/src/pages/Me.vue +39 -59
  147. package/src/pages/UserPasswordNew.vue +12 -68
  148. package/src/pages/UserPasswordReset.vue +15 -64
  149. package/src/pages/UserResendConfirmation.vue +39 -113
  150. package/src/pages/UserSignIn.vue +18 -67
  151. package/src/pages/UserSignUp.vue +15 -64
  152. package/src/pages/community/CommunityConversation.vue +31 -0
  153. package/src/pages/community/CommunityConversations.vue +18 -0
  154. package/src/pages/community/CommunityEvent.vue +39 -0
  155. package/src/pages/community/CommunityEvents.vue +58 -0
  156. package/src/pages/community/CommunityHome.vue +49 -0
  157. package/src/pages/community/CommunityJoaTu.vue +115 -0
  158. package/src/pages/community/CommunityMembers.vue +23 -0
  159. package/src/pages/community/CommunityPage.vue +31 -0
  160. package/src/pages/community/CommunityPages.vue +25 -0
  161. package/src/pages/community/CommunityPost.vue +28 -0
  162. package/src/pages/community/CommunityPosts.vue +58 -0
  163. package/src/pages/community/CommunitySettingsPage.vue +117 -0
  164. package/src/pages/community/RoleManagerPage.vue +93 -0
  165. package/src/plugins/bootstrap-vue.js +5 -5
  166. package/src/plugins/font-awesome.js +3 -2
  167. package/src/plugins/index.js +9 -4
  168. package/src/plugins/progress.js +16 -0
  169. package/src/pwa/index.js +156 -0
  170. package/src/pwa/sw-helpers.js +130 -0
  171. package/src/router/communityRoutes.js +78 -0
  172. package/src/router/index.js +30 -144
  173. package/src/slot-registry.js +15 -0
  174. package/src/stores/auth.js +134 -0
  175. package/src/stores/communities.js +59 -0
  176. package/src/stores/index.js +5 -0
  177. package/src/stores/menus.js +14 -0
  178. package/src/stores/people.js +48 -0
  179. package/src/stores/sync.js +93 -0
  180. package/src/stylesheets/sync-indicators.scss +34 -0
  181. package/.env.sample +0 -1
  182. package/.eslintrc.js +0 -51
  183. package/.gitlab-ci.yml +0 -14
  184. package/.travis/.rbenv-gemsets +0 -1
  185. package/.travis/.ruby-version +0 -1
  186. package/.travis.yml +0 -31
  187. package/babel.config.js +0 -5
  188. package/cypress.json +0 -3
  189. package/deploy/build.sh +0 -8
  190. package/eslint.config.js +0 -16
  191. package/postcss.config.js +0 -5
  192. package/src/eslint.config.js +0 -16
  193. package/src/forms/BtProfileFormSchema.js +0 -19
  194. package/src/forms/BtUserConfirmationFormSchema.js +0 -20
  195. package/src/forms/BtUserNewPasswordFormSchema.js +0 -29
  196. package/src/forms/BtUserResetPasswordFormSchema.js +0 -20
  197. package/src/forms/BtUserSignInFormSchema.js +0 -29
  198. package/src/forms/BtUserSignUpFormSchema.js +0 -63
  199. package/src/forms/CommunityFormSchema.js +0 -19
  200. package/src/plugins/vue-form-generator.js +0 -4
  201. package/src/plugins/vue-loading.js +0 -10
  202. package/src/registerServiceWorker.js +0 -32
  203. package/src/store/index.js +0 -32
  204. package/src/store/modules/authentication.js +0 -170
  205. package/src/store/modules/communities.js +0 -98
  206. package/src/store/modules/community-engine.js +0 -14
  207. package/src/store/modules/menus.js +0 -52
  208. package/src/store/modules/people.js +0 -88
  209. package/tests/e2e/.eslintrc.js +0 -12
  210. package/tests/e2e/plugins/index.js +0 -26
  211. package/tests/e2e/specs/home.js +0 -8
  212. package/tests/e2e/support/commands.js +0 -25
  213. package/tests/e2e/support/index.js +0 -20
  214. package/tests/unit/.eslintrc.js +0 -5
  215. package/tests/unit/example.spec.js +0 -13
  216. package/vue.config.js +0 -11
  217. package/webpack.config.js +0 -28
  218. /package/{public → dist}/_redirects +0 -0
  219. /package/{public → dist}/favicon.ico +0 -0
  220. /package/{public → dist}/img/favicon.ico +0 -0
  221. /package/{public → dist}/img/icons/android-chrome-192x192.png +0 -0
  222. /package/{public → dist}/img/icons/android-chrome-384x384.png +0 -0
  223. /package/{public → dist}/img/icons/apple-touch-icon.png +0 -0
  224. /package/{public → dist}/img/icons/favicon-16x16.png +0 -0
  225. /package/{public → dist}/img/icons/favicon-32x32.png +0 -0
  226. /package/{public → dist}/img/icons/favicon.ico +0 -0
  227. /package/{public → dist}/img/icons/mstile-150x150.png +0 -0
  228. /package/{public → dist}/img/icons/safari-pinned-tab.svg +0 -0
  229. /package/{public → dist}/robots.txt +0 -0
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <BForm
3
+ class="bt-offer-form"
4
+ @submit.prevent="handleSubmit"
5
+ >
6
+ <BFormGroup
7
+ :label="t('bt.joatu.offers.title_label')"
8
+ label-for="offer-title"
9
+ >
10
+ <BFormInput
11
+ id="offer-title"
12
+ v-model="form.title"
13
+ required
14
+ :placeholder="t('bt.joatu.offers.title_placeholder')"
15
+ />
16
+ </BFormGroup>
17
+ <BFormGroup
18
+ :label="t('bt.joatu.offers.description_label')"
19
+ label-for="offer-description"
20
+ >
21
+ <BFormTextarea
22
+ id="offer-description"
23
+ v-model="form.description"
24
+ rows="3"
25
+ :placeholder="t('bt.joatu.offers.description_placeholder')"
26
+ />
27
+ </BFormGroup>
28
+ <BFormGroup
29
+ :label="t('bt.joatu.offers.category_label')"
30
+ label-for="offer-category"
31
+ >
32
+ <BFormInput
33
+ id="offer-category"
34
+ v-model="form.category"
35
+ :placeholder="t('bt.joatu.offers.category_placeholder')"
36
+ />
37
+ </BFormGroup>
38
+ <BFormGroup
39
+ :label="t('bt.joatu.offers.credits_label')"
40
+ label-for="offer-credits"
41
+ >
42
+ <BFormInput
43
+ id="offer-credits"
44
+ v-model.number="form.time_credits"
45
+ type="number"
46
+ min="1"
47
+ max="100"
48
+ />
49
+ <template #description>
50
+ {{ t('bt.joatu.offers.credits_hint') }}
51
+ </template>
52
+ </BFormGroup>
53
+ <div class="d-flex justify-content-end gap-2 mt-3">
54
+ <BButton
55
+ type="button"
56
+ variant="outline-secondary"
57
+ @click="$emit('cancel')"
58
+ >
59
+ {{ t('bt.actions.cancel') }}
60
+ </BButton>
61
+ <BButton
62
+ type="submit"
63
+ variant="success"
64
+ >
65
+ {{ t('bt.joatu.offers.submit') }}
66
+ </BButton>
67
+ </div>
68
+ </BForm>
69
+ </template>
70
+ <script setup>
71
+ import { reactive } from 'vue'
72
+ import { useI18n } from 'vue-i18n'
73
+ import { BForm, BFormGroup, BFormInput, BFormTextarea, BButton } from 'bootstrap-vue-next'
74
+ const { t } = useI18n()
75
+ const emit = defineEmits(['submit', 'cancel'])
76
+ const form = reactive({ title: '', description: '', category: '', time_credits: 1 })
77
+ function handleSubmit() {
78
+ if (!form.title) return
79
+ emit('submit', { ...form })
80
+ Object.assign(form, { title: '', description: '', category: '', time_credits: 1 })
81
+ }
82
+ </script>
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <div class="bt-offer-list">
3
+ <slot name="header" />
4
+ <div
5
+ v-if="loading"
6
+ class="bt-offer-list__loading"
7
+ >
8
+ <slot name="loading">
9
+ <div class="text-center p-4 text-muted">
10
+ {{ t('bt.joatu.offers.loading') }}
11
+ </div>
12
+ </slot>
13
+ </div>
14
+ <div
15
+ v-else-if="!offers.length"
16
+ class="bt-offer-list__empty"
17
+ >
18
+ <slot name="empty">
19
+ <div class="text-center p-4 text-muted">
20
+ {{ t('bt.joatu.offers.list_empty') }}
21
+ </div>
22
+ </slot>
23
+ </div>
24
+ <template v-else>
25
+ <slot
26
+ v-for="(offer, index) in offers"
27
+ :key="offer.id"
28
+ name="item"
29
+ :item="offer"
30
+ :index="index"
31
+ >
32
+ <OfferCard
33
+ :offer="offer"
34
+ class="mb-3"
35
+ @view="$emit('view', offer)"
36
+ />
37
+ </slot>
38
+ </template>
39
+ <slot name="footer" />
40
+ </div>
41
+ </template>
42
+ <script setup>
43
+ import { useI18n } from 'vue-i18n'
44
+ import OfferCard from './OfferCard.vue'
45
+ const { t } = useI18n()
46
+ defineProps({
47
+ offers: { type: Array, default: () => [] },
48
+ loading: { type: Boolean, default: false },
49
+ })
50
+ defineEmits(['view'])
51
+ </script>
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <BCard class="bt-request-card">
3
+ <BCardBody>
4
+ <slot name="title">
5
+ <div class="d-flex align-items-start justify-content-between gap-2 mb-1">
6
+ <h5 class="bt-request-card__title mb-0">
7
+ <span class="text-muted me-1">{{ t('bt.joatu.requests.seeking') }}</span>{{ request.title }}
8
+ </h5>
9
+ <slot name="sync-badge">
10
+ <SyncBadge :item="request" />
11
+ </slot>
12
+ </div>
13
+ </slot>
14
+ <slot name="meta">
15
+ <div class="d-flex align-items-center gap-2 mb-2">
16
+ <BBadge :variant="statusVariant">
17
+ {{ request.status }}
18
+ </BBadge>
19
+ <span class="bt-request-card__credits">
20
+ {{ t('bt.joatu.offers.credits_display', request.time_credits) }}
21
+ </span>
22
+ <BBadge
23
+ v-if="request.category"
24
+ variant="outline-secondary"
25
+ >
26
+ {{ request.category }}
27
+ </BBadge>
28
+ </div>
29
+ </slot>
30
+ <slot name="body">
31
+ <BCardText>{{ truncatedDescription }}</BCardText>
32
+ </slot>
33
+ </BCardBody>
34
+ <template #footer>
35
+ <slot name="footer">
36
+ <div class="d-flex align-items-center gap-2">
37
+ <BButton
38
+ variant="outline-warning"
39
+ size="sm"
40
+ @click="$emit('view', request)"
41
+ >
42
+ {{ t('bt.joatu.requests.fulfill') }}
43
+ </BButton>
44
+ <ExtensionSlot
45
+ slot="footer"
46
+ target="RequestCard"
47
+ :context="{ item: request }"
48
+ />
49
+ </div>
50
+ </slot>
51
+ </template>
52
+ </BCard>
53
+ </template>
54
+ <script setup>
55
+ import { computed } from 'vue'
56
+ import { useI18n } from 'vue-i18n'
57
+ import { BCard, BCardBody, BCardText, BBadge, BButton } from 'bootstrap-vue-next'
58
+ import SyncBadge from '../sync/SyncBadge.vue'
59
+ import ExtensionSlot from '../shared/ExtensionSlot.vue'
60
+ const { t } = useI18n()
61
+ const props = defineProps({ request: { type: Object, required: true } })
62
+ defineEmits(['view'])
63
+ const truncatedDescription = computed(() => { const d = props.request.description || ''; return d.length > 150 ? d.slice(0, 150) + '…' : d })
64
+ const statusVariant = computed(() => ({ open: 'success', fulfilled: 'info', withdrawn: 'secondary' }[props.request.status] ?? 'secondary'))
65
+ </script>
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <BForm
3
+ class="bt-request-form"
4
+ @submit.prevent="handleSubmit"
5
+ >
6
+ <BFormGroup
7
+ :label="t('bt.joatu.requests.title_label')"
8
+ label-for="request-title"
9
+ >
10
+ <BFormInput
11
+ id="request-title"
12
+ v-model="form.title"
13
+ required
14
+ :placeholder="t('bt.joatu.requests.title_placeholder')"
15
+ />
16
+ </BFormGroup>
17
+ <BFormGroup
18
+ :label="t('bt.joatu.requests.description_label')"
19
+ label-for="request-description"
20
+ >
21
+ <BFormTextarea
22
+ id="request-description"
23
+ v-model="form.description"
24
+ rows="3"
25
+ :placeholder="t('bt.joatu.requests.description_placeholder')"
26
+ />
27
+ </BFormGroup>
28
+ <BFormGroup
29
+ :label="t('bt.joatu.requests.category_label')"
30
+ label-for="request-category"
31
+ >
32
+ <BFormInput
33
+ id="request-category"
34
+ v-model="form.category"
35
+ :placeholder="t('bt.joatu.offers.category_placeholder')"
36
+ />
37
+ </BFormGroup>
38
+ <BFormGroup
39
+ :label="t('bt.joatu.requests.credits_label')"
40
+ label-for="request-credits"
41
+ >
42
+ <BFormInput
43
+ id="request-credits"
44
+ v-model.number="form.time_credits"
45
+ type="number"
46
+ min="1"
47
+ max="100"
48
+ />
49
+ <template #description>
50
+ {{ t('bt.joatu.requests.credits_hint') }}
51
+ </template>
52
+ </BFormGroup>
53
+ <div class="d-flex justify-content-end gap-2 mt-3">
54
+ <BButton
55
+ type="button"
56
+ variant="outline-secondary"
57
+ @click="$emit('cancel')"
58
+ >
59
+ {{ t('bt.actions.cancel') }}
60
+ </BButton>
61
+ <BButton
62
+ type="submit"
63
+ variant="warning"
64
+ >
65
+ {{ t('bt.joatu.requests.submit') }}
66
+ </BButton>
67
+ </div>
68
+ </BForm>
69
+ </template>
70
+ <script setup>
71
+ import { reactive } from 'vue'
72
+ import { useI18n } from 'vue-i18n'
73
+ import { BForm, BFormGroup, BFormInput, BFormTextarea, BButton } from 'bootstrap-vue-next'
74
+ const { t } = useI18n()
75
+ const emit = defineEmits(['submit', 'cancel'])
76
+ const form = reactive({ title: '', description: '', category: '', time_credits: 1 })
77
+ function handleSubmit() {
78
+ if (!form.title) return
79
+ emit('submit', { ...form })
80
+ Object.assign(form, { title: '', description: '', category: '', time_credits: 1 })
81
+ }
82
+ </script>
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <div class="bt-request-list">
3
+ <slot name="header" />
4
+ <div
5
+ v-if="loading"
6
+ class="bt-request-list__loading"
7
+ >
8
+ <slot name="loading">
9
+ <div class="text-center p-4 text-muted">
10
+ {{ t('bt.joatu.requests.loading') }}
11
+ </div>
12
+ </slot>
13
+ </div>
14
+ <div
15
+ v-else-if="!requests.length"
16
+ class="bt-request-list__empty"
17
+ >
18
+ <slot name="empty">
19
+ <div class="text-center p-4 text-muted">
20
+ {{ t('bt.joatu.requests.list_empty') }}
21
+ </div>
22
+ </slot>
23
+ </div>
24
+ <template v-else>
25
+ <slot
26
+ v-for="(request, index) in requests"
27
+ :key="request.id"
28
+ name="item"
29
+ :item="request"
30
+ :index="index"
31
+ >
32
+ <RequestCard
33
+ :request="request"
34
+ class="mb-3"
35
+ @view="$emit('view', request)"
36
+ />
37
+ </slot>
38
+ </template>
39
+ <slot name="footer" />
40
+ </div>
41
+ </template>
42
+ <script setup>
43
+ import { useI18n } from 'vue-i18n'
44
+ import RequestCard from './RequestCard.vue'
45
+ const { t } = useI18n()
46
+ defineProps({
47
+ requests: { type: Array, default: () => [] },
48
+ loading: { type: Boolean, default: false },
49
+ })
50
+ defineEmits(['view'])
51
+ </script>
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <BCard class="bt-page-card">
3
+ <BCardBody>
4
+ <slot name="title">
5
+ <div class="d-flex align-items-start justify-content-between gap-2 mb-1">
6
+ <h5 class="bt-page-card__title mb-0">
7
+ {{ page.title }}
8
+ </h5>
9
+ <slot name="sync-badge">
10
+ <SyncBadge :item="page" />
11
+ </slot>
12
+ </div>
13
+ </slot>
14
+ <slot name="meta">
15
+ <small
16
+ v-if="page.published_at"
17
+ class="text-muted"
18
+ >{{ formattedDate }}</small>
19
+ </slot>
20
+ <slot name="body">
21
+ <BCardText>{{ excerpt }}</BCardText>
22
+ </slot>
23
+ </BCardBody>
24
+ <template #footer>
25
+ <slot name="footer">
26
+ <div class="d-flex align-items-center gap-2">
27
+ <BButton
28
+ variant="outline-primary"
29
+ size="sm"
30
+ @click="$emit('view', page)"
31
+ >
32
+ {{ t('bt.pages.read') }}
33
+ </BButton>
34
+ <ExtensionSlot
35
+ slot="footer"
36
+ target="PageCard"
37
+ :context="{ item: page }"
38
+ />
39
+ </div>
40
+ </slot>
41
+ </template>
42
+ </BCard>
43
+ </template>
44
+ <script setup>
45
+ import { computed } from 'vue'
46
+ import { useI18n } from 'vue-i18n'
47
+ import { BCard, BCardBody, BCardText, BButton } from 'bootstrap-vue-next'
48
+ import SyncBadge from '../sync/SyncBadge.vue'
49
+ import ExtensionSlot from '../shared/ExtensionSlot.vue'
50
+ const { t } = useI18n()
51
+ const props = defineProps({ page: { type: Object, required: true } })
52
+ defineEmits(['view'])
53
+ const excerpt = computed(() => { const c = props.page.content || ''; return c.length > 200 ? c.slice(0, 200) + '…' : c })
54
+ const formattedDate = computed(() => new Date(props.page.published_at).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' }))
55
+ </script>
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <article class="bt-page-detail">
3
+ <header class="bt-page-detail__header mb-4">
4
+ <h1 class="bt-page-detail__title">
5
+ {{ page.title }}
6
+ </h1>
7
+ <div class="d-flex align-items-center gap-2">
8
+ <small
9
+ v-if="page.published_at"
10
+ class="text-muted"
11
+ >{{ formattedDate }}</small>
12
+ <SyncBadge :item="page" />
13
+ </div>
14
+ </header>
15
+ <!-- eslint-disable-next-line vue/no-v-html -->
16
+ <div
17
+ class="bt-page-detail__content"
18
+ v-html="page.content"
19
+ />
20
+ </article>
21
+ </template>
22
+ <script setup>
23
+ import { computed } from 'vue'
24
+ import SyncBadge from '../sync/SyncBadge.vue'
25
+ const props = defineProps({ page: { type: Object, required: true } })
26
+ const formattedDate = computed(() => {
27
+ if (!props.page.published_at) return ''
28
+ return new Date(props.page.published_at).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' })
29
+ })
30
+ </script>
31
+ <style scoped lang="scss">
32
+ .bt-page-detail__content { line-height: 1.7; }
33
+ .bt-page-detail__content :deep(img) { max-width: 100%; height: auto; }
34
+ .bt-page-detail__content :deep(h2) { margin-top: 2rem; }
35
+ </style>
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <div class="bt-page-list">
3
+ <slot name="header" />
4
+ <div
5
+ v-if="loading"
6
+ class="bt-page-list__loading"
7
+ >
8
+ <slot name="loading">
9
+ <div class="text-center p-4 text-muted">
10
+ {{ t('bt.pages.loading') }}
11
+ </div>
12
+ </slot>
13
+ </div>
14
+ <div
15
+ v-else-if="!pages.length"
16
+ class="bt-page-list__empty"
17
+ >
18
+ <slot name="empty">
19
+ <div class="text-center p-4 text-muted">
20
+ {{ t('bt.pages.list_empty') }}
21
+ </div>
22
+ </slot>
23
+ </div>
24
+ <template v-else>
25
+ <slot
26
+ v-for="(page, index) in pages"
27
+ :key="page.id"
28
+ name="item"
29
+ :item="page"
30
+ :index="index"
31
+ >
32
+ <PageCard
33
+ :page="page"
34
+ class="mb-3"
35
+ @view="$emit('view', page)"
36
+ />
37
+ </slot>
38
+ </template>
39
+ <slot name="footer" />
40
+ </div>
41
+ </template>
42
+ <script setup>
43
+ import { useI18n } from 'vue-i18n'
44
+ import PageCard from './PageCard.vue'
45
+ const { t } = useI18n()
46
+ defineProps({
47
+ pages: { type: Array, default: () => [] },
48
+ loading: { type: Boolean, default: false },
49
+ })
50
+ defineEmits(['view'])
51
+ </script>
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <div class="bt-member-list">
3
+ <slot name="header" />
4
+ <div v-if="loading">
5
+ <slot name="loading">
6
+ <BSpinner :label="t('bt.person.loading')" />
7
+ </slot>
8
+ </div>
9
+ <div v-else-if="!members.length">
10
+ <slot name="empty">
11
+ <p class="text-muted">
12
+ {{ t('bt.person.members_empty') }}
13
+ </p>
14
+ </slot>
15
+ </div>
16
+ <div
17
+ v-else
18
+ class="bt-member-list__items"
19
+ >
20
+ <div
21
+ v-for="(member, index) in members"
22
+ :key="member.id"
23
+ class="bt-member-list__item"
24
+ >
25
+ <slot
26
+ name="item"
27
+ :item="member"
28
+ :index="index"
29
+ >
30
+ <div class="d-flex align-items-center gap-2">
31
+ <PersonAvatar
32
+ :person="{ id: member.person_id, name: '' }"
33
+ :size="32"
34
+ />
35
+ <span>{{ member.person_id }}</span>
36
+ <BBadge
37
+ v-if="member.role"
38
+ variant="secondary"
39
+ >
40
+ {{ member.role }}
41
+ </BBadge>
42
+ </div>
43
+ </slot>
44
+ </div>
45
+ </div>
46
+ <slot name="footer" />
47
+ </div>
48
+ </template>
49
+
50
+ <script setup>
51
+ import { useI18n } from 'vue-i18n'
52
+ import { BBadge, BSpinner } from 'bootstrap-vue-next'
53
+ import PersonAvatar from './PersonAvatar.vue'
54
+
55
+ const { t } = useI18n()
56
+
57
+ defineProps({
58
+ members: { type: Array, default: () => [] },
59
+ loading: { type: Boolean, default: false },
60
+ })
61
+ </script>
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <div
3
+ class="bt-person-avatar"
4
+ :style="avatarStyle"
5
+ :title="person.name"
6
+ >
7
+ <img
8
+ v-if="person.profile_image_url"
9
+ :src="person.profile_image_url"
10
+ :alt="person.name"
11
+ class="bt-person-avatar__img"
12
+ >
13
+ <span
14
+ v-else
15
+ class="bt-person-avatar__initials"
16
+ >{{ initials }}</span>
17
+ </div>
18
+ </template>
19
+
20
+ <script setup>
21
+ import { computed } from 'vue'
22
+
23
+ const props = defineProps({
24
+ person: { type: Object, required: true },
25
+ size: { type: Number, default: 40 },
26
+ })
27
+
28
+ const initials = computed(() => {
29
+ const parts = (props.person.name || props.person.handle || '?').split(' ')
30
+ return parts.slice(0, 2).map((p) => p[0]?.toUpperCase() ?? '').join('')
31
+ })
32
+
33
+ const avatarStyle = computed(() => ({
34
+ width: `${props.size}px`,
35
+ height: `${props.size}px`,
36
+ fontSize: `${props.size * 0.4}px`,
37
+ }))
38
+ </script>
39
+
40
+ <style scoped lang="scss">
41
+ .bt-person-avatar {
42
+ border-radius: 50%;
43
+ background-color: var(--bt-primary, #4f46e5);
44
+ color: white;
45
+ display: inline-flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ overflow: hidden;
49
+ flex-shrink: 0;
50
+
51
+ &__img { width: 100%; height: 100%; object-fit: cover; }
52
+ &__initials { font-weight: 600; line-height: 1; }
53
+ }
54
+ </style>
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <BCard class="bt-person-card">
3
+ <BCardBody class="d-flex align-items-start gap-3">
4
+ <slot name="avatar">
5
+ <PersonAvatar
6
+ :person="person"
7
+ :size="48"
8
+ />
9
+ </slot>
10
+ <div class="flex-grow-1">
11
+ <slot name="title">
12
+ <div class="d-flex align-items-center gap-2">
13
+ <strong class="bt-person-card__name">{{ person.name }}</strong>
14
+ <slot name="sync-badge">
15
+ <SyncBadge :item="person" />
16
+ </slot>
17
+ </div>
18
+ </slot>
19
+ <slot name="meta">
20
+ <!-- eslint-disable-next-line @intlify/vue-i18n/no-raw-text -->
21
+ <small class="text-muted">@{{ person.handle || person.slug }}</small>
22
+ </slot>
23
+ <slot name="body" />
24
+ </div>
25
+ </BCardBody>
26
+ <template #footer>
27
+ <slot name="footer">
28
+ <ExtensionSlot
29
+ slot="footer"
30
+ target="PersonCard"
31
+ :context="{ item: person }"
32
+ />
33
+ </slot>
34
+ </template>
35
+ </BCard>
36
+ </template>
37
+
38
+ <script setup>
39
+ import { BCard, BCardBody } from 'bootstrap-vue-next'
40
+ import PersonAvatar from './PersonAvatar.vue'
41
+ import SyncBadge from '../sync/SyncBadge.vue'
42
+ import ExtensionSlot from '../shared/ExtensionSlot.vue'
43
+
44
+ defineProps({
45
+ person: { type: Object, required: true },
46
+ })
47
+ </script>