Skip to content

Commit 81c9a96

Browse files
prushforthprushfor
authored andcommitted
Add gcds-map component
Add dependency on @maps4html/mapml Update stencil config to copy mapml to dist output directory. Update index.html with example <mapml-viewer> Add gcds-map.stories.tsx Add dist/gcds/gcds-map as static resource directory for storybook. Make controlslist a multi-select in storybook Make gcds-map a component only in name, created for the purpose of importing the map client CSS rules in gcds-map.css. Add global script to dynamically and conditionally import mapml.js; global script can refer to other global script imports as required. Include gcds-map.css in build, integrate via run time load Add mapml.js and gcds-map.css imports to storybook preview-head.html, so that it appears in the iframe regardless of whether the <mapml-viewer> has been rendered yet. Add some basemap mapml (services) directory contents to component definition for use in index.html and story Add a test Add jest, jest-environment-node to root node_modules - this is necessary to successfully run tests in packages/web Add gcds-map.d.ts, re-export from index.ts. Leverage gcds-map.d.ts in gcds-map.e2e.ts a little bit Fix issue with ts not liking [Symbol.iterator]: function (): IterableIterator<File> by adding dom.iterable to the lib section, fix discovered here: sitelint.com/blog/solution-to-type-filelist-must-have-a-symbol-iterator-method-that-returns-an-iterator Add dom.iterable to tsconfig.json everywhere Add functional second story to map: hidden (basemap) layers. Add current_conditions in en only (so far). Add a Playground story Add geojson default style example Update current weather to comment out feature query Add copying of geojson canada.json file into static assets Update GeoJSON2MapMLExample story with styles. Update GeoJSON2MapMLExample story parameters docs.source.code etc Add DarkMode example with assets Update dark mode example to be remote mapml, so that we can have an explicit inline/remote example later. Update overview, add inline vs remote MapML example Add custom projection example Add delimiter comments to code disclosure widget so that the Copy button works, except for that there's no React code in this component Co-authored-by: Pierre Dubois <[email protected]> Update global-mapml.ts to use import.meta to obtain the module path at runtime, so that mapml.js can be correctly imported at the same root path as gcds-components/dist Add devDependency on babel-plugin-transform-import-meta Add babel-plugin-transform-import-meta to storybook main.js to ignore the import.meta since it is a runtime consideration Update relative paths of resources to get the build-storybook script working Add sass-embedded devDependency so that the npm run build script will work Rebase on upstream main
1 parent dec83da commit 81c9a96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1362
-70866
lines changed

package-lock.json

Lines changed: 0 additions & 43734 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
"@stencil/angular-output-target": "^0.10.0",
3737
"@types/node": "^20.11.10",
3838
"cssnano": "^6.0.0",
39+
"jest": "^28.1.3",
40+
"jest-environment-node": "^28.1.3",
3941
"ncp": "^2.0.0",
4042
"ng-packagr": "^19.0.1",
4143
"nx": "^16.0.0",

packages/react-ssr/gcds.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-ssr/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"declarationDir": "./dist/types/lib",
1111
"lib": [
1212
"dom",
13+
"dom.iterable",
1314
"es2015"
1415
],
1516
"module": "esnext",

packages/web/.storybook/main.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,42 @@ const config = {
1919
name: getAbsolutePath("@storybook/html-webpack5"),
2020
options: {},
2121
},
22+
staticDirs: [{ from: '../dist/gcds/gcds-map', to: '/dist/gcds/gcds-map' }],
2223
docs: {
2324
autodocs: false,
2425
defaultName: 'Stories'
2526
},
27+
webpackFinal: async (config) => {
28+
// Use ts-loader for .ts and .tsx files
29+
config.module.rules.push({
30+
test: /\.(ts|tsx)$/,
31+
use: [
32+
{
33+
loader: require.resolve('ts-loader'),
34+
options: {
35+
transpileOnly: true,
36+
},
37+
},
38+
],
39+
});
40+
/* this is for mapml.js which is imported at run time */
41+
config.module.rules.push({
42+
test: /\.(js|ts)$/,
43+
use: [
44+
{
45+
loader: require.resolve('babel-loader'),
46+
options: {
47+
plugins: [require.resolve('babel-plugin-transform-import-meta')],
48+
},
49+
},
50+
],
51+
});
52+
53+
config.resolve.extensions.push('.ts', '.tsx');
54+
55+
56+
return config;
57+
}
2658
};
2759
export default config;
2860

packages/web/.storybook/preview-head.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,3 +765,5 @@
765765

766766
// ----- End custom copy code buttons -----
767767
</script>
768+
<script src="./dist/gcds/gcds-map/mapml.js" type="module" id="mapml-loader"></script>
769+
<link rel="stylesheet" href="./dist/gcds/gcds-map/gcds-map.css" id="mapml-client-styles">

0 commit comments

Comments
 (0)