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.
Files changed (90) hide show
  1. package/dist/cjs/shevchenko.js +97 -7
  2. package/dist/cjs/shevchenko.js.map +1 -1
  3. package/dist/es/shevchenko.js +97 -7
  4. package/dist/es/shevchenko.js.map +1 -1
  5. package/dist/umd/shevchenko.min.js +3 -3
  6. package/dist/umd/shevchenko.min.js.map +1 -1
  7. package/nuxt/.eslintrc.json +27 -0
  8. package/nuxt/.prettierrc.json +6 -0
  9. package/nuxt/README.md +27 -0
  10. package/nuxt/app.config.ts +3 -0
  11. package/nuxt/app.vue +5 -0
  12. package/nuxt/assets/img/shevchenko_pixelized_304x304.jpg +0 -0
  13. package/nuxt/assets/img/shevchenko_pixelized_304x304.png +0 -0
  14. package/nuxt/assets/img/shevchenko_pixelized_608x608.jpg +0 -0
  15. package/nuxt/assets/style/main.scss +3 -0
  16. package/nuxt/components/about-modal.vue +58 -0
  17. package/nuxt/components/api-spec.vue +25 -0
  18. package/nuxt/components/contact-me-button.vue +11 -0
  19. package/nuxt/components/contact-me-modal.vue +63 -0
  20. package/nuxt/components/copy-button.vue +38 -0
  21. package/nuxt/components/declension-demo.vue +38 -0
  22. package/nuxt/components/declension-form.vue +158 -0
  23. package/nuxt/components/declension-preview.vue +170 -0
  24. package/nuxt/components/declension-results.vue +135 -0
  25. package/nuxt/components/error-404.vue +15 -0
  26. package/nuxt/components/github-issue-count.vue +18 -0
  27. package/nuxt/components/how-it-works.vue +51 -0
  28. package/nuxt/components/installation-instructions.vue +33 -0
  29. package/nuxt/components/library-docs.vue +27 -0
  30. package/nuxt/components/page-copyright.vue +15 -0
  31. package/nuxt/components/page-footer.vue +32 -0
  32. package/nuxt/components/page-header.vue +4 -0
  33. package/nuxt/components/preview-banner.vue +32 -0
  34. package/nuxt/components/share-links.vue +108 -0
  35. package/nuxt/components/top-nav-bar.vue +165 -0
  36. package/nuxt/components/ukrainian-flag.vue +37 -0
  37. package/nuxt/components/usage-example.vue +32 -0
  38. package/nuxt/composables/declension.ts +124 -0
  39. package/nuxt/composables/page-i18n.ts +11 -0
  40. package/nuxt/composables/page-meta.ts +5 -0
  41. package/nuxt/composables/route-utils.ts +17 -0
  42. package/nuxt/config.ts +20 -0
  43. package/nuxt/data/female-first-names.json +556 -0
  44. package/nuxt/data/male-first-names.json +603 -0
  45. package/nuxt/error.vue +25 -0
  46. package/nuxt/layouts/default.vue +5 -0
  47. package/nuxt/locales/en-US.json +63 -0
  48. package/nuxt/locales/uk-UA.json +65 -0
  49. package/nuxt/nuxt.config.ts +99 -0
  50. package/nuxt/package-lock.json +19524 -0
  51. package/nuxt/package.json +37 -0
  52. package/nuxt/pages/en-US/index.vue +41 -0
  53. package/nuxt/pages/index.vue +68 -0
  54. package/nuxt/plugins/i18n.ts +26 -0
  55. package/nuxt/public/.nojekyll +0 -0
  56. package/nuxt/public/CNAME +1 -0
  57. package/nuxt/public/android-icon-144x144.png +0 -0
  58. package/nuxt/public/android-icon-192x192.png +0 -0
  59. package/nuxt/public/android-icon-36x36.png +0 -0
  60. package/nuxt/public/android-icon-48x48.png +0 -0
  61. package/nuxt/public/android-icon-72x72.png +0 -0
  62. package/nuxt/public/android-icon-96x96.png +0 -0
  63. package/nuxt/public/apple-icon-114x114.png +0 -0
  64. package/nuxt/public/apple-icon-120x120.png +0 -0
  65. package/nuxt/public/apple-icon-144x144.png +0 -0
  66. package/nuxt/public/apple-icon-152x152.png +0 -0
  67. package/nuxt/public/apple-icon-180x180.png +0 -0
  68. package/nuxt/public/apple-icon-57x57.png +0 -0
  69. package/nuxt/public/apple-icon-60x60.png +0 -0
  70. package/nuxt/public/apple-icon-72x72.png +0 -0
  71. package/nuxt/public/apple-icon-76x76.png +0 -0
  72. package/nuxt/public/apple-icon-precomposed.png +0 -0
  73. package/nuxt/public/apple-icon.png +0 -0
  74. package/nuxt/public/browserconfig.xml +2 -0
  75. package/nuxt/public/favicon-16x16.png +0 -0
  76. package/nuxt/public/favicon-32x32.png +0 -0
  77. package/nuxt/public/favicon-96x96.png +0 -0
  78. package/nuxt/public/favicon.ico +0 -0
  79. package/nuxt/public/manifest.json +41 -0
  80. package/nuxt/public/ms-icon-144x144.png +0 -0
  81. package/nuxt/public/ms-icon-150x150.png +0 -0
  82. package/nuxt/public/ms-icon-310x310.png +0 -0
  83. package/nuxt/public/ms-icon-70x70.png +0 -0
  84. package/nuxt/public/preview-608x608.jpg +0 -0
  85. package/nuxt/scripts/postgenerate.js +7 -0
  86. package/nuxt/scripts/publish.js +7 -0
  87. package/nuxt/server/plugins/google-tag-manager.js +37 -0
  88. package/nuxt/tsconfig.json +11 -0
  89. package/package.json +3 -2
  90. package/src/resources/inflector/rules.json +94 -5
@@ -0,0 +1,37 @@
1
+ {
2
+ "private": true,
3
+ "scripts": {
4
+ "build": "nuxt build",
5
+ "dev": "nuxt dev",
6
+ "generate": "nuxt generate",
7
+ "postgenerate": "node ./scripts/postgenerate.js",
8
+ "publish": "node ./scripts/publish.js",
9
+ "serve": "serve .output/public",
10
+ "preview": "nuxt preview",
11
+ "postinstall": "nuxt prepare",
12
+ "lint": "eslint --fix \"**/*.{ts,vue}\""
13
+ },
14
+ "devDependencies": {
15
+ "@nuxtjs/eslint-config-typescript": "^11.0.0",
16
+ "@typescript-eslint/eslint-plugin": "^5.42.0",
17
+ "@typescript-eslint/parser": "^5.42.0",
18
+ "@vue/eslint-config-typescript": "^11.0.2",
19
+ "@vueuse/core": "^9.4.0",
20
+ "@vueuse/nuxt": "^9.4.0",
21
+ "eslint": "^8.26.0",
22
+ "eslint-config-prettier": "^8.5.0",
23
+ "eslint-config-xo": "^0.42.0",
24
+ "eslint-config-xo-typescript": "^0.53.0",
25
+ "eslint-plugin-prettier": "^4.2.1",
26
+ "eslint-plugin-unicorn": "^43.0.2",
27
+ "eslint-plugin-vue": "^9.7.0",
28
+ "nuxt": "^3.0.0",
29
+ "prettier": "^2.7.1",
30
+ "sass": "^1.56.0",
31
+ "serve": "^14.0.1",
32
+ "shevchenko": "^2.1.2",
33
+ "typescript": "^4.8.4",
34
+ "vue-i18n": "^9.2.2",
35
+ "vue-router": "^4.1.6"
36
+ }
37
+ }
@@ -0,0 +1,41 @@
1
+ <script>
2
+ import { computed } from 'vue';
3
+ import { useI18n } from 'vue-i18n';
4
+ import IndexPage from '~/pages/index.vue';
5
+ import { usePageI18n } from '~/composables/page-i18n';
6
+ import { useRouteUtils } from '~/composables/route-utils';
7
+ import { usePageMeta } from '~/composables/page-meta';
8
+
9
+ function setup(...args) {
10
+ const setupResult = IndexPage.setup.call(this, ...args);
11
+
12
+ definePageMeta({
13
+ alias: ['/en', '/en.html'],
14
+ });
15
+
16
+ usePageI18n({
17
+ locale: 'en-US',
18
+ });
19
+
20
+ const { t: $t } = useI18n();
21
+ const { buildPageTitle } = usePageMeta();
22
+
23
+ const pageTitle = computed(() => {
24
+ const title = $t('app.name').toString();
25
+ return buildPageTitle(title);
26
+ });
27
+
28
+ const { buildPageUrl } = useRouteUtils();
29
+ useHead({
30
+ title: pageTitle,
31
+ link: [
32
+ //
33
+ { rel: 'canonical', href: buildPageUrl('/en-US') },
34
+ ],
35
+ });
36
+
37
+ return setupResult;
38
+ }
39
+
40
+ export default { ...IndexPage, setup };
41
+ </script>
@@ -0,0 +1,68 @@
1
+ <script setup lang="ts">
2
+ import { computed, ref, onMounted } from 'vue';
3
+ import { useI18n } from 'vue-i18n';
4
+ import { usePageI18n } from '~/composables/page-i18n';
5
+ import { buildPageUrl, useRouteUtils } from '~/composables/route-utils';
6
+ import { usePageMeta } from '~/composables/page-meta';
7
+ import { Anthroponym } from 'shevchenko';
8
+
9
+ usePageI18n({
10
+ locale: 'uk-UA',
11
+ });
12
+
13
+ const appConfig = useAppConfig();
14
+ const { t: $t } = useI18n();
15
+ const route = useRoute();
16
+ const { pageUrl } = useRouteUtils();
17
+ const router = useRouter();
18
+ const { buildPageTitle } = usePageMeta();
19
+
20
+ const defaultPageTitle = computed(() => {
21
+ const title = $t('app.name').toString();
22
+ return buildPageTitle(title);
23
+ });
24
+
25
+ const pageTitle = ref(defaultPageTitle.value);
26
+
27
+ useHead({
28
+ title: pageTitle,
29
+ link: [
30
+ //
31
+ { rel: 'canonical', href: buildPageUrl('/') },
32
+ ],
33
+ meta: [
34
+ { property: 'og:image', content: buildPageUrl('/preview-608x608.jpg') },
35
+ { property: 'og:image:width', content: '608' },
36
+ { property: 'og:image:height', content: '608' },
37
+ { property: 'og:type', content: 'website' },
38
+ { property: 'og:url', content: pageUrl },
39
+ { property: 'og:site_name', content: appConfig.library.name },
40
+ { property: 'og:title', content: pageTitle },
41
+ { property: 'og:description', content: pageTitle },
42
+ { name: 'twitter:image', content: buildPageUrl('/preview-608x608.jpg') },
43
+ { name: 'twitter:card', content: 'summary' },
44
+ { name: 'twitter:title', content: pageTitle },
45
+ ],
46
+ });
47
+
48
+ async function updatePageTitle(anthroponym: Partial<Anthroponym>): Promise<void> {
49
+ // For some reason, the route query is not updated when all query keys remain the same.
50
+ // The next line of code forcibly resets the route query to fix the bug.
51
+ await router.replace({ query: {} });
52
+
53
+ await router.replace({ query: { ...anthroponym } });
54
+ }
55
+
56
+ onMounted(() => updatePageTitle(route.query));
57
+ </script>
58
+
59
+ <template>
60
+ <PageHeader />
61
+ <PreviewBanner />
62
+ <DeclensionDemo :initial-anthroponym="$route.query" @declension="updatePageTitle" />
63
+ <HowItWorks />
64
+ <LibraryDocs />
65
+ <PageFooter />
66
+ <ContactMeModal />
67
+ <AboutModal />
68
+ </template>
@@ -0,0 +1,26 @@
1
+ import { createI18n } from 'vue-i18n';
2
+ import enUS from '~/locales/en-US.json';
3
+ import ukUA from '~/locales/uk-UA.json';
4
+
5
+ export type LocaleName = 'en-US' | 'uk-UA';
6
+ type MessageSchema = typeof enUS;
7
+ type MessageDictionary = any;
8
+
9
+ export const defaultLocale: LocaleName = 'uk-UA';
10
+ export const fallbackLocale: LocaleName = 'en-US';
11
+
12
+ export default defineNuxtPlugin(({ vueApp }) => {
13
+ const i18n = createI18n<MessageSchema, LocaleName>({
14
+ legacy: false,
15
+ globalInjection: true,
16
+ messageResolver: (messages: MessageDictionary, path) => {
17
+ const message = messages[path];
18
+ return message != null ? message : null;
19
+ },
20
+ locale: defaultLocale,
21
+ fallbackLocale: fallbackLocale,
22
+ messages: { 'en-US': enUS, 'uk-UA': ukUA },
23
+ });
24
+
25
+ vueApp.use(i18n);
26
+ });
File without changes
@@ -0,0 +1 @@
1
+ shevchenko-js.tooleks.com
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "shevchenko-js.tooleks.com",
3
+ "icons": [
4
+ {
5
+ "src": "\/android-icon-36x36.png",
6
+ "sizes": "36x36",
7
+ "type": "image\/png",
8
+ "density": "0.75"
9
+ },
10
+ {
11
+ "src": "\/android-icon-48x48.png",
12
+ "sizes": "48x48",
13
+ "type": "image\/png",
14
+ "density": "1.0"
15
+ },
16
+ {
17
+ "src": "\/android-icon-72x72.png",
18
+ "sizes": "72x72",
19
+ "type": "image\/png",
20
+ "density": "1.5"
21
+ },
22
+ {
23
+ "src": "\/android-icon-96x96.png",
24
+ "sizes": "96x96",
25
+ "type": "image\/png",
26
+ "density": "2.0"
27
+ },
28
+ {
29
+ "src": "\/android-icon-144x144.png",
30
+ "sizes": "144x144",
31
+ "type": "image\/png",
32
+ "density": "3.0"
33
+ },
34
+ {
35
+ "src": "\/android-icon-192x192.png",
36
+ "sizes": "192x192",
37
+ "type": "image\/png",
38
+ "density": "4.0"
39
+ }
40
+ ]
41
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,7 @@
1
+ const { copyFileSync } = require('fs');
2
+ const { join } = require('path');
3
+
4
+ const dir = join(__dirname, '../.output/public');
5
+ const src = join(dir, 'en-US/index.html');
6
+ const dest = join(dir, 'en.html');
7
+ copyFileSync(src, dest);
@@ -0,0 +1,7 @@
1
+ const { cpSync, rmSync } = require('fs');
2
+ const { join } = require('path');
3
+
4
+ const src = join(__dirname, '../.output/public');
5
+ const dest = join(__dirname, '../../docs');
6
+ rmSync(dest, { recursive: true });
7
+ cpSync(src, dest, { recursive: true });
@@ -0,0 +1,37 @@
1
+ import { defineNitroPlugin } from 'nitropack/runtime/plugin';
2
+
3
+ const headCode = `
4
+ <!-- Google Tag Manager -->
5
+ <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
6
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
7
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
8
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
9
+ })(window,document,'script','dataLayer','GTM-WGR7576');</script>
10
+ <!-- End Google Tag Manager -->
11
+ <!-- Google tag (gtag.js) -->
12
+ <script async src="https://www.googletagmanager.com/gtag/js?id=G-RZ36XWPBER"></script>
13
+ <script>
14
+ window.dataLayer = window.dataLayer || [];
15
+ function gtag(){dataLayer.push(arguments);}
16
+ gtag('js', new Date());
17
+
18
+ gtag('config', 'G-RZ36XWPBER');
19
+ </script>
20
+ `;
21
+
22
+ const bodyCode = `
23
+ <!-- Google Tag Manager (noscript) -->
24
+ <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WGR7576"
25
+ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
26
+ <!-- End Google Tag Manager (noscript) -->
27
+ `;
28
+
29
+ /**
30
+ * Injects Google Tag Manager code snippets into head and body HTML elements.
31
+ */
32
+ export default defineNitroPlugin((nitroApp) => {
33
+ nitroApp.hooks.hook('render:html', (html) => {
34
+ html.head.unshift(headCode.trim());
35
+ html.bodyPrepend.unshift(bodyCode.trim());
36
+ });
37
+ });
@@ -0,0 +1,11 @@
1
+ {
2
+ // https://v3.nuxtjs.org/concepts/typescript
3
+ "extends": "./.nuxt/tsconfig.json",
4
+ "compilerOptions": {
5
+ "target": "ES5",
6
+ "module": "CommonJS",
7
+ "skipLibCheck": false,
8
+ "allowSyntheticDefaultImports": true,
9
+ "strict": true
10
+ }
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shevchenko",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "JavaScript library for declension of Ukrainian anthroponyms",
5
5
  "browser": "./dist/umd/shevchenko.min.js",
6
6
  "main": "./dist/cjs/shevchenko.js",
@@ -64,10 +64,11 @@
64
64
  "@types/synaptic": "^1.0.3",
65
65
  "axios": "^0.21.0",
66
66
  "chai": "^4.2.0",
67
- "ejs": "^3.1.5",
67
+ "ejs": "^3.1.7",
68
68
  "gulp": "^4.0.2",
69
69
  "i18n": "^0.13.2",
70
70
  "mocha": "^8.2.1",
71
+ "nuxi": "*",
71
72
  "rimraf": "^3.0.2",
72
73
  "rollup": "^2.34.2",
73
74
  "rollup-plugin-terser": "^7.0.2",
@@ -429,7 +429,8 @@
429
429
  {
430
430
  "description": "друга відміна / чоловічий рід / м'яка група / на -(голосна)лець",
431
431
  "examples": [
432
- "стрілець"
432
+ "стрілець",
433
+ "білець"
433
434
  ],
434
435
  "partOfSpeech": "noun",
435
436
  "gender": [
@@ -2070,7 +2071,7 @@
2070
2071
  }
2071
2072
  },
2072
2073
  {
2073
- "description": "друга відміна / чоловічий рід / м'яка група / на -.бідь",
2074
+ "description": "друга відміна / чоловічий рід / м'яка група / на -бідь",
2074
2075
  "examples": [
2075
2076
  "лебідь"
2076
2077
  ],
@@ -2181,7 +2182,7 @@
2181
2182
  }
2182
2183
  },
2183
2184
  {
2184
- "description": "друга відміна / чоловічий рід / м'яка група / на -.мінь",
2185
+ "description": "друга відміна / чоловічий рід / м'яка група / на -мінь",
2185
2186
  "examples": [
2186
2187
  "кремінь"
2187
2188
  ],
@@ -2958,7 +2959,7 @@
2958
2959
  }
2959
2960
  },
2960
2961
  {
2961
- "description": "друга відміна / чоловічий рід / тверда група / на -.ків",
2962
+ "description": "друга відміна / чоловічий рід / тверда група / на -ків",
2962
2963
  "examples": [
2963
2964
  "яків"
2964
2965
  ],
@@ -3069,7 +3070,7 @@
3069
3070
  }
3070
3071
  },
3071
3072
  {
3072
- "description": "друга відміна / чоловічий рід / тверда група / на -.(к|р)іп",
3073
+ "description": "друга відміна / чоловічий рід / тверда група / на -(к|р)іп",
3073
3074
  "examples": [
3074
3075
  "прокіп"
3075
3076
  ],
@@ -5313,6 +5314,94 @@
5313
5314
  ]
5314
5315
  }
5315
5316
  },
5317
+ {
5318
+ "description": "чоловічі по батькові та прізвища / на -іч",
5319
+ "examples": [
5320
+ "ілліч"
5321
+ ],
5322
+ "partOfSpeech": "noun",
5323
+ "gender": [
5324
+ "male"
5325
+ ],
5326
+ "priority": 2,
5327
+ "usage": [
5328
+ "middleName",
5329
+ "lastName"
5330
+ ],
5331
+ "pattern": {
5332
+ "find": "іч$",
5333
+ "modify": "(.{1})$"
5334
+ },
5335
+ "grammaticalCases": {
5336
+ "nominative": [],
5337
+ "genitive": [
5338
+ {
5339
+ "0": {
5340
+ "type": "append",
5341
+ "value": "а"
5342
+ }
5343
+ }
5344
+ ],
5345
+ "dative": [
5346
+ {
5347
+ "0": {
5348
+ "type": "append",
5349
+ "value": "у"
5350
+ }
5351
+ },
5352
+ {
5353
+ "0": {
5354
+ "type": "append",
5355
+ "value": "еві"
5356
+ }
5357
+ }
5358
+ ],
5359
+ "accusative": [
5360
+ {
5361
+ "0": {
5362
+ "type": "append",
5363
+ "value": "а"
5364
+ }
5365
+ }
5366
+ ],
5367
+ "ablative": [
5368
+ {
5369
+ "0": {
5370
+ "type": "append",
5371
+ "value": "ем"
5372
+ }
5373
+ }
5374
+ ],
5375
+ "locative": [
5376
+ {
5377
+ "0": {
5378
+ "type": "append",
5379
+ "value": "і"
5380
+ }
5381
+ },
5382
+ {
5383
+ "0": {
5384
+ "type": "append",
5385
+ "value": "у"
5386
+ }
5387
+ },
5388
+ {
5389
+ "0": {
5390
+ "type": "append",
5391
+ "value": "еві"
5392
+ }
5393
+ }
5394
+ ],
5395
+ "vocative": [
5396
+ {
5397
+ "0": {
5398
+ "type": "append",
5399
+ "value": "у"
5400
+ }
5401
+ }
5402
+ ]
5403
+ }
5404
+ },
5316
5405
  {
5317
5406
  "description": "жіночі по батькові / на -на",
5318
5407
  "examples": [