@poe-platform/safe-bash 0.1.746 → 0.1.748
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/safe-bash/chunks/{chunk-JCXAGOEK.js → chunk-K3LGRJMX.js} +5 -4
- package/dist/safe-bash/chunks/{chunk-3ZNXN3XO.js → chunk-MSEZFB2F.js} +181 -57
- package/dist/safe-bash/chunks/{chunk-OF2PDE3W.js → chunk-RPNX7NO2.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-BS6QFRNX.js → chunk-XIWFKWNM.js} +2 -2
- package/dist/safe-bash/chunks/{src-T2WAWJXF.js → src-2MBSXQOA.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-6QU5OLPJ.js → chunk-4AWKMIU3.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-6742OVAC.js → chunk-WX5IUIQK.js} +4 -3
- package/dist/safe-bash/core.browser.js +62 -123
- package/dist/safe-bash/shell/pattern.js +1 -1
- package/dist/safe-bash/shell/runtime.d.ts +1 -1
- package/dist/safe-bash/shell/runtime.js +86 -158
- package/dist/safe-bash-command-ssconvert/index.js +177 -56
- package/dist/safe-bash-query-engine/index.js +2 -2
- package/dist/safe-bash-query-engine/interpreter.js +1 -1
- package/dist/safe-bash-query-engine/query-core.js +2 -2
- package/package.json +2 -2
|
@@ -97606,7 +97606,8 @@ var lookupSpecialForms = {
|
|
|
97606
97606
|
if (!args.length || args.length > 4) return error("#VALUE!");
|
|
97607
97607
|
let source = args[0];
|
|
97608
97608
|
while (source.kind === "parentheses") source = source.child;
|
|
97609
|
-
|
|
97609
|
+
const areaSet = source.kind === "binary" && source.op === "union";
|
|
97610
|
+
let value3 = host.evaluate(source, areaSet);
|
|
97610
97611
|
if (value3.kind === "error") return value3;
|
|
97611
97612
|
const offsets = [0, 0, 0];
|
|
97612
97613
|
for (let index2 = 1; index2 < args.length; index2++) {
|
|
@@ -97616,11 +97617,17 @@ var lookupSpecialForms = {
|
|
|
97616
97617
|
if (n === void 0) return error("#VALUE!");
|
|
97617
97618
|
offsets[index2 - 1] = Math.trunc(n) - 1;
|
|
97618
97619
|
}
|
|
97619
|
-
if (
|
|
97620
|
-
|
|
97621
|
-
|
|
97622
|
-
|
|
97623
|
-
|
|
97620
|
+
if (areaSet) {
|
|
97621
|
+
const areas = [], pending = [value3];
|
|
97622
|
+
while (pending.length) {
|
|
97623
|
+
host.tick();
|
|
97624
|
+
const area = pending.pop();
|
|
97625
|
+
if (area.kind === "set") for (let index2 = area.values.length - 1; index2 >= 0; index2--) pending.push(area.values[index2]);
|
|
97626
|
+
else areas.push(area);
|
|
97627
|
+
}
|
|
97628
|
+
if (offsets[2] < 0 || offsets[2] >= areas.length) return error("#REF!");
|
|
97629
|
+
value3 = areas[offsets[2]];
|
|
97630
|
+
if (value3.kind === "error") return value3;
|
|
97624
97631
|
} else if (offsets[2] !== 0) return error("#REF!");
|
|
97625
97632
|
const row = offsets[0], column = offsets[1], dims = dimensions(value3);
|
|
97626
97633
|
if (row < 0 || column < 0 || row >= dims.height || column >= dims.width) return error("#REF!");
|
|
@@ -140035,6 +140042,7 @@ function lotusExternalVariable(name) {
|
|
|
140035
140042
|
async function lotusFormula(bytes, format2, group, row, column, sheetIndex, sheetName2, context, consumeOperation, functions2 = lotusFunctions, names2, legacyReferenceLayout) {
|
|
140036
140043
|
const b3 = new Binary(bytes), stack = [], modern = format2 !== "wk1";
|
|
140037
140044
|
const relativeReferences = /* @__PURE__ */ new Map();
|
|
140045
|
+
const indexRanges = /* @__PURE__ */ new Map();
|
|
140038
140046
|
let at = 0;
|
|
140039
140047
|
const pop = async () => {
|
|
140040
140048
|
if (stack.length) return stack.pop();
|
|
@@ -140042,7 +140050,8 @@ async function lotusFormula(bytes, format2, group, row, column, sheetIndex, shee
|
|
|
140042
140050
|
return "#REF!";
|
|
140043
140051
|
};
|
|
140044
140052
|
const ref = (r, c4, rr, cr) => {
|
|
140045
|
-
|
|
140053
|
+
const rows = modern || legacyReferenceLayout === void 0 ? 65536 : legacyReferenceLayout === "wk1" ? 2048 : 16384;
|
|
140054
|
+
if (r < 0 || r >= rows || c4 < 0 || c4 >= 256) return "#REF!";
|
|
140046
140055
|
const a3 = formatA1(r, c4);
|
|
140047
140056
|
let i = 0;
|
|
140048
140057
|
while (a3[i] >= "A" && a3[i] <= "Z") i++;
|
|
@@ -140052,13 +140061,13 @@ async function lotusFormula(bytes, format2, group, row, column, sheetIndex, shee
|
|
|
140052
140061
|
const c4 = b3.u16(p2), r = b3.u16(p2 + 2), cr = !!(c4 & 32768), rr = !!(r & 32768);
|
|
140053
140062
|
if (legacyReferenceLayout === "works3" || legacyReferenceLayout === "symphony") {
|
|
140054
140063
|
const axis = (raw, origin, bits) => {
|
|
140055
|
-
if (!(raw & 32768)) return raw;
|
|
140064
|
+
if (!(raw & 32768)) return raw & (1 << bits) - 1;
|
|
140056
140065
|
const shift = 32 - bits, boundary = 2 ** (bits - 1);
|
|
140057
140066
|
let delta = raw << shift >> shift;
|
|
140058
140067
|
if (delta + origin >= boundary) delta -= boundary;
|
|
140059
140068
|
return origin + delta;
|
|
140060
140069
|
};
|
|
140061
|
-
let targetColumn = c4;
|
|
140070
|
+
let targetColumn = c4 & 255;
|
|
140062
140071
|
if (legacyReferenceLayout === "symphony" && cr) {
|
|
140063
140072
|
let delta = c4 & 255;
|
|
140064
140073
|
if (delta & 128 && delta + column >= 256) delta -= 256;
|
|
@@ -140086,6 +140095,10 @@ async function lotusFormula(bytes, format2, group, row, column, sheetIndex, shee
|
|
|
140086
140095
|
const target = b3.u8(p2 + 2), name = sheetName2(target);
|
|
140087
140096
|
return (target === sheetIndex && !qualifySheet ? "" : quoteFormulaString(name, "'", gnumericGrammar) + "!") + ref(b3.u16(p2), b3.u8(p2 + 3), !!(flags & 2), !!(flags & 1));
|
|
140088
140097
|
};
|
|
140098
|
+
const rangeReference = (first, last) => {
|
|
140099
|
+
if (first.endsWith("#REF!") || last?.endsWith("#REF!")) return "#REF!";
|
|
140100
|
+
return first + (last === void 0 ? "" : ":" + last);
|
|
140101
|
+
};
|
|
140089
140102
|
while (at < bytes.length) {
|
|
140090
140103
|
context.signal.throwIfAborted();
|
|
140091
140104
|
const op = b3.u8(at++);
|
|
@@ -140119,8 +140132,17 @@ async function lotusFormula(bytes, format2, group, row, column, sheetIndex, shee
|
|
|
140119
140132
|
const name = `LOTUS_SHEET_REFERENCE_${relativeReferences.size}`;
|
|
140120
140133
|
relativeReferences.set(name, { kind: "reference", start: 0, end: 0, first, ...last ? { last } : {} });
|
|
140121
140134
|
stack.push(name);
|
|
140122
|
-
} else
|
|
140123
|
-
|
|
140135
|
+
} else {
|
|
140136
|
+
const source = rangeReference(newRef(at + 1, flags & 7, crossSheet), op === 2 ? newRef(at + 5, flags >> 3 & 7, crossSheet) : void 0);
|
|
140137
|
+
stack.push(source);
|
|
140138
|
+
if (crossSheet) indexRanges.set(source, {
|
|
140139
|
+
firstSheet: b3.u8(at + 3),
|
|
140140
|
+
lastSheet: b3.u8(at + 7),
|
|
140141
|
+
first: ref(b3.u16(at + 1), b3.u8(at + 4), !!(flags & 2), !!(flags & 1)),
|
|
140142
|
+
last: ref(b3.u16(at + 5), b3.u8(at + 8), !!(flags & 16), !!(flags & 8))
|
|
140143
|
+
});
|
|
140144
|
+
}
|
|
140145
|
+
} else stack.push(rangeReference(oldRef(at), op === 2 ? oldRef(at + 4) : void 0));
|
|
140124
140146
|
at += length;
|
|
140125
140147
|
} else if (op === 5) {
|
|
140126
140148
|
const length = format2 === "123" ? 4 : 2;
|
|
@@ -140159,7 +140181,14 @@ async function lotusFormula(bytes, format2, group, row, column, sheetIndex, shee
|
|
|
140159
140181
|
const crossSheet = range3.first.sheet !== range3.last.sheet;
|
|
140160
140182
|
const endpoint = (point) => (point.sheet === sheetIndex && !crossSheet ? "" : quoteFormulaString(sheetName2(point.sheet), "'", gnumericGrammar) + "!") + ref(point.row, point.column, op === 7, op === 7);
|
|
140161
140183
|
const single = range3.first.row === range3.last.row && range3.first.column === range3.last.column && range3.first.sheet === range3.last.sheet;
|
|
140162
|
-
|
|
140184
|
+
const source = endpoint(range3.first) + (single ? "" : ":" + endpoint(range3.last));
|
|
140185
|
+
stack.push(source);
|
|
140186
|
+
if (crossSheet) indexRanges.set(source, {
|
|
140187
|
+
firstSheet: range3.first.sheet,
|
|
140188
|
+
lastSheet: range3.last.sheet,
|
|
140189
|
+
first: ref(range3.first.row, range3.first.column, op === 7, op === 7),
|
|
140190
|
+
last: ref(range3.last.row, range3.last.column, op === 7, op === 7)
|
|
140191
|
+
});
|
|
140163
140192
|
}
|
|
140164
140193
|
} else if (modern && op >= 9 && op <= 11) {
|
|
140165
140194
|
const length = op === 9 ? 4 : op === 10 ? 5 : 11;
|
|
@@ -140203,7 +140232,7 @@ async function lotusFormula(bytes, format2, group, row, column, sheetIndex, shee
|
|
|
140203
140232
|
}
|
|
140204
140233
|
const operands = [];
|
|
140205
140234
|
for (let i = 0; i < args; i++) operands.unshift(await pop());
|
|
140206
|
-
let subtract3 = 0;
|
|
140235
|
+
let subtract3 = info?.[3] === "wk1_year_func" ? 1900 : 0;
|
|
140207
140236
|
if (functions2 === lotusFunctions) {
|
|
140208
140237
|
switch (info?.[1]) {
|
|
140209
140238
|
case "CHOOSE":
|
|
@@ -140221,19 +140250,36 @@ async function lotusFormula(bytes, format2, group, row, column, sheetIndex, shee
|
|
|
140221
140250
|
case "HLOOKUP":
|
|
140222
140251
|
if (operands.length === 3) operands[2] = `(${operands[2]}+1)`;
|
|
140223
140252
|
break;
|
|
140253
|
+
case "DSUM":
|
|
140254
|
+
case "DAVG":
|
|
140255
|
+
case "DCNT":
|
|
140256
|
+
case "DMIN":
|
|
140257
|
+
case "DMAX":
|
|
140258
|
+
case "DVAR":
|
|
140259
|
+
case "DSTD":
|
|
140260
|
+
case "DPURECOUNT":
|
|
140261
|
+
if (operands.length > 1) operands[1] = `(${operands[1]}+1)`;
|
|
140262
|
+
break;
|
|
140224
140263
|
case "INDEX":
|
|
140225
|
-
if (operands.length === 3) {
|
|
140264
|
+
if (operands.length === 3 || operands.length === 4) {
|
|
140226
140265
|
const [, column2, row2] = operands;
|
|
140227
140266
|
operands[1] = `(${row2}+1)`;
|
|
140228
140267
|
operands[2] = `(${column2}+1)`;
|
|
140268
|
+
if (operands.length === 4) operands[3] = `(${operands[3]}+1)`;
|
|
140269
|
+
const span2 = indexRanges.get(operands[0]);
|
|
140270
|
+
if (span2) {
|
|
140271
|
+
const choices = [];
|
|
140272
|
+
for (let index2 = Math.min(span2.firstSheet, span2.lastSheet); index2 <= Math.max(span2.firstSheet, span2.lastSheet); index2++) {
|
|
140273
|
+
consumeOperation();
|
|
140274
|
+
choices.push(quoteFormulaString(sheetName2(index2), "'", gnumericGrammar) + "!" + span2.first + ":" + span2.last);
|
|
140275
|
+
}
|
|
140276
|
+
operands[0] = `(${choices.join(",")})`;
|
|
140277
|
+
}
|
|
140229
140278
|
}
|
|
140230
140279
|
break;
|
|
140231
140280
|
case "STRING":
|
|
140232
140281
|
operands.push("TRUE()");
|
|
140233
140282
|
break;
|
|
140234
|
-
case "YEAR":
|
|
140235
|
-
subtract3 = 1900;
|
|
140236
|
-
break;
|
|
140237
140283
|
case "ROUNDUP":
|
|
140238
140284
|
case "ROUNDDOWN":
|
|
140239
140285
|
if (operands.length === 3) operands.pop();
|
|
@@ -140355,7 +140401,7 @@ async function readLotus(bytes, context) {
|
|
|
140355
140401
|
at += length;
|
|
140356
140402
|
if (id === 0) {
|
|
140357
140403
|
if (modern) {
|
|
140358
|
-
if (length >= 18) group = data3.u8(16);
|
|
140404
|
+
if (version >= 4098 && length >= 18) group = data3.u8(16);
|
|
140359
140405
|
} else {
|
|
140360
140406
|
active = sheets.length;
|
|
140361
140407
|
sheet(active);
|
|
@@ -144349,8 +144395,8 @@ function odfDatabaseRanges(spreadsheet, sheetName2, charge) {
|
|
|
144349
144395
|
var tableNamespaces = ["urn:oasis:names:tc:opendocument:xmlns:table:1.0", "http://openoffice.org/2000/table"];
|
|
144350
144396
|
function readOdfLabelRanges(parent, sheets, context, charge) {
|
|
144351
144397
|
const byName = new Map(sheets.map((sheet) => {
|
|
144352
|
-
charge();
|
|
144353
|
-
return [sheet.name, sheet];
|
|
144398
|
+
charge(1 + sheet.name.length);
|
|
144399
|
+
return [foldSheetName(sheet.name), sheet];
|
|
144354
144400
|
}));
|
|
144355
144401
|
const ranges2 = /* @__PURE__ */ new Map();
|
|
144356
144402
|
const sizes = new Map(sheets.map((sheet) => {
|
|
@@ -144386,8 +144432,9 @@ function readOdfLabelRanges(parent, sheets, context, charge) {
|
|
|
144386
144432
|
});
|
|
144387
144433
|
if (!parsed.ok || parsed.document.root.kind !== "reference") return invalid10();
|
|
144388
144434
|
const first = parsed.document.root.first, last = parsed.document.root.last ?? first;
|
|
144389
|
-
const sheet = first.sheet === void 0 ? void 0 : byName.get(first.sheet);
|
|
144390
|
-
|
|
144435
|
+
const sheet = first.sheet === void 0 ? void 0 : byName.get(foldSheetName(first.sheet));
|
|
144436
|
+
const lastSheet = last.sheet === void 0 ? sheet : byName.get(foldSheetName(last.sheet));
|
|
144437
|
+
if (!sheet || first.workbook !== void 0 || last.workbook !== void 0 || lastSheet !== sheet || !first.row || !first.column || !last.row || !last.column) return invalid10();
|
|
144391
144438
|
const range3 = { startRow: first.row.value, endRow: last.row.value, startColumn: first.column.value, endColumn: last.column.value };
|
|
144392
144439
|
if (Object.values(range3).some((value3) => !Number.isSafeInteger(value3) || value3 < 0) || range3.startRow > range3.endRow || range3.startColumn > range3.endColumn || range3.endRow >= MAX_SHEET_SIZE.rows || range3.endColumn >= MAX_SHEET_SIZE.columns) return invalid10();
|
|
144393
144440
|
return { sheet, range: range3 };
|
|
@@ -144732,8 +144779,8 @@ function createOdfStyles(xml2, extended, book, context) {
|
|
|
144732
144779
|
}
|
|
144733
144780
|
return { register, styles };
|
|
144734
144781
|
}
|
|
144735
|
-
function
|
|
144736
|
-
const
|
|
144782
|
+
function odfPrintProperties(records, xml2, extended) {
|
|
144783
|
+
const properties = { "style:print": "charts drawings objects" };
|
|
144737
144784
|
for (const source of records) for (const n of odfChildren(source)) {
|
|
144738
144785
|
xml2.charge();
|
|
144739
144786
|
const v = odfObject(n), a3 = odfAttributes(n);
|
|
@@ -144751,10 +144798,80 @@ function odfPrintStyles(records, index2, xml2, extended) {
|
|
|
144751
144798
|
} else if (a3.percentage) properties["style:scale-to"] = a3.percentage + "%";
|
|
144752
144799
|
}
|
|
144753
144800
|
}
|
|
144754
|
-
return
|
|
144755
|
-
|
|
144756
|
-
|
|
144757
|
-
|
|
144801
|
+
return properties;
|
|
144802
|
+
}
|
|
144803
|
+
function createOdfStyleDefinitions(book, xml2) {
|
|
144804
|
+
const sections = /* @__PURE__ */ new Map();
|
|
144805
|
+
const shapes2 = /* @__PURE__ */ new Map();
|
|
144806
|
+
const names2 = /* @__PURE__ */ new Set();
|
|
144807
|
+
let anonymous = 0;
|
|
144808
|
+
for (const record7 of book.unsupportedRecords ?? []) {
|
|
144809
|
+
xml2.charge();
|
|
144810
|
+
if (record7.source !== "Gnumeric_OpenCalc:openoffice") continue;
|
|
144811
|
+
const data3 = odfObject(record7.data);
|
|
144812
|
+
const section = record7.kind === "automatic-styles" ? data3?.packagePart === "styles.xml" ? "stylesAutomatic" : "contentAutomatic" : record7.kind === "master-styles" ? "masters" : record7.kind === "font-face-decls" ? "fonts" : record7.kind === "styles" ? "styles" : void 0;
|
|
144813
|
+
if (!section) continue;
|
|
144814
|
+
let entries = sections.get(section);
|
|
144815
|
+
if (!entries) {
|
|
144816
|
+
entries = /* @__PURE__ */ new Map();
|
|
144817
|
+
sections.set(section, entries);
|
|
144818
|
+
}
|
|
144819
|
+
for (const child7 of odfChildren(data3?.xml)) {
|
|
144820
|
+
xml2.charge();
|
|
144821
|
+
const node3 = odfObject(child7), attributes4 = odfAttributes(child7, odfNamespaces.style);
|
|
144822
|
+
const key = attributes4.name ? JSON.stringify([node3?.namespace, node3?.name, attributes4.family ?? "", attributes4.name]) : "anonymous:" + anonymous++;
|
|
144823
|
+
entries.set(key, child7);
|
|
144824
|
+
if (attributes4.name) names2.add(attributes4.name);
|
|
144825
|
+
}
|
|
144826
|
+
}
|
|
144827
|
+
for (const [section, entries] of sections) {
|
|
144828
|
+
const byShape = /* @__PURE__ */ new Map();
|
|
144829
|
+
shapes2.set(section, byShape);
|
|
144830
|
+
for (const child7 of entries.values()) {
|
|
144831
|
+
xml2.charge();
|
|
144832
|
+
const node3 = odfObject(child7), name = odfAttributes(child7, odfNamespaces.style).name;
|
|
144833
|
+
if (!node3 || !name || !Array.isArray(node3.attributes)) continue;
|
|
144834
|
+
const attributes4 = node3.attributes.filter((value3) => {
|
|
144835
|
+
xml2.charge();
|
|
144836
|
+
const attribute5 = odfObject(value3);
|
|
144837
|
+
return attribute5?.namespace !== odfNamespaces.style || attribute5?.name !== "name";
|
|
144838
|
+
});
|
|
144839
|
+
byShape.set(xml2.retained({ ...node3, attributes: attributes4 }), name);
|
|
144840
|
+
}
|
|
144841
|
+
}
|
|
144842
|
+
function register(section, tag, preferredName, attributes4, content2 = "") {
|
|
144843
|
+
const shape = xml2.element(tag, attributes4, content2);
|
|
144844
|
+
let byShape = shapes2.get(section);
|
|
144845
|
+
const existing = byShape?.get(shape);
|
|
144846
|
+
if (existing !== void 0) return existing;
|
|
144847
|
+
let name = preferredName, suffix = 1;
|
|
144848
|
+
while (names2.has(name)) {
|
|
144849
|
+
xml2.charge();
|
|
144850
|
+
name = preferredName + "_" + suffix++;
|
|
144851
|
+
}
|
|
144852
|
+
names2.add(name);
|
|
144853
|
+
let entries = sections.get(section);
|
|
144854
|
+
if (!entries) {
|
|
144855
|
+
entries = /* @__PURE__ */ new Map();
|
|
144856
|
+
sections.set(section, entries);
|
|
144857
|
+
}
|
|
144858
|
+
entries.set("generated:" + name, xml2.element(tag, { "style:name": name, ...attributes4 }, content2));
|
|
144859
|
+
if (!byShape) {
|
|
144860
|
+
byShape = /* @__PURE__ */ new Map();
|
|
144861
|
+
shapes2.set(section, byShape);
|
|
144862
|
+
}
|
|
144863
|
+
byShape.set(shape, name);
|
|
144864
|
+
return name;
|
|
144865
|
+
}
|
|
144866
|
+
function render(section) {
|
|
144867
|
+
let result2 = "";
|
|
144868
|
+
for (const value3 of sections.get(section)?.values() ?? []) {
|
|
144869
|
+
xml2.charge();
|
|
144870
|
+
result2 += typeof value3 === "string" ? value3 : xml2.retained(value3);
|
|
144871
|
+
}
|
|
144872
|
+
return result2;
|
|
144873
|
+
}
|
|
144874
|
+
return { register, render };
|
|
144758
144875
|
}
|
|
144759
144876
|
var odfWriterFunctionNames = Object.freeze({
|
|
144760
144877
|
"ABS": "ABS",
|
|
@@ -145591,7 +145708,8 @@ async function readOdf(bytes, context) {
|
|
|
145591
145708
|
const dateSystem = attr5(children5(calculation, "null-date")[0], "date-value")?.startsWith("1904") ? "1904" : "1900";
|
|
145592
145709
|
const unsupportedRecords = [];
|
|
145593
145710
|
const styles = readStyles(styleRoots, pkg.charge);
|
|
145594
|
-
for (const r of styleRoots) for (const node3 of r.children) if (["styles", "automatic-styles", "master-styles", "font-face-decls", "font-decls"].includes(node3.localName))
|
|
145711
|
+
for (const r of styleRoots) for (const node3 of r.children) if (["styles", "automatic-styles", "master-styles", "font-face-decls", "font-decls"].includes(node3.localName))
|
|
145712
|
+
unsupportedRecords.push(record4(node3, { packagePart: r === preparseRoot ? "content.xml" : "styles.xml" }));
|
|
145595
145713
|
if (manifest) unsupportedRecords.push(record4(manifest));
|
|
145596
145714
|
for (const name of ["meta.xml", "settings.xml"]) if (pkg.entries.has(name)) unsupportedRecords.push(record4(await pkg.document(name)));
|
|
145597
145715
|
const resources = /* @__PURE__ */ new Set();
|
|
@@ -145899,6 +146017,8 @@ async function readOdf(bytes, context) {
|
|
|
145899
146017
|
if (calculation) unsupportedRecords.push(record4(calculation));
|
|
145900
146018
|
if (!sheets.length) invalid4("no sheets");
|
|
145901
146019
|
const iteration = children5(calculation, "iteration")[0];
|
|
146020
|
+
const iterationMaximum = Number(attr5(iteration, "steps") ?? "100");
|
|
146021
|
+
if (!Number.isSafeInteger(iterationMaximum) || iterationMaximum < 0) invalid4("invalid iteration count");
|
|
145902
146022
|
const lookup = attr5(calculation, "automatic-find-labels");
|
|
145903
146023
|
if (lookup !== void 0 && !["true", "false"].includes(lookup)) invalid4("invalid automatic label lookup setting");
|
|
145904
146024
|
const book = {
|
|
@@ -145910,7 +146030,7 @@ async function readOdf(bytes, context) {
|
|
|
145910
146030
|
unsupportedRecords,
|
|
145911
146031
|
...iteration ? { iteration: {
|
|
145912
146032
|
enabled: attr5(iteration, "status") === "enable",
|
|
145913
|
-
maximum:
|
|
146033
|
+
maximum: iterationMaximum,
|
|
145914
146034
|
tolerance: Number(attr5(iteration, "maximum-difference") ?? "0.001")
|
|
145915
146035
|
} } : {}
|
|
145916
146036
|
};
|
|
@@ -146168,40 +146288,40 @@ function createOdfWriter(profile) {
|
|
|
146168
146288
|
"table:maximum-difference": iteration?.tolerance ?? 1e-3
|
|
146169
146289
|
})
|
|
146170
146290
|
);
|
|
146171
|
-
|
|
146291
|
+
const definitions4 = createOdfStyleDefinitions(book, xml2);
|
|
146292
|
+
let automatic = "", spreadsheet = "", validations = "", databaseRanges = "";
|
|
146172
146293
|
for (const record7 of book.unsupportedRecords ?? []) {
|
|
146173
146294
|
xml2.charge();
|
|
146174
146295
|
const v = odfObject(record7.data), node3 = odfObject(v?.xml);
|
|
146175
146296
|
if (record7.source === "Gnumeric_OpenCalc:openoffice" && node3) {
|
|
146176
|
-
if (
|
|
146177
|
-
const content2 = odfChildren(node3).map((n) => xml2.retained(n)).join("");
|
|
146178
|
-
if (record7.kind === "automatic-styles") automatic += content2;
|
|
146179
|
-
else if (record7.kind === "master-styles") masters += content2;
|
|
146180
|
-
else if (record7.kind === "font-face-decls") fontFaces += content2;
|
|
146181
|
-
else styleBody += content2;
|
|
146182
|
-
} else if (record7.kind === "content-validations") validations += odfChildren(node3).map((n) => xml2.retained(n)).join("");
|
|
146297
|
+
if (record7.kind === "content-validations") validations += odfChildren(node3).map((n) => xml2.retained(n)).join("");
|
|
146183
146298
|
else if (record7.kind === "database-ranges") databaseRanges += xml2.retained(node3);
|
|
146184
146299
|
}
|
|
146185
146300
|
}
|
|
146186
146301
|
for (const [index2, sheet] of book.sheets.entries()) {
|
|
146187
146302
|
xml2.charge();
|
|
146188
|
-
const sheetStyle = "ta" + index2;
|
|
146189
146303
|
const view2 = odfObject(sheet.view?.gnumeric) ?? {}, properties = odfChildren(sheet.view?.odf).find((n) => odfObject(n)?.name === "table-properties");
|
|
146190
146304
|
const originalProperties = odfAttributes(properties, odfNamespaces.gnm);
|
|
146191
|
-
const print =
|
|
146192
|
-
|
|
146193
|
-
|
|
146194
|
-
|
|
146195
|
-
"
|
|
146196
|
-
"style:
|
|
146197
|
-
|
|
146198
|
-
|
|
146199
|
-
|
|
146200
|
-
"
|
|
146201
|
-
"
|
|
146202
|
-
|
|
146203
|
-
|
|
146204
|
-
|
|
146305
|
+
const print = odfPrintProperties((sheet.unsupportedRecords ?? []).filter((r) => r.kind === "PrintInformation").flatMap((r) => r.data ? [r.data] : []), xml2, extended);
|
|
146306
|
+
const layoutName = definitions4.register("stylesAutomatic", "style:page-layout", "pl" + index2, {}, e("style:page-layout-properties", print));
|
|
146307
|
+
const masterName = definitions4.register("masters", "style:master-page", "mp" + index2, { "style:page-layout-name": layoutName });
|
|
146308
|
+
const sheetStyle = definitions4.register(
|
|
146309
|
+
"contentAutomatic",
|
|
146310
|
+
"style:style",
|
|
146311
|
+
"ta" + index2,
|
|
146312
|
+
{ "style:family": "table", "style:master-page-name": masterName },
|
|
146313
|
+
e("style:table-properties", {
|
|
146314
|
+
"table:display": sheet.visibility && sheet.visibility !== "visible" ? "false" : "true",
|
|
146315
|
+
"style:writing-mode": Number(view2.RTL_Layout ?? 0) ? "rl-tb" : "lr-tb",
|
|
146316
|
+
...extended ? {
|
|
146317
|
+
"gnm:display-formulas": String(Boolean(Number(view2.DisplayFormulas ?? 0))),
|
|
146318
|
+
"gnm:display-col-header": String(!Number(view2.HideColHeader ?? 0)),
|
|
146319
|
+
"gnm:display-row-header": String(!Number(view2.HideRowHeader ?? 0)),
|
|
146320
|
+
"gnm:tab-color": originalProperties["tab-color"],
|
|
146321
|
+
"gnm:tab-text-color": originalProperties["tab-text-color"]
|
|
146322
|
+
} : {}
|
|
146323
|
+
})
|
|
146324
|
+
);
|
|
146205
146325
|
const addresses = /* @__PURE__ */ new Map(), rowCells = /* @__PURE__ */ new Map();
|
|
146206
146326
|
for (const cell of sheet.cells) {
|
|
146207
146327
|
coordinate(cell.row, MAX_SHEET_SIZE.rows);
|
|
@@ -146480,7 +146600,8 @@ function createOdfWriter(profile) {
|
|
|
146480
146600
|
if (pair.axis !== "row" && pair.axis !== "column") throw new SsconvertError("invalid-request", "Invalid OpenDocument label orientation");
|
|
146481
146601
|
const dataSheet = pair.dataSheet === void 0 ? sheet : labelSheets.get(pair.dataSheet);
|
|
146482
146602
|
if (!dataSheet) throw new SsconvertError("unsupported-feature", "OpenDocument label data sheet is not exported");
|
|
146483
|
-
const
|
|
146603
|
+
const absolute = (row, column) => "$" + formatA1(0, column).slice(0, -1) + "$" + (row + 1);
|
|
146604
|
+
const address = (r, name) => "$" + quoteFormulaString(name, "'", odfGrammar) + "." + absolute(r.startRow, r.startColumn) + ":." + absolute(r.endRow, r.endColumn);
|
|
146484
146605
|
labelRanges += e("table:label-range", {
|
|
146485
146606
|
"table:label-cell-range-address": address(pair.labels, sheet.name),
|
|
146486
146607
|
"table:data-cell-range-address": address(pair.data, dataSheet.name),
|
|
@@ -146496,8 +146617,8 @@ function createOdfWriter(profile) {
|
|
|
146496
146617
|
parts.set(name, encoder3.encode(value3));
|
|
146497
146618
|
}
|
|
146498
146619
|
part("mimetype", "application/vnd.oasis.opendocument.spreadsheet");
|
|
146499
|
-
part("content.xml", xml2.document("office:document-content", e("office:scripts") + e("office:font-face-decls") + e("office:automatic-styles", {}, automatic + cellStyles.styles.join("")) + e("office:body", {}, e("office:spreadsheet", {}, spreadsheet))));
|
|
146500
|
-
part("styles.xml", xml2.document("office:document-styles", e("office:font-face-decls", {},
|
|
146620
|
+
part("content.xml", xml2.document("office:document-content", e("office:scripts") + e("office:font-face-decls") + e("office:automatic-styles", {}, definitions4.render("contentAutomatic") + automatic + cellStyles.styles.join("")) + e("office:body", {}, e("office:spreadsheet", {}, spreadsheet))));
|
|
146621
|
+
part("styles.xml", xml2.document("office:document-styles", e("office:font-face-decls", {}, definitions4.render("fonts")) + e("office:styles", {}, definitions4.render("styles")) + e("office:automatic-styles", {}, definitions4.render("stylesAutomatic")) + e("office:master-styles", {}, definitions4.render("masters"))));
|
|
146501
146622
|
part("meta.xml", xml2.document("office:document-meta", e("office:meta", {}, e("meta:generator", {}, "Gnumeric/1.12.61"))));
|
|
146502
146623
|
part("settings.xml", xml2.document("office:document-settings", e("office:settings", {}, e(
|
|
146503
146624
|
"config:config-item-set",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
YqValueFailure,
|
|
3
3
|
createYqQuerySession
|
|
4
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
4
|
+
} from "../safe-bash/command-chunks/chunk-4AWKMIU3.js";
|
|
5
5
|
import "../safe-bash/command-chunks/chunk-S3BO2NJT.js";
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-WX5IUIQK.js";
|
|
7
7
|
import "../safe-bash/command-chunks/chunk-TPDKSK66.js";
|
|
8
8
|
import "../safe-bash/command-chunks/chunk-A7SJ2FC6.js";
|
|
9
9
|
import "../safe-bash/command-chunks/chunk-XZ7QGZMG.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Interpreter
|
|
3
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
3
|
+
} from "../safe-bash/command-chunks/chunk-WX5IUIQK.js";
|
|
4
4
|
import "../safe-bash/command-chunks/chunk-TPDKSK66.js";
|
|
5
5
|
import "../safe-bash/command-chunks/chunk-A7SJ2FC6.js";
|
|
6
6
|
import "../safe-bash/command-chunks/chunk-XZ7QGZMG.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
YqValueFailure,
|
|
3
3
|
createYqQuerySession
|
|
4
|
-
} from "../safe-bash/command-chunks/chunk-
|
|
4
|
+
} from "../safe-bash/command-chunks/chunk-4AWKMIU3.js";
|
|
5
5
|
import "../safe-bash/command-chunks/chunk-S3BO2NJT.js";
|
|
6
|
-
import "../safe-bash/command-chunks/chunk-
|
|
6
|
+
import "../safe-bash/command-chunks/chunk-WX5IUIQK.js";
|
|
7
7
|
import "../safe-bash/command-chunks/chunk-TPDKSK66.js";
|
|
8
8
|
import "../safe-bash/command-chunks/chunk-A7SJ2FC6.js";
|
|
9
9
|
import "../safe-bash/command-chunks/chunk-XZ7QGZMG.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poe-platform/safe-bash",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.748",
|
|
4
4
|
"description": "Extensible virtual shell with pluggable filesystems and streaming commands",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -645,7 +645,7 @@
|
|
|
645
645
|
"access": "public"
|
|
646
646
|
},
|
|
647
647
|
"dependencies": {
|
|
648
|
-
"@poe-platform/safe-fs": "0.1.
|
|
648
|
+
"@poe-platform/safe-fs": "0.1.748",
|
|
649
649
|
"pdf-lib": "1.17.1",
|
|
650
650
|
"@types/node": "^25.2.2",
|
|
651
651
|
"pako": "3.0.1",
|