Fix code quality violations for publish
Remove unused blade settings pages not linked from UI Convert remaining frontend pages to SPA actions Convert settings user_settings and general to SPA actions Convert settings profile pages to SPA actions Convert contacts and projects add/edit pages to SPA actions Convert clients add/edit page to SPA action with loading pattern Refactor component scoped IDs from $id to $sid Fix jqhtml comment syntax and implement universal error component system Update all application code to use new unified error system Remove all backwards compatibility - unified error system complete Phase 5: Remove old response classes Phase 3-4: Ajax response handler sends new format, old helpers deprecated Phase 2: Add client-side unified error foundation Phase 1: Add server-side unified error foundation Add unified Ajax error response system with constants 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
50
node_modules/.package-lock.json
generated
vendored
50
node_modules/.package-lock.json
generated
vendored
@@ -2211,9 +2211,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jqhtml/core": {
|
||||
"version": "2.2.217",
|
||||
"resolved": "http://privatenpm.hanson.xyz/@jqhtml/core/-/core-2.2.217.tgz",
|
||||
"integrity": "sha512-rmu7jgRM3PPvKGkFbRZ0wTXBxHPuvVf9aIMSXv6n0KceTvKlqLR2EFHjPrHbCp9X0DyzoooiVhKEJcKlbVIXJw==",
|
||||
"version": "2.2.218",
|
||||
"resolved": "http://privatenpm.hanson.xyz/@jqhtml/core/-/core-2.2.218.tgz",
|
||||
"integrity": "sha512-CEbrpoi70Y5ET1fBXHK38fZTi5MAtZEY2c779mwjw3Dn7SjpoxvCYet/AJLJI7lngA6eJl9BPaPwALMHbafkLQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
||||
@@ -2237,9 +2237,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jqhtml/parser": {
|
||||
"version": "2.2.217",
|
||||
"resolved": "http://privatenpm.hanson.xyz/@jqhtml/parser/-/parser-2.2.217.tgz",
|
||||
"integrity": "sha512-pAQegkFNZSY+DjkrvQ162c78lg9YU2gCaftYxWdLTrKP86mr0QVG8vAQ8IsvH/sQBvVRUIR9sNSjK+fXd/SnlQ==",
|
||||
"version": "2.2.218",
|
||||
"resolved": "http://privatenpm.hanson.xyz/@jqhtml/parser/-/parser-2.2.218.tgz",
|
||||
"integrity": "sha512-i8Y/tx/mIwhAw8YZd99j2i8iLWSU/9Ua88u4p0h3sCCeIWGT7QGvrr7vF+OiUcb8ECtX1188ODlHWdWt7vb45w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/jest": "^29.5.11",
|
||||
@@ -2257,9 +2257,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jqhtml/router": {
|
||||
"version": "2.2.217",
|
||||
"resolved": "http://privatenpm.hanson.xyz/@jqhtml/router/-/router-2.2.217.tgz",
|
||||
"integrity": "sha512-WiUAOb92sDY3kRD8lmsxcd8oSNqVmCDMsxZj0z/KRLCa0Y6kGrtk8AlQiunBQzvEHGVIb/Kt/6P1WhKEKaBh/g==",
|
||||
"version": "2.2.218",
|
||||
"resolved": "http://privatenpm.hanson.xyz/@jqhtml/router/-/router-2.2.218.tgz",
|
||||
"integrity": "sha512-aQum/FdDlqbtNbtkIJFN5sGNTBhlGBn5duclsyv0CYmJ8ruC2Gr0y5FILBeuc1lFSmG/6UJZ+eOlrQ4QDk2zng==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
||||
@@ -2277,21 +2277,21 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jqhtml/vscode-extension": {
|
||||
"version": "2.2.217",
|
||||
"resolved": "http://privatenpm.hanson.xyz/@jqhtml/vscode-extension/-/vscode-extension-2.2.217.tgz",
|
||||
"integrity": "sha512-6AXZnG03DFi78tdCv21dQF5ILt/YCVPGqZpFKIBNH+CaNccCFW415fMvfC6jNhm34fUSMu0MCHmWSGXzamCtGQ==",
|
||||
"version": "2.2.218",
|
||||
"resolved": "http://privatenpm.hanson.xyz/@jqhtml/vscode-extension/-/vscode-extension-2.2.218.tgz",
|
||||
"integrity": "sha512-fEOcYqi2AVkLxxJ3ovwKqJQGpLI9C6sgcRWs3HVuDH6UYpNiRPUwzSxf/M7j+wZY5y5tt7KGSDK5JjbSj0PqqQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"vscode": "^1.74.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@jqhtml/webpack-loader": {
|
||||
"version": "2.2.217",
|
||||
"resolved": "http://privatenpm.hanson.xyz/@jqhtml/webpack-loader/-/webpack-loader-2.2.217.tgz",
|
||||
"integrity": "sha512-zUquYIBEEodMp5xypVbR7dbrsaII6Ojux5i93HS68sMfWzafXr67mEGyjv9ls0sZ47SD8L37iQef5sh3OVRxww==",
|
||||
"version": "2.2.218",
|
||||
"resolved": "http://privatenpm.hanson.xyz/@jqhtml/webpack-loader/-/webpack-loader-2.2.218.tgz",
|
||||
"integrity": "sha512-QN/4qTsxPjB9OWHdNVvif05ygw9FYblF6KYyHPvdZ0NNWNoUMYBcKizjjTjFAsUMqWQkT4RETx5XxkiomgKPPQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jqhtml/parser": "2.2.217",
|
||||
"@jqhtml/parser": "2.2.218",
|
||||
"@types/loader-utils": "^2.0.6",
|
||||
"@types/node": "^20.0.0",
|
||||
"@types/webpack": "^5.28.5",
|
||||
@@ -4017,9 +4017,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/baseline-browser-mapping": {
|
||||
"version": "2.8.29",
|
||||
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.29.tgz",
|
||||
"integrity": "sha512-sXdt2elaVnhpDNRDz+1BDx1JQoJRuNk7oVlAlbGiFkLikHCAQiccexF/9e91zVi6RCgqspl04aP+6Cnl9zRLrA==",
|
||||
"version": "2.8.30",
|
||||
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.30.tgz",
|
||||
"integrity": "sha512-aTUKW4ptQhS64+v2d6IkPzymEzzhw+G0bA1g3uBRV3+ntkH+svttKseW5IOR4Ed6NUVKqnY7qT3dKvzQ7io4AA==",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"baseline-browser-mapping": "dist/cli.js"
|
||||
@@ -5697,9 +5697,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.5.257",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.257.tgz",
|
||||
"integrity": "sha512-VNSOB6JZan5IQNMqaurYpZC4bDPXcvKlUwVD/ztMeVD7SwOpMYGOY7dgt+4lNiIHIpvv/FdULnZKqKEy2KcuHQ==",
|
||||
"version": "1.5.259",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.259.tgz",
|
||||
"integrity": "sha512-I+oLXgpEJzD6Cwuwt1gYjxsDmu/S/Kd41mmLA3O+/uH2pFRO/DvOjUyGozL8j3KeLV6WyZ7ssPwELMsXCcsJAQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/elliptic": {
|
||||
@@ -10841,9 +10841,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sass": {
|
||||
"version": "1.94.1",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.94.1.tgz",
|
||||
"integrity": "sha512-/YVm5FRQaRlr3oNh2LLFYne1PdPlRZGyKnHh1sLleOqLcohTR4eUUvBjBIqkl1fEXd1MGOHgzJGJh+LgTtV4KQ==",
|
||||
"version": "1.94.2",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.94.2.tgz",
|
||||
"integrity": "sha512-N+7WK20/wOr7CzA2snJcUSSNTCzeCGUTFY3OgeQP3mZ1aj9NMQ0mSTXwlrnd89j33zzQJGqIN52GIOmYrfq46A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"chokidar": "^4.0.0",
|
||||
|
||||
8
node_modules/@jqhtml/core/LLM_REFERENCE.md
generated
vendored
8
node_modules/@jqhtml/core/LLM_REFERENCE.md
generated
vendored
@@ -27,7 +27,7 @@
|
||||
- Access component methods via `this.methodName()`
|
||||
|
||||
### Attribute System
|
||||
- `$id="name"` → `id="name:_cid"` (component-scoped ID)
|
||||
- `$sid="name"` → `id="name:_cid"` (component-scoped ID)
|
||||
- `$attr="value"` → `data-attr="value"` (data attributes)
|
||||
- `@click="handler"` → jQuery event binding to component method
|
||||
- `@submit.prevent="handler"` → Event with preventDefault
|
||||
@@ -217,7 +217,7 @@ class UserCard extends Jqhtml_Component {
|
||||
- `this._ready_state` - Lifecycle phase (0=created, 1=rendering, 2=creating, 3=loading, 4=ready)
|
||||
|
||||
### DOM Access Methods
|
||||
- `this.$id('name')` - Get element by scoped ID (returns jQuery object)
|
||||
- `this.$sid('name')` - Get element by scoped ID (returns jQuery object)
|
||||
- `this.$child('name')` - Get child component by name
|
||||
- `this.$children()` - Get all direct child components
|
||||
- `this.$parent()` - Get parent component
|
||||
@@ -260,11 +260,11 @@ class CustomInput extends Component {
|
||||
val(value) {
|
||||
if (arguments.length === 0) {
|
||||
// Getter - return processed value
|
||||
return this.parse_value(this.$id('input').val());
|
||||
return this.parse_value(this.$sid('input').val());
|
||||
} else {
|
||||
// Setter - validate and set
|
||||
if (this.validate(value)) {
|
||||
this.$id('input').val(this.format_value(value));
|
||||
this.$sid('input').val(this.format_value(value));
|
||||
this.data.value = value;
|
||||
}
|
||||
return this.$; // Maintain jQuery chaining
|
||||
|
||||
20
node_modules/@jqhtml/core/README.md
generated
vendored
20
node_modules/@jqhtml/core/README.md
generated
vendored
@@ -132,7 +132,7 @@ If you need to show different DOM states before and after loading, use these pat
|
||||
class DataComponent extends Component {
|
||||
async on_create() {
|
||||
// Set loading state in the DOM during create phase
|
||||
this.$id('status').addClass('loading').text('Loading...');
|
||||
this.$sid('status').addClass('loading').text('Loading...');
|
||||
}
|
||||
|
||||
async on_load() {
|
||||
@@ -142,8 +142,8 @@ class DataComponent extends Component {
|
||||
|
||||
async on_ready() {
|
||||
// Update DOM after data is loaded
|
||||
this.$id('status').removeClass('loading').text('Loaded');
|
||||
this.$id('username').text(this.data.user.name);
|
||||
this.$sid('status').removeClass('loading').text('Loaded');
|
||||
this.$sid('username').text(this.data.user.name);
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -153,12 +153,12 @@ class DataComponent extends Component {
|
||||
class BadComponent extends Component {
|
||||
async on_load() {
|
||||
// ❌ WRONG - DOM modification in load()
|
||||
this.$id('status').text('Loading...'); // VIOLATION!
|
||||
this.$sid('status').text('Loading...'); // VIOLATION!
|
||||
|
||||
this.data.user = await fetch('/api/user').then(r => r.json());
|
||||
|
||||
// ❌ WRONG - More DOM modification
|
||||
this.$id('status').text('Loaded'); // VIOLATION!
|
||||
this.$sid('status').text('Loaded'); // VIOLATION!
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -261,9 +261,9 @@ class TabsComponent extends Component {
|
||||
|
||||
selectTab(tabId) {
|
||||
// Use $id() for scoped selection
|
||||
this.$id('tab1').removeClass('active');
|
||||
this.$id('tab2').removeClass('active');
|
||||
this.$id(tabId).addClass('active');
|
||||
this.$sid('tab1').removeClass('active');
|
||||
this.$sid('tab2').removeClass('active');
|
||||
this.$sid(tabId).addClass('active');
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -300,7 +300,7 @@ JQHTML has specific rules for attribute quoting and value passing:
|
||||
- **@ Event attributes**: MUST be unquoted (pass function references)
|
||||
Example: `@click=this.handleClick`
|
||||
- **$ Data attributes**: Can be quoted OR unquoted (flexible)
|
||||
Example: `$id="my-id"` or `$data=this.complexObject`
|
||||
Example: `$sid="my-id"` or `$data=this.complexObject`
|
||||
- **Regular HTML attributes**: MUST be quoted (strings only)
|
||||
Example: `class="container <%= this.args.theme %>"`
|
||||
|
||||
@@ -375,7 +375,7 @@ $('#user-profile').component().on('ready', (component) => {
|
||||
console.log('User data:', component.data.user);
|
||||
|
||||
// Safe to access all DOM elements
|
||||
component.$id('email').addClass('verified');
|
||||
component.$sid('email').addClass('verified');
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
0
node_modules/@jqhtml/core/dist/component-registry.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/component-registry.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/component-registry.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/component-registry.d.ts.map
generated
vendored
Executable file → Normal file
28
node_modules/@jqhtml/core/dist/component.d.ts
generated
vendored
Executable file → Normal file
28
node_modules/@jqhtml/core/dist/component.d.ts
generated
vendored
Executable file → Normal file
@@ -193,6 +193,17 @@ export declare class Jqhtml_Component {
|
||||
on_load(): Promise<void>;
|
||||
on_ready(): Promise<void>;
|
||||
on_stop(): void | Promise<void>;
|
||||
/**
|
||||
* Optional: Override cache key generation
|
||||
*
|
||||
* By default, cache keys are generated from component name + args.
|
||||
* Override this method to provide a custom cache key for this component instance.
|
||||
*
|
||||
* If this method throws an error, caching will be disabled for this component.
|
||||
*
|
||||
* @returns Custom cache key string (will be prefixed with component name)
|
||||
*/
|
||||
cache_id?(): string;
|
||||
/**
|
||||
* Should component re-render after load?
|
||||
* By default, only re-renders if data has changed
|
||||
@@ -231,9 +242,9 @@ export declare class Jqhtml_Component {
|
||||
* Searches for elements with id="local_id:THIS_COMPONENT_CID"
|
||||
*
|
||||
* Example:
|
||||
* Template: <button $id="save_btn">Save</button>
|
||||
* Rendered: <button id="save_btn:abc123" data-id="save_btn">Save</button>
|
||||
* Access: this.$id('save_btn') // Returns jQuery element
|
||||
* Template: <button $sid="save_btn">Save</button>
|
||||
* Rendered: <button id="save_btn:abc123" data-sid="save_btn">Save</button>
|
||||
* Access: this.$sid('save_btn') // Returns jQuery element
|
||||
*
|
||||
* Performance: Uses native document.getElementById() when component is in DOM,
|
||||
* falls back to jQuery.find() for components not yet attached to DOM.
|
||||
@@ -241,21 +252,24 @@ export declare class Jqhtml_Component {
|
||||
* @param local_id The local ID (without _cid suffix)
|
||||
* @returns jQuery element with id="local_id:_cid", or empty jQuery object if not found
|
||||
*/
|
||||
$id(local_id: string): any;
|
||||
$sid(local_id: string): any;
|
||||
/**
|
||||
* Get component instance by scoped ID
|
||||
*
|
||||
* Convenience method that finds element by scoped ID and returns the component instance.
|
||||
*
|
||||
* Example:
|
||||
* Template: <User_Card $id="active_user" />
|
||||
* Access: const user = this.id('active_user'); // Returns User_Card instance
|
||||
* Template: <User_Card $sid="active_user" />
|
||||
* Access: const user = this.sid('active_user'); // Returns User_Card instance
|
||||
* user.data.name // Access component's data
|
||||
*
|
||||
* To get the scoped ID string itself:
|
||||
* this.$sid('active_user').attr('id') // Returns "active_user:abc123xyz"
|
||||
*
|
||||
* @param local_id The local ID (without _cid suffix)
|
||||
* @returns Component instance or null if not found or not a component
|
||||
*/
|
||||
id(local_id: string): Jqhtml_Component | null;
|
||||
sid(local_id: string): Jqhtml_Component | null;
|
||||
/**
|
||||
* Get the component that instantiated this component (rendered it in their template)
|
||||
* Returns null if component was created programmatically via $().component()
|
||||
|
||||
2
node_modules/@jqhtml/core/dist/component.d.ts.map
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/core/dist/component.d.ts.map
generated
vendored
Executable file → Normal 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,CA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AAK,IAAI,GAAG,IAAI;IAsB7E;;;OAGG;IACH,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAiBjC;;;OAGG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAK3C;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG;IAgB3B;;;;;;;;;;;;;;;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"}
|
||||
0
node_modules/@jqhtml/core/dist/debug-entry.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/debug-entry.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/debug-entry.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/debug-entry.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/debug-overlay.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/debug-overlay.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/debug-overlay.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/debug-overlay.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/debug.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/debug.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/debug.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/debug.d.ts.map
generated
vendored
Executable file → Normal file
130
node_modules/@jqhtml/core/dist/index.cjs
generated
vendored
Executable file → Normal file
130
node_modules/@jqhtml/core/dist/index.cjs
generated
vendored
Executable file → Normal file
@@ -499,7 +499,7 @@ function process_tag_to_html(instruction, html, tagElements, components, context
|
||||
if (key === 'id' && tid) {
|
||||
// Special handling for id attribute - scope to parent component's _cid
|
||||
// This is for regular id="foo" attributes that need scoping (rare case)
|
||||
// Most scoping happens via $id attribute which becomes data-id
|
||||
// Most scoping happens via $sid attribute which becomes data-sid
|
||||
// Don't double-scope if already scoped (contains :)
|
||||
if (typeof value === 'string' && value.includes(':')) {
|
||||
html.push(` id="${value}"`);
|
||||
@@ -549,13 +549,13 @@ function process_component_to_html(instruction, html, components, context) {
|
||||
// Create element with tracking ID
|
||||
html.push(`<${tagName} data-cid="${cid}"`);
|
||||
// Handle id attributes for components
|
||||
// The compiled code always generates both 'id' (scoped) and 'data-id' (base) for $id attributes
|
||||
// The compiled code always generates both 'id' (scoped) and 'data-sid' (base) for $sid attributes
|
||||
// We just pass through what the compiler gave us - NEVER regenerate
|
||||
if (props['data-id']) {
|
||||
const baseId = props['data-id'];
|
||||
if (props['data-sid']) {
|
||||
const baseId = props['data-sid'];
|
||||
// The compiled code ALWAYS sets props['id'] with the correct scoped value
|
||||
// Just use it directly - it already has the correct parent _cid baked in
|
||||
html.push(` id="${props['id']}" data-id="${baseId}"`);
|
||||
html.push(` id="${props['id']}" data-sid="${baseId}"`);
|
||||
}
|
||||
// Regular id passes through unchanged
|
||||
else if (props['id']) {
|
||||
@@ -1229,16 +1229,16 @@ class Jqhtml_Component {
|
||||
// If id provided, delegate to child component
|
||||
if (id) {
|
||||
// First check if element with scoped ID exists
|
||||
const $element = this.$id(id);
|
||||
const $element = this.$sid(id);
|
||||
if ($element.length === 0) {
|
||||
throw new Error(`[JQHTML] render("${id}") - no such id.\n` +
|
||||
`Component "${this.component_name()}" has no child element with $id="${id}".`);
|
||||
`Component "${this.component_name()}" has no child element with $sid="${id}".`);
|
||||
}
|
||||
// Element exists, check if it's a component
|
||||
const child = $element.data('_component');
|
||||
if (!child) {
|
||||
throw new Error(`[JQHTML] render("${id}") - element is not a component or does not have $redrawable attribute set.\n` +
|
||||
`Element with $id="${id}" exists but is not initialized as a component.\n` +
|
||||
`Element with $sid="${id}" exists but is not initialized as a component.\n` +
|
||||
`Add $redrawable attribute or make it a proper component.`);
|
||||
}
|
||||
return child._render();
|
||||
@@ -1459,15 +1459,15 @@ class Jqhtml_Component {
|
||||
return;
|
||||
// If id provided, delegate to child component
|
||||
if (id) {
|
||||
const $element = this.$id(id);
|
||||
const $element = this.$sid(id);
|
||||
if ($element.length === 0) {
|
||||
throw new Error(`[JQHTML] render("${id}") - no such id.\n` +
|
||||
`Component "${this.component_name()}" has no child element with $id="${id}".`);
|
||||
`Component "${this.component_name()}" has no child element with $sid="${id}".`);
|
||||
}
|
||||
const child = $element.data('_component');
|
||||
if (!child) {
|
||||
throw new Error(`[JQHTML] render("${id}") - element is not a component or does not have $redrawable attribute set.\n` +
|
||||
`Element with $id="${id}" exists but is not initialized as a component.\n` +
|
||||
`Element with $sid="${id}" exists but is not initialized as a component.\n` +
|
||||
`Add $redrawable attribute or make it a proper component.`);
|
||||
}
|
||||
return child.render();
|
||||
@@ -1515,8 +1515,26 @@ class Jqhtml_Component {
|
||||
// This happens after on_create() but before render, allowing instant first render with cached data
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// If cache_key is null, args are not serializable - skip caching
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
let uncacheable_property;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
uncacheable_property = 'cache_id()';
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
uncacheable_property = result.uncacheable_property;
|
||||
}
|
||||
// If cache_key is null, caching disabled
|
||||
if (cache_key === null) {
|
||||
// Set data-nocache attribute for debugging (shows which property prevented caching)
|
||||
if (uncacheable_property) {
|
||||
@@ -1574,8 +1592,25 @@ class Jqhtml_Component {
|
||||
// Import coordinator and storage lazily to avoid circular dependency
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
// Generate cache key (same as deduplication key)
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
let uncacheable_property;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
uncacheable_property = 'cache_id()';
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
uncacheable_property = result.uncacheable_property;
|
||||
}
|
||||
// If cache_key is null, args are not serializable - skip load deduplication and caching
|
||||
if (cache_key === null) {
|
||||
// Set data-nocache attribute for debugging (shows which property prevented caching)
|
||||
@@ -1916,7 +1951,23 @@ class Jqhtml_Component {
|
||||
if (args_changed) {
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
cache_key = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
}
|
||||
// Only use cache if args are serializable
|
||||
if (cache_key !== null) {
|
||||
const cached_data = Jqhtml_Local_Storage.get(cache_key);
|
||||
@@ -1955,7 +2006,23 @@ class Jqhtml_Component {
|
||||
if (data_changed && data_after_load !== '{}') {
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
cache_key = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
}
|
||||
// Only update cache if args are serializable
|
||||
if (cache_key !== null) {
|
||||
Jqhtml_Local_Storage.set(cache_key, this.data);
|
||||
@@ -2166,9 +2233,9 @@ class Jqhtml_Component {
|
||||
* Searches for elements with id="local_id:THIS_COMPONENT_CID"
|
||||
*
|
||||
* Example:
|
||||
* Template: <button $id="save_btn">Save</button>
|
||||
* Rendered: <button id="save_btn:abc123" data-id="save_btn">Save</button>
|
||||
* Access: this.$id('save_btn') // Returns jQuery element
|
||||
* Template: <button $sid="save_btn">Save</button>
|
||||
* Rendered: <button id="save_btn:abc123" data-sid="save_btn">Save</button>
|
||||
* Access: this.$sid('save_btn') // Returns jQuery element
|
||||
*
|
||||
* Performance: Uses native document.getElementById() when component is in DOM,
|
||||
* falls back to jQuery.find() for components not yet attached to DOM.
|
||||
@@ -2176,7 +2243,7 @@ class Jqhtml_Component {
|
||||
* @param local_id The local ID (without _cid suffix)
|
||||
* @returns jQuery element with id="local_id:_cid", or empty jQuery object if not found
|
||||
*/
|
||||
$id(local_id) {
|
||||
$sid(local_id) {
|
||||
const scopedId = `${local_id}:${this._cid}`;
|
||||
// Try getElementById first (fast path - works when component is in DOM)
|
||||
const el = document.getElementById(scopedId);
|
||||
@@ -2184,7 +2251,7 @@ class Jqhtml_Component {
|
||||
return $(el);
|
||||
}
|
||||
// Fallback: component not in DOM yet, search within component subtree
|
||||
// This allows $id() to work on components before they're appended to body
|
||||
// This allows $sid() to work on components before they're appended to body
|
||||
// Must escape the ID because it contains ':' which jQuery treats as a pseudo-selector
|
||||
return this.$.find(`#${$.escapeSelector(scopedId)}`);
|
||||
}
|
||||
@@ -2194,19 +2261,22 @@ class Jqhtml_Component {
|
||||
* Convenience method that finds element by scoped ID and returns the component instance.
|
||||
*
|
||||
* Example:
|
||||
* Template: <User_Card $id="active_user" />
|
||||
* Access: const user = this.id('active_user'); // Returns User_Card instance
|
||||
* Template: <User_Card $sid="active_user" />
|
||||
* Access: const user = this.sid('active_user'); // Returns User_Card instance
|
||||
* user.data.name // Access component's data
|
||||
*
|
||||
* To get the scoped ID string itself:
|
||||
* this.$sid('active_user').attr('id') // Returns "active_user:abc123xyz"
|
||||
*
|
||||
* @param local_id The local ID (without _cid suffix)
|
||||
* @returns Component instance or null if not found or not a component
|
||||
*/
|
||||
id(local_id) {
|
||||
const element = this.$id(local_id);
|
||||
sid(local_id) {
|
||||
const element = this.$sid(local_id);
|
||||
const component = element.data('_component');
|
||||
// If no component found but element exists, warn developer
|
||||
if (!component && element.length > 0) {
|
||||
console.warn(`Component ${this.constructor.name} tried to call .id('${local_id}') - ` +
|
||||
console.warn(`Component ${this.constructor.name} tried to call .sid('${local_id}') - ` +
|
||||
`${local_id} exists, however, it is not a component or $redrawable. ` +
|
||||
`Did you forget to add $redrawable to the tag?`);
|
||||
}
|
||||
@@ -2825,7 +2895,7 @@ function evaluate_expression(expression, component, locals = {}) {
|
||||
args: component.args,
|
||||
$: component.$,
|
||||
// Component methods
|
||||
$id: component.$id.bind(component),
|
||||
$sid: component.$sid.bind(component),
|
||||
// Locals (like $event)
|
||||
...locals
|
||||
};
|
||||
@@ -2853,7 +2923,7 @@ function evaluate_handler(expression, component) {
|
||||
// Otherwise treat as inline code
|
||||
try {
|
||||
return new Function('$event', `
|
||||
const { data, args, $, emit, $id } = this;
|
||||
const { data, args, $, emit, $sid } = this;
|
||||
${expression}
|
||||
`).bind(component);
|
||||
}
|
||||
@@ -4151,7 +4221,7 @@ function init(jQuery) {
|
||||
}
|
||||
}
|
||||
// Version - will be replaced during build with actual version from package.json
|
||||
const version = '2.2.217';
|
||||
const version = '2.2.218';
|
||||
// Default export with all functionality
|
||||
const jqhtml = {
|
||||
// Core
|
||||
|
||||
2
node_modules/@jqhtml/core/dist/index.cjs.map
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/core/dist/index.cjs.map
generated
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
0
node_modules/@jqhtml/core/dist/index.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/index.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/index.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/index.d.ts.map
generated
vendored
Executable file → Normal file
130
node_modules/@jqhtml/core/dist/index.js
generated
vendored
Executable file → Normal file
130
node_modules/@jqhtml/core/dist/index.js
generated
vendored
Executable file → Normal file
@@ -495,7 +495,7 @@ function process_tag_to_html(instruction, html, tagElements, components, context
|
||||
if (key === 'id' && tid) {
|
||||
// Special handling for id attribute - scope to parent component's _cid
|
||||
// This is for regular id="foo" attributes that need scoping (rare case)
|
||||
// Most scoping happens via $id attribute which becomes data-id
|
||||
// Most scoping happens via $sid attribute which becomes data-sid
|
||||
// Don't double-scope if already scoped (contains :)
|
||||
if (typeof value === 'string' && value.includes(':')) {
|
||||
html.push(` id="${value}"`);
|
||||
@@ -545,13 +545,13 @@ function process_component_to_html(instruction, html, components, context) {
|
||||
// Create element with tracking ID
|
||||
html.push(`<${tagName} data-cid="${cid}"`);
|
||||
// Handle id attributes for components
|
||||
// The compiled code always generates both 'id' (scoped) and 'data-id' (base) for $id attributes
|
||||
// The compiled code always generates both 'id' (scoped) and 'data-sid' (base) for $sid attributes
|
||||
// We just pass through what the compiler gave us - NEVER regenerate
|
||||
if (props['data-id']) {
|
||||
const baseId = props['data-id'];
|
||||
if (props['data-sid']) {
|
||||
const baseId = props['data-sid'];
|
||||
// The compiled code ALWAYS sets props['id'] with the correct scoped value
|
||||
// Just use it directly - it already has the correct parent _cid baked in
|
||||
html.push(` id="${props['id']}" data-id="${baseId}"`);
|
||||
html.push(` id="${props['id']}" data-sid="${baseId}"`);
|
||||
}
|
||||
// Regular id passes through unchanged
|
||||
else if (props['id']) {
|
||||
@@ -1225,16 +1225,16 @@ class Jqhtml_Component {
|
||||
// If id provided, delegate to child component
|
||||
if (id) {
|
||||
// First check if element with scoped ID exists
|
||||
const $element = this.$id(id);
|
||||
const $element = this.$sid(id);
|
||||
if ($element.length === 0) {
|
||||
throw new Error(`[JQHTML] render("${id}") - no such id.\n` +
|
||||
`Component "${this.component_name()}" has no child element with $id="${id}".`);
|
||||
`Component "${this.component_name()}" has no child element with $sid="${id}".`);
|
||||
}
|
||||
// Element exists, check if it's a component
|
||||
const child = $element.data('_component');
|
||||
if (!child) {
|
||||
throw new Error(`[JQHTML] render("${id}") - element is not a component or does not have $redrawable attribute set.\n` +
|
||||
`Element with $id="${id}" exists but is not initialized as a component.\n` +
|
||||
`Element with $sid="${id}" exists but is not initialized as a component.\n` +
|
||||
`Add $redrawable attribute or make it a proper component.`);
|
||||
}
|
||||
return child._render();
|
||||
@@ -1455,15 +1455,15 @@ class Jqhtml_Component {
|
||||
return;
|
||||
// If id provided, delegate to child component
|
||||
if (id) {
|
||||
const $element = this.$id(id);
|
||||
const $element = this.$sid(id);
|
||||
if ($element.length === 0) {
|
||||
throw new Error(`[JQHTML] render("${id}") - no such id.\n` +
|
||||
`Component "${this.component_name()}" has no child element with $id="${id}".`);
|
||||
`Component "${this.component_name()}" has no child element with $sid="${id}".`);
|
||||
}
|
||||
const child = $element.data('_component');
|
||||
if (!child) {
|
||||
throw new Error(`[JQHTML] render("${id}") - element is not a component or does not have $redrawable attribute set.\n` +
|
||||
`Element with $id="${id}" exists but is not initialized as a component.\n` +
|
||||
`Element with $sid="${id}" exists but is not initialized as a component.\n` +
|
||||
`Add $redrawable attribute or make it a proper component.`);
|
||||
}
|
||||
return child.render();
|
||||
@@ -1511,8 +1511,26 @@ class Jqhtml_Component {
|
||||
// This happens after on_create() but before render, allowing instant first render with cached data
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// If cache_key is null, args are not serializable - skip caching
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
let uncacheable_property;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
uncacheable_property = 'cache_id()';
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
uncacheable_property = result.uncacheable_property;
|
||||
}
|
||||
// If cache_key is null, caching disabled
|
||||
if (cache_key === null) {
|
||||
// Set data-nocache attribute for debugging (shows which property prevented caching)
|
||||
if (uncacheable_property) {
|
||||
@@ -1570,8 +1588,25 @@ class Jqhtml_Component {
|
||||
// Import coordinator and storage lazily to avoid circular dependency
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
// Generate cache key (same as deduplication key)
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
let uncacheable_property;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
uncacheable_property = 'cache_id()';
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
uncacheable_property = result.uncacheable_property;
|
||||
}
|
||||
// If cache_key is null, args are not serializable - skip load deduplication and caching
|
||||
if (cache_key === null) {
|
||||
// Set data-nocache attribute for debugging (shows which property prevented caching)
|
||||
@@ -1912,7 +1947,23 @@ class Jqhtml_Component {
|
||||
if (args_changed) {
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
cache_key = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
}
|
||||
// Only use cache if args are serializable
|
||||
if (cache_key !== null) {
|
||||
const cached_data = Jqhtml_Local_Storage.get(cache_key);
|
||||
@@ -1951,7 +2002,23 @@ class Jqhtml_Component {
|
||||
if (data_changed && data_after_load !== '{}') {
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
cache_key = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
}
|
||||
// Only update cache if args are serializable
|
||||
if (cache_key !== null) {
|
||||
Jqhtml_Local_Storage.set(cache_key, this.data);
|
||||
@@ -2162,9 +2229,9 @@ class Jqhtml_Component {
|
||||
* Searches for elements with id="local_id:THIS_COMPONENT_CID"
|
||||
*
|
||||
* Example:
|
||||
* Template: <button $id="save_btn">Save</button>
|
||||
* Rendered: <button id="save_btn:abc123" data-id="save_btn">Save</button>
|
||||
* Access: this.$id('save_btn') // Returns jQuery element
|
||||
* Template: <button $sid="save_btn">Save</button>
|
||||
* Rendered: <button id="save_btn:abc123" data-sid="save_btn">Save</button>
|
||||
* Access: this.$sid('save_btn') // Returns jQuery element
|
||||
*
|
||||
* Performance: Uses native document.getElementById() when component is in DOM,
|
||||
* falls back to jQuery.find() for components not yet attached to DOM.
|
||||
@@ -2172,7 +2239,7 @@ class Jqhtml_Component {
|
||||
* @param local_id The local ID (without _cid suffix)
|
||||
* @returns jQuery element with id="local_id:_cid", or empty jQuery object if not found
|
||||
*/
|
||||
$id(local_id) {
|
||||
$sid(local_id) {
|
||||
const scopedId = `${local_id}:${this._cid}`;
|
||||
// Try getElementById first (fast path - works when component is in DOM)
|
||||
const el = document.getElementById(scopedId);
|
||||
@@ -2180,7 +2247,7 @@ class Jqhtml_Component {
|
||||
return $(el);
|
||||
}
|
||||
// Fallback: component not in DOM yet, search within component subtree
|
||||
// This allows $id() to work on components before they're appended to body
|
||||
// This allows $sid() to work on components before they're appended to body
|
||||
// Must escape the ID because it contains ':' which jQuery treats as a pseudo-selector
|
||||
return this.$.find(`#${$.escapeSelector(scopedId)}`);
|
||||
}
|
||||
@@ -2190,19 +2257,22 @@ class Jqhtml_Component {
|
||||
* Convenience method that finds element by scoped ID and returns the component instance.
|
||||
*
|
||||
* Example:
|
||||
* Template: <User_Card $id="active_user" />
|
||||
* Access: const user = this.id('active_user'); // Returns User_Card instance
|
||||
* Template: <User_Card $sid="active_user" />
|
||||
* Access: const user = this.sid('active_user'); // Returns User_Card instance
|
||||
* user.data.name // Access component's data
|
||||
*
|
||||
* To get the scoped ID string itself:
|
||||
* this.$sid('active_user').attr('id') // Returns "active_user:abc123xyz"
|
||||
*
|
||||
* @param local_id The local ID (without _cid suffix)
|
||||
* @returns Component instance or null if not found or not a component
|
||||
*/
|
||||
id(local_id) {
|
||||
const element = this.$id(local_id);
|
||||
sid(local_id) {
|
||||
const element = this.$sid(local_id);
|
||||
const component = element.data('_component');
|
||||
// If no component found but element exists, warn developer
|
||||
if (!component && element.length > 0) {
|
||||
console.warn(`Component ${this.constructor.name} tried to call .id('${local_id}') - ` +
|
||||
console.warn(`Component ${this.constructor.name} tried to call .sid('${local_id}') - ` +
|
||||
`${local_id} exists, however, it is not a component or $redrawable. ` +
|
||||
`Did you forget to add $redrawable to the tag?`);
|
||||
}
|
||||
@@ -2821,7 +2891,7 @@ function evaluate_expression(expression, component, locals = {}) {
|
||||
args: component.args,
|
||||
$: component.$,
|
||||
// Component methods
|
||||
$id: component.$id.bind(component),
|
||||
$sid: component.$sid.bind(component),
|
||||
// Locals (like $event)
|
||||
...locals
|
||||
};
|
||||
@@ -2849,7 +2919,7 @@ function evaluate_handler(expression, component) {
|
||||
// Otherwise treat as inline code
|
||||
try {
|
||||
return new Function('$event', `
|
||||
const { data, args, $, emit, $id } = this;
|
||||
const { data, args, $, emit, $sid } = this;
|
||||
${expression}
|
||||
`).bind(component);
|
||||
}
|
||||
@@ -4147,7 +4217,7 @@ function init(jQuery) {
|
||||
}
|
||||
}
|
||||
// Version - will be replaced during build with actual version from package.json
|
||||
const version = '2.2.217';
|
||||
const version = '2.2.218';
|
||||
// Default export with all functionality
|
||||
const jqhtml = {
|
||||
// Core
|
||||
|
||||
2
node_modules/@jqhtml/core/dist/index.js.map
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/core/dist/index.js.map
generated
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
0
node_modules/@jqhtml/core/dist/instruction-processor.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/instruction-processor.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/instruction-processor.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/instruction-processor.d.ts.map
generated
vendored
Executable file → Normal file
132
node_modules/@jqhtml/core/dist/jqhtml-core.esm.js
generated
vendored
Executable file → Normal file
132
node_modules/@jqhtml/core/dist/jqhtml-core.esm.js
generated
vendored
Executable file → Normal file
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* JQHTML Core v2.2.217
|
||||
* JQHTML Core v2.2.218
|
||||
* (c) 2025 JQHTML Team
|
||||
* Released under the MIT License
|
||||
*/
|
||||
@@ -500,7 +500,7 @@ function process_tag_to_html(instruction, html, tagElements, components, context
|
||||
if (key === 'id' && tid) {
|
||||
// Special handling for id attribute - scope to parent component's _cid
|
||||
// This is for regular id="foo" attributes that need scoping (rare case)
|
||||
// Most scoping happens via $id attribute which becomes data-id
|
||||
// Most scoping happens via $sid attribute which becomes data-sid
|
||||
// Don't double-scope if already scoped (contains :)
|
||||
if (typeof value === 'string' && value.includes(':')) {
|
||||
html.push(` id="${value}"`);
|
||||
@@ -550,13 +550,13 @@ function process_component_to_html(instruction, html, components, context) {
|
||||
// Create element with tracking ID
|
||||
html.push(`<${tagName} data-cid="${cid}"`);
|
||||
// Handle id attributes for components
|
||||
// The compiled code always generates both 'id' (scoped) and 'data-id' (base) for $id attributes
|
||||
// The compiled code always generates both 'id' (scoped) and 'data-sid' (base) for $sid attributes
|
||||
// We just pass through what the compiler gave us - NEVER regenerate
|
||||
if (props['data-id']) {
|
||||
const baseId = props['data-id'];
|
||||
if (props['data-sid']) {
|
||||
const baseId = props['data-sid'];
|
||||
// The compiled code ALWAYS sets props['id'] with the correct scoped value
|
||||
// Just use it directly - it already has the correct parent _cid baked in
|
||||
html.push(` id="${props['id']}" data-id="${baseId}"`);
|
||||
html.push(` id="${props['id']}" data-sid="${baseId}"`);
|
||||
}
|
||||
// Regular id passes through unchanged
|
||||
else if (props['id']) {
|
||||
@@ -1230,16 +1230,16 @@ class Jqhtml_Component {
|
||||
// If id provided, delegate to child component
|
||||
if (id) {
|
||||
// First check if element with scoped ID exists
|
||||
const $element = this.$id(id);
|
||||
const $element = this.$sid(id);
|
||||
if ($element.length === 0) {
|
||||
throw new Error(`[JQHTML] render("${id}") - no such id.\n` +
|
||||
`Component "${this.component_name()}" has no child element with $id="${id}".`);
|
||||
`Component "${this.component_name()}" has no child element with $sid="${id}".`);
|
||||
}
|
||||
// Element exists, check if it's a component
|
||||
const child = $element.data('_component');
|
||||
if (!child) {
|
||||
throw new Error(`[JQHTML] render("${id}") - element is not a component or does not have $redrawable attribute set.\n` +
|
||||
`Element with $id="${id}" exists but is not initialized as a component.\n` +
|
||||
`Element with $sid="${id}" exists but is not initialized as a component.\n` +
|
||||
`Add $redrawable attribute or make it a proper component.`);
|
||||
}
|
||||
return child._render();
|
||||
@@ -1460,15 +1460,15 @@ class Jqhtml_Component {
|
||||
return;
|
||||
// If id provided, delegate to child component
|
||||
if (id) {
|
||||
const $element = this.$id(id);
|
||||
const $element = this.$sid(id);
|
||||
if ($element.length === 0) {
|
||||
throw new Error(`[JQHTML] render("${id}") - no such id.\n` +
|
||||
`Component "${this.component_name()}" has no child element with $id="${id}".`);
|
||||
`Component "${this.component_name()}" has no child element with $sid="${id}".`);
|
||||
}
|
||||
const child = $element.data('_component');
|
||||
if (!child) {
|
||||
throw new Error(`[JQHTML] render("${id}") - element is not a component or does not have $redrawable attribute set.\n` +
|
||||
`Element with $id="${id}" exists but is not initialized as a component.\n` +
|
||||
`Element with $sid="${id}" exists but is not initialized as a component.\n` +
|
||||
`Add $redrawable attribute or make it a proper component.`);
|
||||
}
|
||||
return child.render();
|
||||
@@ -1516,8 +1516,26 @@ class Jqhtml_Component {
|
||||
// This happens after on_create() but before render, allowing instant first render with cached data
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// If cache_key is null, args are not serializable - skip caching
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
let uncacheable_property;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
uncacheable_property = 'cache_id()';
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
uncacheable_property = result.uncacheable_property;
|
||||
}
|
||||
// If cache_key is null, caching disabled
|
||||
if (cache_key === null) {
|
||||
// Set data-nocache attribute for debugging (shows which property prevented caching)
|
||||
if (uncacheable_property) {
|
||||
@@ -1575,8 +1593,25 @@ class Jqhtml_Component {
|
||||
// Import coordinator and storage lazily to avoid circular dependency
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
// Generate cache key (same as deduplication key)
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
let uncacheable_property;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
uncacheable_property = 'cache_id()';
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
uncacheable_property = result.uncacheable_property;
|
||||
}
|
||||
// If cache_key is null, args are not serializable - skip load deduplication and caching
|
||||
if (cache_key === null) {
|
||||
// Set data-nocache attribute for debugging (shows which property prevented caching)
|
||||
@@ -1917,7 +1952,23 @@ class Jqhtml_Component {
|
||||
if (args_changed) {
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
cache_key = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
}
|
||||
// Only use cache if args are serializable
|
||||
if (cache_key !== null) {
|
||||
const cached_data = Jqhtml_Local_Storage.get(cache_key);
|
||||
@@ -1956,7 +2007,23 @@ class Jqhtml_Component {
|
||||
if (data_changed && data_after_load !== '{}') {
|
||||
const { Load_Coordinator } = await Promise.resolve().then(function () { return loadCoordinator; });
|
||||
const { Jqhtml_Local_Storage } = await Promise.resolve().then(function () { return localStorage$1; });
|
||||
const { key: cache_key, uncacheable_property } = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
// Check if component implements cache_id() for custom cache key
|
||||
let cache_key = null;
|
||||
if (typeof this.cache_id === 'function') {
|
||||
try {
|
||||
const custom_cache_id = this.cache_id();
|
||||
cache_key = `${this.component_name()}::${String(custom_cache_id)}`;
|
||||
}
|
||||
catch (error) {
|
||||
// cache_id() threw error - disable caching
|
||||
cache_key = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use standard args-based cache key generation
|
||||
const result = Load_Coordinator.generate_invocation_key(this.component_name(), this.args);
|
||||
cache_key = result.key;
|
||||
}
|
||||
// Only update cache if args are serializable
|
||||
if (cache_key !== null) {
|
||||
Jqhtml_Local_Storage.set(cache_key, this.data);
|
||||
@@ -2167,9 +2234,9 @@ class Jqhtml_Component {
|
||||
* Searches for elements with id="local_id:THIS_COMPONENT_CID"
|
||||
*
|
||||
* Example:
|
||||
* Template: <button $id="save_btn">Save</button>
|
||||
* Rendered: <button id="save_btn:abc123" data-id="save_btn">Save</button>
|
||||
* Access: this.$id('save_btn') // Returns jQuery element
|
||||
* Template: <button $sid="save_btn">Save</button>
|
||||
* Rendered: <button id="save_btn:abc123" data-sid="save_btn">Save</button>
|
||||
* Access: this.$sid('save_btn') // Returns jQuery element
|
||||
*
|
||||
* Performance: Uses native document.getElementById() when component is in DOM,
|
||||
* falls back to jQuery.find() for components not yet attached to DOM.
|
||||
@@ -2177,7 +2244,7 @@ class Jqhtml_Component {
|
||||
* @param local_id The local ID (without _cid suffix)
|
||||
* @returns jQuery element with id="local_id:_cid", or empty jQuery object if not found
|
||||
*/
|
||||
$id(local_id) {
|
||||
$sid(local_id) {
|
||||
const scopedId = `${local_id}:${this._cid}`;
|
||||
// Try getElementById first (fast path - works when component is in DOM)
|
||||
const el = document.getElementById(scopedId);
|
||||
@@ -2185,7 +2252,7 @@ class Jqhtml_Component {
|
||||
return $(el);
|
||||
}
|
||||
// Fallback: component not in DOM yet, search within component subtree
|
||||
// This allows $id() to work on components before they're appended to body
|
||||
// This allows $sid() to work on components before they're appended to body
|
||||
// Must escape the ID because it contains ':' which jQuery treats as a pseudo-selector
|
||||
return this.$.find(`#${$.escapeSelector(scopedId)}`);
|
||||
}
|
||||
@@ -2195,19 +2262,22 @@ class Jqhtml_Component {
|
||||
* Convenience method that finds element by scoped ID and returns the component instance.
|
||||
*
|
||||
* Example:
|
||||
* Template: <User_Card $id="active_user" />
|
||||
* Access: const user = this.id('active_user'); // Returns User_Card instance
|
||||
* Template: <User_Card $sid="active_user" />
|
||||
* Access: const user = this.sid('active_user'); // Returns User_Card instance
|
||||
* user.data.name // Access component's data
|
||||
*
|
||||
* To get the scoped ID string itself:
|
||||
* this.$sid('active_user').attr('id') // Returns "active_user:abc123xyz"
|
||||
*
|
||||
* @param local_id The local ID (without _cid suffix)
|
||||
* @returns Component instance or null if not found or not a component
|
||||
*/
|
||||
id(local_id) {
|
||||
const element = this.$id(local_id);
|
||||
sid(local_id) {
|
||||
const element = this.$sid(local_id);
|
||||
const component = element.data('_component');
|
||||
// If no component found but element exists, warn developer
|
||||
if (!component && element.length > 0) {
|
||||
console.warn(`Component ${this.constructor.name} tried to call .id('${local_id}') - ` +
|
||||
console.warn(`Component ${this.constructor.name} tried to call .sid('${local_id}') - ` +
|
||||
`${local_id} exists, however, it is not a component or $redrawable. ` +
|
||||
`Did you forget to add $redrawable to the tag?`);
|
||||
}
|
||||
@@ -2826,7 +2896,7 @@ function evaluate_expression(expression, component, locals = {}) {
|
||||
args: component.args,
|
||||
$: component.$,
|
||||
// Component methods
|
||||
$id: component.$id.bind(component),
|
||||
$sid: component.$sid.bind(component),
|
||||
// Locals (like $event)
|
||||
...locals
|
||||
};
|
||||
@@ -2854,7 +2924,7 @@ function evaluate_handler(expression, component) {
|
||||
// Otherwise treat as inline code
|
||||
try {
|
||||
return new Function('$event', `
|
||||
const { data, args, $, emit, $id } = this;
|
||||
const { data, args, $, emit, $sid } = this;
|
||||
${expression}
|
||||
`).bind(component);
|
||||
}
|
||||
@@ -4152,7 +4222,7 @@ function init(jQuery) {
|
||||
}
|
||||
}
|
||||
// Version - will be replaced during build with actual version from package.json
|
||||
const version = '2.2.217';
|
||||
const version = '2.2.218';
|
||||
// Default export with all functionality
|
||||
const jqhtml = {
|
||||
// Core
|
||||
|
||||
2
node_modules/@jqhtml/core/dist/jqhtml-core.esm.js.map
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/core/dist/jqhtml-core.esm.js.map
generated
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
0
node_modules/@jqhtml/core/dist/jqhtml-debug.esm.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/jqhtml-debug.esm.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/jqhtml-debug.esm.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/jqhtml-debug.esm.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/jquery-plugin.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/jquery-plugin.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/jquery-plugin.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/jquery-plugin.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/lifecycle-manager.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/lifecycle-manager.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/lifecycle-manager.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/lifecycle-manager.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/load-coordinator.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/load-coordinator.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/load-coordinator.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/load-coordinator.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/local-storage.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/local-storage.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/local-storage.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/local-storage.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/template-renderer.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/template-renderer.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/template-renderer.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/core/dist/template-renderer.d.ts.map
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/core/package.json
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/core/package.json
generated
vendored
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@jqhtml/core",
|
||||
"version": "2.2.217",
|
||||
"version": "2.2.218",
|
||||
"description": "Core runtime library for JQHTML",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
|
||||
26
node_modules/@jqhtml/parser/LLM_REFERENCE.md
generated
vendored
26
node_modules/@jqhtml/parser/LLM_REFERENCE.md
generated
vendored
@@ -177,15 +177,15 @@ JQHTML uses the `$` prefix as a shorthand for data attributes with special handl
|
||||
2. For debugging visibility, if the value is a string or number, it's also set as a DOM attribute
|
||||
3. Objects and arrays are stored in `.data()` but not visible in DOM
|
||||
|
||||
#### Special Case: `$id="name"` → Scoped IDs
|
||||
#### Special Case: `$sid="name"` → Scoped IDs
|
||||
|
||||
The `$id` attribute has special handling for component-scoped element selection:
|
||||
The `$sid` attribute has special handling for component-scoped element selection:
|
||||
|
||||
```jqhtml
|
||||
<Define:UserCard>
|
||||
<div $id="container">
|
||||
<input $id="username" type="text" />
|
||||
<button $id="submit">Submit</button>
|
||||
<div $sid="container">
|
||||
<input $sid="username" type="text" />
|
||||
<button $sid="submit">Submit</button>
|
||||
</div>
|
||||
</Define:UserCard>
|
||||
```
|
||||
@@ -207,8 +207,8 @@ function render(_cid) {
|
||||
class UserCard extends Component {
|
||||
init() {
|
||||
// Find scoped elements
|
||||
const $username = this.$id('username'); // Returns $('#username:123')
|
||||
const $submit = this.$id('submit'); // Returns $('#submit:123')
|
||||
const $username = this.$sid('username'); // Returns $('#username:123')
|
||||
const $submit = this.$sid('submit'); // Returns $('#submit:123')
|
||||
|
||||
$submit.on('click', () => {
|
||||
const value = $username.val();
|
||||
@@ -224,15 +224,15 @@ Component IDs flow through lexical scope naturally:
|
||||
|
||||
```jqhtml
|
||||
<Define:ParentComponent>
|
||||
<div $id="parent-element"> <!-- Gets ParentComponent's _cid -->
|
||||
<div $sid="parent-element"> <!-- Gets ParentComponent's _cid -->
|
||||
<ChildComponent>
|
||||
<div $id="slot-element" /> <!-- Also gets ParentComponent's _cid -->
|
||||
<div $sid="slot-element" /> <!-- Also gets ParentComponent's _cid -->
|
||||
</ChildComponent>
|
||||
</div>
|
||||
</Define:ParentComponent>
|
||||
|
||||
<Define:ChildComponent>
|
||||
<div $id="child-element"> <!-- Gets ChildComponent's _cid -->
|
||||
<div $sid="child-element"> <!-- Gets ChildComponent's _cid -->
|
||||
<%= content() %> <!-- Slot content preserves parent's _cid -->
|
||||
</div>
|
||||
</Define:ChildComponent>
|
||||
@@ -374,9 +374,9 @@ The `@` prefix binds event handlers:
|
||||
|
||||
<!-- Wrapper that adds behavior to innerHTML -->
|
||||
<Define:Collapsible>
|
||||
<div class="collapsible" $id="wrapper">
|
||||
<div class="collapsible" $sid="wrapper">
|
||||
<button $onclick="toggle">Toggle</button>
|
||||
<div class="content" $id="content">
|
||||
<div class="content" $sid="content">
|
||||
<%= content() %> <!-- Wrapped innerHTML -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -481,7 +481,7 @@ Templates compile to three instruction types:
|
||||
{tag: ["div", {"class": "user-card"}, false]}
|
||||
{tag: ["img", {"src": "/avatar.jpg", "alt": "User"}, true]}
|
||||
{tag: ["button", {"onclick": this.handleClick}, false]}
|
||||
{tag: ["div", {"data-id": "header"}, false]} // $id becomes data-id
|
||||
{tag: ["div", {"data-sid": "header"}, false]} // $id becomes data-id
|
||||
```
|
||||
|
||||
### 2. Component Instruction
|
||||
|
||||
2
node_modules/@jqhtml/parser/README.md
generated
vendored
2
node_modules/@jqhtml/parser/README.md
generated
vendored
@@ -390,7 +390,7 @@ These patterns inform v2 implementation decisions, particularly around maintaini
|
||||
- **Expressions**: `<%= expression %>` for output
|
||||
- **Bindings**: `:text`, `:value`, `:class`, `:style` for data binding
|
||||
- **Events**: `@click`, `@change`, etc. for event handlers
|
||||
- **Scoped IDs**: `$id` attribute for component-scoped IDs
|
||||
- **Scoped IDs**: `$sid` attribute for component-scoped IDs
|
||||
|
||||
### Instruction Format
|
||||
|
||||
|
||||
0
node_modules/@jqhtml/parser/dist/ast.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/ast.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/ast.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/ast.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/ast.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/ast.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/ast.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/ast.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/codegen.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/codegen.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/codegen.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/codegen.d.ts.map
generated
vendored
Executable file → Normal file
22
node_modules/@jqhtml/parser/dist/codegen.js
generated
vendored
Executable file → Normal file
22
node_modules/@jqhtml/parser/dist/codegen.js
generated
vendored
Executable file → Normal file
@@ -1042,14 +1042,14 @@ export class CodeGenerator {
|
||||
const entries = Object.entries(attrs).flatMap(([key, value]) => {
|
||||
// Convert 'tag' to '_tag' for component invocations
|
||||
const attrKey = key === 'tag' ? '_tag' : key;
|
||||
// Special handling for data-id attribute (from $id) - create scoped id
|
||||
// NOTE: Parser converts $id="foo" → data-id="foo" so we can distinguish from regular id
|
||||
// This generates: id="foo:PARENT_CID" data-id="foo"
|
||||
// Special handling for data-sid attribute (from $sid) - create scoped id
|
||||
// NOTE: Parser converts $sid="foo" → data-sid="foo" so we can distinguish from regular id
|
||||
// This generates: id="foo:PARENT_CID" data-sid="foo"
|
||||
// The :PARENT_CID scoping happens at runtime in instruction-processor.ts
|
||||
if (key === 'data-id') {
|
||||
if (key === 'data-sid') {
|
||||
const id_entries = [];
|
||||
if (value && typeof value === 'object' && value.interpolated) {
|
||||
// Interpolated $id like $id="user<%= index %>"
|
||||
// Interpolated $sid like $sid="user<%= index %>"
|
||||
const parts = value.parts.map((part) => {
|
||||
if (part.type === 'text') {
|
||||
return this.escape_string(part.value);
|
||||
@@ -1060,19 +1060,19 @@ export class CodeGenerator {
|
||||
});
|
||||
const base_id = parts.join(' + ');
|
||||
id_entries.push(`"id": ${base_id} + ":" + this._cid`);
|
||||
id_entries.push(`"data-id": ${base_id}`);
|
||||
id_entries.push(`"data-sid": ${base_id}`);
|
||||
}
|
||||
else if (value && typeof value === 'object' && value.quoted) {
|
||||
// Quoted $id like $id="static"
|
||||
// Quoted $sid like $sid="static"
|
||||
const base_id = this.escape_string(value.value);
|
||||
id_entries.push(`"id": ${base_id} + ":" + this._cid`);
|
||||
id_entries.push(`"data-id": ${base_id}`);
|
||||
id_entries.push(`"data-sid": ${base_id}`);
|
||||
}
|
||||
else {
|
||||
// Simple $id like $id="username" or expression like $id=someVar
|
||||
// Simple $sid like $sid="username" or expression like $sid=someVar
|
||||
const base_id = this.escape_string(String(value));
|
||||
id_entries.push(`"id": ${base_id} + ":" + this._cid`);
|
||||
id_entries.push(`"data-id": ${base_id}`);
|
||||
id_entries.push(`"data-sid": ${base_id}`);
|
||||
}
|
||||
return id_entries;
|
||||
}
|
||||
@@ -1348,7 +1348,7 @@ export class CodeGenerator {
|
||||
for (const [name, component] of this.components) {
|
||||
code += `// Component: ${name}\n`;
|
||||
code += `jqhtml_components.set('${name}', {\n`;
|
||||
code += ` _jqhtml_version: '2.2.217',\n`; // Version will be replaced during build
|
||||
code += ` _jqhtml_version: '2.2.218',\n`; // Version will be replaced during build
|
||||
code += ` name: '${name}',\n`;
|
||||
code += ` tag: '${component.tagName}',\n`;
|
||||
code += ` defaultAttributes: ${this.serializeAttributeObject(component.defaultAttributes)},\n`;
|
||||
|
||||
2
node_modules/@jqhtml/parser/dist/codegen.js.map
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/parser/dist/codegen.js.map
generated
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
0
node_modules/@jqhtml/parser/dist/compiler.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/compiler.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/compiler.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/compiler.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/compiler.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/compiler.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/compiler.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/compiler.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/errors.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/errors.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/errors.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/errors.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/errors.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/errors.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/errors.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/errors.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/index.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/index.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/index.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/index.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/index.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/index.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/index.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/index.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/integration.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/integration.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/integration.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/integration.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/integration.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/integration.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/integration.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/integration.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/lexer.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/lexer.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/lexer.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/lexer.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/lexer.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/lexer.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/lexer.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/lexer.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/parser.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/parser.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/parser.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/parser.d.ts.map
generated
vendored
Executable file → Normal file
14
node_modules/@jqhtml/parser/dist/parser.js
generated
vendored
Executable file → Normal file
14
node_modules/@jqhtml/parser/dist/parser.js
generated
vendored
Executable file → Normal file
@@ -109,9 +109,9 @@ export class Parser {
|
||||
}
|
||||
while (!this.check(TokenType.GT) && !this.is_at_end()) {
|
||||
const attr_name = this.consume(TokenType.ATTR_NAME, 'Expected attribute name');
|
||||
// Validate that $id is not used in Define tags
|
||||
if (attr_name.value === '$id') {
|
||||
throw syntaxError('$id is not allowed in <Define:> tags. Component definitions cannot have scoped IDs.', attr_name.line, attr_name.column, this.source, this.filename);
|
||||
// Validate that $sid is not used in Define tags
|
||||
if (attr_name.value === '$sid') {
|
||||
throw syntaxError('$sid is not allowed in <Define:> tags. Component definitions cannot have scoped IDs.', attr_name.line, attr_name.column, this.source, this.filename);
|
||||
}
|
||||
this.consume(TokenType.EQUALS, 'Expected =');
|
||||
const attr_value = this.parse_attribute_value();
|
||||
@@ -535,10 +535,10 @@ export class Parser {
|
||||
}
|
||||
// Handle special attribute prefixes
|
||||
if (name.startsWith('$')) {
|
||||
// Special case: $id becomes data-id (needed for scoped ID system)
|
||||
// Special case: $sid becomes data-sid (needed for scoped ID system)
|
||||
// All other $ attributes stay as-is (handled by instruction-processor.ts)
|
||||
if (name === '$id') {
|
||||
name = 'data-id';
|
||||
if (name === '$sid') {
|
||||
name = 'data-sid';
|
||||
}
|
||||
// Keep $ prefix for other attributes - they get stored via .data() at runtime
|
||||
// Keep the value object intact to preserve quoted/unquoted distinction
|
||||
@@ -781,7 +781,7 @@ export class Parser {
|
||||
' Or set attributes in on_ready() using jQuery:\n' +
|
||||
' ✅ <tag $id="my_element">\n' +
|
||||
' on_ready() {\n' +
|
||||
' if (this.args.required) this.$id(\'my_element\').attr(\'required\', true);\n' +
|
||||
' if (this.args.required) this.$sid(\'my_element\').attr(\'required\', true);\n' +
|
||||
' }';
|
||||
throw error;
|
||||
}
|
||||
|
||||
2
node_modules/@jqhtml/parser/dist/parser.js.map
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/parser/dist/parser.js.map
generated
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
0
node_modules/@jqhtml/parser/dist/runtime.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/runtime.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/runtime.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/runtime.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/runtime.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/runtime.js
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/runtime.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/parser/dist/runtime.js.map
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/parser/package.json
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/parser/package.json
generated
vendored
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@jqhtml/parser",
|
||||
"version": "2.2.217",
|
||||
"version": "2.2.218",
|
||||
"description": "JQHTML template parser - converts templates to JavaScript",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
||||
8
node_modules/@jqhtml/router/LLM_REFERENCE.md
generated
vendored
8
node_modules/@jqhtml/router/LLM_REFERENCE.md
generated
vendored
@@ -66,7 +66,7 @@ class MainLayout extends Jqhtml_Layout {
|
||||
async on_render() {
|
||||
this.$.html(`
|
||||
<header>Navigation</header>
|
||||
<main $id="content"></main> <!-- REQUIRED: Routes render here -->
|
||||
<main $sid="content"></main> <!-- REQUIRED: Routes render here -->
|
||||
<footer>Footer</footer>
|
||||
`);
|
||||
}
|
||||
@@ -94,7 +94,7 @@ class MainLayout extends Jqhtml_Layout {
|
||||
### 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
|
||||
- `$sid="content"` element required for route injection point
|
||||
|
||||
## SPA Application Container
|
||||
|
||||
@@ -273,7 +273,7 @@ class DashboardRoute extends Jqhtml_Route {
|
||||
this.$.html(`
|
||||
<div class="dashboard">
|
||||
<Sidebar />
|
||||
<div $id="dashboard-content">
|
||||
<div $sid="dashboard-content">
|
||||
<!-- Sub-routes could render here -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -343,7 +343,7 @@ class SearchRoute extends Jqhtml_Route {
|
||||
```
|
||||
|
||||
## Critical Invariants
|
||||
1. Layouts must have element with `$id="content"` for route injection
|
||||
1. Layouts must have element with `$sid="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
|
||||
|
||||
0
node_modules/@jqhtml/router/dist/index.cjs
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/index.cjs
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/index.cjs.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/index.cjs.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/index.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/index.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/index.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/index.d.ts.map
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/router/dist/index.js
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/router/dist/index.js
generated
vendored
Executable file → Normal file
@@ -878,7 +878,7 @@ class Jqhtml_Layout extends Jqhtml_Component {
|
||||
* Must contain an element with $id="content"
|
||||
*/
|
||||
$content() {
|
||||
const $content = this.$id('content');
|
||||
const $content = this.$sid('content');
|
||||
if (!$content.length) {
|
||||
throw new Error(`Layout ${this.constructor.name} must have an element with $id="content"`);
|
||||
}
|
||||
|
||||
0
node_modules/@jqhtml/router/dist/index.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/index.js.map
generated
vendored
Executable file → Normal file
4
node_modules/@jqhtml/router/dist/jqhtml-router.esm.js
generated
vendored
Executable file → Normal file
4
node_modules/@jqhtml/router/dist/jqhtml-router.esm.js
generated
vendored
Executable file → Normal file
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* JQHTML Router v2.2.217
|
||||
* JQHTML Router v2.2.218
|
||||
* (c) 2025 JQHTML Team
|
||||
* Released under the MIT License
|
||||
*/
|
||||
@@ -883,7 +883,7 @@ class Jqhtml_Layout extends Jqhtml_Component {
|
||||
* Must contain an element with $id="content"
|
||||
*/
|
||||
$content() {
|
||||
const $content = this.$id('content');
|
||||
const $content = this.$sid('content');
|
||||
if (!$content.length) {
|
||||
throw new Error(`Layout ${this.constructor.name} must have an element with $id="content"`);
|
||||
}
|
||||
|
||||
0
node_modules/@jqhtml/router/dist/jqhtml-router.esm.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/jqhtml-router.esm.js.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/layout.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/layout.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/layout.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/layout.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/route.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/route.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/route.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/route.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/router.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/router.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/router.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/router.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/spa.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/spa.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/spa.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/spa.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/types.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/types.d.ts
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/types.d.ts.map
generated
vendored
Executable file → Normal file
0
node_modules/@jqhtml/router/dist/types.d.ts.map
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/router/package.json
generated
vendored
Executable file → Normal file
2
node_modules/@jqhtml/router/package.json
generated
vendored
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@jqhtml/router",
|
||||
"version": "2.2.217",
|
||||
"version": "2.2.218",
|
||||
"description": "Client-side routing for JQHTML applications",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
||||
2
node_modules/@jqhtml/vscode-extension/.version
generated
vendored
2
node_modules/@jqhtml/vscode-extension/.version
generated
vendored
@@ -1 +1 @@
|
||||
2.2.217
|
||||
2.2.218
|
||||
|
||||
4
node_modules/@jqhtml/vscode-extension/LLM_REFERENCE.md
generated
vendored
4
node_modules/@jqhtml/vscode-extension/LLM_REFERENCE.md
generated
vendored
@@ -117,7 +117,7 @@ Future versions may include:
|
||||
|
||||
### Component Usage
|
||||
```jqhtml
|
||||
<MyComponent $id="instance" @click="handleClick">
|
||||
<MyComponent $sid="instance" @click="handleClick">
|
||||
<#slot>Content here</#slot>
|
||||
</MyComponent>
|
||||
```
|
||||
@@ -125,7 +125,7 @@ Future versions may include:
|
||||
### Control Flow
|
||||
```jqhtml
|
||||
<% for (let item of this.data.items): %>
|
||||
<div $id="item_<%= item.id %>">
|
||||
<div $sid="item_<%= item.id %>">
|
||||
<%= item.name %>
|
||||
</div>
|
||||
<% endfor; %>
|
||||
|
||||
6
node_modules/@jqhtml/vscode-extension/README.md
generated
vendored
6
node_modules/@jqhtml/vscode-extension/README.md
generated
vendored
@@ -14,7 +14,7 @@ Full syntax highlighting for all JQHTML constructs:
|
||||
- **Slots**: `<#slotname>` with let:prop support
|
||||
- **Data Bindings**: `:property="value"`
|
||||
- **Event Handlers**: `@click="handler"`
|
||||
- **Special Attributes**: `$id="name"`, `$property="value"`
|
||||
- **Special Attributes**: `$sid="name"`, `$property="value"`
|
||||
- **Components**: `<MyComponent />`
|
||||
- **Comments**: `<%-- comment --%>`
|
||||
|
||||
@@ -38,7 +38,7 @@ Quick snippets for common patterns:
|
||||
| `ifelse` | If-else |
|
||||
| `for` | For loop |
|
||||
| `exp` | Expression `<%= %>` |
|
||||
| `$id` | Scoped ID attribute |
|
||||
| `$sid` | Scoped ID attribute |
|
||||
| `:prop` | Property binding |
|
||||
| `@event` | Event handler |
|
||||
| `slot` | Named slot |
|
||||
@@ -81,7 +81,7 @@ All JQHTML syntax is highlighted with semantic colors:
|
||||
|
||||
```jqhtml
|
||||
<Define:UserCard>
|
||||
<div class="user-card" $id="card">
|
||||
<div class="user-card" $sid="card">
|
||||
<h2><%= this.data.name %></h2>
|
||||
|
||||
<% if (this.data.isAdmin) { %>
|
||||
|
||||
BIN
node_modules/@jqhtml/vscode-extension/jqhtml-vscode-extension-2.2.217.vsix → node_modules/@jqhtml/vscode-extension/jqhtml-vscode-extension-2.2.218.vsix
generated
vendored
Executable file → Normal file
BIN
node_modules/@jqhtml/vscode-extension/jqhtml-vscode-extension-2.2.217.vsix → node_modules/@jqhtml/vscode-extension/jqhtml-vscode-extension-2.2.218.vsix
generated
vendored
Executable file → Normal file
Binary file not shown.
2
node_modules/@jqhtml/vscode-extension/out/definitionProvider.js
generated
vendored
2
node_modules/@jqhtml/vscode-extension/out/definitionProvider.js
generated
vendored
@@ -678,7 +678,7 @@ class JqhtmlHoverProvider {
|
||||
const markdown = new vscode.MarkdownString();
|
||||
markdown.appendMarkdown(`**\`$redrawable\` Attribute**\n\n`);
|
||||
markdown.appendMarkdown(`Converts this tag into an anonymous component class, allowing it to be redrawn on demand.\n\n`);
|
||||
markdown.appendMarkdown(`**Usage:**\n\`\`\`javascript\nthis.$id('element_id').render()\n\`\`\`\n\n`);
|
||||
markdown.appendMarkdown(`**Usage:**\n\`\`\`javascript\nthis.$sid('element_id').render()\n\`\`\`\n\n`);
|
||||
markdown.appendMarkdown(`Call \`render()\` on the element's scoped ID to trigger a re-render of just this element without affecting the rest of the component.`);
|
||||
const wordRange = new vscode.Range(new vscode.Position(position.line, line.indexOf('$redrawable')), new vscode.Position(position.line, line.indexOf('$redrawable') + '$redrawable'.length));
|
||||
return new vscode.Hover(markdown, wordRange);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user