@sushichan044/kg-core 0.10.0 → 0.10.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/dist/index.d.mts +367 -367
- package/dist/index.mjs +2 -2
- package/dist/lint.mjs +1 -1
- package/dist/{novel-composer-C0EqiM0f.mjs → novel-composer-D_orH6ET.mjs} +57 -16
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.mjs +2 -2
- package/dist/{presentation-kind-DCgXI574.d.mts → presentation-kind-BwIZFSZS.d.mts} +102 -102
- package/dist/{question-or-exclamation-spacing-Bv-mF2ZE.mjs → question-or-exclamation-spacing-Cp3eOGlA.mjs} +5 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as PaperSize, d as ManuscriptOffsets, f as ManuscriptAppearanceSettings, g as ParsedManuscript, h as FontPresetId, i as ManuscriptGeometry, l as NovelCompositionSettings, m as FontSizePt, n as novelComposer, p as PaperSizeId, u as NovelFlowSettings } from "./novel-composer-
|
|
1
|
+
import { c as graphemeSegmenter, d as ManuscriptDiagnostic, l as ValidationIssue, m as ManuscriptRange, p as NamespacedId, u as ManuscriptResult, v as readonlyObject } from "./question-or-exclamation-spacing-Cp3eOGlA.mjs";
|
|
2
|
+
import { a as PaperSize, d as ManuscriptOffsets, f as ManuscriptAppearanceSettings, g as ParsedManuscript, h as FontPresetId, i as ManuscriptGeometry, l as NovelCompositionSettings, m as FontSizePt, n as novelComposer, p as PaperSizeId, u as NovelFlowSettings } from "./novel-composer-D_orH6ET.mjs";
|
|
3
3
|
import { n as assertNever, t as describeCause } from "./describe-cause-BV8mZ3Um.mjs";
|
|
4
4
|
import * as v from "valibot";
|
|
5
5
|
const Rejection = { schema: readonlyObject({ reason: v.string() }) };
|
package/dist/lint.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as readonlyArray, a as CLOSING_BRACKETS, c as graphemeSegmenter, d as ManuscriptDiagnostic, f as DiagnosticSeverity, l as ValidationIssue, m as ManuscriptRange, n as leadingSpaces, o as OPENING_BRACKETS, p as NamespacedId, s as characterClass, t as questionOrExclamationSpacings, u as ManuscriptResult, v as readonlyObject } from "./question-or-exclamation-spacing-Cp3eOGlA.mjs";
|
|
2
2
|
import { n as assertNever, t as describeCause } from "./describe-cause-BV8mZ3Um.mjs";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
//#region src/proofreading/invalid-rule-options.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as readonlyArray, a as CLOSING_BRACKETS, c as graphemeSegmenter, g as nonNegativeInteger, h as TextRange, i as TATE_CHU_YOKO_MARKS, m as ManuscriptRange, o as OPENING_BRACKETS, p as NamespacedId, r as DIVIDING_PUNCTUATION, s as characterClass, t as questionOrExclamationSpacings, u as ManuscriptResult, v as readonlyObject } from "./question-or-exclamation-spacing-Cp3eOGlA.mjs";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
import { eastAsianWidth } from "get-east-asian-width";
|
|
4
4
|
const BoldAnnotation = { schema: readonlyObject({
|
|
@@ -363,26 +363,46 @@ const BoundaryRule = { resolve: (left, right, profile, context) => {
|
|
|
363
363
|
const ASCII_ALPHANUMERIC = /^[A-Za-z0-9]$/u;
|
|
364
364
|
const ASCII_TWO_DIGITS = /^[0-9]{2}$/u;
|
|
365
365
|
const UPRIGHT_LATIN_ABBREVIATION = /^(?:[A-Z]+|[A-Z][a-z]{1,2})$/u;
|
|
366
|
+
const TATE_CHU_YOKO_MARK = new RegExp(`^[${characterClass(TATE_CHU_YOKO_MARKS)}]$`, "u");
|
|
366
367
|
const FULLWIDTH_ALPHANUMERIC = /^[A-Za-z0-9]$/u;
|
|
368
|
+
function stretchEnd(graphemes, start, pattern) {
|
|
369
|
+
let end = start + 1;
|
|
370
|
+
while (pattern.test(graphemes[end]?.value ?? "")) end += 1;
|
|
371
|
+
return end;
|
|
372
|
+
}
|
|
373
|
+
function presentationOf(text) {
|
|
374
|
+
if (ASCII_ALPHANUMERIC.test(text[0] ?? "")) {
|
|
375
|
+
if (ASCII_TWO_DIGITS.test(text)) return "tate-chu-yoko";
|
|
376
|
+
return text.length === 1 || UPRIGHT_LATIN_ABBREVIATION.test(text) ? "upright" : "sideways";
|
|
377
|
+
}
|
|
378
|
+
return FULLWIDTH_ALPHANUMERIC.test(text) ? "upright" : "mixed";
|
|
379
|
+
}
|
|
367
380
|
function recognize(graphemes) {
|
|
368
381
|
const runs = [];
|
|
369
|
-
|
|
370
|
-
while (cursor < graphemes.length) {
|
|
371
|
-
const first = graphemes[cursor];
|
|
372
|
-
if (first === void 0) break;
|
|
373
|
-
const start = cursor;
|
|
374
|
-
cursor += 1;
|
|
375
|
-
const ascii = ASCII_ALPHANUMERIC.test(first.value);
|
|
376
|
-
if (ascii) while (ASCII_ALPHANUMERIC.test(graphemes[cursor]?.value ?? "")) cursor += 1;
|
|
377
|
-
const members = graphemes.slice(start, cursor);
|
|
378
|
-
const text = members.map(({ value }) => value).join("");
|
|
379
|
-
const presentation = ascii ? ASCII_TWO_DIGITS.test(text) ? "tate-chu-yoko" : text.length === 1 || UPRIGHT_LATIN_ABBREVIATION.test(text) ? "upright" : "sideways" : FULLWIDTH_ALPHANUMERIC.test(first.value) ? "upright" : "mixed";
|
|
382
|
+
const push = (members, presentation) => {
|
|
380
383
|
const range = ManuscriptRange.merge(members.map((member) => member.range));
|
|
381
384
|
if (range !== null) runs.push({
|
|
382
385
|
range,
|
|
383
386
|
presentation,
|
|
384
387
|
members
|
|
385
388
|
});
|
|
389
|
+
};
|
|
390
|
+
let cursor = 0;
|
|
391
|
+
while (cursor < graphemes.length) {
|
|
392
|
+
const first = graphemes[cursor];
|
|
393
|
+
if (first === void 0) break;
|
|
394
|
+
if (TATE_CHU_YOKO_MARK.test(first.value)) {
|
|
395
|
+
const end = stretchEnd(graphemes, cursor, TATE_CHU_YOKO_MARK);
|
|
396
|
+
const members = graphemes.slice(cursor, end);
|
|
397
|
+
if (members.length === 2 || members.length === 3) push(members, "tate-chu-yoko");
|
|
398
|
+
else for (const member of members) push([member], "mixed");
|
|
399
|
+
cursor = end;
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
402
|
+
const end = ASCII_ALPHANUMERIC.test(first.value) ? stretchEnd(graphemes, cursor, ASCII_ALPHANUMERIC) : cursor + 1;
|
|
403
|
+
const members = graphemes.slice(cursor, end);
|
|
404
|
+
push(members, presentationOf(members.map(({ value }) => value).join("")));
|
|
405
|
+
cursor = end;
|
|
386
406
|
}
|
|
387
407
|
return runs;
|
|
388
408
|
}
|
|
@@ -914,6 +934,7 @@ const OPENING = /* @__PURE__ */ new Set(`${OPENING_BRACKETS}【〘〝⦅«`);
|
|
|
914
934
|
const CLOSING = /* @__PURE__ */ new Set(`${CLOSING_BRACKETS}】〙〟⦆»`);
|
|
915
935
|
const HYPHENS = /* @__PURE__ */ new Set("‐‑⁃–");
|
|
916
936
|
const DIVIDING_MARKS = new Set(DIVIDING_PUNCTUATION);
|
|
937
|
+
const COMBINED_DIVIDING_MARKS = new Set(TATE_CHU_YOKO_MARKS);
|
|
917
938
|
const MIDDLE_DOTS = /* @__PURE__ */ new Set("・:;");
|
|
918
939
|
const SMALL_KANA = /* @__PURE__ */ new Set("ァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖ");
|
|
919
940
|
const ITERATION_MARKS = /* @__PURE__ */ new Set("ヽヾゝゞ々〻");
|
|
@@ -928,7 +949,8 @@ const WESTERN = /^[\p{Script=Latin}\p{Script=Greek}\p{Script=Cyrillic}]$/u;
|
|
|
928
949
|
/**
|
|
929
950
|
* Order matters: a character inside a tate-chu-yoko group is cl-30 (3.2.5) and an upright Latin
|
|
930
951
|
* letter or Arabic numeral is cl-19 (3.2.4), whatever either would be on its own; anything left
|
|
931
|
-
* unmatched is cl-19 too, the class JLReq reserves for kanji and the like.
|
|
952
|
+
* unmatched is cl-19 too, the class JLReq reserves for kanji and the like. A tate-chu-yoko `!?`
|
|
953
|
+
* stays cl-04, the class JLReq gives `⁉`, so it still may not open a line.
|
|
932
954
|
*
|
|
933
955
|
* The quarter em 3.2.6 sets between Japanese and a Western character or numeral applies only to a
|
|
934
956
|
* character rotated 90 degrees in vertical writing mode or mixed into horizontal writing mode —
|
|
@@ -937,7 +959,7 @@ const WESTERN = /^[\p{Script=Latin}\p{Script=Greek}\p{Script=Cyrillic}]$/u;
|
|
|
937
959
|
* the same as a tate-chu-yoko run's 3.2.5.
|
|
938
960
|
*/
|
|
939
961
|
function classify({ value, presentation }) {
|
|
940
|
-
if (presentation === "tate-chu-yoko") return "cl-30";
|
|
962
|
+
if (presentation === "tate-chu-yoko") return COMBINED_DIVIDING_MARKS.has(value) ? "cl-04" : "cl-30";
|
|
941
963
|
if (presentation === "upright") return "cl-19";
|
|
942
964
|
if (OPENING.has(value)) return "cl-01";
|
|
943
965
|
if (CLOSING.has(value)) return "cl-02";
|
|
@@ -1727,9 +1749,28 @@ const MeasurementSession = { create: (provider, settings) => {
|
|
|
1727
1749
|
renderSpan: cluster.renderSpan,
|
|
1728
1750
|
value: text.slice(cluster.textRange.start, cluster.textRange.end)
|
|
1729
1751
|
}));
|
|
1752
|
+
const segments = [...graphemeSegmenter.segment(text)];
|
|
1753
|
+
if (kind === "base" && presentation === "tate-chu-yoko") {
|
|
1754
|
+
const advanceEm = full.advanceEm / segments.length;
|
|
1755
|
+
return segments.map(({ segment, index }, position) => {
|
|
1756
|
+
const span = {
|
|
1757
|
+
offsetEm: position * advanceEm,
|
|
1758
|
+
advanceEm
|
|
1759
|
+
};
|
|
1760
|
+
return {
|
|
1761
|
+
value: segment,
|
|
1762
|
+
textRange: MeasurementTextRange.of({
|
|
1763
|
+
start: index,
|
|
1764
|
+
end: index + segment.length
|
|
1765
|
+
}),
|
|
1766
|
+
layoutSpan: span,
|
|
1767
|
+
renderSpan: span
|
|
1768
|
+
};
|
|
1769
|
+
});
|
|
1770
|
+
}
|
|
1730
1771
|
const pieces = [];
|
|
1731
1772
|
let offsetEm = 0;
|
|
1732
|
-
for (const { segment, index } of
|
|
1773
|
+
for (const { segment, index } of segments) {
|
|
1733
1774
|
const measured = get(segment, kind, presentation);
|
|
1734
1775
|
if (measured === void 0) return void 0;
|
|
1735
1776
|
const cluster = measured.kind === "clustered" ? measured.clusters[0] : void 0;
|
|
@@ -2772,7 +2813,7 @@ const logicalRunMeasurer = (request) => {
|
|
|
2772
2813
|
const segments = [...graphemeSegmenter.segment(request.text)];
|
|
2773
2814
|
return {
|
|
2774
2815
|
kind: "advance",
|
|
2775
|
-
advanceEm: (request.kind === "base" && request.presentation === "upright" ? segments.length : segments.reduce((total, { segment }) => total + graphemeWidth(segment), 0)) * request.scale
|
|
2816
|
+
advanceEm: (request.kind === "base" && request.presentation === "upright" ? segments.length : request.kind === "base" && request.presentation === "tate-chu-yoko" ? 1 : segments.reduce((total, { segment }) => total + graphemeWidth(segment), 0)) * request.scale
|
|
2776
2817
|
};
|
|
2777
2818
|
};
|
|
2778
2819
|
//#endregion
|
package/dist/plugin.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as ManuscriptResult, i as ParsedManuscript, n as ValidationIssue, r as NamespacedId } from "./composed-manuscript-C0f3mxKs.mjs";
|
|
2
|
-
import { a as RunMeasurer, c as MeasurementRequest, d as ManuscriptComposer, f as ManuscriptParser, o as logicalRunMeasurer, p as Rejection, r as createNovelComposer, s as RunMeasurement, t as PresentationKind } from "./presentation-kind-
|
|
2
|
+
import { a as RunMeasurer, c as MeasurementRequest, d as ManuscriptComposer, f as ManuscriptParser, o as logicalRunMeasurer, p as Rejection, r as createNovelComposer, s as RunMeasurement, t as PresentationKind } from "./presentation-kind-BwIZFSZS.mjs";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
//#region src/composer/measurement-text-range.d.ts
|
|
5
5
|
declare const MeasurementTextRangeSchema: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
package/dist/plugin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as MeasurementTextRange, g as ParsedManuscript, h as FontPresetId, m as FontSizePt, o as RunMeasurement, r as logicalRunMeasurer, s as MeasuredCluster, t as createNovelComposer } from "./novel-composer-
|
|
1
|
+
import { l as ValidationIssue, p as NamespacedId, u as ManuscriptResult, v as readonlyObject } from "./question-or-exclamation-spacing-Cp3eOGlA.mjs";
|
|
2
|
+
import { c as MeasurementTextRange, g as ParsedManuscript, h as FontPresetId, m as FontSizePt, o as RunMeasurement, r as logicalRunMeasurer, s as MeasuredCluster, t as createNovelComposer } from "./novel-composer-D_orH6ET.mjs";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
const PresentationKind = { schema: v.picklist([
|
|
5
5
|
"mixed",
|
|
@@ -12202,57 +12202,6 @@ declare const novelComposer: Readonly<{
|
|
|
12202
12202
|
}> | null;
|
|
12203
12203
|
inlineSizeEm: number;
|
|
12204
12204
|
readonly items: readonly (Readonly<{
|
|
12205
|
-
kind: "glue";
|
|
12206
|
-
origin: "generated";
|
|
12207
|
-
offsetEm: number;
|
|
12208
|
-
widthEm: number;
|
|
12209
|
-
naturalWidthEm: number;
|
|
12210
|
-
adjustment: "natural" | "shrunk" | "stretched";
|
|
12211
|
-
}> | Readonly<{
|
|
12212
|
-
kind: "glue";
|
|
12213
|
-
origin: "source";
|
|
12214
|
-
value: string;
|
|
12215
|
-
readonly range: Readonly<{
|
|
12216
|
-
source: Readonly<{
|
|
12217
|
-
start: number;
|
|
12218
|
-
end: number;
|
|
12219
|
-
}> & import("valibot").Brand<"SourceRange">;
|
|
12220
|
-
display: Readonly<{
|
|
12221
|
-
start: number;
|
|
12222
|
-
end: number;
|
|
12223
|
-
}> & import("valibot").Brand<"DisplayRange">;
|
|
12224
|
-
graphemes: Readonly<{
|
|
12225
|
-
start: number;
|
|
12226
|
-
end: number;
|
|
12227
|
-
}> & import("valibot").Brand<"GraphemeRange">;
|
|
12228
|
-
}>;
|
|
12229
|
-
offsetEm: number;
|
|
12230
|
-
widthEm: number;
|
|
12231
|
-
naturalWidthEm: number;
|
|
12232
|
-
adjustment: "natural" | "shrunk" | "stretched";
|
|
12233
|
-
}> | Readonly<{
|
|
12234
|
-
kind: "kern";
|
|
12235
|
-
offsetEm: number;
|
|
12236
|
-
widthEm: number;
|
|
12237
|
-
}> | Readonly<{
|
|
12238
|
-
kind: "suppressed";
|
|
12239
|
-
value: string;
|
|
12240
|
-
readonly range: Readonly<{
|
|
12241
|
-
source: Readonly<{
|
|
12242
|
-
start: number;
|
|
12243
|
-
end: number;
|
|
12244
|
-
}> & import("valibot").Brand<"SourceRange">;
|
|
12245
|
-
display: Readonly<{
|
|
12246
|
-
start: number;
|
|
12247
|
-
end: number;
|
|
12248
|
-
}> & import("valibot").Brand<"DisplayRange">;
|
|
12249
|
-
graphemes: Readonly<{
|
|
12250
|
-
start: number;
|
|
12251
|
-
end: number;
|
|
12252
|
-
}> & import("valibot").Brand<"GraphemeRange">;
|
|
12253
|
-
}>;
|
|
12254
|
-
reason: "question-or-exclamation-gap";
|
|
12255
|
-
}> | Readonly<{
|
|
12256
12205
|
value: string;
|
|
12257
12206
|
readonly range: Readonly<{
|
|
12258
12207
|
source: Readonly<{
|
|
@@ -12388,6 +12337,57 @@ declare const novelComposer: Readonly<{
|
|
|
12388
12337
|
kind: "combined-glyph";
|
|
12389
12338
|
presentation: "sideways" | "tate-chu-yoko";
|
|
12390
12339
|
disposition: "placed";
|
|
12340
|
+
}> | Readonly<{
|
|
12341
|
+
kind: "glue";
|
|
12342
|
+
origin: "generated";
|
|
12343
|
+
offsetEm: number;
|
|
12344
|
+
widthEm: number;
|
|
12345
|
+
naturalWidthEm: number;
|
|
12346
|
+
adjustment: "natural" | "shrunk" | "stretched";
|
|
12347
|
+
}> | Readonly<{
|
|
12348
|
+
kind: "glue";
|
|
12349
|
+
origin: "source";
|
|
12350
|
+
value: string;
|
|
12351
|
+
readonly range: Readonly<{
|
|
12352
|
+
source: Readonly<{
|
|
12353
|
+
start: number;
|
|
12354
|
+
end: number;
|
|
12355
|
+
}> & import("valibot").Brand<"SourceRange">;
|
|
12356
|
+
display: Readonly<{
|
|
12357
|
+
start: number;
|
|
12358
|
+
end: number;
|
|
12359
|
+
}> & import("valibot").Brand<"DisplayRange">;
|
|
12360
|
+
graphemes: Readonly<{
|
|
12361
|
+
start: number;
|
|
12362
|
+
end: number;
|
|
12363
|
+
}> & import("valibot").Brand<"GraphemeRange">;
|
|
12364
|
+
}>;
|
|
12365
|
+
offsetEm: number;
|
|
12366
|
+
widthEm: number;
|
|
12367
|
+
naturalWidthEm: number;
|
|
12368
|
+
adjustment: "natural" | "shrunk" | "stretched";
|
|
12369
|
+
}> | Readonly<{
|
|
12370
|
+
kind: "kern";
|
|
12371
|
+
offsetEm: number;
|
|
12372
|
+
widthEm: number;
|
|
12373
|
+
}> | Readonly<{
|
|
12374
|
+
kind: "suppressed";
|
|
12375
|
+
value: string;
|
|
12376
|
+
readonly range: Readonly<{
|
|
12377
|
+
source: Readonly<{
|
|
12378
|
+
start: number;
|
|
12379
|
+
end: number;
|
|
12380
|
+
}> & import("valibot").Brand<"SourceRange">;
|
|
12381
|
+
display: Readonly<{
|
|
12382
|
+
start: number;
|
|
12383
|
+
end: number;
|
|
12384
|
+
}> & import("valibot").Brand<"DisplayRange">;
|
|
12385
|
+
graphemes: Readonly<{
|
|
12386
|
+
start: number;
|
|
12387
|
+
end: number;
|
|
12388
|
+
}> & import("valibot").Brand<"GraphemeRange">;
|
|
12389
|
+
}>;
|
|
12390
|
+
reason: "question-or-exclamation-gap";
|
|
12391
12391
|
}>)[];
|
|
12392
12392
|
break: Readonly<{
|
|
12393
12393
|
kind: "natural";
|
|
@@ -12649,57 +12649,6 @@ declare const novelComposer: Readonly<{
|
|
|
12649
12649
|
}> | null;
|
|
12650
12650
|
inlineSizeEm: number;
|
|
12651
12651
|
readonly items: readonly (Readonly<{
|
|
12652
|
-
kind: "glue";
|
|
12653
|
-
origin: "generated";
|
|
12654
|
-
offsetEm: number;
|
|
12655
|
-
widthEm: number;
|
|
12656
|
-
naturalWidthEm: number;
|
|
12657
|
-
adjustment: "natural" | "shrunk" | "stretched";
|
|
12658
|
-
}> | Readonly<{
|
|
12659
|
-
kind: "glue";
|
|
12660
|
-
origin: "source";
|
|
12661
|
-
value: string;
|
|
12662
|
-
readonly range: Readonly<{
|
|
12663
|
-
source: Readonly<{
|
|
12664
|
-
start: number;
|
|
12665
|
-
end: number;
|
|
12666
|
-
}> & import("valibot").Brand<"SourceRange">;
|
|
12667
|
-
display: Readonly<{
|
|
12668
|
-
start: number;
|
|
12669
|
-
end: number;
|
|
12670
|
-
}> & import("valibot").Brand<"DisplayRange">;
|
|
12671
|
-
graphemes: Readonly<{
|
|
12672
|
-
start: number;
|
|
12673
|
-
end: number;
|
|
12674
|
-
}> & import("valibot").Brand<"GraphemeRange">;
|
|
12675
|
-
}>;
|
|
12676
|
-
offsetEm: number;
|
|
12677
|
-
widthEm: number;
|
|
12678
|
-
naturalWidthEm: number;
|
|
12679
|
-
adjustment: "natural" | "shrunk" | "stretched";
|
|
12680
|
-
}> | Readonly<{
|
|
12681
|
-
kind: "kern";
|
|
12682
|
-
offsetEm: number;
|
|
12683
|
-
widthEm: number;
|
|
12684
|
-
}> | Readonly<{
|
|
12685
|
-
kind: "suppressed";
|
|
12686
|
-
value: string;
|
|
12687
|
-
readonly range: Readonly<{
|
|
12688
|
-
source: Readonly<{
|
|
12689
|
-
start: number;
|
|
12690
|
-
end: number;
|
|
12691
|
-
}> & import("valibot").Brand<"SourceRange">;
|
|
12692
|
-
display: Readonly<{
|
|
12693
|
-
start: number;
|
|
12694
|
-
end: number;
|
|
12695
|
-
}> & import("valibot").Brand<"DisplayRange">;
|
|
12696
|
-
graphemes: Readonly<{
|
|
12697
|
-
start: number;
|
|
12698
|
-
end: number;
|
|
12699
|
-
}> & import("valibot").Brand<"GraphemeRange">;
|
|
12700
|
-
}>;
|
|
12701
|
-
reason: "question-or-exclamation-gap";
|
|
12702
|
-
}> | Readonly<{
|
|
12703
12652
|
value: string;
|
|
12704
12653
|
readonly range: Readonly<{
|
|
12705
12654
|
source: Readonly<{
|
|
@@ -12835,6 +12784,57 @@ declare const novelComposer: Readonly<{
|
|
|
12835
12784
|
kind: "combined-glyph";
|
|
12836
12785
|
presentation: "sideways" | "tate-chu-yoko";
|
|
12837
12786
|
disposition: "placed";
|
|
12787
|
+
}> | Readonly<{
|
|
12788
|
+
kind: "glue";
|
|
12789
|
+
origin: "generated";
|
|
12790
|
+
offsetEm: number;
|
|
12791
|
+
widthEm: number;
|
|
12792
|
+
naturalWidthEm: number;
|
|
12793
|
+
adjustment: "natural" | "shrunk" | "stretched";
|
|
12794
|
+
}> | Readonly<{
|
|
12795
|
+
kind: "glue";
|
|
12796
|
+
origin: "source";
|
|
12797
|
+
value: string;
|
|
12798
|
+
readonly range: Readonly<{
|
|
12799
|
+
source: Readonly<{
|
|
12800
|
+
start: number;
|
|
12801
|
+
end: number;
|
|
12802
|
+
}> & import("valibot").Brand<"SourceRange">;
|
|
12803
|
+
display: Readonly<{
|
|
12804
|
+
start: number;
|
|
12805
|
+
end: number;
|
|
12806
|
+
}> & import("valibot").Brand<"DisplayRange">;
|
|
12807
|
+
graphemes: Readonly<{
|
|
12808
|
+
start: number;
|
|
12809
|
+
end: number;
|
|
12810
|
+
}> & import("valibot").Brand<"GraphemeRange">;
|
|
12811
|
+
}>;
|
|
12812
|
+
offsetEm: number;
|
|
12813
|
+
widthEm: number;
|
|
12814
|
+
naturalWidthEm: number;
|
|
12815
|
+
adjustment: "natural" | "shrunk" | "stretched";
|
|
12816
|
+
}> | Readonly<{
|
|
12817
|
+
kind: "kern";
|
|
12818
|
+
offsetEm: number;
|
|
12819
|
+
widthEm: number;
|
|
12820
|
+
}> | Readonly<{
|
|
12821
|
+
kind: "suppressed";
|
|
12822
|
+
value: string;
|
|
12823
|
+
readonly range: Readonly<{
|
|
12824
|
+
source: Readonly<{
|
|
12825
|
+
start: number;
|
|
12826
|
+
end: number;
|
|
12827
|
+
}> & import("valibot").Brand<"SourceRange">;
|
|
12828
|
+
display: Readonly<{
|
|
12829
|
+
start: number;
|
|
12830
|
+
end: number;
|
|
12831
|
+
}> & import("valibot").Brand<"DisplayRange">;
|
|
12832
|
+
graphemes: Readonly<{
|
|
12833
|
+
start: number;
|
|
12834
|
+
end: number;
|
|
12835
|
+
}> & import("valibot").Brand<"GraphemeRange">;
|
|
12836
|
+
}>;
|
|
12837
|
+
reason: "question-or-exclamation-gap";
|
|
12838
12838
|
}>)[];
|
|
12839
12839
|
break: Readonly<{
|
|
12840
12840
|
kind: "natural";
|
|
@@ -195,6 +195,10 @@ function characterClass(characters) {
|
|
|
195
195
|
* neutral.
|
|
196
196
|
*/
|
|
197
197
|
const DIVIDING_PUNCTUATION = "!?‼⁇⁈⁉";
|
|
198
|
+
/**
|
|
199
|
+
* The marks a short run of which is set as one tate-chu-yoko cell, `!?` reading as `⁉`.
|
|
200
|
+
*/
|
|
201
|
+
const TATE_CHU_YOKO_MARKS = "!?!?";
|
|
198
202
|
//#endregion
|
|
199
203
|
//#region src/internal/japanese-spaces.ts
|
|
200
204
|
const LEADING_SPACES = /^[ \t]+/u;
|
|
@@ -255,4 +259,4 @@ function questionOrExclamationSpacings(line) {
|
|
|
255
259
|
return [...line.matchAll(MARKS)].map((marks) => analyzeMatch(line, marks)).filter((spacing) => spacing !== void 0);
|
|
256
260
|
}
|
|
257
261
|
//#endregion
|
|
258
|
-
export {
|
|
262
|
+
export { readonlyArray as _, CLOSING_BRACKETS as a, graphemeSegmenter as c, ManuscriptDiagnostic as d, DiagnosticSeverity as f, nonNegativeInteger as g, TextRange as h, TATE_CHU_YOKO_MARKS as i, ValidationIssue as l, ManuscriptRange as m, leadingSpaces as n, OPENING_BRACKETS as o, NamespacedId as p, DIVIDING_PUNCTUATION as r, characterClass as s, questionOrExclamationSpacings as t, ManuscriptResult as u, readonlyObject as v };
|