Fix code quality violations and rename select input components

Move small tasks from wishlist to todo, update npm packages
Replace #[Auth] attributes with manual auth checks and code quality rule
Remove on_jqhtml_ready lifecycle method from framework
Complete ACL system with 100-based role indexing and /dev/acl tester
WIP: ACL system implementation with debug instrumentation
Convert rsx:check JS linting to RPC socket server
Clean up docs and fix $id→$sid in man pages, remove SSR/FPC feature
Reorganize wishlists: priority order, mark sublayouts complete, add email
Update model_fetch docs: mark MVP complete, fix enum docs, reorganize
Comprehensive documentation overhaul: clarity, compression, and critical rules
Convert Contacts/Projects CRUD to Model.fetch() and add fetch_or_null()
Add JS ORM relationship lazy-loading and fetch array handling
Add JS ORM relationship fetching and CRUD documentation
Fix ORM hydration and add IDE resolution for Base_* model stubs
Rename Json_Tree_Component to JS_Tree_Debug_Component and move to framework
Enhance JS ORM infrastructure and add Json_Tree class name badges

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-23 21:39:43 +00:00
parent 78553d4edf
commit 84ca3dfe42
167 changed files with 7538 additions and 49164 deletions

View File

@@ -278,7 +278,7 @@ class CustomInput extends Component {
Templates compile to instruction arrays:
```javascript
[
{tag: ['div', {class: 'container', $id: 'root'}, false]},
{tag: ['div', {class: 'container', $sid: 'root'}, false]},
{text: 'Static content'},
{expr: function() { return this.data.title; }},
{comp: ['ChildComponent', {props: 'values'}, [

View File

@@ -260,7 +260,7 @@ class TabsComponent extends Component {
}
selectTab(tabId) {
// Use $id() for scoped selection
// Use $sid() for scoped selection
this.$sid('tab1').removeClass('active');
this.$sid('tab2').removeClass('active');
this.$sid(tabId).addClass('active');
@@ -428,7 +428,7 @@ await component.render(); // "Widget rendered" logs again
- `should_rerender()` - Control re-rendering after load
- `emit(event, data)` - Emit jQuery events
- `on(event, callback)` - Register lifecycle event callback
- `$id(localId)` - Get scoped jQuery element
- `$sid(localId)` - Get scoped jQuery element
- `id(localId)` - Get scoped component instance
- `parent()` - Get parent component
- `children()` - Get direct child components

View File

@@ -101,16 +101,26 @@ export declare class Jqhtml_Component {
_ready(): Promise<void>;
/**
* Public API: Wait for component to be fully ready
* Returns a promise that resolves when the component reaches ready state
* Returns a promise that resolves when the component reaches ready state.
* Optionally accepts a callback that executes when ready.
*
* @example
* await component.ready(); // Wait for component initialization
* // Promise pattern
* await component.ready();
*
* @example
* const child = this.id('child_component');
* await child.ready(); // Wait for child to be ready
* // Callback pattern
* component.ready(() => {
* console.log('Component is ready!');
* });
*
* @example
* // Both patterns work together
* await component.ready(() => console.log('Callback fired'));
*
* @param callback Optional callback to execute when ready
*/
ready(): Promise<void>;
ready(callback?: () => void): Promise<void>;
/**
* Wait for all child components to reach ready state
* Ensures bottom-up ordering (children ready before parent)

View File

@@ -1 +1 @@
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,CAAC,EAAE;YACb,GAAG,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;YACjF,UAAU,EAAE,MAAM,IAAI,CAAC;SACxB,CAAC;KACH;CACF;AAED,qBAAa,gBAAgB;IAE3B,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAGtB,CAAC,EAAE,GAAG,CAAC;IACP,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAK;IAGzB,OAAO,CAAC,kBAAkB,CAAmB;IAC7C,OAAO,CAAC,aAAa,CAAiC;IACt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;;;;;OAeG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAgB9C;;;OAGG;IACH,YAAY,IAAI,gBAAgB,GAAG,IAAI;IAIvC;;OAEG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,EAAE;IAa1C;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAoBlD;;OAEG;IACH,MAAM,CAAC,mBAAmB,IAAI,MAAM,EAAE;IA0CtC,OAAO,CAAC,aAAa;IAIrB;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAkB7B,OAAO,CAAC,kBAAkB;IA4B1B,OAAO,CAAC,yBAAyB;IAuHjC,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,gBAAgB;IAcxB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA+BzB,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,UAAU;IAUlB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,0BAA0B;CAqEnC"}

View File

@@ -479,7 +479,7 @@ function process_instruction_to_html(instruction, html, tagElements, components,
function process_tag_to_html(instruction, html, tagElements, components, context) {
const [tagName, attrs, selfClosing] = instruction.tag;
// Check if we need to track this element for second pass
const needsTracking = Object.keys(attrs).some(key => key === '$id' || key.startsWith('$') || key.startsWith('@') ||
const needsTracking = Object.keys(attrs).some(key => key === '$sid' || key.startsWith('$') || key.startsWith('@') ||
key.startsWith('on') ||
key.startsWith('data-bind-') || key.startsWith('data-__-on-'));
// Start building tag
@@ -632,7 +632,7 @@ function process_rawtag_to_html(instruction, html) {
* Apply attributes with special handling to a DOM element
*
* This function processes various attribute types and applies them to the element:
* - $id: Creates component-scoped IDs (handled elsewhere in HTML generation)
* - $sid: Creates component-scoped IDs (handled elsewhere in HTML generation)
* - $*: Stored via jQuery .data() only (added to context.args for components)
* - @*: Event handlers with automatic preventDefault and context binding
* - on*: Standard event handlers with context binding
@@ -650,7 +650,7 @@ function process_rawtag_to_html(instruction, html) {
*/
function apply_attributes(element, attrs, context) {
for (const [key, value] of Object.entries(attrs)) {
if (key === '$id' || key === 'id') {
if (key === '$sid' || key === 'id') {
// Already handled in HTML generation
continue;
}
@@ -1811,23 +1811,39 @@ class Jqhtml_Component {
}
/**
* Public API: Wait for component to be fully ready
* Returns a promise that resolves when the component reaches ready state
* Returns a promise that resolves when the component reaches ready state.
* Optionally accepts a callback that executes when ready.
*
* @example
* await component.ready(); // Wait for component initialization
* // Promise pattern
* await component.ready();
*
* @example
* const child = this.id('child_component');
* await child.ready(); // Wait for child to be ready
* // Callback pattern
* component.ready(() => {
* console.log('Component is ready!');
* });
*
* @example
* // Both patterns work together
* await component.ready(() => console.log('Callback fired'));
*
* @param callback Optional callback to execute when ready
*/
ready() {
// If already ready, resolve immediately
ready(callback) {
// If already ready, execute callback immediately and resolve
if (this._ready_state >= 4) {
if (callback)
callback();
return Promise.resolve();
}
// Return promise that resolves when ready event fires
return new Promise((resolve) => {
this.on('ready', () => resolve());
this.on('ready', () => {
if (callback)
callback();
resolve();
});
});
}
/**
@@ -3354,7 +3370,7 @@ function init_jquery_plugin(jQuery) {
if (selector &&
typeof selector === 'object' &&
selector.$ &&
typeof selector.$id === 'function' &&
typeof selector.$sid === 'function' &&
typeof selector.id === 'function') {
// Return the component's jQuery element
return selector.$;
@@ -4221,7 +4237,7 @@ function init(jQuery) {
}
}
// Version - will be replaced during build with actual version from package.json
const version = '2.2.218';
const version = '2.2.220';
// Default export with all functionality
const jqhtml = {
// Core

File diff suppressed because one or more lines are too long

View File

@@ -475,7 +475,7 @@ function process_instruction_to_html(instruction, html, tagElements, components,
function process_tag_to_html(instruction, html, tagElements, components, context) {
const [tagName, attrs, selfClosing] = instruction.tag;
// Check if we need to track this element for second pass
const needsTracking = Object.keys(attrs).some(key => key === '$id' || key.startsWith('$') || key.startsWith('@') ||
const needsTracking = Object.keys(attrs).some(key => key === '$sid' || key.startsWith('$') || key.startsWith('@') ||
key.startsWith('on') ||
key.startsWith('data-bind-') || key.startsWith('data-__-on-'));
// Start building tag
@@ -628,7 +628,7 @@ function process_rawtag_to_html(instruction, html) {
* Apply attributes with special handling to a DOM element
*
* This function processes various attribute types and applies them to the element:
* - $id: Creates component-scoped IDs (handled elsewhere in HTML generation)
* - $sid: Creates component-scoped IDs (handled elsewhere in HTML generation)
* - $*: Stored via jQuery .data() only (added to context.args for components)
* - @*: Event handlers with automatic preventDefault and context binding
* - on*: Standard event handlers with context binding
@@ -646,7 +646,7 @@ function process_rawtag_to_html(instruction, html) {
*/
function apply_attributes(element, attrs, context) {
for (const [key, value] of Object.entries(attrs)) {
if (key === '$id' || key === 'id') {
if (key === '$sid' || key === 'id') {
// Already handled in HTML generation
continue;
}
@@ -1807,23 +1807,39 @@ class Jqhtml_Component {
}
/**
* Public API: Wait for component to be fully ready
* Returns a promise that resolves when the component reaches ready state
* Returns a promise that resolves when the component reaches ready state.
* Optionally accepts a callback that executes when ready.
*
* @example
* await component.ready(); // Wait for component initialization
* // Promise pattern
* await component.ready();
*
* @example
* const child = this.id('child_component');
* await child.ready(); // Wait for child to be ready
* // Callback pattern
* component.ready(() => {
* console.log('Component is ready!');
* });
*
* @example
* // Both patterns work together
* await component.ready(() => console.log('Callback fired'));
*
* @param callback Optional callback to execute when ready
*/
ready() {
// If already ready, resolve immediately
ready(callback) {
// If already ready, execute callback immediately and resolve
if (this._ready_state >= 4) {
if (callback)
callback();
return Promise.resolve();
}
// Return promise that resolves when ready event fires
return new Promise((resolve) => {
this.on('ready', () => resolve());
this.on('ready', () => {
if (callback)
callback();
resolve();
});
});
}
/**
@@ -3350,7 +3366,7 @@ function init_jquery_plugin(jQuery) {
if (selector &&
typeof selector === 'object' &&
selector.$ &&
typeof selector.$id === 'function' &&
typeof selector.$sid === 'function' &&
typeof selector.id === 'function') {
// Return the component's jQuery element
return selector.$;
@@ -4217,7 +4233,7 @@ function init(jQuery) {
}
}
// Version - will be replaced during build with actual version from package.json
const version = '2.2.218';
const version = '2.2.220';
// Default export with all functionality
const jqhtml = {
// Core

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
/**
* JQHTML Core v2.2.218
* JQHTML Core v2.2.220
* (c) 2025 JQHTML Team
* Released under the MIT License
*/
@@ -480,7 +480,7 @@ function process_instruction_to_html(instruction, html, tagElements, components,
function process_tag_to_html(instruction, html, tagElements, components, context) {
const [tagName, attrs, selfClosing] = instruction.tag;
// Check if we need to track this element for second pass
const needsTracking = Object.keys(attrs).some(key => key === '$id' || key.startsWith('$') || key.startsWith('@') ||
const needsTracking = Object.keys(attrs).some(key => key === '$sid' || key.startsWith('$') || key.startsWith('@') ||
key.startsWith('on') ||
key.startsWith('data-bind-') || key.startsWith('data-__-on-'));
// Start building tag
@@ -633,7 +633,7 @@ function process_rawtag_to_html(instruction, html) {
* Apply attributes with special handling to a DOM element
*
* This function processes various attribute types and applies them to the element:
* - $id: Creates component-scoped IDs (handled elsewhere in HTML generation)
* - $sid: Creates component-scoped IDs (handled elsewhere in HTML generation)
* - $*: Stored via jQuery .data() only (added to context.args for components)
* - @*: Event handlers with automatic preventDefault and context binding
* - on*: Standard event handlers with context binding
@@ -651,7 +651,7 @@ function process_rawtag_to_html(instruction, html) {
*/
function apply_attributes(element, attrs, context) {
for (const [key, value] of Object.entries(attrs)) {
if (key === '$id' || key === 'id') {
if (key === '$sid' || key === 'id') {
// Already handled in HTML generation
continue;
}
@@ -1812,23 +1812,39 @@ class Jqhtml_Component {
}
/**
* Public API: Wait for component to be fully ready
* Returns a promise that resolves when the component reaches ready state
* Returns a promise that resolves when the component reaches ready state.
* Optionally accepts a callback that executes when ready.
*
* @example
* await component.ready(); // Wait for component initialization
* // Promise pattern
* await component.ready();
*
* @example
* const child = this.id('child_component');
* await child.ready(); // Wait for child to be ready
* // Callback pattern
* component.ready(() => {
* console.log('Component is ready!');
* });
*
* @example
* // Both patterns work together
* await component.ready(() => console.log('Callback fired'));
*
* @param callback Optional callback to execute when ready
*/
ready() {
// If already ready, resolve immediately
ready(callback) {
// If already ready, execute callback immediately and resolve
if (this._ready_state >= 4) {
if (callback)
callback();
return Promise.resolve();
}
// Return promise that resolves when ready event fires
return new Promise((resolve) => {
this.on('ready', () => resolve());
this.on('ready', () => {
if (callback)
callback();
resolve();
});
});
}
/**
@@ -3355,7 +3371,7 @@ function init_jquery_plugin(jQuery) {
if (selector &&
typeof selector === 'object' &&
selector.$ &&
typeof selector.$id === 'function' &&
typeof selector.$sid === 'function' &&
typeof selector.id === 'function') {
// Return the component's jQuery element
return selector.$;
@@ -4222,7 +4238,7 @@ function init(jQuery) {
}
}
// Version - will be replaced during build with actual version from package.json
const version = '2.2.218';
const version = '2.2.220';
// Default export with all functionality
const jqhtml = {
// Core

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "@jqhtml/core",
"version": "2.2.218",
"version": "2.2.220",
"description": "Core runtime library for JQHTML",
"type": "module",
"main": "./dist/index.js",