@hyperfixi/core 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/hyperscript-api.d.ts +2 -0
- package/dist/ast-utils/index.d.ts +1 -1
- package/dist/ast-utils/index.js +11 -1
- package/dist/ast-utils/index.mjs +11 -1
- package/dist/ast-utils/interchange/index.d.ts +1 -1
- package/dist/ast-utils/interchange/lsp.d.ts +4 -1
- package/dist/behaviors/index.js +13 -5
- package/dist/behaviors/index.mjs +13 -5
- package/dist/bundle-generator/index.js +9 -0
- package/dist/bundle-generator/index.mjs +9 -0
- package/dist/chunks/{bridge-I6ceoWxV.js → bridge-CZfeDyEz.js} +2 -2
- package/dist/chunks/browser-modular-CwTpxqdt.js +2 -0
- package/dist/chunks/feature-eventsource-B5F2-H1r.js +2 -0
- package/dist/chunks/feature-sockets-ClOH7vk7.js +2 -0
- package/dist/chunks/feature-webworker-3bAp0ac9.js +2 -0
- package/dist/commands/index.js +27 -6
- package/dist/commands/index.mjs +27 -6
- package/dist/debug/debug-controller.d.ts +62 -0
- package/dist/debug/index.d.ts +5 -0
- package/dist/expressions/index.js +16 -52
- package/dist/expressions/index.mjs +16 -52
- package/dist/hyperfixi-classic-i18n.js +1 -1
- package/dist/hyperfixi-hx.js +1 -1
- package/dist/hyperfixi-hybrid-complete.js +1 -1
- package/dist/hyperfixi-minimal.js +1 -1
- package/dist/hyperfixi-multilingual.js +1 -1
- package/dist/hyperfixi-standard.js +1 -1
- package/dist/hyperfixi.js +1 -1
- package/dist/hyperfixi.mjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +10112 -6941
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +10111 -6942
- package/dist/lokascript-browser-classic-i18n.js +1 -1
- package/dist/lokascript-browser-minimal.js +1 -1
- package/dist/lokascript-browser-standard.js +1 -1
- package/dist/lokascript-browser.js +1 -1
- package/dist/lokascript-hybrid-complete.js +1 -1
- package/dist/lokascript-hybrid-hx.js +1 -1
- package/dist/lokascript-multilingual.js +1 -1
- package/dist/metadata.d.ts +4 -4
- package/dist/metadata.js +4 -4
- package/dist/metadata.mjs +4 -4
- package/dist/parser/full-parser.js +12 -31
- package/dist/parser/full-parser.mjs +12 -31
- package/dist/parser/hybrid/index.js +35 -2
- package/dist/parser/hybrid/index.mjs +35 -2
- package/dist/parser/hybrid/parser-core.d.ts +1 -0
- package/dist/parser/hybrid/parser-core.js +35 -2
- package/dist/parser/hybrid/parser-core.mjs +35 -2
- package/dist/parser/hybrid/tokenizer.js +5 -0
- package/dist/parser/hybrid/tokenizer.mjs +5 -0
- package/dist/parser/hybrid-parser.js +35 -2
- package/dist/parser/hybrid-parser.mjs +35 -2
- package/dist/registry/index.js +16 -52
- package/dist/registry/index.mjs +16 -52
- package/dist/runtime/runtime-base.d.ts +1 -0
- package/package.json +5 -5
- package/dist/chunks/browser-modular-Dv6PAV3c.js +0 -2
- package/dist/chunks/feature-eventsource-DWb514fy.js +0 -2
- package/dist/chunks/feature-sockets-3PFuvCVY.js +0 -2
- package/dist/chunks/feature-webworker-DTm_eh-E.js +0 -2
|
@@ -498,8 +498,9 @@ const SPECIAL_DOM_PROPERTIES = {
|
|
|
498
498
|
outerhtml: el => el.outerHTML,
|
|
499
499
|
value: el => (isFormElement(el) ? el.value : undefined),
|
|
500
500
|
checked: el => (isInputElement(el) ? el.checked : undefined),
|
|
501
|
-
disabled: el => (
|
|
501
|
+
disabled: el => ('disabled' in el ? el.disabled : undefined),
|
|
502
502
|
selected: el => (isOptionElement(el) ? el.selected : undefined),
|
|
503
|
+
tabindex: el => (isHTMLElement$1(el) ? el.tabIndex : undefined),
|
|
503
504
|
hidden: el => (isHTMLElement$1(el) ? el.hidden : undefined),
|
|
504
505
|
style: el => getComputedStyle(el),
|
|
505
506
|
children: el => Array.from(el.children),
|
|
@@ -508,7 +509,19 @@ const SPECIAL_DOM_PROPERTIES = {
|
|
|
508
509
|
lastchild: el => el.lastElementChild,
|
|
509
510
|
nextsibling: el => el.nextElementSibling,
|
|
510
511
|
previoussibling: el => el.previousElementSibling,
|
|
512
|
+
values: el => collectFormValues(el),
|
|
511
513
|
};
|
|
514
|
+
function collectFormValues(el) {
|
|
515
|
+
if (el instanceof HTMLFormElement)
|
|
516
|
+
return new FormData(el);
|
|
517
|
+
const fd = new FormData();
|
|
518
|
+
el.querySelectorAll('input, select, textarea').forEach((input) => {
|
|
519
|
+
const name = input.getAttribute('name');
|
|
520
|
+
if (name && 'value' in input)
|
|
521
|
+
fd.append(name, input.value);
|
|
522
|
+
});
|
|
523
|
+
return fd;
|
|
524
|
+
}
|
|
512
525
|
function getElementProperty(element, property) {
|
|
513
526
|
if (property.startsWith('computed-')) {
|
|
514
527
|
const cssProperty = property.slice('computed-'.length);
|
|
@@ -5132,7 +5145,7 @@ const enhancedConverters = {
|
|
|
5132
5145
|
Values: (value, _context) => {
|
|
5133
5146
|
try {
|
|
5134
5147
|
if (value instanceof HTMLFormElement) {
|
|
5135
|
-
return success(
|
|
5148
|
+
return success(getFormValuesProcessed(value), 'object');
|
|
5136
5149
|
}
|
|
5137
5150
|
if (value instanceof HTMLElement) {
|
|
5138
5151
|
const inputs = value.querySelectorAll('input, select, textarea');
|
|
@@ -5140,7 +5153,7 @@ const enhancedConverters = {
|
|
|
5140
5153
|
inputs.forEach((input) => {
|
|
5141
5154
|
const htmlInput = input;
|
|
5142
5155
|
if (htmlInput.name) {
|
|
5143
|
-
const inputValue =
|
|
5156
|
+
const inputValue = getInputValue(htmlInput);
|
|
5144
5157
|
if (inputValue !== undefined) {
|
|
5145
5158
|
values[htmlInput.name] = inputValue;
|
|
5146
5159
|
}
|
|
@@ -5595,55 +5608,6 @@ class IsExpression extends BaseExpressionImpl {
|
|
|
5595
5608
|
}
|
|
5596
5609
|
}
|
|
5597
5610
|
}
|
|
5598
|
-
function extractFormValues(form) {
|
|
5599
|
-
const values = {};
|
|
5600
|
-
const elements = form.querySelectorAll('input, select, textarea');
|
|
5601
|
-
elements.forEach(element => {
|
|
5602
|
-
const input = element;
|
|
5603
|
-
if (input.name) {
|
|
5604
|
-
const value = extractInputValue(input);
|
|
5605
|
-
if (value !== undefined) {
|
|
5606
|
-
if (values[input.name] !== undefined) {
|
|
5607
|
-
if (!Array.isArray(values[input.name])) {
|
|
5608
|
-
values[input.name] = [values[input.name]];
|
|
5609
|
-
}
|
|
5610
|
-
values[input.name].push(value);
|
|
5611
|
-
}
|
|
5612
|
-
else {
|
|
5613
|
-
values[input.name] = value;
|
|
5614
|
-
}
|
|
5615
|
-
}
|
|
5616
|
-
}
|
|
5617
|
-
});
|
|
5618
|
-
return values;
|
|
5619
|
-
}
|
|
5620
|
-
function extractInputValue(input) {
|
|
5621
|
-
if (input instanceof HTMLInputElement) {
|
|
5622
|
-
switch (input.type) {
|
|
5623
|
-
case 'checkbox':
|
|
5624
|
-
return input.checked;
|
|
5625
|
-
case 'radio':
|
|
5626
|
-
return input.checked ? input.value : undefined;
|
|
5627
|
-
case 'number':
|
|
5628
|
-
case 'range':
|
|
5629
|
-
return input.valueAsNumber;
|
|
5630
|
-
case 'date':
|
|
5631
|
-
case 'datetime-local':
|
|
5632
|
-
return input.valueAsDate;
|
|
5633
|
-
case 'file':
|
|
5634
|
-
return input.files;
|
|
5635
|
-
default:
|
|
5636
|
-
return input.value;
|
|
5637
|
-
}
|
|
5638
|
-
}
|
|
5639
|
-
if (input instanceof HTMLSelectElement) {
|
|
5640
|
-
if (input.multiple) {
|
|
5641
|
-
return Array.from(input.selectedOptions).map(option => option.value);
|
|
5642
|
-
}
|
|
5643
|
-
return input.value;
|
|
5644
|
-
}
|
|
5645
|
-
return input.value;
|
|
5646
|
-
}
|
|
5647
5611
|
({
|
|
5648
5612
|
as: new AsExpression(),
|
|
5649
5613
|
is: new IsExpression(),
|