-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Generate typings on watch mode - Separate out MapShapeEditor component
- Loading branch information
Showing
36 changed files
with
10,226 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
import { | ||
type SourceSpecification, | ||
type GeoJSONSourceSpecification, | ||
type Source, | ||
type GeoJSONSource, | ||
} from 'maplibre-gl'; | ||
|
||
export function getLayerName(sourceKey: string, layerKey: string, managed: boolean) { | ||
if (!managed) { | ||
return layerKey; | ||
} | ||
return `${sourceKey}›${layerKey}`; | ||
} | ||
|
||
type ModifiedSourceSpecification = Exclude<SourceSpecification, GeoJSONSourceSpecification> | Omit<GeoJSONSourceSpecification, 'data'>; | ||
|
||
export function isGeoJSONSourceSpecification( | ||
s: ModifiedSourceSpecification, | ||
): s is Omit<GeoJSONSourceSpecification, 'data'> { | ||
return !!s && s.type === 'geojson'; | ||
} | ||
|
||
export function isGeoJSONSource( | ||
s: Source, | ||
): s is GeoJSONSource { | ||
return !!s && s.type === 'geojson'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
module.exports = { | ||
extends: [ | ||
'airbnb', | ||
'airbnb/hooks', | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
env: { | ||
browser: true, | ||
jest: true, | ||
}, | ||
plugins: [ | ||
'@typescript-eslint', | ||
], | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.jsx', '.ts', '.tsx'], | ||
}, | ||
}, | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
sourceType: 'module', | ||
allowImportExportEverywhere: true, | ||
}, | ||
rules: { | ||
strict: 1, | ||
indent: ['error', 4, { SwitchCase: 1 }], | ||
|
||
'no-unused-vars': 0, | ||
'@typescript-eslint/no-unused-vars': 1, | ||
|
||
'no-use-before-define': 0, | ||
'@typescript-eslint/no-use-before-define': 1, | ||
|
||
// note you must disable the base rule as it can report incorrect errors | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': ['error'], | ||
|
||
'import/no-unresolved': ['error'], | ||
'import/extensions': ['off', 'never'], | ||
'import/no-extraneous-dependencies': ['error', { devDependencies: true }], | ||
|
||
'react/prop-types': 0, | ||
'react/require-default-props': ['warn', { | ||
ignoreFunctionalComponents: true, | ||
}], | ||
|
||
'react/jsx-indent': [2, 4], | ||
'react/jsx-indent-props': [2, 4], | ||
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx', '.ts', '.tsx'] }], | ||
|
||
'import/no-relative-packages': 0, | ||
|
||
'react-hooks/rules-of-hooks': 'error', | ||
'react-hooks/exhaustive-deps': 'warn', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
legacy-peer-deps=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { mergeConfig } = require('vite'); | ||
|
||
module.exports = { | ||
async viteFinal(config) { | ||
return mergeConfig(config, { | ||
css: { | ||
modules: { | ||
localsConvention: 'camelCase', | ||
}, | ||
}, | ||
}); | ||
}, | ||
"stories": [ | ||
"../stories/**/*.stories.mdx", | ||
"../stories/**/*.stories.@(js|jsx|ts|tsx)" | ||
], | ||
"addons": [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions" | ||
], | ||
"framework": "@storybook/react", | ||
"core": { | ||
"builder": "@storybook/builder-vite" | ||
}, | ||
"features": { | ||
"storyStoreV7": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script> | ||
window.global = window; | ||
</script> | ||
<style> | ||
* { | ||
box-sizing: border-box; | ||
} | ||
</style> | ||
|
||
<!-- | ||
<link href="https://fonts.googleapis.com/css?family=Oxygen+Mono|Source+Sans+Pro:400,600" rel="stylesheet"> | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'maplibre-gl/dist/maplibre-gl.css'; | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"plugins": [], | ||
"extends": [ | ||
"stylelint-config-recommended", | ||
"stylelint-config-concentric" | ||
], | ||
"rules": { | ||
"indentation": 4, | ||
"selector-pseudo-class-no-unknown": [ | ||
true, | ||
{ | ||
"ignorePseudoClasses": ["global"] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"entry": ["./stories/**/*.stories.tsx"], | ||
"ignorePatterns": ["node_modules/**", "build/**"], | ||
"ignoreUnimported": ["**/*.d.ts"], | ||
"extensions": [".ts", ".js", ".tsx", ".jsx"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module '*.css' { | ||
const content: {[className: string]: string}; | ||
export default content; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"name": "@togglecorp/re-map-storybook", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"typecheck": "tsc", | ||
"lint": "eslint ./stories --report-unused-disable-directives", | ||
"check-unused": "unimported", | ||
"storybook": "start-storybook -p 6006 --no-open", | ||
"build-storybook": "build-storybook" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@mapbox/mapbox-gl-draw": "^1.4.3", | ||
"@togglecorp/fujs": "^2.0.0", | ||
"@togglecorp/re-map": "^0.3.0", | ||
"immer": "^10.0.3", | ||
"maplibre-gl": "^3.5.2", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.22.8", | ||
"@storybook/addon-actions": "^6.5.12", | ||
"@storybook/addon-essentials": "^6.5.12", | ||
"@storybook/addon-interactions": "^6.5.12", | ||
"@storybook/addon-links": "^6.5.12", | ||
"@storybook/builder-vite": "^0.2.3", | ||
"@storybook/react": "^6.5.12", | ||
"@storybook/testing-library": "^0.0.13", | ||
"@types/react": "^18.2.14", | ||
"@types/react-dom": "^18.2.6", | ||
"@typescript-eslint/eslint-plugin": "^5.61.0", | ||
"@typescript-eslint/parser": "^5.61.0", | ||
"babel-loader": "^8.2.5", | ||
"eslint": "^8.44.0", | ||
"eslint-config-airbnb": "^19.0.4", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-jsx-a11y": "^6.7.1", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"postcss-nested": "^6.0.0", | ||
"postcss-normalize": "^10.0.1", | ||
"postcss-preset-env": "^7.8.2", | ||
"stylelint": "^14.13.0", | ||
"stylelint-config-concentric": "^2.0.2", | ||
"stylelint-config-recommended": "^9.0.0", | ||
"typescript": "^5.1.6", | ||
"unimported": "^1.22.0", | ||
"vite": "^3.1.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
plugins: [ | ||
require('postcss-nested'), | ||
require('postcss-normalize'), | ||
require('postcss-preset-env'), | ||
], | ||
}; |
Oops, something went wrong.