@tiqian/shared 0.0.0-stage → 0.1.0-alpha.10
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/org/tiqian/clreq/AdjustmentStylePolicy.d.ts +11 -0
- package/dist/org/tiqian/clreq/AdjustmentStylePolicy.js +21 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.d.ts +16 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.js +17 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.d.ts +13 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.js +23 -0
- package/dist/org/tiqian/clreq/BopomofoReading.d.ts +12 -0
- package/dist/org/tiqian/clreq/BopomofoReading.js +86 -0
- package/dist/org/tiqian/clreq/BopomofoTone.d.ts +28 -0
- package/dist/org/tiqian/clreq/BopomofoTone.js +26 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.d.ts +16 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.js +17 -0
- package/dist/org/tiqian/clreq/ClreqProfile.d.ts +27 -0
- package/dist/org/tiqian/clreq/ClreqProfile.js +58 -0
- package/dist/org/tiqian/clreq/ClreqRegion.d.ts +20 -0
- package/dist/org/tiqian/clreq/ClreqRegion.js +20 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.d.ts +16 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.js +17 -0
- package/dist/org/tiqian/clreq/GlueSide.d.ts +16 -0
- package/dist/org/tiqian/clreq/GlueSide.js +17 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.d.ts +20 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.js +20 -0
- package/dist/org/tiqian/clreq/KinsokuMode.d.ts +14 -0
- package/dist/org/tiqian/clreq/KinsokuMode.js +2 -0
- package/dist/org/tiqian/clreq/KinsokuModes.d.ts +11 -0
- package/dist/org/tiqian/clreq/KinsokuModes.js +71 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.d.ts +16 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.js +17 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/PunctuationClass.d.ts +44 -0
- package/dist/org/tiqian/clreq/PunctuationClass.js +38 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.d.ts +12 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.js +14 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.d.ts +9 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.js +49 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.d.ts +8 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.js +16 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.d.ts +12 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.js +43 -0
- package/dist/org/tiqian/core/Cluster.d.ts +13 -0
- package/dist/org/tiqian/core/Cluster.js +24 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.d.ts +4 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.js +399 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.d.ts +8 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.js +14 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.d.ts +20 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.js +20 -0
- package/dist/org/tiqian/core/Ic.d.ts +7 -0
- package/dist/org/tiqian/core/Ic.js +17 -0
- package/dist/org/tiqian/core/IllegalStateException.d.ts +4 -0
- package/dist/org/tiqian/core/IllegalStateException.js +8 -0
- package/dist/org/tiqian/core/IntRange.d.ts +12 -0
- package/dist/org/tiqian/core/IntRange.js +30 -0
- package/dist/org/tiqian/core/LineEndReason.d.ts +16 -0
- package/dist/org/tiqian/core/LineEndReason.js +17 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.d.ts +16 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.js +17 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.d.ts +29 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.js +193 -0
- package/dist/org/tiqian/core/TextRange.d.ts +11 -0
- package/dist/org/tiqian/core/TextRange.js +40 -0
- package/dist/org/tiqian/core/TextRangeError.d.ts +11 -0
- package/dist/org/tiqian/core/TextRangeError.js +2 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.d.ts +6 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.js +21 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.d.ts +10 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.js +16 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.js +109 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.js +88 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.js +35 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.js +64 -0
- package/dist/org/tiqian/core/UnicodeNumber.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumber.js +14 -0
- package/dist/org/tiqian/core/UnicodeNumberData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumberData.js +64 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.d.ts +7 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.d.ts +4 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.js +295 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.d.ts +6 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.js +17 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.js +234 -0
- package/dist/org/tiqian/font/FontRole.d.ts +28 -0
- package/dist/org/tiqian/font/FontRole.js +26 -0
- package/dist/org/tiqian/font/FontRoleContext.d.ts +13 -0
- package/dist/org/tiqian/font/FontRoleContext.js +28 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.d.ts +51 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.js +305 -0
- package/dist/org/tiqian/layout/LineOptimization.d.ts +124 -0
- package/dist/org/tiqian/layout/LineOptimization.js +298 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.d.ts +86 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.js +415 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.d.ts +5 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.js +33 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.d.ts +63 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.js +251 -0
- package/dist/org/tiqian/linebreak/BreakKind.d.ts +20 -0
- package/dist/org/tiqian/linebreak/BreakKind.js +20 -0
- package/dist/org/tiqian/shared/SnapshotValueStyle.d.ts +11 -0
- package/dist/org/tiqian/shared/SnapshotValueStyle.js +64 -0
- package/dist/org/tiqian/shared/ValueStyleInterner.d.ts +7 -0
- package/dist/org/tiqian/shared/ValueStyleInterner.js +23 -0
- package/dist/org/tiqian/shared/html/CompoundSelector.d.ts +28 -0
- package/dist/org/tiqian/shared/html/CompoundSelector.js +247 -0
- package/dist/org/tiqian/shared/html/DomAttribute.d.ts +5 -0
- package/dist/org/tiqian/shared/html/DomAttribute.js +10 -0
- package/dist/org/tiqian/shared/html/DomNode.d.ts +10 -0
- package/dist/org/tiqian/shared/html/DomNode.js +2 -0
- package/dist/org/tiqian/shared/html/DomParser.d.ts +16 -0
- package/dist/org/tiqian/shared/html/DomParser.js +84 -0
- package/dist/org/tiqian/shared/html/HtmlAttributeInsertion.d.ts +4 -0
- package/dist/org/tiqian/shared/html/HtmlAttributeInsertion.js +2 -0
- package/dist/org/tiqian/shared/html/HtmlError.d.ts +16 -0
- package/dist/org/tiqian/shared/html/HtmlError.js +17 -0
- package/dist/org/tiqian/shared/html/HtmlNameCase.d.ts +3 -0
- package/dist/org/tiqian/shared/html/HtmlNameCase.js +20 -0
- package/dist/org/tiqian/shared/html/HtmlOpeningTag.d.ts +6 -0
- package/dist/org/tiqian/shared/html/HtmlOpeningTag.js +12 -0
- package/dist/org/tiqian/shared/html/HtmlParseException.d.ts +6 -0
- package/dist/org/tiqian/shared/html/HtmlParseException.js +19 -0
- package/dist/org/tiqian/shared/html/HtmlScan.d.ts +16 -0
- package/dist/org/tiqian/shared/html/HtmlScan.js +191 -0
- package/dist/org/tiqian/shared/prepared_dom/AttributeEntry.d.ts +5 -0
- package/dist/org/tiqian/shared/prepared_dom/AttributeEntry.js +10 -0
- package/dist/org/tiqian/shared/prepared_dom/BopomofoPlacement.d.ts +8 -0
- package/dist/org/tiqian/shared/prepared_dom/BopomofoPlacement.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/BopomofoPlacementCss.d.ts +6 -0
- package/dist/org/tiqian/shared/prepared_dom/BopomofoPlacementCss.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/BopomofoZone.d.ts +7 -0
- package/dist/org/tiqian/shared/prepared_dom/BopomofoZone.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/EmphasisDotColorResolver.d.ts +4 -0
- package/dist/org/tiqian/shared/prepared_dom/EmphasisDotColorResolver.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/Evidence.d.ts +33 -0
- package/dist/org/tiqian/shared/prepared_dom/Evidence.js +251 -0
- package/dist/org/tiqian/shared/prepared_dom/EvidenceDecorationKind.d.ts +12 -0
- package/dist/org/tiqian/shared/prepared_dom/EvidenceDecorationKind.js +14 -0
- package/dist/org/tiqian/shared/prepared_dom/EvidenceDecorationSegment.d.ts +7 -0
- package/dist/org/tiqian/shared/prepared_dom/EvidenceDecorationSegment.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/EvidenceEmphasisDot.d.ts +6 -0
- package/dist/org/tiqian/shared/prepared_dom/EvidenceEmphasisDot.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/EvidenceOverlayOptions.d.ts +4 -0
- package/dist/org/tiqian/shared/prepared_dom/EvidenceOverlayOptions.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/EvidenceOverlayPlan.d.ts +9 -0
- package/dist/org/tiqian/shared/prepared_dom/EvidenceOverlayPlan.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/FixedEmphasisDotColor.d.ts +5 -0
- package/dist/org/tiqian/shared/prepared_dom/FixedEmphasisDotColor.js +8 -0
- package/dist/org/tiqian/shared/prepared_dom/InlineBoxEntry.d.ts +6 -0
- package/dist/org/tiqian/shared/prepared_dom/InlineBoxEntry.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/InlineEdgeEntry.d.ts +5 -0
- package/dist/org/tiqian/shared/prepared_dom/InlineEdgeEntry.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/InlineObjectPlaceholderCell.d.ts +6 -0
- package/dist/org/tiqian/shared/prepared_dom/InlineObjectPlaceholderCell.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/Markup.d.ts +30 -0
- package/dist/org/tiqian/shared/prepared_dom/Markup.js +344 -0
- package/dist/org/tiqian/shared/prepared_dom/MarkupArtifact.d.ts +12 -0
- package/dist/org/tiqian/shared/prepared_dom/MarkupArtifact.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/MarkupContainer.d.ts +7 -0
- package/dist/org/tiqian/shared/prepared_dom/MarkupContainer.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/MarkupNode.d.ts +5 -0
- package/dist/org/tiqian/shared/prepared_dom/MarkupNode.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/NumericFeatureContract.d.ts +4 -0
- package/dist/org/tiqian/shared/prepared_dom/NumericFeatureContract.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/NumericFeatures.d.ts +8 -0
- package/dist/org/tiqian/shared/prepared_dom/NumericFeatures.js +50 -0
- package/dist/org/tiqian/shared/prepared_dom/PlanBopomofoZone.d.ts +8 -0
- package/dist/org/tiqian/shared/prepared_dom/PlanBopomofoZone.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PlanRubyAnnotation.d.ts +10 -0
- package/dist/org/tiqian/shared/prepared_dom/PlanRubyAnnotation.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedArtifact.d.ts +23 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedArtifact.js +477 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedArtifactOptions.d.ts +15 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedArtifactOptions.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedArtifactResult.d.ts +8 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedArtifactResult.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedArtifactState.d.ts +11 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedArtifactState.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedCjkStrongSemantic.d.ts +5 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedCjkStrongSemantic.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedDom.d.ts +29 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedDom.js +191 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedDomError.d.ts +15 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedDomError.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedDomException.d.ts +6 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedDomException.js +25 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedDomTestSupport.d.ts +11 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedDomTestSupport.js +93 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedEmphasisRange.d.ts +4 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedEmphasisRange.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedLineChild.d.ts +16 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedLineChild.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedPlan.d.ts +19 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedPlan.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedPlanCell.d.ts +26 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedPlanCell.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedPlanLine.d.ts +13 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedPlanLine.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedRenderTextSpan.d.ts +6 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedRenderTextSpan.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedRunRenderInput.d.ts +23 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedRunRenderInput.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedRunSignature.d.ts +19 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedRunSignature.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedRunTyped.d.ts +32 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedRunTyped.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedSemanticSpan.d.ts +10 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedSemanticSpan.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedSpacingResult.d.ts +4 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedSpacingResult.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/RenderedMarkupContainer.d.ts +16 -0
- package/dist/org/tiqian/shared/prepared_dom/RenderedMarkupContainer.js +48 -0
- package/dist/org/tiqian/shared/prepared_dom/RenderedMarkupNode.d.ts +11 -0
- package/dist/org/tiqian/shared/prepared_dom/RenderedMarkupNode.js +21 -0
- package/dist/org/tiqian/shared/prepared_dom/RubyAnnotation.d.ts +9 -0
- package/dist/org/tiqian/shared/prepared_dom/RubyAnnotation.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/StyleClassResolver.d.ts +4 -0
- package/dist/org/tiqian/shared/prepared_dom/StyleClassResolver.js +2 -0
- package/dist/org/tiqian/shared/prepared_dom/StyleDelta.d.ts +5 -0
- package/dist/org/tiqian/shared/prepared_dom/StyleDelta.js +2 -0
- package/dist/org/tiqian/shared/snapshot/SnapshotSource.d.ts +24 -0
- package/dist/org/tiqian/shared/snapshot/SnapshotSource.js +135 -0
- package/dist/org/tiqian/test/TestHelpers.d.ts +5 -0
- package/dist/org/tiqian/test/TestHelpers.js +27 -0
- package/dist/org/tiqian/test/trace/TestTrace.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTrace.js +8 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.js +78 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.d.ts +9 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.js +36 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.d.ts +47 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.js +690 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.d.ts +18 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.js +149 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.js +2 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.js +16 -0
- package/dist/org/tiqian/test/trace/TraceField.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceField.js +10 -0
- package/dist/org/tiqian/test/trace/TraceFormat.d.ts +21 -0
- package/dist/org/tiqian/test/trace/TraceFormat.js +184 -0
- package/dist/runtime.d.ts +96 -0
- package/dist/runtime.js +1612 -0
- package/dist/std/FsError.d.ts +48 -0
- package/dist/std/FsError.js +2 -0
- package/dist/std/FsException.d.ts +6 -0
- package/dist/std/FsException.js +45 -0
- package/dist/std/UStringException.d.ts +6 -0
- package/dist/std/UStringException.js +21 -0
- package/dist/std/UStringFault.d.ts +9 -0
- package/dist/std/UStringFault.js +2 -0
- package/package.json +22 -4
- package/README.md +0 -3
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { Markup } from "./Markup.js";
|
|
3
|
+
import { PreparedDomException } from "./PreparedDomException.js";
|
|
4
|
+
export class Evidence {
|
|
5
|
+
static SPACING_EPSILON = 0.01;
|
|
6
|
+
static RUBY_ASCENT_RATIO = 0.8;
|
|
7
|
+
static BOPOMOFO_LANG = "zh-Hant-TW";
|
|
8
|
+
static BOPOMOFO_TONE_TARGET_INK_WIDTH_SCALE = 0.82;
|
|
9
|
+
static BOPOMOFO_TONE_SLASH_INK_WIDTH_EM_REGULAR = 0.404;
|
|
10
|
+
static BOPOMOFO_TONE_SLASH_INK_WIDTH_EM_SEMIBOLD = 0.446;
|
|
11
|
+
static BOPOMOFO_TONE_CARON_INK_WIDTH_EM_REGULAR = 0.644;
|
|
12
|
+
static BOPOMOFO_TONE_CARON_INK_WIDTH_EM_SEMIBOLD = 0.682;
|
|
13
|
+
static LINE_THICKNESS_EM = 0.08;
|
|
14
|
+
static WAVY_HALF_WAVE_EM = 0.2;
|
|
15
|
+
static WAVY_AMPLITUDE_EM = 0.06;
|
|
16
|
+
static WAVY_ENDPOINT_EPSILON_PX = 0.01;
|
|
17
|
+
static inlineObjectPlaceholder(cell, trailingGap, styleClassFor) {
|
|
18
|
+
const carriesTrailingMargin = Math.abs(trailingGap) >= Evidence.SPACING_EPSILON;
|
|
19
|
+
const attributes = [];
|
|
20
|
+
Markup.setAttribute(attributes, "data-tq-advance", `${cell.naturalWidth}`);
|
|
21
|
+
Markup.setAttribute(attributes, "data-tq-geometry", "true");
|
|
22
|
+
Markup.setAttribute(attributes, "data-tq-inline-object", "pending");
|
|
23
|
+
Markup.setAttribute(attributes, "data-tq-object-range", `${cell.rangeStart}-${cell.rangeEnd}`);
|
|
24
|
+
if (carriesTrailingMargin) {
|
|
25
|
+
Markup.setAttribute(attributes, "data-tq-object-trailing-margin", `${trailingGap}`);
|
|
26
|
+
}
|
|
27
|
+
Markup.setAttribute(attributes, "data-tq-x", `${cell.drawX}`);
|
|
28
|
+
const styles = ["display:inline-block!important", "box-sizing:border-box!important", `inline-size:${Markup.px(cell.naturalWidth)}!important`];
|
|
29
|
+
if (carriesTrailingMargin) {
|
|
30
|
+
styles.push(`margin-right:${Markup.px(trailingGap)}!important`);
|
|
31
|
+
}
|
|
32
|
+
Markup.applyDynamicStyles(attributes, styles, styleClassFor);
|
|
33
|
+
return Markup.renderedElement("span", attributes, null, false);
|
|
34
|
+
}
|
|
35
|
+
static rubyAnnotationSpan(ruby, lineTop, styleClassFor) {
|
|
36
|
+
const fontSize = ruby.fontSize;
|
|
37
|
+
const planAscent = ruby.ascent;
|
|
38
|
+
const ascent = (Number.isFinite(planAscent) ? planAscent : fontSize * Evidence.RUBY_ASCENT_RATIO);
|
|
39
|
+
const families = ruby.fontFamilies;
|
|
40
|
+
const attributes = [];
|
|
41
|
+
Markup.setAttribute(attributes, "data-tq-geometry", "true");
|
|
42
|
+
Markup.setAttribute(attributes, "data-tq-src", `(${ruby.text})`);
|
|
43
|
+
const styles = ["color:currentColor!important"];
|
|
44
|
+
if (families.length > 0) {
|
|
45
|
+
styles.push(`font-family:${Markup.cssFamilyList(families)}!important`);
|
|
46
|
+
}
|
|
47
|
+
styles.push(`font-size:${Markup.px(fontSize)}!important`);
|
|
48
|
+
styles.push(`font-weight:${ruby.fontWeight}!important`);
|
|
49
|
+
styles.push(`left:${Markup.px(ruby.centerX)}!important`);
|
|
50
|
+
styles.push("line-height:1!important");
|
|
51
|
+
styles.push("position:absolute!important");
|
|
52
|
+
styles.push(`top:${Markup.px(ruby.baselineY - lineTop - ascent)}!important`);
|
|
53
|
+
styles.push("transform:translateX(-50%)!important");
|
|
54
|
+
styles.push("white-space:pre!important");
|
|
55
|
+
Markup.applyDynamicStyles(attributes, styles, styleClassFor);
|
|
56
|
+
return Markup.renderedElement("span", attributes, ruby.text, false);
|
|
57
|
+
}
|
|
58
|
+
static bopomofoAnnotationSpan(zone, width, lineTop, lineHeight, styleClassFor) {
|
|
59
|
+
const fontWeight = zone.fontWeight;
|
|
60
|
+
const families = zone.fontFamilies;
|
|
61
|
+
const placements = zone.placements;
|
|
62
|
+
const attributes = [];
|
|
63
|
+
Markup.setAttribute(attributes, "data-tq-geometry", "true");
|
|
64
|
+
Markup.setAttribute(attributes, "data-tq-src", `(${zone.text})`);
|
|
65
|
+
Markup.setAttribute(attributes, "lang", Evidence.BOPOMOFO_LANG);
|
|
66
|
+
const styles = ["box-sizing:border-box!important", "display:inline-block!important", `height:${Markup.px(lineHeight)}!important`, `line-height:${Markup.px(lineHeight)}!important`, "overflow:visible!important", "position:relative!important", "user-select:all!important", "vertical-align:top!important", "-webkit-user-select:all!important", "white-space:pre!important", `width:${Markup.px(width)}!important`];
|
|
67
|
+
Markup.applyDynamicStyles(attributes, styles, styleClassFor);
|
|
68
|
+
const container = Markup.renderedContainer("span", attributes);
|
|
69
|
+
const zoneLeft = Evidence.bopomofoZoneLeft(placements);
|
|
70
|
+
let i = 0;
|
|
71
|
+
while (i < placements.length) {
|
|
72
|
+
const placement = placements[i];
|
|
73
|
+
const text = placement.text;
|
|
74
|
+
const css = Evidence.bopomofoCssPlacement(text, placement.role, fontWeight, placement.left, placement.top, placement.width, placement.height);
|
|
75
|
+
const glyphAttributes = [];
|
|
76
|
+
Markup.setAttribute(glyphAttributes, "data-tq-geometry", "true");
|
|
77
|
+
Markup.setAttribute(glyphAttributes, "lang", Evidence.BOPOMOFO_LANG);
|
|
78
|
+
const glyphStyles = ["color:currentColor!important"];
|
|
79
|
+
if (families.length > 0) {
|
|
80
|
+
glyphStyles.push(`font-family:${Markup.cssFamilyList(families)}!important`);
|
|
81
|
+
}
|
|
82
|
+
glyphStyles.push("font-feature-settings:'vert' 1, 'vrt2' 1!important");
|
|
83
|
+
glyphStyles.push(`font-size:${Markup.px(css.fontSize)}!important`);
|
|
84
|
+
glyphStyles.push("font-style:normal!important");
|
|
85
|
+
glyphStyles.push(`font-weight:${fontWeight}!important`);
|
|
86
|
+
glyphStyles.push(`left:${Markup.px(css.left - zoneLeft)}!important`);
|
|
87
|
+
glyphStyles.push(`line-height:${Markup.px(css.lineHeight)}!important`);
|
|
88
|
+
glyphStyles.push("overflow:visible!important");
|
|
89
|
+
glyphStyles.push("pointer-events:none!important");
|
|
90
|
+
glyphStyles.push("position:absolute!important");
|
|
91
|
+
glyphStyles.push(`top:${Markup.px(css.top - lineTop)}!important`);
|
|
92
|
+
glyphStyles.push("white-space:pre!important");
|
|
93
|
+
glyphStyles.push("display:inline-block!important");
|
|
94
|
+
glyphStyles.push("text-orientation:upright!important");
|
|
95
|
+
glyphStyles.push("writing-mode:vertical-rl!important");
|
|
96
|
+
Markup.applyDynamicStyles(glyphAttributes, glyphStyles, styleClassFor);
|
|
97
|
+
container.children.push(Markup.renderedElement("span", glyphAttributes, text, false));
|
|
98
|
+
i += 1;
|
|
99
|
+
}
|
|
100
|
+
return container;
|
|
101
|
+
}
|
|
102
|
+
static appendEvidenceOverlays(nodes, plan, options) {
|
|
103
|
+
const segments = (plan.decorationSegments === null ? [] : plan.decorationSegments);
|
|
104
|
+
const dots = (plan.emphasisDots === null ? [] : plan.emphasisDots);
|
|
105
|
+
const emphasisDotColor = options.emphasisDotColor;
|
|
106
|
+
if (segments.length > 0) {
|
|
107
|
+
const fontSize = plan.fontSize;
|
|
108
|
+
const width = plan.overlayWidth;
|
|
109
|
+
const height = plan.height;
|
|
110
|
+
if (!Number.isFinite(fontSize) || !Number.isFinite(width) || !Number.isFinite(height)) {
|
|
111
|
+
throw new PreparedDomException({ kind: "InvalidPreparedOverlayGeometry" });
|
|
112
|
+
}
|
|
113
|
+
const strokeWidth = fontSize * Evidence.LINE_THICKNESS_EM;
|
|
114
|
+
const svg = Markup.renderedContainer("svg", Evidence.overlayAttributes(width, height));
|
|
115
|
+
let i = 0;
|
|
116
|
+
while (i < segments.length) {
|
|
117
|
+
const segment = segments[i];
|
|
118
|
+
const left = segment.left;
|
|
119
|
+
const top = segment.top;
|
|
120
|
+
const right = segment.right;
|
|
121
|
+
const style = `--tq-decoration-color:currentColor;--tq-decoration-stroke-width:${Markup.px(strokeWidth)}`;
|
|
122
|
+
{
|
|
123
|
+
const _g = segment.kind;
|
|
124
|
+
switch (_g.kind) {
|
|
125
|
+
case "ProperNoun":
|
|
126
|
+
svg.children.push(Evidence.decorationLine(left, top, right, strokeWidth, style));
|
|
127
|
+
break;
|
|
128
|
+
case "BookTitle":
|
|
129
|
+
svg.children.push(Evidence.decorationWave(left, top, right, fontSize, strokeWidth, style));
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
i += 1;
|
|
134
|
+
}
|
|
135
|
+
nodes.push(svg);
|
|
136
|
+
}
|
|
137
|
+
if (dots.length > 0) {
|
|
138
|
+
const width2 = plan.overlayWidth;
|
|
139
|
+
const height2 = plan.height;
|
|
140
|
+
if (!Number.isFinite(width2) || !Number.isFinite(height2)) {
|
|
141
|
+
throw new PreparedDomException({ kind: "InvalidPreparedOverlayGeometry" });
|
|
142
|
+
}
|
|
143
|
+
const svg2 = Markup.renderedContainer("svg", Evidence.overlayAttributes(width2, height2));
|
|
144
|
+
let j = 0;
|
|
145
|
+
while (j < dots.length) {
|
|
146
|
+
const dot = dots[j];
|
|
147
|
+
const color = (emphasisDotColor === null ? "" : emphasisDotColor.resolve(dot.clusterRangeStart));
|
|
148
|
+
const dotColor = (color.length === 0 ? "currentColor" : color);
|
|
149
|
+
const circleEntries = [];
|
|
150
|
+
Markup.setAttribute(circleEntries, "cx", `${dot.anchorX}`);
|
|
151
|
+
Markup.setAttribute(circleEntries, "cy", `${dot.anchorY}`);
|
|
152
|
+
Markup.setAttribute(circleEntries, "data-tq-decoration-dot", "true");
|
|
153
|
+
Markup.setAttribute(circleEntries, "fill", dotColor);
|
|
154
|
+
Markup.setAttribute(circleEntries, "r", `${dot.dotDiameter / 2}`);
|
|
155
|
+
Markup.setAttribute(circleEntries, "style", `--tq-decoration-color:${dotColor}`);
|
|
156
|
+
svg2.children.push(Markup.renderedElement("circle", circleEntries, null, false));
|
|
157
|
+
j += 1;
|
|
158
|
+
}
|
|
159
|
+
nodes.push(svg2);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
static decorationLine(left, top, right, strokeWidth, style) {
|
|
163
|
+
const entries = [];
|
|
164
|
+
Markup.setAttribute(entries, "data-tq-decoration-line", "true");
|
|
165
|
+
Markup.setAttribute(entries, "stroke", "currentColor");
|
|
166
|
+
Markup.setAttribute(entries, "style", style);
|
|
167
|
+
Markup.setAttribute(entries, "stroke-linecap", "butt");
|
|
168
|
+
Markup.setAttribute(entries, "stroke-width", `${strokeWidth}`);
|
|
169
|
+
Markup.setAttribute(entries, "x1", `${left}`);
|
|
170
|
+
Markup.setAttribute(entries, "x2", `${right}`);
|
|
171
|
+
Markup.setAttribute(entries, "y1", `${top}`);
|
|
172
|
+
Markup.setAttribute(entries, "y2", `${top}`);
|
|
173
|
+
return Markup.renderedElement("line", entries, null, false);
|
|
174
|
+
}
|
|
175
|
+
static decorationWave(left, top, right, fontSize, strokeWidth, style) {
|
|
176
|
+
const entries = [];
|
|
177
|
+
Markup.setAttribute(entries, "data-tq-decoration-wave", "true");
|
|
178
|
+
Markup.setAttribute(entries, "d", Evidence.wavyLinePath(left, right, top, fontSize));
|
|
179
|
+
Markup.setAttribute(entries, "fill", "none");
|
|
180
|
+
Markup.setAttribute(entries, "stroke", "currentColor");
|
|
181
|
+
Markup.setAttribute(entries, "style", style);
|
|
182
|
+
Markup.setAttribute(entries, "stroke-linecap", "butt");
|
|
183
|
+
Markup.setAttribute(entries, "stroke-linejoin", "round");
|
|
184
|
+
Markup.setAttribute(entries, "stroke-width", `${strokeWidth}`);
|
|
185
|
+
return Markup.renderedElement("path", entries, null, false);
|
|
186
|
+
}
|
|
187
|
+
static bopomofoToneInkWidthEm(text, fontWeight) {
|
|
188
|
+
const caron = text === "ˇ";
|
|
189
|
+
const regular = (caron ? Evidence.BOPOMOFO_TONE_CARON_INK_WIDTH_EM_REGULAR : Evidence.BOPOMOFO_TONE_SLASH_INK_WIDTH_EM_REGULAR);
|
|
190
|
+
const semibold = (caron ? Evidence.BOPOMOFO_TONE_CARON_INK_WIDTH_EM_SEMIBOLD : Evidence.BOPOMOFO_TONE_SLASH_INK_WIDTH_EM_SEMIBOLD);
|
|
191
|
+
const t = Math.min(Math.max((fontWeight - 400) / 300, 0), 1);
|
|
192
|
+
return regular + (semibold - regular) * t;
|
|
193
|
+
}
|
|
194
|
+
static bopomofoCssPlacement(text, role, fontWeight, boxLeft, boxTop, boxWidth, boxHeight) {
|
|
195
|
+
if (role === "Symbol") {
|
|
196
|
+
return { left: boxLeft, top: boxTop, fontSize: boxHeight, lineHeight: boxWidth };
|
|
197
|
+
}
|
|
198
|
+
if (role === "Neutral") {
|
|
199
|
+
const neutralFontSize = boxWidth;
|
|
200
|
+
return { left: boxLeft, top: boxTop + (boxHeight - neutralFontSize) / 2, fontSize: neutralFontSize, lineHeight: boxWidth };
|
|
201
|
+
}
|
|
202
|
+
const inkWidthEm = Math.max(Evidence.bopomofoToneInkWidthEm(text, fontWeight), 0.1);
|
|
203
|
+
const toneFontSize = boxWidth * Evidence.BOPOMOFO_TONE_TARGET_INK_WIDTH_SCALE / inkWidthEm;
|
|
204
|
+
return { left: boxLeft, top: boxTop + (boxHeight - toneFontSize) / 2, fontSize: toneFontSize, lineHeight: boxWidth };
|
|
205
|
+
}
|
|
206
|
+
static bopomofoZoneLeft(placements) {
|
|
207
|
+
let i = 0;
|
|
208
|
+
while (i < placements.length) {
|
|
209
|
+
if (placements[i].role === "Symbol") {
|
|
210
|
+
return placements[i].left - placements[i].width / 9;
|
|
211
|
+
}
|
|
212
|
+
i += 1;
|
|
213
|
+
}
|
|
214
|
+
if (placements.length === 0) {
|
|
215
|
+
return 0;
|
|
216
|
+
}
|
|
217
|
+
let min = placements[0].left;
|
|
218
|
+
let j = 1;
|
|
219
|
+
while (j < placements.length) {
|
|
220
|
+
if (placements[j].left < min) {
|
|
221
|
+
min = placements[j].left;
|
|
222
|
+
}
|
|
223
|
+
j += 1;
|
|
224
|
+
}
|
|
225
|
+
return min;
|
|
226
|
+
}
|
|
227
|
+
static wavyLinePath(left, right, y, fontSize) {
|
|
228
|
+
const halfWave = Math.max(fontSize * Evidence.WAVY_HALF_WAVE_EM, 1);
|
|
229
|
+
const amplitude = fontSize * Evidence.WAVY_AMPLITUDE_EM;
|
|
230
|
+
let out = `M ${left} ${y}`;
|
|
231
|
+
let x = left;
|
|
232
|
+
let up = true;
|
|
233
|
+
while (x < right - Evidence.WAVY_ENDPOINT_EPSILON_PX) {
|
|
234
|
+
const rawNextX = x + halfWave;
|
|
235
|
+
const nextX = (rawNextX >= right - Evidence.WAVY_ENDPOINT_EPSILON_PX ? right : rawNextX);
|
|
236
|
+
const controlY = (up ? y - amplitude * 2 : y + amplitude * 2);
|
|
237
|
+
out += ` Q ${(x + nextX) / 2} ${controlY} ${nextX} ${y}`;
|
|
238
|
+
x = nextX;
|
|
239
|
+
up = !up;
|
|
240
|
+
}
|
|
241
|
+
return out;
|
|
242
|
+
}
|
|
243
|
+
static overlayAttributes(width, height) {
|
|
244
|
+
const attributes = [];
|
|
245
|
+
Markup.setAttribute(attributes, "aria-hidden", "true");
|
|
246
|
+
Markup.setAttribute(attributes, "data-tq-copy-ignore", "true");
|
|
247
|
+
Markup.setAttribute(attributes, "data-tq-geometry", "true");
|
|
248
|
+
Markup.setAttribute(attributes, "style", `--tq-overlay-width:${Markup.px(width)};--tq-overlay-height:${Markup.px(height)}`);
|
|
249
|
+
return attributes;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ProperNoun {
|
|
2
|
+
readonly kind: "ProperNoun";
|
|
3
|
+
}
|
|
4
|
+
export interface BookTitle {
|
|
5
|
+
readonly kind: "BookTitle";
|
|
6
|
+
}
|
|
7
|
+
export type EvidenceDecorationKind = ProperNoun | BookTitle;
|
|
8
|
+
export declare const EvidenceDecorationKind: Readonly<{
|
|
9
|
+
ProperNoun: Readonly<ProperNoun>;
|
|
10
|
+
BookTitle: Readonly<BookTitle>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function compareEvidenceDecorationKind(a: EvidenceDecorationKind, b: EvidenceDecorationKind): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
export const EvidenceDecorationKind = Object.freeze({
|
|
3
|
+
ProperNoun: Object.freeze({ kind: "ProperNoun" }),
|
|
4
|
+
BookTitle: Object.freeze({ kind: "BookTitle" })
|
|
5
|
+
});
|
|
6
|
+
export function compareEvidenceDecorationKind(a, b) {
|
|
7
|
+
if (a === b)
|
|
8
|
+
return 0;
|
|
9
|
+
if (a.kind === "ProperNoun")
|
|
10
|
+
return 0 - (b.kind === "ProperNoun" ? 0 : 0);
|
|
11
|
+
if (a.kind === "BookTitle")
|
|
12
|
+
return 1 - (b.kind === "BookTitle" ? 1 : 0);
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type EvidenceDecorationSegment } from "./EvidenceDecorationSegment.js";
|
|
2
|
+
import { type EvidenceEmphasisDot } from "./EvidenceEmphasisDot.js";
|
|
3
|
+
export interface EvidenceOverlayPlan {
|
|
4
|
+
decorationSegments: EvidenceDecorationSegment[] | null;
|
|
5
|
+
emphasisDots: EvidenceEmphasisDot[] | null;
|
|
6
|
+
fontSize: number;
|
|
7
|
+
overlayWidth: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type AttributeEntry } from "./AttributeEntry.js";
|
|
2
|
+
import { type MarkupNode } from "./MarkupNode.js";
|
|
3
|
+
import { RenderedMarkupContainer } from "./RenderedMarkupContainer.js";
|
|
4
|
+
import { type StyleClassResolver } from "./StyleClassResolver.js";
|
|
5
|
+
export declare class Markup {
|
|
6
|
+
static escapeText(value: string): string;
|
|
7
|
+
static escapeAttribute(value: string): string;
|
|
8
|
+
static cssString(value: string): string;
|
|
9
|
+
static px(value: number): string;
|
|
10
|
+
static applyDynamicStyles(entries: AttributeEntry[], styles: string[], styleClassFor: StyleClassResolver | null): void;
|
|
11
|
+
static setAttribute(entries: AttributeEntry[], name: string, value: string): void;
|
|
12
|
+
static sortedAttributeEntries(entries: AttributeEntry[]): AttributeEntry[];
|
|
13
|
+
static serializeAttributeEntries(entries: AttributeEntry[]): string;
|
|
14
|
+
static cssFamilyList(families: string[]): string;
|
|
15
|
+
static renderedText(value: string): MarkupNode;
|
|
16
|
+
static renderedElement(tag: string, entries: AttributeEntry[], text: string | null, voidElement: boolean): MarkupNode;
|
|
17
|
+
static renderedContainer(tag: string, entries: AttributeEntry[]): RenderedMarkupContainer;
|
|
18
|
+
private static compareEntryNames;
|
|
19
|
+
private static roundToFiveDecimals;
|
|
20
|
+
private static formatFixed;
|
|
21
|
+
private static timesSmall;
|
|
22
|
+
private static addDecimal;
|
|
23
|
+
private static multiplyDecimal;
|
|
24
|
+
private static fivePower;
|
|
25
|
+
private static twoPower;
|
|
26
|
+
private static truncateLast;
|
|
27
|
+
private static reverse;
|
|
28
|
+
private static stripFractionZeros;
|
|
29
|
+
private static zeros;
|
|
30
|
+
}
|