@kungal/editor-core 0.2.0
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/CHANGELOG.md +54 -0
- package/LICENSE +661 -0
- package/README.md +100 -0
- package/dist/chunk-KY2VN6IQ.js +8 -0
- package/dist/chunk-KY2VN6IQ.js.map +1 -0
- package/dist/index.cjs +12 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/preset/index.cjs +1062 -0
- package/dist/preset/index.cjs.map +1 -0
- package/dist/preset/index.d.cts +185 -0
- package/dist/preset/index.d.ts +185 -0
- package/dist/preset/index.js +1006 -0
- package/dist/preset/index.js.map +1 -0
- package/dist/types-B_iVOftJ.d.cts +87 -0
- package/dist/types-B_iVOftJ.d.ts +87 -0
- package/package.json +114 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @kungal/editor-core
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6e1f780: P2 — port the adapter-driven Milkdown plugins into `editor-core/preset`.
|
|
8
|
+
|
|
9
|
+
- `createUploadPlugin(uploadImage, { locale, notify })` — paste / drop / toolbar
|
|
10
|
+
image upload built on `@milkdown/kit/plugin/upload`. The forum's hardcoded
|
|
11
|
+
`kunFetch('/image/topic')` becomes the injected `uploadImage` adapter; a failed
|
|
12
|
+
image is skipped (and reported via `notify`) instead of aborting the batch.
|
|
13
|
+
- `createMentionPlugin()` — the `[@name](kungal-user:id)` mention atom + `$remark`
|
|
14
|
+
round-trip. The schema is pure; the `@` autocomplete dropdown that consumes
|
|
15
|
+
`searchMentionUsers` is a render-layer view (P3).
|
|
16
|
+
- `createQuotePlugin()` — an inline reference atom, generalized per the
|
|
17
|
+
architecture decision (option 1): the forum's `{ replyId, floor }` becomes an
|
|
18
|
+
opaque `{ refId, label }` the host supplies via `insertQuoteCommand`. Markdown
|
|
19
|
+
form `[label](kungal-reply:<refId>)`.
|
|
20
|
+
|
|
21
|
+
`createKunEditorPlugins` now gates upload on the `uploadImage` adapter, wires the
|
|
22
|
+
mention schema by default, and treats quote as opt-in (`features.quote`). Adds
|
|
23
|
+
`QUOTE_SCHEME` to the light main entry (shared with the server, like
|
|
24
|
+
`MENTION_SCHEME`) and a `quote` flag to `KunEditorFeatures`.
|
|
25
|
+
|
|
26
|
+
Stickers need no core plugin — a sticker is a plain image node, so its picker is
|
|
27
|
+
a P3 view over the `stickerSource` adapter.
|
|
28
|
+
|
|
29
|
+
Covered by headless vitest: mention/quote markdown round-trips, the uploader
|
|
30
|
+
(image filter + notify-on-failure), and preset feature gating.
|
|
31
|
+
|
|
32
|
+
## 0.1.0
|
|
33
|
+
|
|
34
|
+
### Minor Changes
|
|
35
|
+
|
|
36
|
+
- 0386d6d: P1 — port the pure Milkdown plugins into `editor-core`.
|
|
37
|
+
|
|
38
|
+
Adds `@kungal/editor-core/preset` with `createKunEditorPlugins(adapters,
|
|
39
|
+
features, options)` — the composed Milkdown bundle (commonmark/gfm baseline +
|
|
40
|
+
KunEditor plugins) — and the individual plugin factories:
|
|
41
|
+
|
|
42
|
+
- `createSpoilerPlugin()` — `||hidden||` inline node with `$remark` round-trip
|
|
43
|
+
- `createKatexPlugins()` — inline `$…$` and block `$$…$$` LaTeX (KaTeX)
|
|
44
|
+
- `createCodeBlockPlugins(opts)` — CodeMirror code block (theme, languages,
|
|
45
|
+
localized toolbar, `latex` preview)
|
|
46
|
+
- `createStopLinkPlugin()` — Space clears the active link mark
|
|
47
|
+
|
|
48
|
+
The main entry (`@kungal/editor-core`) stays light — types + `MENTION_SCHEME`,
|
|
49
|
+
no runtime deps — so the server can import the scheme without the Milkdown /
|
|
50
|
+
katex / codemirror peers. The heavier `@codemirror/*`, `@lezer/highlight` and
|
|
51
|
+
`katex` peers are only needed when importing `/preset`.
|
|
52
|
+
|
|
53
|
+
Covered by a headless vitest suite that round-trips markdown for spoiler,
|
|
54
|
+
inline/block math and the full preset.
|