@lokascript/compilation-service 2.2.1 → 2.3.1
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/{chunk-5VQO5CSQ.js → chunk-E5HS7EYK.js} +2 -2
- package/dist/{chunk-YFCEVGOM.js → chunk-IZIF5G26.js} +2 -2
- package/dist/{core-parser-adapter-VCJB52SO-VNI2RAC6.js → core-parser-adapter-VCJB52SO-UNDWZLXO.js} +2 -2
- package/dist/{dist-3TBAKHJP.js → dist-37BGWHOT.js} +3 -3
- package/dist/{dist-TXRKL7PN.js → dist-QPI3MUNN.js} +157 -78
- package/dist/{dist-TXRKL7PN.js.map → dist-QPI3MUNN.js.map} +1 -1
- package/dist/http.cjs +156 -77
- package/dist/http.cjs.map +1 -1
- package/dist/http.js +1 -1
- package/dist/index.cjs +156 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-5VQO5CSQ.js.map → chunk-E5HS7EYK.js.map} +0 -0
- /package/dist/{chunk-YFCEVGOM.js.map → chunk-IZIF5G26.js.map} +0 -0
- /package/dist/{core-parser-adapter-VCJB52SO-VNI2RAC6.js.map → core-parser-adapter-VCJB52SO-UNDWZLXO.js.map} +0 -0
- /package/dist/{dist-3TBAKHJP.js.map → dist-37BGWHOT.js.map} +0 -0
|
@@ -2768,7 +2768,7 @@ var CompilationService = class _CompilationService {
|
|
|
2768
2768
|
initValidation({
|
|
2769
2769
|
validateSemanticResult: semantic.validateSemanticResult
|
|
2770
2770
|
});
|
|
2771
|
-
const aot = await import("./dist-
|
|
2771
|
+
const aot = await import("./dist-37BGWHOT.js");
|
|
2772
2772
|
const compiler = aot.createCompiler();
|
|
2773
2773
|
initBridge(
|
|
2774
2774
|
{
|
|
@@ -3206,4 +3206,4 @@ export {
|
|
|
3206
3206
|
SvelteRenderer,
|
|
3207
3207
|
CompilationService
|
|
3208
3208
|
};
|
|
3209
|
-
//# sourceMappingURL=chunk-
|
|
3209
|
+
//# sourceMappingURL=chunk-E5HS7EYK.js.map
|
|
@@ -24,7 +24,7 @@ function convertCoreASTToAOT(node) {
|
|
|
24
24
|
return node;
|
|
25
25
|
}
|
|
26
26
|
async function createCoreParserAdapter() {
|
|
27
|
-
const core = await import("./dist-
|
|
27
|
+
const core = await import("./dist-QPI3MUNN.js");
|
|
28
28
|
const api = core.hyperscript ?? core.default ?? core;
|
|
29
29
|
if (!api?.compileSync) {
|
|
30
30
|
throw new Error(
|
|
@@ -46,4 +46,4 @@ export {
|
|
|
46
46
|
convertCoreASTToAOT,
|
|
47
47
|
createCoreParserAdapter
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-IZIF5G26.js.map
|
package/dist/{core-parser-adapter-VCJB52SO-VNI2RAC6.js → core-parser-adapter-VCJB52SO-UNDWZLXO.js}
RENAMED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
CoreParserAdapter,
|
|
3
3
|
convertCoreASTToAOT,
|
|
4
4
|
createCoreParserAdapter
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IZIF5G26.js";
|
|
6
6
|
import "./chunk-GBPMR66W.js";
|
|
7
7
|
export {
|
|
8
8
|
CoreParserAdapter,
|
|
9
9
|
convertCoreASTToAOT,
|
|
10
10
|
createCoreParserAdapter
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=core-parser-adapter-VCJB52SO-
|
|
12
|
+
//# sourceMappingURL=core-parser-adapter-VCJB52SO-UNDWZLXO.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CoreParserAdapter,
|
|
3
3
|
createCoreParserAdapter
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IZIF5G26.js";
|
|
5
5
|
import {
|
|
6
6
|
SemanticParserAdapter,
|
|
7
7
|
createSemanticAdapter
|
|
@@ -4217,7 +4217,7 @@ async function compileHyperscript(code, options) {
|
|
|
4217
4217
|
async function createMultilingualCompiler() {
|
|
4218
4218
|
const compiler = new AOTCompiler();
|
|
4219
4219
|
try {
|
|
4220
|
-
const { createCoreParserAdapter: createCoreParserAdapter2 } = await import("./core-parser-adapter-VCJB52SO-
|
|
4220
|
+
const { createCoreParserAdapter: createCoreParserAdapter2 } = await import("./core-parser-adapter-VCJB52SO-UNDWZLXO.js");
|
|
4221
4221
|
compiler.setParser(await createCoreParserAdapter2());
|
|
4222
4222
|
} catch {
|
|
4223
4223
|
}
|
|
@@ -4270,4 +4270,4 @@ export {
|
|
|
4270
4270
|
sanitizeSelector,
|
|
4271
4271
|
scanFiles
|
|
4272
4272
|
};
|
|
4273
|
-
//# sourceMappingURL=dist-
|
|
4273
|
+
//# sourceMappingURL=dist-37BGWHOT.js.map
|
|
@@ -441,7 +441,7 @@ function tokenize$1(input) {
|
|
|
441
441
|
const isKeywordContext = prevToken && prevToken.kind === TokenKind.IDENTIFIER && SELECTOR_CONTEXT_KEYWORDS.has(prevToken.value.toLowerCase());
|
|
442
442
|
const isCSSSelectorContext = !prevToken || prevToken.kind === TokenKind.OPERATOR && prevToken.value !== ")" && prevToken.value !== "]" || isCommandContext || isKeywordContext || prevToken.value === "(" || prevToken.value === "[" || prevToken.value === "{" || prevToken.value === "," || prevToken.value === ";";
|
|
443
443
|
const isAdjacentToPrev = prevToken && prevToken.end === tokenizer.position;
|
|
444
|
-
if (isCSSSelectorContext && !isAdjacentToPrev && isAlpha(peek(tokenizer))) {
|
|
444
|
+
if (isCSSSelectorContext && !isAdjacentToPrev && (isAlpha(peek(tokenizer)) || peek(tokenizer) === "{")) {
|
|
445
445
|
tokenizeCSSSelector(tokenizer);
|
|
446
446
|
continue;
|
|
447
447
|
}
|
|
@@ -657,6 +657,17 @@ function tokenizeCSSSelector(tokenizer) {
|
|
|
657
657
|
const start = tokenizer.position;
|
|
658
658
|
const prefix2 = advance(tokenizer);
|
|
659
659
|
let value = prefix2;
|
|
660
|
+
if (tokenizer.position < tokenizer.input.length && tokenizer.input[tokenizer.position] === "{") {
|
|
661
|
+
value += advance(tokenizer);
|
|
662
|
+
while (tokenizer.position < tokenizer.input.length) {
|
|
663
|
+
const ch = tokenizer.input[tokenizer.position];
|
|
664
|
+
value += advance(tokenizer);
|
|
665
|
+
if (ch === "}")
|
|
666
|
+
break;
|
|
667
|
+
}
|
|
668
|
+
addToken(tokenizer, TokenKind.SELECTOR, value, start);
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
660
671
|
while (tokenizer.position < tokenizer.input.length) {
|
|
661
672
|
const char = tokenizer.input[tokenizer.position];
|
|
662
673
|
if (isAlphaNumeric(char) || char === "-" || char === "_" || char === ":") {
|
|
@@ -2239,31 +2250,14 @@ function parseTriggerCommand(ctx, identifierNode) {
|
|
|
2239
2250
|
});
|
|
2240
2251
|
}
|
|
2241
2252
|
}
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
const arg = allArgs[i];
|
|
2249
|
-
const argRecord = arg;
|
|
2250
|
-
const argValue = argRecord.name || argRecord.value;
|
|
2251
|
-
if ((arg.type === "identifier" || arg.type === "literal" || arg.type === "keyword") && (argValue === "on" || argValue === "to")) {
|
|
2252
|
-
operationIndex = i;
|
|
2253
|
-
operationKeyword = argValue;
|
|
2254
|
-
break;
|
|
2253
|
+
const finalArgs = [...allArgs];
|
|
2254
|
+
if (ctx.check("on") || ctx.check("to")) {
|
|
2255
|
+
const keyword = ctx.advance().value;
|
|
2256
|
+
finalArgs.push(ctx.createIdentifier(keyword));
|
|
2257
|
+
while (!isCommandBoundary(ctx)) {
|
|
2258
|
+
finalArgs.push(ctx.parsePrimary());
|
|
2255
2259
|
}
|
|
2256
2260
|
}
|
|
2257
|
-
const finalArgs = [];
|
|
2258
|
-
if (operationIndex === -1) {
|
|
2259
|
-
finalArgs.push(...allArgs);
|
|
2260
|
-
} else {
|
|
2261
|
-
const eventArgs = allArgs.slice(0, operationIndex);
|
|
2262
|
-
const targetArgs = allArgs.slice(operationIndex + 1);
|
|
2263
|
-
finalArgs.push(...eventArgs);
|
|
2264
|
-
finalArgs.push(ctx.createIdentifier(operationKeyword));
|
|
2265
|
-
finalArgs.push(...targetArgs);
|
|
2266
|
-
}
|
|
2267
2261
|
return CommandNodeBuilder.fromIdentifier(identifierNode).withArgs(...finalArgs).endingAt(ctx.getPosition()).build();
|
|
2268
2262
|
}
|
|
2269
2263
|
function parseHaltCommand(ctx, identifierNode) {
|
|
@@ -2900,8 +2894,9 @@ function parseSwapCommand(ctx, identifierNode) {
|
|
|
2900
2894
|
}
|
|
2901
2895
|
function parseWaitCommand(ctx, commandToken) {
|
|
2902
2896
|
const args = [];
|
|
2903
|
-
|
|
2904
|
-
|
|
2897
|
+
const isExpressionStart = ctx.checkTimeExpression() || ctx.checkLiteral() || ctx.checkContextVar() || ctx.check("(") || ctx.checkIdentifierLike() && !ctx.check("for") && !isCommandBoundary(ctx);
|
|
2898
|
+
if (isExpressionStart) {
|
|
2899
|
+
const timeExpr = ctx.parseExpression();
|
|
2905
2900
|
args.push(timeExpr);
|
|
2906
2901
|
return CommandNodeBuilder.from(commandToken).withArgs(...args).blocking().endingAt(ctx.getPosition()).build();
|
|
2907
2902
|
}
|
|
@@ -3069,43 +3064,24 @@ function parsePropertyOfTarget(ctx, startPosition) {
|
|
|
3069
3064
|
return null;
|
|
3070
3065
|
const thePosition = ctx.savePosition();
|
|
3071
3066
|
ctx.advance();
|
|
3072
|
-
const
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
const propertyToken = ctx.advance();
|
|
3076
|
-
if (ctx.check(KEYWORDS$1.OF)) {
|
|
3077
|
-
ctx.advance();
|
|
3078
|
-
const targetToken = ctx.advance();
|
|
3079
|
-
const isIdSelector2 = targetToken.value.startsWith("#");
|
|
3080
|
-
return {
|
|
3081
|
-
type: "propertyOfExpression",
|
|
3082
|
-
property: {
|
|
3083
|
-
type: "identifier",
|
|
3084
|
-
name: propertyToken.value,
|
|
3085
|
-
start: propertyToken.start,
|
|
3086
|
-
end: propertyToken.end
|
|
3087
|
-
},
|
|
3088
|
-
target: {
|
|
3089
|
-
type: isIdSelector2 ? "idSelector" : "cssSelector",
|
|
3090
|
-
value: targetToken.value,
|
|
3091
|
-
start: targetToken.start,
|
|
3092
|
-
end: targetToken.end
|
|
3093
|
-
},
|
|
3094
|
-
start: startPosition,
|
|
3095
|
-
end: ctx.savePosition()
|
|
3096
|
-
};
|
|
3097
|
-
}
|
|
3098
|
-
ctx.restorePosition(startPosition);
|
|
3067
|
+
const propertyExpr = ctx.parseExpression();
|
|
3068
|
+
if (!propertyExpr) {
|
|
3069
|
+
ctx.restorePosition(thePosition);
|
|
3099
3070
|
return null;
|
|
3100
3071
|
}
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
start:
|
|
3107
|
-
end:
|
|
3108
|
-
|
|
3072
|
+
const exprAny = propertyExpr;
|
|
3073
|
+
if (exprAny.type === "binaryExpression" && exprAny.operator === KEYWORDS$1.OF) {
|
|
3074
|
+
const property = exprAny.left;
|
|
3075
|
+
const target = exprAny.right;
|
|
3076
|
+
return createPropertyOfExpression(property, target, {
|
|
3077
|
+
start: property.start ?? 0,
|
|
3078
|
+
end: target.end ?? 0,
|
|
3079
|
+
line: property.line ?? 1,
|
|
3080
|
+
column: property.column ?? 1
|
|
3081
|
+
});
|
|
3082
|
+
}
|
|
3083
|
+
if (ctx.check(KEYWORDS$1.TO)) {
|
|
3084
|
+
return propertyExpr;
|
|
3109
3085
|
}
|
|
3110
3086
|
ctx.restorePosition(thePosition);
|
|
3111
3087
|
return null;
|
|
@@ -3429,6 +3405,68 @@ function parseFetchNakedNamedArgs(ctx) {
|
|
|
3429
3405
|
column: startPos.column
|
|
3430
3406
|
};
|
|
3431
3407
|
}
|
|
3408
|
+
function findJsEndBoundary(ctx, startPos) {
|
|
3409
|
+
const input = ctx.getInputSlice(startPos);
|
|
3410
|
+
if (!input) {
|
|
3411
|
+
return startPos;
|
|
3412
|
+
}
|
|
3413
|
+
let i = 0;
|
|
3414
|
+
while (i < input.length) {
|
|
3415
|
+
const ch = input[i];
|
|
3416
|
+
if (ch === "'" || ch === "\u2019" || ch === "\u2018") {
|
|
3417
|
+
i++;
|
|
3418
|
+
while (i < input.length && input[i] !== ch) {
|
|
3419
|
+
if (input[i] === "\\")
|
|
3420
|
+
i++;
|
|
3421
|
+
i++;
|
|
3422
|
+
}
|
|
3423
|
+
i++;
|
|
3424
|
+
continue;
|
|
3425
|
+
}
|
|
3426
|
+
if (ch === '"') {
|
|
3427
|
+
i++;
|
|
3428
|
+
while (i < input.length && input[i] !== '"') {
|
|
3429
|
+
if (input[i] === "\\")
|
|
3430
|
+
i++;
|
|
3431
|
+
i++;
|
|
3432
|
+
}
|
|
3433
|
+
i++;
|
|
3434
|
+
continue;
|
|
3435
|
+
}
|
|
3436
|
+
if (ch === "`") {
|
|
3437
|
+
i++;
|
|
3438
|
+
while (i < input.length && input[i] !== "`") {
|
|
3439
|
+
if (input[i] === "\\")
|
|
3440
|
+
i++;
|
|
3441
|
+
i++;
|
|
3442
|
+
}
|
|
3443
|
+
i++;
|
|
3444
|
+
continue;
|
|
3445
|
+
}
|
|
3446
|
+
if (ch === "/" && i + 1 < input.length && input[i + 1] === "/") {
|
|
3447
|
+
i += 2;
|
|
3448
|
+
while (i < input.length && input[i] !== "\n")
|
|
3449
|
+
i++;
|
|
3450
|
+
continue;
|
|
3451
|
+
}
|
|
3452
|
+
if (ch === "/" && i + 1 < input.length && input[i + 1] === "*") {
|
|
3453
|
+
i += 2;
|
|
3454
|
+
while (i < input.length && !(input[i] === "*" && i + 1 < input.length && input[i + 1] === "/"))
|
|
3455
|
+
i++;
|
|
3456
|
+
i += 2;
|
|
3457
|
+
continue;
|
|
3458
|
+
}
|
|
3459
|
+
if ((ch === "e" || ch === "E") && i + 3 <= input.length && input.slice(i, i + 3).toLowerCase() === "end") {
|
|
3460
|
+
const before = i === 0 || !/[a-zA-Z0-9_]/.test(input[i - 1]);
|
|
3461
|
+
const after = i + 3 >= input.length || !/[a-zA-Z0-9_]/.test(input[i + 3]);
|
|
3462
|
+
if (before && after) {
|
|
3463
|
+
return startPos + i;
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
i++;
|
|
3467
|
+
}
|
|
3468
|
+
return startPos + input.length;
|
|
3469
|
+
}
|
|
3432
3470
|
function parseJsCommand(ctx, identifierNode) {
|
|
3433
3471
|
const parameters = [];
|
|
3434
3472
|
if (ctx.match("(")) {
|
|
@@ -3441,11 +3479,12 @@ function parseJsCommand(ctx, identifierNode) {
|
|
|
3441
3479
|
ctx.consume(")", "Expected ) after js parameters");
|
|
3442
3480
|
}
|
|
3443
3481
|
const jsCodeStart = ctx.peek().start;
|
|
3444
|
-
|
|
3482
|
+
const jsCodeEnd = findJsEndBoundary(ctx, jsCodeStart);
|
|
3483
|
+
while (!ctx.isAtEnd() && !ctx.check(KEYWORDS$1.END)) {
|
|
3484
|
+
if (ctx.peek().start >= jsCodeEnd)
|
|
3485
|
+
break;
|
|
3445
3486
|
ctx.advance();
|
|
3446
3487
|
}
|
|
3447
|
-
const endToken = ctx.peek();
|
|
3448
|
-
const jsCodeEnd = endToken.start;
|
|
3449
3488
|
ctx.consume(KEYWORDS$1.END, "Expected end after js code body");
|
|
3450
3489
|
const rawSlice = ctx.getInputSlice(jsCodeStart, jsCodeEnd);
|
|
3451
3490
|
const code = rawSlice.trim();
|
|
@@ -4289,7 +4328,7 @@ var Parser = class _Parser {
|
|
|
4289
4328
|
}
|
|
4290
4329
|
} else {
|
|
4291
4330
|
const commandName = expr.name.toLowerCase();
|
|
4292
|
-
if (commandName === "wait" && this.checkTimeExpression()) {
|
|
4331
|
+
if (commandName === "wait" && (this.checkTimeExpression() || this.checkNumber() || this.checkIdentifier() || this.checkContextVar() || this.check("("))) {
|
|
4293
4332
|
const command2 = this.createCommandFromIdentifier(expr);
|
|
4294
4333
|
if (command2) {
|
|
4295
4334
|
expr = command2;
|
|
@@ -5399,9 +5438,7 @@ var Parser = class _Parser {
|
|
|
5399
5438
|
while (!this.isAtEnd() && !this.check("end")) {
|
|
5400
5439
|
if (this.match("on")) {
|
|
5401
5440
|
const handlerPos = this.getPosition();
|
|
5402
|
-
const
|
|
5403
|
-
const eventName = eventToken.value;
|
|
5404
|
-
this.advance();
|
|
5441
|
+
const eventName = this.parseEventNameWithNamespace("Expected event name after 'on'");
|
|
5405
5442
|
const eventArgs = [];
|
|
5406
5443
|
if (this.check("(")) {
|
|
5407
5444
|
this.advance();
|
|
@@ -8093,6 +8130,8 @@ var BaseExpressionEvaluator = class {
|
|
|
8093
8130
|
return this.evaluateIdSelector(node, context);
|
|
8094
8131
|
case "attributeAccess":
|
|
8095
8132
|
return this.evaluateAttributeAccess(node, context);
|
|
8133
|
+
case "asExpression":
|
|
8134
|
+
return this.evaluateAsExpression(node, context);
|
|
8096
8135
|
default:
|
|
8097
8136
|
throw new Error(`Unsupported AST node type for evaluation: ${node.type}`);
|
|
8098
8137
|
}
|
|
@@ -8368,6 +8407,14 @@ var BaseExpressionEvaluator = class {
|
|
|
8368
8407
|
}
|
|
8369
8408
|
return `@${node.attributeName}`;
|
|
8370
8409
|
}
|
|
8410
|
+
async evaluateAsExpression(node, context) {
|
|
8411
|
+
const value = await this.evaluate(node.expression, context);
|
|
8412
|
+
const asExpr = this.expressionRegistry.get("as");
|
|
8413
|
+
if (asExpr) {
|
|
8414
|
+
return asExpr.evaluate(context, value, node.targetType);
|
|
8415
|
+
}
|
|
8416
|
+
throw new Error(`Conversion type 'as' not registered`);
|
|
8417
|
+
}
|
|
8371
8418
|
getAvailableExpressions() {
|
|
8372
8419
|
return Array.from(this.expressionRegistry.keys());
|
|
8373
8420
|
}
|
|
@@ -13745,6 +13792,8 @@ var RuntimeBase = class _RuntimeBase {
|
|
|
13745
13792
|
this.behaviorAPI = {
|
|
13746
13793
|
has: (name) => this.behaviorRegistry.has(name),
|
|
13747
13794
|
get: (name) => this.behaviorRegistry.get(name),
|
|
13795
|
+
set: (name, definition) => this.behaviorRegistry.set(name, definition),
|
|
13796
|
+
resolve: null,
|
|
13748
13797
|
install: async (behaviorName, element, parameters) => {
|
|
13749
13798
|
return await this.installBehaviorOnElement(behaviorName, element, parameters);
|
|
13750
13799
|
}
|
|
@@ -14208,9 +14257,14 @@ var RuntimeBase = class _RuntimeBase {
|
|
|
14208
14257
|
}
|
|
14209
14258
|
async installBehaviorOnElement(behaviorName, element, parameters) {
|
|
14210
14259
|
debug.runtime(`BEHAVIOR: installBehaviorOnElement called: ${behaviorName}`);
|
|
14211
|
-
|
|
14212
|
-
if (!behavior)
|
|
14213
|
-
|
|
14260
|
+
let behavior = this.behaviorRegistry.get(behaviorName);
|
|
14261
|
+
if (!behavior) {
|
|
14262
|
+
if (this.behaviorAPI.resolve && this.behaviorAPI.resolve(behaviorName)) {
|
|
14263
|
+
behavior = this.behaviorRegistry.get(behaviorName);
|
|
14264
|
+
}
|
|
14265
|
+
if (!behavior)
|
|
14266
|
+
throw new Error(`Behavior "${behaviorName}" not found`);
|
|
14267
|
+
}
|
|
14214
14268
|
if (behavior.type === "imperative" && typeof behavior.install === "function") {
|
|
14215
14269
|
debug.runtime(`BEHAVIOR: Installing imperative behavior '${behaviorName}'`);
|
|
14216
14270
|
behavior.install(element, parameters);
|
|
@@ -16426,11 +16480,28 @@ var PutCommand = (() => {
|
|
|
16426
16480
|
const obj = targetArg.object, prop = targetArg.property;
|
|
16427
16481
|
if (obj?.type === "selector")
|
|
16428
16482
|
targetSelector = obj.value;
|
|
16429
|
-
else if (obj?.type === "identifier")
|
|
16430
|
-
|
|
16483
|
+
else if (obj?.type === "identifier") {
|
|
16484
|
+
const objName = obj.name;
|
|
16485
|
+
if (objName === "my" || objName === "me" || objName === "I") {
|
|
16486
|
+
if (context.me && prop?.name) {
|
|
16487
|
+
return {
|
|
16488
|
+
value,
|
|
16489
|
+
targets: [context.me],
|
|
16490
|
+
position: "replace",
|
|
16491
|
+
memberPath: prop.name
|
|
16492
|
+
};
|
|
16493
|
+
}
|
|
16494
|
+
} else if (objName === "its" || objName === "it") {
|
|
16495
|
+
const ev = await evaluator.evaluate(targetArg, context);
|
|
16496
|
+
if (typeof ev === "string")
|
|
16497
|
+
targetSelector = ev;
|
|
16498
|
+
} else {
|
|
16499
|
+
targetSelector = objName;
|
|
16500
|
+
}
|
|
16501
|
+
}
|
|
16431
16502
|
if (targetSelector && prop?.name)
|
|
16432
16503
|
memberPath = prop.name;
|
|
16433
|
-
else {
|
|
16504
|
+
else if (!targetSelector && !memberPath) {
|
|
16434
16505
|
const ev = await evaluator.evaluate(targetArg, context);
|
|
16435
16506
|
if (typeof ev === "string")
|
|
16436
16507
|
targetSelector = ev;
|
|
@@ -19288,7 +19359,9 @@ var SetCommand = (() => {
|
|
|
19288
19359
|
return { type: "property", element: firstValue[0], property: "textContent", value: value2 };
|
|
19289
19360
|
}
|
|
19290
19361
|
if (typeof firstValue !== "string") {
|
|
19291
|
-
|
|
19362
|
+
const isMember = firstArg?.type === "memberExpression" || firstArg?.type === "propertyAccess";
|
|
19363
|
+
const hint = isMember ? ` (a property chain evaluated to ${firstValue === null ? "null" : typeof firstValue} \u2014 check that all intermediate objects exist)` : "";
|
|
19364
|
+
throw new Error(`set command target must be a string or object literal${hint}`);
|
|
19292
19365
|
}
|
|
19293
19366
|
const value = await this.extractValue(raw, evaluator, context);
|
|
19294
19367
|
return { type: "variable", name: firstValue, value };
|
|
@@ -22343,12 +22416,18 @@ var InstallCommand = class _InstallCommand {
|
|
|
22343
22416
|
const behaviorRegistry = context.locals.get("_behaviors");
|
|
22344
22417
|
if (behaviorRegistry && typeof behaviorRegistry === "object") {
|
|
22345
22418
|
const registry = behaviorRegistry;
|
|
22346
|
-
|
|
22419
|
+
if (registry.has(behaviorName))
|
|
22420
|
+
return true;
|
|
22421
|
+
if (registry.resolve && registry.resolve(behaviorName))
|
|
22422
|
+
return true;
|
|
22347
22423
|
}
|
|
22348
22424
|
if (typeof globalThis !== "undefined") {
|
|
22349
22425
|
const hyperscriptGlobal = globalThis._hyperscript;
|
|
22350
22426
|
if (hyperscriptGlobal?.behaviors) {
|
|
22351
|
-
|
|
22427
|
+
if (hyperscriptGlobal.behaviors.has(behaviorName))
|
|
22428
|
+
return true;
|
|
22429
|
+
if (hyperscriptGlobal.behaviors.resolve && hyperscriptGlobal.behaviors.resolve(behaviorName))
|
|
22430
|
+
return true;
|
|
22352
22431
|
}
|
|
22353
22432
|
}
|
|
22354
22433
|
return false;
|
|
@@ -74674,4 +74753,4 @@ export {
|
|
|
74674
74753
|
toCoreAST,
|
|
74675
74754
|
validatePartialContent
|
|
74676
74755
|
};
|
|
74677
|
-
//# sourceMappingURL=dist-
|
|
74756
|
+
//# sourceMappingURL=dist-QPI3MUNN.js.map
|