@artinstack/migrator 0.1.7 → 0.1.9
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 +2 -1
- package/dist/{bundle-uAAHehbv.d.ts → bundle-B3XS20r_.d.ts} +1 -1
- package/dist/{chunk-BOYB6XRA.js → chunk-BONZ3U3I.js} +11 -62
- package/dist/chunk-BONZ3U3I.js.map +1 -0
- package/dist/chunk-EJTWYEAX.js +1 -0
- package/dist/chunk-EJTWYEAX.js.map +1 -0
- package/dist/{chunk-KF7G7DM6.js → chunk-FB3MMCHY.js} +315 -84
- package/dist/chunk-FB3MMCHY.js.map +1 -0
- package/dist/{chunk-HI7JHWZU.js → chunk-KTQGOM45.js} +1 -1
- package/dist/chunk-KTQGOM45.js.map +1 -0
- package/dist/{chunk-MDSY3FEZ.js → chunk-PPT5RIZ4.js} +83 -39
- package/dist/chunk-PPT5RIZ4.js.map +1 -0
- package/dist/{chunk-XYP3VYDH.js → chunk-S4GMDRGX.js} +149 -6
- package/dist/chunk-S4GMDRGX.js.map +1 -0
- package/dist/{chunk-S4XYG4SM.js → chunk-S4SUJT2D.js} +36 -2
- package/dist/chunk-S4SUJT2D.js.map +1 -0
- package/dist/chunk-XRCF73DA.js +24 -0
- package/dist/chunk-XRCF73DA.js.map +1 -0
- package/dist/cli/index.js +8 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +9 -33
- package/dist/index.js +31 -16
- package/dist/lib/index.d.ts +7 -25
- package/dist/lib/index.js +34 -3
- package/dist/media-urls-u49RCyPn.d.ts +88 -0
- package/dist/normalizer/index.d.ts +4 -4
- package/dist/normalizer/index.js +1 -1
- package/dist/{rewrite-inline-images-Bq16bJA5.d.ts → rewrite-inline-images-BsgSquzV.d.ts} +4 -0
- package/dist/sinks/index.d.ts +21 -5
- package/dist/sinks/index.js +7 -4
- package/dist/transformers/index.d.ts +170 -4
- package/dist/transformers/index.js +5 -4
- package/dist/{types-DWOP8Dcy.d.ts → types-Ce4r6zqt.d.ts} +4 -0
- package/package.json +1 -1
- package/dist/chunk-BOYB6XRA.js.map +0 -1
- package/dist/chunk-HI7JHWZU.js.map +0 -1
- package/dist/chunk-KF7G7DM6.js.map +0 -1
- package/dist/chunk-MDSY3FEZ.js.map +0 -1
- package/dist/chunk-S4XYG4SM.js.map +0 -1
- package/dist/chunk-XYP3VYDH.js.map +0 -1
- package/dist/index-Dp6nqBqe.d.ts +0 -177
package/dist/index-Dp6nqBqe.d.ts
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { l as ValidationResult } from './types-DWOP8Dcy.js';
|
|
3
|
-
import './rewrite-inline-images-Bq16bJA5.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Map normalized upload URLs (and pathnames) → normalizer `sourceId`.
|
|
7
|
-
* Attachment ids are WXR `post_id` strings; inline discoveries use `url:{src}`.
|
|
8
|
-
*/
|
|
9
|
-
declare function buildMigrationMediaUrlIndex(entries: Iterable<{
|
|
10
|
-
sourceUrl: string;
|
|
11
|
-
sourceId: string;
|
|
12
|
-
}>): Map<string, string>;
|
|
13
|
-
declare function resolveMigrationMediaSourceId(src: string, urlIndex: Map<string, string>): string | undefined;
|
|
14
|
-
|
|
15
|
-
type LayoutKind = "section" | "row" | "column";
|
|
16
|
-
/** Map OSS-2 `data-layout` markers to Grapes component types (host may override). */
|
|
17
|
-
interface LayoutTypeMap {
|
|
18
|
-
section?: string;
|
|
19
|
-
row?: string;
|
|
20
|
-
column?: string;
|
|
21
|
-
}
|
|
22
|
-
interface HtmlToGrapesOptions {
|
|
23
|
-
/** Map source class names to Grapes component types. */
|
|
24
|
-
componentMap?: Record<string, string>;
|
|
25
|
-
/** Map HTML tag names to Grapes component types (e.g. `h2` → `heading`). */
|
|
26
|
-
tagMap?: Record<string, string>;
|
|
27
|
-
/** Map `data-layout` section/row/column markers to Grapes component types. */
|
|
28
|
-
layoutTypeMap?: LayoutTypeMap;
|
|
29
|
-
}
|
|
30
|
-
interface GrapesStyleRule {
|
|
31
|
-
selectors: string[];
|
|
32
|
-
style: Record<string, string>;
|
|
33
|
-
}
|
|
34
|
-
interface GrapesComponent {
|
|
35
|
-
type: string;
|
|
36
|
-
tagName?: string;
|
|
37
|
-
attributes?: Record<string, string>;
|
|
38
|
-
classes?: string[];
|
|
39
|
-
components?: GrapesComponent[];
|
|
40
|
-
content?: string;
|
|
41
|
-
void?: boolean;
|
|
42
|
-
}
|
|
43
|
-
interface GrapesProjectSnapshot {
|
|
44
|
-
content: GrapesComponent[];
|
|
45
|
-
styles: GrapesStyleRule[];
|
|
46
|
-
contentHtml?: string;
|
|
47
|
-
contentCss?: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** Cheerio HTML walk → Grapes `content` + root `styles`. */
|
|
51
|
-
declare function htmlToGrapes(html: string, options?: HtmlToGrapesOptions): GrapesProjectSnapshot;
|
|
52
|
-
|
|
53
|
-
/** ProseMirror / Tiptap mark (inline formatting). */
|
|
54
|
-
interface TiptapMark {
|
|
55
|
-
type: string;
|
|
56
|
-
attrs?: Record<string, string>;
|
|
57
|
-
}
|
|
58
|
-
/** ProseMirror / Tiptap node — text nodes use `text`; others use `content`. */
|
|
59
|
-
interface TiptapNode {
|
|
60
|
-
type: string;
|
|
61
|
-
attrs?: Record<string, unknown>;
|
|
62
|
-
content?: TiptapNode[];
|
|
63
|
-
marks?: TiptapMark[];
|
|
64
|
-
text?: string;
|
|
65
|
-
}
|
|
66
|
-
/** Root Tiptap document (`content_json` shape). */
|
|
67
|
-
interface TiptapDoc {
|
|
68
|
-
type: "doc";
|
|
69
|
-
content: TiptapNode[];
|
|
70
|
-
}
|
|
71
|
-
interface HtmlToTiptapOptions {
|
|
72
|
-
/**
|
|
73
|
-
* Unwrap OSS-2 `data-layout` scaffolding (section/row/column divs) into prose blocks.
|
|
74
|
-
* @default true
|
|
75
|
-
*/
|
|
76
|
-
unwrapLayoutMarkers?: boolean;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/** Cheerio HTML walk → Tiptap / ProseMirror `doc` JSON for blog `content_json`. */
|
|
80
|
-
declare function htmlToTiptap(html: string, options?: HtmlToTiptapOptions): TiptapDoc;
|
|
81
|
-
|
|
82
|
-
/** Parse `<style>` blocks and class rules into Grapes root `styles[]`. */
|
|
83
|
-
declare function cssToStyles(css: string): GrapesStyleRule[];
|
|
84
|
-
|
|
85
|
-
declare const grapesStyleRuleSchema: z.ZodObject<{
|
|
86
|
-
selectors: z.ZodArray<z.ZodString, "many">;
|
|
87
|
-
style: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
88
|
-
}, "strip", z.ZodTypeAny, {
|
|
89
|
-
style: Record<string, string>;
|
|
90
|
-
selectors: string[];
|
|
91
|
-
}, {
|
|
92
|
-
style: Record<string, string>;
|
|
93
|
-
selectors: string[];
|
|
94
|
-
}>;
|
|
95
|
-
declare const grapesComponentSchema: z.ZodType<GrapesComponent>;
|
|
96
|
-
declare const grapesProjectSnapshotSchema: z.ZodObject<{
|
|
97
|
-
content: z.ZodArray<z.ZodType<GrapesComponent, z.ZodTypeDef, GrapesComponent>, "many">;
|
|
98
|
-
styles: z.ZodArray<z.ZodObject<{
|
|
99
|
-
selectors: z.ZodArray<z.ZodString, "many">;
|
|
100
|
-
style: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
101
|
-
}, "strip", z.ZodTypeAny, {
|
|
102
|
-
style: Record<string, string>;
|
|
103
|
-
selectors: string[];
|
|
104
|
-
}, {
|
|
105
|
-
style: Record<string, string>;
|
|
106
|
-
selectors: string[];
|
|
107
|
-
}>, "many">;
|
|
108
|
-
contentHtml: z.ZodOptional<z.ZodString>;
|
|
109
|
-
contentCss: z.ZodOptional<z.ZodString>;
|
|
110
|
-
}, "strip", z.ZodTypeAny, {
|
|
111
|
-
content: GrapesComponent[];
|
|
112
|
-
styles: {
|
|
113
|
-
style: Record<string, string>;
|
|
114
|
-
selectors: string[];
|
|
115
|
-
}[];
|
|
116
|
-
contentHtml?: string | undefined;
|
|
117
|
-
contentCss?: string | undefined;
|
|
118
|
-
}, {
|
|
119
|
-
content: GrapesComponent[];
|
|
120
|
-
styles: {
|
|
121
|
-
style: Record<string, string>;
|
|
122
|
-
selectors: string[];
|
|
123
|
-
}[];
|
|
124
|
-
contentHtml?: string | undefined;
|
|
125
|
-
contentCss?: string | undefined;
|
|
126
|
-
}>;
|
|
127
|
-
interface ValidateGrapesProjectSnapshotOptions {
|
|
128
|
-
/** When set, every component `type` in the tree must be in this allowlist. */
|
|
129
|
-
allowedComponentTypes?: string[];
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Opt-in structural check for a Grapes project snapshot (not a full Grapes editor project file).
|
|
133
|
-
* Does not validate host-specific component registries unless `allowedComponentTypes` is passed.
|
|
134
|
-
*/
|
|
135
|
-
declare function validateGrapesProjectSnapshot(snapshot: unknown, options?: ValidateGrapesProjectSnapshotOptions): ValidationResult;
|
|
136
|
-
|
|
137
|
-
declare const tiptapMarkSchema: z.ZodObject<{
|
|
138
|
-
type: z.ZodString;
|
|
139
|
-
attrs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
140
|
-
}, "strip", z.ZodTypeAny, {
|
|
141
|
-
type: string;
|
|
142
|
-
attrs?: Record<string, string> | undefined;
|
|
143
|
-
}, {
|
|
144
|
-
type: string;
|
|
145
|
-
attrs?: Record<string, string> | undefined;
|
|
146
|
-
}>;
|
|
147
|
-
declare const tiptapNodeSchema: z.ZodType<TiptapNode>;
|
|
148
|
-
declare const tiptapDocSchema: z.ZodObject<{
|
|
149
|
-
type: z.ZodLiteral<"doc">;
|
|
150
|
-
content: z.ZodArray<z.ZodType<TiptapNode, z.ZodTypeDef, TiptapNode>, "many">;
|
|
151
|
-
}, "strip", z.ZodTypeAny, {
|
|
152
|
-
type: "doc";
|
|
153
|
-
content: TiptapNode[];
|
|
154
|
-
}, {
|
|
155
|
-
type: "doc";
|
|
156
|
-
content: TiptapNode[];
|
|
157
|
-
}>;
|
|
158
|
-
interface ValidateTiptapDocOptions {
|
|
159
|
-
/** When set, every node `type` in the tree must be in this allowlist. */
|
|
160
|
-
allowedNodeTypes?: string[];
|
|
161
|
-
/** When set, every mark `type` must be in this allowlist. */
|
|
162
|
-
allowedMarkTypes?: string[];
|
|
163
|
-
}
|
|
164
|
-
/** Opt-in structural check for a Tiptap / ProseMirror document. */
|
|
165
|
-
declare function validateTiptapDoc(doc: unknown, options?: ValidateTiptapDocOptions): ValidationResult;
|
|
166
|
-
|
|
167
|
-
interface ExpandMigrationMediaRefsResult {
|
|
168
|
-
html: string;
|
|
169
|
-
unresolved: string[];
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Expand OSS-14 `artinstack-migration://asset/…` refs to host CDN URLs.
|
|
173
|
-
* Lookup (`migration_entities` → `publicUrl`) is host-supplied via `resolvePublicUrl`.
|
|
174
|
-
*/
|
|
175
|
-
declare function expandMigrationMediaRefs(html: string, resolvePublicUrl: (sourceId: string) => string | undefined): ExpandMigrationMediaRefsResult;
|
|
176
|
-
|
|
177
|
-
export { type ExpandMigrationMediaRefsResult as E, type GrapesComponent as G, type HtmlToGrapesOptions as H, type LayoutKind as L, type TiptapDoc as T, type ValidateGrapesProjectSnapshotOptions as V, type GrapesProjectSnapshot as a, type GrapesStyleRule as b, type HtmlToTiptapOptions as c, type LayoutTypeMap as d, type TiptapMark as e, type TiptapNode as f, type ValidateTiptapDocOptions as g, buildMigrationMediaUrlIndex as h, cssToStyles as i, expandMigrationMediaRefs as j, grapesComponentSchema as k, grapesProjectSnapshotSchema as l, grapesStyleRuleSchema as m, htmlToGrapes as n, htmlToTiptap as o, tiptapMarkSchema as p, tiptapNodeSchema as q, resolveMigrationMediaSourceId as r, validateTiptapDoc as s, tiptapDocSchema as t, validateGrapesProjectSnapshot as v };
|