@sushichan044/kg-core 0.9.4 → 0.10.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/README.md +100 -25
- package/dist/index.d.mts +26014 -12830
- package/dist/index.mjs +2 -2
- package/dist/lint.mjs +1 -1
- package/dist/novel-composer-C0EqiM0f.mjs +3352 -0
- package/dist/plugin.d.mts +130 -2
- package/dist/plugin.mjs +29 -3
- package/dist/{novel-composer-DhycV9B3.d.mts → presentation-kind-DCgXI574.d.mts} +6092 -2833
- package/dist/{question-or-exclamation-spacing-B5o23ZLf.mjs → question-or-exclamation-spacing-Bv-mF2ZE.mjs} +10 -3
- package/package.json +5 -5
- package/dist/novel-composer-DRgsEA2s.mjs +0 -2340
|
@@ -189,6 +189,13 @@ function characterClass(characters) {
|
|
|
189
189
|
return characters.replaceAll(/[\\\]^-]/gu, "\\$&");
|
|
190
190
|
}
|
|
191
191
|
//#endregion
|
|
192
|
+
//#region src/internal/japanese-punctuation.ts
|
|
193
|
+
/**
|
|
194
|
+
* JLReq cl-04 occupies a full em, including compound marks whose Unicode East Asian Width is
|
|
195
|
+
* neutral.
|
|
196
|
+
*/
|
|
197
|
+
const DIVIDING_PUNCTUATION = "!?‼⁇⁈⁉";
|
|
198
|
+
//#endregion
|
|
192
199
|
//#region src/internal/japanese-spaces.ts
|
|
193
200
|
const LEADING_SPACES = /^[ \t]+/u;
|
|
194
201
|
/**
|
|
@@ -203,7 +210,7 @@ function leadingSpaces(text) {
|
|
|
203
210
|
/**
|
|
204
211
|
* Runs, not single marks: `!?` is one mark and takes one gap, so the gap belongs after the run.
|
|
205
212
|
*/
|
|
206
|
-
const MARKS =
|
|
213
|
+
const MARKS = new RegExp(`[${characterClass(DIVIDING_PUNCTUATION)}]+`, "gu");
|
|
207
214
|
function analyzeMatch(line, marks) {
|
|
208
215
|
const start = marks.index;
|
|
209
216
|
if (start === void 0) return void 0;
|
|
@@ -240,7 +247,7 @@ function analyzeMatch(line, marks) {
|
|
|
240
247
|
};
|
|
241
248
|
}
|
|
242
249
|
/**
|
|
243
|
-
* Classifies the spacing after each run of
|
|
250
|
+
* Classifies the spacing after each run of Japanese question or exclamation marks in one display
|
|
244
251
|
* line. Runs at the end of the line or immediately before a closing bracket need no gap and are
|
|
245
252
|
* omitted from the result.
|
|
246
253
|
*/
|
|
@@ -248,4 +255,4 @@ function questionOrExclamationSpacings(line) {
|
|
|
248
255
|
return [...line.matchAll(MARKS)].map((marks) => analyzeMatch(line, marks)).filter((spacing) => spacing !== void 0);
|
|
249
256
|
}
|
|
250
257
|
//#endregion
|
|
251
|
-
export {
|
|
258
|
+
export { readonlyObject as _, OPENING_BRACKETS as a, ValidationIssue as c, DiagnosticSeverity as d, NamespacedId as f, readonlyArray as g, nonNegativeInteger as h, CLOSING_BRACKETS as i, ManuscriptResult as l, TextRange as m, leadingSpaces as n, characterClass as o, ManuscriptRange as p, DIVIDING_PUNCTUATION as r, graphemeSegmenter as s, questionOrExclamationSpacings as t, ManuscriptDiagnostic as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sushichan044/kg-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Framework-independent parsing, composition, and proofreading for Japanese manuscripts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"japanese",
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
"registry": "https://registry.npmjs.org/"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"get-east-asian-width": "^1.
|
|
56
|
-
"valibot": "1.
|
|
55
|
+
"get-east-asian-width": "^1.7.0",
|
|
56
|
+
"valibot": "1.5.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@arethetypeswrong/core": "0.18.5",
|
|
60
|
-
"publint": "0.3.
|
|
60
|
+
"publint": "0.3.25",
|
|
61
61
|
"typescript": "7.0.2",
|
|
62
62
|
"unplugin-unused": "0.6.0",
|
|
63
|
-
"vite-plus": "
|
|
63
|
+
"vite-plus": "1.1.0"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">=22.12.0"
|