hyperframes 0.7.30 → 0.7.31
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/cli.js +388 -267
- package/dist/studio/assets/{index-D0yNztV_.js → index-ClVRei_K.js} +1 -1
- package/dist/studio/assets/{index-BhSyGx7y.js → index-DM6n1UAe.js} +1 -1
- package/dist/studio/assets/{index-kbACg3_I.js → index-DeqMZHQ4.js} +3 -3
- package/dist/studio/index.html +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -50,7 +50,7 @@ var VERSION;
|
|
|
50
50
|
var init_version = __esm({
|
|
51
51
|
"src/version.ts"() {
|
|
52
52
|
"use strict";
|
|
53
|
-
VERSION = true ? "0.7.
|
|
53
|
+
VERSION = true ? "0.7.31" : "0.0.0-dev";
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -1870,15 +1870,15 @@ var require_types = __commonJS({
|
|
|
1870
1870
|
}
|
|
1871
1871
|
function getBuilderName(typeName) {
|
|
1872
1872
|
return typeName.replace(/^[A-Z]+/, function(upperCasePrefix) {
|
|
1873
|
-
var
|
|
1874
|
-
switch (
|
|
1873
|
+
var len2 = upperCasePrefix.length;
|
|
1874
|
+
switch (len2) {
|
|
1875
1875
|
case 0:
|
|
1876
1876
|
return "";
|
|
1877
1877
|
// If there's only one initial capital letter, just lower-case it.
|
|
1878
1878
|
case 1:
|
|
1879
1879
|
return upperCasePrefix.toLowerCase();
|
|
1880
1880
|
default:
|
|
1881
|
-
return upperCasePrefix.slice(0,
|
|
1881
|
+
return upperCasePrefix.slice(0, len2 - 1).toLowerCase() + upperCasePrefix.charAt(len2 - 1);
|
|
1882
1882
|
}
|
|
1883
1883
|
});
|
|
1884
1884
|
}
|
|
@@ -1956,7 +1956,7 @@ var require_types = __commonJS({
|
|
|
1956
1956
|
lastSeen[typeName] = pos;
|
|
1957
1957
|
list.push.apply(list, d2.baseNames);
|
|
1958
1958
|
}
|
|
1959
|
-
for (var to = 0, from = to,
|
|
1959
|
+
for (var to = 0, from = to, len2 = list.length; from < len2; ++from) {
|
|
1960
1960
|
if (hasOwn3.call(list, from)) {
|
|
1961
1961
|
list[to++] = list[from];
|
|
1962
1962
|
}
|
|
@@ -2060,15 +2060,15 @@ var require_path = __commonJS({
|
|
|
2060
2060
|
};
|
|
2061
2061
|
Pp.each = function each(callback, context) {
|
|
2062
2062
|
var childPaths = [];
|
|
2063
|
-
var
|
|
2063
|
+
var len2 = this.value.length;
|
|
2064
2064
|
var i2 = 0;
|
|
2065
|
-
for (var i2 = 0; i2 <
|
|
2065
|
+
for (var i2 = 0; i2 < len2; ++i2) {
|
|
2066
2066
|
if (hasOwn3.call(this.value, i2)) {
|
|
2067
2067
|
childPaths[i2] = this.get(i2);
|
|
2068
2068
|
}
|
|
2069
2069
|
}
|
|
2070
2070
|
context = context || this;
|
|
2071
|
-
for (i2 = 0; i2 <
|
|
2071
|
+
for (i2 = 0; i2 < len2; ++i2) {
|
|
2072
2072
|
if (hasOwn3.call(childPaths, i2)) {
|
|
2073
2073
|
callback.call(context, childPaths[i2]);
|
|
2074
2074
|
}
|
|
@@ -4891,7 +4891,7 @@ var require_util = __commonJS({
|
|
|
4891
4891
|
return path2;
|
|
4892
4892
|
}
|
|
4893
4893
|
exports.normalize = normalize;
|
|
4894
|
-
function
|
|
4894
|
+
function join113(aRoot, aPath) {
|
|
4895
4895
|
if (aRoot === "") {
|
|
4896
4896
|
aRoot = ".";
|
|
4897
4897
|
}
|
|
@@ -4923,7 +4923,7 @@ var require_util = __commonJS({
|
|
|
4923
4923
|
}
|
|
4924
4924
|
return joined;
|
|
4925
4925
|
}
|
|
4926
|
-
exports.join =
|
|
4926
|
+
exports.join = join113;
|
|
4927
4927
|
exports.isAbsolute = function(aPath) {
|
|
4928
4928
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
4929
4929
|
};
|
|
@@ -5096,7 +5096,7 @@ var require_util = __commonJS({
|
|
|
5096
5096
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
5097
5097
|
}
|
|
5098
5098
|
}
|
|
5099
|
-
sourceURL =
|
|
5099
|
+
sourceURL = join113(urlGenerate(parsed), sourceURL);
|
|
5100
5100
|
}
|
|
5101
5101
|
return normalize(sourceURL);
|
|
5102
5102
|
}
|
|
@@ -5117,7 +5117,7 @@ var require_array_set = __commonJS({
|
|
|
5117
5117
|
}
|
|
5118
5118
|
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
|
5119
5119
|
var set = new ArraySet();
|
|
5120
|
-
for (var i2 = 0,
|
|
5120
|
+
for (var i2 = 0, len2 = aArray.length; i2 < len2; i2++) {
|
|
5121
5121
|
set.add(aArray[i2], aAllowDuplicates);
|
|
5122
5122
|
}
|
|
5123
5123
|
return set;
|
|
@@ -5418,7 +5418,7 @@ var require_source_map_generator = __commonJS({
|
|
|
5418
5418
|
var nameIdx;
|
|
5419
5419
|
var sourceIdx;
|
|
5420
5420
|
var mappings = this._mappings.toArray();
|
|
5421
|
-
for (var i2 = 0,
|
|
5421
|
+
for (var i2 = 0, len2 = mappings.length; i2 < len2; i2++) {
|
|
5422
5422
|
mapping = mappings[i2];
|
|
5423
5423
|
next = "";
|
|
5424
5424
|
if (mapping.generatedLine !== previousGeneratedLine) {
|
|
@@ -6311,7 +6311,7 @@ var require_source_node = __commonJS({
|
|
|
6311
6311
|
};
|
|
6312
6312
|
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
|
|
6313
6313
|
var chunk;
|
|
6314
|
-
for (var i2 = 0,
|
|
6314
|
+
for (var i2 = 0, len2 = this.children.length; i2 < len2; i2++) {
|
|
6315
6315
|
chunk = this.children[i2];
|
|
6316
6316
|
if (chunk[isSourceNode]) {
|
|
6317
6317
|
chunk.walk(aFn);
|
|
@@ -6330,10 +6330,10 @@ var require_source_node = __commonJS({
|
|
|
6330
6330
|
SourceNode.prototype.join = function SourceNode_join(aSep) {
|
|
6331
6331
|
var newChildren;
|
|
6332
6332
|
var i2;
|
|
6333
|
-
var
|
|
6334
|
-
if (
|
|
6333
|
+
var len2 = this.children.length;
|
|
6334
|
+
if (len2 > 0) {
|
|
6335
6335
|
newChildren = [];
|
|
6336
|
-
for (i2 = 0; i2 <
|
|
6336
|
+
for (i2 = 0; i2 < len2 - 1; i2++) {
|
|
6337
6337
|
newChildren.push(this.children[i2]);
|
|
6338
6338
|
newChildren.push(aSep);
|
|
6339
6339
|
}
|
|
@@ -6357,13 +6357,13 @@ var require_source_node = __commonJS({
|
|
|
6357
6357
|
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
|
|
6358
6358
|
};
|
|
6359
6359
|
SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
|
|
6360
|
-
for (var i2 = 0,
|
|
6360
|
+
for (var i2 = 0, len2 = this.children.length; i2 < len2; i2++) {
|
|
6361
6361
|
if (this.children[i2][isSourceNode]) {
|
|
6362
6362
|
this.children[i2].walkSourceContents(aFn);
|
|
6363
6363
|
}
|
|
6364
6364
|
}
|
|
6365
6365
|
var sources = Object.keys(this.sourceContents);
|
|
6366
|
-
for (var i2 = 0,
|
|
6366
|
+
for (var i2 = 0, len2 = sources.length; i2 < len2; i2++) {
|
|
6367
6367
|
aFn(util.fromSetString(sources[i2]), this.sourceContents[sources[i2]]);
|
|
6368
6368
|
}
|
|
6369
6369
|
};
|
|
@@ -11739,9 +11739,9 @@ var require_esprima2 = __commonJS({
|
|
|
11739
11739
|
return cp;
|
|
11740
11740
|
};
|
|
11741
11741
|
Scanner2.prototype.scanHexEscape = function(prefix) {
|
|
11742
|
-
var
|
|
11742
|
+
var len2 = prefix === "u" ? 4 : 2;
|
|
11743
11743
|
var code = 0;
|
|
11744
|
-
for (var i2 = 0; i2 <
|
|
11744
|
+
for (var i2 = 0; i2 < len2; ++i2) {
|
|
11745
11745
|
if (!this.eof() && character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
|
|
11746
11746
|
code = code * 16 + hexValue(this.source[this.index++]);
|
|
11747
11747
|
} else {
|
|
@@ -13769,8 +13769,8 @@ var require_lines = __commonJS({
|
|
|
13769
13769
|
var maxCacheKeyLen = 10;
|
|
13770
13770
|
function countSpaces(spaces, tabWidth) {
|
|
13771
13771
|
var count = 0;
|
|
13772
|
-
var
|
|
13773
|
-
for (var i2 = 0; i2 <
|
|
13772
|
+
var len2 = spaces.length;
|
|
13773
|
+
for (var i2 = 0; i2 < len2; ++i2) {
|
|
13774
13774
|
switch (spaces.charCodeAt(i2)) {
|
|
13775
13775
|
case 9: {
|
|
13776
13776
|
(0, tiny_invariant_1.default)(typeof tabWidth === "number");
|
|
@@ -14380,9 +14380,9 @@ var require_fast_path = __commonJS({
|
|
|
14380
14380
|
};
|
|
14381
14381
|
FPp.getName = function getName4() {
|
|
14382
14382
|
var s2 = this.stack;
|
|
14383
|
-
var
|
|
14384
|
-
if (
|
|
14385
|
-
return s2[
|
|
14383
|
+
var len2 = s2.length;
|
|
14384
|
+
if (len2 > 1) {
|
|
14385
|
+
return s2[len2 - 2];
|
|
14386
14386
|
}
|
|
14387
14387
|
return null;
|
|
14388
14388
|
};
|
|
@@ -14968,10 +14968,10 @@ var require_patcher = __commonJS({
|
|
|
14968
14968
|
return true;
|
|
14969
14969
|
}
|
|
14970
14970
|
isArray4.assert(newNode);
|
|
14971
|
-
var
|
|
14972
|
-
if (!(isArray4.check(oldNode) && oldNode.length ===
|
|
14971
|
+
var len2 = newNode.length;
|
|
14972
|
+
if (!(isArray4.check(oldNode) && oldNode.length === len2))
|
|
14973
14973
|
return false;
|
|
14974
|
-
for (var i2 = 0; i2 <
|
|
14974
|
+
for (var i2 = 0; i2 < len2; ++i2) {
|
|
14975
14975
|
newPath.stack.push(i2, newNode[i2]);
|
|
14976
14976
|
oldPath.stack.push(i2, oldNode[i2]);
|
|
14977
14977
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
@@ -16974,14 +16974,14 @@ var require_printer = __commonJS({
|
|
|
16974
16974
|
(0, tiny_invariant_1.default)(sawStatement === false, "Comments may appear as statements in otherwise empty statement lists, but may not coexist with non-Comment nodes.");
|
|
16975
16975
|
}
|
|
16976
16976
|
var prevTrailingSpace = null;
|
|
16977
|
-
var
|
|
16977
|
+
var len2 = filtered.length;
|
|
16978
16978
|
var parts = [];
|
|
16979
16979
|
filtered.forEach(function(info, i2) {
|
|
16980
16980
|
var printed = info.printed;
|
|
16981
16981
|
var stmt = info.node;
|
|
16982
16982
|
var multiLine = printed.length > 1;
|
|
16983
16983
|
var notFirst = i2 > 0;
|
|
16984
|
-
var notLast = i2 <
|
|
16984
|
+
var notLast = i2 < len2 - 1;
|
|
16985
16985
|
var leadingSpace;
|
|
16986
16986
|
var trailingSpace;
|
|
16987
16987
|
var lines = stmt && stmt.loc && stmt.loc.lines;
|
|
@@ -22232,12 +22232,12 @@ var require_lib = __commonJS({
|
|
|
22232
22232
|
return flags;
|
|
22233
22233
|
}
|
|
22234
22234
|
hasImport(name, allowShadow) {
|
|
22235
|
-
const
|
|
22236
|
-
if (this.importsStack[
|
|
22235
|
+
const len2 = this.importsStack.length;
|
|
22236
|
+
if (this.importsStack[len2 - 1].has(name)) {
|
|
22237
22237
|
return true;
|
|
22238
22238
|
}
|
|
22239
|
-
if (!allowShadow &&
|
|
22240
|
-
for (let i2 = 0; i2 <
|
|
22239
|
+
if (!allowShadow && len2 > 1) {
|
|
22240
|
+
for (let i2 = 0; i2 < len2 - 1; i2++) {
|
|
22241
22241
|
if (this.importsStack[i2].has(name)) return true;
|
|
22242
22242
|
}
|
|
22243
22243
|
}
|
|
@@ -22306,8 +22306,8 @@ var require_lib = __commonJS({
|
|
|
22306
22306
|
name
|
|
22307
22307
|
} = id;
|
|
22308
22308
|
if (this.hasImport(name)) return;
|
|
22309
|
-
const
|
|
22310
|
-
for (let i2 =
|
|
22309
|
+
const len2 = this.scopeStack.length;
|
|
22310
|
+
for (let i2 = len2 - 1; i2 >= 0; i2--) {
|
|
22311
22311
|
const scope = this.scopeStack[i2];
|
|
22312
22312
|
const type = scope.tsNames.get(name);
|
|
22313
22313
|
if ((type & 1) > 0 || (type & 16) > 0) {
|
|
@@ -22904,13 +22904,13 @@ var require_lib = __commonJS({
|
|
|
22904
22904
|
return res(String.fromCharCode(ch));
|
|
22905
22905
|
}
|
|
22906
22906
|
}
|
|
22907
|
-
function readHexChar(input2, pos, lineStart, curLine,
|
|
22907
|
+
function readHexChar(input2, pos, lineStart, curLine, len2, forceLen, throwOnInvalid, errors) {
|
|
22908
22908
|
const initialPos = pos;
|
|
22909
22909
|
let n2;
|
|
22910
22910
|
({
|
|
22911
22911
|
n: n2,
|
|
22912
22912
|
pos
|
|
22913
|
-
} = readInt(input2, pos, lineStart, curLine, 16,
|
|
22913
|
+
} = readInt(input2, pos, lineStart, curLine, 16, len2, forceLen, false, errors, !throwOnInvalid));
|
|
22914
22914
|
if (n2 === null) {
|
|
22915
22915
|
if (throwOnInvalid) {
|
|
22916
22916
|
errors.invalidEscapeSequence(initialPos, lineStart, curLine);
|
|
@@ -22923,13 +22923,13 @@ var require_lib = __commonJS({
|
|
|
22923
22923
|
pos
|
|
22924
22924
|
};
|
|
22925
22925
|
}
|
|
22926
|
-
function readInt(input2, pos, lineStart, curLine, radix,
|
|
22926
|
+
function readInt(input2, pos, lineStart, curLine, radix, len2, forceLen, allowNumSeparator, errors, bailOnError) {
|
|
22927
22927
|
const start = pos;
|
|
22928
22928
|
const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
|
|
22929
22929
|
const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin;
|
|
22930
22930
|
let invalid = false;
|
|
22931
22931
|
let total = 0;
|
|
22932
|
-
for (let i2 = 0, e3 =
|
|
22932
|
+
for (let i2 = 0, e3 = len2 == null ? Infinity : len2; i2 < e3; ++i2) {
|
|
22933
22933
|
const code2 = input2.charCodeAt(pos);
|
|
22934
22934
|
let val;
|
|
22935
22935
|
if (code2 === 95 && allowNumSeparator !== "bail") {
|
|
@@ -22978,7 +22978,7 @@ var require_lib = __commonJS({
|
|
|
22978
22978
|
++pos;
|
|
22979
22979
|
total = total * radix + val;
|
|
22980
22980
|
}
|
|
22981
|
-
if (pos === start ||
|
|
22981
|
+
if (pos === start || len2 != null && pos - start !== len2 || invalid) {
|
|
22982
22982
|
return {
|
|
22983
22983
|
n: null,
|
|
22984
22984
|
pos
|
|
@@ -23769,11 +23769,11 @@ var require_lib = __commonJS({
|
|
|
23769
23769
|
flags: mods
|
|
23770
23770
|
});
|
|
23771
23771
|
}
|
|
23772
|
-
readInt(radix,
|
|
23772
|
+
readInt(radix, len2, forceLen = false, allowNumSeparator = true) {
|
|
23773
23773
|
const {
|
|
23774
23774
|
n: n2,
|
|
23775
23775
|
pos
|
|
23776
|
-
} = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix,
|
|
23776
|
+
} = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len2, forceLen, allowNumSeparator, this.errorHandlers_readInt, false);
|
|
23777
23777
|
this.state.pos = pos;
|
|
23778
23778
|
return n2;
|
|
23779
23779
|
}
|
|
@@ -29488,7 +29488,7 @@ var require_lib = __commonJS({
|
|
|
29488
29488
|
return node.type === "Identifier";
|
|
29489
29489
|
}
|
|
29490
29490
|
isSimpleParamList(params) {
|
|
29491
|
-
for (let i2 = 0,
|
|
29491
|
+
for (let i2 = 0, len2 = params.length; i2 < len2; i2++) {
|
|
29492
29492
|
if (!this.isSimpleParameter(params[i2])) return false;
|
|
29493
29493
|
}
|
|
29494
29494
|
return true;
|
|
@@ -32647,8 +32647,8 @@ var init_acorn = __esm({
|
|
|
32647
32647
|
return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0;
|
|
32648
32648
|
};
|
|
32649
32649
|
Parser.extend = function extend() {
|
|
32650
|
-
var plugins = [],
|
|
32651
|
-
while (
|
|
32650
|
+
var plugins = [], len2 = arguments.length;
|
|
32651
|
+
while (len2--) plugins[len2] = arguments[len2];
|
|
32652
32652
|
var cls = this;
|
|
32653
32653
|
for (var i2 = 0; i2 < plugins.length; i2++) {
|
|
32654
32654
|
cls = plugins[i2](cls);
|
|
@@ -33639,8 +33639,8 @@ var init_acorn = __esm({
|
|
|
33639
33639
|
if (!this.options.checkPrivateFields) {
|
|
33640
33640
|
return;
|
|
33641
33641
|
}
|
|
33642
|
-
var
|
|
33643
|
-
var parent =
|
|
33642
|
+
var len2 = this.privateNameStack.length;
|
|
33643
|
+
var parent = len2 === 0 ? null : this.privateNameStack[len2 - 1];
|
|
33644
33644
|
for (var i2 = 0; i2 < used.length; ++i2) {
|
|
33645
33645
|
var id = used[i2];
|
|
33646
33646
|
if (!hasOwn(declared, id.name)) {
|
|
@@ -37243,11 +37243,11 @@ var init_acorn = __esm({
|
|
|
37243
37243
|
}
|
|
37244
37244
|
return this.finishToken(types$1.regexp, { pattern, flags, value });
|
|
37245
37245
|
};
|
|
37246
|
-
pp.readInt = function(radix,
|
|
37247
|
-
var allowSeparators = this.options.ecmaVersion >= 12 &&
|
|
37246
|
+
pp.readInt = function(radix, len2, maybeLegacyOctalNumericLiteral) {
|
|
37247
|
+
var allowSeparators = this.options.ecmaVersion >= 12 && len2 === void 0;
|
|
37248
37248
|
var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;
|
|
37249
37249
|
var start = this.pos, total = 0, lastCode = 0;
|
|
37250
|
-
for (var i2 = 0, e3 =
|
|
37250
|
+
for (var i2 = 0, e3 = len2 == null ? Infinity : len2; i2 < e3; ++i2, ++this.pos) {
|
|
37251
37251
|
var code = this.input.charCodeAt(this.pos), val = void 0;
|
|
37252
37252
|
if (allowSeparators && code === 95) {
|
|
37253
37253
|
if (isLegacyOctalNumericLiteral) {
|
|
@@ -37280,7 +37280,7 @@ var init_acorn = __esm({
|
|
|
37280
37280
|
if (allowSeparators && lastCode === 95) {
|
|
37281
37281
|
this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits");
|
|
37282
37282
|
}
|
|
37283
|
-
if (this.pos === start ||
|
|
37283
|
+
if (this.pos === start || len2 != null && this.pos - start !== len2) {
|
|
37284
37284
|
return null;
|
|
37285
37285
|
}
|
|
37286
37286
|
return total;
|
|
@@ -37571,9 +37571,9 @@ var init_acorn = __esm({
|
|
|
37571
37571
|
return String.fromCharCode(ch);
|
|
37572
37572
|
}
|
|
37573
37573
|
};
|
|
37574
|
-
pp.readHexChar = function(
|
|
37574
|
+
pp.readHexChar = function(len2) {
|
|
37575
37575
|
var codePos = this.pos;
|
|
37576
|
-
var n2 = this.readInt(16,
|
|
37576
|
+
var n2 = this.readInt(16, len2);
|
|
37577
37577
|
if (n2 === null) {
|
|
37578
37578
|
this.invalidStringToken(codePos, "Bad character escape sequence");
|
|
37579
37579
|
}
|
|
@@ -40262,17 +40262,17 @@ function getDecoder(decodeTree) {
|
|
|
40262
40262
|
while ((offset2 = str.indexOf("&", offset2)) >= 0) {
|
|
40263
40263
|
ret += str.slice(lastIndex, offset2);
|
|
40264
40264
|
decoder.startEntity(decodeMode);
|
|
40265
|
-
const
|
|
40265
|
+
const len2 = decoder.write(
|
|
40266
40266
|
str,
|
|
40267
40267
|
// Skip the "&"
|
|
40268
40268
|
offset2 + 1
|
|
40269
40269
|
);
|
|
40270
|
-
if (
|
|
40270
|
+
if (len2 < 0) {
|
|
40271
40271
|
lastIndex = offset2 + decoder.end();
|
|
40272
40272
|
break;
|
|
40273
40273
|
}
|
|
40274
|
-
lastIndex = offset2 +
|
|
40275
|
-
offset2 =
|
|
40274
|
+
lastIndex = offset2 + len2;
|
|
40275
|
+
offset2 = len2 === 0 ? lastIndex + 1 : lastIndex;
|
|
40276
40276
|
}
|
|
40277
40277
|
const result = ret + str.slice(lastIndex);
|
|
40278
40278
|
ret = "";
|
|
@@ -43612,17 +43612,17 @@ var init_attributes2 = __esm({
|
|
|
43612
43612
|
const { adapter: adapter2 } = options;
|
|
43613
43613
|
const { name } = data2;
|
|
43614
43614
|
let { value } = data2;
|
|
43615
|
-
const
|
|
43615
|
+
const len2 = value.length;
|
|
43616
43616
|
if (shouldIgnoreCase(data2, options)) {
|
|
43617
43617
|
value = value.toLowerCase();
|
|
43618
43618
|
return function hyphenIC(elem) {
|
|
43619
43619
|
const attr2 = adapter2.getAttributeValue(elem, name);
|
|
43620
|
-
return attr2 != null && (attr2.length ===
|
|
43620
|
+
return attr2 != null && (attr2.length === len2 || attr2.charAt(len2) === "-") && attr2.substr(0, len2).toLowerCase() === value && next(elem);
|
|
43621
43621
|
};
|
|
43622
43622
|
}
|
|
43623
43623
|
return function hyphen(elem) {
|
|
43624
43624
|
const attr2 = adapter2.getAttributeValue(elem, name);
|
|
43625
|
-
return attr2 != null && (attr2.length ===
|
|
43625
|
+
return attr2 != null && (attr2.length === len2 || attr2.charAt(len2) === "-") && attr2.substr(0, len2) === value && next(elem);
|
|
43626
43626
|
};
|
|
43627
43627
|
},
|
|
43628
43628
|
element(next, data2, options) {
|
|
@@ -43644,15 +43644,15 @@ var init_attributes2 = __esm({
|
|
|
43644
43644
|
const { adapter: adapter2 } = options;
|
|
43645
43645
|
const { name } = data2;
|
|
43646
43646
|
let { value } = data2;
|
|
43647
|
-
const
|
|
43648
|
-
if (
|
|
43647
|
+
const len2 = value.length;
|
|
43648
|
+
if (len2 === 0) {
|
|
43649
43649
|
return import_boolbase.default.falseFunc;
|
|
43650
43650
|
}
|
|
43651
43651
|
if (shouldIgnoreCase(data2, options)) {
|
|
43652
43652
|
value = value.toLowerCase();
|
|
43653
43653
|
return (elem) => {
|
|
43654
43654
|
const attr2 = adapter2.getAttributeValue(elem, name);
|
|
43655
|
-
return attr2 != null && attr2.length >=
|
|
43655
|
+
return attr2 != null && attr2.length >= len2 && attr2.substr(0, len2).toLowerCase() === value && next(elem);
|
|
43656
43656
|
};
|
|
43657
43657
|
}
|
|
43658
43658
|
return (elem) => {
|
|
@@ -43664,15 +43664,15 @@ var init_attributes2 = __esm({
|
|
|
43664
43664
|
const { adapter: adapter2 } = options;
|
|
43665
43665
|
const { name } = data2;
|
|
43666
43666
|
let { value } = data2;
|
|
43667
|
-
const
|
|
43668
|
-
if (
|
|
43667
|
+
const len2 = -value.length;
|
|
43668
|
+
if (len2 === 0) {
|
|
43669
43669
|
return import_boolbase.default.falseFunc;
|
|
43670
43670
|
}
|
|
43671
43671
|
if (shouldIgnoreCase(data2, options)) {
|
|
43672
43672
|
value = value.toLowerCase();
|
|
43673
43673
|
return (elem) => {
|
|
43674
43674
|
var _a4;
|
|
43675
|
-
return ((_a4 = adapter2.getAttributeValue(elem, name)) === null || _a4 === void 0 ? void 0 : _a4.substr(
|
|
43675
|
+
return ((_a4 = adapter2.getAttributeValue(elem, name)) === null || _a4 === void 0 ? void 0 : _a4.substr(len2).toLowerCase()) === value && next(elem);
|
|
43676
43676
|
};
|
|
43677
43677
|
}
|
|
43678
43678
|
return (elem) => {
|
|
@@ -57121,16 +57121,16 @@ function classifyCodePoint(codePoint) {
|
|
|
57121
57121
|
return "L";
|
|
57122
57122
|
}
|
|
57123
57123
|
function computeBidiLevels(str) {
|
|
57124
|
-
const
|
|
57125
|
-
if (
|
|
57124
|
+
const len2 = str.length;
|
|
57125
|
+
if (len2 === 0)
|
|
57126
57126
|
return null;
|
|
57127
|
-
const types5 = new Array(
|
|
57127
|
+
const types5 = new Array(len2);
|
|
57128
57128
|
let sawBidi = false;
|
|
57129
|
-
for (let i2 = 0; i2 <
|
|
57129
|
+
for (let i2 = 0; i2 < len2; ) {
|
|
57130
57130
|
const first = str.charCodeAt(i2);
|
|
57131
57131
|
let codePoint = first;
|
|
57132
57132
|
let codeUnitLength = 1;
|
|
57133
|
-
if (first >= 55296 && first <= 56319 && i2 + 1 <
|
|
57133
|
+
if (first >= 55296 && first <= 56319 && i2 + 1 < len2) {
|
|
57134
57134
|
const second = str.charCodeAt(i2 + 1);
|
|
57135
57135
|
if (second >= 56320 && second <= 57343) {
|
|
57136
57136
|
codePoint = (first - 55296 << 10) + (second - 56320) + 65536;
|
|
@@ -57148,7 +57148,7 @@ function computeBidiLevels(str) {
|
|
|
57148
57148
|
if (!sawBidi)
|
|
57149
57149
|
return null;
|
|
57150
57150
|
let startLevel = 0;
|
|
57151
|
-
for (let i2 = 0; i2 <
|
|
57151
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
57152
57152
|
const t2 = types5[i2];
|
|
57153
57153
|
if (t2 === "L") {
|
|
57154
57154
|
startLevel = 0;
|
|
@@ -57159,31 +57159,31 @@ function computeBidiLevels(str) {
|
|
|
57159
57159
|
break;
|
|
57160
57160
|
}
|
|
57161
57161
|
}
|
|
57162
|
-
const levels = new Int8Array(
|
|
57163
|
-
for (let i2 = 0; i2 <
|
|
57162
|
+
const levels = new Int8Array(len2);
|
|
57163
|
+
for (let i2 = 0; i2 < len2; i2++)
|
|
57164
57164
|
levels[i2] = startLevel;
|
|
57165
57165
|
const e3 = startLevel & 1 ? "R" : "L";
|
|
57166
57166
|
const sor = e3;
|
|
57167
57167
|
let lastType = sor;
|
|
57168
|
-
for (let i2 = 0; i2 <
|
|
57168
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
57169
57169
|
if (types5[i2] === "NSM")
|
|
57170
57170
|
types5[i2] = lastType;
|
|
57171
57171
|
else
|
|
57172
57172
|
lastType = types5[i2];
|
|
57173
57173
|
}
|
|
57174
57174
|
lastType = sor;
|
|
57175
|
-
for (let i2 = 0; i2 <
|
|
57175
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
57176
57176
|
const t2 = types5[i2];
|
|
57177
57177
|
if (t2 === "EN")
|
|
57178
57178
|
types5[i2] = lastType === "AL" ? "AN" : "EN";
|
|
57179
57179
|
else if (t2 === "R" || t2 === "L" || t2 === "AL")
|
|
57180
57180
|
lastType = t2;
|
|
57181
57181
|
}
|
|
57182
|
-
for (let i2 = 0; i2 <
|
|
57182
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
57183
57183
|
if (types5[i2] === "AL")
|
|
57184
57184
|
types5[i2] = "R";
|
|
57185
57185
|
}
|
|
57186
|
-
for (let i2 = 1; i2 <
|
|
57186
|
+
for (let i2 = 1; i2 < len2 - 1; i2++) {
|
|
57187
57187
|
if (types5[i2] === "ES" && types5[i2 - 1] === "EN" && types5[i2 + 1] === "EN") {
|
|
57188
57188
|
types5[i2] = "EN";
|
|
57189
57189
|
}
|
|
@@ -57191,36 +57191,36 @@ function computeBidiLevels(str) {
|
|
|
57191
57191
|
types5[i2] = types5[i2 - 1];
|
|
57192
57192
|
}
|
|
57193
57193
|
}
|
|
57194
|
-
for (let i2 = 0; i2 <
|
|
57194
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
57195
57195
|
if (types5[i2] !== "EN")
|
|
57196
57196
|
continue;
|
|
57197
57197
|
let j3;
|
|
57198
57198
|
for (j3 = i2 - 1; j3 >= 0 && types5[j3] === "ET"; j3--)
|
|
57199
57199
|
types5[j3] = "EN";
|
|
57200
|
-
for (j3 = i2 + 1; j3 <
|
|
57200
|
+
for (j3 = i2 + 1; j3 < len2 && types5[j3] === "ET"; j3++)
|
|
57201
57201
|
types5[j3] = "EN";
|
|
57202
57202
|
}
|
|
57203
|
-
for (let i2 = 0; i2 <
|
|
57203
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
57204
57204
|
const t2 = types5[i2];
|
|
57205
57205
|
if (t2 === "WS" || t2 === "ES" || t2 === "ET" || t2 === "CS")
|
|
57206
57206
|
types5[i2] = "ON";
|
|
57207
57207
|
}
|
|
57208
57208
|
lastType = sor;
|
|
57209
|
-
for (let i2 = 0; i2 <
|
|
57209
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
57210
57210
|
const t2 = types5[i2];
|
|
57211
57211
|
if (t2 === "EN")
|
|
57212
57212
|
types5[i2] = lastType === "L" ? "L" : "EN";
|
|
57213
57213
|
else if (t2 === "R" || t2 === "L")
|
|
57214
57214
|
lastType = t2;
|
|
57215
57215
|
}
|
|
57216
|
-
for (let i2 = 0; i2 <
|
|
57216
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
57217
57217
|
if (types5[i2] !== "ON")
|
|
57218
57218
|
continue;
|
|
57219
57219
|
let end = i2 + 1;
|
|
57220
|
-
while (end <
|
|
57220
|
+
while (end < len2 && types5[end] === "ON")
|
|
57221
57221
|
end++;
|
|
57222
57222
|
const before3 = i2 > 0 ? types5[i2 - 1] : sor;
|
|
57223
|
-
const after2 = end <
|
|
57223
|
+
const after2 = end < len2 ? types5[end] : sor;
|
|
57224
57224
|
const bDir = before3 !== "L" ? "R" : "L";
|
|
57225
57225
|
const aDir = after2 !== "L" ? "R" : "L";
|
|
57226
57226
|
if (bDir === aDir) {
|
|
@@ -57229,11 +57229,11 @@ function computeBidiLevels(str) {
|
|
|
57229
57229
|
}
|
|
57230
57230
|
i2 = end - 1;
|
|
57231
57231
|
}
|
|
57232
|
-
for (let i2 = 0; i2 <
|
|
57232
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
57233
57233
|
if (types5[i2] === "ON")
|
|
57234
57234
|
types5[i2] = e3;
|
|
57235
57235
|
}
|
|
57236
|
-
for (let i2 = 0; i2 <
|
|
57236
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
57237
57237
|
const t2 = types5[i2];
|
|
57238
57238
|
if ((levels[i2] & 1) === 0) {
|
|
57239
57239
|
if (t2 === "R")
|
|
@@ -67679,14 +67679,14 @@ function resolveCssAssetCandidates(projectDir, url, htmlCompSrcPath, cssRootRela
|
|
|
67679
67679
|
return resolveLocalAssetCandidates(projectDir, url);
|
|
67680
67680
|
}
|
|
67681
67681
|
async function lintProject(projectDir) {
|
|
67682
|
-
const
|
|
67682
|
+
const indexPath2 = resolve7(projectDir, "index.html");
|
|
67683
67683
|
const results = [];
|
|
67684
67684
|
let totalErrors = 0;
|
|
67685
67685
|
let totalWarnings = 0;
|
|
67686
67686
|
let totalInfos = 0;
|
|
67687
|
-
const rootHtml = readFileSync4(
|
|
67687
|
+
const rootHtml = readFileSync4(indexPath2, "utf-8");
|
|
67688
67688
|
const rootResult = await lintHyperframeHtml(rootHtml, {
|
|
67689
|
-
filePath:
|
|
67689
|
+
filePath: indexPath2,
|
|
67690
67690
|
externalStyles: collectExternalStyles(projectDir, rootHtml)
|
|
67691
67691
|
});
|
|
67692
67692
|
results.push({ file: "index.html", result: rootResult });
|
|
@@ -70898,10 +70898,10 @@ function hoistCompositionScripts(container, opts) {
|
|
|
70898
70898
|
}
|
|
70899
70899
|
}
|
|
70900
70900
|
async function bundleToSingleHtml(projectDir, options) {
|
|
70901
|
-
const
|
|
70902
|
-
if (!existsSync10(
|
|
70901
|
+
const indexPath2 = join10(projectDir, "index.html");
|
|
70902
|
+
if (!existsSync10(indexPath2))
|
|
70903
70903
|
throw new Error("index.html not found in project directory");
|
|
70904
|
-
const rawHtml = readFileSync5(
|
|
70904
|
+
const rawHtml = readFileSync5(indexPath2, "utf-8");
|
|
70905
70905
|
const compiled = await compileHtml(rawHtml, projectDir, options?.probeMediaDuration);
|
|
70906
70906
|
const staticGuard = await validateHyperframeHtmlContract(compiled);
|
|
70907
70907
|
if (!staticGuard.isValid) {
|
|
@@ -74396,16 +74396,16 @@ function getLinearToHlgLut() {
|
|
|
74396
74396
|
}
|
|
74397
74397
|
function hdrToLinear(buf, transfer) {
|
|
74398
74398
|
const lut = transfer === "pq" ? getPqToLinearLut() : getHlgToLinearLut();
|
|
74399
|
-
const
|
|
74400
|
-
for (let i2 = 0; i2 <
|
|
74399
|
+
const len2 = buf.length / 2;
|
|
74400
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
74401
74401
|
const off = i2 * 2;
|
|
74402
74402
|
buf.writeUInt16LE(lut[buf.readUInt16LE(off)] ?? 0, off);
|
|
74403
74403
|
}
|
|
74404
74404
|
}
|
|
74405
74405
|
function linearToHdr(buf, transfer) {
|
|
74406
74406
|
const lut = transfer === "pq" ? getLinearToPqLut() : getLinearToHlgLut();
|
|
74407
|
-
const
|
|
74408
|
-
for (let i2 = 0; i2 <
|
|
74407
|
+
const len2 = buf.length / 2;
|
|
74408
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
74409
74409
|
const off = i2 * 2;
|
|
74410
74410
|
buf.writeUInt16LE(lut[buf.readUInt16LE(off)] ?? 0, off);
|
|
74411
74411
|
}
|
|
@@ -74429,8 +74429,8 @@ function getPqToHlgLut() {
|
|
|
74429
74429
|
function convertTransfer(buf, from, to) {
|
|
74430
74430
|
if (from === to) return;
|
|
74431
74431
|
const lut = from === "hlg" ? getHlgToPqLut() : getPqToHlgLut();
|
|
74432
|
-
const
|
|
74433
|
-
for (let i2 = 0; i2 <
|
|
74432
|
+
const len2 = buf.length / 2;
|
|
74433
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
74434
74434
|
const off = i2 * 2;
|
|
74435
74435
|
buf.writeUInt16LE(lut[buf.readUInt16LE(off)] ?? 0, off);
|
|
74436
74436
|
}
|
|
@@ -81103,8 +81103,8 @@ function formatRenderSummaryDetail(input2) {
|
|
|
81103
81103
|
return [middle, renderTime].filter(Boolean).join(" \xB7 ");
|
|
81104
81104
|
}
|
|
81105
81105
|
function label(name, value) {
|
|
81106
|
-
const
|
|
81107
|
-
return ` ${c.dim(name)}${" ".repeat(Math.max(1,
|
|
81106
|
+
const pad4 = 14 - name.length;
|
|
81107
|
+
return ` ${c.dim(name)}${" ".repeat(Math.max(1, pad4))}${c.bold(value)}`;
|
|
81108
81108
|
}
|
|
81109
81109
|
function errorBox(title, hint2, suggestion) {
|
|
81110
81110
|
console.error(`
|
|
@@ -81135,18 +81135,18 @@ function resolveProjectOrThrow(dirArg) {
|
|
|
81135
81135
|
}
|
|
81136
81136
|
const dir = resolve15(dirArg ?? ".");
|
|
81137
81137
|
const name = basename2(dir);
|
|
81138
|
-
const
|
|
81138
|
+
const indexPath2 = resolve15(dir, "index.html");
|
|
81139
81139
|
if (!existsSync26(dir) || !statSync7(dir).isDirectory()) {
|
|
81140
81140
|
throw new InvalidProjectError("Not a directory: " + dir);
|
|
81141
81141
|
}
|
|
81142
|
-
if (!existsSync26(
|
|
81142
|
+
if (!existsSync26(indexPath2)) {
|
|
81143
81143
|
throw new InvalidProjectError(
|
|
81144
81144
|
"No composition found in " + dir,
|
|
81145
81145
|
"No index.html file found.",
|
|
81146
81146
|
"Run npx hyperframes init to create a new composition."
|
|
81147
81147
|
);
|
|
81148
81148
|
}
|
|
81149
|
-
return { dir, name, indexPath };
|
|
81149
|
+
return { dir, name, indexPath: indexPath2 };
|
|
81150
81150
|
}
|
|
81151
81151
|
function resolveProject(dirArg) {
|
|
81152
81152
|
try {
|
|
@@ -86917,12 +86917,12 @@ var require_parser2 = __commonJS({
|
|
|
86917
86917
|
if (this.currToken[tokenize_1.FIELDS.TYPE] !== tokens.closeSquare) {
|
|
86918
86918
|
return this.expected("closing square bracket", this.currToken[tokenize_1.FIELDS.START_POS]);
|
|
86919
86919
|
}
|
|
86920
|
-
var
|
|
86920
|
+
var len2 = attr2.length;
|
|
86921
86921
|
var node = {
|
|
86922
86922
|
source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]),
|
|
86923
86923
|
sourceIndex: startingToken[tokenize_1.FIELDS.START_POS]
|
|
86924
86924
|
};
|
|
86925
|
-
if (
|
|
86925
|
+
if (len2 === 1 && !~[tokens.word].indexOf(attr2[0][tokenize_1.FIELDS.TYPE])) {
|
|
86926
86926
|
return this.expected("attribute", attr2[0][tokenize_1.FIELDS.START_POS]);
|
|
86927
86927
|
}
|
|
86928
86928
|
var pos = 0;
|
|
@@ -86930,7 +86930,7 @@ var require_parser2 = __commonJS({
|
|
|
86930
86930
|
var commentBefore = "";
|
|
86931
86931
|
var lastAdded = null;
|
|
86932
86932
|
var spaceAfterMeaningfulToken = false;
|
|
86933
|
-
while (pos <
|
|
86933
|
+
while (pos < len2) {
|
|
86934
86934
|
var token = attr2[pos];
|
|
86935
86935
|
var content = this.content(token);
|
|
86936
86936
|
var next = attr2[pos + 1];
|
|
@@ -93393,10 +93393,10 @@ function buildSubCompositionHtml(projectDir, compPath, runtimeUrl, baseHref) {
|
|
|
93393
93393
|
}
|
|
93394
93394
|
rewrittenContent = stripEmbeddedRuntimeScripts(rewrittenContent);
|
|
93395
93395
|
rewrittenContent = tagRootCompositionFile(rewrittenContent, compPath);
|
|
93396
|
-
const
|
|
93396
|
+
const indexPath2 = join72(projectDir, "index.html");
|
|
93397
93397
|
let headContent = "";
|
|
93398
|
-
if (existsSync42(
|
|
93399
|
-
const indexHtml = readFileSync42(
|
|
93398
|
+
if (existsSync42(indexPath2)) {
|
|
93399
|
+
const indexHtml = readFileSync42(indexPath2, "utf-8");
|
|
93400
93400
|
const headMatch = indexHtml.match(/<head[^>]*>([\s\S]*?)<\/head>/i);
|
|
93401
93401
|
headContent = headMatch?.[1] ?? "";
|
|
93402
93402
|
}
|
|
@@ -93852,9 +93852,9 @@ async function transformPreviewHtml(html, adapter2, project, activeCompositionPa
|
|
|
93852
93852
|
}
|
|
93853
93853
|
}
|
|
93854
93854
|
function resolveProjectMainHtml(projectDir, projectId) {
|
|
93855
|
-
const
|
|
93856
|
-
if (existsSync52(
|
|
93857
|
-
return { html: readFileSync72(
|
|
93855
|
+
const indexPath2 = join82(projectDir, "index.html");
|
|
93856
|
+
if (existsSync52(indexPath2)) {
|
|
93857
|
+
return { html: readFileSync72(indexPath2, "utf-8"), compositionPath: "index.html" };
|
|
93858
93858
|
}
|
|
93859
93859
|
const blockHtmlPath = join82(projectDir, `${projectId}.html`);
|
|
93860
93860
|
if (existsSync52(blockHtmlPath)) {
|
|
@@ -95188,16 +95188,16 @@ function getElementScreenshotClip(selector, selectorIndex) {
|
|
|
95188
95188
|
if (!(el instanceof HTMLElement)) return void 0;
|
|
95189
95189
|
const rect = el.getBoundingClientRect();
|
|
95190
95190
|
if (rect.width < 4 || rect.height < 4) return void 0;
|
|
95191
|
-
const
|
|
95192
|
-
const x3 = Math.max(0, rect.left -
|
|
95193
|
-
const y = Math.max(0, rect.top -
|
|
95191
|
+
const pad4 = 8;
|
|
95192
|
+
const x3 = Math.max(0, rect.left - pad4);
|
|
95193
|
+
const y = Math.max(0, rect.top - pad4);
|
|
95194
95194
|
const maxWidth = window.innerWidth - x3;
|
|
95195
95195
|
const maxHeight = window.innerHeight - y;
|
|
95196
95196
|
return {
|
|
95197
95197
|
x: x3,
|
|
95198
95198
|
y,
|
|
95199
|
-
width: Math.max(1, Math.min(rect.width +
|
|
95200
|
-
height: Math.max(1, Math.min(rect.height +
|
|
95199
|
+
width: Math.max(1, Math.min(rect.width + pad4 * 2, maxWidth)),
|
|
95200
|
+
height: Math.max(1, Math.min(rect.height + pad4 * 2, maxHeight))
|
|
95201
95201
|
};
|
|
95202
95202
|
}
|
|
95203
95203
|
var import_postcss_selector_parser, IGNORE_DIRS, COMPOSITION_ID_RE, MIME_TYPES2, SAMPLE_RATE, PEAK_COUNT, WAVEFORM_CACHE_VERSION, VIDEO_EXT, AUDIO_EXT, DEFAULT_KEEP_PER_FILE, DOM_PATCH_NULL_VALUE_PATH, HOLD_SYNC_MUTATION_TYPES, REGEXP_SPECIALS, NON_RENDERED_TAGS, SIGNATURE_TEXT_EXTENSIONS, SIGNATURE_EXCLUDED_DIRS, MAX_SIGNATURE_TEXT_BYTES, STUDIO_SIGNATURE_MANIFEST_PATHS, projectSignatureCache, STUDIO_MOTION_PATH, PROJECT_SIGNATURE_META, GSAP_CDN_VERSION, GSAP_CDN_SCRIPT, GSAP_CUSTOM_EASE_CDN_SCRIPT, GSAP_MOTION_PATH_CDN_SCRIPT, GSAP_CDN_FALLBACK_SCRIPT, VALID_RESOLUTIONS, STUDIO_MANUAL_EDITS_PATH, THUMBNAIL_CACHE_VERSION, MAX_FONT_RESULTS, GOOGLE_FONTS_METADATA_URL, GOOGLE_FONTS_FETCH_TIMEOUT_MS, cachedFonts, cachedGoogleFonts, GOOGLE_FONT_FALLBACKS;
|
|
@@ -95395,16 +95395,16 @@ function getElementScreenshotClip2(selector, selectorIndex) {
|
|
|
95395
95395
|
if (!(el instanceof HTMLElement)) return void 0;
|
|
95396
95396
|
const rect = el.getBoundingClientRect();
|
|
95397
95397
|
if (rect.width < 4 || rect.height < 4) return void 0;
|
|
95398
|
-
const
|
|
95399
|
-
const x3 = Math.max(0, rect.left -
|
|
95400
|
-
const y = Math.max(0, rect.top -
|
|
95398
|
+
const pad4 = 8;
|
|
95399
|
+
const x3 = Math.max(0, rect.left - pad4);
|
|
95400
|
+
const y = Math.max(0, rect.top - pad4);
|
|
95401
95401
|
const maxWidth = window.innerWidth - x3;
|
|
95402
95402
|
const maxHeight = window.innerHeight - y;
|
|
95403
95403
|
return {
|
|
95404
95404
|
x: x3,
|
|
95405
95405
|
y,
|
|
95406
|
-
width: Math.max(1, Math.min(rect.width +
|
|
95407
|
-
height: Math.max(1, Math.min(rect.height +
|
|
95406
|
+
width: Math.max(1, Math.min(rect.width + pad4 * 2, maxWidth)),
|
|
95407
|
+
height: Math.max(1, Math.min(rect.height + pad4 * 2, maxHeight))
|
|
95408
95408
|
};
|
|
95409
95409
|
}
|
|
95410
95410
|
var init_screenshotClip = __esm({
|
|
@@ -95563,8 +95563,8 @@ function compareVersionDirsDescending(a, b2) {
|
|
|
95563
95563
|
if (!pa && !pb) return 0;
|
|
95564
95564
|
if (!pa) return 1;
|
|
95565
95565
|
if (!pb) return -1;
|
|
95566
|
-
const
|
|
95567
|
-
for (let i2 = 0; i2 <
|
|
95566
|
+
const len2 = Math.max(pa.length, pb.length);
|
|
95567
|
+
for (let i2 = 0; i2 < len2; i2 += 1) {
|
|
95568
95568
|
const av = pa[i2] ?? 0;
|
|
95569
95569
|
const bv = pb[i2] ?? 0;
|
|
95570
95570
|
if (av !== bv) return bv - av;
|
|
@@ -96141,16 +96141,16 @@ var require_compress_binding = __commonJS({
|
|
|
96141
96141
|
return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
|
|
96142
96142
|
}
|
|
96143
96143
|
function lengthBytesUTF8(str) {
|
|
96144
|
-
var
|
|
96144
|
+
var len2 = 0;
|
|
96145
96145
|
for (var i2 = 0; i2 < str.length; ++i2) {
|
|
96146
96146
|
var u = str.charCodeAt(i2);
|
|
96147
96147
|
if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i2) & 1023;
|
|
96148
|
-
if (u <= 127) ++
|
|
96149
|
-
else if (u <= 2047)
|
|
96150
|
-
else if (u <= 65535)
|
|
96151
|
-
else
|
|
96148
|
+
if (u <= 127) ++len2;
|
|
96149
|
+
else if (u <= 2047) len2 += 2;
|
|
96150
|
+
else if (u <= 65535) len2 += 3;
|
|
96151
|
+
else len2 += 4;
|
|
96152
96152
|
}
|
|
96153
|
-
return
|
|
96153
|
+
return len2;
|
|
96154
96154
|
}
|
|
96155
96155
|
var UTF16Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-16le") : void 0;
|
|
96156
96156
|
function UTF16ToString(ptr, maxBytesToRead) {
|
|
@@ -96227,13 +96227,13 @@ var require_compress_binding = __commonJS({
|
|
|
96227
96227
|
return outPtr - startPtr;
|
|
96228
96228
|
}
|
|
96229
96229
|
function lengthBytesUTF32(str) {
|
|
96230
|
-
var
|
|
96230
|
+
var len2 = 0;
|
|
96231
96231
|
for (var i2 = 0; i2 < str.length; ++i2) {
|
|
96232
96232
|
var codeUnit = str.charCodeAt(i2);
|
|
96233
96233
|
if (codeUnit >= 55296 && codeUnit <= 57343) ++i2;
|
|
96234
|
-
|
|
96234
|
+
len2 += 4;
|
|
96235
96235
|
}
|
|
96236
|
-
return
|
|
96236
|
+
return len2;
|
|
96237
96237
|
}
|
|
96238
96238
|
function alignUp(x3, multiple) {
|
|
96239
96239
|
if (x3 % multiple > 0) {
|
|
@@ -97701,16 +97701,16 @@ var require_decompress_binding = __commonJS({
|
|
|
97701
97701
|
return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
|
|
97702
97702
|
}
|
|
97703
97703
|
function lengthBytesUTF8(str) {
|
|
97704
|
-
var
|
|
97704
|
+
var len2 = 0;
|
|
97705
97705
|
for (var i2 = 0; i2 < str.length; ++i2) {
|
|
97706
97706
|
var u = str.charCodeAt(i2);
|
|
97707
97707
|
if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i2) & 1023;
|
|
97708
|
-
if (u <= 127) ++
|
|
97709
|
-
else if (u <= 2047)
|
|
97710
|
-
else if (u <= 65535)
|
|
97711
|
-
else
|
|
97708
|
+
if (u <= 127) ++len2;
|
|
97709
|
+
else if (u <= 2047) len2 += 2;
|
|
97710
|
+
else if (u <= 65535) len2 += 3;
|
|
97711
|
+
else len2 += 4;
|
|
97712
97712
|
}
|
|
97713
|
-
return
|
|
97713
|
+
return len2;
|
|
97714
97714
|
}
|
|
97715
97715
|
var UTF16Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-16le") : void 0;
|
|
97716
97716
|
function UTF16ToString(ptr, maxBytesToRead) {
|
|
@@ -97787,13 +97787,13 @@ var require_decompress_binding = __commonJS({
|
|
|
97787
97787
|
return outPtr - startPtr;
|
|
97788
97788
|
}
|
|
97789
97789
|
function lengthBytesUTF32(str) {
|
|
97790
|
-
var
|
|
97790
|
+
var len2 = 0;
|
|
97791
97791
|
for (var i2 = 0; i2 < str.length; ++i2) {
|
|
97792
97792
|
var codeUnit = str.charCodeAt(i2);
|
|
97793
97793
|
if (codeUnit >= 55296 && codeUnit <= 57343) ++i2;
|
|
97794
|
-
|
|
97794
|
+
len2 += 4;
|
|
97795
97795
|
}
|
|
97796
|
-
return
|
|
97796
|
+
return len2;
|
|
97797
97797
|
}
|
|
97798
97798
|
function alignUp(x3, multiple) {
|
|
97799
97799
|
if (x3 % multiple > 0) {
|
|
@@ -110543,9 +110543,9 @@ async function loadPreviewServerBuildSignature() {
|
|
|
110543
110543
|
]);
|
|
110544
110544
|
}
|
|
110545
110545
|
function rewriteWrittenToHostViewport(projectDir, written) {
|
|
110546
|
-
const
|
|
110547
|
-
if (!existsSync54(
|
|
110548
|
-
const indexHtml = readFileSync34(
|
|
110546
|
+
const indexPath2 = join61(projectDir, "index.html");
|
|
110547
|
+
if (!existsSync54(indexPath2)) return;
|
|
110548
|
+
const indexHtml = readFileSync34(indexPath2, "utf-8");
|
|
110549
110549
|
const hostW = indexHtml.match(/data-width="(\d+)"/)?.[1];
|
|
110550
110550
|
const hostH = indexHtml.match(/data-height="(\d+)"/)?.[1];
|
|
110551
110551
|
if (!hostW || !hostH) return;
|
|
@@ -110867,8 +110867,8 @@ function createStudioServer(options) {
|
|
|
110867
110867
|
return `<script>window.__HF_STUDIO_ENV__=${JSON.stringify(overrides)};</script>`;
|
|
110868
110868
|
}
|
|
110869
110869
|
app.get("*", (c3) => {
|
|
110870
|
-
const
|
|
110871
|
-
if (!existsSync54(
|
|
110870
|
+
const indexPath2 = resolve30(studioDir, "index.html");
|
|
110871
|
+
if (!existsSync54(indexPath2)) {
|
|
110872
110872
|
return c3.html(
|
|
110873
110873
|
`<!doctype html>
|
|
110874
110874
|
<html>
|
|
@@ -110924,7 +110924,7 @@ function createStudioServer(options) {
|
|
|
110924
110924
|
500
|
|
110925
110925
|
);
|
|
110926
110926
|
}
|
|
110927
|
-
let html = readFileSync34(
|
|
110927
|
+
let html = readFileSync34(indexPath2, "utf-8");
|
|
110928
110928
|
const headScript = buildStudioHeadScripts(buildRuntimeEnvScript());
|
|
110929
110929
|
if (headScript) {
|
|
110930
110930
|
html = html.replace("<head>", `<head>${headScript}`);
|
|
@@ -113990,8 +113990,8 @@ var init_publish = __esm({
|
|
|
113990
113990
|
async run({ args }) {
|
|
113991
113991
|
const rawArg = args.dir;
|
|
113992
113992
|
const dir = resolve40(rawArg ?? ".");
|
|
113993
|
-
const
|
|
113994
|
-
if (existsSync63(
|
|
113993
|
+
const indexPath2 = join66(dir, "index.html");
|
|
113994
|
+
if (existsSync63(indexPath2)) {
|
|
113995
113995
|
const lintResult = await lintProject(dir);
|
|
113996
113996
|
if (lintResult.totalErrors > 0 || lintResult.totalWarnings > 0) {
|
|
113997
113997
|
console.log();
|
|
@@ -114143,14 +114143,14 @@ function resolveVariablesArg(inline, filePath) {
|
|
|
114143
114143
|
}
|
|
114144
114144
|
return result.value;
|
|
114145
114145
|
}
|
|
114146
|
-
function validateVariablesAgainstProject(
|
|
114147
|
-
const schema = loadProjectVariableSchema(
|
|
114146
|
+
function validateVariablesAgainstProject(indexPath2, values) {
|
|
114147
|
+
const schema = loadProjectVariableSchema(indexPath2);
|
|
114148
114148
|
return validateVariablesAgainstSchema(values, schema);
|
|
114149
114149
|
}
|
|
114150
|
-
function loadProjectVariableSchema(
|
|
114150
|
+
function loadProjectVariableSchema(indexPath2) {
|
|
114151
114151
|
let html;
|
|
114152
114152
|
try {
|
|
114153
|
-
html = readFileSync39(
|
|
114153
|
+
html = readFileSync39(indexPath2, "utf8");
|
|
114154
114154
|
} catch {
|
|
114155
114155
|
return [];
|
|
114156
114156
|
}
|
|
@@ -114845,8 +114845,8 @@ function checkOutputCollisions(rows, manifestPath2) {
|
|
|
114845
114845
|
seen.set(row.outputPath, row.index);
|
|
114846
114846
|
}
|
|
114847
114847
|
}
|
|
114848
|
-
function validateBatchVariables(rows,
|
|
114849
|
-
const schema = loadProjectVariableSchema(
|
|
114848
|
+
function validateBatchVariables(rows, indexPath2, strictVariables, quiet, json) {
|
|
114849
|
+
const schema = loadProjectVariableSchema(indexPath2);
|
|
114850
114850
|
let issueCount = 0;
|
|
114851
114851
|
const strictRows = [];
|
|
114852
114852
|
for (let index = 0; index < rows.length; index++) {
|
|
@@ -120269,11 +120269,11 @@ function groupTraces(tweens) {
|
|
|
120269
120269
|
}
|
|
120270
120270
|
return traces;
|
|
120271
120271
|
}
|
|
120272
|
-
function collectCompositions(
|
|
120273
|
-
const html = readFileSync47(
|
|
120274
|
-
const baseDir = dirname33(
|
|
120272
|
+
function collectCompositions(indexPath2) {
|
|
120273
|
+
const html = readFileSync47(indexPath2, "utf-8");
|
|
120274
|
+
const baseDir = dirname33(indexPath2);
|
|
120275
120275
|
const out = [
|
|
120276
|
-
surfaceComposition(html, basename14(
|
|
120276
|
+
surfaceComposition(html, basename14(indexPath2), basename14(indexPath2))
|
|
120277
120277
|
];
|
|
120278
120278
|
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
120279
120279
|
for (const div of Array.from(doc.querySelectorAll("[data-composition-src]"))) {
|
|
@@ -132617,7 +132617,7 @@ var require_bignumber = __commonJS({
|
|
|
132617
132617
|
suffix: ""
|
|
132618
132618
|
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
|
|
132619
132619
|
function BigNumber2(v2, b2) {
|
|
132620
|
-
var alphabet, c3, caseChanged, e3, i2, isNum,
|
|
132620
|
+
var alphabet, c3, caseChanged, e3, i2, isNum, len2, str, x3 = this;
|
|
132621
132621
|
if (!(x3 instanceof BigNumber2)) return new BigNumber2(v2, b2);
|
|
132622
132622
|
if (b2 == null) {
|
|
132623
132623
|
if (v2 && v2._isBigNumber === true) {
|
|
@@ -132675,11 +132675,11 @@ var require_bignumber = __commonJS({
|
|
|
132675
132675
|
}
|
|
132676
132676
|
alphabet = ALPHABET.slice(0, b2);
|
|
132677
132677
|
e3 = i2 = 0;
|
|
132678
|
-
for (
|
|
132678
|
+
for (len2 = str.length; i2 < len2; i2++) {
|
|
132679
132679
|
if (alphabet.indexOf(c3 = str.charAt(i2)) < 0) {
|
|
132680
132680
|
if (c3 == ".") {
|
|
132681
132681
|
if (i2 > e3) {
|
|
132682
|
-
e3 =
|
|
132682
|
+
e3 = len2;
|
|
132683
132683
|
continue;
|
|
132684
132684
|
}
|
|
132685
132685
|
} else if (!caseChanged) {
|
|
@@ -132699,10 +132699,10 @@ var require_bignumber = __commonJS({
|
|
|
132699
132699
|
else e3 = str.length;
|
|
132700
132700
|
}
|
|
132701
132701
|
for (i2 = 0; str.charCodeAt(i2) === 48; i2++) ;
|
|
132702
|
-
for (
|
|
132703
|
-
if (str = str.slice(i2, ++
|
|
132704
|
-
|
|
132705
|
-
if (isNum && BigNumber2.DEBUG &&
|
|
132702
|
+
for (len2 = str.length; str.charCodeAt(--len2) === 48; ) ;
|
|
132703
|
+
if (str = str.slice(i2, ++len2)) {
|
|
132704
|
+
len2 -= i2;
|
|
132705
|
+
if (isNum && BigNumber2.DEBUG && len2 > 15 && (v2 > MAX_SAFE_INTEGER || v2 !== mathfloor(v2))) {
|
|
132706
132706
|
throw Error(tooManyDigits + x3.s * v2);
|
|
132707
132707
|
}
|
|
132708
132708
|
if ((e3 = e3 - i2 - 1) > MAX_EXP) {
|
|
@@ -132714,14 +132714,14 @@ var require_bignumber = __commonJS({
|
|
|
132714
132714
|
x3.c = [];
|
|
132715
132715
|
i2 = (e3 + 1) % LOG_BASE;
|
|
132716
132716
|
if (e3 < 0) i2 += LOG_BASE;
|
|
132717
|
-
if (i2 <
|
|
132717
|
+
if (i2 < len2) {
|
|
132718
132718
|
if (i2) x3.c.push(+str.slice(0, i2));
|
|
132719
|
-
for (
|
|
132719
|
+
for (len2 -= LOG_BASE; i2 < len2; ) {
|
|
132720
132720
|
x3.c.push(+str.slice(i2, i2 += LOG_BASE));
|
|
132721
132721
|
}
|
|
132722
132722
|
i2 = LOG_BASE - (str = str.slice(i2)).length;
|
|
132723
132723
|
} else {
|
|
132724
|
-
i2 -=
|
|
132724
|
+
i2 -= len2;
|
|
132725
132725
|
}
|
|
132726
132726
|
for (; i2--; str += "0") ;
|
|
132727
132727
|
x3.c.push(+str);
|
|
@@ -132948,8 +132948,8 @@ var require_bignumber = __commonJS({
|
|
|
132948
132948
|
convertBase = /* @__PURE__ */ (function() {
|
|
132949
132949
|
var decimal = "0123456789";
|
|
132950
132950
|
function toBaseOut(str, baseIn, baseOut, alphabet) {
|
|
132951
|
-
var j3, arr = [0], arrL, i2 = 0,
|
|
132952
|
-
for (; i2 <
|
|
132951
|
+
var j3, arr = [0], arrL, i2 = 0, len2 = str.length;
|
|
132952
|
+
for (; i2 < len2; ) {
|
|
132953
132953
|
for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
|
|
132954
132954
|
arr[0] += alphabet.indexOf(str.charAt(i2++));
|
|
132955
132955
|
for (j3 = 0; j3 < arr.length; j3++) {
|
|
@@ -133162,7 +133162,7 @@ var require_bignumber = __commonJS({
|
|
|
133162
133162
|
};
|
|
133163
133163
|
})();
|
|
133164
133164
|
function format(n2, i2, rm, id) {
|
|
133165
|
-
var c0, e3, ne2,
|
|
133165
|
+
var c0, e3, ne2, len2, str;
|
|
133166
133166
|
if (rm == null) rm = ROUNDING_MODE;
|
|
133167
133167
|
else intCheck(rm, 0, 8);
|
|
133168
133168
|
if (!n2.c) return n2.toString();
|
|
@@ -133175,19 +133175,19 @@ var require_bignumber = __commonJS({
|
|
|
133175
133175
|
n2 = round5(new BigNumber2(n2), i2, rm);
|
|
133176
133176
|
e3 = n2.e;
|
|
133177
133177
|
str = coeffToString(n2.c);
|
|
133178
|
-
|
|
133178
|
+
len2 = str.length;
|
|
133179
133179
|
if (id == 1 || id == 2 && (i2 <= e3 || e3 <= TO_EXP_NEG)) {
|
|
133180
|
-
for (;
|
|
133180
|
+
for (; len2 < i2; str += "0", len2++) ;
|
|
133181
133181
|
str = toExponential(str, e3);
|
|
133182
133182
|
} else {
|
|
133183
133183
|
i2 -= ne2 + (id === 2 && e3 > ne2);
|
|
133184
133184
|
str = toFixedPoint(str, e3, "0");
|
|
133185
|
-
if (e3 + 1 >
|
|
133185
|
+
if (e3 + 1 > len2) {
|
|
133186
133186
|
if (--i2 > 0) for (str += "."; i2--; str += "0") ;
|
|
133187
133187
|
} else {
|
|
133188
|
-
i2 += e3 -
|
|
133188
|
+
i2 += e3 - len2;
|
|
133189
133189
|
if (i2 > 0) {
|
|
133190
|
-
if (e3 + 1 ==
|
|
133190
|
+
if (e3 + 1 == len2) str += ".";
|
|
133191
133191
|
for (; i2--; str += "0") ;
|
|
133192
133192
|
}
|
|
133193
133193
|
}
|
|
@@ -133773,17 +133773,17 @@ var require_bignumber = __commonJS({
|
|
|
133773
133773
|
}
|
|
133774
133774
|
str = x3.toFixed(dp, rm);
|
|
133775
133775
|
if (x3.c) {
|
|
133776
|
-
var i2, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x3.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart,
|
|
133776
|
+
var i2, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x3.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len2 = intDigits.length;
|
|
133777
133777
|
if (g2) {
|
|
133778
133778
|
i2 = g1;
|
|
133779
133779
|
g1 = g2;
|
|
133780
133780
|
g2 = i2;
|
|
133781
|
-
|
|
133781
|
+
len2 -= i2;
|
|
133782
133782
|
}
|
|
133783
|
-
if (g1 > 0 &&
|
|
133784
|
-
i2 =
|
|
133783
|
+
if (g1 > 0 && len2 > 0) {
|
|
133784
|
+
i2 = len2 % g1 || g1;
|
|
133785
133785
|
intPart = intDigits.substr(0, i2);
|
|
133786
|
-
for (; i2 <
|
|
133786
|
+
for (; i2 < len2; i2 += g1) intPart += groupSeparator + intDigits.substr(i2, g1);
|
|
133787
133787
|
if (g2 > 0) intPart += groupSeparator + intDigits.slice(i2);
|
|
133788
133788
|
if (isNeg) intPart = "-" + intPart;
|
|
133789
133789
|
}
|
|
@@ -133916,16 +133916,16 @@ var require_bignumber = __commonJS({
|
|
|
133916
133916
|
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e3 < 0 ? "e" : "e+") + e3;
|
|
133917
133917
|
}
|
|
133918
133918
|
function toFixedPoint(str, e3, z3) {
|
|
133919
|
-
var
|
|
133919
|
+
var len2, zs;
|
|
133920
133920
|
if (e3 < 0) {
|
|
133921
133921
|
for (zs = z3 + "."; ++e3; zs += z3) ;
|
|
133922
133922
|
str = zs + str;
|
|
133923
133923
|
} else {
|
|
133924
|
-
|
|
133925
|
-
if (++e3 >
|
|
133926
|
-
for (zs = z3, e3 -=
|
|
133924
|
+
len2 = str.length;
|
|
133925
|
+
if (++e3 > len2) {
|
|
133926
|
+
for (zs = z3, e3 -= len2; --e3; zs += z3) ;
|
|
133927
133927
|
str += zs;
|
|
133928
|
-
} else if (e3 <
|
|
133928
|
+
} else if (e3 < len2) {
|
|
133929
133929
|
str = str.slice(0, e3) + "." + str.slice(e3);
|
|
133930
133930
|
}
|
|
133931
133931
|
}
|
|
@@ -135058,22 +135058,22 @@ var require_base64_js = __commonJS({
|
|
|
135058
135058
|
var revLookup = [];
|
|
135059
135059
|
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
|
135060
135060
|
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
135061
|
-
for (i2 = 0,
|
|
135061
|
+
for (i2 = 0, len2 = code.length; i2 < len2; ++i2) {
|
|
135062
135062
|
lookup[i2] = code[i2];
|
|
135063
135063
|
revLookup[code.charCodeAt(i2)] = i2;
|
|
135064
135064
|
}
|
|
135065
135065
|
var i2;
|
|
135066
|
-
var
|
|
135066
|
+
var len2;
|
|
135067
135067
|
revLookup["-".charCodeAt(0)] = 62;
|
|
135068
135068
|
revLookup["_".charCodeAt(0)] = 63;
|
|
135069
135069
|
function getLens(b64) {
|
|
135070
|
-
var
|
|
135071
|
-
if (
|
|
135070
|
+
var len3 = b64.length;
|
|
135071
|
+
if (len3 % 4 > 0) {
|
|
135072
135072
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
135073
135073
|
}
|
|
135074
135074
|
var validLen = b64.indexOf("=");
|
|
135075
|
-
if (validLen === -1) validLen =
|
|
135076
|
-
var placeHoldersLen = validLen ===
|
|
135075
|
+
if (validLen === -1) validLen = len3;
|
|
135076
|
+
var placeHoldersLen = validLen === len3 ? 0 : 4 - validLen % 4;
|
|
135077
135077
|
return [validLen, placeHoldersLen];
|
|
135078
135078
|
}
|
|
135079
135079
|
function byteLength(b64) {
|
|
@@ -135092,9 +135092,9 @@ var require_base64_js = __commonJS({
|
|
|
135092
135092
|
var placeHoldersLen = lens[1];
|
|
135093
135093
|
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
|
|
135094
135094
|
var curByte = 0;
|
|
135095
|
-
var
|
|
135095
|
+
var len3 = placeHoldersLen > 0 ? validLen - 4 : validLen;
|
|
135096
135096
|
var i3;
|
|
135097
|
-
for (i3 = 0; i3 <
|
|
135097
|
+
for (i3 = 0; i3 < len3; i3 += 4) {
|
|
135098
135098
|
tmp = revLookup[b64.charCodeAt(i3)] << 18 | revLookup[b64.charCodeAt(i3 + 1)] << 12 | revLookup[b64.charCodeAt(i3 + 2)] << 6 | revLookup[b64.charCodeAt(i3 + 3)];
|
|
135099
135099
|
arr[curByte++] = tmp >> 16 & 255;
|
|
135100
135100
|
arr[curByte++] = tmp >> 8 & 255;
|
|
@@ -135125,20 +135125,20 @@ var require_base64_js = __commonJS({
|
|
|
135125
135125
|
}
|
|
135126
135126
|
function fromByteArray(uint8) {
|
|
135127
135127
|
var tmp;
|
|
135128
|
-
var
|
|
135129
|
-
var extraBytes =
|
|
135128
|
+
var len3 = uint8.length;
|
|
135129
|
+
var extraBytes = len3 % 3;
|
|
135130
135130
|
var parts = [];
|
|
135131
135131
|
var maxChunkLength = 16383;
|
|
135132
|
-
for (var i3 = 0, len22 =
|
|
135132
|
+
for (var i3 = 0, len22 = len3 - extraBytes; i3 < len22; i3 += maxChunkLength) {
|
|
135133
135133
|
parts.push(encodeChunk(uint8, i3, i3 + maxChunkLength > len22 ? len22 : i3 + maxChunkLength));
|
|
135134
135134
|
}
|
|
135135
135135
|
if (extraBytes === 1) {
|
|
135136
|
-
tmp = uint8[
|
|
135136
|
+
tmp = uint8[len3 - 1];
|
|
135137
135137
|
parts.push(
|
|
135138
135138
|
lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="
|
|
135139
135139
|
);
|
|
135140
135140
|
} else if (extraBytes === 2) {
|
|
135141
|
-
tmp = (uint8[
|
|
135141
|
+
tmp = (uint8[len3 - 2] << 8) + uint8[len3 - 1];
|
|
135142
135142
|
parts.push(
|
|
135143
135143
|
lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="
|
|
135144
135144
|
);
|
|
@@ -142661,24 +142661,24 @@ var require_validation = __commonJS({
|
|
|
142661
142661
|
return code >= 1e3 && code <= 1014 && code !== 1004 && code !== 1005 && code !== 1006 || code >= 3e3 && code <= 4999;
|
|
142662
142662
|
}
|
|
142663
142663
|
function _isValidUTF8(buf) {
|
|
142664
|
-
const
|
|
142664
|
+
const len2 = buf.length;
|
|
142665
142665
|
let i2 = 0;
|
|
142666
|
-
while (i2 <
|
|
142666
|
+
while (i2 < len2) {
|
|
142667
142667
|
if ((buf[i2] & 128) === 0) {
|
|
142668
142668
|
i2++;
|
|
142669
142669
|
} else if ((buf[i2] & 224) === 192) {
|
|
142670
|
-
if (i2 + 1 ===
|
|
142670
|
+
if (i2 + 1 === len2 || (buf[i2 + 1] & 192) !== 128 || (buf[i2] & 254) === 192) {
|
|
142671
142671
|
return false;
|
|
142672
142672
|
}
|
|
142673
142673
|
i2 += 2;
|
|
142674
142674
|
} else if ((buf[i2] & 240) === 224) {
|
|
142675
|
-
if (i2 + 2 >=
|
|
142675
|
+
if (i2 + 2 >= len2 || (buf[i2 + 1] & 192) !== 128 || (buf[i2 + 2] & 192) !== 128 || buf[i2] === 224 && (buf[i2 + 1] & 224) === 128 || // Overlong
|
|
142676
142676
|
buf[i2] === 237 && (buf[i2 + 1] & 224) === 160) {
|
|
142677
142677
|
return false;
|
|
142678
142678
|
}
|
|
142679
142679
|
i2 += 3;
|
|
142680
142680
|
} else if ((buf[i2] & 248) === 240) {
|
|
142681
|
-
if (i2 + 3 >=
|
|
142681
|
+
if (i2 + 3 >= len2 || (buf[i2 + 1] & 192) !== 128 || (buf[i2 + 2] & 192) !== 128 || (buf[i2 + 3] & 192) !== 128 || buf[i2] === 240 && (buf[i2 + 1] & 240) === 128 || // Overlong
|
|
142682
142682
|
buf[i2] === 244 && buf[i2 + 1] > 143 || buf[i2] > 244) {
|
|
142683
142683
|
return false;
|
|
142684
142684
|
}
|
|
@@ -168636,11 +168636,11 @@ var init_capture2 = __esm({
|
|
|
168636
168636
|
} catch (err) {
|
|
168637
168637
|
const errMsg = normalizeErrorMessage(err);
|
|
168638
168638
|
try {
|
|
168639
|
-
const { mkdirSync:
|
|
168640
|
-
|
|
168639
|
+
const { mkdirSync: mkdirSync56, writeFileSync: writeFileSync47 } = await import("fs");
|
|
168640
|
+
mkdirSync56(outputDir, { recursive: true });
|
|
168641
168641
|
const isTimeout = /timeout|timed out/i.test(errMsg);
|
|
168642
168642
|
const reason = isTimeout ? "Page navigation timed out \u2014 the site may be blocking headless browsers or requires authentication." : `Capture failed: ${errMsg}`;
|
|
168643
|
-
|
|
168643
|
+
writeFileSync47(
|
|
168644
168644
|
`${outputDir}/BLOCKED.md`,
|
|
168645
168645
|
`# Capture Failed
|
|
168646
168646
|
|
|
@@ -169072,14 +169072,14 @@ async function runRender(args) {
|
|
|
169072
169072
|
});
|
|
169073
169073
|
const variables = resolveVariablesArg(args.variables, args.variablesFile);
|
|
169074
169074
|
if (variables && Object.keys(variables).length > 0) {
|
|
169075
|
-
const
|
|
169076
|
-
if (existsSync95(
|
|
169077
|
-
const issues = validateVariablesAgainstProject(
|
|
169075
|
+
const indexPath2 = join99(projectDir, "index.html");
|
|
169076
|
+
if (existsSync95(indexPath2)) {
|
|
169077
|
+
const issues = validateVariablesAgainstProject(indexPath2, variables);
|
|
169078
169078
|
reportVariableIssues(issues, { strict: args.strictVariables ?? false, quiet: args.json });
|
|
169079
169079
|
} else if (args.strictVariables && !args.json) {
|
|
169080
169080
|
console.warn(
|
|
169081
169081
|
c.warn(
|
|
169082
|
-
`--strict-variables: no ${
|
|
169082
|
+
`--strict-variables: no ${indexPath2} on disk \u2014 schema validation skipped. Variables flow through unchecked. To enable strict checking, run from a project dir that contains the composition.`
|
|
169083
169083
|
)
|
|
169084
169084
|
);
|
|
169085
169085
|
}
|
|
@@ -170701,9 +170701,9 @@ function resolveAndValidateVariables(args, projectDir) {
|
|
|
170701
170701
|
args["variables-file"]
|
|
170702
170702
|
);
|
|
170703
170703
|
if (variables && Object.keys(variables).length > 0) {
|
|
170704
|
-
const
|
|
170705
|
-
if (existsSync97(
|
|
170706
|
-
const issues = validateVariablesAgainstProject(
|
|
170704
|
+
const indexPath2 = join101(projectDir, "index.html");
|
|
170705
|
+
if (existsSync97(indexPath2)) {
|
|
170706
|
+
const issues = validateVariablesAgainstProject(indexPath2, variables);
|
|
170707
170707
|
reportVariableIssues(issues, {
|
|
170708
170708
|
strict: Boolean(args["strict-variables"]),
|
|
170709
170709
|
quiet: Boolean(args.json)
|
|
@@ -172701,8 +172701,8 @@ function resolveVariablesAndValidateIfLocal(inline, filePath, strict, source) {
|
|
|
172701
172701
|
const variables = resolveVariablesArg(inline, filePath);
|
|
172702
172702
|
if (!variables || Object.keys(variables).length === 0) return variables;
|
|
172703
172703
|
if (source.kind !== "dir") return variables;
|
|
172704
|
-
const { indexPath } = resolveProject(source.dir);
|
|
172705
|
-
const issues = validateVariablesAgainstProject(
|
|
172704
|
+
const { indexPath: indexPath2 } = resolveProject(source.dir);
|
|
172705
|
+
const issues = validateVariablesAgainstProject(indexPath2, variables);
|
|
172706
172706
|
reportVariableIssues(issues, { strict, quiet: false });
|
|
172707
172707
|
return variables;
|
|
172708
172708
|
}
|
|
@@ -174421,7 +174421,7 @@ var init_jsonl = __esm({
|
|
|
174421
174421
|
});
|
|
174422
174422
|
|
|
174423
174423
|
// ../core/dist/figma/manifest.js
|
|
174424
|
-
import { appendFileSync as appendFileSync2, existsSync as existsSync100, mkdirSync as mkdirSync50, readFileSync as readFileSync69 } from "fs";
|
|
174424
|
+
import { appendFileSync as appendFileSync2, existsSync as existsSync100, mkdirSync as mkdirSync50, readFileSync as readFileSync69, writeFileSync as writeFileSync41 } from "fs";
|
|
174425
174425
|
import { join as join104 } from "path";
|
|
174426
174426
|
function mediaDir(projectDir) {
|
|
174427
174427
|
return join104(projectDir, ".media");
|
|
@@ -174457,12 +174457,25 @@ function appendRecord(projectDir, record) {
|
|
|
174457
174457
|
mkdirSync50(typeDirPath(projectDir, record.type), { recursive: true });
|
|
174458
174458
|
appendFileSync2(manifestPath(projectDir), JSON.stringify(record) + "\n");
|
|
174459
174459
|
}
|
|
174460
|
-
function
|
|
174461
|
-
|
|
174462
|
-
|
|
174463
|
-
|
|
174464
|
-
|
|
174465
|
-
|
|
174460
|
+
function findAllByFigmaNode(projectDir, fileKey, nodeId) {
|
|
174461
|
+
return readManifest(projectDir).filter((r2) => r2.provenance.source === "figma" && r2.provenance.fileKey === fileKey && r2.provenance.nodeId === nodeId);
|
|
174462
|
+
}
|
|
174463
|
+
function updateRecord(projectDir, record) {
|
|
174464
|
+
const p2 = manifestPath(projectDir);
|
|
174465
|
+
const lines = readFileSync69(p2, "utf8").split(/\r?\n/);
|
|
174466
|
+
const out = lines.map((line2) => {
|
|
174467
|
+
const trimmed = line2.trim();
|
|
174468
|
+
if (trimmed.length === 0)
|
|
174469
|
+
return line2;
|
|
174470
|
+
try {
|
|
174471
|
+
const parsed = JSON.parse(trimmed);
|
|
174472
|
+
if (isFigmaManifestRecord(parsed) && parsed.id === record.id)
|
|
174473
|
+
return JSON.stringify(record);
|
|
174474
|
+
} catch {
|
|
174475
|
+
}
|
|
174476
|
+
return line2;
|
|
174477
|
+
});
|
|
174478
|
+
writeFileSync41(p2, out.join("\n"));
|
|
174466
174479
|
}
|
|
174467
174480
|
function nextId(projectDir, type) {
|
|
174468
174481
|
const re2 = new RegExp(`^${type}_(\\d+)$`);
|
|
@@ -174502,6 +174515,70 @@ var init_manifest = __esm({
|
|
|
174502
174515
|
}
|
|
174503
174516
|
});
|
|
174504
174517
|
|
|
174518
|
+
// ../core/dist/figma/mediaIndex.js
|
|
174519
|
+
import { mkdirSync as mkdirSync51, writeFileSync as writeFileSync43 } from "fs";
|
|
174520
|
+
import { dirname as dirname46, join as join105 } from "path";
|
|
174521
|
+
function isRow(value) {
|
|
174522
|
+
return typeof value === "object" && value !== null;
|
|
174523
|
+
}
|
|
174524
|
+
function indexPath(projectDir) {
|
|
174525
|
+
return join105(mediaDir(projectDir), "index.md");
|
|
174526
|
+
}
|
|
174527
|
+
function pad(str, len2) {
|
|
174528
|
+
return String(str ?? "").padEnd(len2);
|
|
174529
|
+
}
|
|
174530
|
+
function formatDur(r2) {
|
|
174531
|
+
if (r2.duration == null)
|
|
174532
|
+
return "\u2014";
|
|
174533
|
+
return `${String(r2.duration)}s`;
|
|
174534
|
+
}
|
|
174535
|
+
function formatDims(r2) {
|
|
174536
|
+
if (r2.width && r2.height)
|
|
174537
|
+
return `${String(r2.width)}\xD7${String(r2.height)}`;
|
|
174538
|
+
if (r2.type === "icon" && r2.transparent)
|
|
174539
|
+
return "svg";
|
|
174540
|
+
return "\u2014";
|
|
174541
|
+
}
|
|
174542
|
+
function len(value) {
|
|
174543
|
+
return String(value ?? "").length;
|
|
174544
|
+
}
|
|
174545
|
+
function generateIndexContent(records) {
|
|
174546
|
+
const count = records.length;
|
|
174547
|
+
const header = `# .media \xB7 ${count} asset${count === 1 ? "" : "s"}
|
|
174548
|
+
`;
|
|
174549
|
+
if (count === 0)
|
|
174550
|
+
return header;
|
|
174551
|
+
const cols = { id: 4, type: 5, dur: 4, dims: 5, path: 5 };
|
|
174552
|
+
for (const r2 of records) {
|
|
174553
|
+
cols.id = Math.max(cols.id, len(r2.id));
|
|
174554
|
+
cols.type = Math.max(cols.type, len(r2.type));
|
|
174555
|
+
cols.dur = Math.max(cols.dur, formatDur(r2).length);
|
|
174556
|
+
cols.dims = Math.max(cols.dims, formatDims(r2).length);
|
|
174557
|
+
cols.path = Math.max(cols.path, len(r2.path));
|
|
174558
|
+
}
|
|
174559
|
+
const heading = pad("id", cols.id + 2) + pad("type", cols.type + 2) + pad("dur", cols.dur + 2) + pad("dims", cols.dims + 2) + pad("path", cols.path + 2) + "description";
|
|
174560
|
+
const lines = [header, heading];
|
|
174561
|
+
for (const r2 of records) {
|
|
174562
|
+
lines.push(pad(r2.id, cols.id + 2) + pad(r2.type, cols.type + 2) + pad(formatDur(r2), cols.dur + 2) + pad(formatDims(r2), cols.dims + 2) + pad(r2.path, cols.path + 2) + String(r2.description ?? ""));
|
|
174563
|
+
}
|
|
174564
|
+
return lines.join("\n") + "\n";
|
|
174565
|
+
}
|
|
174566
|
+
function regenerateIndex(projectDir) {
|
|
174567
|
+
const records = readJsonlValues(manifestPath(projectDir)).filter(isRow);
|
|
174568
|
+
const content = generateIndexContent(records);
|
|
174569
|
+
const p2 = indexPath(projectDir);
|
|
174570
|
+
mkdirSync51(dirname46(p2), { recursive: true });
|
|
174571
|
+
writeFileSync43(p2, content);
|
|
174572
|
+
return content;
|
|
174573
|
+
}
|
|
174574
|
+
var init_mediaIndex = __esm({
|
|
174575
|
+
"../core/dist/figma/mediaIndex.js"() {
|
|
174576
|
+
"use strict";
|
|
174577
|
+
init_jsonl();
|
|
174578
|
+
init_manifest();
|
|
174579
|
+
}
|
|
174580
|
+
});
|
|
174581
|
+
|
|
174505
174582
|
// ../core/dist/figma/assetSnippet.js
|
|
174506
174583
|
function escapeAttr(value) {
|
|
174507
174584
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -174556,10 +174633,10 @@ var init_sanitizeSvg = __esm({
|
|
|
174556
174633
|
});
|
|
174557
174634
|
|
|
174558
174635
|
// ../core/dist/figma/bindings.js
|
|
174559
|
-
import { appendFileSync as appendFileSync3, mkdirSync as
|
|
174560
|
-
import { join as
|
|
174636
|
+
import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync53, writeFileSync as writeFileSync44 } from "fs";
|
|
174637
|
+
import { join as join106 } from "path";
|
|
174561
174638
|
function bindingsPath(projectDir) {
|
|
174562
|
-
return
|
|
174639
|
+
return join106(mediaDir(projectDir), BINDINGS_FILE);
|
|
174563
174640
|
}
|
|
174564
174641
|
function isRecord6(value) {
|
|
174565
174642
|
return typeof value === "object" && value !== null;
|
|
@@ -174576,9 +174653,9 @@ function readBindings(projectDir) {
|
|
|
174576
174653
|
function upsertBindings(projectDir, records) {
|
|
174577
174654
|
const incoming = new Set(records.map((r2) => r2.figmaId));
|
|
174578
174655
|
const survivors = readLines(projectDir).filter((line2) => !(isBindingRecord(line2) && incoming.has(line2.figmaId)));
|
|
174579
|
-
|
|
174656
|
+
mkdirSync53(mediaDir(projectDir), { recursive: true });
|
|
174580
174657
|
const lines = [...survivors, ...records].map((r2) => JSON.stringify(r2)).join("\n");
|
|
174581
|
-
|
|
174658
|
+
writeFileSync44(bindingsPath(projectDir), lines.length > 0 ? lines + "\n" : "");
|
|
174582
174659
|
}
|
|
174583
174660
|
var BINDINGS_FILE;
|
|
174584
174661
|
var init_bindings = __esm({
|
|
@@ -175055,6 +175132,7 @@ var init_figma = __esm({
|
|
|
175055
175132
|
init_parseFigmaRef();
|
|
175056
175133
|
init_freeze();
|
|
175057
175134
|
init_manifest();
|
|
175135
|
+
init_mediaIndex();
|
|
175058
175136
|
init_assetSnippet();
|
|
175059
175137
|
init_sanitizeSvg();
|
|
175060
175138
|
init_bindings();
|
|
@@ -175113,7 +175191,7 @@ __export(asset_exports, {
|
|
|
175113
175191
|
runAssetImport: () => runAssetImport
|
|
175114
175192
|
});
|
|
175115
175193
|
import { existsSync as existsSync101 } from "fs";
|
|
175116
|
-
import { join as
|
|
175194
|
+
import { join as join107, relative as relative16 } from "path";
|
|
175117
175195
|
async function runAssetImport(refInput, opts, deps) {
|
|
175118
175196
|
const ref2 = parseFigmaRef(refInput);
|
|
175119
175197
|
if (!ref2.nodeId)
|
|
@@ -175121,9 +175199,23 @@ async function runAssetImport(refInput, opts, deps) {
|
|
|
175121
175199
|
`ref "${refInput}" has no node id \u2014 share a link with ?node-id=\u2026 or use fileKey:nodeId`
|
|
175122
175200
|
);
|
|
175123
175201
|
const { version: version2 } = await deps.client.fileVersion(ref2.fileKey);
|
|
175124
|
-
const
|
|
175125
|
-
|
|
175126
|
-
|
|
175202
|
+
const description = normalizeMeta(opts.description);
|
|
175203
|
+
const entity = normalizeMeta(opts.entity);
|
|
175204
|
+
const existing = findAllByFigmaNode(deps.projectDir, ref2.fileKey, ref2.nodeId).find(
|
|
175205
|
+
(r2) => r2.provenance.format === opts.format && (r2.provenance.scale ?? 1) === (opts.scale ?? 1) && r2.provenance.version === version2 && existsSync101(join107(deps.projectDir, r2.path))
|
|
175206
|
+
);
|
|
175207
|
+
if (existing) {
|
|
175208
|
+
let record2 = existing;
|
|
175209
|
+
if (description !== void 0 && description !== existing.description || entity !== void 0 && entity !== existing.entity) {
|
|
175210
|
+
record2 = {
|
|
175211
|
+
...existing,
|
|
175212
|
+
...description !== void 0 && { description },
|
|
175213
|
+
...entity !== void 0 && { entity }
|
|
175214
|
+
};
|
|
175215
|
+
updateRecord(deps.projectDir, record2);
|
|
175216
|
+
}
|
|
175217
|
+
safeRegenerateIndex(deps.projectDir);
|
|
175218
|
+
return { record: record2, snippet: buildAssetSnippet(record2), reused: true };
|
|
175127
175219
|
}
|
|
175128
175220
|
const rendered = await deps.client.renderNode(ref2, opts);
|
|
175129
175221
|
let bytes = await deps.download(rendered.url);
|
|
@@ -175134,13 +175226,15 @@ async function runAssetImport(refInput, opts, deps) {
|
|
|
175134
175226
|
bytes = new TextEncoder().encode(sanitizeSvg(new TextDecoder().decode(bytes)));
|
|
175135
175227
|
}
|
|
175136
175228
|
const id = nextId(deps.projectDir, "image");
|
|
175137
|
-
const destAbs =
|
|
175229
|
+
const destAbs = join107(typeDirPath(deps.projectDir, "image"), `${id}.${rendered.ext}`);
|
|
175138
175230
|
freezeBytes(bytes, destAbs);
|
|
175139
175231
|
const record = {
|
|
175140
175232
|
id,
|
|
175141
175233
|
type: "image",
|
|
175142
175234
|
path: relative16(deps.projectDir, destAbs),
|
|
175143
175235
|
source: `figma:${ref2.fileKey}/${ref2.nodeId}`,
|
|
175236
|
+
...description !== void 0 && { description },
|
|
175237
|
+
...entity !== void 0 && { entity },
|
|
175144
175238
|
provenance: {
|
|
175145
175239
|
source: "figma",
|
|
175146
175240
|
fileKey: ref2.fileKey,
|
|
@@ -175151,8 +175245,21 @@ async function runAssetImport(refInput, opts, deps) {
|
|
|
175151
175245
|
}
|
|
175152
175246
|
};
|
|
175153
175247
|
appendRecord(deps.projectDir, record);
|
|
175248
|
+
safeRegenerateIndex(deps.projectDir);
|
|
175154
175249
|
return { record, snippet: buildAssetSnippet(record), reused: false };
|
|
175155
175250
|
}
|
|
175251
|
+
function normalizeMeta(value) {
|
|
175252
|
+
if (value === void 0) return void 0;
|
|
175253
|
+
const cleaned = value.replace(/\s+/g, " ").trim();
|
|
175254
|
+
return cleaned.length > 0 ? cleaned : void 0;
|
|
175255
|
+
}
|
|
175256
|
+
function safeRegenerateIndex(projectDir) {
|
|
175257
|
+
try {
|
|
175258
|
+
regenerateIndex(projectDir);
|
|
175259
|
+
} catch (err) {
|
|
175260
|
+
console.warn(`index.md regeneration failed: ${err instanceof Error ? err.message : err}`);
|
|
175261
|
+
}
|
|
175262
|
+
}
|
|
175156
175263
|
function parseFormat3(raw) {
|
|
175157
175264
|
for (const f3 of FORMATS3) if (f3 === raw) return f3;
|
|
175158
175265
|
throw new Error(`unsupported format "${raw}" \u2014 use one of ${FORMATS3.join(", ")}`);
|
|
@@ -175176,6 +175283,14 @@ var init_asset = __esm({
|
|
|
175176
175283
|
},
|
|
175177
175284
|
format: { type: "string", description: "png | svg | jpg | pdf", default: "svg" },
|
|
175178
175285
|
scale: { type: "string", description: "export scale (e.g. 2)" },
|
|
175286
|
+
description: {
|
|
175287
|
+
type: "string",
|
|
175288
|
+
description: "what this asset is (index.md + <img alt>); e.g. the layer's purpose"
|
|
175289
|
+
},
|
|
175290
|
+
entity: {
|
|
175291
|
+
type: "string",
|
|
175292
|
+
description: 'entity name for media-use cache lookups (e.g. "Acme logo")'
|
|
175293
|
+
},
|
|
175179
175294
|
dir: { type: "string", description: "project directory", default: "." }
|
|
175180
175295
|
},
|
|
175181
175296
|
async run({ args }) {
|
|
@@ -175186,7 +175301,9 @@ var init_asset = __esm({
|
|
|
175186
175301
|
args.ref,
|
|
175187
175302
|
{
|
|
175188
175303
|
format: parseFormat3(args.format),
|
|
175189
|
-
scale: args.scale !== void 0 ? Number(args.scale) : void 0
|
|
175304
|
+
scale: args.scale !== void 0 ? Number(args.scale) : void 0,
|
|
175305
|
+
description: args.description,
|
|
175306
|
+
entity: args.entity
|
|
175190
175307
|
},
|
|
175191
175308
|
{ projectDir: args.dir, client, download: downloadRender }
|
|
175192
175309
|
);
|
|
@@ -175205,12 +175322,12 @@ __export(tokens_exports, {
|
|
|
175205
175322
|
default: () => tokens_default,
|
|
175206
175323
|
runTokensImport: () => runTokensImport
|
|
175207
175324
|
});
|
|
175208
|
-
import { writeFileSync as
|
|
175209
|
-
import { join as
|
|
175325
|
+
import { writeFileSync as writeFileSync45 } from "fs";
|
|
175326
|
+
import { join as join108 } from "path";
|
|
175210
175327
|
async function runTokensImport(refInput, deps) {
|
|
175211
175328
|
const { fileKey } = parseFigmaRef(refInput);
|
|
175212
175329
|
const { version: version2 } = await deps.client.fileVersion(fileKey);
|
|
175213
|
-
const sidecarPath =
|
|
175330
|
+
const sidecarPath = join108(deps.projectDir, "figma-tokens.json");
|
|
175214
175331
|
let vars = null;
|
|
175215
175332
|
try {
|
|
175216
175333
|
vars = await deps.client.variables(fileKey);
|
|
@@ -175220,7 +175337,7 @@ async function runTokensImport(refInput, deps) {
|
|
|
175220
175337
|
if (vars !== null) {
|
|
175221
175338
|
const out = tokensToVariables(vars, { fileKey, version: version2 });
|
|
175222
175339
|
upsertBindings(deps.projectDir, out.bindings);
|
|
175223
|
-
|
|
175340
|
+
writeFileSync45(sidecarPath, JSON.stringify(out.sidecar, null, 2) + "\n");
|
|
175224
175341
|
return { mode: "variables", entries: out.entries, sidecarPath };
|
|
175225
175342
|
}
|
|
175226
175343
|
const styles = await deps.client.styles(fileKey);
|
|
@@ -175234,7 +175351,7 @@ async function runTokensImport(refInput, deps) {
|
|
|
175234
175351
|
value: null
|
|
175235
175352
|
}))
|
|
175236
175353
|
};
|
|
175237
|
-
|
|
175354
|
+
writeFileSync45(sidecarPath, JSON.stringify(sidecar, null, 2) + "\n");
|
|
175238
175355
|
return { mode: "styles", entries: [], sidecarPath };
|
|
175239
175356
|
}
|
|
175240
175357
|
var tokens_default;
|
|
@@ -175276,8 +175393,8 @@ __export(component_exports, {
|
|
|
175276
175393
|
default: () => component_default,
|
|
175277
175394
|
runComponentImport: () => runComponentImport
|
|
175278
175395
|
});
|
|
175279
|
-
import { existsSync as existsSync102, mkdirSync as
|
|
175280
|
-
import { join as
|
|
175396
|
+
import { existsSync as existsSync102, mkdirSync as mkdirSync54, writeFileSync as writeFileSync46 } from "fs";
|
|
175397
|
+
import { join as join109, relative as relative17 } from "path";
|
|
175281
175398
|
function escapeAttr2(value) {
|
|
175282
175399
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
175283
175400
|
}
|
|
@@ -175288,20 +175405,22 @@ async function runComponentImport(refInput, deps) {
|
|
|
175288
175405
|
const bindings = resolveBindings(tree, readBindings(deps.projectDir));
|
|
175289
175406
|
const mapped = nodeToHtml(tree, bindings);
|
|
175290
175407
|
const name = slugify2(tree.name);
|
|
175291
|
-
const componentDir =
|
|
175408
|
+
const componentDir = join109(deps.projectDir, "compositions", "components", name);
|
|
175292
175409
|
if (existsSync102(componentDir))
|
|
175293
175410
|
console.warn(
|
|
175294
175411
|
`component dir compositions/components/${name} already exists \u2014 overwriting (rename the figma frame for a separate import)`
|
|
175295
175412
|
);
|
|
175296
|
-
|
|
175413
|
+
mkdirSync54(componentDir, { recursive: true });
|
|
175297
175414
|
let html = mapped.html;
|
|
175415
|
+
const frozenAssets = [];
|
|
175298
175416
|
for (const req of mapped.rasterize) {
|
|
175299
175417
|
const asset = await runAssetImport(
|
|
175300
175418
|
`${ref2.fileKey}:${req.nodeId}`,
|
|
175301
|
-
{ format: "svg" },
|
|
175419
|
+
{ format: "svg", description: req.name },
|
|
175302
175420
|
{ projectDir: deps.projectDir, client: deps.client, download: deps.download }
|
|
175303
175421
|
);
|
|
175304
|
-
|
|
175422
|
+
frozenAssets.push(asset.record.path);
|
|
175423
|
+
const srcRel = relative17(componentDir, join109(deps.projectDir, asset.record.path)).replaceAll(
|
|
175305
175424
|
"\\",
|
|
175306
175425
|
"/"
|
|
175307
175426
|
);
|
|
@@ -175311,8 +175430,8 @@ async function runComponentImport(refInput, deps) {
|
|
|
175311
175430
|
`data-figma-rasterize="${emittedId}" src="${escapeAttr2(srcRel)}" `
|
|
175312
175431
|
);
|
|
175313
175432
|
}
|
|
175314
|
-
const htmlFile =
|
|
175315
|
-
|
|
175433
|
+
const htmlFile = join109(componentDir, `${name}.html`);
|
|
175434
|
+
writeFileSync46(htmlFile, html + "\n");
|
|
175316
175435
|
const registryItem = {
|
|
175317
175436
|
name,
|
|
175318
175437
|
type: "hyperframes:component",
|
|
@@ -175323,15 +175442,17 @@ async function runComponentImport(refInput, deps) {
|
|
|
175323
175442
|
target: `compositions/components/${name}/${name}.html`,
|
|
175324
175443
|
type: "hyperframes:snippet"
|
|
175325
175444
|
},
|
|
175326
|
-
|
|
175327
|
-
|
|
175328
|
-
|
|
175445
|
+
// The paths the frozen files ACTUALLY landed at (image_NNN.svg), which
|
|
175446
|
+
// is also what the emitted HTML references — not the slug names.
|
|
175447
|
+
...frozenAssets.map((p2) => ({
|
|
175448
|
+
path: p2.split("/").pop() ?? p2,
|
|
175449
|
+
target: p2.replaceAll("\\", "/"),
|
|
175329
175450
|
type: "hyperframes:asset"
|
|
175330
175451
|
}))
|
|
175331
175452
|
]
|
|
175332
175453
|
};
|
|
175333
|
-
|
|
175334
|
-
|
|
175454
|
+
writeFileSync46(
|
|
175455
|
+
join109(componentDir, "registry-item.json"),
|
|
175335
175456
|
JSON.stringify(registryItem, null, 2) + "\n"
|
|
175336
175457
|
);
|
|
175337
175458
|
return {
|
|
@@ -175571,9 +175692,9 @@ __export(autoUpdate_exports, {
|
|
|
175571
175692
|
scheduleBackgroundInstall: () => scheduleBackgroundInstall
|
|
175572
175693
|
});
|
|
175573
175694
|
import { spawn as spawn17 } from "child_process";
|
|
175574
|
-
import { appendFileSync as appendFileSync4, mkdirSync as
|
|
175695
|
+
import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync55, openSync as openSync3 } from "fs";
|
|
175575
175696
|
import { homedir as homedir16 } from "os";
|
|
175576
|
-
import { join as
|
|
175697
|
+
import { join as join110 } from "path";
|
|
175577
175698
|
import { compareVersions as compareVersions3 } from "compare-versions";
|
|
175578
175699
|
function isAutoInstallDisabled() {
|
|
175579
175700
|
if (isDevMode()) return true;
|
|
@@ -175588,15 +175709,15 @@ function majorOf(version2) {
|
|
|
175588
175709
|
}
|
|
175589
175710
|
function log(line2) {
|
|
175590
175711
|
try {
|
|
175591
|
-
|
|
175712
|
+
mkdirSync55(CONFIG_DIR2, { recursive: true, mode: 448 });
|
|
175592
175713
|
appendFileSync4(LOG_FILE, `${(/* @__PURE__ */ new Date()).toISOString()} ${line2}
|
|
175593
175714
|
`, { mode: 384 });
|
|
175594
175715
|
} catch {
|
|
175595
175716
|
}
|
|
175596
175717
|
}
|
|
175597
175718
|
function launchDetachedInstall(installCommand, version2) {
|
|
175598
|
-
|
|
175599
|
-
const configFile =
|
|
175719
|
+
mkdirSync55(CONFIG_DIR2, { recursive: true, mode: 448 });
|
|
175720
|
+
const configFile = join110(CONFIG_DIR2, "config.json");
|
|
175600
175721
|
const nodeScript = `
|
|
175601
175722
|
const { exec } = require("node:child_process");
|
|
175602
175723
|
const { readFileSync, renameSync, writeFileSync } = require("node:fs");
|
|
@@ -175715,8 +175836,8 @@ var init_autoUpdate = __esm({
|
|
|
175715
175836
|
init_config();
|
|
175716
175837
|
init_env();
|
|
175717
175838
|
init_installerDetection();
|
|
175718
|
-
CONFIG_DIR2 =
|
|
175719
|
-
LOG_FILE =
|
|
175839
|
+
CONFIG_DIR2 = join110(homedir16(), ".hyperframes");
|
|
175840
|
+
LOG_FILE = join110(CONFIG_DIR2, "auto-update.log");
|
|
175720
175841
|
PENDING_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
175721
175842
|
}
|
|
175722
175843
|
});
|
|
@@ -175964,7 +176085,7 @@ var init_help = __esm({
|
|
|
175964
176085
|
// src/cli.ts
|
|
175965
176086
|
init_version();
|
|
175966
176087
|
init_dist();
|
|
175967
|
-
import { dirname as
|
|
176088
|
+
import { dirname as dirname47, join as join111 } from "path";
|
|
175968
176089
|
import { fileURLToPath as fileURLToPath16 } from "url";
|
|
175969
176090
|
import { existsSync as existsSync103 } from "fs";
|
|
175970
176091
|
|
|
@@ -176008,8 +176129,8 @@ for (const stream of [process.stdout, process.stderr]) {
|
|
|
176008
176129
|
});
|
|
176009
176130
|
}
|
|
176010
176131
|
(() => {
|
|
176011
|
-
const here =
|
|
176012
|
-
const shader =
|
|
176132
|
+
const here = dirname47(fileURLToPath16(import.meta.url));
|
|
176133
|
+
const shader = join111(here, "shaderTransitionWorker.js");
|
|
176013
176134
|
if (!process.env.HF_SHADER_WORKER_ENTRY && existsSync103(shader)) {
|
|
176014
176135
|
process.env.HF_SHADER_WORKER_ENTRY = shader;
|
|
176015
176136
|
}
|