vira 22.1.0 → 22.1.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.
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { FullRoute, SpaRouter } from 'spa-router-vir';
|
|
2
|
-
|
|
2
|
+
import { RequireExactlyOne } from 'type-fest';
|
|
3
|
+
export declare const ViraLink: import("element-vir").DeclarativeElementDefinition<"vira-link", RequireExactlyOne<{
|
|
3
4
|
/**
|
|
4
5
|
* A full raw URL link that will navigate the current window away or open a new tab. If this
|
|
5
6
|
* property is provided for the inputs, don't provide a route property.
|
|
6
7
|
*/
|
|
7
|
-
link
|
|
8
|
+
link: {
|
|
8
9
|
url: string;
|
|
9
10
|
newTab: boolean;
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
|
-
* A route that'll change that current page without navigating the window. If this property
|
|
13
|
-
* provided for the inputs, don't provide a link property.
|
|
13
|
+
* A route that'll change that current page without navigating the window. If this property
|
|
14
|
+
* is provided for the inputs, don't provide a link property.
|
|
14
15
|
*/
|
|
15
|
-
route
|
|
16
|
-
route: FullRoute
|
|
17
|
-
router: Pick<SpaRouter, '
|
|
16
|
+
route: {
|
|
17
|
+
route: FullRoute<any, any, any>;
|
|
18
|
+
router: Pick<SpaRouter<any, any, any>, 'createRouteUrl' | 'setRouteOnDirectNavigation'>;
|
|
18
19
|
scrollToTop?: boolean;
|
|
19
20
|
};
|
|
20
|
-
}
|
|
21
|
+
}>, {}, {
|
|
21
22
|
routeChange: import("element-vir").DefinedTypedEventNameDefinition<FullRoute>;
|
|
22
23
|
}, `vira-link-${string}`, "vira-link-hover-color", readonly string[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css, defineElementEvent, html, listen } from 'element-vir';
|
|
2
|
-
import {
|
|
2
|
+
import { shouldClickEventTriggerRouteChange } from 'spa-router-vir';
|
|
3
3
|
import { defineViraElement } from './define-vira-element';
|
|
4
4
|
export const ViraLink = defineViraElement()({
|
|
5
5
|
tagName: 'vira-link',
|
|
@@ -33,12 +33,12 @@ export const ViraLink = defineViraElement()({
|
|
|
33
33
|
routeChange: defineElementEvent(),
|
|
34
34
|
},
|
|
35
35
|
renderCallback({ inputs, dispatch, events }) {
|
|
36
|
-
function clickCallback(
|
|
36
|
+
function clickCallback(event) {
|
|
37
37
|
if (!inputs.route) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
if (
|
|
41
|
-
|
|
40
|
+
if (shouldClickEventTriggerRouteChange(event)) {
|
|
41
|
+
event.preventDefault();
|
|
42
42
|
if (inputs.route.scrollToTop) {
|
|
43
43
|
window.scrollTo(0, 0);
|
|
44
44
|
}
|
|
@@ -56,7 +56,7 @@ export const ViraLink = defineViraElement()({
|
|
|
56
56
|
else {
|
|
57
57
|
const linkUrl = inputs.link
|
|
58
58
|
? inputs.link.url
|
|
59
|
-
: inputs.route?.router.
|
|
59
|
+
: inputs.route?.router.createRouteUrl(inputs.route.route);
|
|
60
60
|
/** Noopener and noreferrer are needed for security reasons, do not remove! */
|
|
61
61
|
return html `
|
|
62
62
|
<a href=${linkUrl} rel="noopener noreferrer" ${listen('click', clickCallback)}>
|
package/dist/styles/color.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Format } from 'colorjs.io/types/src/space';
|
|
2
2
|
import { ColorTypes } from '../re-exports/colorjs-io';
|
|
3
|
-
export declare function getAssertedValidColor(input: ColorTypes | undefined): import("colorjs.io/types
|
|
3
|
+
export declare function getAssertedValidColor(input: ColorTypes | undefined): import("colorjs.io/types").default;
|
|
4
4
|
export declare const rgbCssColorFormat: Format;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vira",
|
|
3
|
-
"version": "22.1.
|
|
3
|
+
"version": "22.1.2",
|
|
4
4
|
"description": "A simple and highly versatile design system using element-vir.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"test": "virmator test-web"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@augment-vir/browser": "^26.3.
|
|
36
|
-
"@augment-vir/common": "^26.3.
|
|
35
|
+
"@augment-vir/browser": "^26.3.3",
|
|
36
|
+
"@augment-vir/common": "^26.3.3",
|
|
37
37
|
"colorjs.io": "^0.5.0",
|
|
38
|
-
"date-vir": "^5.1.
|
|
38
|
+
"date-vir": "^5.1.4",
|
|
39
39
|
"lit-css-vars": "^3.0.9",
|
|
40
|
-
"spa-router-vir": "^
|
|
40
|
+
"spa-router-vir": "^4.0.2",
|
|
41
41
|
"type-fest": "^4.15.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@augment-vir/browser-testing": "^26.3.
|
|
45
|
-
"@augment-vir/node-js": "^26.3.
|
|
44
|
+
"@augment-vir/browser-testing": "^26.3.3",
|
|
45
|
+
"@augment-vir/node-js": "^26.3.3",
|
|
46
46
|
"@open-wc/testing": "^4.0.0",
|
|
47
47
|
"@types/chai": "^4.3.14",
|
|
48
48
|
"@types/mocha": "^10.0.6",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"markdown-code-example-inserter": "^1.0.0",
|
|
57
57
|
"run-time-assertions": "^1.2.0",
|
|
58
58
|
"typedoc": "^0.25.13",
|
|
59
|
-
"typescript": "5.
|
|
59
|
+
"typescript": "5.4.5",
|
|
60
60
|
"vite": "^4.5.0",
|
|
61
61
|
"vite-tsconfig-paths": "^4.3.2"
|
|
62
62
|
},
|