Pmtiles js v4 (#499)

* pmtiles js v4: remove pmtiles spec v2 compatibility [#287]
* restructure ts files into src
* add tsup for building ESM/CJS and making types work in ESM
* bump fflate dependency
* update CHANGELOG for js 4.0.0
This commit is contained in:
Brandon Liu
2024-11-26 11:56:41 +08:00
committed by GitHub
parent bbeda97ed4
commit e678dd5326
24 changed files with 2885 additions and 888 deletions

View File

@@ -5,7 +5,13 @@ import Protobuf from "pbf";
import { Dispatch, SetStateAction, useEffect, useRef, useState } from "react";
import { UncontrolledReactSVGPanZoom } from "react-svg-pan-zoom";
import { useMeasure } from "react-use";
import { Entry, Header, PMTiles, TileType, tileIdToZxy } from "../../js/index";
import {
Entry,
Header,
PMTiles,
TileType,
tileIdToZxy,
} from "../../js/src/index";
import { styled } from "./stitches.config";
const TableContainer = styled("div", {

View File

@@ -1,5 +1,5 @@
import { useState } from "react";
import { PMTiles } from "../../js/index";
import { PMTiles } from "../../js/src/index";
import { styled } from "./stitches.config";
import MaplibreMap from "./MaplibreMap";

View File

@@ -1,7 +1,7 @@
import * as DialogPrimitive from "@radix-ui/react-dialog";
import { GitHubLogoIcon } from "@radix-ui/react-icons";
import React, { useState, useEffect } from "react";
import { PMTiles } from "../../js/index";
import { PMTiles } from "../../js/src/index";
import { globalStyles, styled } from "./stitches.config";
import Loader from "./Loader";

View File

@@ -9,8 +9,8 @@ import "maplibre-gl/dist/maplibre-gl.css";
import baseTheme from "protomaps-themes-base";
import React, { useState, useEffect, useRef } from "react";
import { renderToString } from "react-dom/server";
import { Protocol } from "../../js/adapters";
import { PMTiles, TileType } from "../../js/index";
import { Protocol } from "../../js/src/adapters";
import { PMTiles, TileType } from "../../js/src/index";
import { styled } from "./stitches.config";
const BASEMAP_THEME = "black";

View File

@@ -1,6 +1,6 @@
import { JsonViewer } from "@textea/json-viewer";
import { useEffect, useState } from "react";
import { Header, PMTiles } from "../../js/index";
import { Header, PMTiles } from "../../js/src/index";
import { styled } from "./stitches.config";
const Padded = styled("div", {

View File

@@ -1,6 +1,6 @@
import { Dispatch, SetStateAction, useCallback, useState } from "react";
import { useDropzone } from "react-dropzone";
import { FileSource, PMTiles } from "../../js/index";
import { FileSource, PMTiles } from "../../js/src/index";
import { styled } from "./stitches.config";
import * as LabelPrimitive from "@radix-ui/react-label";

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
import { PMTiles } from "../../js/index";
import { PMTiles } from "../../js/src/index";
import { globalStyles, styled } from "./stitches.config";
import Inspector from "./Inspector";
import Start from "./Start";