Skip to content

Commit a74f9fd

Browse files
authored
Merge pull request #212 from UW-Macrostrat/packaging-updates
Major updates to packaging
2 parents 8302505 + 50d25aa commit a74f9fd

Some content is hidden

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

64 files changed

+584
-405
lines changed

packages/color-utils/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to
77
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [1.2.1] - 2026-01-29
10+
11+
- Change layout of `package.json` and explicitly mark no side effects.
12+
913
## [1.2.0] - 2026-01-27
1014

1115
Change build system from Parcel to Vite

packages/color-utils/package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@macrostrat/color-utils",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Color utility functions",
55
"repository": {
66
"type": "git",
@@ -18,12 +18,18 @@
1818
"src",
1919
"dist"
2020
],
21+
"sideEffects": false,
2122
"exports": {
2223
".": {
2324
"source": "./src/index.ts",
24-
"import": "./dist/index.js",
25-
"require": "./dist/index.cjs",
26-
"types": "./dist/index.d.ts"
25+
"import": {
26+
"types": "./dist/index.d.ts",
27+
"default": "./dist/index.js"
28+
},
29+
"require": {
30+
"types": "./dist/index.d.ts",
31+
"default": "./dist/index.cjs"
32+
}
2733
},
2834
"./package.json": "./package.json"
2935
},

packages/column-components/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format
44
is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this
55
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.0.4] - 2026-01-29
8+
9+
- Change layout of `package.json`
10+
- Remove `ui-box` dependency in favor of `@macrostrat/ui-components`
11+
- Remove color picker
12+
- Bundle `labella` dependency to avoid CommonJS issues
13+
714
## [2.0.3] - 2026-01-28
815

916
Update handling of `@uiw/react-color` dependency

packages/column-components/package.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@macrostrat/column-components",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "React rendering primitives for stratigraphic columns",
55
"keywords": [
66
"geology",
@@ -31,9 +31,14 @@
3131
"exports": {
3232
".": {
3333
"source": "./src/index.ts",
34-
"import": "./dist/index.js",
35-
"require": "./dist/index.cjs",
36-
"types": "./dist/index.d.ts",
34+
"import": {
35+
"types": "./dist/index.d.ts",
36+
"default": "./dist/index.js"
37+
},
38+
"require": {
39+
"types": "./dist/index.d.ts",
40+
"default": "./dist/index.cjs"
41+
},
3742
"style": "./dist/column-components.css"
3843
},
3944
"./package.json": "./package.json",
@@ -53,8 +58,6 @@
5358
"@macrostrat/stratigraphy-utils": "workspace:^",
5459
"@macrostrat/timescale": "workspace:^",
5560
"@macrostrat/ui-components": "workspace:^",
56-
"@uiw/react-color": "^2.9.2",
57-
"chroma-js": "^3.2.0",
5861
"classnames": "^2.5.1",
5962
"d3-axis": "^3.0.0",
6063
"d3-format": "^3.1.2",
@@ -67,12 +70,14 @@
6770
"react-scroll": "^1.7.16",
6871
"react-select": "^3.0.8",
6972
"react-svg-textures": "^1.4.7",
70-
"ui-box": "^5.4.1",
7173
"uuid": "^7.0.3"
7274
},
7375
"devDependencies": {
7476
"@macrostrat/web-components-bundler": "workspace:*"
7577
},
78+
"rollupInternal": [
79+
"labella"
80+
],
7681
"publishConfig": {
7782
"access": "public"
7883
}

packages/column-components/src/edit-overlay.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
ColumnDivision,
1616
} from "./context";
1717
import chroma from "chroma-js";
18-
import Box from "ui-box";
18+
import { Box } from "@macrostrat/ui-components";
1919

2020
const fmt = format(".1f");
2121
const fmt2 = format(".2f");

packages/column-components/src/editor/facies/color-picker.ts

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

packages/column-components/src/editor/facies/description.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component } from "react";
22
import h from "@macrostrat/hyper";
33
import classNames from "classnames";
44
import { FaciesContext } from "../../context";
5-
import { FaciesSwatch } from "./color-picker";
5+
import { FaciesSwatch } from "./swatch";
66

77
type FaciesData = any;
88

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export * from "./color-picker";
2-
export * from "./picker";
1+
export * from "./swatch";
32
export * from "./description";

packages/column-components/src/editor/facies/picker.ts

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import { Component } from "react";
2+
import { hyperStyled } from "@macrostrat/hyper";
3+
import { ColumnDivision, FaciesContext } from "../../context";
4+
import { RaisedSelect } from "../util";
5+
import styles from "../main.module.scss";
6+
7+
const h = hyperStyled(styles);
8+
9+
const FaciesRow = ({ facies }) =>
10+
h("span.facies-picker-row", [
11+
h(BasicFaciesSwatch, { facies, className: "facies-color-swatch" }),
12+
h("span.facies-picker-name", facies.name),
13+
]);
14+
15+
interface FaciesPickerProps {
16+
interval: ColumnDivision;
17+
onChange: (f: number) => void;
18+
}
19+
20+
export class FaciesPicker extends Component<FaciesPickerProps> {
21+
static contextType = FaciesContext;
22+
declare context: any;
23+
24+
render() {
25+
const { facies } = this.context;
26+
const { interval, onChange } = this.props;
27+
28+
const options = facies.map((f) => ({
29+
value: f.id,
30+
label: h(FaciesRow, { facies: f }),
31+
}));
32+
33+
let value = options.find((d) => d.value === interval.facies);
34+
if (value == null) {
35+
value = null;
36+
}
37+
38+
return h(RaisedSelect, {
39+
id: "facies-select",
40+
options,
41+
value,
42+
selected: interval.facies,
43+
isClearable: true,
44+
onChange(res) {
45+
console.log("Changing", res);
46+
const f = res != null ? res.value : null;
47+
return onChange(f);
48+
},
49+
});
50+
}
51+
}
52+
53+
//import { Swatch } from "@uiw/react-color";
54+
//import { Popover } from "@blueprintjs/core";
55+
//import { FaciesContext } from "../../context";
56+
57+
interface FaciesColorPickerProps {
58+
facies: {
59+
id: number;
60+
color: string;
61+
};
62+
}
63+
64+
// class FaciesColorPicker extends Component<FaciesColorPickerProps> {
65+
// static contextType = FaciesContext;
66+
// declare context: any;
67+
//
68+
// render() {
69+
// const { setFaciesColor } = this.context;
70+
// const { facies: d } = this.props;
71+
// return h("div", [
72+
// h(Swatch, {
73+
// color: d.color || "black",
74+
// onChange(color) {
75+
// return setFaciesColor(d.id, color.hex);
76+
// },
77+
// }),
78+
// ]);
79+
// }
80+
// }
81+
82+
export const BasicFaciesSwatch = ({ facies: d, ...rest }) =>
83+
h("div.color-swatch", {
84+
style: {
85+
backgroundColor: d.color || "black",
86+
width: "2em",
87+
height: "2em",
88+
},
89+
...rest,
90+
});
91+
92+
interface FaciesSwatchProps {
93+
isEditable: boolean;
94+
facies: {
95+
id: number;
96+
color: string;
97+
} | null;
98+
}
99+
100+
export class FaciesSwatch extends Component<FaciesSwatchProps> {
101+
static defaultProps = {
102+
isEditable: true,
103+
facies: null,
104+
};
105+
constructor(props) {
106+
super(props);
107+
}
108+
109+
render() {
110+
const { facies, isEditable = false } = this.props;
111+
const basic = h(BasicFaciesSwatch, { facies });
112+
return basic;
113+
// return h(
114+
// Popover,
115+
// {
116+
// // tetherOptions: {
117+
// // constraints: [{ attachment: "together", to: "scrollParent" }],
118+
// // },
119+
// },
120+
// [basic, h(FaciesColorPicker, { facies })],
121+
// );
122+
}
123+
}

0 commit comments

Comments
 (0)