@arpproject/recrate 0.1.7-test2 → 0.1.7-test3
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
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arpproject/recrate",
|
|
3
|
-
"version": "0.1.7-
|
|
3
|
+
"version": "0.1.7-test3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
|
|
6
|
-
"main": "./dist/recrate.
|
|
6
|
+
"main": "./dist/recrate.umd.js",
|
|
7
7
|
"module": "./dist/recrate.es.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
"exports": {
|
|
11
11
|
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
12
13
|
"import": "./dist/recrate.es.js",
|
|
13
|
-
"
|
|
14
|
+
"require": "./dist/recrate.umd.js"
|
|
14
15
|
},
|
|
15
16
|
"./style.css": "./dist/recrate.css"
|
|
16
17
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { validateIri, IriValidationStrategy } from "../lib/validate-iri";
|
|
2
2
|
|
|
3
3
|
type ValidateIdParams = {
|
|
4
4
|
id: string | undefined;
|
|
@@ -44,7 +44,7 @@ export function validateId({ id, type }: ValidateIdParams): ValidateIdResponse {
|
|
|
44
44
|
|
|
45
45
|
// otherwise check that the id is a valid IRI
|
|
46
46
|
try {
|
|
47
|
-
let result =
|
|
47
|
+
let result = validateIri(id, IriValidationStrategy.Strict);
|
|
48
48
|
if (!result) {
|
|
49
49
|
// it's valid
|
|
50
50
|
return { isValid: true };
|
package/vite.config.ts
CHANGED
|
@@ -21,20 +21,78 @@ export default defineConfig({
|
|
|
21
21
|
})
|
|
22
22
|
|
|
23
23
|
],
|
|
24
|
+
optimizeDeps: {
|
|
25
|
+
include: [
|
|
26
|
+
"ajv",
|
|
27
|
+
"antd",
|
|
28
|
+
"dayjs",
|
|
29
|
+
"lodash",
|
|
30
|
+
"lodash-es",
|
|
31
|
+
"validator",
|
|
32
|
+
"@emotion/react",
|
|
33
|
+
"@emotion/styled",
|
|
34
|
+
"@mui/material",
|
|
35
|
+
"@mui/icons-material",
|
|
36
|
+
"@mui/system",
|
|
37
|
+
"react-i18next",
|
|
38
|
+
"i18next",
|
|
39
|
+
"zustand",
|
|
40
|
+
"uuid",
|
|
41
|
+
"leaflet",
|
|
42
|
+
"codemirror"
|
|
43
|
+
],
|
|
44
|
+
},
|
|
24
45
|
build: {
|
|
25
46
|
lib: {
|
|
26
47
|
entry: path.resolve(__dirname, 'src/index.ts'),
|
|
27
48
|
name: 'ReCrate',
|
|
28
49
|
fileName: (format) => `recrate.${format}.js`,
|
|
29
|
-
formats: ["es"],
|
|
50
|
+
formats: ["es", "umd"],
|
|
30
51
|
},
|
|
31
52
|
minify: false,
|
|
32
53
|
rollupOptions: {
|
|
33
|
-
external: [
|
|
54
|
+
external: [
|
|
55
|
+
"react",
|
|
56
|
+
"react-dom",
|
|
57
|
+
"styled-components",
|
|
58
|
+
"antd",
|
|
59
|
+
"@emotion/react",
|
|
60
|
+
"@emotion/styled",
|
|
61
|
+
"@mui/material",
|
|
62
|
+
"@mui/icons-material",
|
|
63
|
+
"@mui/system",
|
|
64
|
+
"react-i18next",
|
|
65
|
+
"i18next",
|
|
66
|
+
"zustand",
|
|
67
|
+
"lodash",
|
|
68
|
+
"dayjs",
|
|
69
|
+
"ajv",
|
|
70
|
+
"validator",
|
|
71
|
+
"uuid",
|
|
72
|
+
"leaflet",
|
|
73
|
+
"codemirror"
|
|
74
|
+
],
|
|
34
75
|
output: {
|
|
35
76
|
globals: {
|
|
36
77
|
react: "React",
|
|
37
|
-
"react-dom": "ReactDOM"
|
|
78
|
+
"react-dom": "ReactDOM",
|
|
79
|
+
"styled-components": "styled",
|
|
80
|
+
"antd": "antd",
|
|
81
|
+
"@emotion/react": "emotionReact",
|
|
82
|
+
"@emotion/styled": "emotionStyled",
|
|
83
|
+
"@mui/material": "MuiMaterial",
|
|
84
|
+
"@mui/icons-material": "MuiIcons",
|
|
85
|
+
"@mui/system": "MuiSystem",
|
|
86
|
+
"react-i18next": "ReactI18next",
|
|
87
|
+
"i18next": "i18next",
|
|
88
|
+
"zustand": "zustand",
|
|
89
|
+
"lodash": "_",
|
|
90
|
+
"dayjs": "dayjs",
|
|
91
|
+
"ajv": "ajv",
|
|
92
|
+
"validator": "validator",
|
|
93
|
+
"uuid": "uuid",
|
|
94
|
+
"leaflet": "L",
|
|
95
|
+
"codemirror": "CodeMirror"
|
|
38
96
|
},
|
|
39
97
|
}
|
|
40
98
|
},
|
|
@@ -43,4 +101,4 @@ export default defineConfig({
|
|
|
43
101
|
postcss: './postcss.config.js',
|
|
44
102
|
}
|
|
45
103
|
|
|
46
|
-
})
|
|
104
|
+
})
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
3
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
// node_modules/validate-iri/lib/Validate.js
|
|
7
|
-
var require_Validate = __commonJS({
|
|
8
|
-
"node_modules/validate-iri/lib/Validate.js"(exports) {
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.validateIri = exports.IriValidationStrategy = void 0;
|
|
11
|
-
function buildAbsoluteIriRfc3987Regex() {
|
|
12
|
-
const sub_delims_raw = `!$&'()*+,;=`;
|
|
13
|
-
const sub_delims = `[${sub_delims_raw}]`;
|
|
14
|
-
const pct_encoded = `%[a-fA-F0-9]{2}`;
|
|
15
|
-
const dec_octet = "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])";
|
|
16
|
-
const ipv4address = `${dec_octet}\\.${dec_octet}\\.${dec_octet}\\.${dec_octet}`;
|
|
17
|
-
const h16 = `[a-fA-F0-9]{1,4}`;
|
|
18
|
-
const ls32 = `(${h16}:${h16}|${ipv4address})`;
|
|
19
|
-
const ipv6address = `((${h16}:){6}${ls32}|::(${h16}:){5}${ls32}|(${h16})?::(${h16}:){4}${ls32}|((${h16}:){0,1}${h16})?::(${h16}:){3}${ls32}|((${h16}:){0,2}${h16})?::(${h16}:){2}${ls32}|((${h16}:){0,3}${h16})?::${h16}:${ls32}|((${h16}:){0,4}${h16})?::${ls32}|((${h16}:){0,5}${h16})?::${h16}|((${h16}:){0,6}${h16})?::)`;
|
|
20
|
-
const ipvfuture = `v[a-fA-F0-9]+\\.(${sub_delims}|${sub_delims}|":)+`;
|
|
21
|
-
const ip_literal = `\\[(${ipv6address}|${ipvfuture})\\]`;
|
|
22
|
-
const port = `[0-9]*`;
|
|
23
|
-
const scheme = `[a-zA-Z][a-zA-Z0-9+\\-.]*`;
|
|
24
|
-
const iprivate_raw = `\uE000-\uF8FF\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}`;
|
|
25
|
-
const iprivate = `[${iprivate_raw}]`;
|
|
26
|
-
const ucschar_raw = `\xA0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\u{10000}-\u{1FFFD}\u{20000}-\u{2FFFD}\u{30000}-\u{3FFFD}\u{40000}-\u{4FFFD}\u{50000}-\u{5FFFD}\u{60000}-\u{6FFFD}\u{70000}-\u{7FFFD}\u{80000}-\u{8FFFD}\u{90000}-\u{9FFFD}\u{A0000}-\u{AFFFD}\u{B0000}-\u{BFFFD}\u{C0000}-\u{CFFFD}\u{D0000}-\u{DFFFD}\u{E1000}-\u{EFFFD}`;
|
|
27
|
-
const iunreserved_raw = `a-zA-Z0-9\\-._~${ucschar_raw}`;
|
|
28
|
-
const iunreserved = `[${iunreserved_raw}]`;
|
|
29
|
-
const ipchar = `(${iunreserved}|${pct_encoded}|${sub_delims}|[:@])*`;
|
|
30
|
-
const ifragment = `(${ipchar}|[\\/?])*`;
|
|
31
|
-
const iquery = `(${ipchar}|${iprivate}|[\\/?])*`;
|
|
32
|
-
const isegment_nz = `(${ipchar})+`;
|
|
33
|
-
const isegment = `(${ipchar})*`;
|
|
34
|
-
const ipath_empty = "";
|
|
35
|
-
const ipath_rootless = `${isegment_nz}(\\/${isegment})*`;
|
|
36
|
-
const ipath_absolute = `\\/(${isegment_nz}(\\/${isegment})*)?`;
|
|
37
|
-
const ipath_abempty = `(\\/${isegment})*`;
|
|
38
|
-
const ireg_name = `(${iunreserved}|${pct_encoded}|${sub_delims})*`;
|
|
39
|
-
const ihost = `(${ip_literal}|${ipv4address}|${ireg_name})`;
|
|
40
|
-
const iuserinfo = `(${iunreserved}|${pct_encoded}|${sub_delims}|:)*`;
|
|
41
|
-
const iauthority = `(${iuserinfo}@)?${ihost}(:${port})?`;
|
|
42
|
-
const ihier_part = `(\\/\\/${iauthority}${ipath_abempty}|${ipath_absolute}|${ipath_rootless}|${ipath_empty})`;
|
|
43
|
-
const iri = `^${scheme}:${ihier_part}(\\?${iquery})?(#${ifragment})?$`;
|
|
44
|
-
return new RegExp(iri, "u");
|
|
45
|
-
}
|
|
46
|
-
var STRICT_IRI_REGEX = buildAbsoluteIriRfc3987Regex();
|
|
47
|
-
var PRAGMATIC_IRI_REGEX = /^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u;
|
|
48
|
-
var IriValidationStrategy;
|
|
49
|
-
(function(IriValidationStrategy2) {
|
|
50
|
-
IriValidationStrategy2["Strict"] = "strict";
|
|
51
|
-
IriValidationStrategy2["Pragmatic"] = "pragmatic";
|
|
52
|
-
IriValidationStrategy2["None"] = "none";
|
|
53
|
-
})(IriValidationStrategy = exports.IriValidationStrategy || (exports.IriValidationStrategy = {}));
|
|
54
|
-
function validateIri(iri, strategy = IriValidationStrategy.Strict) {
|
|
55
|
-
switch (strategy) {
|
|
56
|
-
case IriValidationStrategy.Strict:
|
|
57
|
-
return STRICT_IRI_REGEX.test(iri) ? void 0 : new Error(`Invalid IRI according to RFC 3987: '${iri}'`);
|
|
58
|
-
case IriValidationStrategy.Pragmatic:
|
|
59
|
-
return PRAGMATIC_IRI_REGEX.test(iri) ? void 0 : new Error(`Invalid IRI according to RDF Turtle: '${iri}'`);
|
|
60
|
-
case IriValidationStrategy.None:
|
|
61
|
-
return void 0;
|
|
62
|
-
default:
|
|
63
|
-
return new Error(`Not supported validation strategy "${strategy}"`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.validateIri = validateIri;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
export default require_Validate();
|