postext 0.0.1

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.
@@ -0,0 +1,4 @@
1
+ import type { FC } from 'react';
2
+ import type { PostextContent, PostextConfig } from './types';
3
+ export declare function createLayout(_content: PostextContent, _config?: PostextConfig): FC;
4
+ //# sourceMappingURL=createLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createLayout.d.ts","sourceRoot":"","sources":["../src/createLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7D,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,cAAc,EACxB,OAAO,CAAC,EAAE,aAAa,GACtB,EAAE,CAIJ"}
@@ -0,0 +1,6 @@
1
+ export function createLayout(_content, _config) {
2
+ const Layout = () => null;
3
+ Layout.displayName = 'PostextLayout';
4
+ return Layout;
5
+ }
6
+ //# sourceMappingURL=createLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createLayout.js","sourceRoot":"","sources":["../src/createLayout.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,YAAY,CAC1B,QAAwB,EACxB,OAAuB;IAEvB,MAAM,MAAM,GAAO,GAAG,EAAE,CAAC,IAAI,CAAC;IAC9B,MAAM,CAAC,WAAW,GAAG,eAAe,CAAC;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { createLayout } from './createLayout';
2
+ export type { PostextContent, PostextResource, PostextNote, PostextConfig, PostextSectionOverride, ColumnConfig, ResourcePlacementConfig, TypographyConfig, ReferenceConfig, PlacementStrategy, } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { createLayout } from './createLayout';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,81 @@
1
+ export interface PostextResource {
2
+ id: string;
3
+ type: 'image' | 'table' | 'figure' | 'pullQuote';
4
+ src?: string;
5
+ alt?: string;
6
+ caption?: string;
7
+ content?: string;
8
+ width?: number;
9
+ height?: number;
10
+ }
11
+ export interface PostextNote {
12
+ id: string;
13
+ type: 'footnote' | 'endnote' | 'marginNote';
14
+ content: string;
15
+ marker?: string;
16
+ }
17
+ export interface PostextContent {
18
+ markdown: string;
19
+ resources?: PostextResource[];
20
+ notes?: PostextNote[];
21
+ }
22
+ export type PlacementStrategy = 'topOfColumn' | 'inline' | 'floatLeft' | 'floatRight' | 'fullWidthBreak' | 'margin';
23
+ export interface ColumnConfig {
24
+ count?: number;
25
+ gutter?: string;
26
+ columnRule?: {
27
+ width?: string;
28
+ style?: string;
29
+ color?: string;
30
+ };
31
+ balancing?: boolean;
32
+ }
33
+ export interface ResourcePlacementConfig {
34
+ defaultStrategy?: PlacementStrategy;
35
+ deferPlacement?: boolean;
36
+ preserveAspectRatio?: boolean;
37
+ }
38
+ export interface TypographyConfig {
39
+ orphans?: number;
40
+ widows?: number;
41
+ hyphenation?: boolean;
42
+ ragOptimization?: boolean;
43
+ spacing?: {
44
+ beforeHeading?: string;
45
+ afterHeading?: string;
46
+ beforeFigure?: string;
47
+ afterFigure?: string;
48
+ beforeBlockQuote?: string;
49
+ afterBlockQuote?: string;
50
+ };
51
+ keepTogether?: {
52
+ headingWithParagraph?: boolean;
53
+ figureWithCaption?: boolean;
54
+ };
55
+ }
56
+ export interface ReferenceConfig {
57
+ footnotes?: {
58
+ placement?: 'columnBottom' | 'pageBottom' | 'endOfSection';
59
+ marker?: 'number' | 'symbol' | 'custom';
60
+ };
61
+ figureNumbering?: boolean;
62
+ tableNumbering?: boolean;
63
+ marginNotes?: boolean;
64
+ }
65
+ export interface PostextSectionOverride {
66
+ selector: string;
67
+ columns?: ColumnConfig;
68
+ typography?: TypographyConfig;
69
+ resourcePlacement?: ResourcePlacementConfig;
70
+ }
71
+ export interface PostextConfig {
72
+ columns?: number;
73
+ gutter?: string;
74
+ columnConfig?: ColumnConfig;
75
+ resourcePlacement?: ResourcePlacementConfig;
76
+ typography?: TypographyConfig;
77
+ references?: ReferenceConfig;
78
+ sectionOverrides?: PostextSectionOverride[];
79
+ renderer?: 'web' | 'pdf';
80
+ }
81
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,GAAG,SAAS,GAAG,YAAY,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,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B,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE;QACV,SAAS,CAAC,EAAE,cAAc,GAAG,YAAY,GAAG,cAAc,CAAC;QAC3D,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;KACzC,CAAC;IACF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;IAC5C,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,UAAU,CAAC,EAAE,eAAe,CAAC;IAE7B,gBAAgB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAE5C,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CAC1B"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "postext",
3
+ "version": "0.0.1",
4
+ "description": "A programmable typesetter for the web",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/AUsername/postext.git",
10
+ "directory": "packages/postext"
11
+ },
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ }
20
+ },
21
+ "peerDependencies": {
22
+ "react": ">=18"
23
+ },
24
+ "devDependencies": {
25
+ "@types/react": "^19",
26
+ "react": "^19.2.4",
27
+ "typescript": "latest",
28
+ "@postext/typescript-config": "0.0.0"
29
+ },
30
+ "scripts": {
31
+ "build": "tsc",
32
+ "dev": "tsc --watch",
33
+ "check-types": "tsc --noEmit",
34
+ "lint": "eslint ."
35
+ }
36
+ }