scoobie 14.2.1 → 14.3.0
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/README.md +2 -2
- package/package.json +3 -3
- package/src/private/url.ts +9 -3
package/README.md
CHANGED
|
@@ -345,7 +345,7 @@ export const MyFirstInlineCode = () => (
|
|
|
345
345
|
|
|
346
346
|
Render an internal link with the same opinions as our [MdxProvider](#mdxprovider):
|
|
347
347
|
|
|
348
|
-
- Internal links pass through the `v` URL
|
|
348
|
+
- Internal links pass through the `v` and `v-panel` URL parameters for UI version switching
|
|
349
349
|
|
|
350
350
|
Unlike [SmartTextLink](#smarttextlink), this is not bound to a parent [Text] as it has no underlying [TextLink].
|
|
351
351
|
It can be used to make complex components navigable rather than just sections of text.
|
|
@@ -398,7 +398,7 @@ export const Component = () => (
|
|
|
398
398
|
|
|
399
399
|
Render all underlying links as follows:
|
|
400
400
|
|
|
401
|
-
- Internal links pass through the `v` URL
|
|
401
|
+
- Internal links pass through the `v` and `v-panel` URL parameters for UI version switching
|
|
402
402
|
- External links open in a new tab
|
|
403
403
|
- Links with a [`download` attribute] prompt the user with a file download
|
|
404
404
|
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"version": "14.
|
|
7
|
+
"version": "14.3.0",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@capsizecss/core": "^3.0.0",
|
|
10
10
|
"@mdx-js/loader": "^1.6.22",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"@storybook/storybook-deployer": "2.8.16",
|
|
35
35
|
"@types/react": "18.0.17",
|
|
36
36
|
"@types/react-dom": "18.0.6",
|
|
37
|
-
"braid-design-system": "32.
|
|
37
|
+
"braid-design-system": "32.4.1",
|
|
38
38
|
"loki": "0.31.1",
|
|
39
39
|
"react": "18.2.0",
|
|
40
40
|
"react-dom": "18.2.0",
|
|
41
41
|
"react-helmet-async": "1.3.0",
|
|
42
42
|
"react-router-dom": "6.9.0",
|
|
43
43
|
"semantic-release": "21.0.0",
|
|
44
|
-
"sku": "11.
|
|
44
|
+
"sku": "11.9.2",
|
|
45
45
|
"webpack": "5.76.3"
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
package/src/private/url.ts
CHANGED
|
@@ -5,10 +5,13 @@ const URLSearchParams = url.URLSearchParams ?? window.URLSearchParams;
|
|
|
5
5
|
|
|
6
6
|
const EXAMPLE_BASE_URL = 'https://example.com';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const parseVersionParams = (search: string) => {
|
|
9
9
|
const urlSearchParams = new URLSearchParams(search);
|
|
10
10
|
|
|
11
|
-
return
|
|
11
|
+
return {
|
|
12
|
+
v: urlSearchParams.get('v'),
|
|
13
|
+
vPanel: urlSearchParams.get('v-panel'),
|
|
14
|
+
};
|
|
12
15
|
};
|
|
13
16
|
|
|
14
17
|
const hrefToUrl = (href: string, pathname: string) => {
|
|
@@ -32,11 +35,14 @@ export const parseInternalHref = (
|
|
|
32
35
|
) => {
|
|
33
36
|
const { hash, pathname, searchParams } = hrefToUrl(href, location.pathname);
|
|
34
37
|
|
|
35
|
-
const v =
|
|
38
|
+
const { v, vPanel } = parseVersionParams(location.search);
|
|
36
39
|
|
|
37
40
|
if (v !== null) {
|
|
38
41
|
searchParams.set('v', v);
|
|
39
42
|
}
|
|
43
|
+
if (vPanel !== null) {
|
|
44
|
+
searchParams.set('v-panel', vPanel);
|
|
45
|
+
}
|
|
40
46
|
|
|
41
47
|
const search = searchParams.toString();
|
|
42
48
|
|