@fmidev/smartmet-alert-client 4.7.0-alpha.0 → 4.7.0-beta.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 (111) hide show
  1. package/AGENTS.md +26 -0
  2. package/dist/index.html +2 -2
  3. package/dist/index.js +183 -236
  4. package/dist/index.mjs +184 -237
  5. package/dist/locale-en-DCEKDw5G.js +1 -1
  6. package/dist/locale-fi-XDTFwO-_.js +8 -0
  7. package/dist/locale-sv-B0FlbgEF.js +1 -1
  8. package/dist/vendor-DlLAhxdV.js +21 -0
  9. package/dist/vue/AlertClientVue.vue.d.ts +112 -0
  10. package/dist/vue/index.mjs +14373 -14503
  11. package/dist/vue/style.css +1 -1
  12. package/dist/vue/vue.d.ts +3 -0
  13. package/dist/xml-parser-BiNO9kc-.js +1 -1
  14. package/index.html +1 -1
  15. package/package.json +32 -9
  16. package/src/AlertClientVue.vue +126 -136
  17. package/src/App.vue +138 -130
  18. package/src/assets/img/ui/ext-link.svg +7 -0
  19. package/src/components/AlertClient.vue +348 -291
  20. package/src/components/CollapsiblePanel.vue +25 -28
  21. package/src/components/DayLarge.vue +153 -122
  22. package/src/components/DaySmall.vue +101 -95
  23. package/src/components/Days.vue +190 -145
  24. package/src/components/DescriptionWarning.vue +91 -54
  25. package/src/components/GrayScaleToggle.vue +56 -57
  26. package/src/components/Legend.vue +102 -113
  27. package/src/components/MapLarge.vue +541 -317
  28. package/src/components/MapSmall.vue +150 -151
  29. package/src/components/PopupRow.vue +27 -18
  30. package/src/components/Region.vue +140 -105
  31. package/src/components/RegionWarning.vue +42 -36
  32. package/src/components/Regions.vue +196 -143
  33. package/src/components/Warning.vue +67 -50
  34. package/src/components/Warnings.vue +146 -97
  35. package/src/composables/useAlertClient.ts +360 -0
  36. package/src/composables/useConfig.ts +573 -0
  37. package/src/composables/useFields.ts +66 -0
  38. package/src/composables/useI18n.ts +62 -0
  39. package/src/composables/useKeyCodes.ts +16 -0
  40. package/src/composables/useMapPaths.ts +477 -0
  41. package/src/composables/useUtils.ts +683 -0
  42. package/src/composables/useWarningsProcessor.ts +1007 -0
  43. package/src/data/geometries.json +993 -0
  44. package/src/locales/fi.json +1 -1
  45. package/src/mixins/geojsonsvg.d.ts +57 -0
  46. package/src/mixins/geojsonsvg.js +5 -3
  47. package/src/plugins/index.ts +5 -0
  48. package/src/scss/colors.scss +1 -0
  49. package/src/scss/themes/dark-gray.scss +1 -0
  50. package/src/scss/themes/dark.scss +1 -0
  51. package/src/scss/themes/light-gray.scss +1 -0
  52. package/src/scss/themes/light.scss +1 -0
  53. package/src/types/index.ts +509 -0
  54. package/src/vite-env.d.ts +23 -0
  55. package/tests/fixtures/{mockWarningData.js → mockWarningData.ts} +29 -12
  56. package/tests/integration/{warning-flow.spec.js → warning-flow.spec.ts} +124 -131
  57. package/tests/{setup.js → setup.ts} +5 -5
  58. package/tests/unit/components/{AlertClient.spec.js → AlertClient.spec.ts} +151 -184
  59. package/tests/unit/components/DayLarge.spec.ts +348 -0
  60. package/tests/unit/components/DaySmall.spec.ts +352 -0
  61. package/tests/unit/components/{Days.spec.js → Days.spec.ts} +88 -105
  62. package/tests/unit/components/DescriptionWarning.spec.ts +385 -0
  63. package/tests/unit/components/{GrayScaleToggle.spec.js → GrayScaleToggle.spec.ts} +64 -57
  64. package/tests/unit/components/Legend.spec.ts +295 -0
  65. package/tests/unit/components/MapLarge.spec.ts +448 -0
  66. package/tests/unit/components/MapSmall.spec.ts +367 -0
  67. package/tests/unit/components/{PopupRow.spec.js → PopupRow.spec.ts} +21 -12
  68. package/tests/unit/components/Region.spec.ts +373 -0
  69. package/tests/unit/components/RegionWarning.snapshot.spec.ts +361 -0
  70. package/tests/unit/components/RegionWarning.spec.ts +381 -0
  71. package/tests/unit/components/Regions.spec.ts +503 -0
  72. package/tests/unit/components/Warning.snapshot.spec.ts +483 -0
  73. package/tests/unit/components/{Warning.spec.js → Warning.spec.ts} +110 -93
  74. package/tests/unit/components/{Warnings.spec.js → Warnings.spec.ts} +77 -63
  75. package/tests/unit/components/__snapshots__/RegionWarning.snapshot.spec.ts.snap +41 -0
  76. package/tests/unit/components/__snapshots__/Warning.snapshot.spec.ts.snap +433 -0
  77. package/tests/unit/{mixins/config.spec.js → composables/useConfig.spec.ts} +69 -59
  78. package/tests/unit/composables/useI18n.spec.ts +116 -0
  79. package/tests/unit/composables/useKeyCodes.spec.ts +27 -0
  80. package/tests/unit/composables/useUtils.spec.ts +213 -0
  81. package/tsconfig.json +43 -0
  82. package/tsconfig.node.json +11 -0
  83. package/vite.config.js +11 -4
  84. package/vitest.config.js +1 -1
  85. package/dist/locale-fi-DPiOM1rB.js +0 -8
  86. package/dist/vendor-Cfkkvdz7.js +0 -21
  87. package/src/mixins/alertClientCore.js +0 -210
  88. package/src/mixins/config.js +0 -1384
  89. package/src/mixins/fields.js +0 -26
  90. package/src/mixins/i18n.js +0 -25
  91. package/src/mixins/keycodes.js +0 -10
  92. package/src/mixins/utils.js +0 -914
  93. package/src/plugins/index.js +0 -3
  94. package/tests/unit/components/DayLarge.spec.js +0 -281
  95. package/tests/unit/components/DaySmall.spec.js +0 -278
  96. package/tests/unit/components/DescriptionWarning.spec.js +0 -432
  97. package/tests/unit/components/Legend.spec.js +0 -223
  98. package/tests/unit/components/MapLarge.spec.js +0 -276
  99. package/tests/unit/components/MapSmall.spec.js +0 -226
  100. package/tests/unit/components/Region.spec.js +0 -430
  101. package/tests/unit/components/RegionWarning.snapshot.spec.js +0 -73
  102. package/tests/unit/components/RegionWarning.spec.js +0 -408
  103. package/tests/unit/components/Regions.spec.js +0 -335
  104. package/tests/unit/components/Warning.snapshot.spec.js +0 -107
  105. package/tests/unit/components/__snapshots__/RegionWarning.snapshot.spec.js.snap +0 -21
  106. package/tests/unit/components/__snapshots__/Warning.snapshot.spec.js.snap +0 -199
  107. package/tests/unit/mixins/i18n.spec.js +0 -115
  108. package/tests/unit/mixins/keycodes.spec.js +0 -37
  109. package/tests/unit/mixins/utils.spec.js +0 -624
  110. /package/src/{main.js → main.ts} +0 -0
  111. /package/src/{vue.js → vue.ts} +0 -0
package/AGENTS.md ADDED
@@ -0,0 +1,26 @@
1
+ # Agent Guidelines for SmartMet Alert Client
2
+
3
+ ## Build & Test Commands
4
+
5
+ - `npm run dev` - Start dev server with hot reload
6
+ - `npm run build` - Production build
7
+ - `npm run lint` - Lint .js and .vue files
8
+ - `npm run lint:fix` - Auto-fix linting issues
9
+ - `npm test` - Run tests in watch mode
10
+ - `npm run test:run` - Run all tests once (CI/CD)
11
+ - `vitest path/to/file.spec.js` - Run single test file
12
+
13
+ ## Code Style
14
+
15
+ - **Formatting**: Prettier with single quotes, no semicolons, bracket spacing, arrowParens always
16
+ - **Imports**: Use `@/` alias for src imports (e.g., `import AlertClient from '@/components/AlertClient.vue'`)
17
+ - **Vue**: Vue 3 composition API, relaxed rules (self-closing, multi-word names, v-html allowed)
18
+ - **ESLint**: Standard + Vue3-recommended + SonarJS (cognitive complexity/duplicate strings disabled)
19
+ - **Naming**: camelCase for variables/functions, PascalCase for components
20
+
21
+ ## Architecture
22
+
23
+ - Vue 3 web components with custom elements
24
+ - Mixins for shared logic (config, utils, i18n, geojsonsvg, fields, keycodes)
25
+ - ES2020 modules, SCSS with modern compiler
26
+ - Vitest + @vue/test-utils + jsdom for testing
package/dist/index.html CHANGED
@@ -7,10 +7,10 @@
7
7
  content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
8
8
  <title>SmartMet Alert Client</title>
9
9
  <script type="module" crossorigin src="./index.mjs"></script>
10
- <link rel="modulepreload" crossorigin href="./vendor-Cfkkvdz7.js">
10
+ <link rel="modulepreload" crossorigin href="./vendor-DlLAhxdV.js">
11
11
  <link rel="modulepreload" crossorigin href="./xml-parser-BiNO9kc-.js">
12
12
  <link rel="modulepreload" crossorigin href="./locale-en-DCEKDw5G.js">
13
- <link rel="modulepreload" crossorigin href="./locale-fi-DPiOM1rB.js">
13
+ <link rel="modulepreload" crossorigin href="./locale-fi-XDTFwO-_.js">
14
14
  <link rel="modulepreload" crossorigin href="./locale-sv-B0FlbgEF.js">
15
15
  </head>
16
16