initial COM2 system snapshot

This commit is contained in:
gitea
2026-03-06 15:22:40 +00:00
commit 9c0fa49baf
4377 changed files with 273033 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
diff --git a/esm/index.js b/esm/index.js
index c83bc63a2c10431fb62e25b7d490656a3796f301..bcae513cc20a4be6c38dc116e0b8d9bacda62b5b 100644
--- a/esm/index.js
+++ b/esm/index.js
@@ -338,6 +338,23 @@ const Switch = ({ children, location }) => {
const router = useRouter();
const [originalLocation] = useLocationFromRouter(router);
+ // Collect all route paths to window object
+ if (typeof window !== 'undefined') {
+ if (!window.__WOUTER_ROUTES__) {
+ window.__WOUTER_ROUTES__ = [];
+ }
+
+ const allChildren = flattenChildren(children);
+ allChildren.forEach((element) => {
+ if (isValidElement(element) && element.props.path) {
+ const path = element.props.path;
+ if (!window.__WOUTER_ROUTES__.includes(path)) {
+ window.__WOUTER_ROUTES__.push(path);
+ }
+ }
+ });
+ }
+
for (const element of flattenChildren(children)) {
let match = 0;