@opengeoweb/cross-section 0.0.0-stage → 20.1.0-nightly-20261017
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/README.md +6 -2
- package/dist/README.md +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +93 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/lib/components/Providers/Providers.d.ts +7 -0
- package/dist/src/lib/components/Providers/index.d.ts +1 -0
- package/dist/src/lib/components/dummy/cross-section.d.ts +2 -0
- package/dist/src/lib/utils/i18n.d.ts +7 -0
- package/package.json +41 -4
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# cross-section
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This library was generated with [Nx](https://nx.dev).
|
|
4
|
+
|
|
5
|
+
## Running unit tests
|
|
6
|
+
|
|
7
|
+
Run `nx test cross-section` to execute the unit tests via [Jest](https://jestjs.io).
|
package/dist/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/index";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import i18n from 'i18next';
|
|
3
|
+
import { useTranslation, I18nextProvider } from 'react-i18next';
|
|
4
|
+
import { SHARED_NAMESPACE, safelyInitI18nForTestsAndStories, sharedTranslations } from '@opengeoweb/shared';
|
|
5
|
+
import { ThemeWrapper, lightTheme } from '@opengeoweb/theme';
|
|
6
|
+
|
|
7
|
+
var en = {
|
|
8
|
+
welcome: "Welcome to Cross Section!"
|
|
9
|
+
};
|
|
10
|
+
var fi = {
|
|
11
|
+
};
|
|
12
|
+
var no = {
|
|
13
|
+
};
|
|
14
|
+
var nl = {
|
|
15
|
+
};
|
|
16
|
+
var crossSectionTranslations = {
|
|
17
|
+
en: en,
|
|
18
|
+
fi: fi,
|
|
19
|
+
no: no,
|
|
20
|
+
nl: nl
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/* *
|
|
24
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
25
|
+
* you may not use this file except in compliance with the License.
|
|
26
|
+
* You may obtain a copy of the License at
|
|
27
|
+
*
|
|
28
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
29
|
+
*
|
|
30
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
31
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
32
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
33
|
+
* See the License for the specific language governing permissions and
|
|
34
|
+
* limitations under the License.
|
|
35
|
+
*
|
|
36
|
+
* Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
37
|
+
* Copyright 2026 - Finnish Meteorological Institute (FMI)
|
|
38
|
+
* Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
|
|
39
|
+
* */
|
|
40
|
+
var CROSS_SECTION_NAMESPACE = 'cross-section';
|
|
41
|
+
var initCrossSectionTestI18n = function initCrossSectionTestI18n() {
|
|
42
|
+
safelyInitI18nForTestsAndStories(i18n, CROSS_SECTION_NAMESPACE, [{
|
|
43
|
+
ns: SHARED_NAMESPACE,
|
|
44
|
+
translations: sharedTranslations
|
|
45
|
+
}, {
|
|
46
|
+
ns: CROSS_SECTION_NAMESPACE,
|
|
47
|
+
translations: crossSectionTranslations
|
|
48
|
+
}]);
|
|
49
|
+
};
|
|
50
|
+
var ns = [CROSS_SECTION_NAMESPACE, SHARED_NAMESPACE];
|
|
51
|
+
var useCrossSectionTranslation = function useCrossSectionTranslation() {
|
|
52
|
+
return useTranslation(ns);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var CrossSection = function CrossSection() {
|
|
56
|
+
var _useCrossSectionTrans = useCrossSectionTranslation(),
|
|
57
|
+
t = _useCrossSectionTrans.t;
|
|
58
|
+
return jsx("div", {
|
|
59
|
+
children: jsx("h1", {
|
|
60
|
+
children: t('welcome')
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
function _objectDestructuringEmpty(t) {
|
|
66
|
+
if (null == t) throw new TypeError("Cannot destructure " + t);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var CrossSectionThemeProvider = function CrossSectionThemeProvider(_ref) {
|
|
70
|
+
var children = _ref.children,
|
|
71
|
+
_ref$theme = _ref.theme,
|
|
72
|
+
theme = _ref$theme === void 0 ? lightTheme : _ref$theme;
|
|
73
|
+
return jsx(ThemeWrapper, {
|
|
74
|
+
theme: theme,
|
|
75
|
+
children: children
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
var CrossSectionI18nProvider = function CrossSectionI18nProvider(_ref2) {
|
|
79
|
+
var children = _ref2.children;
|
|
80
|
+
initCrossSectionTestI18n();
|
|
81
|
+
return jsx(I18nextProvider, {
|
|
82
|
+
i18n: i18n,
|
|
83
|
+
children: children
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
var CrossSectionProviderWrapper = function CrossSectionProviderWrapper(_ref3) {
|
|
87
|
+
var props = Object.assign({}, (_objectDestructuringEmpty(_ref3), _ref3));
|
|
88
|
+
return jsx(CrossSectionI18nProvider, {
|
|
89
|
+
children: jsx(CrossSectionThemeProvider, Object.assign({}, props))
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export { CrossSection, CrossSectionI18nProvider, CrossSectionProviderWrapper };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ThemeProviderProps } from '@opengeoweb/theme';
|
|
2
|
+
interface CrossSectionTranslationsWrapperProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare const CrossSectionI18nProvider: React.FC<CrossSectionTranslationsWrapperProps>;
|
|
6
|
+
export declare const CrossSectionProviderWrapper: React.FC<ThemeProviderProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Providers';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import i18n from 'i18next';
|
|
2
|
+
import type { UseTranslationResponse } from 'react-i18next';
|
|
3
|
+
export declare const CROSS_SECTION_NAMESPACE = "cross-section";
|
|
4
|
+
export declare const initCrossSectionTestI18n: () => void;
|
|
5
|
+
export declare const translateInTestsAndStories: (key: string, params?: Record<string, string | number> | undefined) => string;
|
|
6
|
+
export declare const useCrossSectionTranslation: () => UseTranslationResponse<typeof CROSS_SECTION_NAMESPACE, typeof i18n>;
|
|
7
|
+
export { i18n };
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"name": "@opengeoweb/cross-section",
|
|
3
|
+
"version": "20.1.0-nightly-20261017",
|
|
4
|
+
"description": "GeoWeb Cross Section library for the opengeoweb project",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+ssh://git@gitlab.com/opengeoweb/opengeoweb.git"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.esm.js",
|
|
11
|
+
"module": "./dist/index.esm.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
"./package.json": "./package.json",
|
|
15
|
+
".": {
|
|
16
|
+
"@opengeoweb/source": "./src/index.ts",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.esm.js",
|
|
19
|
+
"default": "./dist/index.esm.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@opengeoweb/shared": "20.1.0-nightly-20261017",
|
|
24
|
+
"@opengeoweb/theme": "20.1.0-nightly-20261017",
|
|
25
|
+
"i18next": "^25.0.1",
|
|
26
|
+
"react-i18next": "^15.1.1"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": "19",
|
|
30
|
+
"@emotion/react": "*",
|
|
31
|
+
"@emotion/styled": "*"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"eslint-plugin-storybook": "10.3.3",
|
|
35
|
+
"msw": "^2.7.3"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"!dist/package.json",
|
|
40
|
+
"README.md",
|
|
41
|
+
"package.json"
|
|
42
|
+
]
|
|
6
43
|
}
|