@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.
- package/LICENSE +21 -0
- package/NOTICE +6 -0
- package/README.md +39 -2
- package/dist/autolink.d.ts +1 -0
- package/dist/autolink.js +18 -0
- package/dist/clipboard.d.ts +11 -0
- package/dist/clipboard.js +140 -0
- package/dist/decorations.d.ts +2 -0
- package/dist/decorations.js +66 -0
- package/dist/dialect.d.ts +9 -0
- package/dist/dialect.js +290 -0
- package/dist/editor.d.ts +106 -0
- package/dist/editor.js +974 -0
- package/dist/highlight.d.ts +1 -0
- package/dist/highlight.js +49 -0
- package/dist/images.d.ts +32 -0
- package/dist/images.js +129 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2 -0
- package/dist/literals.d.ts +13 -0
- package/dist/literals.js +127 -0
- package/dist/paste.d.ts +23 -0
- package/dist/paste.js +362 -0
- package/dist/preserve.d.ts +16 -0
- package/dist/preserve.js +177 -0
- package/dist/selection.d.ts +1 -0
- package/dist/selection.js +47 -0
- package/dist/style.css +537 -0
- package/dist/tables.d.ts +7 -0
- package/dist/tables.js +80 -0
- package/dist/tasks.d.ts +3 -0
- package/dist/tasks.js +49 -0
- package/dist/types.d.ts +59 -0
- package/dist/types.js +8 -0
- package/package.json +71 -4
package/dist/types.d.ts
ADDED
|
@@ -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
package/package.json
CHANGED
|
@@ -1,6 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aicayzer/inkkit",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
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
|
+
}
|