@macrostrat/data-sheet 3.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/components/actions.cjs +2 -6
- package/dist/components/actions.cjs.map +1 -1
- package/dist/components/actions.js +1 -3
- package/dist/components/actions.js.map +1 -1
- package/dist/components/actions.module.sass.cjs +7 -2
- package/dist/components/actions.module.sass.cjs.map +1 -1
- package/dist/components/actions.module.sass.js +5 -2
- package/dist/components/actions.module.sass.js.map +1 -1
- package/dist/components/colors.cjs +4 -7
- package/dist/components/colors.cjs.map +1 -1
- package/dist/components/colors.js +1 -3
- package/dist/components/colors.js.map +1 -1
- package/dist/components/editor-popup.cjs +15 -19
- package/dist/components/editor-popup.cjs.map +1 -1
- package/dist/components/editor-popup.d.ts +1 -1
- package/dist/components/editor-popup.js +10 -12
- package/dist/components/editor-popup.js.map +1 -1
- package/dist/components/main.module.sass.cjs +6 -1
- package/dist/components/main.module.sass.cjs.map +1 -1
- package/dist/components/main.module.sass.js +4 -1
- package/dist/components/main.module.sass.js.map +1 -1
- package/dist/components/text-areas.js +2 -2
- package/dist/components/text-areas.js.map +1 -1
- package/dist/core.cjs +48 -61
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +20 -32
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/main.module.sass.cjs +6 -1
- package/dist/main.module.sass.cjs.map +1 -1
- package/dist/main.module.sass.js +4 -1
- package/dist/main.module.sass.js.map +1 -1
- package/dist/postgrest-table/data-loaders.cjs +109 -0
- package/dist/postgrest-table/data-loaders.cjs.map +1 -1
- package/dist/postgrest-table/data-loaders.d.ts +6 -0
- package/dist/postgrest-table/data-loaders.js +111 -2
- package/dist/postgrest-table/data-loaders.js.map +1 -1
- package/dist/postgrest-table/index.cjs +1 -0
- package/dist/postgrest-table/index.cjs.map +1 -1
- package/dist/postgrest-table/index.d.ts +1 -0
- package/dist/postgrest-table/index.js +4 -2
- package/dist/postgrest-table/index.js.map +1 -1
- package/dist/postgrest-table/lazy-loader-table.cjs +26 -0
- package/dist/postgrest-table/lazy-loader-table.cjs.map +1 -0
- package/dist/postgrest-table/lazy-loader-table.d.ts +3 -0
- package/dist/postgrest-table/lazy-loader-table.js +24 -0
- package/dist/postgrest-table/lazy-loader-table.js.map +1 -0
- package/dist/postgrest-table/main.module.sass.cjs +6 -1
- package/dist/postgrest-table/main.module.sass.cjs.map +1 -1
- package/dist/postgrest-table/main.module.sass.js +4 -1
- package/dist/postgrest-table/main.module.sass.js.map +1 -1
- package/dist/provider.cjs +5 -2
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +5 -2
- package/dist/provider.js.map +1 -1
- package/dist/utils/column-spec.cjs +6 -1
- package/dist/utils/column-spec.cjs.map +1 -1
- package/dist/utils/column-spec.js +6 -1
- package/dist/utils/column-spec.js.map +1 -1
- package/package.json +7 -7
- package/src/components/actions.ts +1 -3
- package/src/components/colors.ts +1 -4
- package/src/components/editor-popup.ts +9 -12
- package/src/core.ts +38 -50
- package/src/postgrest-table/data-loaders.ts +151 -1
- package/src/postgrest-table/index.ts +1 -0
- package/src/postgrest-table/lazy-loader-table.ts +24 -0
- package/src/provider.ts +6 -3
- package/src/utils/column-spec.ts +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.0.4] - 2026-04-05 [_changes_](https://github.com/UW-Macrostrat/web-components/compare/@macrostrat/data-sheet-v3.0.3...@macrostrat/data-sheet-v3.0.4)
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- General performance improvements for rendering and infinite scrolling
|
|
8
|
+
- Use `PopoverNext` instead of popover
|
|
9
|
+
[4bd24d9f](https://github.com/UW-Macrostrat/web-components/commit/4bd24d9f65dacfdbbede3613921182858ec1e3d1)
|
|
10
|
+
Re-enable column reordering
|
|
11
|
+
- Updated `@macrostrat/hyper` dependency
|
|
12
|
+
[6e9a6654](https://github.com/UW-Macrostrat/web-components/commit/6e9a665456460b31c30316a2a13d41abed94c43a)
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
[6e9a6654](https://github.com/UW-Macrostrat/web-components/commit/6e9a665456460b31c30316a2a13d41abed94c43a)
|
|
15
|
+
- @macrostrat/data-components@1.1.5
|
|
16
|
+
- @macrostrat/ui-components@5.0.7
|
|
17
|
+
|
|
18
|
+
## [3.0.3] - 2026-04-04 [_changes_](https://github.com/UW-Macrostrat/web-components/compare/@macrostrat/data-sheet-v3.0.2...@macrostrat/data-sheet-v3.0.3)
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated [BlueprintJS](https://blueprintjs.com) dependencies to latest `6.x.x`
|
|
23
|
+
series
|
|
24
|
+
[fa23ec06](https://github.com/UW-Macrostrat/web-components/commit/fa23ec06a42fefa638f1b95bdb68473f2fc9615b)
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
[fa23ec06](https://github.com/UW-Macrostrat/web-components/commit/fa23ec06a42fefa638f1b95bdb68473f2fc9615b)
|
|
27
|
+
- @macrostrat/data-components@1.1.4
|
|
28
|
+
- @macrostrat/ui-components@5.0.6
|
|
29
|
+
|
|
3
30
|
All notable changes to this project will be documented in this file. The format
|
|
4
31
|
is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this
|
|
5
32
|
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const hyper = require("@macrostrat/hyper");
|
|
4
3
|
const actions_module = require("./actions.module.sass.cjs");
|
|
5
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
6
|
-
const hyper__default = /* @__PURE__ */ _interopDefault(hyper);
|
|
7
|
-
const h = hyper__default.default.styled(actions_module);
|
|
8
4
|
function DataSheetActionsRow(props) {
|
|
9
|
-
return
|
|
5
|
+
return actions_module("div.table-actions", props.children);
|
|
10
6
|
}
|
|
11
7
|
function DataSheetAction(props) {
|
|
12
|
-
return
|
|
8
|
+
return actions_module("div.table-action", props.children);
|
|
13
9
|
}
|
|
14
10
|
exports.DataSheetAction = DataSheetAction;
|
|
15
11
|
exports.DataSheetActionsRow = DataSheetActionsRow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.cjs","sources":["../../src/components/actions.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"actions.cjs","sources":["../../src/components/actions.ts"],"sourcesContent":["import h from \"./actions.module.sass\";\n\nexport function DataSheetActionsRow(props) {\n return h(\"div.table-actions\", props.children);\n}\n\nexport function DataSheetAction(props) {\n return h(\"div.table-action\", props.children);\n}\n"],"names":["h"],"mappings":";;;AAEO,SAAS,oBAAoB,OAAO;AACzC,SAAOA,eAAE,qBAAqB,MAAM,QAAQ;AAC9C;AAEO,SAAS,gBAAgB,OAAO;AACrC,SAAOA,eAAE,oBAAoB,MAAM,QAAQ;AAC7C;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sources":["../../src/components/actions.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"actions.js","sources":["../../src/components/actions.ts"],"sourcesContent":["import h from \"./actions.module.sass\";\n\nexport function DataSheetActionsRow(props) {\n return h(\"div.table-actions\", props.children);\n}\n\nexport function DataSheetAction(props) {\n return h(\"div.table-action\", props.children);\n}\n"],"names":[],"mappings":";AAEO,SAAS,oBAAoB,OAAO;AACzC,SAAO,EAAE,qBAAqB,MAAM,QAAQ;AAC9C;AAEO,SAAS,gBAAgB,OAAO;AACrC,SAAO,EAAE,oBAAoB,MAAM,QAAQ;AAC7C;"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
2
|
+
const hyper = require("@macrostrat/hyper");
|
|
3
|
+
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
4
|
+
const hyper__default = /* @__PURE__ */ _interopDefault(hyper);
|
|
5
|
+
const styles = {
|
|
3
6
|
"table-actions": "_table-actions_1xz9a_1",
|
|
4
7
|
"table-action": "_table-action_1xz9a_1"
|
|
5
8
|
};
|
|
6
|
-
|
|
9
|
+
let h = hyper__default.default.styled(styles);
|
|
10
|
+
Object.assign(h, styles);
|
|
11
|
+
module.exports = h;
|
|
7
12
|
//# sourceMappingURL=actions.module.sass.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.module.sass.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actions.module.sass.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import hyper from "@macrostrat/hyper";
|
|
2
|
+
const styles = {
|
|
2
3
|
"table-actions": "_table-actions_1xz9a_1",
|
|
3
4
|
"table-action": "_table-action_1xz9a_1"
|
|
4
5
|
};
|
|
6
|
+
let h = hyper.styled(styles);
|
|
7
|
+
Object.assign(h, styles);
|
|
5
8
|
export {
|
|
6
|
-
|
|
9
|
+
h as default
|
|
7
10
|
};
|
|
8
11
|
//# sourceMappingURL=actions.module.sass.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.module.sass.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actions.module.sass.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const table = require("@blueprintjs/table");
|
|
4
4
|
const uiComponents = require("@macrostrat/ui-components");
|
|
5
|
-
const hyper = require("@macrostrat/hyper");
|
|
6
5
|
const main_module = require("./main.module.sass.cjs");
|
|
7
6
|
const colorUtils = require("@macrostrat/color-utils");
|
|
8
7
|
const underscore = require("underscore");
|
|
9
8
|
const classNames = require("classnames");
|
|
10
9
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
11
|
-
const hyper__default = /* @__PURE__ */ _interopDefault(hyper);
|
|
12
10
|
const classNames__default = /* @__PURE__ */ _interopDefault(classNames);
|
|
13
11
|
const ColorPicker = uiComponents.ColorPicker2;
|
|
14
|
-
const h = hyper__default.default.styled(main_module.default);
|
|
15
12
|
function ColorCell({
|
|
16
13
|
value,
|
|
17
14
|
children,
|
|
@@ -35,7 +32,7 @@ function ColorCell({
|
|
|
35
32
|
if (intent != null) {
|
|
36
33
|
mainColor = void 0;
|
|
37
34
|
}
|
|
38
|
-
return
|
|
35
|
+
return main_module.default(
|
|
39
36
|
table.Cell,
|
|
40
37
|
{
|
|
41
38
|
intent,
|
|
@@ -51,11 +48,11 @@ function ColorCell({
|
|
|
51
48
|
);
|
|
52
49
|
}
|
|
53
50
|
function colorSwatchRenderer(value) {
|
|
54
|
-
return
|
|
55
|
-
|
|
51
|
+
return main_module.default("span.color-swatch-container", [
|
|
52
|
+
main_module.default("span.color-swatch", {
|
|
56
53
|
style: { backgroundColor: value }
|
|
57
54
|
}),
|
|
58
|
-
|
|
55
|
+
main_module.default("span.color-name", value)
|
|
59
56
|
]);
|
|
60
57
|
}
|
|
61
58
|
const colorCombo = underscore.memoize(colorUtils.getLuminanceAdjustedColorScheme);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.cjs","sources":["../../src/components/colors.ts"],"sourcesContent":["import { Cell } from \"@blueprintjs/table\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport
|
|
1
|
+
{"version":3,"file":"colors.cjs","sources":["../../src/components/colors.ts"],"sourcesContent":["import { Cell } from \"@blueprintjs/table\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport h from \"./main.module.sass\";\nimport { getLuminanceAdjustedColorScheme } from \"@macrostrat/color-utils\";\nimport { memoize } from \"underscore\";\nimport classNames from \"classnames\";\nimport { ColorPicker2 } from \"@macrostrat/ui-components\";\n\nexport const ColorPicker = ColorPicker2;\n\nexport function ColorCell({\n value,\n children,\n style,\n intent,\n adjustLuminance = true,\n className,\n ...rest\n}) {\n const darkMode = useInDarkMode();\n\n const _className = classNames(className, \"color-cell\");\n\n let mainColor = \"var(--text-color)\";\n let backgroundColor = value;\n\n if (adjustLuminance) {\n // If adjustLuminance is true, get the color scheme based on the value\n let colors = colorCombo(value, darkMode, 0.05);\n if (colors != null) {\n mainColor = colors.mainColor;\n backgroundColor = colors.backgroundColor;\n }\n }\n\n if (intent != null) {\n // If an intent is specified, override the main color\n mainColor = undefined;\n }\n\n return h(\n Cell,\n {\n intent,\n className: _className,\n ...rest,\n style: {\n color: mainColor,\n backgroundColor,\n ...style,\n },\n },\n children,\n );\n}\n\nexport function colorSwatchRenderer(value) {\n return h(\"span.color-swatch-container\", [\n h(\"span.color-swatch\", {\n style: { backgroundColor: value },\n }),\n h(\"span.color-name\", value),\n ]);\n}\n\nconst colorCombo = memoize(getLuminanceAdjustedColorScheme);\n"],"names":["ColorPicker2","useInDarkMode","classNames","h","Cell","memoize","getLuminanceAdjustedColorScheme"],"mappings":";;;;;;;;;;AAQO,MAAM,cAAcA,aAAAA;AAEpB,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,WAAWC,aAAAA,cAAA;AAEjB,QAAM,aAAaC,oBAAAA,QAAW,WAAW,YAAY;AAErD,MAAI,YAAY;AAChB,MAAI,kBAAkB;AAEtB,MAAI,iBAAiB;AAEnB,QAAI,SAAS,WAAW,OAAO,UAAU,IAAI;AAC7C,QAAI,UAAU,MAAM;AAClB,kBAAY,OAAO;AACnB,wBAAkB,OAAO;AAAA,IAC3B;AAAA,EACF;AAEA,MAAI,UAAU,MAAM;AAElB,gBAAY;AAAA,EACd;AAEA,SAAOC,YAAAA;AAAAA,IACLC,MAAAA;AAAAA,IACA;AAAA,MACE;AAAA,MACA,WAAW;AAAA,MACX,GAAG;AAAA,MACH,OAAO;AAAA,QACL,OAAO;AAAA,QACP;AAAA,QACA,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF;AAAA,EAAA;AAEJ;AAEO,SAAS,oBAAoB,OAAO;AACzC,SAAOD,YAAAA,QAAE,+BAA+B;AAAA,IACtCA,YAAAA,QAAE,qBAAqB;AAAA,MACrB,OAAO,EAAE,iBAAiB,MAAA;AAAA,IAAM,CACjC;AAAA,IACDA,YAAAA,QAAE,mBAAmB,KAAK;AAAA,EAAA,CAC3B;AACH;AAEA,MAAM,aAAaE,WAAAA,QAAQC,0CAA+B;;;;"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Cell } from "@blueprintjs/table";
|
|
2
2
|
import { ColorPicker2, useInDarkMode } from "@macrostrat/ui-components";
|
|
3
|
-
import
|
|
4
|
-
import styles from "./main.module.sass.js";
|
|
3
|
+
import h from "./main.module.sass.js";
|
|
5
4
|
import { getLuminanceAdjustedColorScheme } from "@macrostrat/color-utils";
|
|
6
5
|
import { memoize } from "underscore";
|
|
7
6
|
import classNames from "classnames";
|
|
8
7
|
const ColorPicker = ColorPicker2;
|
|
9
|
-
const h = hyper.styled(styles);
|
|
10
8
|
function ColorCell({
|
|
11
9
|
value,
|
|
12
10
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sources":["../../src/components/colors.ts"],"sourcesContent":["import { Cell } from \"@blueprintjs/table\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport
|
|
1
|
+
{"version":3,"file":"colors.js","sources":["../../src/components/colors.ts"],"sourcesContent":["import { Cell } from \"@blueprintjs/table\";\nimport { useInDarkMode } from \"@macrostrat/ui-components\";\nimport h from \"./main.module.sass\";\nimport { getLuminanceAdjustedColorScheme } from \"@macrostrat/color-utils\";\nimport { memoize } from \"underscore\";\nimport classNames from \"classnames\";\nimport { ColorPicker2 } from \"@macrostrat/ui-components\";\n\nexport const ColorPicker = ColorPicker2;\n\nexport function ColorCell({\n value,\n children,\n style,\n intent,\n adjustLuminance = true,\n className,\n ...rest\n}) {\n const darkMode = useInDarkMode();\n\n const _className = classNames(className, \"color-cell\");\n\n let mainColor = \"var(--text-color)\";\n let backgroundColor = value;\n\n if (adjustLuminance) {\n // If adjustLuminance is true, get the color scheme based on the value\n let colors = colorCombo(value, darkMode, 0.05);\n if (colors != null) {\n mainColor = colors.mainColor;\n backgroundColor = colors.backgroundColor;\n }\n }\n\n if (intent != null) {\n // If an intent is specified, override the main color\n mainColor = undefined;\n }\n\n return h(\n Cell,\n {\n intent,\n className: _className,\n ...rest,\n style: {\n color: mainColor,\n backgroundColor,\n ...style,\n },\n },\n children,\n );\n}\n\nexport function colorSwatchRenderer(value) {\n return h(\"span.color-swatch-container\", [\n h(\"span.color-swatch\", {\n style: { backgroundColor: value },\n }),\n h(\"span.color-name\", value),\n ]);\n}\n\nconst colorCombo = memoize(getLuminanceAdjustedColorScheme);\n"],"names":[],"mappings":";;;;;;AAQO,MAAM,cAAc;AAEpB,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,WAAW,cAAA;AAEjB,QAAM,aAAa,WAAW,WAAW,YAAY;AAErD,MAAI,YAAY;AAChB,MAAI,kBAAkB;AAEtB,MAAI,iBAAiB;AAEnB,QAAI,SAAS,WAAW,OAAO,UAAU,IAAI;AAC7C,QAAI,UAAU,MAAM;AAClB,kBAAY,OAAO;AACnB,wBAAkB,OAAO;AAAA,IAC3B;AAAA,EACF;AAEA,MAAI,UAAU,MAAM;AAElB,gBAAY;AAAA,EACd;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MACE;AAAA,MACA,WAAW;AAAA,MACX,GAAG;AAAA,MACH,OAAO;AAAA,QACL,OAAO;AAAA,QACP;AAAA,QACA,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF;AAAA,EAAA;AAEJ;AAEO,SAAS,oBAAoB,OAAO;AACzC,SAAO,EAAE,+BAA+B;AAAA,IACtC,EAAE,qBAAqB;AAAA,MACrB,OAAO,EAAE,iBAAiB,MAAA;AAAA,IAAM,CACjC;AAAA,IACD,EAAE,mBAAmB,KAAK;AAAA,EAAA,CAC3B;AACH;AAEA,MAAM,aAAa,QAAQ,+BAA+B;"}
|
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const hyper = require("@macrostrat/hyper");
|
|
4
3
|
const uiComponents = require("@macrostrat/ui-components");
|
|
5
4
|
const core = require("@blueprintjs/core");
|
|
6
5
|
const main_module = require("./main.module.sass.cjs");
|
|
7
6
|
const react = require("react");
|
|
8
7
|
const provider = require("../provider.cjs");
|
|
9
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
10
|
-
const hyper__default = /* @__PURE__ */ _interopDefault(hyper);
|
|
11
|
-
const h = hyper__default.default.styled(main_module.default);
|
|
12
8
|
function EditorPopup(props) {
|
|
13
9
|
const {
|
|
14
10
|
children,
|
|
15
11
|
targetClassName,
|
|
16
12
|
autoFocus,
|
|
17
13
|
valueViewer,
|
|
18
|
-
placement = "right-start"
|
|
19
|
-
minimal = true
|
|
14
|
+
placement = "right-start"
|
|
20
15
|
} = props;
|
|
21
16
|
const [isOpen, setIsOpen] = react.useState(autoFocus);
|
|
22
17
|
const keyHandler = provider.useSelector((state) => state.keyHandler);
|
|
23
18
|
const ref = react.useRef(null);
|
|
24
|
-
const inlineEditor =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
const inlineEditor = main_module.default([
|
|
20
|
+
main_module.default("span.editor-value.bp6-table-cell", valueViewer),
|
|
21
|
+
main_module.default("input.hidden-editor", {
|
|
22
|
+
defaultValue: "",
|
|
28
23
|
autoFocus: true,
|
|
29
24
|
onKeyDown: keyHandler
|
|
30
25
|
})
|
|
31
26
|
]);
|
|
32
|
-
return
|
|
33
|
-
core.
|
|
27
|
+
return main_module.default(
|
|
28
|
+
core.PopoverNext,
|
|
34
29
|
{
|
|
35
|
-
content:
|
|
30
|
+
content: main_module.default(
|
|
36
31
|
"div.interaction-barrier",
|
|
37
32
|
{
|
|
38
33
|
onMouseDown(evt) {
|
|
@@ -49,21 +44,22 @@ function EditorPopup(props) {
|
|
|
49
44
|
}
|
|
50
45
|
}
|
|
51
46
|
},
|
|
52
|
-
|
|
47
|
+
main_module.default(uiComponents.ErrorBoundary, null, children)
|
|
53
48
|
),
|
|
54
49
|
enforceFocus: false,
|
|
55
50
|
autoFocus: false,
|
|
56
|
-
minimal,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
51
|
+
animation: "minimal",
|
|
52
|
+
lazy: true,
|
|
53
|
+
// modifiers: {
|
|
54
|
+
// offset: { enabled: true, options: { offset: [0, 8] } },
|
|
55
|
+
// },
|
|
60
56
|
placement,
|
|
61
57
|
interactionKind: "hover-target",
|
|
62
58
|
isOpen,
|
|
63
59
|
// Portal must be used to avoid issues with the editor being clipped to the bounds of the cell
|
|
64
60
|
usePortal: true
|
|
65
61
|
},
|
|
66
|
-
|
|
62
|
+
main_module.default(
|
|
67
63
|
"span.editor-popup-target.bp6-table-cell",
|
|
68
64
|
{
|
|
69
65
|
className: targetClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-popup.cjs","sources":["../../src/components/editor-popup.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"editor-popup.cjs","sources":["../../src/components/editor-popup.ts"],"sourcesContent":["import { ErrorBoundary } from \"@macrostrat/ui-components\";\nimport { PopoverNext } from \"@blueprintjs/core\";\nimport h from \"./main.module.sass\";\nimport { useRef, useState } from \"react\";\nimport { useSelector } from \"../provider\";\n\nexport function EditorPopup(props) {\n const {\n children,\n targetClassName,\n autoFocus,\n valueViewer,\n placement = \"right-start\",\n } = props;\n\n const [isOpen, setIsOpen] = useState(autoFocus);\n const keyHandler = useSelector((state) => state.keyHandler);\n\n const ref = useRef(null);\n\n const inlineEditor = h([\n h(\"span.editor-value.bp6-table-cell\", valueViewer),\n h(\"input.hidden-editor\", {\n defaultValue: \"\",\n autoFocus: true,\n onKeyDown: keyHandler,\n }),\n ]);\n\n return h(\n PopoverNext,\n {\n content: h(\n \"div.interaction-barrier\",\n {\n onMouseDown(evt) {\n evt.nativeEvent.stopImmediatePropagation();\n },\n onKeyDown(evt) {\n if (evt.key === \"Escape\") {\n if (isOpen) {\n setIsOpen(false);\n }\n evt.stopPropagation();\n evt.preventDefault();\n return;\n }\n // Climb over the interaction barrier to propagate the key event to the table\n },\n },\n h(ErrorBoundary, null, children),\n ),\n enforceFocus: false,\n autoFocus: false,\n animation: \"minimal\",\n lazy: true,\n // modifiers: {\n // offset: { enabled: true, options: { offset: [0, 8] } },\n // },\n placement,\n interactionKind: \"hover-target\",\n isOpen,\n // Portal must be used to avoid issues with the editor being clipped to the bounds of the cell\n usePortal: true,\n },\n h(\n \"span.editor-popup-target.bp6-table-cell\",\n {\n className: targetClassName,\n onClick: () => setIsOpen(!isOpen),\n ref,\n },\n // If the editor is open, show the inline editor, otherwise show the value viewer\n isOpen ? valueViewer : (inlineEditor ?? valueViewer),\n ),\n );\n}\n"],"names":["useState","useSelector","useRef","h","PopoverNext","ErrorBoundary"],"mappings":";;;;;;;AAMO,SAAS,YAAY,OAAO;AACjC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,EAAA,IACV;AAEJ,QAAM,CAAC,QAAQ,SAAS,IAAIA,MAAAA,SAAS,SAAS;AAC9C,QAAM,aAAaC,SAAAA,YAAY,CAAC,UAAU,MAAM,UAAU;AAE1D,QAAM,MAAMC,MAAAA,OAAO,IAAI;AAEvB,QAAM,eAAeC,YAAAA,QAAE;AAAA,IACrBA,YAAAA,QAAE,oCAAoC,WAAW;AAAA,IACjDA,YAAAA,QAAE,uBAAuB;AAAA,MACvB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,WAAW;AAAA,IAAA,CACZ;AAAA,EAAA,CACF;AAED,SAAOA,YAAAA;AAAAA,IACLC,KAAAA;AAAAA,IACA;AAAA,MACE,SAASD,YAAAA;AAAAA,QACP;AAAA,QACA;AAAA,UACE,YAAY,KAAK;AACf,gBAAI,YAAY,yBAAA;AAAA,UAClB;AAAA,UACA,UAAU,KAAK;AACb,gBAAI,IAAI,QAAQ,UAAU;AACxB,kBAAI,QAAQ;AACV,0BAAU,KAAK;AAAA,cACjB;AACA,kBAAI,gBAAA;AACJ,kBAAI,eAAA;AACJ;AAAA,YACF;AAAA,UAEF;AAAA,QAAA;AAAA,QAEFA,oBAAEE,aAAAA,eAAe,MAAM,QAAQ;AAAA,MAAA;AAAA,MAEjC,cAAc;AAAA,MACd,WAAW;AAAA,MACX,WAAW;AAAA,MACX,MAAM;AAAA;AAAA;AAAA;AAAA,MAIN;AAAA,MACA,iBAAiB;AAAA,MACjB;AAAA;AAAA,MAEA,WAAW;AAAA,IAAA;AAAA,IAEbF,YAAAA;AAAAA,MACE;AAAA,MACA;AAAA,QACE,WAAW;AAAA,QACX,SAAS,MAAM,UAAU,CAAC,MAAM;AAAA,QAChC;AAAA,MAAA;AAAA;AAAA,MAGF,SAAS,cAAe,gBAAgB;AAAA,IAAA;AAAA,EAC1C;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function EditorPopup(props: any): import('react').
|
|
1
|
+
export declare function EditorPopup(props: any): import('react').FunctionComponentElement<import('@blueprintjs/core').PopoverNextProps<import('@blueprintjs/core').DefaultPopoverTargetHTMLProps> & import('react').RefAttributes<import('@blueprintjs/core').PopoverNextRef>>;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import hyper from "@macrostrat/hyper";
|
|
2
1
|
import { ErrorBoundary } from "@macrostrat/ui-components";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { PopoverNext } from "@blueprintjs/core";
|
|
3
|
+
import h from "./main.module.sass.js";
|
|
5
4
|
import { useState, useRef } from "react";
|
|
6
5
|
import { useSelector } from "../provider.js";
|
|
7
|
-
const h = hyper.styled(styles);
|
|
8
6
|
function EditorPopup(props) {
|
|
9
7
|
const {
|
|
10
8
|
children,
|
|
11
9
|
targetClassName,
|
|
12
10
|
autoFocus,
|
|
13
11
|
valueViewer,
|
|
14
|
-
placement = "right-start"
|
|
15
|
-
minimal = true
|
|
12
|
+
placement = "right-start"
|
|
16
13
|
} = props;
|
|
17
14
|
const [isOpen, setIsOpen] = useState(autoFocus);
|
|
18
15
|
const keyHandler = useSelector((state) => state.keyHandler);
|
|
@@ -20,13 +17,13 @@ function EditorPopup(props) {
|
|
|
20
17
|
const inlineEditor = h([
|
|
21
18
|
h("span.editor-value.bp6-table-cell", valueViewer),
|
|
22
19
|
h("input.hidden-editor", {
|
|
23
|
-
|
|
20
|
+
defaultValue: "",
|
|
24
21
|
autoFocus: true,
|
|
25
22
|
onKeyDown: keyHandler
|
|
26
23
|
})
|
|
27
24
|
]);
|
|
28
25
|
return h(
|
|
29
|
-
|
|
26
|
+
PopoverNext,
|
|
30
27
|
{
|
|
31
28
|
content: h(
|
|
32
29
|
"div.interaction-barrier",
|
|
@@ -49,10 +46,11 @@ function EditorPopup(props) {
|
|
|
49
46
|
),
|
|
50
47
|
enforceFocus: false,
|
|
51
48
|
autoFocus: false,
|
|
52
|
-
minimal,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
49
|
+
animation: "minimal",
|
|
50
|
+
lazy: true,
|
|
51
|
+
// modifiers: {
|
|
52
|
+
// offset: { enabled: true, options: { offset: [0, 8] } },
|
|
53
|
+
// },
|
|
56
54
|
placement,
|
|
57
55
|
interactionKind: "hover-target",
|
|
58
56
|
isOpen,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-popup.js","sources":["../../src/components/editor-popup.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"editor-popup.js","sources":["../../src/components/editor-popup.ts"],"sourcesContent":["import { ErrorBoundary } from \"@macrostrat/ui-components\";\nimport { PopoverNext } from \"@blueprintjs/core\";\nimport h from \"./main.module.sass\";\nimport { useRef, useState } from \"react\";\nimport { useSelector } from \"../provider\";\n\nexport function EditorPopup(props) {\n const {\n children,\n targetClassName,\n autoFocus,\n valueViewer,\n placement = \"right-start\",\n } = props;\n\n const [isOpen, setIsOpen] = useState(autoFocus);\n const keyHandler = useSelector((state) => state.keyHandler);\n\n const ref = useRef(null);\n\n const inlineEditor = h([\n h(\"span.editor-value.bp6-table-cell\", valueViewer),\n h(\"input.hidden-editor\", {\n defaultValue: \"\",\n autoFocus: true,\n onKeyDown: keyHandler,\n }),\n ]);\n\n return h(\n PopoverNext,\n {\n content: h(\n \"div.interaction-barrier\",\n {\n onMouseDown(evt) {\n evt.nativeEvent.stopImmediatePropagation();\n },\n onKeyDown(evt) {\n if (evt.key === \"Escape\") {\n if (isOpen) {\n setIsOpen(false);\n }\n evt.stopPropagation();\n evt.preventDefault();\n return;\n }\n // Climb over the interaction barrier to propagate the key event to the table\n },\n },\n h(ErrorBoundary, null, children),\n ),\n enforceFocus: false,\n autoFocus: false,\n animation: \"minimal\",\n lazy: true,\n // modifiers: {\n // offset: { enabled: true, options: { offset: [0, 8] } },\n // },\n placement,\n interactionKind: \"hover-target\",\n isOpen,\n // Portal must be used to avoid issues with the editor being clipped to the bounds of the cell\n usePortal: true,\n },\n h(\n \"span.editor-popup-target.bp6-table-cell\",\n {\n className: targetClassName,\n onClick: () => setIsOpen(!isOpen),\n ref,\n },\n // If the editor is open, show the inline editor, otherwise show the value viewer\n isOpen ? valueViewer : (inlineEditor ?? valueViewer),\n ),\n );\n}\n"],"names":[],"mappings":";;;;;AAMO,SAAS,YAAY,OAAO;AACjC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,EAAA,IACV;AAEJ,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,SAAS;AAC9C,QAAM,aAAa,YAAY,CAAC,UAAU,MAAM,UAAU;AAE1D,QAAM,MAAM,OAAO,IAAI;AAEvB,QAAM,eAAe,EAAE;AAAA,IACrB,EAAE,oCAAoC,WAAW;AAAA,IACjD,EAAE,uBAAuB;AAAA,MACvB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,WAAW;AAAA,IAAA,CACZ;AAAA,EAAA,CACF;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MACE,SAAS;AAAA,QACP;AAAA,QACA;AAAA,UACE,YAAY,KAAK;AACf,gBAAI,YAAY,yBAAA;AAAA,UAClB;AAAA,UACA,UAAU,KAAK;AACb,gBAAI,IAAI,QAAQ,UAAU;AACxB,kBAAI,QAAQ;AACV,0BAAU,KAAK;AAAA,cACjB;AACA,kBAAI,gBAAA;AACJ,kBAAI,eAAA;AACJ;AAAA,YACF;AAAA,UAEF;AAAA,QAAA;AAAA,QAEF,EAAE,eAAe,MAAM,QAAQ;AAAA,MAAA;AAAA,MAEjC,cAAc;AAAA,MACd,WAAW;AAAA,MACX,WAAW;AAAA,MACX,MAAM;AAAA;AAAA;AAAA;AAAA,MAIN;AAAA,MACA,iBAAiB;AAAA,MACjB;AAAA;AAAA,MAEA,WAAW;AAAA,IAAA;AAAA,IAEb;AAAA,MACE;AAAA,MACA;AAAA,QACE,WAAW;AAAA,QACX,SAAS,MAAM,UAAU,CAAC,MAAM;AAAA,QAChC;AAAA,MAAA;AAAA;AAAA,MAGF,SAAS,cAAe,gBAAgB;AAAA,IAAA;AAAA,EAC1C;AAEJ;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const hyper = require("@macrostrat/hyper");
|
|
4
|
+
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
5
|
+
const hyper__default = /* @__PURE__ */ _interopDefault(hyper);
|
|
3
6
|
const tools = "_tools_utey8_23";
|
|
4
7
|
const styles = {
|
|
5
8
|
"interaction-barrier": "_interaction-barrier_utey8_1",
|
|
@@ -12,6 +15,8 @@ const styles = {
|
|
|
12
15
|
"color-swatch-container": "_color-swatch-container_utey8_49",
|
|
13
16
|
"color-name": "_color-name_utey8_61"
|
|
14
17
|
};
|
|
15
|
-
|
|
18
|
+
let h = hyper__default.default.styled(styles);
|
|
19
|
+
Object.assign(h, styles);
|
|
20
|
+
exports.default = h;
|
|
16
21
|
exports.tools = tools;
|
|
17
22
|
//# sourceMappingURL=main.module.sass.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.module.sass.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.module.sass.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import hyper from "@macrostrat/hyper";
|
|
1
2
|
const tools = "_tools_utey8_23";
|
|
2
3
|
const styles = {
|
|
3
4
|
"interaction-barrier": "_interaction-barrier_utey8_1",
|
|
@@ -10,8 +11,10 @@ const styles = {
|
|
|
10
11
|
"color-swatch-container": "_color-swatch-container_utey8_49",
|
|
11
12
|
"color-name": "_color-name_utey8_61"
|
|
12
13
|
};
|
|
14
|
+
let h = hyper.styled(styles);
|
|
15
|
+
Object.assign(h, styles);
|
|
13
16
|
export {
|
|
14
|
-
|
|
17
|
+
h as default,
|
|
15
18
|
tools
|
|
16
19
|
};
|
|
17
20
|
//# sourceMappingURL=main.module.sass.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.module.sass.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.module.sass.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import hyper from "@macrostrat/hyper";
|
|
2
|
-
import
|
|
2
|
+
import h$1 from "./main.module.sass.js";
|
|
3
3
|
import { Button } from "@blueprintjs/core";
|
|
4
4
|
import { useRef, useEffect } from "react";
|
|
5
5
|
import { multiLineTextKeyHandler } from "../utils/key-handling.js";
|
|
6
|
-
const h = hyper.styled(
|
|
6
|
+
const h = hyper.styled(h$1);
|
|
7
7
|
function EditableTextArea({ value, onChange }) {
|
|
8
8
|
const ref = useRef(null);
|
|
9
9
|
useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-areas.js","sources":["../../src/components/text-areas.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { Button } from \"@blueprintjs/core\";\nimport { useEffect, useRef } from \"react\";\nimport { multiLineTextKeyHandler } from \"../utils\";\n\nconst h = hyper.styled(styles);\n\nexport function EditableTextArea({ value, onChange }) {\n const ref = useRef(null);\n\n useEffect(() => {\n if (ref.current == null) return;\n ref.current.focus();\n // Get the current value\n const val = ref.current.value;\n // Move the cursor to the end of the text\n ref.current.setSelectionRange(val.length, val.length);\n }, []);\n\n return h(\"div.editable-text-area\", [\n h(\"textarea.bp6-input\", {\n ref,\n value: value ?? \"\",\n onChange: (evt) => onChange(evt.target.value),\n onKeyDown: multiLineTextKeyHandler,\n }),\n h(\"div.tools\", [\n h(Button, {\n icon: \"key-enter\",\n minimal: true,\n small: true,\n onClick() {\n // Get cursor position\n let _value = value ?? \"\";\n\n const cursorPos = ref.current.selectionStart ?? _value.length;\n // Insert a newline at the cursor position\n onChange(_value.slice(0, cursorPos) + \"\\n\" + _value.slice(cursorPos));\n // Re-focus the textarea\n ref.current.focus();\n // Move the cursor to the end of the line\n ref.current.setSelectionRange(cursorPos + 1, cursorPos + 1);\n },\n }),\n ]),\n ]);\n}\n"],"names":[],"mappings":";;;;;AAMA,MAAM,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"text-areas.js","sources":["../../src/components/text-areas.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { Button } from \"@blueprintjs/core\";\nimport { useEffect, useRef } from \"react\";\nimport { multiLineTextKeyHandler } from \"../utils\";\n\nconst h = hyper.styled(styles);\n\nexport function EditableTextArea({ value, onChange }) {\n const ref = useRef(null);\n\n useEffect(() => {\n if (ref.current == null) return;\n ref.current.focus();\n // Get the current value\n const val = ref.current.value;\n // Move the cursor to the end of the text\n ref.current.setSelectionRange(val.length, val.length);\n }, []);\n\n return h(\"div.editable-text-area\", [\n h(\"textarea.bp6-input\", {\n ref,\n value: value ?? \"\",\n onChange: (evt) => onChange(evt.target.value),\n onKeyDown: multiLineTextKeyHandler,\n }),\n h(\"div.tools\", [\n h(Button, {\n icon: \"key-enter\",\n minimal: true,\n small: true,\n onClick() {\n // Get cursor position\n let _value = value ?? \"\";\n\n const cursorPos = ref.current.selectionStart ?? _value.length;\n // Insert a newline at the cursor position\n onChange(_value.slice(0, cursorPos) + \"\\n\" + _value.slice(cursorPos));\n // Re-focus the textarea\n ref.current.focus();\n // Move the cursor to the end of the line\n ref.current.setSelectionRange(cursorPos + 1, cursorPos + 1);\n },\n }),\n ]),\n ]);\n}\n"],"names":["styles"],"mappings":";;;;;AAMA,MAAM,IAAI,MAAM,OAAOA,GAAM;AAEtB,SAAS,iBAAiB,EAAE,OAAO,YAAY;AACpD,QAAM,MAAM,OAAO,IAAI;AAEvB,YAAU,MAAM;AACd,QAAI,IAAI,WAAW,KAAM;AACzB,QAAI,QAAQ,MAAA;AAEZ,UAAM,MAAM,IAAI,QAAQ;AAExB,QAAI,QAAQ,kBAAkB,IAAI,QAAQ,IAAI,MAAM;AAAA,EACtD,GAAG,CAAA,CAAE;AAEL,SAAO,EAAE,0BAA0B;AAAA,IACjC,EAAE,sBAAsB;AAAA,MACtB;AAAA,MACA,OAAO,SAAS;AAAA,MAChB,UAAU,CAAC,QAAQ,SAAS,IAAI,OAAO,KAAK;AAAA,MAC5C,WAAW;AAAA,IAAA,CACZ;AAAA,IACD,EAAE,aAAa;AAAA,MACb,EAAE,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,SAAS;AAAA,QACT,OAAO;AAAA,QACP,UAAU;AAER,cAAI,SAAS,SAAS;AAEtB,gBAAM,YAAY,IAAI,QAAQ,kBAAkB,OAAO;AAEvD,mBAAS,OAAO,MAAM,GAAG,SAAS,IAAI,OAAO,OAAO,MAAM,SAAS,CAAC;AAEpE,cAAI,QAAQ,MAAA;AAEZ,cAAI,QAAQ,kBAAkB,YAAY,GAAG,YAAY,CAAC;AAAA,QAC5D;AAAA,MAAA,CACD;AAAA,IAAA,CACF;AAAA,EAAA,CACF;AACH;"}
|