deckjsx 0.8.1 → 0.8.2
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/README.md +54 -1
- package/dist/{adapter-B-bVXjv-.d.mts → adapter-B0PALTZN.d.mts} +2 -2
- package/dist/{adapter-CNSvvD4i.mjs → adapter-B3Efckbf.mjs} +105 -52
- package/dist/adapter.d.mts +1 -1
- package/dist/adapter.mjs +1 -1
- package/dist/{index-BlOsGMTm.d.mts → index-DOxigSfK.d.mts} +16 -12
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +984 -161
- package/dist/inspect.d.mts +3 -3
- package/dist/jsx-dev-runtime.d.mts +2 -2
- package/dist/{jsx-runtime-Dd6G09P7.d.mts → jsx-runtime-BhY1AeJ9.d.mts} +1 -1
- package/dist/jsx-runtime.d.mts +2 -2
- package/dist/{model-oqG9gKTq.d.mts → model-C82_FI4k.d.mts} +2 -2
- package/dist/node-output-L2bV2_8g.mjs +136 -0
- package/dist/{resolve-CfjiMtv5.d.mts → resolve-DH0cI2C3.d.mts} +5 -2
- package/package.json +1 -1
- package/dist/node-output-BXQOTLKj.mjs +0 -28
package/dist/inspect.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as BaseSemanticNode, B as SemanticRole, F as SemanticDocumentNode, G as SourceIdentity, H as SemanticSlideNode, I as SemanticImageNode, J as StyleEntity, K as SourceOrigin, L as SemanticNode, M as GraphNodeId, N as SemanticAuthorGraph, O as AssetEntity, P as SemanticContainerNode, R as SemanticNodeKind, U as SemanticTextNode, V as SemanticShapeNode, W as SemanticTextRunNode, Y as StyleEntityId, k as AssetEntityId, q as StyleClassRef, z as SemanticOrigin } from "./index-
|
|
2
|
-
import { $ as PptxSupportPartPayload, $t as isPptxRelationshipsPart, A as PptxPackagePartKind, At as ProjectInspectionEffectiveProjectedStyleEntry, B as PptxRelationshipsPart, Bt as ProjectInspectionPaintFallbackAggregationEntry, C as PptxNotesPlaceholderPayload, Ct as PptxVisibility, D as PptxPackagePartCandidate, Dt as ProjectInspectionComposedPaintOrderSlideView, E as PptxPackagePart, Et as ProjectInspectionComposedPaintOrderEntry, F as PptxPackagePartRequirementStatus, Ft as ProjectInspectionMediaSummary, G as PptxShapeElement, Gt as ProjectInspectionSummary, H as PptxSerializedIdentities, Ht as ProjectInspectionPartSummary, I as PptxPaintOrderInput, It as ProjectInspectionPackageDependencyInvalidationEntry, J as PptxSlideLayoutPartPayload, Jt as ProjectInspectionUnsupportedSemanticRecord, K as PptxSlideDrawing, Kt as ProjectInspectionThemeProjectionEntry, L as PptxPictureElement, Lt as ProjectInspectionPackageDependencyInvalidationView, M as PptxPackagePartOrderKey, Mt as ProjectInspectionElementSummary, N as PptxPackagePartRequirement, Nt as ProjectInspectionFilteredReason, O as PptxPackagePartCategory, Ot as ProjectInspectionDetails, P as PptxPackagePartRequirementCondition, Pt as ProjectInspectionFilteredRecord, Q as PptxSupportPart, Qt as isPptxPackagePart, R as PptxPresentationSlideMasterId, Rt as ProjectInspectionPackageDependencyReason, S as PptxMediaPartPayload, St as PptxUnsupportedSemanticFeature, T as PptxPackageModelCandidate, Tt as ProjectInspectionBackgroundLayerSummary, U as PptxSerializedIdentity, Ut as ProjectInspectionRelationshipSummary, V as PptxRelationshipsPayload, Vt as ProjectInspectionPaintFallbackAggregationView, W as PptxShadow, Wt as ProjectInspectionResolvedValues, X as PptxSlideMasterPartPayload, Xt as isPptxMediaPart, Y as PptxSlideMasterLayoutId, Yt as isPptxContentTypesPart, Z as PptxSlidePart, Zt as isPptxPackageModel, _ as PptxKnownPackagePart, _t as PptxThemeValueGroupFingerprint, a as PptxContentTypeOverride, at as PptxThemeEffectiveInheritanceStep, b as PptxMediaMetadata, bt as PptxUnsupportedFallbackStrategy, c as PptxDrawingNode, ct as PptxThemeProjectionPayload, d as PptxElementKind, dt as PptxThemeReferenceSerializationChoice, en as isPptxSlidePart, et as PptxTextElement, f as PptxElementOrigin, ft as PptxThemeReferenceSerializationDecision, g as PptxGroupElement, gt as PptxThemeValueGroup, h as PptxGeneratedStrokeLayer, ht as PptxThemeUnprojectedMapping, i as PptxContentTypeDefault, it as PptxThemeDefaultStyleProjectionTarget, j as PptxPackagePartOrderGroup, jt as ProjectInspectionEffectiveProjectedStyleSlideView, k as PptxPackagePartDependencyFingerprint, kt as ProjectInspectionDiagnosticSummary, l as PptxElement, lt as PptxThemeProjectionTrace, m as PptxEmptySupportPartPayload, mt as PptxThemeSupportMapping, n as PptxBackgroundLayer, nt as PptxThemeDefaultStyleDecision, o as PptxContentTypesPart, ot as PptxThemeEffectiveInheritanceTrace, p as PptxEmissionTarget, pt as PptxThemeReferenceSerializationKind, q as PptxSlideLayoutAnchor, qt as ProjectInspectionThemeProjectionView, r as PptxClip, rt as PptxThemeDefaultStyleDecisionKind, s as PptxContentTypesPayload, st as PptxThemePartPayload, t as PackagePartId, tn as isPptxSupportPart, tt as PptxThemeConcreteDrawingPropertyMapping, u as PptxElementId, ut as PptxThemeReferenceCandidate, v as PptxLayoutAnchor, vt as PptxThemeWholeThemeMapping, w as PptxPackageModel, wt as ProjectInspectionAdapterLimitation, x as PptxMediaPart, xt as PptxUnsupportedSemantic, y as PptxMeasurement, yt as PptxUnsupportedFallback, z as PptxRelationship, zt as ProjectInspectionPackageDependencySummary } from "./model-
|
|
3
|
-
import { a as ResolvedStyleSource, i as ResolvedStyleProperty, n as ResolvedStyleLayer, o as StyleResolutionResult, r as ResolvedStyleMap, t as ResolvedStyle } from "./resolve-
|
|
1
|
+
import { A as BaseSemanticNode, B as SemanticRole, F as SemanticDocumentNode, G as SourceIdentity, H as SemanticSlideNode, I as SemanticImageNode, J as StyleEntity, K as SourceOrigin, L as SemanticNode, M as GraphNodeId, N as SemanticAuthorGraph, O as AssetEntity, P as SemanticContainerNode, R as SemanticNodeKind, U as SemanticTextNode, V as SemanticShapeNode, W as SemanticTextRunNode, Y as StyleEntityId, k as AssetEntityId, q as StyleClassRef, z as SemanticOrigin } from "./index-DOxigSfK.mjs";
|
|
2
|
+
import { $ as PptxSupportPartPayload, $t as isPptxRelationshipsPart, A as PptxPackagePartKind, At as ProjectInspectionEffectiveProjectedStyleEntry, B as PptxRelationshipsPart, Bt as ProjectInspectionPaintFallbackAggregationEntry, C as PptxNotesPlaceholderPayload, Ct as PptxVisibility, D as PptxPackagePartCandidate, Dt as ProjectInspectionComposedPaintOrderSlideView, E as PptxPackagePart, Et as ProjectInspectionComposedPaintOrderEntry, F as PptxPackagePartRequirementStatus, Ft as ProjectInspectionMediaSummary, G as PptxShapeElement, Gt as ProjectInspectionSummary, H as PptxSerializedIdentities, Ht as ProjectInspectionPartSummary, I as PptxPaintOrderInput, It as ProjectInspectionPackageDependencyInvalidationEntry, J as PptxSlideLayoutPartPayload, Jt as ProjectInspectionUnsupportedSemanticRecord, K as PptxSlideDrawing, Kt as ProjectInspectionThemeProjectionEntry, L as PptxPictureElement, Lt as ProjectInspectionPackageDependencyInvalidationView, M as PptxPackagePartOrderKey, Mt as ProjectInspectionElementSummary, N as PptxPackagePartRequirement, Nt as ProjectInspectionFilteredReason, O as PptxPackagePartCategory, Ot as ProjectInspectionDetails, P as PptxPackagePartRequirementCondition, Pt as ProjectInspectionFilteredRecord, Q as PptxSupportPart, Qt as isPptxPackagePart, R as PptxPresentationSlideMasterId, Rt as ProjectInspectionPackageDependencyReason, S as PptxMediaPartPayload, St as PptxUnsupportedSemanticFeature, T as PptxPackageModelCandidate, Tt as ProjectInspectionBackgroundLayerSummary, U as PptxSerializedIdentity, Ut as ProjectInspectionRelationshipSummary, V as PptxRelationshipsPayload, Vt as ProjectInspectionPaintFallbackAggregationView, W as PptxShadow, Wt as ProjectInspectionResolvedValues, X as PptxSlideMasterPartPayload, Xt as isPptxMediaPart, Y as PptxSlideMasterLayoutId, Yt as isPptxContentTypesPart, Z as PptxSlidePart, Zt as isPptxPackageModel, _ as PptxKnownPackagePart, _t as PptxThemeValueGroupFingerprint, a as PptxContentTypeOverride, at as PptxThemeEffectiveInheritanceStep, b as PptxMediaMetadata, bt as PptxUnsupportedFallbackStrategy, c as PptxDrawingNode, ct as PptxThemeProjectionPayload, d as PptxElementKind, dt as PptxThemeReferenceSerializationChoice, en as isPptxSlidePart, et as PptxTextElement, f as PptxElementOrigin, ft as PptxThemeReferenceSerializationDecision, g as PptxGroupElement, gt as PptxThemeValueGroup, h as PptxGeneratedStrokeLayer, ht as PptxThemeUnprojectedMapping, i as PptxContentTypeDefault, it as PptxThemeDefaultStyleProjectionTarget, j as PptxPackagePartOrderGroup, jt as ProjectInspectionEffectiveProjectedStyleSlideView, k as PptxPackagePartDependencyFingerprint, kt as ProjectInspectionDiagnosticSummary, l as PptxElement, lt as PptxThemeProjectionTrace, m as PptxEmptySupportPartPayload, mt as PptxThemeSupportMapping, n as PptxBackgroundLayer, nt as PptxThemeDefaultStyleDecision, o as PptxContentTypesPart, ot as PptxThemeEffectiveInheritanceTrace, p as PptxEmissionTarget, pt as PptxThemeReferenceSerializationKind, q as PptxSlideLayoutAnchor, qt as ProjectInspectionThemeProjectionView, r as PptxClip, rt as PptxThemeDefaultStyleDecisionKind, s as PptxContentTypesPayload, st as PptxThemePartPayload, t as PackagePartId, tn as isPptxSupportPart, tt as PptxThemeConcreteDrawingPropertyMapping, u as PptxElementId, ut as PptxThemeReferenceCandidate, v as PptxLayoutAnchor, vt as PptxThemeWholeThemeMapping, w as PptxPackageModel, wt as ProjectInspectionAdapterLimitation, x as PptxMediaPart, xt as PptxUnsupportedSemantic, y as PptxMeasurement, yt as PptxUnsupportedFallback, z as PptxRelationship, zt as ProjectInspectionPackageDependencySummary } from "./model-C82_FI4k.mjs";
|
|
3
|
+
import { a as ResolvedStyleSource, i as ResolvedStyleProperty, n as ResolvedStyleLayer, o as StyleResolutionResult, r as ResolvedStyleMap, t as ResolvedStyle } from "./resolve-DH0cI2C3.mjs";
|
|
4
4
|
export { type AssetEntity, type AssetEntityId, type BaseSemanticNode, type GraphNodeId, type PackagePartId, type PptxBackgroundLayer, type PptxClip, type PptxContentTypeDefault, type PptxContentTypeOverride, type PptxContentTypesPart, type PptxContentTypesPayload, type PptxDrawingNode, type PptxElement, type PptxElementId, type PptxElementKind, type PptxElementOrigin, type PptxEmissionTarget, type PptxEmptySupportPartPayload, type PptxGeneratedStrokeLayer, type PptxGroupElement, type PptxKnownPackagePart, type PptxLayoutAnchor, type PptxMeasurement, type PptxMediaMetadata, type PptxMediaPart, type PptxMediaPartPayload, type PptxNotesPlaceholderPayload, type PptxPackageModel, type PptxPackageModelCandidate, type PptxPackagePart, type PptxPackagePartCandidate, type PptxPackagePartCategory, type PptxPackagePartDependencyFingerprint, type PptxPackagePartKind, type PptxPackagePartOrderGroup, type PptxPackagePartOrderKey, type PptxPackagePartRequirement, type PptxPackagePartRequirementCondition, type PptxPackagePartRequirementStatus, type PptxPaintOrderInput, type PptxPictureElement, type PptxPresentationSlideMasterId, type PptxRelationship, type PptxRelationshipsPart, type PptxRelationshipsPayload, type PptxSerializedIdentities, type PptxSerializedIdentity, type PptxShadow, type PptxShapeElement, type PptxSlideDrawing, type PptxSlideLayoutAnchor, type PptxSlideLayoutPartPayload, type PptxSlideMasterLayoutId, type PptxSlideMasterPartPayload, type PptxSlidePart, type PptxSupportPart, type PptxSupportPartPayload, type PptxTextElement, type PptxThemeConcreteDrawingPropertyMapping, type PptxThemeDefaultStyleDecision, type PptxThemeDefaultStyleDecisionKind, type PptxThemeDefaultStyleProjectionTarget, type PptxThemeEffectiveInheritanceStep, type PptxThemeEffectiveInheritanceTrace, type PptxThemePartPayload, type PptxThemeProjectionPayload, type PptxThemeProjectionTrace, type PptxThemeReferenceCandidate, type PptxThemeReferenceSerializationChoice, type PptxThemeReferenceSerializationDecision, type PptxThemeReferenceSerializationKind, type PptxThemeSupportMapping, type PptxThemeUnprojectedMapping, type PptxThemeValueGroup, type PptxThemeValueGroupFingerprint, type PptxThemeWholeThemeMapping, type PptxUnsupportedFallback, type PptxUnsupportedFallbackStrategy, type PptxUnsupportedSemantic, type PptxUnsupportedSemanticFeature, type PptxVisibility, type ProjectInspectionAdapterLimitation, type ProjectInspectionBackgroundLayerSummary, type ProjectInspectionComposedPaintOrderEntry, type ProjectInspectionComposedPaintOrderSlideView, type ProjectInspectionDetails, type ProjectInspectionDiagnosticSummary, type ProjectInspectionEffectiveProjectedStyleEntry, type ProjectInspectionEffectiveProjectedStyleSlideView, type ProjectInspectionElementSummary, type ProjectInspectionFilteredReason, type ProjectInspectionFilteredRecord, type ProjectInspectionMediaSummary, type ProjectInspectionPackageDependencyInvalidationEntry, type ProjectInspectionPackageDependencyInvalidationView, type ProjectInspectionPackageDependencyReason, type ProjectInspectionPackageDependencySummary, type ProjectInspectionPaintFallbackAggregationEntry, type ProjectInspectionPaintFallbackAggregationView, type ProjectInspectionPartSummary, type ProjectInspectionRelationshipSummary, type ProjectInspectionResolvedValues, type ProjectInspectionSummary, type ProjectInspectionThemeProjectionEntry, type ProjectInspectionThemeProjectionView, type ProjectInspectionUnsupportedSemanticRecord, type ResolvedStyle, type ResolvedStyleLayer, type ResolvedStyleMap, type ResolvedStyleProperty, type ResolvedStyleSource, type SemanticAuthorGraph, type SemanticContainerNode, type SemanticDocumentNode, type SemanticImageNode, type SemanticNode, type SemanticNodeKind, type SemanticOrigin, type SemanticRole, type SemanticShapeNode, type SemanticSlideNode, type SemanticTextNode, type SemanticTextRunNode, type SourceIdentity, type SourceOrigin, type StyleClassRef, type StyleEntity, type StyleEntityId, type StyleResolutionResult, isPptxContentTypesPart, isPptxMediaPart, isPptxPackageModel, isPptxPackagePart, isPptxRelationshipsPart, isPptxSlidePart, isPptxSupportPart };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as IntrinsicDivProps, c as IntrinsicShapeProps, d as JsxNode, l as IntrinsicTextTag, n as DeckJsxElement, o as IntrinsicImgProps, ot as JsxKey, r as DeckJsxIntrinsicElements, s as IntrinsicPProps, u as IntrinsicViewTag } from "./index-
|
|
2
|
-
import { a as jsxs, i as jsx, n as JsxComponentProps, o as Fragment, r as JsxDevSource } from "./jsx-runtime-
|
|
1
|
+
import { a as IntrinsicDivProps, c as IntrinsicShapeProps, d as JsxNode, l as IntrinsicTextTag, n as DeckJsxElement, o as IntrinsicImgProps, ot as JsxKey, r as DeckJsxIntrinsicElements, s as IntrinsicPProps, u as IntrinsicViewTag } from "./index-DOxigSfK.mjs";
|
|
2
|
+
import { a as jsxs, i as jsx, n as JsxComponentProps, o as Fragment, r as JsxDevSource } from "./jsx-runtime-BhY1AeJ9.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/jsx-dev-runtime.d.ts
|
|
5
5
|
type JsxComponent<P, R extends DeckJsxElement> = (props: P) => R;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as IntrinsicDivProps, c as IntrinsicShapeProps, d as JsxNode, l as IntrinsicTextTag, n as DeckJsxElement, o as IntrinsicImgProps, ot as JsxKey, r as DeckJsxIntrinsicElements, s as IntrinsicPProps, u as IntrinsicViewTag } from "./index-
|
|
1
|
+
import { a as IntrinsicDivProps, c as IntrinsicShapeProps, d as JsxNode, l as IntrinsicTextTag, n as DeckJsxElement, o as IntrinsicImgProps, ot as JsxKey, r as DeckJsxIntrinsicElements, s as IntrinsicPProps, u as IntrinsicViewTag } from "./index-DOxigSfK.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/jsx.d.ts
|
|
4
4
|
declare function Fragment(props: {
|
package/dist/jsx-runtime.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ot as JsxKey } from "./index-
|
|
2
|
-
import { a as jsxs, i as jsx, n as JsxComponentProps, o as Fragment, r as JsxDevSource, t as JSX } from "./jsx-runtime-
|
|
1
|
+
import { ot as JsxKey } from "./index-DOxigSfK.mjs";
|
|
2
|
+
import { a as jsxs, i as jsx, n as JsxComponentProps, o as Fragment, r as JsxDevSource, t as JSX } from "./jsx-runtime-BhY1AeJ9.mjs";
|
|
3
3
|
export { Fragment, JSX, JsxComponentProps, JsxDevSource, JsxKey, jsx, jsxs };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as Diagnostics, K as SourceOrigin, L as SemanticNode, M as GraphNodeId, O as AssetEntity,
|
|
1
|
+
import { $ as Diagnostics, K as SourceOrigin, L as SemanticNode, M as GraphNodeId, O as AssetEntity, Wt as CssVisibility, X as Diagnostic, Y as StyleEntityId, bt as BorderStyle, ht as TemplateAreaKind, i as DeckOptions, in as StrokeLineJoin, j as Brand, nn as StrokeDashType, on as StyleDeclarationValue, pn as VerticalAlign, rn as StrokeLineCap, sn as TextFit } from "./index-DOxigSfK.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/assets.d.ts
|
|
4
4
|
type AssetMediaType = string;
|
|
@@ -54,7 +54,7 @@ type ProjectedLayoutClip = {
|
|
|
54
54
|
readonly clipFrame: FrameIR;
|
|
55
55
|
readonly visibleFrame: FrameIR;
|
|
56
56
|
};
|
|
57
|
-
type ProjectedUnsupportedSemanticFeature = "blend" | "background" | "border" | "clipping" | "filter" | "isolation" | "outline" | "opacity" | "shadow" | "stroke" | "transform";
|
|
57
|
+
type ProjectedUnsupportedSemanticFeature = "blend" | "background" | "border" | "clipping" | "filter" | "image" | "isolation" | "layout" | "outline" | "opacity" | "shadow" | "stroke" | "transform";
|
|
58
58
|
type ProjectedUnsupportedFallbackStrategy = "axisAlignedClipWithoutTransformedMask" | "cascadeOpacityToChildren" | "dropBlendMode" | "dropFilterEffect" | "dropIsolationGroup" | "preserveAuthoredValueOnly" | "preserveOpacityWithoutCompositedSubtree" | "preserveTransformWithoutStackingContext" | "sourceRectBeforeTransform";
|
|
59
59
|
type ProjectedUnsupportedFallback = {
|
|
60
60
|
readonly strategy: ProjectedUnsupportedFallbackStrategy;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { closeSync, mkdirSync, openSync, renameSync, statSync, unlinkSync, writeSync } from "node:fs";
|
|
2
|
+
import { mkdir, rename, stat, unlink, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
//#region src/runtime/node-output.ts
|
|
5
|
+
function temporaryOutputPath(output) {
|
|
6
|
+
return join(dirname(output), `.${Date.now()}-${process.pid}-${Math.random().toString(16).slice(2)}.deckjsx.tmp`);
|
|
7
|
+
}
|
|
8
|
+
function temporaryBackupPath(output) {
|
|
9
|
+
return join(dirname(output), `.${Date.now()}-${process.pid}-${Math.random().toString(16).slice(2)}.deckjsx.backup`);
|
|
10
|
+
}
|
|
11
|
+
function isEnoent(error) {
|
|
12
|
+
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
13
|
+
}
|
|
14
|
+
function existingOutputIsFileSync(output) {
|
|
15
|
+
try {
|
|
16
|
+
return statSync(output).isFile();
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if (isEnoent(error)) return false;
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async function existingOutputIsFile(output) {
|
|
23
|
+
try {
|
|
24
|
+
return (await stat(output)).isFile();
|
|
25
|
+
} catch (error) {
|
|
26
|
+
if (isEnoent(error)) return false;
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function replaceOutputSync(tempOutput, output) {
|
|
31
|
+
if (!existingOutputIsFileSync(output)) {
|
|
32
|
+
renameSync(tempOutput, output);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const backupOutput = temporaryBackupPath(output);
|
|
36
|
+
renameSync(output, backupOutput);
|
|
37
|
+
try {
|
|
38
|
+
renameSync(tempOutput, output);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
try {
|
|
41
|
+
renameSync(backupOutput, output);
|
|
42
|
+
} catch (restoreError) {
|
|
43
|
+
throw new AggregateError([error, restoreError], "Failed to replace output and restore the previous output file.");
|
|
44
|
+
}
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
unlinkSync(backupOutput);
|
|
49
|
+
} catch {}
|
|
50
|
+
}
|
|
51
|
+
async function replaceOutput(tempOutput, output) {
|
|
52
|
+
if (!await existingOutputIsFile(output)) {
|
|
53
|
+
await rename(tempOutput, output);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const backupOutput = temporaryBackupPath(output);
|
|
57
|
+
await rename(output, backupOutput);
|
|
58
|
+
try {
|
|
59
|
+
await rename(tempOutput, output);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
try {
|
|
62
|
+
await rename(backupOutput, output);
|
|
63
|
+
} catch (restoreError) {
|
|
64
|
+
throw new AggregateError([error, restoreError], "Failed to replace output and restore the previous output file.");
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
await unlink(backupOutput).catch(() => void 0);
|
|
69
|
+
}
|
|
70
|
+
function createNodeOutputByteSink(input) {
|
|
71
|
+
mkdirSync(dirname(input.output), { recursive: true });
|
|
72
|
+
const tempOutput = temporaryOutputPath(input.output);
|
|
73
|
+
const fd = openSync(tempOutput, "wx");
|
|
74
|
+
let closed = false;
|
|
75
|
+
let failed = false;
|
|
76
|
+
const cleanup = () => {
|
|
77
|
+
try {
|
|
78
|
+
unlinkSync(tempOutput);
|
|
79
|
+
} catch {}
|
|
80
|
+
};
|
|
81
|
+
const closeTemp = () => {
|
|
82
|
+
if (closed) return;
|
|
83
|
+
closed = true;
|
|
84
|
+
closeSync(fd);
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
name: "node-file-output",
|
|
88
|
+
write(chunk) {
|
|
89
|
+
if (closed) throw new Error("Cannot write output bytes after the file sink is closed.");
|
|
90
|
+
try {
|
|
91
|
+
writeSync(fd, chunk, 0, chunk.byteLength);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
failed = true;
|
|
94
|
+
try {
|
|
95
|
+
closeTemp();
|
|
96
|
+
} catch {}
|
|
97
|
+
cleanup();
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
close() {
|
|
102
|
+
if (closed) return;
|
|
103
|
+
try {
|
|
104
|
+
closeTemp();
|
|
105
|
+
} catch (error) {
|
|
106
|
+
failed = true;
|
|
107
|
+
cleanup();
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
if (failed) {
|
|
111
|
+
cleanup();
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
try {
|
|
115
|
+
replaceOutputSync(tempOutput, input.output);
|
|
116
|
+
} catch (error) {
|
|
117
|
+
cleanup();
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
async function writeNodeOutput(input) {
|
|
124
|
+
await mkdir(dirname(input.output), { recursive: true });
|
|
125
|
+
const tempOutput = temporaryOutputPath(input.output);
|
|
126
|
+
try {
|
|
127
|
+
await writeFile(tempOutput, input.artifact.bytes, { flag: "wx" });
|
|
128
|
+
await replaceOutput(tempOutput, input.output);
|
|
129
|
+
} catch (error) {
|
|
130
|
+
await unlink(tempOutput).catch(() => void 0);
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
return { path: input.output };
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
export { createNodeOutputByteSink, writeNodeOutput };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { $ as Diagnostics, M as GraphNodeId, an as
|
|
1
|
+
import { $ as Diagnostics, M as GraphNodeId, an as StyleDeclaration, on as StyleDeclarationValue } from "./index-DOxigSfK.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/style/resolve.d.ts
|
|
4
4
|
type ResolvedStyleDeclaration = StyleDeclaration;
|
|
5
5
|
type ResolvedStyleValue = StyleDeclarationValue;
|
|
6
|
-
type ResolvedStyleLayer = "default" | "theme" | "class" | "style";
|
|
6
|
+
type ResolvedStyleLayer = "default" | "inherited" | "theme" | "class" | "style";
|
|
7
7
|
type ResolvedStyleSource = {
|
|
8
8
|
readonly layer: "default";
|
|
9
|
+
} | {
|
|
10
|
+
readonly layer: "inherited";
|
|
11
|
+
readonly parentId: GraphNodeId;
|
|
9
12
|
} | {
|
|
10
13
|
readonly layer: "theme";
|
|
11
14
|
readonly defaultKey: string;
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { closeSync, mkdirSync, openSync, writeSync } from "node:fs";
|
|
2
|
-
import { mkdir, writeFile } from "node:fs/promises";
|
|
3
|
-
import { dirname } from "node:path";
|
|
4
|
-
//#region src/runtime/node-output.ts
|
|
5
|
-
function createNodeOutputByteSink(input) {
|
|
6
|
-
mkdirSync(dirname(input.output), { recursive: true });
|
|
7
|
-
const fd = openSync(input.output, "w");
|
|
8
|
-
let closed = false;
|
|
9
|
-
return {
|
|
10
|
-
name: "node-file-output",
|
|
11
|
-
write(chunk) {
|
|
12
|
-
if (closed) throw new Error("Cannot write output bytes after the file sink is closed.");
|
|
13
|
-
writeSync(fd, chunk, 0, chunk.byteLength);
|
|
14
|
-
},
|
|
15
|
-
close() {
|
|
16
|
-
if (closed) return;
|
|
17
|
-
closed = true;
|
|
18
|
-
closeSync(fd);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
async function writeNodeOutput(input) {
|
|
23
|
-
await mkdir(dirname(input.output), { recursive: true });
|
|
24
|
-
await writeFile(input.output, input.artifact.bytes);
|
|
25
|
-
return { path: input.output };
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
export { createNodeOutputByteSink, writeNodeOutput };
|