@sillsdev/config-r 1.0.0-alpha.3 → 1.0.0-alpha.30

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/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  export { ConfigrPane } from './ConfigrPane';
2
+ export type { ConfigrPaneHandle } from './ConfigrPane';
3
+ export * from './ConfigrLocalizations';
4
+ export * from './validation';
2
5
  export * from './ContentPane';
3
6
  export * from './ConfigrColorPicker';
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ export type ConfigrValidationResult = boolean | string;
3
+ export type ConfigrValidation<T> = (value: T) => ConfigrValidationResult;
4
+ export type ConfigrErrorMessageGetter = (data: Record<string, unknown>) => string | undefined;
5
+ export declare const RequiredMessageContext: React.Context<boolean>;
6
+ export declare const ActiveFieldPathContext: React.Context<string | undefined>;
7
+ export declare function getFieldPathFromEventTarget(target: EventTarget | null): string | undefined;
8
+ type ValidationMessageProps<T> = {
9
+ path: string;
10
+ value: T;
11
+ disabled?: boolean;
12
+ required?: boolean;
13
+ validation?: ConfigrValidation<T>;
14
+ getErrorMessage?: ConfigrErrorMessageGetter;
15
+ };
16
+ export declare function useValidationMessage<T>(props: ValidationMessageProps<T>): string | undefined;
17
+ type ValidationConfig<T> = Omit<ValidationMessageProps<T>, 'value' | 'disabled'> & {
18
+ disabled?: boolean;
19
+ };
20
+ export declare function useValidationMessageForValue<T>(config: ValidationConfig<T>, value: T, disabled?: boolean | undefined): string | undefined;
21
+ export {};
package/package.json CHANGED
@@ -1,101 +1,119 @@
1
1
  {
2
2
  "name": "@sillsdev/config-r",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-alpha.30",
4
4
  "license": "MIT",
5
- "packageManager": "yarn@1.22.19",
6
5
  "keywords": [
7
6
  "react",
8
7
  "settings"
9
8
  ],
10
9
  "repository": {
11
- "type": "git",
12
- "url": "https://github.com/BloomBooks/config-r"
10
+ "url": "git+https://github.com/sillsdev/config-r.git"
13
11
  },
14
12
  "scripts": {
15
- "dev": "start http://localhost:3000 && vite",
13
+ "dev": "start http://localhost:5173 && vite",
16
14
  "// see https://github.com/vitejs/vite/issues/3461, this uses a totally different builder that has its typescript typings act more together than vitejs": "",
17
15
  "build": "tsc && vite build",
16
+ "build:dev": "tsc && vite build --mode development --minify false --sourcemap true --watch",
18
17
  "serve": "vite preview",
19
18
  "lint:fix": "eslint ./src --ext .jsx,.js,.ts,.tsx --quiet --fix --ignore-path ./.gitignore",
20
- "lint:format": "prettier --loglevel warn --write \"./**/*.{js,jsx,ts,tsx,css,md,json}\" ",
21
- "lint": "yarn lint:format && yarn lint:fix ",
19
+ "lint:format": "prettier --log-level warn --write \"./**/*.{js,jsx,ts,tsx,css,md,json}\"",
20
+ "lint": "pnpm lint:format && pnpm lint:fix ",
21
+ "prepare": "simple-git-hooks",
22
22
  "type-check": "tsc",
23
- "storybook": "start-storybook -p 6006",
24
- "build-storybook": "build-storybook"
23
+ "test": "vitest run",
24
+ "storybook": "storybook dev -p 6006",
25
+ "build-storybook": "storybook build"
25
26
  },
26
27
  "dependencies": {
27
- "@textea/json-viewer": "^2.13.1",
28
- "formik": "^2.2.9",
29
- "formik-mui": "^4.0.0",
30
- "lodash": "^4.17.21",
31
- "mark.js": "^8.11.1",
32
- "react-children-utilities": "^2.8.0"
28
+ "@textea/json-viewer": "2.13.1",
29
+ "formik": "2.2.9",
30
+ "formik-mui": "4.0.0",
31
+ "lodash": "4.17.21",
32
+ "mark.js": "8.11.1",
33
+ "react-children-utilities": "2.8.0"
33
34
  },
34
35
  "peerDependencies": {
35
36
  "@emotion/react": ">= 11.8.2 < 12",
36
37
  "@emotion/styled": ">= 11.8.1 < 12",
37
38
  "@mui/icons-material": "5.x",
38
39
  "@mui/material": ">= 5.5.3 < 6",
39
- "react": ">= 17.0.2 < 18",
40
- "react-dom": ">= 17.0.2 < 18"
40
+ "react": ">= 17.0.2 < 19",
41
+ "react-dom": ">= 17.0.2 < 19"
41
42
  },
42
43
  "devDependencies": {
43
- "@babel/core": "^7.16.5",
44
- "@emotion/babel-plugin": "^11.7.2",
45
- "@emotion/eslint-plugin": "^11.10.0",
46
- "@emotion/react": "^11.8.2",
47
- "@emotion/styled": "^11.8.1",
48
- "@mui/icons-material": "^5.5.1",
49
- "@mui/material": "^5.5.3",
50
- "@semantic-release/changelog": "^6.0.2",
51
- "@semantic-release/commit-analyzer": "^9.0.2",
52
- "@storybook/addon-actions": "^6.5.16",
53
- "@storybook/addon-essentials": "^6.5.16",
54
- "@storybook/addon-links": "^6.5.16",
55
- "@storybook/builder-vite": "^0.4.2",
56
- "@storybook/react": "^6.5.16",
57
- "@types/lodash": "^4.14.178",
58
- "@types/mark.js": "^8.11.7",
59
- "@types/react": "^18.0.28",
60
- "@types/react-color": "^3.0.6",
61
- "@types/react-dom": "^18.0.11",
62
- "@typescript-eslint/eslint-plugin": "^5.51.0",
63
- "@typescript-eslint/parser": "^5.51.0",
64
- "@vitejs/plugin-react": "^3.1.0",
65
- "@vitejs/plugin-react-refresh": "^1.3.6",
66
- "babel-loader": "^8.2.3",
67
- "eslint": "^8.33.0",
68
- "eslint-config-prettier": "^8.6.0",
69
- "eslint-plugin-import": "^2.27.5",
70
- "eslint-plugin-jsx-a11y": "^6.7.1",
71
- "eslint-plugin-prettier": "^4.2.1",
72
- "eslint-plugin-react": "^7.32.2",
73
- "eslint-plugin-simple-import-sort": "^10.0.0",
74
- "eslint-plugin-storybook": "^0.6.10",
75
- "pre-commit": "^1.2.2",
76
- "prettier": "^2.8.4",
77
- "react": "^18.2.0",
78
- "react-color": "^2.19.3",
79
- "react-dom": "^18.2.0",
80
- "rollup-plugin-copy": "^3.4.0",
81
- "typescript": "^4.9.5",
82
- "vite": "^4.1.1",
83
- "vite-plugin-dts": "^1.7.2"
44
+ "@babel/core": "7.21.0",
45
+ "@emotion/babel-plugin": "11.10.6",
46
+ "@emotion/eslint-plugin": "11.10.0",
47
+ "@emotion/react": "11.10.6",
48
+ "@emotion/styled": "11.10.6",
49
+ "@mui/icons-material": "5.11.9",
50
+ "@mui/material": "5.11.10",
51
+ "@semantic-release/changelog": "6.0.2",
52
+ "@semantic-release/commit-analyzer": "9.0.2",
53
+ "@storybook/addon-actions": "8.2.8",
54
+ "@storybook/addon-essentials": "8.2.8",
55
+ "@storybook/addon-links": "8.2.8",
56
+ "@storybook/builder-vite": "8.2.8",
57
+ "@storybook/react": "8.2.8",
58
+ "@storybook/react-vite": "8.2.8",
59
+ "@testing-library/dom": "10.4.0",
60
+ "@testing-library/react": "16.1.0",
61
+ "@types/lodash": "4.14.191",
62
+ "@types/mark.js": "8.11.8",
63
+ "@types/react": "18.0.28",
64
+ "@types/react-color": "3.0.6",
65
+ "@types/react-dom": "18.0.11",
66
+ "@typescript-eslint/eslint-plugin": "5.53.0",
67
+ "@typescript-eslint/parser": "5.53.0",
68
+ "@vitejs/plugin-react": "4.3.3",
69
+ "@vitejs/plugin-react-refresh": "1.3.6",
70
+ "babel-loader": "8.3.0",
71
+ "eslint": "8.34.0",
72
+ "eslint-config-prettier": "8.6.0",
73
+ "eslint-plugin-import": "2.27.5",
74
+ "eslint-plugin-jsx-a11y": "6.7.1",
75
+ "eslint-plugin-prettier": "4.2.1",
76
+ "eslint-plugin-react": "7.32.2",
77
+ "eslint-plugin-simple-import-sort": "10.0.0",
78
+ "eslint-plugin-storybook": "0.8.0",
79
+ "jsdom": "25.0.1",
80
+ "prettier": "3.3.3",
81
+ "react": "18.2.0",
82
+ "react-color": "2.19.3",
83
+ "react-dom": "18.2.0",
84
+ "rollup-plugin-copy": "3.5.0",
85
+ "simple-git-hooks": "2.13.1",
86
+ "semantic-release": "25.0.3",
87
+ "storybook": "8.2.8",
88
+ "typescript": "5.5.4",
89
+ "vite": "5.4.11",
90
+ "vite-plugin-dts": "4.3.0",
91
+ "vitest": "2.1.9"
92
+ },
93
+ "simple-git-hooks": {
94
+ "pre-commit": "pnpm lint"
84
95
  },
85
- "pre-commit": "lint",
86
96
  "files": [
87
97
  "dist"
88
98
  ],
89
- "main": "./dist/configr.es.js",
90
99
  "module": "./dist/configr.es.js",
91
- "//about index.d.ts": "see comment in vite.config.ts",
92
- "types": "./dist/index.d.ts",
100
+ "main": "./dist/configr.cjs.js",
93
101
  "exports": {
94
102
  ".": {
95
- "require": "./dist/configr.es.js"
103
+ "types": "./dist/index.d.ts",
104
+ "import": "./dist/configr.es.js",
105
+ "require": "./dist/configr.cjs.js",
106
+ "default": "./dist/configr.es.js"
96
107
  }
97
108
  },
109
+ "types": "./dist/index.d.ts",
98
110
  "publishConfig": {
99
111
  "access": "public"
100
- }
112
+ },
113
+ "packageManager": "pnpm@10.33.0",
114
+ "volta": {
115
+ "node": "24.14.0",
116
+ "pnpm": "10.33.0"
117
+ },
118
+ "type": "module"
101
119
  }