diff --git a/.changeset/orange-points-eat.md b/.changeset/orange-points-eat.md new file mode 100644 index 0000000000..73496e2d8d --- /dev/null +++ b/.changeset/orange-points-eat.md @@ -0,0 +1,16 @@ +--- +'@antv/l7-component': patch +'@antv/l7-core': patch +'@antv/l7': patch +'@antv/l7-layers': patch +'@antv/l7-map': patch +'@antv/l7-maps': patch +'@antv/l7-renderer': patch +'@antv/l7-scene': patch +'@antv/l7-source': patch +'@antv/l7-test-utils': patch +'@antv/l7-three': patch +'@antv/l7-utils': patch +--- + +raster tile extent diff --git a/package.json b/package.json index 9e88de448f..2aa525558e 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "@commitlint/cli": "^19.2.1", "@commitlint/config-conventional": "^19.1.0", "@types/jest": "^29.5.1", + "@types/lodash": "^4.17.14", "@types/offscreencanvas": "^2019.7.0", "@types/pixelmatch": "^5.2.5", "@types/pngjs": "^6.0.3", @@ -87,7 +88,7 @@ "babel-plugin-transform-import-css-l7": "^0.0.6", "case-police": "^0.6.1", "cross-env": "^7.0.2", - "eslint": "^8.54.0", + "eslint": "^9.17.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-jest": "^27.9.0", "eslint-plugin-jsx-a11y": "^6.8.0", @@ -117,6 +118,7 @@ "stylelint": "^16.3.0", "stylelint-config-standard": "^36.0.0", "stylelint-declaration-block-no-ignored-properties": "^2.8.0", + "swr": "^2.2.5", "terminate": "latest", "ts-jest": "^29.1.1", "ts-node": "^10.9.2", diff --git a/packages/core/src/services/asset/FontService.ts b/packages/core/src/services/asset/FontService.ts index 421aa91e18..b16a1fcf5a 100644 --- a/packages/core/src/services/asset/FontService.ts +++ b/packages/core/src/services/asset/FontService.ts @@ -241,9 +241,11 @@ export default class FontService extends EventEmitter implements IFontService { // 3. layout characters if (sdf) { + // @ts-ignore const tinySDF = new TinySDF(fontSize, buffer, radius, cutoff, fontFamily, fontWeight); // used to store distance values from tinySDF // tinySDF.size equals `fontSize + buffer * 2` + // @ts-ignore const imageData = ctx.getImageData(0, 0, tinySDF.size, tinySDF.size); for (const char of characterSet) { if (iconfont) { @@ -254,8 +256,10 @@ export default class FontService extends EventEmitter implements IFontService { const icon = String.fromCharCode(parseInt(char.replace('&#x', '').replace(';', ''), 16)); const iconData = tinySDF.draw(icon); + // @ts-ignore populateAlphaChannel(iconData, imageData); } else { + // @ts-ignore populateAlphaChannel(tinySDF.draw(char), imageData); } // populateAlphaChannel(tinySDF.draw(char), imageData); diff --git a/packages/utils/src/color.ts b/packages/utils/src/color.ts index a16960c46d..dc8e072341 100644 --- a/packages/utils/src/color.ts +++ b/packages/utils/src/color.ts @@ -1,3 +1,4 @@ +// @ts-ignore import * as d3 from 'd3-color'; import type { Context } from 'vm'; export interface IColorRamp { diff --git a/site/.dumi/pages/404.tsx b/site/.dumi/pages/404.tsx index b8b058eccf..2a8b032991 100644 --- a/site/.dumi/pages/404.tsx +++ b/site/.dumi/pages/404.tsx @@ -1,8 +1,8 @@ +import SEO from '@antv/dumi-theme-antv/dist/common/SEO'; import React from 'react'; import { NotFound as NotFoundPage } from '../slots/404'; import { Footer } from '../slots/Footer'; import { Header } from '../slots/Header'; -import { SEO } from '../slots/SEO'; /** * 404 页面 diff --git a/site/.dumi/pages/Examples/index.tsx b/site/.dumi/pages/Examples/index.tsx index abf65a0745..c3b1b42f34 100644 --- a/site/.dumi/pages/Examples/index.tsx +++ b/site/.dumi/pages/Examples/index.tsx @@ -1,11 +1,11 @@ import { VerticalAlignTopOutlined } from '@ant-design/icons'; +import SEO from '@antv/dumi-theme-antv/dist/common/SEO'; import { ThemeAntVContext } from '@antv/dumi-theme-antv/dist/context'; import { Article } from '@antv/dumi-theme-antv/dist/pages/Examples/components/Article'; import { ExampleTopicMenu } from '@antv/dumi-theme-antv/dist/pages/Examples/components/ExampleTopicMenu'; import { Footer } from '@antv/dumi-theme-antv/dist/slots/Footer'; import { Header } from '@antv/dumi-theme-antv/dist/slots/Header'; import NavigatorBanner from '@antv/dumi-theme-antv/dist/slots/Header/Products/NavigatorBanner'; -import { SEO } from '@antv/dumi-theme-antv/dist/slots/SEO'; import { usePrevAndNext } from '@antv/dumi-theme-antv/dist/slots/hooks'; import type { ExampleTopic } from '@antv/dumi-theme-antv/dist/types'; import { Layout as AntLayout, BackTop } from 'antd'; diff --git a/site/.dumi/theme/plugin.ts b/site/.dumi/theme/plugin.ts deleted file mode 100644 index d672ec7f44..0000000000 --- a/site/.dumi/theme/plugin.ts +++ /dev/null @@ -1,106 +0,0 @@ -import cheerio from 'cheerio'; -import type { IApi } from 'dumi'; -import fs from 'fs'; -import path from 'path'; -import readMarkdown from 'read-markdown'; - -export default (api: IApi) => { - api.describe({ - key: 'docsMeta', - config: { - schema(joi) { - return joi.string(); - }, - }, - // enableBy: api.EnableBy.config - }); - - api.modifyExportHTMLFiles(async (files: Array<{ path: string; content: string }>) => { - const newFiles = await Promise.all( - files.map(async (file) => { - const pathItems = file.path.split('/'); - const prefix = pathItems[0]; - let pathstr = file.path; - // API/Tutorial - if ((prefix === 'en' || prefix === 'zh') && pathItems[1] !== 'examples') { - pathstr = - '../../docs/' + file.path.substring(3).replace(/\/index\.html/, `.${prefix}.md`); - } - - if (pathItems[0] === 'api' || pathItems[0] === 'tutorial') { - pathstr = '../../docs/' + file.path.replace(/\/index.html/, '.zh.md'); - } - - if (pathItems[0] === 'common') { - pathstr = '../../docs/' + file.path.replace(/\/index.html/, '.md'); - } - - // Examples - if ((prefix === 'en' || prefix === 'zh') && pathItems[1] === 'examples') { - pathstr = '../../' + pathItems.slice(1).join('/').replace(/html/, `${prefix}.md`); - } - if (pathItems[0] === 'examples') { - pathstr = '../../' + pathItems.join('/').replace(/\.html/, '.zh.md'); - } - - // custom - - if (pathItems[0] === 'custom') { - pathstr = '../../' + file.path.replace(/\/index.html/, '.md'); - } - - // const md = `./docs/${pathstr}`; - const md = path.resolve(__dirname, pathstr); - - const keywords: string[] = []; - - // 提取demo 关键字 - if (pathItems[0] === 'examples' || pathItems[1] === 'examples') { - const metaPath = md.split('/').slice(0, -1).join('/') + '/demo/meta.json'; - if (fs.existsSync(metaPath)) { - const metas = JSON.parse(fs.readFileSync(metaPath, 'utf-8')); - - keywords.push( - ...metas.demos.map((demo: any) => { - return demo.title.zh ? demo.title.zh : demo.title; - }), - ); - } - } - - if (fs.existsSync(md)) { - const str = await readMarkdown(md); - const mdData = str[md].data || {}; - const { title, description } = mdData; - const $ = cheerio.load(file.content); - - if (description) { - $('head').append(``); - $('head').append(` 0) { - $('head').append(``); - } - if (title) { - const main = $('title').text(); - const newTitle = `${title} | ${main}`; - $('head').append(``); - $('title').text(newTitle); - } - - file.content = $.html(); - } else { - console.log('no file', md, file.path); - } - - return file; - }), - ); - return newFiles; - }); -}; diff --git a/site/.dumi/theme/slots/ManualContent/index.tsx b/site/.dumi/theme/slots/ManualContent/index.tsx index 258ef361fd..b5db024ca0 100644 --- a/site/.dumi/theme/slots/ManualContent/index.tsx +++ b/site/.dumi/theme/slots/ManualContent/index.tsx @@ -13,8 +13,8 @@ import { useMedia } from 'react-use'; import readingTime from 'reading-time'; import URI from 'uri-parse'; +import SEO from '@antv/dumi-theme-antv/dist/common/SEO'; import { ContentTable } from '@antv/dumi-theme-antv/dist/slots/ContentTable'; -import { SEO } from '@antv/dumi-theme-antv/dist/slots/SEO'; import GithubButtonBar from '../GithubButtonBar'; import { NavigatorBanner } from '@antv/dumi-theme-antv/dist/slots/ManualContent/NavigatorBanner'; diff --git a/site/package.json b/site/package.json index b9048862da..27de503dbd 100644 --- a/site/package.json +++ b/site/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@ant-design/icons": "^5.3.6", - "@antv/dumi-theme-antv": "^0.x", + "@antv/dumi-theme-antv": "^0.5.6", "@antv/g2": "^4.2.8", "@antv/l7-composite-layers": "^0.15.0", "@antv/l7-draw": "^3.0.9", @@ -55,6 +55,7 @@ "geojson2svg": "^1.3.3", "geotiff": "^2.0.7", "lerc": "^3.0.0", + "swr": "^2.3.0", "lodash-es": "^4.17.21", "pbf": "^3.2.1", "pmtiles": "^2.7.2", diff --git a/site/site/pages/index.zh.tsx b/site/site/pages/index.zh.tsx index 1344cc4af0..48d8374396 100644 --- a/site/site/pages/index.zh.tsx +++ b/site/site/pages/index.zh.tsx @@ -1,8 +1,8 @@ +import SEO from '@antv/dumi-theme-antv/dist/common/SEO'; import Banner from '@antv/gatsby-theme-antv/site/components/Banner'; import Cases from '@antv/gatsby-theme-antv/site/components/Cases'; import Companies from '@antv/gatsby-theme-antv/site/components/Companies'; import Features from '@antv/gatsby-theme-antv/site/components/Features'; -import SEO from '@antv/gatsby-theme-antv/site/components/Seo'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { L7Draw } from '../components/L7Draw';