@thepalaceproject/circulation-admin 1.42.2 → 1.43.0-post.1

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/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "author": "The Palace Project",
10
10
  "license": "Apache-2.0",
11
11
  "engines": {
12
- "node": ">=20.0.0 <25.0.0",
12
+ "node": ">=24.0.0 <25.0.0",
13
13
  "npm": ">=11.10.0"
14
14
  },
15
15
  "packageManager": "npm@11.17.0",
@@ -71,6 +71,7 @@
71
71
  "url": "^0.11.0"
72
72
  },
73
73
  "devDependencies": {
74
+ "@eslint/js": "^9.39.4",
74
75
  "@tanstack/react-query-devtools": "^4.36.1",
75
76
  "@testing-library/jest-dom": "^6.9.1",
76
77
  "@testing-library/react": "^12.1.5",
@@ -87,12 +88,11 @@
87
88
  "@types/react-router": "^3.0.28",
88
89
  "@types/recharts": "^1.8.28",
89
90
  "@types/redux-mock-store": "^1.0.3",
90
- "@eslint/js": "^9.39.4",
91
91
  "chai": "4.2.0",
92
92
  "clean-webpack-plugin": "^2.0.1",
93
93
  "colors-cli": "^1.0.27",
94
- "copy-webpack-plugin": "13.0.1",
95
- "css-loader": "^6.7.2",
94
+ "copy-webpack-plugin": "14.0.0",
95
+ "css-loader": "^7.1.4",
96
96
  "dotenv-cli": "^11.0.0",
97
97
  "enzyme": "^3.11.0",
98
98
  "enzyme-adapter-react-16": "^1.15.6",
@@ -153,5 +153,5 @@
153
153
  "*.{js,jsx,ts,tsx,css,md}": "prettier --write",
154
154
  "*.{js,css,md}": "prettier --write"
155
155
  },
156
- "version": "1.42.2"
156
+ "version": "1.43.0-post.1"
157
157
  }
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { render, screen, act, fireEvent } from "@testing-library/react";
3
3
  import JsonField, { JsonFieldHandle } from "../../../src/components/JsonField";
4
+ import { MONOSPACE_FONT_STACK } from "../../../src/fonts";
4
5
 
5
6
  const setting = {
6
7
  key: "my_json",
@@ -472,6 +473,25 @@ describe("JsonField", () => {
472
473
  });
473
474
  });
474
475
 
476
+ describe("use_monospace_font", () => {
477
+ (
478
+ [
479
+ { id: "set", use_monospace_font: true, hasStyle: true },
480
+ { id: "absent", hasStyle: false },
481
+ ] as { id: string; use_monospace_font?: boolean; hasStyle: boolean }[]
482
+ ).forEach(({ id, use_monospace_font, hasStyle }) => {
483
+ it(id, () => {
484
+ render(<JsonField setting={{ ...setting, use_monospace_font }} />);
485
+ const ta = screen.getByLabelText("JSON Setting");
486
+ if (hasStyle) {
487
+ expect(ta).toHaveStyle({ fontFamily: MONOSPACE_FONT_STACK });
488
+ } else {
489
+ expect(ta).not.toHaveStyle({ fontFamily: MONOSPACE_FONT_STACK });
490
+ }
491
+ });
492
+ });
493
+ });
494
+
475
495
  describe("clear()", () => {
476
496
  it("resets text and clears parse error", () => {
477
497
  const ref = React.createRef<JsonFieldHandle>();
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
  import { render, screen, fireEvent, act } from "@testing-library/react";
3
3
  import userEvent from "@testing-library/user-event";
4
4
  import ProtocolFormField from "../../../src/components/ProtocolFormField";
5
+ import { MONOSPACE_FONT_STACK } from "../../../src/fonts";
5
6
 
6
7
  // NB: This file adds / duplicates existing tests from:
7
8
  // - `src/components/__tests__/ProtocolFormField-test.tsx`.
@@ -64,6 +65,41 @@ describe("ProtocolFormField — json type", () => {
64
65
  });
65
66
  });
66
67
 
68
+ describe("ProtocolFormField — use_monospace_font", () => {
69
+ (
70
+ [
71
+ { id: "text-input", use_monospace_font: true, hasStyle: true },
72
+ {
73
+ id: "textarea",
74
+ type: "textarea",
75
+ use_monospace_font: true,
76
+ hasStyle: true,
77
+ },
78
+ { id: "absent", hasStyle: false },
79
+ ] as {
80
+ id: string;
81
+ type?: string;
82
+ use_monospace_font?: boolean;
83
+ hasStyle: boolean;
84
+ }[]
85
+ ).forEach(({ id, type, use_monospace_font, hasStyle }) => {
86
+ it(id, () => {
87
+ render(
88
+ <ProtocolFormField
89
+ setting={{ key: "f", label: "My Field", type, use_monospace_font }}
90
+ disabled={false}
91
+ />
92
+ );
93
+ const el = screen.getByLabelText("My Field");
94
+ if (hasStyle) {
95
+ expect(el).toHaveStyle({ fontFamily: MONOSPACE_FONT_STACK });
96
+ } else {
97
+ expect(el).not.toHaveStyle({ fontFamily: MONOSPACE_FONT_STACK });
98
+ }
99
+ });
100
+ });
101
+ });
102
+
67
103
  describe("ProtocolFormField", () => {
68
104
  it("renders date-picker setting", async () => {
69
105
  const user = userEvent.setup();