xmlui 0.11.23 → 0.11.24
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/bin/index.cjs +24 -22
- package/dist/bin/index.js +7 -5
- package/dist/lib/{index-Dh3wc_JX.js → index-9UB61miF.js} +1515 -1171
- package/dist/lib/index.css +1 -1
- package/dist/lib/{initMock-BE0szWSR.js → initMock-DppAqVHs.js} +1 -1
- package/dist/lib/language-server-web-worker.js +1 -1
- package/dist/lib/language-server.js +1 -1
- package/dist/lib/{metadata-utils-ow3vRMof.js → metadata-utils-X4ryJQBa.js} +1 -1
- package/dist/lib/{server-common-DjRwBoWi.js → server-common-BZY2B446.js} +2464 -1296
- package/dist/lib/syntax-textmate.d.ts +1 -1
- package/dist/lib/syntax-textmate.js +1 -1
- package/dist/lib/testing.d.ts +8 -1
- package/dist/lib/testing.js +1 -1
- package/dist/lib/{transform-vby4pBMJ.js → transform-FiPBuy3W.js} +6 -2
- package/dist/lib/vite-xmlui-plugin.js +4 -2
- package/dist/lib/{xmlui-parser-B2m1xG6D.js → xmlui-parser-DXCqrM50.js} +1 -1
- package/dist/lib/xmlui-parser.d.ts +8 -1
- package/dist/lib/xmlui-parser.js +2 -2
- package/dist/lib/{xmlui-serializer-DeegIW2y.js → xmlui-serializer-D4ixnQay.js} +1 -1
- package/dist/lib/xmlui.d.ts +15 -5
- package/dist/lib/xmlui.js +65 -64
- package/dist/metadata/{collectedComponentMetadata-BFVjl5S6.js → collectedComponentMetadata-CkHQSF65.js} +1443 -1103
- package/dist/metadata/{initMock-CyVKxVyG.js → initMock-KBzfT81H.js} +1 -1
- package/dist/metadata/xmlui-metadata.css +1 -1
- package/dist/metadata/xmlui-metadata.js +1 -1
- package/dist/metadata/xmlui-metadata.umd.cjs +3 -3
- package/dist/standalone/xmlui-standalone.es.d.ts +17 -5
- package/dist/standalone/xmlui-standalone.umd.js +8 -8
- package/package.json +1 -1
- package/src/syntax/textMate/xmlui.tmLanguage.json +1 -1
package/dist/bin/index.cjs
CHANGED
|
@@ -488,7 +488,7 @@ var require_scan = /* @__PURE__ */ __commonJS({ "../node_modules/picomatch/lib/s
|
|
|
488
488
|
}
|
|
489
489
|
let base = str;
|
|
490
490
|
let prefix = "";
|
|
491
|
-
let glob$
|
|
491
|
+
let glob$2 = "";
|
|
492
492
|
if (start$1 > 0) {
|
|
493
493
|
prefix = str.slice(0, start$1);
|
|
494
494
|
str = str.slice(start$1);
|
|
@@ -496,16 +496,16 @@ var require_scan = /* @__PURE__ */ __commonJS({ "../node_modules/picomatch/lib/s
|
|
|
496
496
|
}
|
|
497
497
|
if (base && isGlob === true && lastIndex > 0) {
|
|
498
498
|
base = str.slice(0, lastIndex);
|
|
499
|
-
glob$
|
|
499
|
+
glob$2 = str.slice(lastIndex);
|
|
500
500
|
} else if (isGlob === true) {
|
|
501
501
|
base = "";
|
|
502
|
-
glob$
|
|
502
|
+
glob$2 = str;
|
|
503
503
|
} else base = str;
|
|
504
504
|
if (base && base !== "" && base !== "/" && base !== str) {
|
|
505
505
|
if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
|
|
506
506
|
}
|
|
507
507
|
if (opts.unescape === true) {
|
|
508
|
-
if (glob$
|
|
508
|
+
if (glob$2) glob$2 = utils$2.removeBackslashes(glob$2);
|
|
509
509
|
if (base && backslashes === true) base = utils$2.removeBackslashes(base);
|
|
510
510
|
}
|
|
511
511
|
const state = {
|
|
@@ -513,7 +513,7 @@ var require_scan = /* @__PURE__ */ __commonJS({ "../node_modules/picomatch/lib/s
|
|
|
513
513
|
input,
|
|
514
514
|
start: start$1,
|
|
515
515
|
base,
|
|
516
|
-
glob: glob$
|
|
516
|
+
glob: glob$2,
|
|
517
517
|
isBrace,
|
|
518
518
|
isBracket,
|
|
519
519
|
isGlob,
|
|
@@ -1453,9 +1453,9 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
|
|
|
1453
1453
|
* @return {Function=} Returns a matcher function.
|
|
1454
1454
|
* @api public
|
|
1455
1455
|
*/
|
|
1456
|
-
const picomatch = (glob$
|
|
1457
|
-
if (Array.isArray(glob$
|
|
1458
|
-
const fns = glob$
|
|
1456
|
+
const picomatch = (glob$2, options, returnState = false) => {
|
|
1457
|
+
if (Array.isArray(glob$2)) {
|
|
1458
|
+
const fns = glob$2.map((input) => picomatch(input, options, returnState));
|
|
1459
1459
|
const arrayMatcher = (str) => {
|
|
1460
1460
|
for (const isMatch of fns) {
|
|
1461
1461
|
const state$1 = isMatch(str);
|
|
@@ -1465,11 +1465,11 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
|
|
|
1465
1465
|
};
|
|
1466
1466
|
return arrayMatcher;
|
|
1467
1467
|
}
|
|
1468
|
-
const isState = isObject(glob$
|
|
1469
|
-
if (glob$
|
|
1468
|
+
const isState = isObject(glob$2) && glob$2.tokens && glob$2.input;
|
|
1469
|
+
if (glob$2 === "" || typeof glob$2 !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
|
|
1470
1470
|
const opts = options || {};
|
|
1471
1471
|
const posix$1 = utils.isWindows(options);
|
|
1472
|
-
const regex = isState ? picomatch.compileRe(glob$
|
|
1472
|
+
const regex = isState ? picomatch.compileRe(glob$2, options) : picomatch.makeRe(glob$2, options, false, true);
|
|
1473
1473
|
const state = regex.state;
|
|
1474
1474
|
delete regex.state;
|
|
1475
1475
|
let isIgnored = () => false;
|
|
@@ -1484,11 +1484,11 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
|
|
|
1484
1484
|
}
|
|
1485
1485
|
const matcher = (input, returnObject = false) => {
|
|
1486
1486
|
const { isMatch, match, output } = picomatch.test(input, regex, options, {
|
|
1487
|
-
glob: glob$
|
|
1487
|
+
glob: glob$2,
|
|
1488
1488
|
posix: posix$1
|
|
1489
1489
|
});
|
|
1490
1490
|
const result = {
|
|
1491
|
-
glob: glob$
|
|
1491
|
+
glob: glob$2,
|
|
1492
1492
|
state,
|
|
1493
1493
|
regex,
|
|
1494
1494
|
posix: posix$1,
|
|
@@ -1529,7 +1529,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
|
|
|
1529
1529
|
* @return {Object} Returns an object with matching info.
|
|
1530
1530
|
* @api public
|
|
1531
1531
|
*/
|
|
1532
|
-
picomatch.test = (input, regex, options, { glob: glob$
|
|
1532
|
+
picomatch.test = (input, regex, options, { glob: glob$2, posix: posix$1 } = {}) => {
|
|
1533
1533
|
if (typeof input !== "string") throw new TypeError("Expected input to be a string");
|
|
1534
1534
|
if (input === "") return {
|
|
1535
1535
|
isMatch: false,
|
|
@@ -1537,11 +1537,11 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
|
|
|
1537
1537
|
};
|
|
1538
1538
|
const opts = options || {};
|
|
1539
1539
|
const format = opts.format || (posix$1 ? utils.toPosixSlashes : null);
|
|
1540
|
-
let match = input === glob$
|
|
1540
|
+
let match = input === glob$2;
|
|
1541
1541
|
let output = match && format ? format(input) : input;
|
|
1542
1542
|
if (match === false) {
|
|
1543
1543
|
output = format ? format(input) : input;
|
|
1544
|
-
match = output === glob$
|
|
1544
|
+
match = output === glob$2;
|
|
1545
1545
|
}
|
|
1546
1546
|
if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix$1);
|
|
1547
1547
|
else match = regex.exec(output);
|
|
@@ -1564,8 +1564,8 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../node_modules/picomatc
|
|
|
1564
1564
|
* @return {Boolean}
|
|
1565
1565
|
* @api public
|
|
1566
1566
|
*/
|
|
1567
|
-
picomatch.matchBase = (input, glob$
|
|
1568
|
-
return (glob$
|
|
1567
|
+
picomatch.matchBase = (input, glob$2, options, posix$1 = utils.isWindows(options)) => {
|
|
1568
|
+
return (glob$2 instanceof RegExp ? glob$2 : picomatch.makeRe(glob$2, options)).test(path$2.basename(input));
|
|
1569
1569
|
};
|
|
1570
1570
|
/**
|
|
1571
1571
|
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
@@ -5734,7 +5734,8 @@ function collectCodeBehindFromSource(moduleName, source) {
|
|
|
5734
5734
|
const result = {
|
|
5735
5735
|
vars: {},
|
|
5736
5736
|
moduleErrors: {},
|
|
5737
|
-
functions: {}
|
|
5737
|
+
functions: {},
|
|
5738
|
+
hasInvalidStatements: false
|
|
5738
5739
|
};
|
|
5739
5740
|
const collectedFunctions = {};
|
|
5740
5741
|
const parsedModule = parseScriptModule(moduleName, source);
|
|
@@ -5756,7 +5757,7 @@ function collectCodeBehindFromSource(moduleName, source) {
|
|
|
5756
5757
|
case T_FUNCTION_DECLARATION:
|
|
5757
5758
|
addFunctionDeclaration(stmt);
|
|
5758
5759
|
break;
|
|
5759
|
-
default:
|
|
5760
|
+
default: result.hasInvalidStatements = true;
|
|
5760
5761
|
}
|
|
5761
5762
|
});
|
|
5762
5763
|
return result;
|
|
@@ -7336,6 +7337,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
|
|
|
7336
7337
|
try {
|
|
7337
7338
|
parser.parseStatements();
|
|
7338
7339
|
comp.scriptCollected = collectCodeBehindFromSource("Main", comp.script);
|
|
7340
|
+
if (comp.scriptCollected.hasInvalidStatements) comp.scriptError = /* @__PURE__ */ new Error(`Only reactive variable and function definitions are allowed in a code-behind module.`);
|
|
7339
7341
|
} catch (err) {
|
|
7340
7342
|
if (parser.errors && parser.errors.length > 0) {
|
|
7341
7343
|
const errMsg = parser.errors[0];
|
|
@@ -8426,7 +8428,7 @@ dotenv.config({
|
|
|
8426
8428
|
});
|
|
8427
8429
|
async function getExportedJsObjects(path$5) {
|
|
8428
8430
|
return await new Promise((resolve$1, reject) => {
|
|
8429
|
-
glob.
|
|
8431
|
+
(0, glob.default)(`${process.cwd()}/${path$5}`, (err, matches = []) => {
|
|
8430
8432
|
resolve$1(Promise.all(matches.map(async (file) => {
|
|
8431
8433
|
return (await import(file)).default;
|
|
8432
8434
|
})));
|
|
@@ -8439,7 +8441,7 @@ async function convertResourcesDir(distRoot, flatDist, filePrefix) {
|
|
|
8439
8441
|
const resourcesDir = `${distRoot}/resources`;
|
|
8440
8442
|
if (!(0, fs.existsSync)(resourcesDir)) return;
|
|
8441
8443
|
const files = await new Promise((resolve$1, reject) => {
|
|
8442
|
-
glob.
|
|
8444
|
+
(0, glob.default)(`${resourcesDir}/**/*`, (err, matches = []) => {
|
|
8443
8445
|
resolve$1(matches);
|
|
8444
8446
|
});
|
|
8445
8447
|
});
|
package/dist/bin/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
import { cp, mkdir, rm, writeFile } from "fs/promises";
|
|
4
4
|
import * as dotenv from "dotenv";
|
|
5
5
|
import { existsSync } from "fs";
|
|
6
|
-
import
|
|
6
|
+
import glob from "glob";
|
|
7
7
|
import { build, createLogger, createServer, defineConfig, loadEnv, preview } from "vite";
|
|
8
8
|
import react from "@vitejs/plugin-react";
|
|
9
9
|
import svgr from "vite-plugin-svgr";
|
|
@@ -5722,7 +5722,8 @@ function collectCodeBehindFromSource(moduleName, source) {
|
|
|
5722
5722
|
const result = {
|
|
5723
5723
|
vars: {},
|
|
5724
5724
|
moduleErrors: {},
|
|
5725
|
-
functions: {}
|
|
5725
|
+
functions: {},
|
|
5726
|
+
hasInvalidStatements: false
|
|
5726
5727
|
};
|
|
5727
5728
|
const collectedFunctions = {};
|
|
5728
5729
|
const parsedModule = parseScriptModule(moduleName, source);
|
|
@@ -5744,7 +5745,7 @@ function collectCodeBehindFromSource(moduleName, source) {
|
|
|
5744
5745
|
case T_FUNCTION_DECLARATION:
|
|
5745
5746
|
addFunctionDeclaration(stmt);
|
|
5746
5747
|
break;
|
|
5747
|
-
default:
|
|
5748
|
+
default: result.hasInvalidStatements = true;
|
|
5748
5749
|
}
|
|
5749
5750
|
});
|
|
5750
5751
|
return result;
|
|
@@ -7324,6 +7325,7 @@ function nodeToComponentDef(node, originalGetText, fileId) {
|
|
|
7324
7325
|
try {
|
|
7325
7326
|
parser.parseStatements();
|
|
7326
7327
|
comp.scriptCollected = collectCodeBehindFromSource("Main", comp.script);
|
|
7328
|
+
if (comp.scriptCollected.hasInvalidStatements) comp.scriptError = /* @__PURE__ */ new Error(`Only reactive variable and function definitions are allowed in a code-behind module.`);
|
|
7327
7329
|
} catch (err) {
|
|
7328
7330
|
if (parser.errors && parser.errors.length > 0) {
|
|
7329
7331
|
const errMsg = parser.errors[0];
|
|
@@ -8414,7 +8416,7 @@ dotenv.config({
|
|
|
8414
8416
|
});
|
|
8415
8417
|
async function getExportedJsObjects(path$5) {
|
|
8416
8418
|
return await new Promise((resolve, reject) => {
|
|
8417
|
-
glob
|
|
8419
|
+
glob(`${process.cwd()}/${path$5}`, (err, matches = []) => {
|
|
8418
8420
|
resolve(Promise.all(matches.map(async (file) => {
|
|
8419
8421
|
return (await import(file)).default;
|
|
8420
8422
|
})));
|
|
@@ -8427,7 +8429,7 @@ async function convertResourcesDir(distRoot, flatDist, filePrefix) {
|
|
|
8427
8429
|
const resourcesDir = `${distRoot}/resources`;
|
|
8428
8430
|
if (!existsSync(resourcesDir)) return;
|
|
8429
8431
|
const files = await new Promise((resolve, reject) => {
|
|
8430
|
-
glob
|
|
8432
|
+
glob(`${resourcesDir}/**/*`, (err, matches = []) => {
|
|
8431
8433
|
resolve(matches);
|
|
8432
8434
|
});
|
|
8433
8435
|
});
|