@vcmap/ui 6.0.0-rc.3 → 6.0.0-rc.6

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 (235) hide show
  1. package/build/buildHelpers.js +60 -11
  2. package/build/buildTypes.js +9 -5
  3. package/build/bundle.js +1 -1
  4. package/build/info/publish.js +25 -31
  5. package/build/lintTypes.js +5 -0
  6. package/config/base.config.json +2 -7
  7. package/config/dev.config.json +11 -1
  8. package/config/projects.config.json +2 -1
  9. package/config/theming.config.json +68 -0
  10. package/config/www.config.json +27 -23
  11. package/dist/assets/@mdi/font/css/{materialdesignicons.min-7a4f6be0.css → materialdesignicons.min-680621ca.css} +1 -1
  12. package/dist/assets/{cesium-cb4dbfba.js → cesium-ccb4cc30.js} +272 -385
  13. package/dist/assets/cesium.js +1 -1
  14. package/dist/assets/{core-72f21835.js → core-e06aa7a6.js} +2313 -2321
  15. package/dist/assets/core.js +1 -1
  16. package/dist/assets/{ol-2d33bc8b.js → ol-e7981d5c.js} +233 -329
  17. package/dist/assets/ol.js +1 -1
  18. package/dist/assets/ui-5dda32d2.css +1 -0
  19. package/dist/assets/{ui-2ab43a16.js → ui-5dda32d2.js} +11344 -11078
  20. package/dist/assets/ui.js +1 -1
  21. package/dist/assets/vue-87bc6efe.js +6083 -0
  22. package/dist/assets/vue.js +1 -1
  23. package/dist/assets/{vuetify-760ced3b.css → vuetify-4c4e4217.css} +2 -2
  24. package/dist/assets/{vuetify-760ced3b.js → vuetify-4c4e4217.js} +8063 -8262
  25. package/dist/assets/vuetify.js +1 -1
  26. package/index.d.ts +27 -17
  27. package/index.js +16 -8
  28. package/package.json +17 -17
  29. package/plugins/@vcmap-show-case/custom-icons-example/README.md +3 -0
  30. package/plugins/@vcmap-show-case/custom-icons-example/assets/imageExample.png +0 -0
  31. package/plugins/@vcmap-show-case/custom-icons-example/assets/svgExample.svg +1 -0
  32. package/plugins/@vcmap-show-case/custom-icons-example/package.json +5 -0
  33. package/plugins/@vcmap-show-case/custom-icons-example/src/CustomIconsExample.vue +90 -0
  34. package/plugins/@vcmap-show-case/custom-icons-example/src/index.js +45 -0
  35. package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +2 -3
  36. package/plugins/@vcmap-show-case/plugin-editors/src/PluginEditors.vue +11 -7
  37. package/plugins/@vcmap-show-case/project-selector/src/ModulesListComponent.vue +18 -11
  38. package/plugins/@vcmap-show-case/search-example/src/index.js +1 -0
  39. package/plugins/@vcmap-show-case/search-example/src/searchImpl.js +35 -5
  40. package/plugins/@vcmap-show-case/theming-example/README.md +3 -0
  41. package/plugins/@vcmap-show-case/theming-example/package.json +5 -0
  42. package/plugins/@vcmap-show-case/theming-example/src/ThemingExample.vue +116 -0
  43. package/plugins/@vcmap-show-case/theming-example/src/index.js +53 -0
  44. package/plugins/@vcmap-show-case/toolbox-example/src/index.js +2 -1
  45. package/plugins/package.json +7 -23
  46. package/public/assets/@mdi/font/css/materialdesignicons.min.css +1 -1
  47. package/src/actions/StyleSelector.vue +1 -1
  48. package/src/actions/actionHelper.d.ts +4 -11
  49. package/src/actions/actionHelper.js +15 -7
  50. package/src/actions/listActions.d.ts +5 -5
  51. package/src/actions/listActions.js +2 -2
  52. package/src/application/VcsApp.vue +113 -50
  53. package/src/application/VcsApp.vue.d.ts +301 -4
  54. package/src/application/VcsAttributionsFooter.vue.d.ts +1 -1
  55. package/src/application/VcsContainer.vue +27 -10
  56. package/src/application/VcsContainer.vue.d.ts +241 -0
  57. package/src/application/VcsMainMap.vue +7 -7
  58. package/src/application/VcsMainMap.vue.d.ts +2 -2
  59. package/src/application/VcsNavbar.vue +14 -2
  60. package/src/application/VcsNavbar.vue.d.ts +1 -0
  61. package/src/application/VcsSplashScreen.vue +33 -26
  62. package/src/application/VcsTextPageFooter.vue +2 -1
  63. package/src/application/attributionsHelper.d.ts +20 -22
  64. package/src/application/attributionsHelper.js +4 -4
  65. package/src/callback/vcsCallback.d.ts +2 -2
  66. package/src/callback/vcsCallback.js +1 -1
  67. package/src/components/buttons/VcsActionButtonList.vue +61 -6
  68. package/src/components/buttons/VcsActionButtonList.vue.d.ts +28 -0
  69. package/src/components/buttons/VcsButton.vue +2 -4
  70. package/src/components/buttons/VcsButton.vue.d.ts +1 -1
  71. package/src/components/buttons/VcsFormButton.vue +4 -4
  72. package/src/components/buttons/VcsToolButton.vue +4 -2
  73. package/src/components/buttons/VcsToolButton.vue.d.ts +2 -2
  74. package/src/components/composables.d.ts +5 -0
  75. package/src/components/composables.js +79 -9
  76. package/src/components/extent/VcsExtent.vue +10 -6
  77. package/src/components/extent/VcsExtent.vue.d.ts +1 -0
  78. package/src/components/flight/VcsFlightComponent.vue +13 -13
  79. package/src/components/flight/VcsFlightComponent.vue.d.ts +1 -0
  80. package/src/components/form-inputs-controls/VcsCheckbox.vue +8 -3
  81. package/src/components/form-inputs-controls/VcsChipArrayInput.vue +13 -16
  82. package/src/components/form-inputs-controls/VcsChipArrayInput.vue.d.ts +2 -4
  83. package/src/components/form-inputs-controls/VcsCoordinate.vue +4 -4
  84. package/src/components/form-inputs-controls/VcsFileInput.vue +1 -1
  85. package/src/components/form-inputs-controls/VcsLabel.vue +1 -1
  86. package/src/components/form-inputs-controls/VcsRadio.vue +8 -6
  87. package/src/components/form-inputs-controls/VcsRadio.vue.d.ts +1 -0
  88. package/src/components/form-inputs-controls/VcsSelect.vue +2 -5
  89. package/src/components/form-inputs-controls/VcsSlider.vue +5 -6
  90. package/src/components/form-inputs-controls/VcsSlider.vue.d.ts +2 -4
  91. package/src/components/form-inputs-controls/VcsTextArea.vue +2 -5
  92. package/src/components/form-inputs-controls/VcsTextField.vue +24 -1
  93. package/src/components/form-inputs-controls/VcsTextField.vue.d.ts +11 -1
  94. package/src/components/form-inputs-controls/VcsWizard.vue +3 -3
  95. package/src/components/form-inputs-controls/VcsWizardStep.vue +6 -5
  96. package/src/components/form-inputs-controls/vcsTextField.scss +8 -5
  97. package/src/components/form-output/VcsFormattedNumber.vue +7 -5
  98. package/src/components/form-output/VcsMarkdown.vue +15 -12
  99. package/src/components/form-output/VcsMarkdown.vue.d.ts +1 -0
  100. package/src/components/form-output/markdownHelper.d.ts +30 -0
  101. package/src/components/form-output/markdownHelper.js +398 -0
  102. package/src/components/import/VcsFileDrop.vue +8 -5
  103. package/src/components/import/VcsImportComponent.vue +8 -4
  104. package/src/components/import/VcsImportComponent.vue.d.ts +1 -2
  105. package/src/components/lists/VcsActionList.vue +6 -6
  106. package/src/components/lists/VcsList.vue +22 -37
  107. package/src/components/lists/VcsList.vue.d.ts +14 -55
  108. package/src/components/lists/{VcsListItem.vue → VcsListItemComponent.vue} +37 -11
  109. package/src/components/lists/VcsListItemComponent.vue.d.ts +79 -0
  110. package/src/components/lists/VcsTreeview.vue +95 -26
  111. package/src/components/lists/VcsTreeview.vue.d.ts +16 -3
  112. package/src/components/lists/VcsTreeviewSearchbar.vue +16 -5
  113. package/src/components/lists/VcsTreeviewSearchbar.vue.d.ts +3 -1
  114. package/src/components/lists/VcsTreeviewTitle.vue +36 -0
  115. package/src/components/modelHelper.d.ts +10 -8
  116. package/src/components/modelHelper.js +8 -6
  117. package/src/components/notification/VcsHelp.vue +6 -7
  118. package/src/components/notification/VcsHelp.vue.d.ts +0 -8
  119. package/src/components/plugins/AbstractConfigEditor.vue +1 -22
  120. package/src/components/plugins/AbstractConfigEditor.vue.d.ts +6 -29
  121. package/src/components/section/VcsExpansionPanel.vue +9 -3
  122. package/src/components/section/VcsExpansionPanel.vue.d.ts +2 -2
  123. package/src/components/section/VcsFormSection.vue +13 -7
  124. package/src/components/section/VcsFormSection.vue.d.ts +2 -3
  125. package/src/components/style/VcsImageSelector.vue +14 -6
  126. package/src/components/style/VcsImageSelector.vue.d.ts +1 -0
  127. package/src/components/style/VcsStrokeSelector.vue +5 -2
  128. package/src/components/style/VcsStrokeSelector.vue.d.ts +1 -0
  129. package/src/components/style/VcsTextMenu.vue +3 -3
  130. package/src/components/style/VcsVectorStyleComponent.vue +1 -1
  131. package/src/components/tables/VcsDataTable.vue +42 -32
  132. package/src/components/tables/VcsDataTable.vue.d.ts +1 -0
  133. package/src/components/tables/VcsTable.vue +45 -62
  134. package/src/components/tables/VcsTable.vue.d.ts +30 -17
  135. package/src/components/tables/VcsTableCell.vue +72 -0
  136. package/src/components/tables/VcsTableCell.vue.d.ts +13 -0
  137. package/src/components/vector-properties/VcsFeatureEditingWindow.vue +6 -5
  138. package/src/components/vector-properties/VcsFeatureTransforms.vue +5 -0
  139. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +42 -31
  140. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue.d.ts +1 -0
  141. package/src/components/viewpoint/VcsViewpointComponent.vue +14 -11
  142. package/src/components/viewpoint/VcsViewpointComponent.vue.d.ts +1 -0
  143. package/src/components/viewpoint/VcsViewpointEditor.vue +2 -2
  144. package/src/contentTree/LayerTree.vue +9 -27
  145. package/src/contentTree/LayerTree.vue.d.ts +1 -1
  146. package/src/contentTree/contentTreeCollection.d.ts +1 -0
  147. package/src/contentTree/contentTreeCollection.js +45 -11
  148. package/src/contentTree/contentTreeItem.d.ts +2 -2
  149. package/src/contentTree/contentTreeItem.js +1 -1
  150. package/src/featureInfo/BalloonComponent.vue +32 -25
  151. package/src/featureInfo/BalloonComponent.vue.d.ts +1 -0
  152. package/src/featureInfo/MarkdownBalloonComponent.vue +4 -2
  153. package/src/featureInfo/MarkdownBalloonComponent.vue.d.ts +2 -2
  154. package/src/featureInfo/abstractFeatureInfoView.d.ts +10 -4
  155. package/src/featureInfo/abstractFeatureInfoView.js +19 -11
  156. package/src/featureInfo/featureInfo.d.ts +7 -7
  157. package/src/featureInfo/featureInfo.js +51 -31
  158. package/src/featureInfo/iframeFeatureInfoView.d.ts +8 -2
  159. package/src/featureInfo/iframeFeatureInfoView.js +15 -5
  160. package/src/featureInfo/markdownBalloonFeatureInfoView.d.ts +1 -1
  161. package/src/featureInfo/markdownBalloonFeatureInfoView.js +5 -5
  162. package/src/featureInfo/markdownFeatureInfoView.d.ts +1 -1
  163. package/src/featureInfo/markdownFeatureInfoView.js +9 -11
  164. package/src/featureInfo/tableFeatureInfoView.js +13 -4
  165. package/src/i18n/i18nCollection.d.ts +9 -15
  166. package/src/i18n/i18nCollection.js +3 -3
  167. package/src/legend/VcsLegend.vue +6 -2
  168. package/src/legend/VcsLegend.vue.d.ts +1 -0
  169. package/src/manager/collectionManager/CollectionComponentList.vue +2 -2
  170. package/src/manager/collectionManager/CollectionComponentList.vue.d.ts +2 -2
  171. package/src/manager/collectionManager/categoryManager.d.ts +1 -1
  172. package/src/manager/collectionManager/collectionComponentClass.d.ts +3 -3
  173. package/src/manager/collectionManager/collectionComponentClass.js +6 -6
  174. package/src/manager/collectionManager/collectionManager.d.ts +1 -1
  175. package/src/manager/collectionManager/editorCollectionComponentClass.js +2 -1
  176. package/src/manager/panel/PanelComponent.vue +2 -9
  177. package/src/manager/panel/PanelManagerComponent.vue +7 -3
  178. package/src/manager/panel/panelHelper.js +3 -3
  179. package/src/manager/panel/panelManager.d.ts +9 -1
  180. package/src/manager/panel/panelManager.js +15 -3
  181. package/src/manager/toolbox/GroupToolboxComponent.vue +11 -5
  182. package/src/manager/toolbox/GroupToolboxComponent.vue.d.ts +1 -0
  183. package/src/manager/toolbox/SelectToolboxComponent.vue +11 -6
  184. package/src/manager/toolbox/SelectToolboxComponent.vue.d.ts +1 -0
  185. package/src/manager/toolbox/{ToolboxManager.vue → ToolboxManagerComponent.vue} +13 -7
  186. package/src/manager/toolbox/{ToolboxManager.vue.d.ts → ToolboxManagerComponent.vue.d.ts} +1 -0
  187. package/src/manager/window/WindowComponent.vue +12 -8
  188. package/src/manager/window/WindowComponentHeader.vue +33 -9
  189. package/src/manager/window/WindowComponentHeader.vue.d.ts +3 -0
  190. package/src/manager/window/WindowManager.vue +2 -2
  191. package/src/manager/window/windowManager.d.ts +6 -6
  192. package/src/manager/window/windowManager.js +3 -3
  193. package/src/navigation/MapNavigation.vue +20 -0
  194. package/src/navigation/OrientationToolsButton.vue +2 -4
  195. package/src/navigation/TiltSlider.vue +3 -5
  196. package/src/navigation/locatorHelper.js +1 -1
  197. package/src/navigation/overviewMap.js +1 -1
  198. package/src/notifier/NotifierComponent.vue +18 -15
  199. package/src/search/ResultItem.vue +18 -6
  200. package/src/search/ResultsComponent.vue +31 -20
  201. package/src/search/ResultsComponent.vue.d.ts +2 -1
  202. package/src/search/SearchComponent.vue +11 -15
  203. package/src/search/SearchComponent.vue.d.ts +1 -0
  204. package/src/siteConfig.js +8 -8
  205. package/src/styles/_typography.scss +0 -2
  206. package/src/styles/main.scss +0 -4
  207. package/src/styles/vcsList.scss +1 -1
  208. package/src/uiConfig.d.ts +311 -7
  209. package/src/uiConfig.js +30 -17
  210. package/src/vcsUiApp.d.ts +48 -63
  211. package/src/vcsUiApp.js +44 -37
  212. package/src/vuePlugins/vuetify.d.ts +88 -62
  213. package/src/vuePlugins/vuetify.js +119 -20
  214. package/dist/assets/ui-2ab43a16.css +0 -1
  215. package/dist/assets/vue-03b265aa.js +0 -6096
  216. package/plugins/@vcmap-show-case/theme-changer/README.md +0 -23
  217. package/plugins/@vcmap-show-case/theme-changer/config.json +0 -69
  218. package/plugins/@vcmap-show-case/theme-changer/package.json +0 -11
  219. package/plugins/@vcmap-show-case/theme-changer/src/ThemeChangerComponent.vue +0 -120
  220. package/plugins/@vcmap-show-case/theme-changer/src/index.js +0 -108
  221. package/src/application/markdownHelper.d.ts +0 -12
  222. package/src/application/markdownHelper.js +0 -70
  223. package/src/components/lists/VcsListItem.vue.d.ts +0 -27
  224. package/src/components/lists/VcsTreeviewLeaf.vue +0 -83
  225. package/src/components/notification/VcsTooltip.vue +0 -156
  226. package/src/components/notification/VcsTooltip.vue.d.ts +0 -27
  227. package/src/featureInfo/MarkdownComponent.vue +0 -16
  228. package/src/featureInfo/MarkdownComponent.vue.d.ts +0 -7
  229. package/src/styles/_theming.scss +0 -73
  230. package/src/styles/settings.scss +0 -6
  231. package/src/styles/shades.scss +0 -4
  232. package/src/styles/variables.scss +0 -140
  233. package/src/styles/vcsFont.scss +0 -2
  234. package/src/styles/vcsGrid.scss +0 -3
  235. /package/src/components/lists/{VcsTreeviewLeaf.vue.d.ts → VcsTreeviewTitle.vue.d.ts} +0 -0
@@ -1,23 +0,0 @@
1
- # VC Map Plugin Theme Changer
2
-
3
- This is a plugin to manage themes of the VC Map.
4
- This plugin provides 4 themes:
5
-
6
- - VCS Theme (defined by `@vcmap/ui`)
7
- - Theme 1
8
- - Theme 2
9
- - Theme 3
10
-
11
- Per config custom themes can be added.
12
-
13
- ## configuration
14
-
15
- You can override the themes array by defining your own themes. A theme must provide:
16
-
17
- ### VcMapTheme
18
-
19
- | Property | Type | Description |
20
- | -------- | ------------ | ---------------------- |
21
- | name | string | name of the theme |
22
- | dark | VuetifyTheme | dark theme definition |
23
- | light | VuetifyTheme | light theme definition |
@@ -1,69 +0,0 @@
1
- {
2
- "name": "@vcmap-show-case/theme-changer",
3
- "entry": "plugins/@vcmap-show-case/theme-changer/index.js",
4
- "themes": [
5
- {
6
- "name": "Theme 1",
7
- "dark": {
8
- "primary": "#21CFF3",
9
- "accent": "#FF4081",
10
- "secondary": "#21dc79",
11
- "success": "#86af3f",
12
- "info": "#f34fc6",
13
- "warning": "#FB8C00",
14
- "error": "#FF5252"
15
- },
16
- "light": {
17
- "primary": "#22daff",
18
- "accent": "#ff6b99",
19
- "secondary": "#26ff8c",
20
- "success": "#a5d64c",
21
- "info": "#ff53d0",
22
- "warning": "#ff8e00",
23
- "error": "#ff5252"
24
- }
25
- },
26
- {
27
- "name": "Theme 2",
28
- "dark": {
29
- "primary": "#E65100",
30
- "accent": "#7CB342",
31
- "secondary": "#689F38",
32
- "success": "#4CAF50",
33
- "info": "#6156d8",
34
- "warning": "#1565C0",
35
- "error": "#FF7043"
36
- },
37
- "light": {
38
- "primary": "#ffa450",
39
- "accent": "#a1e754",
40
- "secondary": "#92de4e",
41
- "success": "#6dff74",
42
- "info": "#7365ff",
43
- "warning": "#2e8ac0",
44
- "error": "#ff5e3c"
45
- }
46
- },
47
- {
48
- "name": "Theme 3",
49
- "dark": {
50
- "primary": "#33691E",
51
- "accent": "#FFCA28",
52
- "secondary": "#607D8B",
53
- "success": "#FFEB3B",
54
- "info": "#2196F3",
55
- "warning": "#9C27B0",
56
- "error": "#B71C1C"
57
- },
58
- "light": {
59
- "primary": "#6ae240",
60
- "accent": "#ffe063",
61
- "secondary": "#7ea4b6",
62
- "success": "#ffea70",
63
- "info": "#229eff",
64
- "warning": "#e239ff",
65
- "error": "#e82424"
66
- }
67
- }
68
- ]
69
- }
@@ -1,11 +0,0 @@
1
- {
2
- "name": "@vcmap-show-case/theme-changer",
3
- "version": "1.0.0",
4
- "mapVersion": "^5.0.0",
5
- "dependencies": {
6
- "@vcsuite/check": "^1.1.2"
7
- },
8
- "peerDependencies": {
9
- "@vcmap/ui": "^5.0.0-rc.2"
10
- }
11
- }
@@ -1,120 +0,0 @@
1
- <template>
2
- <v-card>
3
- <v-list-item>
4
- <v-list-item-content>
5
- <v-list-item-title class="font-weight-bold">
6
- Dark Mode
7
- </v-list-item-title>
8
- </v-list-item-content>
9
- <v-list-item-action>
10
- <v-switch v-model="$vuetify.theme.dark" />
11
- </v-list-item-action>
12
- </v-list-item>
13
- <v-divider />
14
- <v-card-text>
15
- <v-card
16
- class="my-2"
17
- :disabled="state.selected.value === theme.name"
18
- @click="setTheme(theme)"
19
- hover
20
- outlined
21
- v-for="(theme, index) in config.themes.value"
22
- :key="index"
23
- >
24
- <v-list-item>
25
- <v-list-item-content>
26
- <v-list-item-title class="font-weight-bold">
27
- {{ theme.name }}
28
- </v-list-item-title>
29
- </v-list-item-content>
30
- <v-list-item-action>
31
- <v-avatar
32
- color="success"
33
- size="30"
34
- v-if="state.selected.value === theme.name"
35
- >
36
- <v-icon>mdi-check</v-icon>
37
- </v-avatar>
38
- </v-list-item-action>
39
- </v-list-item>
40
- <v-card class="my-1 ma-1 py-1 white">
41
- <h2>light</h2>
42
- <v-chip
43
- class="mx-1"
44
- label
45
- :color="theme.light[key]?.base || theme.light[key]"
46
- v-for="(key, lightIdx) in Object.keys(theme.light)"
47
- :key="lightIdx"
48
- >
49
- {{ key }}
50
- </v-chip>
51
- </v-card>
52
- <v-card class="my-1 ma-1 py-1 black">
53
- <h2 class="white--text">dark</h2>
54
- <v-chip
55
- class="mx-1"
56
- label
57
- :color="theme.dark[key]?.base || theme.dark[key]"
58
- v-for="(key, darkIdx) in Object.keys(theme.dark)"
59
- :key="darkIdx"
60
- >
61
- {{ key }}
62
- </v-chip>
63
- </v-card>
64
- </v-card>
65
- </v-card-text>
66
- </v-card>
67
- </template>
68
- <script>
69
- import { inject } from 'vue';
70
- import {
71
- VCard,
72
- VCardText,
73
- VChip,
74
- VListItem,
75
- // VListItemContent,
76
- VListItemTitle,
77
- VListItemAction,
78
- VAvatar,
79
- VIcon,
80
- VDivider,
81
- VSwitch,
82
- } from 'vuetify/components';
83
-
84
- export default {
85
- name: 'ThemeChanger',
86
- components: {
87
- VCard,
88
- VCardText,
89
- VChip,
90
- VListItem,
91
- // VListItemContent,
92
- VListItemTitle,
93
- VListItemAction,
94
- VAvatar,
95
- VIcon,
96
- VDivider,
97
- VSwitch,
98
- },
99
- setup() {
100
- const app = inject('vcsApp');
101
- const plugin = app.plugins.getByKey('@vcmap-show-case/theme-changer');
102
-
103
- function setTheme(theme) {
104
- const { name, dark, light } = theme;
105
- Object.keys(dark).forEach((i) => {
106
- this.$vuetify.theme.themes.dark[i] = dark[i];
107
- });
108
- Object.keys(light).forEach((i) => {
109
- this.$vuetify.theme.themes.light[i] = light[i];
110
- });
111
- plugin.state.selected.value = name;
112
- }
113
- return {
114
- state: plugin.state,
115
- config: plugin.config,
116
- setTheme,
117
- };
118
- },
119
- };
120
- </script>
@@ -1,108 +0,0 @@
1
- import { ref } from 'vue';
2
- import { check } from '@vcsuite/check';
3
- import { ButtonLocation, createToggleAction, createVcsThemes } from '@vcmap/ui';
4
- import ThemeChangerComponent from './ThemeChangerComponent.vue';
5
- import packageJSON from '../package.json';
6
- import defaultConfig from '../config.json';
7
-
8
- /**
9
- * @typedef {Object} VuetifyTheme
10
- * @property {string} primary
11
- * @property {string} secondary
12
- * @property {string} accent
13
- * @property {string} error
14
- * @property {string} info
15
- * @property {string} success
16
- * @property {string} warning
17
- */
18
-
19
- /**
20
- * @typedef {Object} VcMapTheme
21
- * @property {string} name
22
- * @property {VuetifyTheme} light
23
- * @property {VuetifyTheme} dark
24
- */
25
-
26
- /**
27
- * @param {Object} config
28
- * @returns {VcsPlugin}
29
- */
30
- export default async function themeChanger(config) {
31
- /** @type {VcMapTheme} */
32
- const vcsTheme = {
33
- name: 'VCS Theme',
34
- ...createVcsThemes(),
35
- };
36
- const customThemes = config.themes || defaultConfig.themes;
37
- const availableThemes = [vcsTheme, ...customThemes];
38
-
39
- const pluginConfig = {
40
- themes: ref(/** @type {Array<VcMapTheme>} */ []),
41
- };
42
-
43
- const pluginState = {
44
- selected: ref(vcsTheme.name),
45
- };
46
-
47
- /**
48
- * @param {VcMapTheme} theme
49
- */
50
- function addTheme(theme) {
51
- check(theme.name, String);
52
- check(theme.light, Object);
53
- check(theme.dark, Object);
54
- pluginConfig.themes.value.push(theme);
55
- }
56
- availableThemes.forEach((t) => addTheme(t));
57
-
58
- return {
59
- get name() {
60
- return packageJSON.name;
61
- },
62
- get version() {
63
- return packageJSON.version;
64
- },
65
- get mapVersion() {
66
- return packageJSON.mapVersion;
67
- },
68
- config: pluginConfig,
69
- state: pluginState,
70
- addTheme,
71
- onVcsAppMounted(app) {
72
- const { action, destroy } = createToggleAction(
73
- {
74
- name: 'Theme Changer',
75
- icon: 'mdi-palette',
76
- },
77
- {
78
- id: 'theme-changer',
79
- component: ThemeChangerComponent,
80
- position: {
81
- left: '60%',
82
- right: '0%',
83
- top: '5%',
84
- bottom: '50%',
85
- },
86
- state: {
87
- headerTitle: 'Theme Changer',
88
- headerIcon: 'mdi-palette',
89
- },
90
- },
91
- app.windowManager,
92
- packageJSON.name,
93
- );
94
- app.navbarManager.add(
95
- { id: 'theme-changer', action },
96
- packageJSON.name,
97
- ButtonLocation.MENU,
98
- );
99
- this._destroyAction = destroy;
100
- },
101
- destroy() {
102
- if (this._destroyAction) {
103
- this._destroyAction();
104
- this._destroyAction = null;
105
- }
106
- },
107
- };
108
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * @param {string} content
3
- * @returns {string}
4
- */
5
- export function parseAndSanitizeMarkdown(content: string): string;
6
- /**
7
- * Replaces template strings by provided attributes, e.g. {{myAttribute}}
8
- * @param {string|string[]} template
9
- * @param {Record<string, unknown>} attributes
10
- * @returns {string}
11
- */
12
- export function replaceAttributes(template: string | string[], attributes: Record<string, unknown>): string;
@@ -1,70 +0,0 @@
1
- import { marked } from 'marked';
2
- import DOMPurify from 'dompurify';
3
-
4
- /**
5
- * @param {string} content
6
- * @returns {string}
7
- */
8
- export function parseAndSanitizeMarkdown(content) {
9
- const html = marked.parse(content, { breaks: true });
10
-
11
- // Then sanitize the HTML using DOMPurify
12
- return DOMPurify.sanitize(html, { ADD_ATTR: ['target'] });
13
- }
14
-
15
- /**
16
- * @param {Record<string, unknown>} parent
17
- * @param {(string|number)[]} keys
18
- * @returns {undefined|T}
19
- * @template {*} T
20
- */
21
- function findRecursive(parent, keys) {
22
- if (keys.length === 1) {
23
- return parent[keys[0]];
24
- } else {
25
- const nextKey = keys.shift();
26
- const nextParent = parent[nextKey];
27
- if (nextParent) {
28
- return findRecursive(nextParent, keys);
29
- }
30
- }
31
- return undefined;
32
- }
33
-
34
- /**
35
- * Replaces template strings by provided attributes, e.g. {{myAttribute}}
36
- * @param {string|string[]} template
37
- * @param {Record<string, unknown>} attributes
38
- * @returns {string}
39
- */
40
- export function replaceAttributes(template, attributes) {
41
- const templateString = Array.isArray(template)
42
- ? template.join('\n')
43
- : template;
44
- return templateString.replace(/\{\{([^}]+)}}/g, (p, value) => {
45
- const keys = value.trim().split('.');
46
-
47
- for (let i = 0; i < keys.length; i++) {
48
- let key = keys[i];
49
- if (typeof key === 'string') {
50
- const indices = [];
51
- let arrayIndex = /\[["']?([^\]]+)["']?]$/.exec(key);
52
- while (arrayIndex != null) {
53
- let bracketKey = arrayIndex[1];
54
- if (/^\d+$/.test(bracketKey)) {
55
- bracketKey = Number(bracketKey);
56
- }
57
- indices.push(bracketKey);
58
- key = key.substring(0, arrayIndex.index);
59
- arrayIndex = /\[["']?([^\]]+)["']?]$/.exec(key);
60
- }
61
-
62
- if (indices.length > 0) {
63
- keys.splice(i, 1, key, ...indices);
64
- }
65
- }
66
- }
67
-
68
- return findRecursive(attributes, keys) ?? '';
69
- });
70
- }
@@ -1,27 +0,0 @@
1
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {
2
- $props: {
3
- readonly [x: string]: any;
4
- };
5
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
6
- title?(_: {
7
- item: any;
8
- dragging: any;
9
- tooltip: string;
10
- }): any;
11
- subtitle?(_: {
12
- item: any;
13
- }): any;
14
- default?(_: {
15
- item: any;
16
- dragging: any;
17
- tooltip: string;
18
- isActive: boolean;
19
- isSelected: boolean;
20
- isIndeterminate: boolean;
21
- select: (value: boolean) => void;
22
- }): any;
23
- }>;
24
- export default _default;
25
- type __VLS_WithTemplateSlots<T, S> = T & (new () => {
26
- $slots: S;
27
- });
@@ -1,83 +0,0 @@
1
- <script setup>
2
- import { computed, onUnmounted, ref, watch } from 'vue';
3
- import { VIcon, VTooltip } from 'vuetify/components';
4
- import { VTreeviewItem } from 'vuetify/labs/VTreeview';
5
- import VcsActionButtonList from '../buttons/VcsActionButtonList.vue';
6
- import ImageElementInjector from '../ImageElementInjector.vue';
7
-
8
- const props = defineProps({
9
- item: {
10
- type: Object,
11
- default: undefined,
12
- },
13
- });
14
-
15
- const isStringIcon = computed(() => typeof props.item?.icon === 'string');
16
- const parentElement = ref();
17
- const titleElem = ref();
18
- const offsetWidth = ref(0);
19
- const scrollWidth = ref(0);
20
-
21
- const observer = new ResizeObserver(() => {
22
- offsetWidth.value = titleElem.value.offsetWidth;
23
- scrollWidth.value = titleElem.value.scrollWidth;
24
- });
25
-
26
- watch(
27
- parentElement,
28
- (newValue, oldValue) => {
29
- if (oldValue) {
30
- observer.unobserve(oldValue.$el);
31
- }
32
- if (newValue) {
33
- observer.observe(newValue.$el);
34
- }
35
- },
36
- { immediate: true },
37
- );
38
-
39
- const tooltip = computed(() => {
40
- // tooltipIteration.value -= 1;
41
- if (props.item?.tooltip) {
42
- return props.item.tooltip;
43
- }
44
- if (offsetWidth.value < scrollWidth.value) {
45
- return props.item?.title ?? '';
46
- }
47
- return '';
48
- });
49
-
50
- onUnmounted(() => {
51
- observer.disconnect();
52
- });
53
- </script>
54
-
55
- <template>
56
- <v-treeview-item v-if="item" ref="parentElement">
57
- <template #prepend v-if="item.icon">
58
- <v-icon v-if="isStringIcon" :size="16" class="mr-1">
59
- {{ item.icon }}
60
- </v-icon>
61
- <ImageElementInjector :element="item.icon" v-else />
62
- </template>
63
- <div class="text-truncate" ref="titleElem">
64
- {{ $st(item.title || item.name) }}
65
- </div>
66
- <v-tooltip
67
- activator="parent"
68
- v-if="tooltip"
69
- :text="$st(tooltip)"
70
- location="bottom"
71
- />
72
- <template #append>
73
- <VcsActionButtonList
74
- v-if="item.actions?.length > 0"
75
- :actions="item.actions"
76
- :overflow-count="3"
77
- :disabled="item.disabled"
78
- right
79
- class="col-4 pa-0 d-flex align-center"
80
- />
81
- </template>
82
- </v-treeview-item>
83
- </template>
@@ -1,156 +0,0 @@
1
- <template>
2
- <v-tooltip
3
- :disabled="!tooltip"
4
- :content-class="`tooltip ${arrowClass}`"
5
- transition="expand-x-transition"
6
- v-bind="{ ...$props, ...$attrs }"
7
- >
8
- <template #activator="{ props }">
9
- <slot name="activator" v-bind="props" />
10
- </template>
11
- <span v-if="tooltip">{{ $st(tooltip) }}</span>
12
- </v-tooltip>
13
- </template>
14
- <style lang="scss" scoped>
15
- //.v-tooltip__content.tooltip {
16
- // border: 1px solid black;
17
- // border-radius: 0;
18
- // background-color: #222222;
19
- //
20
- //&.arrow-top {
21
- // transform: translateY(-6px);
22
- //
23
- //&::after, &::before {
24
- // bottom: 100%;
25
- // left: 50%;
26
- // border: solid transparent;
27
- // content: "";
28
- // height: 0;
29
- // width: 0;
30
- // position: absolute;
31
- // pointer-events: none;
32
- // }
33
- //
34
- //&::before {
35
- // border-color: rgba(194, 225, 245, 0);
36
- // border-bottom-color: black;
37
- // border-width: 5px;
38
- // margin-left: -5px;
39
- // }
40
- //}
41
- //
42
- //&.arrow-bottom {
43
- // transform: translateY(6px);
44
- //
45
- //&::after, &::before {
46
- // top: 100%;
47
- // left: 50%;
48
- // border: solid transparent;
49
- // content: "";
50
- // height: 0;
51
- // width: 0;
52
- // position: absolute;
53
- // pointer-events: none;
54
- // }
55
- //
56
- //&::before {
57
- // border-color: rgba(194, 225, 245, 0);
58
- // border-top-color: black;
59
- // border-width: 5px;
60
- // margin-left: -5px;
61
- // }
62
- //}
63
- //
64
- //&.arrow-right {
65
- //&::after, &::before {
66
- // top: 50%;
67
- // right: -11px;
68
- // transform: translateY(-50%);
69
- // border: solid transparent;
70
- // content: "";
71
- // height: 0;
72
- // width: 0;
73
- // position: absolute;
74
- // pointer-events: none;
75
- // }
76
- //
77
- //&::before {
78
- // border-color: rgba(255, 0, 0, 0);
79
- // border-left-color: black;
80
- // border-width: 5px;
81
- // margin-left: -5px;
82
- // }
83
- //}
84
- //
85
- //&.arrow-left {
86
- //
87
- //&::after, &::before {
88
- // top: 50%;
89
- // left: -11px;
90
- // transform: translateY(-50%);
91
- // border: solid transparent;
92
- // content: "";
93
- // height: 0;
94
- // width: 0;
95
- // position: absolute;
96
- // pointer-events: none;
97
- // }
98
- //
99
- //&::before {
100
- // border-color: rgba(194, 225, 245, 0);
101
- // border-right-color: black;
102
- // border-width: 5px;
103
- // }
104
- //}
105
- //}
106
- </style>
107
- <script>
108
- import { VTooltip } from 'vuetify/components';
109
-
110
- /**
111
- * @enum {string} TooltipPositions
112
- * @property {string} bottom
113
- * @property {string} left
114
- * @property {string} top
115
- * @property {string} right
116
- * @readonly
117
- * @module VcsTooltip
118
- */
119
- const TooltipPositions = {
120
- bottom: 'arrow-top',
121
- top: 'arrow-bottom',
122
- left: 'arrow-right',
123
- right: 'arrow-left',
124
- };
125
-
126
- /**
127
- * @description tooltip extending {@link https://vuetifyjs.com/en/api/v-tooltip/|vuetify v-tooltip}.
128
- * @vue-prop {string} tooltip - Text content of a tooltip which appears on hover with default delay. This should be an i18n key.
129
- * @vue-prop {string} [tooltipPosition='bottom'] - Position of the tooltip (allowed values: 'bottom'|'left'|'top'|'right').
130
- * @vue-computed {string} arrowClass - direction of tooltip arrow
131
- */
132
- export default {
133
- name: 'VcsTooltip',
134
- components: {
135
- VTooltip,
136
- },
137
- props: {
138
- tooltip: {
139
- type: String,
140
- default: undefined,
141
- },
142
- tooltipPosition: {
143
- type: String,
144
- default: 'bottom',
145
- validator(value) {
146
- return Object.keys(TooltipPositions).includes(value);
147
- },
148
- },
149
- },
150
- computed: {
151
- arrowClass() {
152
- return TooltipPositions[this.tooltipPosition];
153
- },
154
- },
155
- };
156
- </script>