@aicayzer/inkkit 0.0.0-stage → 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,59 @@
1
+ export type DocumentFormat = 'md' | 'txt';
2
+ export interface DocumentContext {
3
+ documentId: string;
4
+ generation: number;
5
+ operationId: string;
6
+ }
7
+ export interface DocumentInput {
8
+ documentId: string;
9
+ generation: number;
10
+ format: DocumentFormat;
11
+ text: string;
12
+ }
13
+ export interface DocumentSnapshot extends DocumentInput {
14
+ revision: number;
15
+ dirty: boolean;
16
+ }
17
+ export type EditorErrorCode = 'not-ready' | 'stale-document' | 'composition' | 'operation-pending' | 'destroyed' | 'preservation' | 'image-unavailable';
18
+ export declare class InkKitError extends Error {
19
+ readonly code: EditorErrorCode;
20
+ constructor(code: EditorErrorCode, message: string);
21
+ }
22
+ export interface CapturedImage {
23
+ bytes: Uint8Array;
24
+ mimeType: string;
25
+ filename?: string;
26
+ source?: string;
27
+ }
28
+ export interface PortableImage {
29
+ bytes: Uint8Array;
30
+ mimeType: string;
31
+ filename?: string;
32
+ }
33
+ export interface ImageAdapter {
34
+ presentation(reference: string): {
35
+ url: string;
36
+ } | undefined;
37
+ importImage(input: CapturedImage, context: DocumentContext): Promise<{
38
+ reference: string;
39
+ }>;
40
+ exportImage(reference: string, context: DocumentContext): Promise<PortableImage>;
41
+ }
42
+ export interface ClipboardInput {
43
+ text: string;
44
+ html?: string;
45
+ images?: CapturedImage[];
46
+ plainText?: boolean;
47
+ }
48
+ export interface ClipboardImage {
49
+ reference: string;
50
+ alt: string;
51
+ image?: PortableImage;
52
+ error?: string;
53
+ }
54
+ export interface ClipboardOutput {
55
+ text: string;
56
+ html: string;
57
+ markdown: string;
58
+ images: ClipboardImage[];
59
+ }
package/dist/types.js ADDED
@@ -0,0 +1,8 @@
1
+ export class InkKitError extends Error {
2
+ code;
3
+ constructor(code, message) {
4
+ super(message);
5
+ this.code = code;
6
+ this.name = 'InkKitError';
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,6 +1,73 @@
1
1
  {
2
2
  "name": "@aicayzer/inkkit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.1",
4
+ "description": "A preserving Markdown editor for offline web views and the web",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/aicayzer/inkkit.git"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ },
16
+ "./style.css": "./dist/style.css"
17
+ },
18
+ "types": "./dist/index.d.ts",
19
+ "files": [
20
+ "dist",
21
+ "LICENSE",
22
+ "NOTICE",
23
+ "README.md"
24
+ ],
25
+ "sideEffects": [
26
+ "**/*.css"
27
+ ],
28
+ "publishConfig": {
29
+ "access": "public",
30
+ "registry": "https://registry.npmjs.org/"
31
+ },
32
+ "packageManager": "pnpm@11.0.9",
33
+ "engines": {
34
+ "node": ">=22.14"
35
+ },
36
+ "scripts": {
37
+ "build": "node scripts/clean-build.mjs && tsc -p tsconfig.build.json && node scripts/copy-style.mjs",
38
+ "typecheck": "tsc --noEmit",
39
+ "test": "vitest run",
40
+ "format": "prettier --write .",
41
+ "format:check": "prettier --check .",
42
+ "dev": "vite playground",
43
+ "build:playground": "vite build playground --config vite.config.ts",
44
+ "test:package": "node scripts/test-package.mjs",
45
+ "check": "pnpm typecheck && pnpm test && pnpm build && pnpm test:package"
46
+ },
47
+ "dependencies": {
48
+ "@milkdown/kit": "7.22.1",
49
+ "lowlight": "^3.3.0",
50
+ "mdast-util-gfm-autolink-literal": "^2.0.1",
51
+ "mdast-util-gfm-strikethrough": "^2.0.0",
52
+ "mdast-util-gfm-task-list-item": "^2.0.0",
53
+ "mdast-util-gfm-table": "^2.0.0",
54
+ "mdast-util-to-markdown": "2.2.0",
55
+ "micromark-extension-gfm-autolink-literal": "^2.1.0",
56
+ "micromark-extension-gfm-strikethrough": "^2.1.0",
57
+ "micromark-extension-gfm-task-list-item": "^2.1.0",
58
+ "micromark-extension-gfm-table": "^2.1.1",
59
+ "prosemirror-search": "^1.1.1"
60
+ },
61
+ "devDependencies": {
62
+ "@types/mdast": "^4.0.4",
63
+ "@types/hast": "^3.0.5",
64
+ "@types/node": "^26.6.2",
65
+ "jsdom": "^30.1.0",
66
+ "prettier": "^3.9.8",
67
+ "typescript": "^7.0.2",
68
+ "unified": "^11.0.5",
69
+ "vite": "^8.3.0",
70
+ "vite-plugin-singlefile": "^2.3.3",
71
+ "vitest": "^5.0.1"
72
+ }
73
+ }