Fix bin/publish: copy docs.dist from project root

Fix bin/publish: use correct .env path for rspade_system
Fix bin/publish script: prevent grep exit code 1 from terminating script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-10-21 02:08:33 +00:00
commit f6fac6c4bc
79758 changed files with 10547827 additions and 0 deletions

21
node_modules/@jqhtml/router/LICENSE generated vendored Executable file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 JQHTML Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

355
node_modules/@jqhtml/router/LLM_REFERENCE.md generated vendored Executable file
View File

@@ -0,0 +1,355 @@
# JQHTML SPA Router System - LLM Reference
## Core Architecture
- Static router class `Jqhtml_Router` manages all navigation
- Routes are ES6 classes extending `Jqhtml_Route`
- Layouts are ES6 classes extending `Jqhtml_Layout`
- SPA container is ES6 class extending `Jqhtml_SPA`
- Hash routing (`#/path`) automatically enabled for `file://` protocol
- Standard routing for `http://` and `https://` protocols
## Route Definition
### Basic Route Class
```javascript
class HomeRoute extends Jqhtml_Route {
static routes = ['/']; // URL patterns this route handles
static layout = 'MainLayout'; // Layout to use (optional)
static meta = { name: 'home', requiresAuth: false }; // Metadata
async on_render() {
// Route component render logic
}
async pre_dispatch() {
// Return false to cancel navigation
// Return string URL to redirect
return true;
}
async post_dispatch() {
// Called after route fully loaded
}
}
```
### Route Patterns
```javascript
static routes = [
'/', // Exact match
'/users', // Static path
'/users/:id', // Parameter capture
'/posts/:id/comments', // Multiple segments
'/admin/:section/:id' // Multiple parameters
];
```
### Parameter Access
```javascript
class UserRoute extends Jqhtml_Route {
static routes = ['/users/:id'];
async on_load() {
// URL: /users/123?tab=profile
const userId = this.args.id; // '123' from URL pattern
const tab = this.args.tab; // 'profile' from query string
const hash = this.args.hash; // Fragment after #
}
}
```
## Layout System
### Layout Definition
```javascript
class MainLayout extends Jqhtml_Layout {
async on_render() {
this.$.html(`
<header>Navigation</header>
<main $id="content"></main> <!-- REQUIRED: Routes render here -->
<footer>Footer</footer>
`);
}
async on_route_change(old_route, new_route) {
// Update active navigation state
this.$find('.nav-link').removeClass('active');
this.$find(`[href="${new_route.path}"]`).addClass('active');
}
should_rerender() {
return false; // Layouts persist across route changes
}
async pre_dispatch(route_info) {
// Can intercept routing at layout level
if (route_info.meta.requiresAuth && !this.data.user) {
return '/login'; // Redirect
}
return true;
}
}
```
### Layout Persistence
- Layouts never re-render during route changes within same layout
- Layout instance persists until different layout needed
- `$id="content"` element required for route injection point
## SPA Application Container
### Basic SPA Setup
```javascript
class App extends Jqhtml_SPA {
async on_create() {
// Register all routes
HomeRoute.init();
UserRoute.init();
AdminRoute.init();
// Register layouts
Jqhtml_Router.register_layout('MainLayout', MainLayout);
Jqhtml_Router.register_layout('AdminLayout', AdminLayout);
// Set default layout
Jqhtml_Router.set_default_layout('MainLayout');
// Initialize router
await this.init_router({
default_layout: 'MainLayout'
});
}
async pre_dispatch(route_info) {
// Global route guard
// Runs before layout.pre_dispatch()
return true;
}
async post_dispatch(route_info) {
// Global post-navigation logic
// Runs after layout.post_dispatch()
}
}
// Mount application
$('#app').append(new App().$);
```
## Navigation Methods
### Programmatic Navigation
```javascript
// Navigate to URL
Jqhtml_Router.dispatch('/users/123');
// Navigate with replace (no history entry)
Jqhtml_Router.replace('/login');
// Navigate with parameters
const url = Jqhtml_Router.url('user-profile', { id: 123, tab: 'settings' });
Jqhtml_Router.dispatch(url);
// From within route component
this.dispatch({ id: 456 }); // Merges with current args
```
### Link Interception
- All `<a>` tags automatically intercepted for same-origin navigation
- External links and `target="_blank"` not intercepted
- Ctrl/Cmd+Click opens in new tab (not intercepted)
### URL Building
```javascript
// Build URL from route name
Jqhtml_Router.url('user-profile', { id: 123 }); // '/users/123'
// Build URL from pattern
Jqhtml_Router.build_url('/users/:id', { id: 123, tab: 'info' }); // '/users/123?tab=info'
// From route class
UserRoute.url({ id: 123 }); // '/users/123'
```
## Dispatch Lifecycle
### Execution Order
1. **URL Matching** - Parse URL, extract parameters
2. **App.pre_dispatch()** - Global guard, can cancel/redirect
3. **Layout Resolution** - Create/reuse layout based on route
4. **Layout.pre_dispatch()** - Layout-level guard
5. **Route Instantiation** - Create route component with args
6. **Route.pre_dispatch()** - Route-level guard
7. **Layout._render_route()** - Inject route into layout
8. **Route Lifecycle** - Standard component lifecycle
9. **Layout.on_route_change()** - Notify layout of change
10. **Route.post_dispatch()** - Route complete
11. **Layout.post_dispatch()** - Layout handling complete
12. **App.post_dispatch()** - Global post-navigation
### Guard Return Values
```javascript
async pre_dispatch(route_info) {
return true; // Continue navigation
return false; // Cancel navigation
return '/login'; // Redirect to different route
}
```
## Router State
### Access Current State
```javascript
// Static access
Jqhtml_Router.state = {
route: 'UserRoute', // Current route component name
layout: 'MainLayout', // Current layout name
url: '/users/123', // Current URL path
args: { id: '123' }, // Current parameters
hash: 'section' // Current hash fragment
};
// Get current route info
const current = Jqhtml_Router.current_route_info;
// { url, path, args, hash, meta, component_name, component_class, layout }
// From SPA class
Jqhtml_SPA.state; // Same as Jqhtml_Router.state
Jqhtml_SPA.current_route; // Current route info
```
## Hash Routing (file:// Protocol)
### Automatic Detection
```javascript
// Router automatically uses hash routing for file:// URLs
// file:///app/index.html#/users/123
// Translates to route: /users/123
// Hash routing format
window.location.href = 'file:///path/index.html#/users/123';
// Router sees: /users/123
// Regular routing format (http/https)
window.location.href = 'https://example.com/users/123';
// Router sees: /users/123
```
### Manual Hash Control
```javascript
if (Jqhtml_Router.use_hash_routing) {
// In hash mode
window.location.hash = '#/users/123';
} else {
// In regular mode
window.history.pushState({}, '', '/users/123');
}
```
## Route Metadata & Named Routes
### Named Route Pattern
```javascript
class UserProfileRoute extends Jqhtml_Route {
static routes = ['/users/:id/profile'];
static meta = {
name: 'user-profile', // Reference name
requiresAuth: true,
title: 'User Profile'
};
}
// Navigate by name
Jqhtml_Router.url('user-profile', { id: 123 });
UserProfileRoute.dispatch({ id: 123 });
```
## Advanced Patterns
### Nested Route Components
```javascript
class DashboardRoute extends Jqhtml_Route {
async on_render() {
this.$.html(`
<div class="dashboard">
<Sidebar />
<div $id="dashboard-content">
<!-- Sub-routes could render here -->
</div>
</div>
`);
}
}
```
### Route-Level Data Loading
```javascript
class UserRoute extends Jqhtml_Route {
async on_load() {
// Runs during component load phase
// Data fetching happens in parallel with siblings
const userId = this.args.id;
this.data.user = await fetch(`/api/users/${userId}`).then(r => r.json());
}
}
```
### Authentication Flow
```javascript
class AuthLayout extends Jqhtml_Layout {
async pre_dispatch(route_info) {
const token = localStorage.getItem('auth_token');
if (!token && route_info.meta.requiresAuth) {
// Store intended destination
sessionStorage.setItem('redirect_after_login', route_info.url);
return '/login'; // Redirect to login
}
return true;
}
}
class LoginRoute extends Jqhtml_Route {
async handleLogin() {
const token = await authenticate(this.data.credentials);
localStorage.setItem('auth_token', token);
// Redirect to intended destination or home
const redirect = sessionStorage.getItem('redirect_after_login') || '/';
sessionStorage.removeItem('redirect_after_login');
Jqhtml_Router.dispatch(redirect);
}
}
```
### Query String Handling
```javascript
// URL: /search?q=jqhtml&category=docs&page=2
class SearchRoute extends Jqhtml_Route {
static routes = ['/search'];
async on_load() {
const query = this.args.q; // 'jqhtml'
const category = this.args.category; // 'docs'
const page = parseInt(this.args.page) || 1; // 2
}
nextPage() {
// Navigate with updated query params
this.dispatch({
page: (parseInt(this.args.page) || 1) + 1
});
}
}
```
## Critical Invariants
1. Layouts must have element with `$id="content"` for route injection
2. Route dispatch is asynchronous and can be cancelled at multiple points
3. Layout instances persist across same-layout route changes
4. Routes are destroyed and recreated on each navigation
5. Hash routing auto-enabled for file:// protocol, cannot be disabled
6. All same-origin link clicks are intercepted unless explicitly prevented
7. Router state is global singleton, only one router instance exists
8. Route parameters are always strings, cast as needed
9. Query parameters merge with route parameters in args object
10. Guard functions execute in strict order: app → layout → route

226
node_modules/@jqhtml/router/README.md generated vendored Executable file
View File

@@ -0,0 +1,226 @@
# @jqhtml/router
Client-side routing for JQHTML single-page applications.
## Installation
```bash
npm install @jqhtml/router @jqhtml/core jquery
```
## Quick Start
```javascript
import { Jqhtml_SPA, Jqhtml_Router, Jqhtml_Layout, Jqhtml_Route } from '@jqhtml/router';
import jqhtml from '@jqhtml/core';
// Define routes
const routes = [
{ path: '/', component: HomeRoute },
{ path: '/about', component: AboutRoute },
{ path: '/users/:id', component: UserRoute }
];
// Create SPA application
class MyApp extends Jqhtml_SPA {
constructor($element) {
super($element);
// Configure router
this.router = new Jqhtml_Router(routes, {
mode: 'hash', // or 'history'
base: '/'
});
}
}
// Initialize
$(document).ready(() => {
const app = new MyApp($('#app'));
app.start();
});
```
## Core Components
### Jqhtml_SPA
Base class for single-page applications. Manages the application lifecycle and router integration.
### Jqhtml_Router
Handles URL routing and navigation. Supports both hash (`#/route`) and history (`/route`) modes.
### Jqhtml_Layout
Persistent layout components that don't re-render on route changes.
### Jqhtml_Route
Base class for route components that render based on the current URL.
## Features
- **Hash & History Modes**: Support for both `#/path` and `/path` routing
- **Nested Routes**: Organize routes hierarchically
- **Route Parameters**: Extract values from URLs like `/users/:id`
- **Query Strings**: Parse and access URL query parameters
- **Layouts**: Persistent wrapper components across routes
- **Lazy Loading**: Load route components on demand
- **Navigation Guards**: Control route access with guards
- **Programmatic Navigation**: Navigate via JavaScript
## Route Configuration
```javascript
const routes = [
{
path: '/',
component: HomeRoute,
name: 'home'
},
{
path: '/users',
component: UsersLayout,
children: [
{ path: '', component: UsersList },
{ path: ':id', component: UserDetail },
{ path: ':id/edit', component: UserEdit }
]
},
{
path: '*',
component: NotFoundRoute
}
];
```
## Navigation
```javascript
// Programmatic navigation
router.navigate('/users/123');
router.navigate({ name: 'home' });
// With query parameters
router.navigate('/search', { query: { q: 'jqhtml' } });
// Replace instead of push
router.replace('/login');
// Go back/forward
router.back();
router.forward();
```
## Route Components
```javascript
class UserRoute extends Jqhtml_Route {
async load() {
// Access route parameters
const userId = this.params.id;
// Load data
this.data.user = await fetchUser(userId);
}
render() {
return `
<div class="user-detail">
<h1>${this.data.user.name}</h1>
</div>
`;
}
}
```
## Layouts
```javascript
class MainLayout extends Jqhtml_Layout {
render() {
return `
<div class="layout">
<header>
<nav>
<a href="#/">Home</a>
<a href="#/about">About</a>
</nav>
</header>
<main>
<div class="route-outlet"></div>
</main>
<footer>© 2024</footer>
</div>
`;
}
// Layouts don't re-render on route change
should_rerender() {
return false;
}
}
```
## Navigation Guards
```javascript
router.beforeEach((to, from, next) => {
if (to.path.startsWith('/admin') && !isAuthenticated()) {
next('/login');
} else {
next();
}
});
router.afterEach((to, from) => {
// Update page title
document.title = to.meta.title || 'My App';
});
```
## URL Parameters
```javascript
// Route: /users/:id/posts/:postId
// URL: /users/123/posts/456?sort=date
class PostRoute extends Jqhtml_Route {
ready() {
console.log(this.params.id); // "123"
console.log(this.params.postId); // "456"
console.log(this.query.sort); // "date"
}
}
```
## Hash Mode (Default)
Best for static file hosting and development:
```javascript
const router = new Jqhtml_Router(routes, {
mode: 'hash'
});
// URLs will be: file:///path/index.html#/route
// Or: https://example.com/#/route
```
## History Mode
For production servers with proper configuration:
```javascript
const router = new Jqhtml_Router(routes, {
mode: 'history',
base: '/app/'
});
// URLs will be: https://example.com/app/route
```
## API Reference
See [LLM_REFERENCE.md](./LLM_REFERENCE.md) for detailed API documentation.
## License
MIT

1063
node_modules/@jqhtml/router/dist/index.cjs generated vendored Executable file

File diff suppressed because it is too large Load Diff

1
node_modules/@jqhtml/router/dist/index.cjs.map generated vendored Executable file

File diff suppressed because one or more lines are too long

9
node_modules/@jqhtml/router/dist/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,9 @@
/**
* JQHTML Router v2 - Client-side routing for JQHTML applications
*/
export { Jqhtml_Router } from './router.js';
export { Jqhtml_Route } from './route.js';
export { Jqhtml_Layout } from './layout.js';
export { Jqhtml_SPA } from './spa.js';
export type { RouteInfo, RouteMeta, RouterState, DispatchOptions, ParsedUrl, RouteDefinition, LayoutDefinition } from './types.js';
//# sourceMappingURL=index.d.ts.map

1
node_modules/@jqhtml/router/dist/index.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,YAAY,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EACjB,MAAM,YAAY,CAAA"}

1058
node_modules/@jqhtml/router/dist/index.js generated vendored Executable file

File diff suppressed because it is too large Load Diff

1
node_modules/@jqhtml/router/dist/index.js.map generated vendored Executable file

File diff suppressed because one or more lines are too long

1063
node_modules/@jqhtml/router/dist/jqhtml-router.esm.js generated vendored Executable file

File diff suppressed because it is too large Load Diff

1
node_modules/@jqhtml/router/dist/jqhtml-router.esm.js.map generated vendored Executable file

File diff suppressed because one or more lines are too long

51
node_modules/@jqhtml/router/dist/layout.d.ts generated vendored Executable file
View File

@@ -0,0 +1,51 @@
/**
* Base class for layout components in JQHTML Router v2
*/
import { Jqhtml_Component } from '@jqhtml/core';
import type { RouteInfo } from './types.js';
declare module '@jqhtml/core' {
interface Jqhtml_Component {
_is_layout?: boolean;
}
}
export declare class Jqhtml_Layout extends Jqhtml_Component {
static layout?: string;
_is_layout: boolean;
constructor(options?: any);
/**
* Called when the route changes within the same layout
* Override this to update layout state (e.g., active navigation items)
*/
on_route_change(old_route: RouteInfo | null, new_route: RouteInfo): Promise<void>;
/**
* Called before dispatching to a new route
* Can cancel navigation by returning false or redirect by returning a URL
*/
pre_dispatch(route_info: RouteInfo): Promise<boolean | string>;
/**
* Called after a route has fully loaded
* Can trigger redirects for post-load logic
*/
post_dispatch(route_info: RouteInfo): Promise<void>;
/**
* Get the content container where routes render
* Must contain an element with $id="content"
*/
$content(): JQuery;
/**
* Internal method to render a route into this layout
* Called by the router during dispatch
*/
_render_route(route_component: any): Promise<void>;
/**
* Override on_render for custom layout rendering
* By default does nothing - layouts should override this or use templates
*/
on_render(): Promise<void>;
/**
* Layouts should never re-render after initial load
* They persist across route changes
*/
should_rerender(): boolean;
}
//# sourceMappingURL=layout.d.ts.map

1
node_modules/@jqhtml/router/dist/layout.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAI3C,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,gBAAgB;QACxB,UAAU,CAAC,EAAE,OAAO,CAAA;KACrB;CACF;AAED,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IAGtB,UAAU,UAAO;gBAEL,OAAO,CAAC,EAAE,GAAG;IAIzB;;;OAGG;IACG,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvF;;;OAGG;IACG,YAAY,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;IAKpE;;;OAGG;IACG,aAAa,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAQlB;;;OAGG;IACG,aAAa,CAAC,eAAe,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBxD;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAOhC;;;OAGG;IACH,eAAe,IAAI,OAAO;CAG3B"}

59
node_modules/@jqhtml/router/dist/route.d.ts generated vendored Executable file
View File

@@ -0,0 +1,59 @@
/**
* Base class for route components in JQHTML Router v2
*/
import { Jqhtml_Component } from '@jqhtml/core';
import type { RouteMeta } from './types.js';
declare module '@jqhtml/core' {
interface Jqhtml_Component {
_is_route?: boolean;
}
}
export declare class Jqhtml_Route extends Jqhtml_Component {
static routes: string[];
static layout: string;
static meta: RouteMeta;
_is_route: boolean;
args: Record<string, any>;
constructor(options?: any);
/**
* Called during app initialization to register routes
* This is where routes call register_route for each path they handle
*/
static init(): void;
/**
* Generate URL for this route with given parameters
* Static version for generating URLs without an instance
*/
static url(params?: Record<string, any>): string;
/**
* Generate URL for this route with current args merged with new params
* Instance method that includes current route parameters
*/
url(params?: Record<string, any>): string;
/**
* Navigate to this route with given parameters
* Static version for programmatic navigation
*/
static dispatch(params?: Record<string, any>): void;
/**
* Navigate to this route with current args merged with new params
* Instance method for navigation from within a route
*/
dispatch(params?: Record<string, any>): void;
/**
* Called before this route is activated
* Can be used for route-specific guards
*/
pre_dispatch(): Promise<boolean | string>;
/**
* Called after this route has fully loaded
* Can be used for analytics, etc.
*/
post_dispatch(): Promise<void>;
/**
* Override on_render for custom route rendering
* By default does nothing - routes should override this or use templates
*/
on_render(): Promise<void>;
}
//# sourceMappingURL=route.d.ts.map

1
node_modules/@jqhtml/router/dist/route.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../src/route.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAI3C,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,gBAAgB;QACxB,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB;CACF;AAED,qBAAa,YAAa,SAAQ,gBAAgB;IAEhD,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAK;IAC5B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAmB;IACxC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAK;IAG3B,SAAS,UAAO;IAGhB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAK;gBAElB,OAAO,CAAC,EAAE,GAAG;IASzB;;;OAGG;IACH,MAAM,CAAC,IAAI,IAAI,IAAI;IAQnB;;;OAGG;IACH,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAehD;;;OAGG;IACH,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAMzC;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAKnD;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAK5C;;;OAGG;IACG,YAAY,IAAI,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;IAK/C;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAMjC"}

104
node_modules/@jqhtml/router/dist/router.d.ts generated vendored Executable file
View File

@@ -0,0 +1,104 @@
/**
* Core Router implementation for JQHTML v2
*/
import type { RouteInfo, RouterState, DispatchOptions, ParsedUrl } from './types';
export declare class Jqhtml_Router {
static state: RouterState;
private static routes;
private static layouts;
private static initialized;
private static ctrl_pressed;
private static is_expired;
private static first_url;
private static current_url;
private static current_hash;
private static default_layout;
private static app;
private static current_route_info;
private static current_layout;
private static current_route;
private static use_hash_routing;
private static is_dispatching;
private static ignore_next_hashchange;
/**
* Register a route
*/
static register_route(path: string, component_name: string, component_class: any): void;
/**
* Register a layout
*/
static register_layout(name: string, component_class: any): void;
/**
* Parse a URL into components
*/
static parse_url(url: string, base?: string): ParsedUrl;
/**
* Match a URL to a route and extract parameters
*/
static match_url_to_route(url: string): RouteInfo | null;
/**
* Convert object to query string
*/
static serialize(params: Record<string, any>): string;
/**
* Parse query string to object
*/
static deserialize(search: string): Record<string, any>;
/**
* Generate URL for a route with parameters
*/
static url(route_name: string, params?: Record<string, any>): string;
/**
* Build URL from pattern and parameters
*/
static build_url(pattern: string, params: Record<string, any>): string;
/**
* Get current URL
*/
static get_current_url(): string;
/**
* Get current hash
*/
static get_current_hash(): string;
/**
* Check if in development mode
*/
private static is_dev;
/**
* Get all registered routes (for debugging)
*/
static get_routes(): Array<{
path: string;
component_name: string;
}>;
/**
* Set the default layout name
*/
static set_default_layout(layout_name: string): void;
/**
* Set the SPA app instance
*/
static set_app(app: any): void;
/**
* Initialize the router
* Sets up browser event handlers
*/
static init(): Promise<void>;
/**
* Setup browser integration for link interception and history
*/
private static setup_browser_integration;
/**
* Main dispatch method - handles navigation
*/
static dispatch(url: string, options?: DispatchOptions): Promise<void>;
/**
* Navigate and replace current history entry
*/
static redirect(url: string): void;
/**
* Navigate and replace current history entry
*/
static replace(url: string): void;
}
//# sourceMappingURL=router.d.ts.map

1
node_modules/@jqhtml/router/dist/router.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,eAAe,EACf,SAAS,EAGV,MAAM,SAAS,CAAA;AAQhB,qBAAa,aAAa;IAExB,MAAM,CAAC,KAAK,EAAE,WAAW,CAMxB;IAGD,OAAO,CAAC,MAAM,CAAC,MAAM,CAAwB;IAC7C,OAAO,CAAC,MAAM,CAAC,OAAO,CAA8B;IACpD,OAAO,CAAC,MAAM,CAAC,WAAW,CAAiB;IAC3C,OAAO,CAAC,MAAM,CAAC,YAAY,CAAiB;IAC5C,OAAO,CAAC,MAAM,CAAC,UAAU,CAAiB;IAC1C,OAAO,CAAC,MAAM,CAAC,SAAS,CAAa;IACrC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAa;IACvC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAa;IACxC,OAAO,CAAC,MAAM,CAAC,cAAc,CAA2B;IACxD,OAAO,CAAC,MAAM,CAAC,GAAG,CAAY;IAC9B,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAyB;IAC1D,OAAO,CAAC,MAAM,CAAC,cAAc,CAAY;IACzC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAY;IACxC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAiB;IAChD,OAAO,CAAC,MAAM,CAAC,cAAc,CAAiB;IAC9C,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAiB;IAEtD;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,GAAG,IAAI;IA6BvF;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,GAAG,IAAI;IAIhE;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS;IAkDvD;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IA2GxD;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAYrD;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAoBvD;;OAEG;IACH,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAYpE;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IA6CtE;;OAEG;IACH,MAAM,CAAC,eAAe,IAAI,MAAM;IAIhC;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,MAAM;IAIjC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,MAAM;IAIrB;;OAEG;IACH,MAAM,CAAC,UAAU,IAAI,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAC,CAAC;IAOlE;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIpD;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI;IAI9B;;;OAGG;WACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA0BlC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IA8GxC;;OAEG;WACU,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA+ShF;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIlC;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAYlC"}

48
node_modules/@jqhtml/router/dist/spa.d.ts generated vendored Executable file
View File

@@ -0,0 +1,48 @@
/**
* Base application class for JQHTML SPAs
*/
import type { RouteInfo } from "./types";
import { Jqhtml_Component } from "@jqhtml/core";
export interface SPAConfig {
default_layout?: string;
not_found_component?: string;
}
export declare class Jqhtml_SPA extends Jqhtml_Component {
private initialized;
private _initial_url;
/**
* Initialize the router and set up event handlers
*/
protected init_router(config?: SPAConfig): Promise<void>;
/**
* Called when the SPA component is fully ready
* This is where we initialize the router and dispatch the initial route
*/
on_ready(): Promise<void>;
/**
* Called before dispatching to a new route
* Can cancel navigation by returning false or redirect by returning a URL
* This runs before layout.pre_dispatch()
*/
pre_dispatch(route_info: RouteInfo): Promise<boolean | string>;
/**
* Called after a route has fully loaded
* This runs after layout.post_dispatch()
* Can trigger redirects for post-load logic
*/
post_dispatch(route_info: RouteInfo): Promise<void>;
/**
* Set the default layout name
* Call this in on_create() if you want a different default than 'Default_Layout'
*/
static set_default_layout(layout_name: string): void;
/**
* Get current router state
*/
static get state(): import("./types").RouterState;
/**
* Get current route info
*/
static get current_route(): RouteInfo | null;
}
//# sourceMappingURL=spa.d.ts.map

1
node_modules/@jqhtml/router/dist/spa.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"spa.d.ts","sourceRoot":"","sources":["../src/spa.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,SAAS;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,qBAAa,UAAW,SAAQ,gBAAgB;IAC9C,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAuB;IAE3C;;OAEG;cACa,WAAW,CAAC,MAAM,GAAE,SAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAqElE;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IA0B/B;;;;OAIG;IACG,YAAY,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;IAKpE;;;;OAIG;IACG,aAAa,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;;OAGG;IACH,MAAM,CAAC,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIpD;;OAEG;IACH,MAAM,KAAK,KAAK,kCAEf;IAED;;OAEG;IACH,MAAM,KAAK,aAAa,IAAI,SAAS,GAAG,IAAI,CAE3C;CACF"}

54
node_modules/@jqhtml/router/dist/types.d.ts generated vendored Executable file
View File

@@ -0,0 +1,54 @@
/**
* Type definitions for JQHTML Router v2
*/
export interface RouteInfo {
url: string;
path: string;
args: Record<string, any>;
hash: string;
meta: RouteMeta;
component_name: string;
component_class: any;
layout?: string;
}
export interface RouteMeta {
name?: string;
requires_auth?: boolean;
title?: string;
[key: string]: any;
}
export interface RouterState {
route: any | null;
layout: any | null;
args: Record<string, any>;
url: string;
hash: string;
}
export interface DispatchOptions {
modify_history?: boolean;
trigger_events?: boolean;
scroll_top?: boolean;
}
export interface ParsedUrl {
host: string;
path: string;
search: string;
hash: string;
href: string;
host_path: string;
host_path_search: string;
path_search: string;
path_search_hash: string;
}
export interface RouteDefinition {
url: string;
component_name: string;
component_class: any;
layout?: string;
meta?: RouteMeta;
}
export interface LayoutDefinition {
name: string;
component_class: any;
}
//# sourceMappingURL=types.d.ts.map

1
node_modules/@jqhtml/router/dist/types.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,GAAG,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,GAAG,GAAG,IAAI,CAAA;IACjB,MAAM,EAAE,GAAG,GAAG,IAAI,CAAA;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,GAAG,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,GAAG,CAAA;CACrB"}

64
node_modules/@jqhtml/router/package.json generated vendored Executable file
View File

@@ -0,0 +1,64 @@
{
"name": "@jqhtml/router",
"version": "2.2.137",
"description": "Client-side routing for JQHTML applications",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
},
"./bundle": {
"import": "./dist/jqhtml-router.esm.js"
}
},
"files": [
"dist",
"README.md",
"LLM_REFERENCE.md",
"LICENSE"
],
"publishConfig": {
"access": "public",
"registry": "https://privatenpm.hanson.xyz/"
},
"repository": {
"type": "git",
"url": "https://github.com/jqhtml/jqhtml.git",
"directory": "packages/router"
},
"scripts": {
"build": "rollup -c",
"build:tsc": "tsc",
"watch": "rollup -c -w",
"test": "jest",
"clean": "rm -rf dist"
},
"keywords": [
"jqhtml",
"router",
"spa",
"jquery"
],
"author": "JQHTML Team",
"license": "MIT",
"peerDependencies": {
"@jqhtml/core": "^2.0.0",
"jquery": "^3.7.0"
},
"browser": true,
"dependencies": {
"@rollup/plugin-node-resolve": "^16.0.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.4",
"@types/jquery": "^3.5.32",
"rollup": "^4.49.0",
"rollup-plugin-dts": "^6.2.3",
"tslib": "^2.8.1",
"typescript": "^5.0.0"
},
"devDependencies": null
}