@vaadin/hilla-file-router 24.5.0-beta2 → 24.5.0-beta3
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/hilla-file-router",
|
|
3
|
-
"version": "24.5.0-
|
|
3
|
+
"version": "24.5.0-beta3",
|
|
4
4
|
"description": "Hilla file-based router",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"type-fest": "^4.9.0"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@vaadin/hilla-generator-utils": "24.5.0-
|
|
83
|
-
"@vaadin/hilla-react-auth": "24.5.0-
|
|
84
|
-
"@vaadin/hilla-react-signals": "24.5.0-
|
|
82
|
+
"@vaadin/hilla-generator-utils": "24.5.0-beta3",
|
|
83
|
+
"@vaadin/hilla-react-auth": "24.5.0-beta3",
|
|
84
|
+
"@vaadin/hilla-react-signals": "24.5.0-beta3",
|
|
85
85
|
"react": "^18.2.0",
|
|
86
86
|
"rollup": "^4.12.0",
|
|
87
87
|
"typescript": "5.6.2"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMenuItems.d.ts","sourceRoot":"","sources":["../src/runtime/createMenuItems.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,aAAa,CAAC;AAExD,eAAO,MAAM,WAAW;;;;;;;
|
|
1
|
+
{"version":3,"file":"createMenuItems.d.ts","sourceRoot":"","sources":["../src/runtime/createMenuItems.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,aAAa,CAAC;AAExD,eAAO,MAAM,WAAW;;;;;;;aAsBiB,CAAC;aAOpC,CAAF;eAGU,CAAA;YAAmE,CAAC;;iBAhCT,CAAC;AAE1E;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,SAAS,QAAQ,EAAE,CA0BrD"}
|
|
@@ -2,13 +2,13 @@ function __REGISTER__(feature, vaadinObj = window.Vaadin ??= {}) {
|
|
|
2
2
|
vaadinObj.registrations ??= [];
|
|
3
3
|
vaadinObj.registrations.push({
|
|
4
4
|
is: feature ? `${"@vaadin/hilla-file-router"}/${feature}` : "@vaadin/hilla-file-router",
|
|
5
|
-
version: "24.5.0-
|
|
5
|
+
version: "24.5.0-beta3"
|
|
6
6
|
});
|
|
7
7
|
}
|
|
8
8
|
import { signal } from "@vaadin/hilla-react-signals";
|
|
9
9
|
const viewsSignal = signal(window.Vaadin?.views);
|
|
10
10
|
function createMenuItems() {
|
|
11
|
-
__REGISTER__("createMenuItems", window.Vaadin
|
|
11
|
+
__REGISTER__("createMenuItems", window.Vaadin);
|
|
12
12
|
const collator = new Intl.Collator("en-US");
|
|
13
13
|
if (!viewsSignal.value) {
|
|
14
14
|
return [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/register.js", "../src/runtime/createMenuItems.ts"],
|
|
4
|
-
"sourcesContent": ["export function __REGISTER__(feature, vaadinObj = (window.Vaadin ??= {})) {\n vaadinObj.registrations ??= [];\n vaadinObj.registrations.push({\n is: feature ? `${__NAME__}/${feature}` : __NAME__,\n version: __VERSION__,\n });\n}\n", "import { signal } from '@vaadin/hilla-react-signals';\nimport type { VaadinWindow } from '../shared/internal.js';\nimport type { MenuItem, ViewConfig } from '../types.js';\n\nexport const viewsSignal = signal((window as VaadinWindow).Vaadin?.views);\n\n/**\n * Creates menu items from the views provided by the server. The views are sorted according to the\n * {@link ViewConfig.menu.order}, filtered out if they are explicitly excluded via {@link ViewConfig.menu.exclude}.\n * Note that views with no order are put below views with an order. Ties are resolved based on the path string\n * comparison.\n *\n * @returns A list of menu items.\n */\nexport function createMenuItems(): readonly MenuItem[] {\n // @ts-expect-error: esbuild injection\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n __REGISTER__('createMenuItems', (window as VaadinWindow).Vaadin
|
|
5
|
-
"mappings": "AAAO,SAAS,aAAa,SAAS,YAAa,OAAO,WAAW,CAAC,GAAI;AACxE,YAAU,kBAAkB,CAAC;AAC7B,YAAU,cAAc,KAAK;AAAA,IAC3B,IAAI,UAAU,GAAG,2BAAQ,IAAI,OAAO,KAAK;AAAA,IACzC,SAAS;AAAA,EACX,CAAC;AACH;ACNA,SAAS,cAAc;AAIhB,MAAM,cAAc,OAAQ,OAAwB,QAAQ,KAAK;AAUjE,SAAS,kBAAuC;AAGrD,eAAa,mBAAoB,OAAwB,
|
|
4
|
+
"sourcesContent": ["export function __REGISTER__(feature, vaadinObj = (window.Vaadin ??= {})) {\n vaadinObj.registrations ??= [];\n vaadinObj.registrations.push({\n is: feature ? `${__NAME__}/${feature}` : __NAME__,\n version: __VERSION__,\n });\n}\n", "import { signal } from '@vaadin/hilla-react-signals';\nimport type { VaadinWindow } from '../shared/internal.js';\nimport type { MenuItem, ViewConfig } from '../types.js';\n\nexport const viewsSignal = signal((window as VaadinWindow).Vaadin?.views);\n\n/**\n * Creates menu items from the views provided by the server. The views are sorted according to the\n * {@link ViewConfig.menu.order}, filtered out if they are explicitly excluded via {@link ViewConfig.menu.exclude}.\n * Note that views with no order are put below views with an order. Ties are resolved based on the path string\n * comparison.\n *\n * @returns A list of menu items.\n */\nexport function createMenuItems(): readonly MenuItem[] {\n // @ts-expect-error: esbuild injection\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n __REGISTER__('createMenuItems', (window as VaadinWindow).Vaadin);\n const collator = new Intl.Collator('en-US');\n if (!viewsSignal.value) {\n return [];\n }\n\n return (\n Object.entries(viewsSignal.value)\n // Filter out the views that are explicitly excluded from the menu.\n .filter(([_, value]) => !value.menu?.exclude)\n // Map the views to menu items.\n .map(([path, config]) => ({\n to: path,\n icon: config.menu?.icon,\n title: config.menu?.title ?? config.title,\n order: config.menu?.order,\n }))\n // Sort views according to the order specified in the view configuration.\n .sort((menuA, menuB) => {\n const ordersDiff = (menuA.order ?? Number.MAX_VALUE) - (menuB.order ?? Number.MAX_VALUE);\n return ordersDiff !== 0 ? ordersDiff : collator.compare(menuA.to, menuB.to);\n })\n );\n}\n\n// @ts-expect-error Vite hotswapping\nif (import.meta.hot) {\n // @ts-expect-error Vite hotswapping\n // eslint-disable-next-line\n import.meta.hot.on('fs-route-update', () => {\n fetch('?v-r=routeinfo')\n .then(async (resp) => resp.json())\n .then((json) => {\n viewsSignal.value = json;\n })\n .catch((e) => {\n console.error('Failed to fetch route info', e);\n });\n });\n}\n"],
|
|
5
|
+
"mappings": "AAAO,SAAS,aAAa,SAAS,YAAa,OAAO,WAAW,CAAC,GAAI;AACxE,YAAU,kBAAkB,CAAC;AAC7B,YAAU,cAAc,KAAK;AAAA,IAC3B,IAAI,UAAU,GAAG,2BAAQ,IAAI,OAAO,KAAK;AAAA,IACzC,SAAS;AAAA,EACX,CAAC;AACH;ACNA,SAAS,cAAc;AAIhB,MAAM,cAAc,OAAQ,OAAwB,QAAQ,KAAK;AAUjE,SAAS,kBAAuC;AAGrD,eAAa,mBAAoB,OAAwB,MAAM;AAC/D,QAAM,WAAW,IAAI,KAAK,SAAS,OAAO;AAC1C,MAAI,CAAC,YAAY,OAAO;AACtB,WAAO,CAAC;AAAA,EACV;AAEA,SACE,OAAO,QAAQ,YAAY,KAAK,EAE7B,OAAO,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,MAAM,MAAM,OAAO,EAE3C,IAAI,CAAC,CAAC,MAAM,MAAM,OAAO;AAAA,IACxB,IAAI;AAAA,IACJ,MAAM,OAAO,MAAM;AAAA,IACnB,OAAO,OAAO,MAAM,SAAS,OAAO;AAAA,IACpC,OAAO,OAAO,MAAM;AAAA,EACtB,EAAE,EAED,KAAK,CAAC,OAAO,UAAU;AACtB,UAAM,cAAc,MAAM,SAAS,OAAO,cAAc,MAAM,SAAS,OAAO;AAC9E,WAAO,eAAe,IAAI,aAAa,SAAS,QAAQ,MAAM,IAAI,MAAM,EAAE;AAAA,EAC5E,CAAC;AAEP;AAGA,IAAI,YAAY,KAAK;AAGnB,cAAY,IAAI,GAAG,mBAAmB,MAAM;AAC1C,UAAM,gBAAgB,EACnB,KAAK,OAAO,SAAS,KAAK,KAAK,CAAC,EAChC,KAAK,CAAC,SAAS;AACd,kBAAY,QAAQ;AAAA,IACtB,CAAC,EACA,MAAM,CAAC,MAAM;AACZ,cAAQ,MAAM,8BAA8B,CAAC;AAAA,IAC/C,CAAC;AAAA,EACL,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|