shevchenko 2.1.1 → 2.1.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.
- package/dist/cjs/shevchenko.js +97 -7
- package/dist/cjs/shevchenko.js.map +1 -1
- package/dist/es/shevchenko.js +97 -7
- package/dist/es/shevchenko.js.map +1 -1
- package/dist/umd/shevchenko.min.js +3 -3
- package/dist/umd/shevchenko.min.js.map +1 -1
- package/nuxt/.eslintrc.json +27 -0
- package/nuxt/.prettierrc.json +6 -0
- package/nuxt/README.md +27 -0
- package/nuxt/app.config.ts +3 -0
- package/nuxt/app.vue +5 -0
- package/nuxt/assets/img/shevchenko_pixelized_304x304.jpg +0 -0
- package/nuxt/assets/img/shevchenko_pixelized_304x304.png +0 -0
- package/nuxt/assets/img/shevchenko_pixelized_608x608.jpg +0 -0
- package/nuxt/assets/style/main.scss +3 -0
- package/nuxt/components/about-modal.vue +58 -0
- package/nuxt/components/api-spec.vue +25 -0
- package/nuxt/components/contact-me-button.vue +11 -0
- package/nuxt/components/contact-me-modal.vue +63 -0
- package/nuxt/components/copy-button.vue +38 -0
- package/nuxt/components/declension-demo.vue +38 -0
- package/nuxt/components/declension-form.vue +158 -0
- package/nuxt/components/declension-preview.vue +170 -0
- package/nuxt/components/declension-results.vue +135 -0
- package/nuxt/components/error-404.vue +15 -0
- package/nuxt/components/github-issue-count.vue +18 -0
- package/nuxt/components/how-it-works.vue +51 -0
- package/nuxt/components/installation-instructions.vue +33 -0
- package/nuxt/components/library-docs.vue +27 -0
- package/nuxt/components/page-copyright.vue +15 -0
- package/nuxt/components/page-footer.vue +32 -0
- package/nuxt/components/page-header.vue +4 -0
- package/nuxt/components/preview-banner.vue +32 -0
- package/nuxt/components/share-links.vue +108 -0
- package/nuxt/components/top-nav-bar.vue +165 -0
- package/nuxt/components/ukrainian-flag.vue +37 -0
- package/nuxt/components/usage-example.vue +32 -0
- package/nuxt/composables/declension.ts +124 -0
- package/nuxt/composables/page-i18n.ts +11 -0
- package/nuxt/composables/page-meta.ts +5 -0
- package/nuxt/composables/route-utils.ts +17 -0
- package/nuxt/config.ts +20 -0
- package/nuxt/data/female-first-names.json +556 -0
- package/nuxt/data/male-first-names.json +603 -0
- package/nuxt/error.vue +25 -0
- package/nuxt/layouts/default.vue +5 -0
- package/nuxt/locales/en-US.json +63 -0
- package/nuxt/locales/uk-UA.json +65 -0
- package/nuxt/nuxt.config.ts +99 -0
- package/nuxt/package-lock.json +19524 -0
- package/nuxt/package.json +37 -0
- package/nuxt/pages/en-US/index.vue +41 -0
- package/nuxt/pages/index.vue +68 -0
- package/nuxt/plugins/i18n.ts +26 -0
- package/nuxt/public/.nojekyll +0 -0
- package/nuxt/public/CNAME +1 -0
- package/nuxt/public/android-icon-144x144.png +0 -0
- package/nuxt/public/android-icon-192x192.png +0 -0
- package/nuxt/public/android-icon-36x36.png +0 -0
- package/nuxt/public/android-icon-48x48.png +0 -0
- package/nuxt/public/android-icon-72x72.png +0 -0
- package/nuxt/public/android-icon-96x96.png +0 -0
- package/nuxt/public/apple-icon-114x114.png +0 -0
- package/nuxt/public/apple-icon-120x120.png +0 -0
- package/nuxt/public/apple-icon-144x144.png +0 -0
- package/nuxt/public/apple-icon-152x152.png +0 -0
- package/nuxt/public/apple-icon-180x180.png +0 -0
- package/nuxt/public/apple-icon-57x57.png +0 -0
- package/nuxt/public/apple-icon-60x60.png +0 -0
- package/nuxt/public/apple-icon-72x72.png +0 -0
- package/nuxt/public/apple-icon-76x76.png +0 -0
- package/nuxt/public/apple-icon-precomposed.png +0 -0
- package/nuxt/public/apple-icon.png +0 -0
- package/nuxt/public/browserconfig.xml +2 -0
- package/nuxt/public/favicon-16x16.png +0 -0
- package/nuxt/public/favicon-32x32.png +0 -0
- package/nuxt/public/favicon-96x96.png +0 -0
- package/nuxt/public/favicon.ico +0 -0
- package/nuxt/public/manifest.json +41 -0
- package/nuxt/public/ms-icon-144x144.png +0 -0
- package/nuxt/public/ms-icon-150x150.png +0 -0
- package/nuxt/public/ms-icon-310x310.png +0 -0
- package/nuxt/public/ms-icon-70x70.png +0 -0
- package/nuxt/public/preview-608x608.jpg +0 -0
- package/nuxt/scripts/postgenerate.js +7 -0
- package/nuxt/scripts/publish.js +7 -0
- package/nuxt/server/plugins/google-tag-manager.js +37 -0
- package/nuxt/tsconfig.json +11 -0
- package/package.json +3 -2
- package/src/resources/inflector/rules.json +94 -5
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useDeclension } from '~/composables/declension';
|
|
3
|
+
import { Anthroponym } from 'shevchenko';
|
|
4
|
+
|
|
5
|
+
const { declensionResults } = useDeclension();
|
|
6
|
+
|
|
7
|
+
function convertAnthroponymToString(anthroponym: Anthroponym): string {
|
|
8
|
+
let output: string[] = [];
|
|
9
|
+
|
|
10
|
+
if (anthroponym.lastName) {
|
|
11
|
+
output.push(anthroponym.lastName);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (anthroponym.firstName) {
|
|
15
|
+
output.push(anthroponym.firstName);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (anthroponym.middleName) {
|
|
19
|
+
output.push(anthroponym.middleName);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return output.join(' ');
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<table class="table table-responsive-md m-0">
|
|
28
|
+
<tr class="bg-light">
|
|
29
|
+
<th class="border-top-0">{{ $t('grammaticalCase') }}</th>
|
|
30
|
+
<th class="border-top-0">{{ $t('anthroponym.lastName') }}</th>
|
|
31
|
+
<th class="border-top-0">{{ $t('anthroponym.firstName') }}</th>
|
|
32
|
+
<th class="border-top-0">{{ $t('anthroponym.middleName') }}</th>
|
|
33
|
+
<th class="border-top-0">
|
|
34
|
+
<span class="py-0 px-1">
|
|
35
|
+
<i
|
|
36
|
+
class="fa fa-info-circle"
|
|
37
|
+
:title="$t('declensionForm.copyMessage')"
|
|
38
|
+
:aria-label="$t('declensionForm.copyMessage')"
|
|
39
|
+
></i>
|
|
40
|
+
</span>
|
|
41
|
+
</th>
|
|
42
|
+
</tr>
|
|
43
|
+
|
|
44
|
+
<tr>
|
|
45
|
+
<th>{{ $t('grammaticalCase.nominative') }}</th>
|
|
46
|
+
<td>{{ declensionResults.nominativeCase.lastName }}</td>
|
|
47
|
+
<td>{{ declensionResults.nominativeCase.firstName }}</td>
|
|
48
|
+
<td>{{ declensionResults.nominativeCase.middleName }}</td>
|
|
49
|
+
<td>
|
|
50
|
+
<CopyButton
|
|
51
|
+
:button-id="'copy-nominative-case-button'"
|
|
52
|
+
:source="convertAnthroponymToString(declensionResults.nominativeCase)"
|
|
53
|
+
/>
|
|
54
|
+
</td>
|
|
55
|
+
</tr>
|
|
56
|
+
|
|
57
|
+
<tr>
|
|
58
|
+
<th>{{ $t('grammaticalCase.genitive') }}</th>
|
|
59
|
+
<td>{{ declensionResults.genitiveCase.lastName }}</td>
|
|
60
|
+
<td>{{ declensionResults.genitiveCase.firstName }}</td>
|
|
61
|
+
<td>{{ declensionResults.genitiveCase.middleName }}</td>
|
|
62
|
+
<td>
|
|
63
|
+
<CopyButton
|
|
64
|
+
:button-id="'copy-genitive-case-button'"
|
|
65
|
+
:source="convertAnthroponymToString(declensionResults.genitiveCase)"
|
|
66
|
+
/>
|
|
67
|
+
</td>
|
|
68
|
+
</tr>
|
|
69
|
+
|
|
70
|
+
<tr>
|
|
71
|
+
<th>{{ $t('grammaticalCase.dative') }}</th>
|
|
72
|
+
<td>{{ declensionResults.dativeCase.lastName }}</td>
|
|
73
|
+
<td>{{ declensionResults.dativeCase.firstName }}</td>
|
|
74
|
+
<td>{{ declensionResults.dativeCase.middleName }}</td>
|
|
75
|
+
<td>
|
|
76
|
+
<CopyButton
|
|
77
|
+
:button-id="'copy-dative-case-button'"
|
|
78
|
+
:source="convertAnthroponymToString(declensionResults.dativeCase)"
|
|
79
|
+
/>
|
|
80
|
+
</td>
|
|
81
|
+
</tr>
|
|
82
|
+
|
|
83
|
+
<tr>
|
|
84
|
+
<th>{{ $t('grammaticalCase.accusative') }}</th>
|
|
85
|
+
<td>{{ declensionResults.accusativeCase.lastName }}</td>
|
|
86
|
+
<td>{{ declensionResults.accusativeCase.firstName }}</td>
|
|
87
|
+
<td>{{ declensionResults.accusativeCase.middleName }}</td>
|
|
88
|
+
<td>
|
|
89
|
+
<CopyButton
|
|
90
|
+
:button-id="'copy-accusative-case-button'"
|
|
91
|
+
:source="convertAnthroponymToString(declensionResults.accusativeCase)"
|
|
92
|
+
/>
|
|
93
|
+
</td>
|
|
94
|
+
</tr>
|
|
95
|
+
|
|
96
|
+
<tr>
|
|
97
|
+
<th>{{ $t('grammaticalCase.ablative') }}</th>
|
|
98
|
+
<td>{{ declensionResults.ablativeCase.lastName }}</td>
|
|
99
|
+
<td>{{ declensionResults.ablativeCase.firstName }}</td>
|
|
100
|
+
<td>{{ declensionResults.ablativeCase.middleName }}</td>
|
|
101
|
+
<td>
|
|
102
|
+
<CopyButton
|
|
103
|
+
:button-id="'copy-ablative-case-button'"
|
|
104
|
+
:source="convertAnthroponymToString(declensionResults.ablativeCase)"
|
|
105
|
+
/>
|
|
106
|
+
</td>
|
|
107
|
+
</tr>
|
|
108
|
+
|
|
109
|
+
<tr>
|
|
110
|
+
<th>{{ $t('grammaticalCase.locative') }}</th>
|
|
111
|
+
<td>{{ declensionResults.locativeCase.lastName }}</td>
|
|
112
|
+
<td>{{ declensionResults.locativeCase.firstName }}</td>
|
|
113
|
+
<td>{{ declensionResults.locativeCase.middleName }}</td>
|
|
114
|
+
<td>
|
|
115
|
+
<CopyButton
|
|
116
|
+
:button-id="'copy-locative-case-button'"
|
|
117
|
+
:source="convertAnthroponymToString(declensionResults.locativeCase)"
|
|
118
|
+
/>
|
|
119
|
+
</td>
|
|
120
|
+
</tr>
|
|
121
|
+
|
|
122
|
+
<tr>
|
|
123
|
+
<th>{{ $t('grammaticalCase.vocative') }}</th>
|
|
124
|
+
<td>{{ declensionResults.vocativeCase.lastName }}</td>
|
|
125
|
+
<td>{{ declensionResults.vocativeCase.firstName }}</td>
|
|
126
|
+
<td>{{ declensionResults.vocativeCase.middleName }}</td>
|
|
127
|
+
<td>
|
|
128
|
+
<CopyButton
|
|
129
|
+
:button-id="'copy-vocative-case-button'"
|
|
130
|
+
:source="convertAnthroponymToString(declensionResults.vocativeCase)"
|
|
131
|
+
/>
|
|
132
|
+
</td>
|
|
133
|
+
</tr>
|
|
134
|
+
</table>
|
|
135
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="jumbotron my-3">
|
|
3
|
+
<h1 class="text-truncate">
|
|
4
|
+
{{ $t('error404.pageTitle') }}
|
|
5
|
+
</h1>
|
|
6
|
+
|
|
7
|
+
<p>
|
|
8
|
+
{{ $t('error404.instructionMessage') }}
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<NuxtLink :to="{ name: 'index' }" class="btn btn-primary">
|
|
12
|
+
{{ $t('action.backToHome') }}
|
|
13
|
+
</NuxtLink>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
|
|
4
|
+
const appConfig = useAppConfig();
|
|
5
|
+
|
|
6
|
+
const { data, pending } = await useFetch(appConfig.library.gitHubStatsUrl, {
|
|
7
|
+
server: false,
|
|
8
|
+
lazy: true,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const issueCount = computed(() => {
|
|
12
|
+
return data.value ? data.value.open_issues_count : 0;
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<span v-if="!pending" class="badge badge-info">{{ issueCount }}</span>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section v-if="$i18n.locale === 'uk-UA'" id="how-it-works" class="my-4">
|
|
3
|
+
<div class="row">
|
|
4
|
+
<div class="col">
|
|
5
|
+
<h2>{{ $t('howItWorks') }}</h2>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div class="row">
|
|
10
|
+
<div class="col">
|
|
11
|
+
<div class="mt-3">
|
|
12
|
+
<p>
|
|
13
|
+
Бібліотека використовує більше вісімдесяти правил для відмінювання прізвищ, імен та по
|
|
14
|
+
батькові. Правила фільтруються за родом, закінченням, частиною мови, сферою застосування
|
|
15
|
+
та сортуються за пріоритетом.
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p>
|
|
19
|
+
При відмінюванні жіночих прізвищ із закінченнями на -а, -я та чоловічих прізвищ із
|
|
20
|
+
закінченнями на -ой, -ій, -ий, -их для визначення частини мови слова використовуються
|
|
21
|
+
нейронні мережі, навчені на більш як сорока тисячах прізвищах. Тому прізвища
|
|
22
|
+
іменникового та прикметникового походжень відмінюються як іменники та прикметники
|
|
23
|
+
відповідно, наприклад, Диня (називний) → Дині (родовий), Синя (називний) →
|
|
24
|
+
Синьої (родовий), Рий (називний) → Рия (родовий), Бурий (називний) → Бурого
|
|
25
|
+
(родовий).
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
<p>
|
|
29
|
+
При відмінюванні відбуваються зміни голосних та приголосних звуків згідно з правилами
|
|
30
|
+
української мови, наприклад, Сивокінь (називний) → Сивоконя (родовий), Гичка
|
|
31
|
+
(називний) → Гичці (давальний), але Чміль (називний) → Чміля (родовий).
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
<p>
|
|
35
|
+
Складені прізвища, утворені поєднанням двох самостійних прізвищ відмінюються за
|
|
36
|
+
правилами відмінювання кожної складової частини, наприклад, Нечуй-Левицький (називний) -
|
|
37
|
+
Нечуя-Левицького (родовий), але Драй-Хмара (називний) — Драй-Хмари (родовий), бо перша
|
|
38
|
+
коротка частина складеного прізвища є односкладовою та сприймається не як самостійне
|
|
39
|
+
прізвище, а як приставка до другого компонента.
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<p>
|
|
43
|
+
Складені імена, утворені поєднанням двох самостійних імен відмінюються згідно з
|
|
44
|
+
правилами відмінювання кожної складової частини, наприклад, Анна-Марія (називний) -
|
|
45
|
+
Анни-Марії (родовий).
|
|
46
|
+
</p>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</section>
|
|
51
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig();
|
|
3
|
+
|
|
4
|
+
const npmInstallCommand = `npm install --save ${appConfig.library.name}`;
|
|
5
|
+
const nodeRequireCode = `const ${appConfig.library.name} = require("${appConfig.library.name}");`;
|
|
6
|
+
const browserScriptCode = `<script type="text/javascript" src="${appConfig.library.cdnUrl}"></script>`;
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div id="installation" class="card my-3">
|
|
11
|
+
<div class="card-body">
|
|
12
|
+
<h5 class="card-title mb-3">{{ $t('installation') }}</h5>
|
|
13
|
+
|
|
14
|
+
<h6 class="card-subtitle mb-2 text-muted">npm</h6>
|
|
15
|
+
<div class="d-flex align-items-center mb-3">
|
|
16
|
+
<pre class="mb-0">{{ npmInstallCommand }}</pre>
|
|
17
|
+
<CopyButton :source="npmInstallCommand" />
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<h6 class="card-subtitle mb-2 text-muted">Node.js</h6>
|
|
21
|
+
<div class="d-flex align-items-center mb-3">
|
|
22
|
+
<pre class="mb-0">{{ nodeRequireCode }}</pre>
|
|
23
|
+
<CopyButton :source="nodeRequireCode" />
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<h6 class="card-subtitle mb-2 text-muted">{{ $t('browser') }}</h6>
|
|
27
|
+
<div class="d-flex align-items-center mb-3">
|
|
28
|
+
<pre class="mb-0">{{ browserScriptCode }}</pre>
|
|
29
|
+
<CopyButton :source="browserScriptCode" />
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section id="documentation" class="my-4">
|
|
3
|
+
<div class="row">
|
|
4
|
+
<div class="col">
|
|
5
|
+
<h2>{{ $t('documentation') }}</h2>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div class="row">
|
|
10
|
+
<div class="col">
|
|
11
|
+
<InstallationInstructions />
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="row">
|
|
16
|
+
<div class="col">
|
|
17
|
+
<UsageExample />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="row">
|
|
22
|
+
<div class="col">
|
|
23
|
+
<ApiSpec />
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</section>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { useNow } from '@vueuse/core';
|
|
4
|
+
|
|
5
|
+
const appConfig = useAppConfig();
|
|
6
|
+
const currentTime = useNow();
|
|
7
|
+
const currentYear = computed(() => currentTime.value.getFullYear());
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<span>
|
|
12
|
+
© {{ appConfig.library.releaseYear }}-{{ currentYear }}
|
|
13
|
+
{{ appConfig.library.name }}
|
|
14
|
+
</span>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const appConfig = useAppConfig();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="row">
|
|
7
|
+
<div class="col-12">
|
|
8
|
+
<hr />
|
|
9
|
+
<nav>
|
|
10
|
+
<ul class="list-unstyled" role="menubar">
|
|
11
|
+
<p class="d-inline mr-2 mb-0">
|
|
12
|
+
<PageCopyright />
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<li class="d-inline mr-2" role="presentation">
|
|
16
|
+
<a :href="appConfig.library.npmUrl" target="_blank" role="menuitem">NPM</a>
|
|
17
|
+
</li>
|
|
18
|
+
|
|
19
|
+
<li class="d-inline mr-2" role="presentation">
|
|
20
|
+
<a :href="appConfig.library.gitHubUrl" target="_blank" role="menuitem">GitHub</a>
|
|
21
|
+
</li>
|
|
22
|
+
|
|
23
|
+
<li class="d-inline mr-2" role="presentation">
|
|
24
|
+
<ContactMeButton role="menuitem">
|
|
25
|
+
{{ $t('action.contactMe') }}
|
|
26
|
+
</ContactMeButton>
|
|
27
|
+
</li>
|
|
28
|
+
</ul>
|
|
29
|
+
</nav>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const appConfig = useAppConfig();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<section id="preview" class="jumbotron my-3">
|
|
7
|
+
<h1 class="text-truncate">
|
|
8
|
+
{{ appConfig.library.name }}
|
|
9
|
+
<span class="d-none d-lg-inline">
|
|
10
|
+
<small class="text-muted"><DeclensionPreview :aria-hidden="true" /></small>
|
|
11
|
+
</span>
|
|
12
|
+
</h1>
|
|
13
|
+
|
|
14
|
+
<p>
|
|
15
|
+
{{ $t('app.name') }}
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p>
|
|
19
|
+
<NuxtLink class="btn btn-lg btn-primary" :to="{ hash: '#demo' }" role="button">
|
|
20
|
+
{{ $t('demo') }}
|
|
21
|
+
</NuxtLink>
|
|
22
|
+
|
|
23
|
+
<NuxtLink
|
|
24
|
+
class="btn btn-lg btn-link text-decoration-none"
|
|
25
|
+
:to="{ hash: '#usage-example' }"
|
|
26
|
+
role="button"
|
|
27
|
+
>
|
|
28
|
+
{{ $t('usageExample') }}
|
|
29
|
+
</NuxtLink>
|
|
30
|
+
</p>
|
|
31
|
+
</section>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { useI18n } from 'vue-i18n';
|
|
4
|
+
import { useRouteUtils } from '~/composables/route-utils';
|
|
5
|
+
|
|
6
|
+
defineProps({
|
|
7
|
+
buttonsClass: { type: String, default: null },
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const { t: $t } = useI18n();
|
|
11
|
+
const { pageUrl } = useRouteUtils();
|
|
12
|
+
|
|
13
|
+
const pageShareLink = computed(() => pageUrl.value);
|
|
14
|
+
|
|
15
|
+
const facebookShareLink = computed(() => {
|
|
16
|
+
const shareLink = new URL('https://www.facebook.com');
|
|
17
|
+
shareLink.pathname = '/sharer/sharer.php';
|
|
18
|
+
shareLink.searchParams.set('u', pageShareLink.value);
|
|
19
|
+
return shareLink.toString();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const twitterShareLink = computed(() => {
|
|
23
|
+
const shareLink = new URL('https://twitter.com');
|
|
24
|
+
shareLink.pathname = '/home';
|
|
25
|
+
shareLink.searchParams.set('status', pageShareLink.value);
|
|
26
|
+
return shareLink.toString();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const linkedInShareLink = computed(() => {
|
|
30
|
+
const shareLink = new URL('https://www.linkedin.com');
|
|
31
|
+
shareLink.pathname = '/shareArticle';
|
|
32
|
+
shareLink.searchParams.set('mini', true.toString());
|
|
33
|
+
shareLink.searchParams.set('url', pageShareLink.value);
|
|
34
|
+
shareLink.searchParams.set('title', '');
|
|
35
|
+
shareLink.searchParams.set('summary', $t('app.name').toString());
|
|
36
|
+
shareLink.searchParams.set('source', '');
|
|
37
|
+
return shareLink.toString();
|
|
38
|
+
});
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div class="btn-group" :class="buttonsClass" role="menubar">
|
|
43
|
+
<CopyButton
|
|
44
|
+
:source="pageShareLink"
|
|
45
|
+
button-class="btn btn-lg btn-link btn--share"
|
|
46
|
+
:button-title="$t('action.copyLink')"
|
|
47
|
+
icon-class="fa fa-link"
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
<a
|
|
51
|
+
class="btn btn-lg btn-link btn--share"
|
|
52
|
+
:href="facebookShareLink"
|
|
53
|
+
:title="$t('action.share.onFacebook')"
|
|
54
|
+
target="_blank"
|
|
55
|
+
role="menuitem"
|
|
56
|
+
>
|
|
57
|
+
<i class="fa fa-facebook fa-facebook--branded" aria-hidden="true"></i>
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
<a
|
|
61
|
+
class="btn btn-lg btn-link btn--share"
|
|
62
|
+
:href="twitterShareLink"
|
|
63
|
+
:title="$t('action.share.onTwitter')"
|
|
64
|
+
target="_blank"
|
|
65
|
+
role="menuitem"
|
|
66
|
+
>
|
|
67
|
+
<i class="fa fa-twitter fa-twitter--branded" aria-hidden="true"></i>
|
|
68
|
+
</a>
|
|
69
|
+
|
|
70
|
+
<a
|
|
71
|
+
class="btn btn-lg btn-link btn--share"
|
|
72
|
+
:href="linkedInShareLink"
|
|
73
|
+
:title="$t('action.share.onLinkedIn')"
|
|
74
|
+
target="_blank"
|
|
75
|
+
role="menuitem"
|
|
76
|
+
>
|
|
77
|
+
<i class="fa fa-linkedin fa-linkedin--branded" aria-hidden="true"></i>
|
|
78
|
+
</a>
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<style lang="scss" scoped>
|
|
83
|
+
.btn {
|
|
84
|
+
&--share {
|
|
85
|
+
width: 45px;
|
|
86
|
+
border: 0;
|
|
87
|
+
text-align: center;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.fa-facebook {
|
|
92
|
+
&--branded {
|
|
93
|
+
color: #4867aa;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.fa-twitter {
|
|
98
|
+
&--branded {
|
|
99
|
+
color: #1da1f2;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.fa-linkedin {
|
|
104
|
+
&--branded {
|
|
105
|
+
color: #0077b5;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
</style>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useRouteUtils } from '~/composables/route-utils';
|
|
3
|
+
|
|
4
|
+
const appConfig = useAppConfig();
|
|
5
|
+
const { buildPageUrl } = useRouteUtils();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
|
10
|
+
<a class="navbar-brand" :href="appConfig.website.url">
|
|
11
|
+
<img
|
|
12
|
+
class="navbar-brand__logo"
|
|
13
|
+
src="~/assets/img/shevchenko_pixelized_304x304.jpg"
|
|
14
|
+
:alt="appConfig.library.name"
|
|
15
|
+
/>
|
|
16
|
+
<span class="hidden-sm">{{ appConfig.library.name }}</span>
|
|
17
|
+
</a>
|
|
18
|
+
|
|
19
|
+
<button
|
|
20
|
+
class="navbar-toggler"
|
|
21
|
+
type="button"
|
|
22
|
+
data-toggle="collapse"
|
|
23
|
+
data-target="#navbar-supported-content"
|
|
24
|
+
aria-controls="navbar-supported-content"
|
|
25
|
+
aria-expanded="false"
|
|
26
|
+
aria-label="Toggle navigation"
|
|
27
|
+
>
|
|
28
|
+
<span class="navbar-toggler-icon"></span>
|
|
29
|
+
</button>
|
|
30
|
+
|
|
31
|
+
<div class="collapse navbar-collapse" id="navbar-supported-content">
|
|
32
|
+
<ul class="navbar-nav mt-2 mt-lg-0 ml-auto" role="menubar">
|
|
33
|
+
<li class="nav-item" role="presentation">
|
|
34
|
+
<NuxtLink class="nav-link" :to="{ hash: '#demo' }" role="menuitem">
|
|
35
|
+
{{ $t('demo') }}
|
|
36
|
+
</NuxtLink>
|
|
37
|
+
</li>
|
|
38
|
+
|
|
39
|
+
<li class="nav-item" role="presentation">
|
|
40
|
+
<NuxtLink class="nav-link" :to="{ hash: '#documentation' }" role="menuitem">
|
|
41
|
+
{{ $t('documentation') }}
|
|
42
|
+
</NuxtLink>
|
|
43
|
+
</li>
|
|
44
|
+
|
|
45
|
+
<li class="nav-item" role="presentation">
|
|
46
|
+
<a class="nav-link" :href="appConfig.library.licenseUrl" target="_blank" role="menuitem">
|
|
47
|
+
{{ $t('license') }}
|
|
48
|
+
</a>
|
|
49
|
+
</li>
|
|
50
|
+
|
|
51
|
+
<li class="nav-item dropdown" role="presentation">
|
|
52
|
+
<a
|
|
53
|
+
class="nav-link dropdown-toggle"
|
|
54
|
+
href="#"
|
|
55
|
+
id="navbar-dropdown-links"
|
|
56
|
+
data-toggle="dropdown"
|
|
57
|
+
role="menuitem"
|
|
58
|
+
aria-haspopup="true"
|
|
59
|
+
aria-expanded="false"
|
|
60
|
+
>
|
|
61
|
+
{{ $t('links') }}
|
|
62
|
+
</a>
|
|
63
|
+
|
|
64
|
+
<div class="dropdown-menu" aria-labelledby="navbar-dropdown-links" role="menu">
|
|
65
|
+
<a
|
|
66
|
+
class="dropdown-item"
|
|
67
|
+
:href="appConfig.library.npmUrl"
|
|
68
|
+
target="_blank"
|
|
69
|
+
role="menuitem"
|
|
70
|
+
>
|
|
71
|
+
NPM
|
|
72
|
+
</a>
|
|
73
|
+
|
|
74
|
+
<a
|
|
75
|
+
class="dropdown-item"
|
|
76
|
+
:href="appConfig.library.gitHubUrl"
|
|
77
|
+
target="_blank"
|
|
78
|
+
role="menuitem"
|
|
79
|
+
>
|
|
80
|
+
GitHub
|
|
81
|
+
</a>
|
|
82
|
+
|
|
83
|
+
<a
|
|
84
|
+
class="dropdown-item"
|
|
85
|
+
:href="appConfig.library.runKitUrl"
|
|
86
|
+
target="_blank"
|
|
87
|
+
role="menuitem"
|
|
88
|
+
>
|
|
89
|
+
RunKit
|
|
90
|
+
</a>
|
|
91
|
+
</div>
|
|
92
|
+
</li>
|
|
93
|
+
|
|
94
|
+
<li class="nav-item dropdown" role="presentation">
|
|
95
|
+
<a
|
|
96
|
+
class="nav-link dropdown-toggle"
|
|
97
|
+
href="#"
|
|
98
|
+
id="navbar-dropdown-feedback"
|
|
99
|
+
data-toggle="dropdown"
|
|
100
|
+
role="menuitem"
|
|
101
|
+
aria-haspopup="true"
|
|
102
|
+
aria-expanded="false"
|
|
103
|
+
>
|
|
104
|
+
{{ $t('feedback') }}
|
|
105
|
+
</a>
|
|
106
|
+
|
|
107
|
+
<div class="dropdown-menu" aria-labelledby="navbar-dropdown-feedback" role="menu">
|
|
108
|
+
<a
|
|
109
|
+
class="dropdown-item"
|
|
110
|
+
:href="appConfig.library.issuesUrl"
|
|
111
|
+
target="_blank"
|
|
112
|
+
role="menuitem"
|
|
113
|
+
>
|
|
114
|
+
{{ $t('issueReport') }} <GithubIssueCount />
|
|
115
|
+
</a>
|
|
116
|
+
|
|
117
|
+
<ContactMeButton button-class="dropdown-item" role="menuitem">
|
|
118
|
+
{{ $t('action.contactMe') }}
|
|
119
|
+
</ContactMeButton>
|
|
120
|
+
</div>
|
|
121
|
+
</li>
|
|
122
|
+
|
|
123
|
+
<li class="nav-item dropdown" role="presentation">
|
|
124
|
+
<a
|
|
125
|
+
class="nav-link dropdown-toggle"
|
|
126
|
+
href="#"
|
|
127
|
+
id="navbar-dropdown-locale"
|
|
128
|
+
data-toggle="dropdown"
|
|
129
|
+
role="menuitem"
|
|
130
|
+
aria-haspopup="true"
|
|
131
|
+
aria-expanded="false"
|
|
132
|
+
>
|
|
133
|
+
<i class="fa fa-globe" aria-hidden="true"></i>
|
|
134
|
+
{{ $i18n.locale }}
|
|
135
|
+
</a>
|
|
136
|
+
|
|
137
|
+
<div class="dropdown-menu" aria-labelledby="navbar-dropdown-locale" role="menu">
|
|
138
|
+
<a
|
|
139
|
+
v-for="locale of $i18n.availableLocales"
|
|
140
|
+
:key="locale"
|
|
141
|
+
class="dropdown-item"
|
|
142
|
+
:href="buildPageUrl(locale === 'uk-UA' ? '/' : `/${locale}`)"
|
|
143
|
+
role="menuitem"
|
|
144
|
+
>
|
|
145
|
+
{{ $t(`locale.${locale}`) }} ({{ locale }})
|
|
146
|
+
</a>
|
|
147
|
+
</div>
|
|
148
|
+
</li>
|
|
149
|
+
</ul>
|
|
150
|
+
</div>
|
|
151
|
+
</nav>
|
|
152
|
+
</template>
|
|
153
|
+
|
|
154
|
+
<style lang="scss" scoped>
|
|
155
|
+
.navbar-brand {
|
|
156
|
+
padding: 0;
|
|
157
|
+
|
|
158
|
+
&__logo {
|
|
159
|
+
display: inline;
|
|
160
|
+
width: 50px;
|
|
161
|
+
height: 50px;
|
|
162
|
+
margin-right: 10px;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flag flag--ukraine"></div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<style lang="scss" scoped>
|
|
6
|
+
$color-sky: #0066cc;
|
|
7
|
+
$color-field: #ffcc00;
|
|
8
|
+
|
|
9
|
+
.flag {
|
|
10
|
+
position: relative;
|
|
11
|
+
display: block;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 30px;
|
|
14
|
+
|
|
15
|
+
&--ukraine {
|
|
16
|
+
&::before {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
display: block;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 50%;
|
|
22
|
+
background-color: $color-sky;
|
|
23
|
+
content: '';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&::after {
|
|
27
|
+
position: absolute;
|
|
28
|
+
bottom: 0;
|
|
29
|
+
display: block;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: 50%;
|
|
32
|
+
background-color: $color-field;
|
|
33
|
+
content: '';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
</style>
|