geonetwork-ui 2.2.0-dev.2446b017 → 2.2.0-dev.266c9755
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/esm2022/libs/api/metadata-converter/src/lib/gn4/atomic-operations.mjs +2 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +36 -2
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.mjs +2 -1
- package/esm2022/libs/api/repository/src/lib/gn4/index.mjs +3 -1
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/feature/catalog/src/lib/organisations/organisations.component.mjs +4 -15
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +5 -4
- package/esm2022/libs/feature/editor/src/lib/record-form/record-form.component.mjs +5 -3
- package/esm2022/libs/feature/map/src/index.mjs +2 -1
- package/esm2022/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.mjs +1 -1
- package/esm2022/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.mjs +106 -0
- package/esm2022/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.mjs +64 -0
- package/esm2022/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.mjs +63 -0
- package/esm2022/libs/feature/map/src/lib/constant/index.mjs +2 -1
- package/esm2022/libs/feature/map/src/lib/constant/projections.mjs +2 -0
- package/esm2022/libs/feature/map/src/lib/feature-map.module.mjs +26 -3
- package/esm2022/libs/feature/map/src/lib/geocoding/geocoding.component.mjs +93 -0
- package/esm2022/libs/feature/map/src/lib/geocoding.service.mjs +40 -0
- package/esm2022/libs/feature/map/src/lib/layers-panel/layers-panel.component.mjs +6 -3
- package/esm2022/libs/feature/map/src/lib/map-context/map-context.service.mjs +3 -1
- package/esm2022/libs/feature/map/src/lib/utils/index.mjs +1 -3
- package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +60 -29
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +29 -20
- package/esm2022/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.mjs +7 -4
- package/esm2022/libs/feature/search/src/lib/results-list/results-list.container.component.mjs +1 -1
- package/esm2022/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.mjs +4 -4
- package/esm2022/libs/ui/catalog/src/lib/organisation-preview/organisation-preview.component.mjs +1 -1
- package/esm2022/libs/ui/elements/src/index.mjs +4 -1
- package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.mjs +27 -0
- package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +17 -0
- package/esm2022/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +12 -6
- package/esm2022/libs/ui/elements/src/lib/related-record-card/related-record-card.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/thumbnail/thumbnail.component.mjs +7 -3
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +15 -3
- package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +2 -2
- package/esm2022/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.mjs +6 -3
- package/esm2022/libs/ui/inputs/src/lib/editable-label/editable-label.directive.mjs +46 -0
- package/esm2022/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.mjs +2 -2
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +8 -3
- package/esm2022/libs/ui/layout/src/lib/carousel/carousel.component.mjs +2 -2
- package/esm2022/libs/ui/search/src/lib/record-preview-card/record-preview-card.component.mjs +1 -1
- package/esm2022/libs/ui/search/src/lib/record-preview-feed/record-preview-feed.component.mjs +1 -1
- package/esm2022/libs/ui/search/src/lib/record-preview-list/record-preview-list.component.mjs +1 -1
- package/esm2022/libs/ui/search/src/lib/record-preview-row/record-preview-row.component.mjs +1 -1
- package/esm2022/libs/ui/search/src/lib/record-preview-title/record-preview-title.component.mjs +1 -1
- package/esm2022/libs/ui/search/src/lib/record-table/record-table.component.mjs +3 -3
- package/esm2022/libs/util/i18n/src/index.mjs +2 -1
- package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +29 -13
- package/esm2022/libs/util/shared/src/lib/utils/fuzzy-filter.mjs +27 -0
- package/esm2022/libs/util/shared/src/lib/utils/index.mjs +2 -1
- package/esm2022/translations/de.json +102 -87
- package/esm2022/translations/en.json +35 -20
- package/esm2022/translations/es.json +15 -0
- package/esm2022/translations/fr.json +19 -4
- package/esm2022/translations/it.json +27 -12
- package/esm2022/translations/nl.json +15 -0
- package/esm2022/translations/pt.json +15 -0
- package/fesm2022/geonetwork-ui.mjs +910 -298
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts +1 -0
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/index.d.ts +2 -0
- package/libs/api/repository/src/lib/gn4/index.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +10 -5
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/feature/catalog/src/lib/organisations/organisations.component.d.ts +0 -1
- package/libs/feature/catalog/src/lib/organisations/organisations.component.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts +15 -2
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/record-form/record-form.component.d.ts.map +1 -1
- package/libs/feature/map/src/index.d.ts +1 -0
- package/libs/feature/map/src/index.d.ts.map +1 -1
- package/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.d.ts +22 -0
- package/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.d.ts.map +1 -0
- package/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.d.ts +22 -0
- package/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.d.ts.map +1 -0
- package/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.d.ts +22 -0
- package/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.d.ts.map +1 -0
- package/libs/feature/map/src/lib/constant/index.d.ts +1 -0
- package/libs/feature/map/src/lib/constant/index.d.ts.map +1 -1
- package/libs/feature/map/src/lib/constant/projections.d.ts.map +1 -0
- package/libs/feature/map/src/lib/feature-map.module.d.ts +16 -12
- package/libs/feature/map/src/lib/feature-map.module.d.ts.map +1 -1
- package/libs/feature/map/src/lib/geocoding/geocoding.component.d.ts +25 -0
- package/libs/feature/map/src/lib/geocoding/geocoding.component.d.ts.map +1 -0
- package/libs/feature/map/src/lib/geocoding.service.d.ts +18 -0
- package/libs/feature/map/src/lib/geocoding.service.d.ts.map +1 -0
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts +1 -0
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts.map +1 -1
- package/libs/feature/map/src/lib/utils/index.d.ts +0 -2
- package/libs/feature/map/src/lib/utils/index.d.ts.map +1 -1
- package/libs/feature/map/src/lib/utils/map-utils.service.d.ts +13 -11
- package/libs/feature/map/src/lib/utils/map-utils.service.d.ts.map +1 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +1 -3
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts +2 -1
- package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts.map +1 -1
- package/libs/ui/dataviz/src/lib/chart/chart.component.d.ts +1 -1
- package/libs/ui/elements/src/index.d.ts +3 -0
- package/libs/ui/elements/src/index.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.d.ts +10 -0
- package/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.d.ts.map +1 -0
- package/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.d.ts +8 -0
- package/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.d.ts.map +1 -0
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +1 -0
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/thumbnail/thumbnail.component.d.ts +3 -2
- package/libs/ui/elements/src/lib/thumbnail/thumbnail.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +13 -11
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/editable-label/editable-label.directive.d.ts +13 -0
- package/libs/ui/inputs/src/lib/editable-label/editable-label.directive.d.ts.map +1 -0
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +2 -1
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts.map +1 -1
- package/libs/util/i18n/src/index.d.ts +1 -0
- package/libs/util/i18n/src/index.d.ts.map +1 -1
- package/libs/util/shared/src/lib/links/link-utils.d.ts +19 -7
- package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
- package/libs/util/shared/src/lib/utils/fuzzy-filter.d.ts +9 -0
- package/libs/util/shared/src/lib/utils/fuzzy-filter.d.ts.map +1 -0
- package/libs/util/shared/src/lib/utils/index.d.ts +1 -0
- package/libs/util/shared/src/lib/utils/index.d.ts.map +1 -1
- package/package.json +4 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +3 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +43 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.ts +1 -0
- package/src/libs/api/repository/src/lib/gn4/index.ts +2 -0
- package/src/libs/common/domain/src/lib/index.ts +2 -0
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +12 -7
- package/src/libs/feature/catalog/src/lib/organisations/organisations.component.ts +3 -17
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +8 -5
- package/src/libs/feature/editor/src/lib/record-form/record-form.component.ts +2 -1
- package/src/libs/feature/map/src/index.ts +1 -0
- package/src/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.css +0 -0
- package/src/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.html +21 -0
- package/src/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.ts +107 -0
- package/src/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.css +0 -0
- package/src/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.html +37 -0
- package/src/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.ts +64 -0
- package/src/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.css +0 -0
- package/src/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.html +55 -0
- package/src/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.ts +63 -0
- package/src/libs/feature/map/src/lib/constant/index.ts +1 -0
- package/src/libs/feature/map/src/lib/feature-map.module.ts +14 -0
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.css +0 -0
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.html +39 -0
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.ts +99 -0
- package/src/libs/feature/map/src/lib/geocoding.service.ts +59 -0
- package/src/libs/feature/map/src/lib/layers-panel/layers-panel.component.html +9 -3
- package/src/libs/feature/map/src/lib/map-context/map-context.service.ts +6 -0
- package/src/libs/feature/map/src/lib/utils/index.ts +0 -2
- package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +85 -50
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +18 -3
- package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html +12 -4
- package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.ts +1 -0
- package/src/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html +1 -0
- package/src/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.ts +1 -1
- package/src/libs/ui/elements/src/index.ts +3 -0
- package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.html +4 -1
- package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.css +0 -0
- package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.html +30 -0
- package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.ts +15 -0
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +264 -0
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.html +1 -0
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.ts +16 -0
- package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html +2 -2
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.css +4 -0
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +59 -32
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +5 -0
- package/src/libs/ui/elements/src/lib/related-record-card/related-record-card.component.html +1 -1
- package/src/libs/ui/elements/src/lib/thumbnail/thumbnail.component.ts +4 -0
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +7 -0
- package/src/libs/ui/inputs/src/lib/button/button.component.css +1 -1
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.ts +7 -4
- package/src/libs/ui/inputs/src/lib/editable-label/editable-label.directive.ts +48 -0
- package/src/libs/ui/inputs/src/lib/navigation-button/navigation-button.component.html +8 -3
- package/src/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.css +1 -0
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +3 -0
- package/src/libs/ui/layout/src/lib/carousel/carousel.component.css +1 -1
- package/src/libs/ui/search/src/lib/record-table/record-table.component.html +2 -2
- package/src/libs/util/i18n/src/index.ts +1 -0
- package/src/libs/util/shared/src/lib/links/link-utils.ts +34 -11
- package/src/libs/util/shared/src/lib/utils/fuzzy-filter.ts +32 -0
- package/src/libs/util/shared/src/lib/utils/index.ts +1 -0
- package/translations/de.json +102 -87
- package/translations/en.json +35 -20
- package/translations/es.json +15 -0
- package/translations/fr.json +19 -4
- package/translations/it.json +27 -12
- package/translations/nl.json +15 -0
- package/translations/pt.json +15 -0
- package/translations/sk.json +15 -0
- package/esm2022/libs/feature/map/src/lib/utils/map-utils-wms.service.mjs +0 -55
- package/esm2022/libs/feature/map/src/lib/utils/projections.mjs +0 -2
- package/libs/feature/map/src/lib/utils/map-utils-wms.service.d.ts +0 -17
- package/libs/feature/map/src/lib/utils/map-utils-wms.service.d.ts.map +0 -1
- package/libs/feature/map/src/lib/utils/projections.d.ts.map +0 -1
- package/src/libs/feature/map/src/lib/utils/map-utils-wms.service.ts +0 -58
- /package/libs/feature/map/src/lib/{utils → constant}/projections.d.ts +0 -0
- /package/src/libs/feature/map/src/lib/{utils → constant}/projections.ts +0 -0
|
@@ -2,18 +2,18 @@ import { HttpClient } from '@angular/common/http'
|
|
|
2
2
|
import { Injectable } from '@angular/core'
|
|
3
3
|
import type { FeatureCollection } from 'geojson'
|
|
4
4
|
import { extend, Extent, isEmpty } from 'ol/extent'
|
|
5
|
-
import
|
|
5
|
+
import Feature from 'ol/Feature'
|
|
6
6
|
import GeoJSON from 'ol/format/GeoJSON'
|
|
7
7
|
import { Geometry } from 'ol/geom'
|
|
8
8
|
import Layer from 'ol/layer/Layer'
|
|
9
9
|
import Map from 'ol/Map'
|
|
10
|
-
import {
|
|
10
|
+
import { transformExtent } from 'ol/proj'
|
|
11
11
|
import Source from 'ol/source/Source'
|
|
12
12
|
import ImageWMS from 'ol/source/ImageWMS'
|
|
13
13
|
import TileWMS from 'ol/source/TileWMS'
|
|
14
14
|
import VectorSource from 'ol/source/Vector'
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { optionsFromCapabilities } from 'ol/source/WMTS'
|
|
16
|
+
import { defaults, DragPan, Interaction, MouseWheelZoom } from 'ol/interaction'
|
|
17
17
|
import {
|
|
18
18
|
mouseOnly,
|
|
19
19
|
noModifierKeys,
|
|
@@ -21,45 +21,53 @@ import {
|
|
|
21
21
|
primaryAction,
|
|
22
22
|
} from 'ol/events/condition'
|
|
23
23
|
import WMTSCapabilities from 'ol/format/WMTSCapabilities'
|
|
24
|
-
import { from, Observable
|
|
24
|
+
import { from, Observable } from 'rxjs'
|
|
25
25
|
import { map } from 'rxjs/operators'
|
|
26
26
|
import {
|
|
27
27
|
MapContextLayerModel,
|
|
28
28
|
MapContextLayerTypeEnum,
|
|
29
|
+
MapContextLayerWmsModel,
|
|
29
30
|
MapContextLayerWmtsModel,
|
|
30
31
|
} from '../map-context/map-context.model'
|
|
31
|
-
import { MapUtilsWMSService } from './map-utils-wms.service'
|
|
32
32
|
import Collection from 'ol/Collection'
|
|
33
33
|
import MapBrowserEvent from 'ol/MapBrowserEvent'
|
|
34
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
CatalogRecord,
|
|
36
|
+
DatasetDistribution,
|
|
37
|
+
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
38
|
+
import { ProxyService } from '../../../../../../libs/util/shared/src'
|
|
39
|
+
import { WmsEndpoint } from '@camptocamp/ogc-client'
|
|
40
|
+
import { LONLAT_CRS_CODES } from '../constant/projections'
|
|
41
|
+
import { fromEPSGCode, register } from 'ol/proj/proj4'
|
|
42
|
+
import proj4 from 'proj4/dist/proj4'
|
|
35
43
|
|
|
36
44
|
const FEATURE_PROJECTION = 'EPSG:3857'
|
|
37
45
|
const DATA_PROJECTION = 'EPSG:4326'
|
|
38
46
|
|
|
47
|
+
const GEOJSON = new GeoJSON()
|
|
48
|
+
|
|
39
49
|
@Injectable({
|
|
40
50
|
providedIn: 'root',
|
|
41
51
|
})
|
|
42
52
|
export class MapUtilsService {
|
|
43
|
-
constructor(private http: HttpClient, private
|
|
53
|
+
constructor(private http: HttpClient, private proxy: ProxyService) {}
|
|
44
54
|
|
|
45
55
|
createEmptyMap(): Map {
|
|
46
|
-
|
|
56
|
+
return new Map({
|
|
47
57
|
controls: [],
|
|
48
58
|
pixelRatio: 1,
|
|
49
59
|
})
|
|
50
|
-
return map
|
|
51
60
|
}
|
|
52
61
|
|
|
53
62
|
readFeatureCollection = (
|
|
54
63
|
featureCollection: FeatureCollection,
|
|
55
64
|
featureProjection = FEATURE_PROJECTION,
|
|
56
65
|
dataProjection = DATA_PROJECTION
|
|
57
|
-
):
|
|
58
|
-
|
|
66
|
+
): Feature<Geometry>[] => {
|
|
67
|
+
return GEOJSON.readFeatures(featureCollection, {
|
|
59
68
|
featureProjection,
|
|
60
69
|
dataProjection,
|
|
61
|
-
})
|
|
62
|
-
return olFeatures
|
|
70
|
+
}) as Feature<Geometry>[]
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
isWMSLayer(layer: Layer<Source>): boolean {
|
|
@@ -78,20 +86,14 @@ export class MapUtilsService {
|
|
|
78
86
|
...source.getParams(),
|
|
79
87
|
INFO_FORMAT: 'application/json',
|
|
80
88
|
}
|
|
81
|
-
|
|
82
|
-
coordinate,
|
|
83
|
-
resolution,
|
|
84
|
-
projection,
|
|
85
|
-
params
|
|
86
|
-
)
|
|
87
|
-
return url
|
|
89
|
+
return source.getFeatureInfoUrl(coordinate, resolution, projection, params)
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
getVectorFeaturesFromClick(olMap, event):
|
|
92
|
+
getVectorFeaturesFromClick(olMap, event): Feature<Geometry>[] {
|
|
91
93
|
const features = []
|
|
92
94
|
const hit = olMap.forEachFeatureAtPixel(
|
|
93
95
|
event.pixel,
|
|
94
|
-
(feature:
|
|
96
|
+
(feature: Feature<Geometry>) => {
|
|
95
97
|
return feature
|
|
96
98
|
},
|
|
97
99
|
{ layerFilter: (layer) => layer.getSource() instanceof VectorSource }
|
|
@@ -103,9 +105,9 @@ export class MapUtilsService {
|
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
getGFIFeaturesObservablesFromClick(
|
|
106
|
-
olMap,
|
|
107
|
-
event
|
|
108
|
-
): Observable<
|
|
108
|
+
olMap: Map,
|
|
109
|
+
event: MapBrowserEvent<PointerEvent>
|
|
110
|
+
): Observable<Feature<Geometry>[]>[] {
|
|
109
111
|
const wmsLayers = olMap.getLayers().getArray().filter(this.isWMSLayer)
|
|
110
112
|
|
|
111
113
|
if (wmsLayers.length > 0) {
|
|
@@ -128,8 +130,8 @@ export class MapUtilsService {
|
|
|
128
130
|
/**
|
|
129
131
|
* Will emit `null` if no extent could be computed
|
|
130
132
|
*/
|
|
131
|
-
getLayerExtent(layer: MapContextLayerModel):
|
|
132
|
-
let
|
|
133
|
+
async getLayerExtent(layer: MapContextLayerModel): Promise<Extent | null> {
|
|
134
|
+
let latLonExtent: Extent
|
|
133
135
|
if (
|
|
134
136
|
layer &&
|
|
135
137
|
layer.type === 'geojson' &&
|
|
@@ -138,37 +140,55 @@ export class MapUtilsService {
|
|
|
138
140
|
layer.data.features[0] &&
|
|
139
141
|
layer.data.features[0].geometry
|
|
140
142
|
) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
.
|
|
148
|
-
|
|
149
|
-
prev ? extend(prev, curr.getExtent()) : curr.getExtent(),
|
|
150
|
-
null as Extent
|
|
151
|
-
)
|
|
143
|
+
latLonExtent = new GeoJSON()
|
|
144
|
+
.readFeatures(layer.data)
|
|
145
|
+
.map((feature) => feature.getGeometry())
|
|
146
|
+
.filter((geom) => !!geom)
|
|
147
|
+
.reduce(
|
|
148
|
+
(prev, curr) =>
|
|
149
|
+
prev ? extend(prev, curr.getExtent()) : curr.getExtent(),
|
|
150
|
+
null as Extent
|
|
152
151
|
)
|
|
153
|
-
)
|
|
154
152
|
} else if (layer && layer.type === 'wms') {
|
|
155
|
-
|
|
153
|
+
latLonExtent = await this.getWmsLayerExtent(layer)
|
|
156
154
|
} else if (layer && layer.type === 'wmts') {
|
|
157
155
|
if (layer.extent) {
|
|
158
|
-
|
|
156
|
+
latLonExtent = layer.extent
|
|
159
157
|
} else {
|
|
160
|
-
return
|
|
158
|
+
return layer.options.tileGrid.getExtent()
|
|
161
159
|
}
|
|
162
160
|
} else {
|
|
163
|
-
return
|
|
161
|
+
return null
|
|
162
|
+
}
|
|
163
|
+
if (!latLonExtent || isEmpty(latLonExtent)) {
|
|
164
|
+
return null
|
|
164
165
|
}
|
|
165
|
-
return
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
return transformExtent(latLonExtent, 'EPSG:4326', 'EPSG:3857')
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async getWmsLayerExtent(
|
|
170
|
+
layer: MapContextLayerWmsModel
|
|
171
|
+
): Promise<Extent | null> {
|
|
172
|
+
const endpoint = await new WmsEndpoint(
|
|
173
|
+
this.proxy.getProxiedUrl(layer.url)
|
|
174
|
+
).isReady()
|
|
175
|
+
const { boundingBoxes } = endpoint.getLayerByName(layer.name)
|
|
176
|
+
if (!Object.keys(boundingBoxes).length) {
|
|
177
|
+
return null
|
|
178
|
+
}
|
|
179
|
+
const lonLatCRS = Object.keys(boundingBoxes)?.find((crs) =>
|
|
180
|
+
LONLAT_CRS_CODES.includes(crs)
|
|
171
181
|
)
|
|
182
|
+
if (lonLatCRS) {
|
|
183
|
+
return boundingBoxes[lonLatCRS].map(parseFloat)
|
|
184
|
+
} else {
|
|
185
|
+
const availableEPSGCode = Object.keys(boundingBoxes)[0]
|
|
186
|
+
register(proj4)
|
|
187
|
+
const proj = await fromEPSGCode(availableEPSGCode)
|
|
188
|
+
const bboxWithFiniteNumbers =
|
|
189
|
+
boundingBoxes[availableEPSGCode].map(parseFloat)
|
|
190
|
+
return transformExtent(bboxWithFiniteNumbers, proj, 'EPSG:4326')
|
|
191
|
+
}
|
|
172
192
|
}
|
|
173
193
|
|
|
174
194
|
getWmtsLayerFromCapabilities(
|
|
@@ -235,6 +255,21 @@ ${e.stack || e.message || e}`)
|
|
|
235
255
|
.getArray()
|
|
236
256
|
)
|
|
237
257
|
}
|
|
258
|
+
|
|
259
|
+
getRecordExtent(record: Partial<CatalogRecord>): Extent {
|
|
260
|
+
if (!('spatialExtents' in record)) {
|
|
261
|
+
return null
|
|
262
|
+
}
|
|
263
|
+
// transform an array of geojson geometries into a bbox
|
|
264
|
+
const totalExtent = record.spatialExtents.reduce(
|
|
265
|
+
(prev, curr) => {
|
|
266
|
+
const geom = GEOJSON.readGeometry(curr.geometry)
|
|
267
|
+
return extend(prev, geom.getExtent())
|
|
268
|
+
},
|
|
269
|
+
[Infinity, Infinity, -Infinity, -Infinity]
|
|
270
|
+
)
|
|
271
|
+
return transformExtent(totalExtent, 'EPSG:4326', 'EPSG:3857')
|
|
272
|
+
}
|
|
238
273
|
}
|
|
239
274
|
|
|
240
275
|
export function dragPanCondition(
|
|
@@ -22,10 +22,14 @@ import { StyleLike } from 'ol/style/Style'
|
|
|
22
22
|
import {
|
|
23
23
|
BehaviorSubject,
|
|
24
24
|
combineLatest,
|
|
25
|
+
from,
|
|
26
|
+
lastValueFrom,
|
|
25
27
|
Observable,
|
|
26
28
|
of,
|
|
29
|
+
startWith,
|
|
27
30
|
Subscription,
|
|
28
31
|
throwError,
|
|
32
|
+
withLatestFrom,
|
|
29
33
|
} from 'rxjs'
|
|
30
34
|
import {
|
|
31
35
|
catchError,
|
|
@@ -99,7 +103,7 @@ export class MapViewComponent implements OnInit, OnDestroy {
|
|
|
99
103
|
|
|
100
104
|
mapContext$ = this.currentLayers$.pipe(
|
|
101
105
|
switchMap((layers) =>
|
|
102
|
-
this.mapUtils.getLayerExtent(layers[0]).pipe(
|
|
106
|
+
from(this.mapUtils.getLayerExtent(layers[0])).pipe(
|
|
103
107
|
catchError((error) => {
|
|
104
108
|
console.warn(error) // FIXME: report this to the user somehow
|
|
105
109
|
return of(undefined)
|
|
@@ -115,7 +119,19 @@ export class MapViewComponent implements OnInit, OnDestroy {
|
|
|
115
119
|
),
|
|
116
120
|
tap(() => this.resetSelection())
|
|
117
121
|
)
|
|
118
|
-
)
|
|
122
|
+
),
|
|
123
|
+
withLatestFrom(this.mdViewFacade.metadata$),
|
|
124
|
+
map(([context, metadata]) => {
|
|
125
|
+
if (context.view.extent) return context
|
|
126
|
+
const extent = this.mapUtils.getRecordExtent(metadata)
|
|
127
|
+
return {
|
|
128
|
+
...context,
|
|
129
|
+
view: {
|
|
130
|
+
...context.view,
|
|
131
|
+
extent,
|
|
132
|
+
},
|
|
133
|
+
}
|
|
134
|
+
})
|
|
119
135
|
)
|
|
120
136
|
|
|
121
137
|
constructor(
|
|
@@ -123,7 +139,6 @@ export class MapViewComponent implements OnInit, OnDestroy {
|
|
|
123
139
|
private mapManager: MapManagerService,
|
|
124
140
|
private mapUtils: MapUtilsService,
|
|
125
141
|
private dataService: DataService,
|
|
126
|
-
private proxy: ProxyService,
|
|
127
142
|
private featureInfo: FeatureInfoService,
|
|
128
143
|
private changeRef: ChangeDetectorRef,
|
|
129
144
|
private styleService: MapStyleService
|
package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
<div>
|
|
2
|
-
<span
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<div class="flex flex-row content-center">
|
|
2
|
+
<span
|
|
3
|
+
class="align-text-top mr-1.5 mt-1.5 favorite-count"
|
|
4
|
+
*ngIf="hasFavoriteCount && displayCount"
|
|
5
|
+
>{{ favoriteCount }}</span
|
|
6
|
+
>
|
|
5
7
|
<gn-ui-star-toggle
|
|
6
8
|
[toggled]="isFavorite$ | async"
|
|
7
9
|
(newValue)="toggleFavorite($event)"
|
|
8
10
|
[disabled]="loading || (isAnonymous$ | async)"
|
|
11
|
+
class="mt-1"
|
|
9
12
|
></gn-ui-star-toggle>
|
|
13
|
+
<span
|
|
14
|
+
class="align-text-top ml-1.5 favorite-count mt-1.5"
|
|
15
|
+
*ngIf="!displayCount"
|
|
16
|
+
translate="datahub.record.addToFavorites"
|
|
17
|
+
></span>
|
|
10
18
|
</div>
|
|
@@ -24,6 +24,7 @@ import { PlatformServiceInterface } from '../../../../../../../libs/common/domai
|
|
|
24
24
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
25
25
|
})
|
|
26
26
|
export class FavoriteStarComponent implements AfterViewInit, OnDestroy {
|
|
27
|
+
@Input() displayCount? = true
|
|
27
28
|
@Input() set record(value) {
|
|
28
29
|
this.record_ = value
|
|
29
30
|
this.favoriteCount =
|
|
@@ -34,7 +34,7 @@ export class LanguageSwitcherComponent implements OnInit {
|
|
|
34
34
|
ngOnInit(): void {
|
|
35
35
|
const languages = this.languagePlaceholder || DEFAULT_LANGUAGES
|
|
36
36
|
this.languageList = languages.map((language) => ({
|
|
37
|
-
label:
|
|
37
|
+
label: `${language}`.toUpperCase(),
|
|
38
38
|
value: language,
|
|
39
39
|
}))
|
|
40
40
|
}
|
|
@@ -18,4 +18,7 @@ export * from './lib/pagination/pagination.component'
|
|
|
18
18
|
export * from './lib/related-record-card/related-record-card.component'
|
|
19
19
|
export * from './lib/search-results-error/search-results-error.component'
|
|
20
20
|
export * from './lib/user-preview/user-preview.component'
|
|
21
|
+
export * from './lib/max-lines/max-lines.component'
|
|
21
22
|
export * from './lib/record-api-form/record-api-form.component'
|
|
23
|
+
export * from './lib/markdown-parser/markdown-parser.component'
|
|
24
|
+
export * from './lib/image-overlay-preview/image-overlay-preview.component'
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
>
|
|
9
9
|
record.metadata.download
|
|
10
10
|
</p>
|
|
11
|
-
<div
|
|
11
|
+
<div
|
|
12
|
+
class="flex flex-wrap justify-start sm:justify-end sm:pb-4"
|
|
13
|
+
data-cy="download-format-filters"
|
|
14
|
+
>
|
|
12
15
|
<gn-ui-button
|
|
13
16
|
class="m-1 format-filter"
|
|
14
17
|
[extraClass]="
|
package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.css
ADDED
|
File without changes
|
package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.html
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<gn-ui-content-ghost
|
|
2
|
+
[showContent]="imageUrl !== undefined"
|
|
3
|
+
ghostClass="h-48 mb-3"
|
|
4
|
+
>
|
|
5
|
+
<div
|
|
6
|
+
*ngIf="imageUrl"
|
|
7
|
+
[showContent]="imageUrl !== undefined"
|
|
8
|
+
data-cy="record-thumbnail"
|
|
9
|
+
class="flex-shrink-0 bg-gray-100 rounded-lg overflow-hidden w-full border border-gray-300 group-hover:shadow-xl group-hover:border-0 h-48 mb-3"
|
|
10
|
+
>
|
|
11
|
+
<gn-ui-thumbnail
|
|
12
|
+
class="relative h-full w-full"
|
|
13
|
+
[thumbnailUrl]="imageUrl"
|
|
14
|
+
fit="cover"
|
|
15
|
+
(placeholderShown)="isPlaceholderShown.emit($event)"
|
|
16
|
+
></gn-ui-thumbnail>
|
|
17
|
+
<div class="relative">
|
|
18
|
+
<gn-ui-button
|
|
19
|
+
class="absolute bottom-0 right-0 z-10 mr-2 mb-2"
|
|
20
|
+
[type]="'outline'"
|
|
21
|
+
[extraClass]="'!py-2 !px-0'"
|
|
22
|
+
(buttonClick)="openLightbox(imageUrl)"
|
|
23
|
+
>
|
|
24
|
+
<mat-icon class="material-symbols-outlined font-extralight"
|
|
25
|
+
>zoom_out_map</mat-icon
|
|
26
|
+
>
|
|
27
|
+
</gn-ui-button>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</gn-ui-content-ghost>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core'
|
|
2
|
+
import * as basicLightbox from 'basiclightbox'
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'gn-ui-image-overlay-preview',
|
|
6
|
+
templateUrl: './image-overlay-preview.component.html',
|
|
7
|
+
styleUrls: ['./image-overlay-preview.component.css'],
|
|
8
|
+
})
|
|
9
|
+
export class ImageOverlayPreviewComponent {
|
|
10
|
+
@Input() imageUrl: string
|
|
11
|
+
@Output() isPlaceholderShown = new EventEmitter<boolean>()
|
|
12
|
+
openLightbox(src: string) {
|
|
13
|
+
basicLightbox.create(`<img src="${src}"/>`).show()
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/** Body **/
|
|
2
|
+
:host ::ng-deep .markdown-body {
|
|
3
|
+
-ms-text-size-adjust: 100%;
|
|
4
|
+
-webkit-text-size-adjust: 100%;
|
|
5
|
+
margin: 0px 0px 1.5rem 0px;
|
|
6
|
+
line-height: 1.5;
|
|
7
|
+
word-wrap: break-word;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Emphasis **/
|
|
11
|
+
|
|
12
|
+
:host ::ng-deep .markdown-body strong {
|
|
13
|
+
@apply font-bold;
|
|
14
|
+
color: var(--color-secondary-darker);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Headings **/
|
|
18
|
+
|
|
19
|
+
:host ::ng-deep .markdown-body h1,
|
|
20
|
+
:host ::ng-deep .markdown-body h2,
|
|
21
|
+
:host ::ng-deep .markdown-body h3,
|
|
22
|
+
:host ::ng-deep .markdown-body h4,
|
|
23
|
+
:host ::ng-deep .markdown-body h5,
|
|
24
|
+
:host ::ng-deep .markdown-body h6 {
|
|
25
|
+
margin-top: 24px;
|
|
26
|
+
margin-bottom: 16px;
|
|
27
|
+
line-height: 1.25;
|
|
28
|
+
@apply text-title font-title font-bold;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host ::ng-deep .markdown-body h1 {
|
|
32
|
+
margin: 0.67em 0;
|
|
33
|
+
padding-bottom: 0.3em;
|
|
34
|
+
font-size: 2em;
|
|
35
|
+
color: var(--color-primary);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host ::ng-deep .markdown-body h2 {
|
|
39
|
+
padding-bottom: 0.3em;
|
|
40
|
+
font-size: 1.5em;
|
|
41
|
+
color: var(--color-secondary);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host ::ng-deep .markdown-body h3 {
|
|
45
|
+
font-size: 1.25em;
|
|
46
|
+
color: var(--color-secondary);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host ::ng-deep .markdown-body h4 {
|
|
50
|
+
font-size: 1em;
|
|
51
|
+
color: var(--color-secondary);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host ::ng-deep .markdown-body h5 {
|
|
55
|
+
font-size: 0.875em;
|
|
56
|
+
color: var(--color-secondary);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host ::ng-deep .markdown-body h6 {
|
|
60
|
+
font-size: 0.85em;
|
|
61
|
+
color: var(--color-secondary-lighter);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Paragraphs **/
|
|
65
|
+
|
|
66
|
+
:host ::ng-deep .markdown-body p {
|
|
67
|
+
margin-top: 0;
|
|
68
|
+
margin-bottom: 10px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Links **/
|
|
72
|
+
|
|
73
|
+
:host ::ng-deep .markdown-body p > a {
|
|
74
|
+
margin-top: 0;
|
|
75
|
+
margin-bottom: 10px;
|
|
76
|
+
color: var(--color-primary) !important;
|
|
77
|
+
text-decoration: none !important;
|
|
78
|
+
@apply font-bold;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host ::ng-deep .markdown-body p > a:hover {
|
|
82
|
+
color: var(--color-primary-darker) !important;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Blockquotes **/
|
|
86
|
+
|
|
87
|
+
:host ::ng-deep .markdown-body blockquote {
|
|
88
|
+
margin: 0;
|
|
89
|
+
padding: 0 1em;
|
|
90
|
+
color: var(--color-secondary-lighter);
|
|
91
|
+
border-left: 0.25em solid var(--color-primary-lighter);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Code **/
|
|
95
|
+
|
|
96
|
+
:host ::ng-deep .markdown-body pre {
|
|
97
|
+
margin-top: 0;
|
|
98
|
+
margin-bottom: 0;
|
|
99
|
+
font-size: 12px;
|
|
100
|
+
background-color: var(--color-gray-100);
|
|
101
|
+
word-wrap: normal;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host ::ng-deep .markdown-body pre {
|
|
105
|
+
padding: 16px;
|
|
106
|
+
overflow: auto;
|
|
107
|
+
font-size: 85%;
|
|
108
|
+
line-height: 1.45;
|
|
109
|
+
color: var(--color-secondary);
|
|
110
|
+
border-radius: 6px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host ::ng-deep .markdown-body code {
|
|
114
|
+
padding: 0.2em 0.4em;
|
|
115
|
+
margin: 0;
|
|
116
|
+
font-size: 85%;
|
|
117
|
+
white-space: break-spaces;
|
|
118
|
+
border-radius: 6px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:host ::ng-deep .markdown-body pre code {
|
|
122
|
+
display: inline;
|
|
123
|
+
max-width: auto;
|
|
124
|
+
padding: 0;
|
|
125
|
+
margin: 0;
|
|
126
|
+
overflow: visible;
|
|
127
|
+
line-height: inherit;
|
|
128
|
+
word-wrap: normal;
|
|
129
|
+
border: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Horizontal rules **/
|
|
133
|
+
|
|
134
|
+
:host ::ng-deep .markdown-body hr {
|
|
135
|
+
box-sizing: content-box;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
background: transparent;
|
|
138
|
+
border-bottom: 1px solid var(--color-secondary);
|
|
139
|
+
height: 0.15em;
|
|
140
|
+
padding: 0;
|
|
141
|
+
margin: 24px 0;
|
|
142
|
+
background-color: var(--color-secondary);
|
|
143
|
+
border: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:host ::ng-deep .markdown-body hr::before {
|
|
147
|
+
display: table;
|
|
148
|
+
content: '';
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:host ::ng-deep .markdown-body hr::after {
|
|
152
|
+
display: table;
|
|
153
|
+
clear: both;
|
|
154
|
+
content: '';
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Lists **/
|
|
158
|
+
|
|
159
|
+
:host ::ng-deep .markdown-body ul,
|
|
160
|
+
:host ::ng-deep .markdown-body ol {
|
|
161
|
+
margin-top: 0;
|
|
162
|
+
margin-bottom: 0;
|
|
163
|
+
padding-left: 2em;
|
|
164
|
+
list-style: revert;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:host ::ng-deep .markdown-body ol ol,
|
|
168
|
+
:host ::ng-deep .markdown-body ul ol {
|
|
169
|
+
list-style-type: lower-roman;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:host ::ng-deep .markdown-body ul ul ol,
|
|
173
|
+
:host ::ng-deep .markdown-body ul ol ol,
|
|
174
|
+
:host ::ng-deep .markdown-body ol ul ol,
|
|
175
|
+
:host ::ng-deep .markdown-body ol ol ol {
|
|
176
|
+
list-style-type: lower-alpha;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
:host ::ng-deep .markdown-body ol[type='a s'] {
|
|
180
|
+
list-style-type: lower-alpha;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:host ::ng-deep .markdown-body ol[type='A s'] {
|
|
184
|
+
list-style-type: upper-alpha;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:host ::ng-deep .markdown-body ol[type='i s'] {
|
|
188
|
+
list-style-type: lower-roman;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:host ::ng-deep .markdown-body ol[type='I s'] {
|
|
192
|
+
list-style-type: upper-roman;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
:host ::ng-deep .markdown-body ol[type='1'] {
|
|
196
|
+
list-style: unset;
|
|
197
|
+
list-style-type: decimal;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
:host ::ng-deep .markdown-body div > ol:not([type]) {
|
|
201
|
+
list-style: unset;
|
|
202
|
+
list-style-type: decimal;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Table **/
|
|
206
|
+
|
|
207
|
+
:host ::ng-deep .markdown-body table {
|
|
208
|
+
border-spacing: 0;
|
|
209
|
+
border-collapse: collapse;
|
|
210
|
+
display: block;
|
|
211
|
+
width: max-content;
|
|
212
|
+
max-width: 100%;
|
|
213
|
+
overflow: auto;
|
|
214
|
+
padding-bottom: 15px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
:host ::ng-deep .markdown-body td,
|
|
218
|
+
:host ::ng-deep .markdown-body th {
|
|
219
|
+
padding: 0;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
:host ::ng-deep .markdown-body th {
|
|
223
|
+
color: var(--color-secondary);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
:host ::ng-deep .markdown-body table th,
|
|
227
|
+
:host ::ng-deep .markdown-body table td {
|
|
228
|
+
padding: 6px 13px;
|
|
229
|
+
border: 1px solid var(--color-gray-500);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
:host ::ng-deep .markdown-body table td > :last-child {
|
|
233
|
+
margin-bottom: 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
:host ::ng-deep .markdown-body table tr {
|
|
237
|
+
background-color: #ffffff;
|
|
238
|
+
border-top: 1px solid var(--color-secondary-lighter);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
:host ::ng-deep .markdown-body table tr:nth-child(2n) {
|
|
242
|
+
background-color: var(--color-gray-100);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
:host ::ng-deep .markdown-body table img {
|
|
246
|
+
background-color: transparent;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** Images **/
|
|
250
|
+
|
|
251
|
+
:host ::ng-deep .markdown-body img {
|
|
252
|
+
border-style: none;
|
|
253
|
+
max-width: 100%;
|
|
254
|
+
box-sizing: content-box;
|
|
255
|
+
background-color: transparent;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
:host ::ng-deep .markdown-body img[align='right'] {
|
|
259
|
+
padding-left: 20px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
:host ::ng-deep .markdown-body img[align='left'] {
|
|
263
|
+
padding-right: 20px;
|
|
264
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<div class="markdown-body" [innerHTML]="parsedMarkdown"></div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component, Input, ChangeDetectionStrategy } from '@angular/core'
|
|
2
|
+
import { marked } from 'marked'
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'gn-ui-markdown-parser',
|
|
6
|
+
templateUrl: './markdown-parser.component.html',
|
|
7
|
+
styleUrls: ['./markdown-parser.component.css'],
|
|
8
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
+
})
|
|
10
|
+
export class MarkdownParserComponent {
|
|
11
|
+
@Input() textContent: string
|
|
12
|
+
|
|
13
|
+
get parsedMarkdown() {
|
|
14
|
+
return marked.parse(this.textContent)
|
|
15
|
+
}
|
|
16
|
+
}
|