@fibery/url-utils 2.2.7 → 2.3.2
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/lib/diactrics.d.ts +4 -1
- package/lib/diactrics.js +107 -111
- package/lib/index.d.ts +33 -31
- package/lib/index.js +80 -121
- package/lib/locator-utils.d.ts +17 -14
- package/lib/locator-utils.js +49 -54
- package/lib/make-path.d.ts +4 -1
- package/lib/make-path.js +25 -32
- package/lib/parse-page-location.d.ts +17 -14
- package/lib/parse-page-location.js +63 -61
- package/lib/routes.d.ts +36 -32
- package/lib/routes.js +133 -163
- package/lib/url-constants.d.ts +11 -5
- package/lib/url-constants.js +10 -8
- package/lib/workspaces.d.ts +19 -14
- package/lib/workspaces.js +16 -17
- package/package.json +17 -34
- package/index.ts +0 -168
- package/lib/babel.config.d.ts +0 -1
- package/lib/babel.config.js +0 -4
- package/lib/jest.config.d.ts +0 -7
- package/lib/jest.config.js +0 -10
package/lib/diactrics.d.ts
CHANGED
package/lib/diactrics.js
CHANGED
|
@@ -1,115 +1,111 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.replaceDiactrics = void 0;
|
|
1
|
+
//#region src/diactrics.ts
|
|
4
2
|
const DIACTRICS_REPLACEMENT_MAP = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
3
|
+
à: "a",
|
|
4
|
+
á: "a",
|
|
5
|
+
â: "a",
|
|
6
|
+
ã: "a",
|
|
7
|
+
ä: "a",
|
|
8
|
+
å: "a",
|
|
9
|
+
ā: "a",
|
|
10
|
+
ą: "a",
|
|
11
|
+
À: "A",
|
|
12
|
+
Á: "A",
|
|
13
|
+
Â: "A",
|
|
14
|
+
Ã: "A",
|
|
15
|
+
Ä: "A",
|
|
16
|
+
Å: "A",
|
|
17
|
+
Ā: "A",
|
|
18
|
+
Ą: "A",
|
|
19
|
+
ç: "c",
|
|
20
|
+
ć: "c",
|
|
21
|
+
č: "c",
|
|
22
|
+
Ç: "C",
|
|
23
|
+
Ć: "C",
|
|
24
|
+
Č: "C",
|
|
25
|
+
đ: "d",
|
|
26
|
+
ď: "d",
|
|
27
|
+
Đ: "D",
|
|
28
|
+
Ď: "D",
|
|
29
|
+
è: "e",
|
|
30
|
+
é: "e",
|
|
31
|
+
ê: "e",
|
|
32
|
+
ë: "e",
|
|
33
|
+
ě: "e",
|
|
34
|
+
ē: "e",
|
|
35
|
+
ę: "e",
|
|
36
|
+
È: "E",
|
|
37
|
+
É: "E",
|
|
38
|
+
Ê: "E",
|
|
39
|
+
Ë: "E",
|
|
40
|
+
Ě: "E",
|
|
41
|
+
Ē: "E",
|
|
42
|
+
Ę: "E",
|
|
43
|
+
ì: "i",
|
|
44
|
+
í: "i",
|
|
45
|
+
î: "i",
|
|
46
|
+
ï: "i",
|
|
47
|
+
ī: "i",
|
|
48
|
+
Ì: "I",
|
|
49
|
+
Í: "I",
|
|
50
|
+
Î: "I",
|
|
51
|
+
Ï: "I",
|
|
52
|
+
Ī: "I",
|
|
53
|
+
ł: "l",
|
|
54
|
+
Ł: "L",
|
|
55
|
+
ñ: "n",
|
|
56
|
+
ň: "n",
|
|
57
|
+
ń: "n",
|
|
58
|
+
Ñ: "N",
|
|
59
|
+
Ň: "N",
|
|
60
|
+
Ń: "N",
|
|
61
|
+
ò: "o",
|
|
62
|
+
ó: "o",
|
|
63
|
+
ô: "o",
|
|
64
|
+
õ: "o",
|
|
65
|
+
ö: "o",
|
|
66
|
+
ø: "o",
|
|
67
|
+
ō: "o",
|
|
68
|
+
Ò: "O",
|
|
69
|
+
Ó: "O",
|
|
70
|
+
Ô: "O",
|
|
71
|
+
Õ: "O",
|
|
72
|
+
Ö: "O",
|
|
73
|
+
Ø: "O",
|
|
74
|
+
Ō: "O",
|
|
75
|
+
ř: "r",
|
|
76
|
+
Ř: "R",
|
|
77
|
+
š: "s",
|
|
78
|
+
ś: "s",
|
|
79
|
+
Š: "S",
|
|
80
|
+
Ś: "S",
|
|
81
|
+
ť: "t",
|
|
82
|
+
Ť: "T",
|
|
83
|
+
ù: "u",
|
|
84
|
+
ú: "u",
|
|
85
|
+
û: "u",
|
|
86
|
+
ü: "u",
|
|
87
|
+
ů: "u",
|
|
88
|
+
ū: "u",
|
|
89
|
+
Ù: "U",
|
|
90
|
+
Ú: "U",
|
|
91
|
+
Û: "U",
|
|
92
|
+
Ü: "U",
|
|
93
|
+
Ů: "U",
|
|
94
|
+
Ū: "U",
|
|
95
|
+
ÿ: "y",
|
|
96
|
+
ý: "y",
|
|
97
|
+
Ÿ: "Y",
|
|
98
|
+
Ý: "Y",
|
|
99
|
+
ž: "z",
|
|
100
|
+
ż: "z",
|
|
101
|
+
ź: "z",
|
|
102
|
+
Ž: "Z",
|
|
103
|
+
Ż: "Z",
|
|
104
|
+
Ź: "Z",
|
|
105
|
+
ß: "ss"
|
|
108
106
|
};
|
|
109
107
|
const replaceDiactrics = (str = "") => {
|
|
110
|
-
|
|
111
|
-
.split("")
|
|
112
|
-
.map((char) => DIACTRICS_REPLACEMENT_MAP[char] || char)
|
|
113
|
-
.join("");
|
|
108
|
+
return str.split("").map((char) => DIACTRICS_REPLACEMENT_MAP[char] || char).join("");
|
|
114
109
|
};
|
|
115
|
-
|
|
110
|
+
//#endregion
|
|
111
|
+
export { replaceDiactrics };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
declare const appendQueryFlag: (url: string, key: string) => string;
|
|
3
|
+
declare const appendQueryParameter: (url: string, key: string, value: string | null) => string;
|
|
4
|
+
declare const getFlagValue: (flag: string) => string | null;
|
|
5
|
+
declare const getSharingKey: () => string | null;
|
|
6
|
+
declare const appendSharingKey: (url?: string | null, sharingKey?: undefined | string | null) => string;
|
|
7
|
+
declare const appendIsPublicParam: (url: string) => string;
|
|
8
|
+
declare const signedFileUrl: (url?: string | null) => string | null | undefined;
|
|
9
|
+
declare const getRefURL: (location?: {
|
|
10
|
+
href: string;
|
|
11
|
+
origin: string;
|
|
11
12
|
}) => string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
declare const isSharingMode: boolean;
|
|
14
|
+
declare const isPublicSpaceMode: boolean;
|
|
15
|
+
declare const isPublicForm: boolean;
|
|
16
|
+
declare const isPublicAccessMode: boolean;
|
|
17
|
+
declare const isRelativeUrl: (url: string) => boolean;
|
|
18
|
+
declare const isPublicUrlInPrivateMode: (absoluteUrl: string, location?: Location) => boolean;
|
|
19
|
+
declare const getRelativeUrlFromAbsolute: (absoluteUrl: string, location?: Location) => string;
|
|
19
20
|
type Context = {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
contextEntityTypeName: string;
|
|
22
|
+
contextEntityPublicId: string;
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
declare const createPureFiberyEntityUrlMatcher: ({ ownHost }: {
|
|
25
|
+
ownHost: string;
|
|
25
26
|
}) => (originalUrl: string, matchUserAsWell?: boolean) => null | {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
publicId: string;
|
|
28
|
+
typeName: string;
|
|
29
|
+
scrollLocator?: string | null;
|
|
30
|
+
scrollLocatorParams?: {
|
|
31
|
+
field?: string;
|
|
32
|
+
comment?: string;
|
|
33
|
+
anchor?: string;
|
|
34
|
+
};
|
|
35
|
+
context?: Context;
|
|
35
36
|
};
|
|
36
|
-
|
|
37
|
+
//#endregion
|
|
38
|
+
export { appendIsPublicParam, appendQueryFlag, appendQueryParameter, appendSharingKey, createPureFiberyEntityUrlMatcher, getFlagValue, getRefURL, getRelativeUrlFromAbsolute, getSharingKey, isPublicAccessMode, isPublicForm, isPublicSpaceMode, isPublicUrlInPrivateMode, isRelativeUrl, isSharingMode, signedFileUrl };
|
package/lib/index.js
CHANGED
|
@@ -1,142 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const parse_page_location_1 = require("./parse-page-location");
|
|
6
|
-
const locator_utils_1 = require("./locator-utils");
|
|
1
|
+
import { parseLocator, parseScrollLocator } from "./locator-utils.js";
|
|
2
|
+
import { publicParamName, publicUrlPrefix, sharingParamName } from "./url-constants.js";
|
|
3
|
+
import { getAuxMatch, getPageMatch, safeDecodeURIComponent } from "./parse-page-location.js";
|
|
4
|
+
//#region src/index.ts
|
|
7
5
|
const appendQueryFlag = (url, key) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return [`${location}${prefix}${key}`, ...hash].join("#");
|
|
6
|
+
const [location, ...hash] = url.split("#");
|
|
7
|
+
return [`${location}${location.includes("?") ? "&" : "?"}${key}`, ...hash].join("#");
|
|
11
8
|
};
|
|
12
|
-
exports.appendQueryFlag = appendQueryFlag;
|
|
13
9
|
const appendQueryParameter = (url, key, value) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const [location, ...hash] = url.split("#");
|
|
18
|
-
const prefix = location.indexOf("?") >= 0 ? "&" : "?";
|
|
19
|
-
return [`${location}${prefix}${key}=${value}`, ...hash].join("#");
|
|
10
|
+
if (!value) return url;
|
|
11
|
+
const [location, ...hash] = url.split("#");
|
|
12
|
+
return [`${location}${location.includes("?") ? "&" : "?"}${key}=${value}`, ...hash].join("#");
|
|
20
13
|
};
|
|
21
|
-
exports.appendQueryParameter = appendQueryParameter;
|
|
22
14
|
const getFlagValue = (flag) => new URLSearchParams(window.location.search).get(flag);
|
|
23
|
-
exports.getFlagValue = getFlagValue;
|
|
24
15
|
const getSharingKey = () => {
|
|
25
|
-
|
|
16
|
+
return getFlagValue("sharing-key") || getFlagValue("sk");
|
|
26
17
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return url || "";
|
|
31
|
-
}
|
|
32
|
-
return (0, exports.appendQueryParameter)(url, url_constants_1.sharingParamName, sharingKey);
|
|
18
|
+
const appendSharingKey = (url, sharingKey = getSharingKey()) => {
|
|
19
|
+
if (!url) return url || "";
|
|
20
|
+
return appendQueryParameter(url, sharingParamName, sharingKey);
|
|
33
21
|
};
|
|
34
|
-
exports.appendSharingKey = appendSharingKey;
|
|
35
22
|
const appendIsPublicParam = (url) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return (0, exports.appendQueryParameter)(url, url_constants_1.publicParamName, "1");
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
return url;
|
|
42
|
-
}
|
|
23
|
+
if (isPublicSpaceMode) return appendQueryParameter(url, publicParamName, "1");
|
|
24
|
+
else return url;
|
|
43
25
|
};
|
|
44
|
-
exports.appendIsPublicParam = appendIsPublicParam;
|
|
45
26
|
const signedFileUrl = (url) => {
|
|
46
|
-
|
|
47
|
-
? url.replace("/api/files", "/api/files/r")
|
|
48
|
-
: url;
|
|
27
|
+
return url?.startsWith("/api/files/") && !url?.startsWith("/api/files/r/") ? url.replace("/api/files", "/api/files/r") : url;
|
|
49
28
|
};
|
|
50
|
-
exports.signedFileUrl = signedFileUrl;
|
|
51
29
|
const getRefURL = (location = window.location) => location.href.replace(location.origin, "");
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const validPageMatchSet = new Set([":page/app-view", ":page/specific-object-view"]);
|
|
30
|
+
const isSharingMode = Boolean(getSharingKey());
|
|
31
|
+
const decodedLocationPathName = safeDecodeURIComponent(window.location.pathname || "");
|
|
32
|
+
const isPublicSpaceMode = decodedLocationPathName.startsWith("/@public") && !decodedLocationPathName.startsWith("/@public/forms");
|
|
33
|
+
const isPublicForm = decodedLocationPathName.startsWith("/@public") && decodedLocationPathName.startsWith("/@public/forms");
|
|
34
|
+
const isPublicAccessMode = isSharingMode || isPublicSpaceMode;
|
|
35
|
+
const validPageMatchSet = /* @__PURE__ */ new Set([":page/app-view", ":page/specific-object-view"]);
|
|
59
36
|
const isRelativeUrl = (url) => {
|
|
60
|
-
|
|
37
|
+
return url.startsWith("/");
|
|
61
38
|
};
|
|
62
|
-
exports.isRelativeUrl = isRelativeUrl;
|
|
63
39
|
const isPublicUrlInPrivateMode = (absoluteUrl, location = window.location) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
return !isPublic && urlObject.pathname.startsWith(url_constants_1.publicUrlPrefix);
|
|
40
|
+
const isPublic = location.pathname.startsWith(publicUrlPrefix);
|
|
41
|
+
let urlObject = null;
|
|
42
|
+
try {
|
|
43
|
+
urlObject = new URL(absoluteUrl);
|
|
44
|
+
} catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return !isPublic && urlObject.pathname.startsWith("/@public");
|
|
74
48
|
};
|
|
75
|
-
exports.isPublicUrlInPrivateMode = isPublicUrlInPrivateMode;
|
|
76
49
|
const getRelativeUrlFromAbsolute = (absoluteUrl, location = window.location) => {
|
|
77
|
-
|
|
50
|
+
return absoluteUrl.replace(location.origin, "");
|
|
78
51
|
};
|
|
79
|
-
|
|
80
|
-
|
|
52
|
+
const knownScrollLocatorParams = /* @__PURE__ */ new Set([
|
|
53
|
+
"field",
|
|
54
|
+
"comment",
|
|
55
|
+
"anchor"
|
|
56
|
+
]);
|
|
81
57
|
const createPureFiberyEntityUrlMatcher = ({ ownHost }) => (originalUrl, matchUserAsWell = false) => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
contextEntityTypeName: `${params.appNamespace}/${params.typeWithoutNamespace}`,
|
|
124
|
-
contextEntityPublicId: contextEntityPublicId,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
if (publicId === null) {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
const scrollLocatorParams = Object.fromEntries(Object.entries((0, locator_utils_1.parseScrollLocator)(pageMatch.params.scrollLocator)).filter(([key, value]) => {
|
|
132
|
-
return knownScrollLocatorParams.has(key) && value;
|
|
133
|
-
}));
|
|
134
|
-
return {
|
|
135
|
-
publicId,
|
|
136
|
-
typeName,
|
|
137
|
-
scrollLocator: pageMatch.params.scrollLocator,
|
|
138
|
-
scrollLocatorParams: Object.keys(scrollLocatorParams).length ? scrollLocatorParams : undefined,
|
|
139
|
-
context,
|
|
140
|
-
};
|
|
58
|
+
let urlObject = null;
|
|
59
|
+
try {
|
|
60
|
+
urlObject = new URL(originalUrl);
|
|
61
|
+
} catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (urlObject.host !== ownHost) return null;
|
|
65
|
+
if (getAuxMatch(urlObject.hash, "") !== null) return null;
|
|
66
|
+
const pageMatch = getPageMatch(urlObject.pathname);
|
|
67
|
+
if (pageMatch === null) return null;
|
|
68
|
+
const { page, params } = pageMatch;
|
|
69
|
+
if (!validPageMatchSet.has(page)) return null;
|
|
70
|
+
let typeName = [params.appNamespace, params.typeWithoutNamespace].join("/");
|
|
71
|
+
if (typeName === "fibery/user" && !matchUserAsWell) return null;
|
|
72
|
+
let publicId = null;
|
|
73
|
+
let context = void 0;
|
|
74
|
+
if (page === ":page/specific-object-view" && !params.viewLocator) {
|
|
75
|
+
const objectOrViewLocator = String(params.objectLocator);
|
|
76
|
+
publicId = parseLocator(objectOrViewLocator).publicId;
|
|
77
|
+
} else if (params.viewLocator) {
|
|
78
|
+
const objectOrViewLocator = String(params.viewLocator);
|
|
79
|
+
publicId = parseLocator(objectOrViewLocator).publicId;
|
|
80
|
+
typeName = "fibery/view";
|
|
81
|
+
const objectLocator = String(params.objectLocator);
|
|
82
|
+
const contextEntityPublicId = parseLocator(objectLocator).publicId;
|
|
83
|
+
if (contextEntityPublicId && params.appNamespace && params.typeWithoutNamespace) context = {
|
|
84
|
+
contextEntityTypeName: `${params.appNamespace}/${params.typeWithoutNamespace}`,
|
|
85
|
+
contextEntityPublicId
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (publicId === null) return null;
|
|
89
|
+
const scrollLocatorParams = Object.fromEntries(Object.entries(parseScrollLocator(pageMatch.params.scrollLocator)).filter(([key, value]) => {
|
|
90
|
+
return knownScrollLocatorParams.has(key) && value;
|
|
91
|
+
}));
|
|
92
|
+
return {
|
|
93
|
+
publicId,
|
|
94
|
+
typeName,
|
|
95
|
+
scrollLocator: pageMatch.params.scrollLocator,
|
|
96
|
+
scrollLocatorParams: Object.keys(scrollLocatorParams).length ? scrollLocatorParams : void 0,
|
|
97
|
+
context
|
|
98
|
+
};
|
|
141
99
|
};
|
|
142
|
-
|
|
100
|
+
//#endregion
|
|
101
|
+
export { appendIsPublicParam, appendQueryFlag, appendQueryParameter, appendSharingKey, createPureFiberyEntityUrlMatcher, getFlagValue, getRefURL, getRelativeUrlFromAbsolute, getSharingKey, isPublicAccessMode, isPublicForm, isPublicSpaceMode, isPublicUrlInPrivateMode, isRelativeUrl, isSharingMode, signedFileUrl };
|
package/lib/locator-utils.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region src/locator-utils.d.ts
|
|
2
|
+
declare const escapeRegExpChar: (x: string) => string;
|
|
3
|
+
declare const parseLocator: (locator: string) => {
|
|
4
|
+
publicId: string | null;
|
|
5
|
+
title: null;
|
|
5
6
|
} | {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
publicId: string;
|
|
8
|
+
title: string;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
declare const parseScrollLocator: (locator?: string | null) => Record<string, string | null>;
|
|
11
|
+
declare const makeLocator: ({ publicId, title }: {
|
|
12
|
+
publicId: string | number | null;
|
|
13
|
+
title?: string | null;
|
|
13
14
|
}) => string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
declare const createAnchorScrollLocatorValue: (params: {
|
|
16
|
+
id: string;
|
|
17
|
+
text?: string;
|
|
17
18
|
}) => string;
|
|
18
|
-
|
|
19
|
+
declare const parseScrollLocatorValue: (key: string, originalValue: string) => string;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { createAnchorScrollLocatorValue, escapeRegExpChar, makeLocator, parseLocator, parseScrollLocator, parseScrollLocatorValue };
|