@cccsaurora/clue-ui 1.6.0-dev.524.1 → 1.6.0-dev.535.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/components/display/markdown/index.js +67 -47
- package/package.json +22 -22
|
@@ -7,7 +7,7 @@ import ReactMarkdown from "react-markdown";
|
|
|
7
7
|
import { Prism } from "react-syntax-highlighter";
|
|
8
8
|
import remarkGfm from "remark-gfm";
|
|
9
9
|
/**
|
|
10
|
-
* react-router v7.18.
|
|
10
|
+
* react-router v7.18.6
|
|
11
11
|
*
|
|
12
12
|
* Copyright (c) Remix Software Inc.
|
|
13
13
|
*
|
|
@@ -65,6 +65,65 @@ function parsePath(path) {
|
|
|
65
65
|
}
|
|
66
66
|
return parsedPath;
|
|
67
67
|
}
|
|
68
|
+
var DEFAULT_NAVIGATION_URL = new URL("http://localhost");
|
|
69
|
+
function getNavigatorCurrentUrl(navigator) {
|
|
70
|
+
if (navigator.createURL) {
|
|
71
|
+
return navigator.createURL("/");
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
return new URL(navigator.createHref("/"), DEFAULT_NAVIGATION_URL);
|
|
75
|
+
} catch {
|
|
76
|
+
return DEFAULT_NAVIGATION_URL;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function isSameOrigin(a, b) {
|
|
80
|
+
return a.origin === b.origin && (a.origin !== "null" || a.protocol === b.protocol && a.host === b.host);
|
|
81
|
+
}
|
|
82
|
+
function isExplicitUrl(destination, target) {
|
|
83
|
+
if (destination.startsWith("//")) {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
let protocol = target.protocol.toLowerCase();
|
|
87
|
+
if (!destination.toLowerCase().startsWith(protocol)) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
return target.host === "" || destination.slice(protocol.length).startsWith("//");
|
|
91
|
+
}
|
|
92
|
+
function validateDocumentNavigationTarget(destination) {
|
|
93
|
+
let normalized = destination.replace(/[\t\n\r]/g, "");
|
|
94
|
+
let start = 0;
|
|
95
|
+
while (normalized.charCodeAt(start) <= 32) start++;
|
|
96
|
+
normalized = normalized.slice(start);
|
|
97
|
+
if (!ABSOLUTE_URL_REGEX.test(normalized)) return;
|
|
98
|
+
let target;
|
|
99
|
+
try {
|
|
100
|
+
target = new URL(destination, DEFAULT_NAVIGATION_URL);
|
|
101
|
+
} catch {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (!isExplicitUrl(destination, target)) {
|
|
105
|
+
throw new Error("External navigation is not allowed");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function validateNavigationTarget(original, resolved, currentUrl, externalPolicy) {
|
|
109
|
+
let originalUrl = null;
|
|
110
|
+
try {
|
|
111
|
+
originalUrl = original == null ? null : new URL(original, currentUrl);
|
|
112
|
+
} catch {
|
|
113
|
+
}
|
|
114
|
+
let resolvedUrl = new URL(resolved, currentUrl);
|
|
115
|
+
let originalIsExternal = originalUrl != null && !isSameOrigin(originalUrl, currentUrl);
|
|
116
|
+
let resolvedIsExternal = !isSameOrigin(resolvedUrl, currentUrl);
|
|
117
|
+
if (externalPolicy === "reject") {
|
|
118
|
+
if (originalIsExternal || resolvedIsExternal) {
|
|
119
|
+
throw new Error("External navigation is not allowed");
|
|
120
|
+
}
|
|
121
|
+
} else if (resolvedIsExternal) {
|
|
122
|
+
if (originalUrl == null || !isExplicitUrl(original, originalUrl) || !isSameOrigin(originalUrl, resolvedUrl)) {
|
|
123
|
+
throw new Error("External navigation is not allowed");
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
68
127
|
function matchRoutes(routes, locationArg, basename = "/") {
|
|
69
128
|
return matchRoutesImpl(routes, locationArg, basename, false);
|
|
70
129
|
}
|
|
@@ -537,49 +596,6 @@ function parseToInfo(_to, basename) {
|
|
|
537
596
|
};
|
|
538
597
|
}
|
|
539
598
|
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
540
|
-
var DEFAULT_NAVIGATION_URL = new URL("http://localhost");
|
|
541
|
-
function getNavigatorCurrentUrl(navigator) {
|
|
542
|
-
if (navigator.createURL) {
|
|
543
|
-
return navigator.createURL("/");
|
|
544
|
-
}
|
|
545
|
-
try {
|
|
546
|
-
return new URL(navigator.createHref("/"), DEFAULT_NAVIGATION_URL);
|
|
547
|
-
} catch {
|
|
548
|
-
return DEFAULT_NAVIGATION_URL;
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
function isSameOrigin(a, b) {
|
|
552
|
-
return a.origin === b.origin && (a.origin !== "null" || a.protocol === b.protocol && a.host === b.host);
|
|
553
|
-
}
|
|
554
|
-
function isExplicitUrl(destination, target) {
|
|
555
|
-
if (destination.startsWith("//")) {
|
|
556
|
-
return true;
|
|
557
|
-
}
|
|
558
|
-
let protocol = target.protocol.toLowerCase();
|
|
559
|
-
if (!destination.toLowerCase().startsWith(protocol)) {
|
|
560
|
-
return false;
|
|
561
|
-
}
|
|
562
|
-
return target.host === "" || destination.slice(protocol.length).startsWith("//");
|
|
563
|
-
}
|
|
564
|
-
function validateNavigationTarget(original, resolved, currentUrl, externalPolicy) {
|
|
565
|
-
let originalUrl = null;
|
|
566
|
-
try {
|
|
567
|
-
originalUrl = original == null ? null : new URL(original, currentUrl);
|
|
568
|
-
} catch {
|
|
569
|
-
}
|
|
570
|
-
let resolvedUrl = new URL(resolved, currentUrl);
|
|
571
|
-
let originalIsExternal = originalUrl != null && !isSameOrigin(originalUrl, currentUrl);
|
|
572
|
-
let resolvedIsExternal = !isSameOrigin(resolvedUrl, currentUrl);
|
|
573
|
-
if (externalPolicy === "reject") {
|
|
574
|
-
if (originalIsExternal || resolvedIsExternal) {
|
|
575
|
-
throw new Error("External navigation is not allowed");
|
|
576
|
-
}
|
|
577
|
-
} else if (resolvedIsExternal) {
|
|
578
|
-
if (originalUrl == null || !isExplicitUrl(original, originalUrl) || !isSameOrigin(originalUrl, resolvedUrl)) {
|
|
579
|
-
throw new Error("External navigation is not allowed");
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
599
|
var validMutationMethodsArr = [
|
|
584
600
|
"POST",
|
|
585
601
|
"PUT",
|
|
@@ -1785,7 +1801,7 @@ var isBrowser2 = typeof window !== "undefined" && typeof window.document !== "un
|
|
|
1785
1801
|
try {
|
|
1786
1802
|
if (isBrowser2) {
|
|
1787
1803
|
window.__reactRouterVersion = // @ts-expect-error
|
|
1788
|
-
"7.18.
|
|
1804
|
+
"7.18.6";
|
|
1789
1805
|
}
|
|
1790
1806
|
} catch (e) {
|
|
1791
1807
|
}
|
|
@@ -1847,6 +1863,8 @@ var Link = React3.forwardRef(
|
|
|
1847
1863
|
}
|
|
1848
1864
|
}
|
|
1849
1865
|
let isSpaLink = !(parsed.isExternal || reloadDocument);
|
|
1866
|
+
let renderedHref = (isSpaLink ? maskedHref : void 0) || parsed.absoluteURL || href;
|
|
1867
|
+
validateDocumentNavigationTarget(renderedHref);
|
|
1850
1868
|
let link = (
|
|
1851
1869
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1852
1870
|
/* @__PURE__ */ React3.createElement(
|
|
@@ -1854,7 +1872,7 @@ var Link = React3.forwardRef(
|
|
|
1854
1872
|
{
|
|
1855
1873
|
...rest,
|
|
1856
1874
|
...prefetchHandlers,
|
|
1857
|
-
href:
|
|
1875
|
+
href: renderedHref,
|
|
1858
1876
|
onClick: isSpaLink ? handleClick : onClick,
|
|
1859
1877
|
ref: mergeRefs(forwardedRef, prefetchRef),
|
|
1860
1878
|
target,
|
|
@@ -2124,7 +2142,9 @@ function useFormAction(action, { relative } = {}) {
|
|
|
2124
2142
|
if (basename !== "/") {
|
|
2125
2143
|
path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
|
|
2126
2144
|
}
|
|
2127
|
-
|
|
2145
|
+
let formAction = createPath(path);
|
|
2146
|
+
validateDocumentNavigationTarget(formAction);
|
|
2147
|
+
return formAction;
|
|
2128
2148
|
}
|
|
2129
2149
|
function useViewTransitionState(to, { relative } = {}) {
|
|
2130
2150
|
let vtContext = React3.useContext(ViewTransitionContext);
|
package/package.json
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"@jsonforms/core": "^3.8.0",
|
|
16
16
|
"@jsonforms/material-renderers": "^3.8.0",
|
|
17
17
|
"@jsonforms/react": "^3.8.0",
|
|
18
|
-
"@microlink/react-json-view": "^1.31.
|
|
19
|
-
"@testing-library/user-event": "^14.6.
|
|
18
|
+
"@microlink/react-json-view": "^1.31.51",
|
|
19
|
+
"@testing-library/user-event": "^14.6.13",
|
|
20
20
|
"ajv": "^8.20.0",
|
|
21
21
|
"d3": "^7.9.2",
|
|
22
22
|
"dayjs": "^1.11.23",
|
|
@@ -58,60 +58,60 @@
|
|
|
58
58
|
},
|
|
59
59
|
"type": "module",
|
|
60
60
|
"types": "main.d.ts",
|
|
61
|
-
"version": "1.6.0-dev.
|
|
61
|
+
"version": "1.6.0-dev.535.1",
|
|
62
62
|
"exports": {
|
|
63
63
|
".": "./main.js",
|
|
64
64
|
"./index.css": "./index.css",
|
|
65
65
|
"./en/*.json": "./en/*.json",
|
|
66
66
|
"./fr/*.json": "./fr/*.json",
|
|
67
|
-
"./text/*": "./text/*.js",
|
|
68
|
-
"./types/*": "./types/*.js",
|
|
69
67
|
"./plugins/*": "./plugins/*.js",
|
|
70
|
-
"./
|
|
68
|
+
"./text/*": "./text/*.js",
|
|
69
|
+
"./database/*": "./database/*.js",
|
|
70
|
+
"./database": "./database/index.js",
|
|
71
71
|
"./hooks/*": "./hooks/*.js",
|
|
72
|
+
"./data/*": "./data/*.js",
|
|
72
73
|
"./icons/*": "./icons/*.js",
|
|
73
|
-
"./components/*": "./components/*.js",
|
|
74
74
|
"./utils/*": "./utils/*.js",
|
|
75
75
|
"./utils/*.json": "./utils/*.json",
|
|
76
|
-
"./
|
|
77
|
-
"./
|
|
78
|
-
"./components/fetchers/*": "./components/fetchers/*.js",
|
|
76
|
+
"./types/*": "./types/*.js",
|
|
77
|
+
"./components/*": "./components/*.js",
|
|
79
78
|
"./components/actions/*": "./components/actions/*.js",
|
|
80
|
-
"./components/display/*": "./components/display/*.js",
|
|
81
79
|
"./components/enrichment/*": "./components/enrichment/*.js",
|
|
82
|
-
"./components/group/*": "./components/group/*.js",
|
|
83
80
|
"./components/stats/*": "./components/stats/*.js",
|
|
81
|
+
"./components/group/*": "./components/group/*.js",
|
|
82
|
+
"./components/fetchers/*": "./components/fetchers/*.js",
|
|
83
|
+
"./components/display/*": "./components/display/*.js",
|
|
84
84
|
"./components/display/json/*": "./components/display/json/*.js",
|
|
85
85
|
"./components/display/json": "./components/display/json/index.js",
|
|
86
|
-
"./components/display/icons/*": "./components/display/icons/*.js",
|
|
87
86
|
"./components/display/graph/*": "./components/display/graph/*.js",
|
|
88
87
|
"./components/display/graph": "./components/display/graph/index.js",
|
|
88
|
+
"./components/display/icons/*": "./components/display/icons/*.js",
|
|
89
89
|
"./components/display/markdown/*.md": "./components/display/markdown/*.md.js",
|
|
90
90
|
"./components/display/markdown": "./components/display/markdown/index.js",
|
|
91
91
|
"./components/display/graph/elements/*": "./components/display/graph/elements/*.js",
|
|
92
92
|
"./components/display/graph/visualizations/*": "./components/display/graph/visualizations/*.js",
|
|
93
|
+
"./components/display/graph/visualizations/tree/*": "./components/display/graph/visualizations/tree/*.js",
|
|
94
|
+
"./components/display/graph/visualizations/tree": "./components/display/graph/visualizations/tree/index.js",
|
|
95
|
+
"./components/display/graph/visualizations/icons/*": "./components/display/graph/visualizations/icons/*.js",
|
|
96
|
+
"./components/display/graph/visualizations/icons": "./components/display/graph/visualizations/icons/index.js",
|
|
93
97
|
"./components/display/graph/visualizations/panels/*": "./components/display/graph/visualizations/panels/*.js",
|
|
94
98
|
"./components/display/graph/visualizations/cloud/*": "./components/display/graph/visualizations/cloud/*.js",
|
|
95
99
|
"./components/display/graph/visualizations/cloud": "./components/display/graph/visualizations/cloud/index.js",
|
|
96
|
-
"./components/display/graph/visualizations/icons/*": "./components/display/graph/visualizations/icons/*.js",
|
|
97
|
-
"./components/display/graph/visualizations/icons": "./components/display/graph/visualizations/icons/index.js",
|
|
98
|
-
"./components/display/graph/visualizations/tree/*": "./components/display/graph/visualizations/tree/*.js",
|
|
99
|
-
"./components/display/graph/visualizations/tree": "./components/display/graph/visualizations/tree/index.js",
|
|
100
|
-
"./components/actions/form/*": "./components/actions/form/*.js",
|
|
101
100
|
"./components/actions/formats/*": "./components/actions/formats/*.js",
|
|
102
101
|
"./components/actions/formats": "./components/actions/formats/index.js",
|
|
103
|
-
"./
|
|
104
|
-
"./plugins/image": "./plugins/image/index.js",
|
|
105
|
-
"./plugins/test/*": "./plugins/test/*.js",
|
|
106
|
-
"./plugins/test": "./plugins/test/index.js",
|
|
102
|
+
"./components/actions/form/*": "./components/actions/form/*.js",
|
|
107
103
|
"./plugins/json/*": "./plugins/json/*.js",
|
|
108
104
|
"./plugins/json": "./plugins/json/index.js",
|
|
109
105
|
"./plugins/file/*": "./plugins/file/*.js",
|
|
110
106
|
"./plugins/file": "./plugins/file/index.js",
|
|
111
107
|
"./plugins/graph/*": "./plugins/graph/*.js",
|
|
112
108
|
"./plugins/graph": "./plugins/graph/index.js",
|
|
109
|
+
"./plugins/test/*": "./plugins/test/*.js",
|
|
110
|
+
"./plugins/test": "./plugins/test/index.js",
|
|
113
111
|
"./plugins/markdown/*.md": "./plugins/markdown/*.md.js",
|
|
114
112
|
"./plugins/markdown": "./plugins/markdown/index.js",
|
|
113
|
+
"./plugins/image/*": "./plugins/image/*.js",
|
|
114
|
+
"./plugins/image": "./plugins/image/index.js",
|
|
115
115
|
"./plugins/graph/example/*": "./plugins/graph/example/*.js"
|
|
116
116
|
}
|
|
117
117
|
}
|