diff --git a/packages/color-utils/CHANGELOG.md b/packages/color-utils/CHANGELOG.md index ec66e4c6..127ec111 100644 --- a/packages/color-utils/CHANGELOG.md +++ b/packages/color-utils/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.2.1] - 2026-01-29 + +- Change layout of `package.json` and explicitly mark no side effects. + ## [1.2.0] - 2026-01-27 Change build system from Parcel to Vite diff --git a/packages/color-utils/package.json b/packages/color-utils/package.json index 1def51f1..42972b93 100644 --- a/packages/color-utils/package.json +++ b/packages/color-utils/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/color-utils", - "version": "1.2.0", + "version": "1.2.1", "description": "Color utility functions", "repository": { "type": "git", @@ -18,12 +18,18 @@ "src", "dist" ], + "sideEffects": false, "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, diff --git a/packages/column-components/CHANGELOG.md b/packages/column-components/CHANGELOG.md index b58dd4ae..fc130d86 100644 --- a/packages/column-components/CHANGELOG.md +++ b/packages/column-components/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.4] - 2026-01-29 + +- Change layout of `package.json` +- Remove `ui-box` dependency in favor of `@macrostrat/ui-components` +- Remove color picker +- Bundle `labella` dependency to avoid CommonJS issues + ## [2.0.3] - 2026-01-28 Update handling of `@uiw/react-color` dependency diff --git a/packages/column-components/package.json b/packages/column-components/package.json index f155cb70..e342ed8d 100644 --- a/packages/column-components/package.json +++ b/packages/column-components/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/column-components", - "version": "2.0.3", + "version": "2.0.4", "description": "React rendering primitives for stratigraphic columns", "keywords": [ "geology", @@ -31,9 +31,14 @@ "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + }, "style": "./dist/column-components.css" }, "./package.json": "./package.json", @@ -53,8 +58,6 @@ "@macrostrat/stratigraphy-utils": "workspace:^", "@macrostrat/timescale": "workspace:^", "@macrostrat/ui-components": "workspace:^", - "@uiw/react-color": "^2.9.2", - "chroma-js": "^3.2.0", "classnames": "^2.5.1", "d3-axis": "^3.0.0", "d3-format": "^3.1.2", @@ -67,12 +70,14 @@ "react-scroll": "^1.7.16", "react-select": "^3.0.8", "react-svg-textures": "^1.4.7", - "ui-box": "^5.4.1", "uuid": "^7.0.3" }, "devDependencies": { "@macrostrat/web-components-bundler": "workspace:*" }, + "rollupInternal": [ + "labella" + ], "publishConfig": { "access": "public" } diff --git a/packages/column-components/src/edit-overlay.ts b/packages/column-components/src/edit-overlay.ts index 1db71eb8..648a801d 100644 --- a/packages/column-components/src/edit-overlay.ts +++ b/packages/column-components/src/edit-overlay.ts @@ -15,7 +15,7 @@ import { ColumnDivision, } from "./context"; import chroma from "chroma-js"; -import Box from "ui-box"; +import { Box } from "@macrostrat/ui-components"; const fmt = format(".1f"); const fmt2 = format(".2f"); diff --git a/packages/column-components/src/editor/facies/color-picker.ts b/packages/column-components/src/editor/facies/color-picker.ts deleted file mode 100644 index ad3f11e6..00000000 --- a/packages/column-components/src/editor/facies/color-picker.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Component } from "react"; -import h from "@macrostrat/hyper"; -import { Swatch } from "@uiw/react-color"; -import { Popover } from "@blueprintjs/core"; -import { FaciesContext } from "../../context"; - -interface FaciesColorPickerProps { - facies: { - id: number; - color: string; - }; -} - -class FaciesColorPicker extends Component { - static contextType = FaciesContext; - declare context: any; - - render() { - const { setFaciesColor } = this.context; - const { facies: d } = this.props; - return h("div", [ - h(Swatch, { - color: d.color || "black", - onChange(color) { - return setFaciesColor(d.id, color.hex); - }, - }), - ]); - } -} - -const BasicFaciesSwatch = ({ facies: d, ...rest }) => - h("div.color-swatch", { - style: { - backgroundColor: d.color || "black", - width: "2em", - height: "2em", - }, - ...rest, - }); - -interface FaciesSwatchProps { - isEditable: boolean; - facies: { - id: number; - color: string; - } | null; -} - -class FaciesSwatch extends Component { - static defaultProps = { - isEditable: true, - facies: null, - }; - constructor(props) { - super(props); - } - - render() { - const { facies, isEditable } = this.props; - const basic = h(BasicFaciesSwatch, { facies }); - if (!isEditable) { - return basic; - } - return h( - Popover, - { - // tetherOptions: { - // constraints: [{ attachment: "together", to: "scrollParent" }], - // }, - }, - [basic, h(FaciesColorPicker, { facies })], - ); - } -} - -export { FaciesSwatch, BasicFaciesSwatch }; diff --git a/packages/column-components/src/editor/facies/description.ts b/packages/column-components/src/editor/facies/description.ts index 6654b091..f425887e 100644 --- a/packages/column-components/src/editor/facies/description.ts +++ b/packages/column-components/src/editor/facies/description.ts @@ -2,7 +2,7 @@ import { Component } from "react"; import h from "@macrostrat/hyper"; import classNames from "classnames"; import { FaciesContext } from "../../context"; -import { FaciesSwatch } from "./color-picker"; +import { FaciesSwatch } from "./swatch"; type FaciesData = any; diff --git a/packages/column-components/src/editor/facies/index.ts b/packages/column-components/src/editor/facies/index.ts index 37da8280..17f41606 100644 --- a/packages/column-components/src/editor/facies/index.ts +++ b/packages/column-components/src/editor/facies/index.ts @@ -1,3 +1,2 @@ -export * from "./color-picker"; -export * from "./picker"; +export * from "./swatch"; export * from "./description"; diff --git a/packages/column-components/src/editor/facies/picker.ts b/packages/column-components/src/editor/facies/picker.ts deleted file mode 100644 index c1277540..00000000 --- a/packages/column-components/src/editor/facies/picker.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Component } from "react"; -import { hyperStyled } from "@macrostrat/hyper"; -import { ColumnDivision, FaciesContext } from "../../context"; -import { BasicFaciesSwatch } from "./color-picker"; -import { RaisedSelect } from "../util"; -import styles from "../main.module.scss"; - -const h = hyperStyled(styles); - -const FaciesRow = ({ facies }) => - h("span.facies-picker-row", [ - h(BasicFaciesSwatch, { facies, className: "facies-color-swatch" }), - h("span.facies-picker-name", facies.name), - ]); - -interface FaciesPickerProps { - interval: ColumnDivision; - onChange: (f: number) => void; -} - -export class FaciesPicker extends Component { - static contextType = FaciesContext; - declare context: any; - - render() { - const { facies } = this.context; - const { interval, onChange } = this.props; - - const options = facies.map((f) => ({ - value: f.id, - label: h(FaciesRow, { facies: f }), - })); - - let value = options.find((d) => d.value === interval.facies); - if (value == null) { - value = null; - } - - return h(RaisedSelect, { - id: "facies-select", - options, - value, - selected: interval.facies, - isClearable: true, - onChange(res) { - console.log("Changing", res); - const f = res != null ? res.value : null; - return onChange(f); - }, - }); - } -} diff --git a/packages/column-components/src/editor/facies/swatch.ts b/packages/column-components/src/editor/facies/swatch.ts new file mode 100644 index 00000000..0124a0af --- /dev/null +++ b/packages/column-components/src/editor/facies/swatch.ts @@ -0,0 +1,123 @@ +import { Component } from "react"; +import { hyperStyled } from "@macrostrat/hyper"; +import { ColumnDivision, FaciesContext } from "../../context"; +import { RaisedSelect } from "../util"; +import styles from "../main.module.scss"; + +const h = hyperStyled(styles); + +const FaciesRow = ({ facies }) => + h("span.facies-picker-row", [ + h(BasicFaciesSwatch, { facies, className: "facies-color-swatch" }), + h("span.facies-picker-name", facies.name), + ]); + +interface FaciesPickerProps { + interval: ColumnDivision; + onChange: (f: number) => void; +} + +export class FaciesPicker extends Component { + static contextType = FaciesContext; + declare context: any; + + render() { + const { facies } = this.context; + const { interval, onChange } = this.props; + + const options = facies.map((f) => ({ + value: f.id, + label: h(FaciesRow, { facies: f }), + })); + + let value = options.find((d) => d.value === interval.facies); + if (value == null) { + value = null; + } + + return h(RaisedSelect, { + id: "facies-select", + options, + value, + selected: interval.facies, + isClearable: true, + onChange(res) { + console.log("Changing", res); + const f = res != null ? res.value : null; + return onChange(f); + }, + }); + } +} + +//import { Swatch } from "@uiw/react-color"; +//import { Popover } from "@blueprintjs/core"; +//import { FaciesContext } from "../../context"; + +interface FaciesColorPickerProps { + facies: { + id: number; + color: string; + }; +} + +// class FaciesColorPicker extends Component { +// static contextType = FaciesContext; +// declare context: any; +// +// render() { +// const { setFaciesColor } = this.context; +// const { facies: d } = this.props; +// return h("div", [ +// h(Swatch, { +// color: d.color || "black", +// onChange(color) { +// return setFaciesColor(d.id, color.hex); +// }, +// }), +// ]); +// } +// } + +export const BasicFaciesSwatch = ({ facies: d, ...rest }) => + h("div.color-swatch", { + style: { + backgroundColor: d.color || "black", + width: "2em", + height: "2em", + }, + ...rest, + }); + +interface FaciesSwatchProps { + isEditable: boolean; + facies: { + id: number; + color: string; + } | null; +} + +export class FaciesSwatch extends Component { + static defaultProps = { + isEditable: true, + facies: null, + }; + constructor(props) { + super(props); + } + + render() { + const { facies, isEditable = false } = this.props; + const basic = h(BasicFaciesSwatch, { facies }); + return basic; + // return h( + // Popover, + // { + // // tetherOptions: { + // // constraints: [{ attachment: "together", to: "scrollParent" }], + // // }, + // }, + // [basic, h(FaciesColorPicker, { facies })], + // ); + } +} diff --git a/packages/column-components/src/util/column-box.ts b/packages/column-components/src/util/column-box.ts index b74a9dd8..2022cd9a 100644 --- a/packages/column-components/src/util/column-box.ts +++ b/packages/column-components/src/util/column-box.ts @@ -2,7 +2,7 @@ import h from "@macrostrat/hyper"; import { useContext } from "react"; import { ColumnContext } from "../context"; import classNames from "classnames"; -import { default as Box } from "ui-box"; +import { Box } from "@macrostrat/ui-components"; import { path } from "d3-path"; import type { Path } from "d3-path"; diff --git a/packages/column-components/src/util/scroll-box.ts b/packages/column-components/src/util/scroll-box.ts index 596b7592..c24bee0f 100644 --- a/packages/column-components/src/util/scroll-box.ts +++ b/packages/column-components/src/util/scroll-box.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useRef } from "react"; -import Box from "ui-box"; +import { Box } from "@macrostrat/ui-components"; import h from "@macrostrat/hyper"; import { useColumn } from "../context"; diff --git a/packages/column-creator/package.json b/packages/column-creator/package.json index aa0bb7a9..b7edf6d7 100644 --- a/packages/column-creator/package.json +++ b/packages/column-creator/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/column-creator", - "version": "0.2.1", + "version": "0.2.2", "private": true, "description": "Interface for defining stratigraphic columns in a standardized format", "repository": { @@ -9,9 +9,9 @@ "directory": "packages/column-creator" }, "license": "MIT", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "style": "dist/column-creator.css", @@ -25,9 +25,14 @@ "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + }, "style": "./dist/column-creator.css" }, "./package.json": "./package.json", @@ -49,7 +54,6 @@ "@macrostrat/hyper": "^3.0.6", "@macrostrat/ui-components": "workspace:^", "immutability-helper": "^3.1.1", - "ui-box": "^5.4.1", "zustand": "^5.0.3", "zustand-computed": "^2.0.2" }, diff --git a/packages/column-creator/src/index.ts b/packages/column-creator/src/index.ts index be4fa886..6f368f6d 100644 --- a/packages/column-creator/src/index.ts +++ b/packages/column-creator/src/index.ts @@ -2,7 +2,7 @@ import { ColumnCreatorData, ColumnCreatorProvider, useSelector } from "./store"; import { ColorCell, ColorPicker, DataSheet } from "@macrostrat/data-sheet"; export * from "./store"; -import { FlexRow, ToasterContext } from "@macrostrat/ui-components"; +import { FlexRow, ToasterContext, Box } from "@macrostrat/ui-components"; import { BasicUnitComponent, Column, @@ -14,7 +14,6 @@ import { Radio, RadioGroup, SegmentedControl } from "@blueprintjs/core"; import { useState } from "react"; import styles from "./index.module.sass"; -import Box from "ui-box"; const h = hyper.styled(styles); diff --git a/packages/column-views/CHANGELOG.md b/packages/column-views/CHANGELOG.md index 3d2fb549..e005decf 100644 --- a/packages/column-views/CHANGELOG.md +++ b/packages/column-views/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.0.3] - 2026-01-29 + +- Change layout of `package.json` + ## [3.0.2] - 2026-01-28 Add rollup interop to fix CommonJS dependency linking issues diff --git a/packages/column-views/package.json b/packages/column-views/package.json index 9dc5b9aa..7f8c9bbe 100644 --- a/packages/column-views/package.json +++ b/packages/column-views/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/column-views", - "version": "3.0.2", + "version": "3.0.3", "description": "Data views for Macrostrat stratigraphic columns", "repository": { "type": "git", @@ -8,9 +8,9 @@ "directory": "packages/column-views" }, "license": "MIT", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "style": "dist/column-views.css", @@ -24,9 +24,14 @@ "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + }, "style": "./dist/column-views.css" }, "./package.json": "./package.json", diff --git a/packages/cross-section-utils/package.json b/packages/cross-section-utils/package.json index 496cba28..5949e1ba 100644 --- a/packages/cross-section-utils/package.json +++ b/packages/cross-section-utils/package.json @@ -3,8 +3,43 @@ "version": "0.1.0", "private": true, "description": "Cross-section visualization", + "repository": { + "type": "git", + "url": "https://github.com/UW-Macrostrat/web-components.git", + "directory": "packages/cross-section-utils" + }, + "license": "MIT", + "source": "src/index.ts", + "main": "dist/index.cjs", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "src", + "dist" + ], + "sideEffects": false, + "exports": { + ".": { + "source": "./src/index.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" + }, + "scripts": { + "build": "bundle-library ." + }, "dependencies": { "@derschmale/tympanum": "^1.3.6", "@macrostrat/hyper": "^3.0.6" + }, + "devDependencies": { + "@macrostrat/web-components-bundler": "workspace:*" } } diff --git a/packages/data-components/CHANGELOG.md b/packages/data-components/CHANGELOG.md index 17b39d71..0f26a933 100644 --- a/packages/data-components/CHANGELOG.md +++ b/packages/data-components/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [1.0.1] - 2026-01-29 + +- Change layout of `package.json` + ## [1.0.0] - 2026-01-26 - Update peer dependencies to React 18 diff --git a/packages/data-components/package.json b/packages/data-components/package.json index 063ba561..ed20d98c 100644 --- a/packages/data-components/package.json +++ b/packages/data-components/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/data-components", - "version": "1.0.0", + "version": "1.0.2", "description": "A library of React components tailored for Macrostrat data and endpoints", "repository": { "type": "git", @@ -8,9 +8,9 @@ "directory": "packages/data-components" }, "license": "MIT", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "style": "dist/data-components.css", @@ -24,9 +24,14 @@ "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + }, "style": "./dist/data-components.css" }, "./package.json": "./package.json", diff --git a/packages/data-sheet/CHANGELOG.md b/packages/data-sheet/CHANGELOG.md index f6657541..088ff23d 100644 --- a/packages/data-sheet/CHANGELOG.md +++ b/packages/data-sheet/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.0.2] - 2026-01-29 + +- Change layout of `package.json` and remove `@uiw/react-color` dependency in + favor of `@macrostrat/ui-components` color picker + ## [3.0.1] - 2026-01-28 Update handling of `@uiw/react-color` dependency diff --git a/packages/data-sheet/package.json b/packages/data-sheet/package.json index e51b7770..c7b7a5e9 100644 --- a/packages/data-sheet/package.json +++ b/packages/data-sheet/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/data-sheet", - "version": "3.0.1", + "version": "3.0.2", "description": "Scalable data sheet with optional editing capabilities", "repository": { "type": "git", @@ -9,9 +9,9 @@ }, "license": "MIT", "author": "Daven Quinn", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "style": "dist/data-sheet.css", @@ -25,9 +25,14 @@ "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + }, "style": "./dist/data-sheet.css" }, "./package.json": "./package.json", @@ -49,8 +54,6 @@ "@macrostrat/ui-components": "workspace:^", "@supabase/postgrest-js": "^1.17.7", "@types/underscore": "^1.13.0", - "@uiw/react-color": "^2.9.2", - "chroma-js": "^3.2.0", "classnames": "^2.5.1", "immutability-helper": "^3.1.1", "underscore": "^1.13.7", diff --git a/packages/data-sheet/src/components/colors.ts b/packages/data-sheet/src/components/colors.ts index 542fabf5..dccb9a91 100644 --- a/packages/data-sheet/src/components/colors.ts +++ b/packages/data-sheet/src/components/colors.ts @@ -2,14 +2,12 @@ import { Cell } from "@blueprintjs/table"; import { useInDarkMode } from "@macrostrat/ui-components"; import hyper from "@macrostrat/hyper"; import styles from "./main.module.sass"; -import { - asChromaColor, - getLuminanceAdjustedColorScheme, -} from "@macrostrat/color-utils"; -import { useEffect, useMemo, useRef, useState } from "react"; +import { getLuminanceAdjustedColorScheme } from "@macrostrat/color-utils"; import { memoize } from "underscore"; -import { Sketch } from "@uiw/react-color"; import classNames from "classnames"; +import { ColorPicker2 } from "@macrostrat/ui-components"; + +export const ColorPicker = ColorPicker2; const h = hyper.styled(styles); @@ -69,51 +67,3 @@ export function colorSwatchRenderer(value) { } const colorCombo = memoize(getLuminanceAdjustedColorScheme); - -enum ColorConversionType { - HEX = "hex", - RGB = "rgb", - HSL = "hsl", - CSS = "css", -} - -export function ColorPicker({ - value, - onChange, - editable = true, - type = ColorConversionType.CSS, -}) { - const ref = useRef(null); - useEffect(() => { - if (ref.current == null) return; - ref.current.focus(); - }, []); - - const color = useMemo(() => { - try { - return asChromaColor(value).hex(); - } catch { - return "#aaaaaa"; - } - }, [value]); - - return h( - "div.color-picker-container", - { - onKeyDown(evt) { - if (evt.key === "Escape") { - evt.preventDefault(); - } - }, - ref, - tabIndex: 0, - }, - h(Sketch, { - color, - disableAlpha: true, - onChange(color) { - onChange(asChromaColor(color.hexa)[type]()); - }, - }), - ); -} diff --git a/packages/data-sheet/src/components/main.module.sass b/packages/data-sheet/src/components/main.module.sass index f9c11a52..09de1d7a 100644 --- a/packages/data-sheet/src/components/main.module.sass +++ b/packages/data-sheet/src/components/main.module.sass @@ -34,12 +34,6 @@ width: 100% height: 100% - -// Color picker -.color-picker-container - :global .w-color-sketch - --sketch-background: var(--secondary-background) !important - .color-swatch width: 18px height: 18px diff --git a/packages/feedback-components/CHANGELOG.md b/packages/feedback-components/CHANGELOG.md index aa1f39c8..b9540ded 100644 --- a/packages/feedback-components/CHANGELOG.md +++ b/packages/feedback-components/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.1] - 2026-01-29 + +- Change layout of `package.json` + ## [2.0.0] - 2026-01-26 - Update peer dependencies to React 18 diff --git a/packages/feedback-components/package.json b/packages/feedback-components/package.json index 01da0b7c..c8d24265 100644 --- a/packages/feedback-components/package.json +++ b/packages/feedback-components/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/feedback-components", - "version": "2.0.0", + "version": "2.0.1", "description": "", "repository": { "type": "git", @@ -9,9 +9,9 @@ }, "license": "MIT", "author": "Daven Quinn", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "style": "dist/feedback-components.css", @@ -25,9 +25,14 @@ "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + }, "style": "./dist/feedback-components.css" }, "./package.json": "./package.json", diff --git a/packages/form-components/CHANGELOG.md b/packages/form-components/CHANGELOG.md index b4b1e371..1bf4d366 100644 --- a/packages/form-components/CHANGELOG.md +++ b/packages/form-components/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [1.0.3] - 2026-01-29 + +- Change layout of `package.json` + ## [1.0.2] - 2026-01-28 Add rollup interop to fix CommonJS dependency linking issues diff --git a/packages/form-components/package.json b/packages/form-components/package.json index 5d06b163..2acbd03e 100644 --- a/packages/form-components/package.json +++ b/packages/form-components/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/form-components", - "version": "1.0.2", + "version": "1.0.3", "description": "Form components for user input into Macrostrat apps", "repository": { "type": "git", @@ -8,9 +8,9 @@ "directory": "packages/form-components" }, "license": "MIT", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "style": "dist/form-components.css", @@ -24,9 +24,14 @@ "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + }, "style": "./dist/form-components.css" }, "./package.json": "./package.json", @@ -57,8 +62,7 @@ "@types/react-dom": "^18", "axios": "^1.13.2", "classnames": "^2.5.1", - "mapbox-gl": "^2.15.0||^3.0.0", - "ui-box": "^5.4.1" + "mapbox-gl": "^2.15.0||^3.0.0" }, "devDependencies": { "@macrostrat/web-components-bundler": "workspace:*" diff --git a/packages/form-components/src/actions/action-preflight.stories.ts b/packages/form-components/src/actions/action-preflight.stories.ts index 0d292810..1c868625 100644 --- a/packages/form-components/src/actions/action-preflight.stories.ts +++ b/packages/form-components/src/actions/action-preflight.stories.ts @@ -1,12 +1,12 @@ import type { Meta, StoryFn, StoryObj } from "@storybook/react-vite"; import h from "@macrostrat/hyper"; import { ActionDef, ActionsPreflightPanel } from "."; -import Box from "ui-box"; import { FormGroup, NumericInput, Spinner } from "@blueprintjs/core"; import { NullableSlider, ToasterContext, useToaster, + Box } from "@macrostrat/ui-components"; import { BaseDataTypeSelect, diff --git a/packages/form-components/src/item-select/examples.ts b/packages/form-components/src/item-select/examples.ts index 6ee1c2f7..68d1b4c9 100644 --- a/packages/form-components/src/item-select/examples.ts +++ b/packages/form-components/src/item-select/examples.ts @@ -2,7 +2,7 @@ * NOT exported. */ import h from "@macrostrat/hyper"; -import Box from "ui-box"; +import { Box } from "@macrostrat/ui-components"; import { MenuItem } from "@blueprintjs/core"; import { ItemSelect } from "."; diff --git a/packages/form-components/src/item-select/item-select.stories.ts b/packages/form-components/src/item-select/item-select.stories.ts index 2f6f9595..7f02569b 100644 --- a/packages/form-components/src/item-select/item-select.stories.ts +++ b/packages/form-components/src/item-select/item-select.stories.ts @@ -1,7 +1,6 @@ import type { Meta, StoryFn } from "@storybook/react-vite"; import h from "@macrostrat/hyper"; -import Box from "ui-box"; -import { ToasterContext } from "@macrostrat/ui-components"; +import { Box, ToasterContext } from "@macrostrat/ui-components"; import { useState } from "react"; import { ItemSelect } from "."; import { diff --git a/packages/map-interface/CHANGELOG.md b/packages/map-interface/CHANGELOG.md index 843e1ca2..b1dcb2e8 100644 --- a/packages/map-interface/CHANGELOG.md +++ b/packages/map-interface/CHANGELOG.md @@ -4,9 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [2.0.1] - 2026-01-28 +## [2.0.1] - 2026-01-29 -Add rollup interop to fix CommonJS dependency linking issues +- Change layout of `package.json` and remove `ui-box` dependency. +- Add rollup interop to fix CommonJS dependency linking issues ## [2.0.0] - 2026-01-26 diff --git a/packages/map-interface/package.json b/packages/map-interface/package.json index 09443d35..4b363074 100644 --- a/packages/map-interface/package.json +++ b/packages/map-interface/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/map-interface", - "version": "2.0.0", + "version": "2.0.1", "description": "Map interface for Macrostrat", "repository": { "type": "git", @@ -8,9 +8,9 @@ "directory": "packages/map-interface" }, "license": "MIT", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "style": "dist/map-interface.css", @@ -24,9 +24,14 @@ "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + }, "style": "./dist/map-interface.css" }, "./package.json": "./package.json", @@ -63,8 +68,7 @@ "use-resize-observer": "^9.1.0" }, "devDependencies": { - "@macrostrat/web-components-bundler": "workspace:*", - "ui-box": "^5.4.1" + "@macrostrat/web-components-bundler": "workspace:*" }, "publishConfig": { "access": "public" diff --git a/packages/map-interface/stories/map-details-panel.stories.ts b/packages/map-interface/stories/map-details-panel.stories.ts index 1d22c47f..e5babe2c 100644 --- a/packages/map-interface/stories/map-details-panel.stories.ts +++ b/packages/map-interface/stories/map-details-panel.stories.ts @@ -2,10 +2,8 @@ import type { Meta } from "@storybook/react-vite"; import type { StoryObj } from "@storybook/react-vite"; import { ExpansionPanel, LocationPanel } from "../src"; import h from "@macrostrat/hyper"; -import { useMapRef, useMapStatus } from "@macrostrat/mapbox-react"; -import { useEffect } from "react"; import { InfoDrawerHeader } from "../src/location-panel/header"; -import Box from "ui-box"; +import { Box } from "@macrostrat/ui-components"; import { LoremIpsum } from "lorem-ipsum"; const lorem = new LoremIpsum({ diff --git a/packages/map-interface/stories/map-interface.stories.ts b/packages/map-interface/stories/map-interface.stories.ts index aff3eec8..956831a5 100644 --- a/packages/map-interface/stories/map-interface.stories.ts +++ b/packages/map-interface/stories/map-interface.stories.ts @@ -1,6 +1,6 @@ import h from "@macrostrat/hyper"; import type { Meta } from "@storybook/react-vite"; -import Box from "ui-box"; +import { Box } from "@macrostrat/ui-components"; import { MapAreaContainer } from "../src"; diff --git a/packages/map-styles/CHANGELOG.md b/packages/map-styles/CHANGELOG.md index d9135e8b..0c2b75d3 100644 --- a/packages/map-styles/CHANGELOG.md +++ b/packages/map-styles/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.1] - 2026-01-29 + +- Change layout of `package.json` and explicitly mark no side effects. + ## [2.0.0] - 2026-01-26 - Removed import of `mapbox-gl/dist/mapbox-gl.css`, no styles bundled with diff --git a/packages/map-styles/package.json b/packages/map-styles/package.json index 1a7b9714..cc3eb45a 100644 --- a/packages/map-styles/package.json +++ b/packages/map-styles/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/map-styles", - "version": "2.0.0", + "version": "2.0.1", "description": "Utilities for working with Mapbox map styles", "repository": { "type": "git", @@ -8,21 +8,27 @@ "directory": "packages/map-styles" }, "license": "MIT", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "files": [ "src", "dist" ], + "sideEffects": false, "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, diff --git a/packages/map-styles/tsconfig.json b/packages/map-styles/tsconfig.json deleted file mode 100644 index cfd66c89..00000000 --- a/packages/map-styles/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "../../", - "include": ["./src", "../../global.d.ts"] - } -} diff --git a/packages/mapbox-react/CHANGELOG.md b/packages/mapbox-react/CHANGELOG.md index dd01cd50..36db8be6 100644 --- a/packages/mapbox-react/CHANGELOG.md +++ b/packages/mapbox-react/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.0.1] - 2026-01-29 + +- Change layout of `package.json` and explicitly mark no side effects. + ## [3.0.0] - 2026-01-26 - Update peer dependencies to React 18 diff --git a/packages/mapbox-react/package.json b/packages/mapbox-react/package.json index b412bbac..0ad7fe67 100644 --- a/packages/mapbox-react/package.json +++ b/packages/mapbox-react/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/mapbox-react", - "version": "3.0.0", + "version": "3.0.1", "description": "Components to support using Mapbox maps in React", "repository": { "type": "git", @@ -8,24 +8,27 @@ "directory": "packages/mapbox-react" }, "license": "MIT", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "files": [ "src", "dist" ], - "sideEffects": [ - "**/*.css" - ], + "sideEffects": false, "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, diff --git a/packages/mapbox-utils/CHANGELOG.md b/packages/mapbox-utils/CHANGELOG.md index e5017b86..94468d09 100644 --- a/packages/mapbox-utils/CHANGELOG.md +++ b/packages/mapbox-utils/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.7.1] - 2026-01-29 + +- Change layout of `package.json` and explicitly mark no side effects. + ## [1.7.0] - 2026-01-26 - Change bundling process to use `@macrostrat/web-components-bundler` diff --git a/packages/mapbox-utils/package.json b/packages/mapbox-utils/package.json index a1de67cf..ac1e6ae8 100644 --- a/packages/mapbox-utils/package.json +++ b/packages/mapbox-utils/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/mapbox-utils", - "version": "1.7.0", + "version": "1.7.1", "description": "Utilities for working with Mapbox maps", "repository": { "type": "git", @@ -8,21 +8,27 @@ "directory": "packages/mapbox-utils" }, "license": "MIT", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "files": [ "src", "dist" ], + "sideEffects": false, "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, diff --git a/packages/static-map-utils/CHANGELOG.md b/packages/static-map-utils/CHANGELOG.md index 92e6b881..83f3585f 100644 --- a/packages/static-map-utils/CHANGELOG.md +++ b/packages/static-map-utils/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.1] - 2026-01-29 + +- Change layout of `package.json` + ## [2.0.0] - 2026-01-26 - Change bundling process to use `@macrostrat/web-components-bundler` diff --git a/packages/static-map-utils/package.json b/packages/static-map-utils/package.json index a919ae48..f9352332 100644 --- a/packages/static-map-utils/package.json +++ b/packages/static-map-utils/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/static-map-utils", - "version": "2.0.0", + "version": "2.0.1", "description": "Utilities for working with Mapbox maps", "repository": { "type": "git", @@ -8,9 +8,9 @@ "directory": "packages/static-map-utils" }, "license": "MIT", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "style": "dist/static-map-utils.css", @@ -24,9 +24,14 @@ "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + }, "style": "./dist/static-map-utils.css" }, "./package.json": "./package.json", diff --git a/packages/stratigraphy-utils/CHANGELOG.md b/packages/stratigraphy-utils/CHANGELOG.md index 1fb0e963..9e9f2345 100644 --- a/packages/stratigraphy-utils/CHANGELOG.md +++ b/packages/stratigraphy-utils/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.2.1] - 2026-01-29 + +- Change layout of `package.json` and explicitly mark no side effects. + ## [1.2.0] - 2026-01-26 - Change bundling process to use `@macrostrat/web-components-bundler` diff --git a/packages/stratigraphy-utils/package.json b/packages/stratigraphy-utils/package.json index d2562210..6d2cb044 100644 --- a/packages/stratigraphy-utils/package.json +++ b/packages/stratigraphy-utils/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/stratigraphy-utils", - "version": "1.2.0", + "version": "1.2.1", "description": "Utility functions for dealing with stratigraphy", "repository": { "type": "git", @@ -18,12 +18,18 @@ "src", "dist" ], + "sideEffects": false, "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, diff --git a/packages/stratigraphy-utils/tsconfig.json b/packages/stratigraphy-utils/tsconfig.json deleted file mode 100644 index cfd66c89..00000000 --- a/packages/stratigraphy-utils/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "../../", - "include": ["./src", "../../global.d.ts"] - } -} diff --git a/packages/svg-map-components/CHANGELOG.md b/packages/svg-map-components/CHANGELOG.md index 1de4a6d5..847aa517 100644 --- a/packages/svg-map-components/CHANGELOG.md +++ b/packages/svg-map-components/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [2.0.1] - 2026-01-29 + +- Change layout of `package.json` and explicitly mark no side effects. + ## [2.0.0] - 2026-01-26 - Change bundling process to use `@macrostrat/web-components-bundler` diff --git a/packages/svg-map-components/package.json b/packages/svg-map-components/package.json index dc580cfc..b307c784 100644 --- a/packages/svg-map-components/package.json +++ b/packages/svg-map-components/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/svg-map-components", - "version": "2.0.0", + "version": "2.0.1", "description": "React components for vector maps", "keywords": [ "gis", @@ -15,21 +15,27 @@ }, "license": "MIT", "author": "Daven Quinn ", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "files": [ "src", "dist" ], + "sideEffects": false, "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, diff --git a/packages/timescale/CHANGELOG.md b/packages/timescale/CHANGELOG.md index a5434f59..4144f705 100644 --- a/packages/timescale/CHANGELOG.md +++ b/packages/timescale/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.0.1] - 2026-01-29 + +- Change layout of `package.json` + ## [3.0.0] - 2026-01-26 - Change bundling process to use `@macrostrat/web-components-bundler` diff --git a/packages/timescale/package.json b/packages/timescale/package.json index 48cdcf7a..758353e5 100644 --- a/packages/timescale/package.json +++ b/packages/timescale/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/timescale", - "version": "3.0.0", + "version": "3.0.1", "description": "A configurable geologic timescale written with React and Typescript", "repository": { "type": "git", @@ -9,9 +9,9 @@ }, "license": "MIT", "author": "Daven Quinn", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "style": "dist/timescale.css", @@ -25,9 +25,14 @@ "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + }, "style": "./dist/timescale.css" }, "./package.json": "./package.json", diff --git a/packages/ui-components/CHANGELOG.md b/packages/ui-components/CHANGELOG.md index 4464c21a..c2ad9c87 100644 --- a/packages/ui-components/CHANGELOG.md +++ b/packages/ui-components/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [5.0.4] - 2026-01-29 + +- Change layout of `package.json` +- Internalize some dependencies in build +- Create `ColorPicker2` based on component from `@macrostrat/data-sheet` + ## [5.0.3] - 2026-01-28 Update handling of `@uiw/react-color` dependency diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index df74acb8..923c5be7 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/ui-components", - "version": "5.0.3", + "version": "5.0.4", "description": "UI components for React and Blueprint.js", "repository": { "type": "git", @@ -9,9 +9,9 @@ }, "license": "MIT", "author": "Daven Quinn", - "type": "module", "source": "src/index.ts", - "main": "dist/index.js", + "main": "dist/index.cjs", + "module": "dist/index.js", "node": "dist/index.cjs", "types": "dist/index.d.ts", "style": "dist/ui-components.css", @@ -25,9 +25,14 @@ "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts", + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + }, "style": "./dist/ui-components.css" }, "./package.json": "./package.json", @@ -67,6 +72,12 @@ "devDependencies": { "@macrostrat/web-components-bundler": "workspace:*" }, + "rollupInternal": [ + "@uiw/react-color", + "ui-box", + "use-async-effect", + "react-json-tree" + ], "contributors": [ { "name": "Casey Idzikowski" diff --git a/packages/ui-components/src/form-controls/color-editor.ts b/packages/ui-components/src/form-controls/color-editor.ts index fa82d594..27fb3c3c 100644 --- a/packages/ui-components/src/form-controls/color-editor.ts +++ b/packages/ui-components/src/form-controls/color-editor.ts @@ -1,9 +1,13 @@ -import h from "@macrostrat/hyper"; +import hyper from "@macrostrat/hyper"; import { ErrorBoundary } from "../error-boundary"; import { Sketch } from "@uiw/react-color"; import { Button, Popover } from "@blueprintjs/core"; -import { useState } from "react"; import chroma from "chroma-js"; +import { asChromaColor } from "@macrostrat/color-utils"; +import { useEffect, useMemo, useRef, useState } from "react"; +import styles from "./main.module.sass"; + +const h = hyper.styled(styles); export function BasePopup(props) { const { children, isOpen, content, ...rest } = props; @@ -70,3 +74,51 @@ export function ColorEditor(props) { ], ); } + +export enum ColorConversionType { + HEX = "hex", + RGB = "rgb", + HSL = "hsl", + CSS = "css", +} + +export function ColorPicker2({ + value, + onChange, + editable = true, + type = ColorConversionType.CSS, +}) { + const ref = useRef(null); + useEffect(() => { + if (ref.current == null) return; + ref.current.focus(); + }, []); + + const color = useMemo(() => { + try { + return asChromaColor(value).hex(); + } catch { + return "#aaaaaa"; + } + }, [value]); + + return h( + "div.color-picker-container", + { + onKeyDown(evt) { + if (evt.key === "Escape") { + evt.preventDefault(); + } + }, + ref, + tabIndex: 0, + }, + h(Sketch, { + color, + disableAlpha: true, + onChange(color) { + onChange(asChromaColor(color.hexa)[type]()); + }, + }), + ); +} diff --git a/packages/ui-components/src/form-controls/form-controls.stories.ts b/packages/ui-components/src/form-controls/form-controls.stories.ts index 253809f2..11bd868a 100644 --- a/packages/ui-components/src/form-controls/form-controls.stories.ts +++ b/packages/ui-components/src/form-controls/form-controls.stories.ts @@ -1,8 +1,29 @@ import { ComponentStory, ComponentMeta } from "@storybook/react-vite"; import { useArgs } from "storybook/preview-api"; import h from "@macrostrat/hyper"; +import React, { ComponentType } from "react"; -import { SimpleToggle } from "./toggle"; +export interface SimpleToggleProps extends React.ComponentProps<"a"> { + isOn: boolean; + toggle: (a: boolean) => void; + component?: ComponentType<{ onClick: () => void }> | string; + name?: string; +} + +export function SimpleToggle(props: SimpleToggleProps) { + const { component = "a", isOn, toggle, name, ...rest } = props; + return h( + component, + { + //@ts-ignore + onClick: () => { + toggle(!isOn); + }, + ...rest, + }, + [isOn ? "Hide" : "Show", " ", name], + ); +} export default { title: "UI Components/Controls/SimpleToggle", diff --git a/packages/ui-components/src/form-controls/index.ts b/packages/ui-components/src/form-controls/index.ts index 67c45bb0..77db7b7e 100644 --- a/packages/ui-components/src/form-controls/index.ts +++ b/packages/ui-components/src/form-controls/index.ts @@ -1 +1,2 @@ +export * from "./color-editor"; export * from "./slider"; diff --git a/packages/ui-components/src/form-controls/main.module.sass b/packages/ui-components/src/form-controls/main.module.sass index 33646287..5a79e8d1 100644 --- a/packages/ui-components/src/form-controls/main.module.sass +++ b/packages/ui-components/src/form-controls/main.module.sass @@ -16,3 +16,8 @@ .slider-disabled :global(.bp6-slider-handle) display: none + +// Color picker +.color-picker-container + :global .w-color-sketch + --sketch-background: var(--secondary-background) !important diff --git a/packages/ui-components/src/form-controls/slider.ts b/packages/ui-components/src/form-controls/slider.ts index 2d5bdb66..48237776 100644 --- a/packages/ui-components/src/form-controls/slider.ts +++ b/packages/ui-components/src/form-controls/slider.ts @@ -7,7 +7,7 @@ import styles from "./main.module.sass"; const h = hyperStyled(styles); -const ControlledSlider = (props: SliderProps) => { +export const ControlledSlider = (props: SliderProps) => { const [value, setValue] = useState(props.value); const onChange = (v) => { (setValue(v), props.onChange?.(v)); @@ -17,7 +17,7 @@ const ControlledSlider = (props: SliderProps) => { return h(Slider, { ...props, onChange, value }); }; -const NullableSlider = (props: SliderProps) => { +export const NullableSlider = (props: SliderProps) => { let { value, showTrackFill, className, ...rest } = props; if (value == null) { value = rest.min ?? 0; @@ -42,5 +42,3 @@ const NullableSlider = (props: SliderProps) => { ]), ]); }; - -export { ControlledSlider, NullableSlider }; diff --git a/packages/ui-components/src/form-controls/toggle.ts b/packages/ui-components/src/form-controls/toggle.ts deleted file mode 100644 index 0ccbb309..00000000 --- a/packages/ui-components/src/form-controls/toggle.ts +++ /dev/null @@ -1,24 +0,0 @@ -import React, { ComponentType } from "react"; -import h from "@macrostrat/hyper"; - -export interface SimpleToggleProps extends React.ComponentProps<"a"> { - isOn: boolean; - toggle: (a: boolean) => void; - component?: ComponentType<{ onClick: () => void }> | string; - name?: string; -} - -export function SimpleToggle(props: SimpleToggleProps) { - const { component = "a", isOn, toggle, name, ...rest } = props; - return h( - component, - { - //@ts-ignore - onClick: () => { - toggle(!isOn); - }, - ...rest, - }, - [isOn ? "Hide" : "Show", " ", name], - ); -} diff --git a/scripts/publish-helpers/update-package-json-files.ts b/scripts/publish-helpers/update-package-json-files.ts index 836ec313..79c9f559 100644 --- a/scripts/publish-helpers/update-package-json-files.ts +++ b/scripts/publish-helpers/update-package-json-files.ts @@ -39,6 +39,7 @@ const packageJSONKeyOrder = [ "peerDependencies", "dependencies", "devDependencies", + "rollupInternal", ]; export function updatePackageJsonFiles() { @@ -70,11 +71,6 @@ export function updatePackageJsonFiles() { const packageDataText = readFileSync(packageJSONPath, "utf-8"); const packageData = JSON.parse(packageDataText); - if (packageData.type !== "module") { - logSkip(chalk.red("not an ESM module")); - continue; - } - const shortModuleName = pkg.name.replace(/^@[^/]+\//, ""); const styleSheetName = `dist/${shortModuleName}.css`; @@ -91,19 +87,20 @@ export function updatePackageJsonFiles() { * prefer the "import" field over it otherwise. */ source: `./${sourceFileName}`, - import: `./${esmFileName}`, - require: `./${cjsFileName}`, - types: `./${typesFileName}`, + import: { + types: `./${typesFileName}`, + default: `./${esmFileName}`, + }, + require: { + types: `./${typesFileName}`, + default: `./${cjsFileName}`, + }, }, "./package.json": "./package.json", }; - let newPackageData: any = { - type: "module", + const basePackageData: any = { source: "src/index.ts", - main: esmFileName, - types: typesFileName, - node: cjsFileName, exports, files: ["src", "dist"], repository: { @@ -112,8 +109,24 @@ export function updatePackageJsonFiles() { directory: pkg.directory, }, license: "MIT", + types: typesFileName, + }; + + let newPackageData = { + ...basePackageData, + main: cjsFileName, + module: esmFileName, }; + if (packageData.type === "module") { + newPackageData = { + ...basePackageData, + type: "module", + main: esmFileName, + node: cjsFileName, + }; + } + if ("style" in packageData) { newPackageData.style = styleSheetName; const relStyleSheetName = `./${styleSheetName}`; @@ -122,6 +135,8 @@ export function updatePackageJsonFiles() { exports[relStyleSheetName] = relStyleSheetName; newPackageData["sideEffects"] = ["**/*.css"]; packagesWithCSSSideEffects.push({ ...pkg, styleSheetName }); + } else { + newPackageData["sideEffects"] = false; } // Merge with existing package data newPackageData = { ...packageData, ...newPackageData }; @@ -130,11 +145,6 @@ export function updatePackageJsonFiles() { newPackageData.devDependencies["@macrostrat/web-components-bundler"] = "workspace:*"; - // Delete the "module" field if it exists - if ("module" in newPackageData) { - delete newPackageData["module"]; - } - if (pkg.private === true) { newPackageData.private = true; delete newPackageData["publishConfig"]; @@ -154,6 +164,7 @@ export function updatePackageJsonFiles() { } } delete newPackageData.targets; + delete newPackageData.typings; const outdatedDevDeps = ["vite", "typescript", "parcel"]; diff --git a/toolchain/bundler/src/index.ts b/toolchain/bundler/src/index.ts index 84db27a1..46a13da4 100644 --- a/toolchain/bundler/src/index.ts +++ b/toolchain/bundler/src/index.ts @@ -50,6 +50,7 @@ interface PackageJSONData extends Omit { dependencies?: Record; peerDependencies?: Record; devDependencies?: Record; + rollupInternal?: string[]; } interface ViteConfigOpts { @@ -77,9 +78,20 @@ function buildStandardViteConfig( }, }; + const rollupInternal = pkg.rollupInternal ?? []; + + if (rollupInternal.length > 0) { + console.log("Internalizing dependencies: ", rollupInternal.join(", ")); + } + // Prefix for output files const prefix = resolve(root).replace(workspaceRoot, "").slice(1) + "/src"; + const externalDeps = [ + ...Object.keys(pkg.dependencies || {}), + ...Object.keys(pkg.peerDependencies || {}), + ].filter((dep) => !rollupInternal.includes(dep)); + return defineConfig({ root, plugins: [ @@ -98,9 +110,9 @@ function buildStandardViteConfig( logLevel: verbose ? "info" : "silent", }) as any, checkExportsPlugin, - cjsInterop({ - dependencies: ["labella", "ui-box"], - }), + // cjsInterop({ + // dependencies: ["labella", "ui-box"], + // }), ], build: { outDir: resolve(root, "dist"), @@ -132,10 +144,7 @@ function buildStandardViteConfig( // Rollup options rollupOptions: { // External dependencies that should not be bundled - external: [ - ...Object.keys(pkg.dependencies || {}), - ...Object.keys(pkg.peerDependencies || {}), - ], + external: externalDeps, output: { preserveModules: true, interop: "auto", diff --git a/toolchain/vite-plugin-hyperstyles/CHANGELOG.md b/toolchain/vite-plugin-hyperstyles/CHANGELOG.md index 41755ad3..1a98dae6 100644 --- a/toolchain/vite-plugin-hyperstyles/CHANGELOG.md +++ b/toolchain/vite-plugin-hyperstyles/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [1.1.1] - 2026-01-29 + +- Change layout of `package.json` + ## [1.1.0] - 2026-01-26 Remove parcel bundler and change to use `@macrostrat/web-components-bundler`. diff --git a/toolchain/vite-plugin-hyperstyles/package.json b/toolchain/vite-plugin-hyperstyles/package.json index 54d78eeb..4025139e 100644 --- a/toolchain/vite-plugin-hyperstyles/package.json +++ b/toolchain/vite-plugin-hyperstyles/package.json @@ -1,6 +1,6 @@ { "name": "@macrostrat/vite-plugin-hyperstyles", - "version": "1.1.0", + "version": "1.1.1", "repository": { "type": "git", "url": "https://github.com/UW-Macrostrat/web-components.git", @@ -16,12 +16,18 @@ "src", "dist" ], + "sideEffects": false, "exports": { ".": { "source": "./src/index.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs", - "types": "./dist/index.d.ts" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.cjs" + } }, "./package.json": "./package.json" }, diff --git a/toolchain/vite-plugin-hyperstyles/tsconfig.json b/toolchain/vite-plugin-hyperstyles/tsconfig.json deleted file mode 100644 index cfd66c89..00000000 --- a/toolchain/vite-plugin-hyperstyles/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "../../", - "include": ["./src", "../../global.d.ts"] - } -} diff --git a/yarn.lock b/yarn.lock index e43b628c..91b6c94f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1172,8 +1172,6 @@ __metadata: "@macrostrat/timescale": "workspace:^" "@macrostrat/ui-components": "workspace:^" "@macrostrat/web-components-bundler": "workspace:*" - "@uiw/react-color": "npm:^2.9.2" - chroma-js: "npm:^3.2.0" classnames: "npm:^2.5.1" d3-axis: "npm:^3.0.0" d3-format: "npm:^3.1.2" @@ -1186,7 +1184,6 @@ __metadata: react-scroll: "npm:^1.7.16" react-select: "npm:^3.0.8" react-svg-textures: "npm:^1.4.7" - ui-box: "npm:^5.4.1" uuid: "npm:^7.0.3" peerDependencies: react: ^18.0.0||^19.0.0 @@ -1207,7 +1204,6 @@ __metadata: "@macrostrat/ui-components": "workspace:^" "@macrostrat/web-components-bundler": "workspace:*" immutability-helper: "npm:^3.1.1" - ui-box: "npm:^5.4.1" zustand: "npm:^5.0.3" zustand-computed: "npm:^2.0.2" peerDependencies: @@ -1274,6 +1270,7 @@ __metadata: dependencies: "@derschmale/tympanum": "npm:^1.3.6" "@macrostrat/hyper": "npm:^3.0.6" + "@macrostrat/web-components-bundler": "workspace:*" languageName: unknown linkType: soft @@ -1316,8 +1313,6 @@ __metadata: "@macrostrat/web-components-bundler": "workspace:*" "@supabase/postgrest-js": "npm:^1.17.7" "@types/underscore": "npm:^1.13.0" - "@uiw/react-color": "npm:^2.9.2" - chroma-js: "npm:^3.2.0" classnames: "npm:^2.5.1" immutability-helper: "npm:^3.1.1" underscore: "npm:^1.13.7" @@ -1374,7 +1369,6 @@ __metadata: axios: "npm:^1.13.2" classnames: "npm:^2.5.1" mapbox-gl: "npm:^2.15.0||^3.0.0" - ui-box: "npm:^5.4.1" peerDependencies: react: ^18.0.0||^19.0.0 react-dom: ^18.0.0||^19.0.0 @@ -1425,7 +1419,6 @@ __metadata: mapbox-gl: "npm:^2.15.0||^3.0.0" query-string: "npm:^9.0.0" transition-hook: "npm:^1.5.2" - ui-box: "npm:^5.4.1" underscore: "npm:^1.13.7" use-resize-observer: "npm:^9.1.0" peerDependencies: