pptx-viewer-core 1.1.28 → 1.1.30
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/CHANGELOG.md +6 -0
- package/dist/cli/index.js +0 -0
- package/dist/cli/index.mjs +0 -0
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +42 -27
- package/dist/index.mjs +42 -27
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to this project are documented here.
|
|
|
4
4
|
This file is generated from [Conventional Commits](https://www.conventionalcommits.org)
|
|
5
5
|
by [git-cliff](https://git-cliff.org); do not edit it by hand.
|
|
6
6
|
|
|
7
|
+
## [1.1.28](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-core@1.1.28) - 2026-06-21
|
|
8
|
+
|
|
9
|
+
### Dependencies
|
|
10
|
+
|
|
11
|
+
- **deps:** Update dependencies within semver ranges (by @ChristopherVR) ([d472b58](https://github.com/ChristopherVR/pptx-viewer/commit/d472b58dfd47628b5c682bd5f4dc2014ec29b421))
|
|
12
|
+
|
|
7
13
|
## [1.1.27](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-viewer-core@1.1.27) - 2026-06-21
|
|
8
14
|
|
|
9
15
|
### Bug Fixes
|
package/dist/cli/index.js
CHANGED
|
Binary file
|
package/dist/cli/index.mjs
CHANGED
|
Binary file
|
package/dist/index.d.mts
CHANGED
|
@@ -3538,7 +3538,9 @@ declare function resolveModel3DMimeType(modelPath: string): string | undefined;
|
|
|
3538
3538
|
type OoxmlConformanceClass = 'strict' | 'transitional';
|
|
3539
3539
|
/**
|
|
3540
3540
|
* Convert a Strict Open XML namespace URI to its Transitional equivalent.
|
|
3541
|
-
*
|
|
3541
|
+
* The explicit map takes precedence; any other Strict URI in a remapped family
|
|
3542
|
+
* is derived structurally. If the URI is already Transitional (or unknown), it
|
|
3543
|
+
* is returned unchanged.
|
|
3542
3544
|
*/
|
|
3543
3545
|
declare function normalizeNamespaceUri(uri: string): string;
|
|
3544
3546
|
/**
|
|
@@ -3565,11 +3567,14 @@ declare function detectStrictConformance(xmlObj: Record<string, unknown>): boole
|
|
|
3565
3567
|
declare function normalizeStrictXml(node: Record<string, unknown>): Record<string, unknown>;
|
|
3566
3568
|
/**
|
|
3567
3569
|
* Convert a Transitional Open XML namespace URI to its Strict equivalent.
|
|
3568
|
-
*
|
|
3570
|
+
* The explicit map takes precedence; any other versioned Transitional URI in a
|
|
3571
|
+
* remapped family is derived structurally. If the URI is already Strict (or
|
|
3572
|
+
* unknown), it is returned unchanged.
|
|
3569
3573
|
*/
|
|
3570
3574
|
declare function toStrictNamespaceUri(uri: string): string;
|
|
3571
3575
|
/**
|
|
3572
|
-
* Check whether a URI belongs to the Transitional Open XML namespace family
|
|
3576
|
+
* Check whether a URI belongs to the Transitional Open XML namespace family,
|
|
3577
|
+
* either by explicit mapping or by the structural family rule.
|
|
3573
3578
|
*/
|
|
3574
3579
|
declare function isTransitionalNamespaceUri(uri: string): boolean;
|
|
3575
3580
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -3538,7 +3538,9 @@ declare function resolveModel3DMimeType(modelPath: string): string | undefined;
|
|
|
3538
3538
|
type OoxmlConformanceClass = 'strict' | 'transitional';
|
|
3539
3539
|
/**
|
|
3540
3540
|
* Convert a Strict Open XML namespace URI to its Transitional equivalent.
|
|
3541
|
-
*
|
|
3541
|
+
* The explicit map takes precedence; any other Strict URI in a remapped family
|
|
3542
|
+
* is derived structurally. If the URI is already Transitional (or unknown), it
|
|
3543
|
+
* is returned unchanged.
|
|
3542
3544
|
*/
|
|
3543
3545
|
declare function normalizeNamespaceUri(uri: string): string;
|
|
3544
3546
|
/**
|
|
@@ -3565,11 +3567,14 @@ declare function detectStrictConformance(xmlObj: Record<string, unknown>): boole
|
|
|
3565
3567
|
declare function normalizeStrictXml(node: Record<string, unknown>): Record<string, unknown>;
|
|
3566
3568
|
/**
|
|
3567
3569
|
* Convert a Transitional Open XML namespace URI to its Strict equivalent.
|
|
3568
|
-
*
|
|
3570
|
+
* The explicit map takes precedence; any other versioned Transitional URI in a
|
|
3571
|
+
* remapped family is derived structurally. If the URI is already Strict (or
|
|
3572
|
+
* unknown), it is returned unchanged.
|
|
3569
3573
|
*/
|
|
3570
3574
|
declare function toStrictNamespaceUri(uri: string): string;
|
|
3571
3575
|
/**
|
|
3572
|
-
* Check whether a URI belongs to the Transitional Open XML namespace family
|
|
3576
|
+
* Check whether a URI belongs to the Transitional Open XML namespace family,
|
|
3577
|
+
* either by explicit mapping or by the structural family rule.
|
|
3573
3578
|
*/
|
|
3574
3579
|
declare function isTransitionalNamespaceUri(uri: string): boolean;
|
|
3575
3580
|
/**
|
package/dist/index.js
CHANGED
|
@@ -20212,8 +20212,41 @@ var STRICT_TO_TRANSITIONAL_NS = new Map(NAMESPACE_PAIRS);
|
|
|
20212
20212
|
var TRANSITIONAL_TO_STRICT_NS = new Map(
|
|
20213
20213
|
NAMESPACE_PAIRS.map(([strict, transitional]) => [transitional, strict])
|
|
20214
20214
|
);
|
|
20215
|
+
var STRICT_BASE = "http://purl.oclc.org/ooxml/";
|
|
20216
|
+
var TRANSITIONAL_BASE = "http://schemas.openxmlformats.org/";
|
|
20217
|
+
var ALGORITHMIC_FAMILIES = /* @__PURE__ */ new Set([
|
|
20218
|
+
"presentationml",
|
|
20219
|
+
"drawingml",
|
|
20220
|
+
"spreadsheetml",
|
|
20221
|
+
"wordprocessingml",
|
|
20222
|
+
"officeDocument"
|
|
20223
|
+
]);
|
|
20224
|
+
function deriveTransitionalUri(uri) {
|
|
20225
|
+
if (!uri.startsWith(STRICT_BASE)) {
|
|
20226
|
+
return void 0;
|
|
20227
|
+
}
|
|
20228
|
+
const segments = uri.slice(STRICT_BASE.length).split("/");
|
|
20229
|
+
if (segments.length < 2 || !ALGORITHMIC_FAMILIES.has(segments[0])) {
|
|
20230
|
+
return void 0;
|
|
20231
|
+
}
|
|
20232
|
+
if (segments[1] !== "2006") {
|
|
20233
|
+
segments.splice(1, 0, "2006");
|
|
20234
|
+
}
|
|
20235
|
+
return TRANSITIONAL_BASE + segments.join("/");
|
|
20236
|
+
}
|
|
20237
|
+
function deriveStrictUri(uri) {
|
|
20238
|
+
if (!uri.startsWith(TRANSITIONAL_BASE)) {
|
|
20239
|
+
return void 0;
|
|
20240
|
+
}
|
|
20241
|
+
const segments = uri.slice(TRANSITIONAL_BASE.length).split("/");
|
|
20242
|
+
if (segments.length < 3 || !ALGORITHMIC_FAMILIES.has(segments[0]) || segments[1] !== "2006") {
|
|
20243
|
+
return void 0;
|
|
20244
|
+
}
|
|
20245
|
+
segments.splice(1, 1);
|
|
20246
|
+
return STRICT_BASE + segments.join("/");
|
|
20247
|
+
}
|
|
20215
20248
|
function normalizeNamespaceUri(uri) {
|
|
20216
|
-
return STRICT_TO_TRANSITIONAL_NS.get(uri) ?? uri;
|
|
20249
|
+
return STRICT_TO_TRANSITIONAL_NS.get(uri) ?? deriveTransitionalUri(uri) ?? uri;
|
|
20217
20250
|
}
|
|
20218
20251
|
function isStrictNamespaceUri(uri) {
|
|
20219
20252
|
return uri.startsWith("http://purl.oclc.org/ooxml/");
|
|
@@ -20245,25 +20278,16 @@ function normalizeStrictXml(node) {
|
|
|
20245
20278
|
const value = node[key];
|
|
20246
20279
|
if (key.startsWith("@_xmlns")) {
|
|
20247
20280
|
if (typeof value === "string") {
|
|
20248
|
-
|
|
20249
|
-
if (mapped) {
|
|
20250
|
-
node[key] = mapped;
|
|
20251
|
-
}
|
|
20281
|
+
node[key] = normalizeNamespaceUri(value);
|
|
20252
20282
|
}
|
|
20253
20283
|
continue;
|
|
20254
20284
|
}
|
|
20255
20285
|
if (key === "@_Type" && typeof value === "string") {
|
|
20256
|
-
|
|
20257
|
-
if (mapped) {
|
|
20258
|
-
node[key] = mapped;
|
|
20259
|
-
}
|
|
20286
|
+
node[key] = normalizeNamespaceUri(value);
|
|
20260
20287
|
continue;
|
|
20261
20288
|
}
|
|
20262
20289
|
if (key === "@_uri" && typeof value === "string") {
|
|
20263
|
-
|
|
20264
|
-
if (mapped) {
|
|
20265
|
-
node[key] = mapped;
|
|
20266
|
-
}
|
|
20290
|
+
node[key] = normalizeNamespaceUri(value);
|
|
20267
20291
|
continue;
|
|
20268
20292
|
}
|
|
20269
20293
|
if (key.startsWith("@_")) {
|
|
@@ -20282,10 +20306,10 @@ function normalizeStrictXml(node) {
|
|
|
20282
20306
|
return node;
|
|
20283
20307
|
}
|
|
20284
20308
|
function toStrictNamespaceUri(uri) {
|
|
20285
|
-
return TRANSITIONAL_TO_STRICT_NS.get(uri) ?? uri;
|
|
20309
|
+
return TRANSITIONAL_TO_STRICT_NS.get(uri) ?? deriveStrictUri(uri) ?? uri;
|
|
20286
20310
|
}
|
|
20287
20311
|
function isTransitionalNamespaceUri(uri) {
|
|
20288
|
-
return TRANSITIONAL_TO_STRICT_NS.has(uri);
|
|
20312
|
+
return TRANSITIONAL_TO_STRICT_NS.has(uri) || deriveStrictUri(uri) !== void 0;
|
|
20289
20313
|
}
|
|
20290
20314
|
function convertXmlToStrict(node, setConformance = false) {
|
|
20291
20315
|
if (typeof node !== "object" || node === null || Array.isArray(node)) {
|
|
@@ -20301,25 +20325,16 @@ function convertXmlToStrict(node, setConformance = false) {
|
|
|
20301
20325
|
const value = node[key];
|
|
20302
20326
|
if (key.startsWith("@_xmlns")) {
|
|
20303
20327
|
if (typeof value === "string") {
|
|
20304
|
-
|
|
20305
|
-
if (mapped) {
|
|
20306
|
-
node[key] = mapped;
|
|
20307
|
-
}
|
|
20328
|
+
node[key] = toStrictNamespaceUri(value);
|
|
20308
20329
|
}
|
|
20309
20330
|
continue;
|
|
20310
20331
|
}
|
|
20311
20332
|
if (key === "@_Type" && typeof value === "string") {
|
|
20312
|
-
|
|
20313
|
-
if (mapped) {
|
|
20314
|
-
node[key] = mapped;
|
|
20315
|
-
}
|
|
20333
|
+
node[key] = toStrictNamespaceUri(value);
|
|
20316
20334
|
continue;
|
|
20317
20335
|
}
|
|
20318
20336
|
if (key === "@_uri" && typeof value === "string") {
|
|
20319
|
-
|
|
20320
|
-
if (mapped) {
|
|
20321
|
-
node[key] = mapped;
|
|
20322
|
-
}
|
|
20337
|
+
node[key] = toStrictNamespaceUri(value);
|
|
20323
20338
|
continue;
|
|
20324
20339
|
}
|
|
20325
20340
|
if (key.startsWith("@_")) {
|
package/dist/index.mjs
CHANGED
|
@@ -20207,8 +20207,41 @@ var STRICT_TO_TRANSITIONAL_NS = new Map(NAMESPACE_PAIRS);
|
|
|
20207
20207
|
var TRANSITIONAL_TO_STRICT_NS = new Map(
|
|
20208
20208
|
NAMESPACE_PAIRS.map(([strict, transitional]) => [transitional, strict])
|
|
20209
20209
|
);
|
|
20210
|
+
var STRICT_BASE = "http://purl.oclc.org/ooxml/";
|
|
20211
|
+
var TRANSITIONAL_BASE = "http://schemas.openxmlformats.org/";
|
|
20212
|
+
var ALGORITHMIC_FAMILIES = /* @__PURE__ */ new Set([
|
|
20213
|
+
"presentationml",
|
|
20214
|
+
"drawingml",
|
|
20215
|
+
"spreadsheetml",
|
|
20216
|
+
"wordprocessingml",
|
|
20217
|
+
"officeDocument"
|
|
20218
|
+
]);
|
|
20219
|
+
function deriveTransitionalUri(uri) {
|
|
20220
|
+
if (!uri.startsWith(STRICT_BASE)) {
|
|
20221
|
+
return void 0;
|
|
20222
|
+
}
|
|
20223
|
+
const segments = uri.slice(STRICT_BASE.length).split("/");
|
|
20224
|
+
if (segments.length < 2 || !ALGORITHMIC_FAMILIES.has(segments[0])) {
|
|
20225
|
+
return void 0;
|
|
20226
|
+
}
|
|
20227
|
+
if (segments[1] !== "2006") {
|
|
20228
|
+
segments.splice(1, 0, "2006");
|
|
20229
|
+
}
|
|
20230
|
+
return TRANSITIONAL_BASE + segments.join("/");
|
|
20231
|
+
}
|
|
20232
|
+
function deriveStrictUri(uri) {
|
|
20233
|
+
if (!uri.startsWith(TRANSITIONAL_BASE)) {
|
|
20234
|
+
return void 0;
|
|
20235
|
+
}
|
|
20236
|
+
const segments = uri.slice(TRANSITIONAL_BASE.length).split("/");
|
|
20237
|
+
if (segments.length < 3 || !ALGORITHMIC_FAMILIES.has(segments[0]) || segments[1] !== "2006") {
|
|
20238
|
+
return void 0;
|
|
20239
|
+
}
|
|
20240
|
+
segments.splice(1, 1);
|
|
20241
|
+
return STRICT_BASE + segments.join("/");
|
|
20242
|
+
}
|
|
20210
20243
|
function normalizeNamespaceUri(uri) {
|
|
20211
|
-
return STRICT_TO_TRANSITIONAL_NS.get(uri) ?? uri;
|
|
20244
|
+
return STRICT_TO_TRANSITIONAL_NS.get(uri) ?? deriveTransitionalUri(uri) ?? uri;
|
|
20212
20245
|
}
|
|
20213
20246
|
function isStrictNamespaceUri(uri) {
|
|
20214
20247
|
return uri.startsWith("http://purl.oclc.org/ooxml/");
|
|
@@ -20240,25 +20273,16 @@ function normalizeStrictXml(node) {
|
|
|
20240
20273
|
const value = node[key];
|
|
20241
20274
|
if (key.startsWith("@_xmlns")) {
|
|
20242
20275
|
if (typeof value === "string") {
|
|
20243
|
-
|
|
20244
|
-
if (mapped) {
|
|
20245
|
-
node[key] = mapped;
|
|
20246
|
-
}
|
|
20276
|
+
node[key] = normalizeNamespaceUri(value);
|
|
20247
20277
|
}
|
|
20248
20278
|
continue;
|
|
20249
20279
|
}
|
|
20250
20280
|
if (key === "@_Type" && typeof value === "string") {
|
|
20251
|
-
|
|
20252
|
-
if (mapped) {
|
|
20253
|
-
node[key] = mapped;
|
|
20254
|
-
}
|
|
20281
|
+
node[key] = normalizeNamespaceUri(value);
|
|
20255
20282
|
continue;
|
|
20256
20283
|
}
|
|
20257
20284
|
if (key === "@_uri" && typeof value === "string") {
|
|
20258
|
-
|
|
20259
|
-
if (mapped) {
|
|
20260
|
-
node[key] = mapped;
|
|
20261
|
-
}
|
|
20285
|
+
node[key] = normalizeNamespaceUri(value);
|
|
20262
20286
|
continue;
|
|
20263
20287
|
}
|
|
20264
20288
|
if (key.startsWith("@_")) {
|
|
@@ -20277,10 +20301,10 @@ function normalizeStrictXml(node) {
|
|
|
20277
20301
|
return node;
|
|
20278
20302
|
}
|
|
20279
20303
|
function toStrictNamespaceUri(uri) {
|
|
20280
|
-
return TRANSITIONAL_TO_STRICT_NS.get(uri) ?? uri;
|
|
20304
|
+
return TRANSITIONAL_TO_STRICT_NS.get(uri) ?? deriveStrictUri(uri) ?? uri;
|
|
20281
20305
|
}
|
|
20282
20306
|
function isTransitionalNamespaceUri(uri) {
|
|
20283
|
-
return TRANSITIONAL_TO_STRICT_NS.has(uri);
|
|
20307
|
+
return TRANSITIONAL_TO_STRICT_NS.has(uri) || deriveStrictUri(uri) !== void 0;
|
|
20284
20308
|
}
|
|
20285
20309
|
function convertXmlToStrict(node, setConformance = false) {
|
|
20286
20310
|
if (typeof node !== "object" || node === null || Array.isArray(node)) {
|
|
@@ -20296,25 +20320,16 @@ function convertXmlToStrict(node, setConformance = false) {
|
|
|
20296
20320
|
const value = node[key];
|
|
20297
20321
|
if (key.startsWith("@_xmlns")) {
|
|
20298
20322
|
if (typeof value === "string") {
|
|
20299
|
-
|
|
20300
|
-
if (mapped) {
|
|
20301
|
-
node[key] = mapped;
|
|
20302
|
-
}
|
|
20323
|
+
node[key] = toStrictNamespaceUri(value);
|
|
20303
20324
|
}
|
|
20304
20325
|
continue;
|
|
20305
20326
|
}
|
|
20306
20327
|
if (key === "@_Type" && typeof value === "string") {
|
|
20307
|
-
|
|
20308
|
-
if (mapped) {
|
|
20309
|
-
node[key] = mapped;
|
|
20310
|
-
}
|
|
20328
|
+
node[key] = toStrictNamespaceUri(value);
|
|
20311
20329
|
continue;
|
|
20312
20330
|
}
|
|
20313
20331
|
if (key === "@_uri" && typeof value === "string") {
|
|
20314
|
-
|
|
20315
|
-
if (mapped) {
|
|
20316
|
-
node[key] = mapped;
|
|
20317
|
-
}
|
|
20332
|
+
node[key] = toStrictNamespaceUri(value);
|
|
20318
20333
|
continue;
|
|
20319
20334
|
}
|
|
20320
20335
|
if (key.startsWith("@_")) {
|