@tiqian/shared 0.0.0-stage → 0.1.0-alpha.9
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/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 +22 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedArtifact.js +457 -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 +28 -0
- package/dist/org/tiqian/shared/prepared_dom/PreparedDom.js +184 -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,344 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { RenderedMarkupContainer } from "./RenderedMarkupContainer.js";
|
|
3
|
+
import { RenderedMarkupNode } from "./RenderedMarkupNode.js";
|
|
4
|
+
import { doubleToI64, formatFloatRuntime, readUnit } from "../../../../runtime.js";
|
|
5
|
+
export class Markup {
|
|
6
|
+
static escapeText(value) {
|
|
7
|
+
let out = "";
|
|
8
|
+
let i = 0;
|
|
9
|
+
while (i < value.length) {
|
|
10
|
+
const c = (Number.isNaN(value.charCodeAt(i)) ? null : value.charCodeAt(i));
|
|
11
|
+
if (c === 38) {
|
|
12
|
+
out += "&";
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
if (c === 60) {
|
|
16
|
+
out += "<";
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
if (c === 62) {
|
|
20
|
+
out += ">";
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
out += String.fromCodePoint((c));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
i += 1;
|
|
28
|
+
}
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
static escapeAttribute(value) {
|
|
32
|
+
const base = Markup.escapeText(value);
|
|
33
|
+
let out = "";
|
|
34
|
+
let i = 0;
|
|
35
|
+
while (i < base.length) {
|
|
36
|
+
const c = (Number.isNaN(base.charCodeAt(i)) ? null : base.charCodeAt(i));
|
|
37
|
+
if (c === 34) {
|
|
38
|
+
out += """;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
out += String.fromCodePoint((c));
|
|
42
|
+
}
|
|
43
|
+
i += 1;
|
|
44
|
+
}
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
static cssString(value) {
|
|
48
|
+
let out = "\"";
|
|
49
|
+
let i = 0;
|
|
50
|
+
while (i < value.length) {
|
|
51
|
+
const c = (Number.isNaN(value.charCodeAt(i)) ? null : value.charCodeAt(i));
|
|
52
|
+
if (c === 92) {
|
|
53
|
+
out += "\\\\";
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
if (c === 34) {
|
|
57
|
+
out += "\\\"";
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
out += String.fromCodePoint((c));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
i += 1;
|
|
64
|
+
}
|
|
65
|
+
out += "\"";
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
static px(value) {
|
|
69
|
+
const normalized = (Math.abs(value) < 0.000001 ? 0.0 : value);
|
|
70
|
+
if (Number.isNaN(normalized)) {
|
|
71
|
+
return "NaNpx";
|
|
72
|
+
}
|
|
73
|
+
if (!Number.isFinite(normalized)) {
|
|
74
|
+
return (normalized < 0 ? "-Infinitypx" : "Infinitypx");
|
|
75
|
+
}
|
|
76
|
+
if (normalized === 0.0) {
|
|
77
|
+
return "0px";
|
|
78
|
+
}
|
|
79
|
+
const negative = normalized < 0;
|
|
80
|
+
const a = (negative ? -normalized : normalized);
|
|
81
|
+
if (a >= 1e21) {
|
|
82
|
+
return (negative ? "-" : "") + formatFloatRuntime(a) + "px";
|
|
83
|
+
}
|
|
84
|
+
const n = Markup.roundToFiveDecimals(a);
|
|
85
|
+
const formatted = Markup.formatFixed(n);
|
|
86
|
+
if (formatted === "0") {
|
|
87
|
+
return "0px";
|
|
88
|
+
}
|
|
89
|
+
return (negative ? "-" : "") + formatted + "px";
|
|
90
|
+
}
|
|
91
|
+
static applyDynamicStyles(entries, styles, styleClassFor) {
|
|
92
|
+
if (styles.length === 0) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const declaration = styles.join(";");
|
|
96
|
+
if (styleClassFor !== null) {
|
|
97
|
+
const generatedClass = styleClassFor.resolve(declaration);
|
|
98
|
+
let index = -1;
|
|
99
|
+
let i = 0;
|
|
100
|
+
while (i < entries.length) {
|
|
101
|
+
if (entries[i].name === "class") {
|
|
102
|
+
index = i;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
i += 1;
|
|
106
|
+
}
|
|
107
|
+
if (index >= 0 && entries[index].value !== "") {
|
|
108
|
+
entries[index].value = entries[index].value + " " + generatedClass;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
if (index >= 0) {
|
|
112
|
+
entries[index].value = generatedClass;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
entries.push({ name: "class", value: generatedClass });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
entries.push({ name: "style", value: declaration });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
static setAttribute(entries, name, value) {
|
|
124
|
+
let i = 0;
|
|
125
|
+
while (i < entries.length) {
|
|
126
|
+
if (entries[i].name === name) {
|
|
127
|
+
entries[i].value = value;
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
i += 1;
|
|
131
|
+
}
|
|
132
|
+
entries.push({ name, value });
|
|
133
|
+
}
|
|
134
|
+
static sortedAttributeEntries(entries) {
|
|
135
|
+
const copy = [];
|
|
136
|
+
let i = 0;
|
|
137
|
+
while (i < entries.length) {
|
|
138
|
+
copy.push(entries[i]);
|
|
139
|
+
i += 1;
|
|
140
|
+
}
|
|
141
|
+
let j = 1;
|
|
142
|
+
while (j < copy.length) {
|
|
143
|
+
const key = copy[j];
|
|
144
|
+
let k = j - 1;
|
|
145
|
+
while (k >= 0 && Markup.compareEntryNames(copy[k], key) > 0) {
|
|
146
|
+
copy[k + 1] = copy[k];
|
|
147
|
+
k -= 1;
|
|
148
|
+
}
|
|
149
|
+
copy[k + 1] = key;
|
|
150
|
+
j += 1;
|
|
151
|
+
}
|
|
152
|
+
return copy;
|
|
153
|
+
}
|
|
154
|
+
static serializeAttributeEntries(entries) {
|
|
155
|
+
let out = "";
|
|
156
|
+
let i = 0;
|
|
157
|
+
while (i < entries.length) {
|
|
158
|
+
if (i > 0) {
|
|
159
|
+
out += " ";
|
|
160
|
+
}
|
|
161
|
+
const e = entries[i];
|
|
162
|
+
if (e.value === "") {
|
|
163
|
+
out += e.name;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
out += e.name + "=\"" + Markup.escapeAttribute(e.value) + "\"";
|
|
167
|
+
}
|
|
168
|
+
i += 1;
|
|
169
|
+
}
|
|
170
|
+
return out;
|
|
171
|
+
}
|
|
172
|
+
static cssFamilyList(families) {
|
|
173
|
+
let out = "";
|
|
174
|
+
let i = 0;
|
|
175
|
+
while (i < families.length) {
|
|
176
|
+
if (i > 0) {
|
|
177
|
+
out += ",";
|
|
178
|
+
}
|
|
179
|
+
out += Markup.cssString(families[i]);
|
|
180
|
+
i += 1;
|
|
181
|
+
}
|
|
182
|
+
return out;
|
|
183
|
+
}
|
|
184
|
+
static renderedText(value) {
|
|
185
|
+
return new RenderedMarkupNode(Markup.escapeText(value), { kind: "Text", text: value });
|
|
186
|
+
}
|
|
187
|
+
static renderedElement(tag, entries, text, voidElement) {
|
|
188
|
+
const sorted = Markup.sortedAttributeEntries(entries);
|
|
189
|
+
const attrs = Markup.serializeAttributeEntries(sorted);
|
|
190
|
+
const open = `<${tag}${(attrs.length > 0 ? ` ${attrs}` : "")}>`;
|
|
191
|
+
if (voidElement) {
|
|
192
|
+
return new RenderedMarkupNode(open, { kind: "Element", tag, entries: sorted, children: [] });
|
|
193
|
+
}
|
|
194
|
+
const body = (text === null ? "" : Markup.escapeText((text)));
|
|
195
|
+
const html = open + body + "</" + tag + ">";
|
|
196
|
+
const children = [];
|
|
197
|
+
if (text !== null) {
|
|
198
|
+
children.push({ kind: "Text", text });
|
|
199
|
+
}
|
|
200
|
+
return new RenderedMarkupNode(html, { kind: "Element", tag, entries: sorted, children });
|
|
201
|
+
}
|
|
202
|
+
static renderedContainer(tag, entries) {
|
|
203
|
+
const sorted = Markup.sortedAttributeEntries(entries);
|
|
204
|
+
return new RenderedMarkupContainer(tag, sorted);
|
|
205
|
+
}
|
|
206
|
+
static compareEntryNames(a, b) {
|
|
207
|
+
if (a.name < b.name) {
|
|
208
|
+
return -1;
|
|
209
|
+
}
|
|
210
|
+
if (a.name > b.name) {
|
|
211
|
+
return 1;
|
|
212
|
+
}
|
|
213
|
+
return 0;
|
|
214
|
+
}
|
|
215
|
+
static roundToFiveDecimals(a) {
|
|
216
|
+
const d = doubleToI64(a);
|
|
217
|
+
const exp11 = (d.high >>> 20) & 2047;
|
|
218
|
+
const mantHigh = d.high & 1048575;
|
|
219
|
+
const low31 = d.low & 2147483647;
|
|
220
|
+
const lowHigh = d.low >>> 31;
|
|
221
|
+
let frac = Markup.timesSmall("4294967296", mantHigh);
|
|
222
|
+
if (lowHigh !== 0) {
|
|
223
|
+
frac = Markup.addDecimal(frac, "2147483648");
|
|
224
|
+
}
|
|
225
|
+
frac = Markup.addDecimal(frac, String(low31));
|
|
226
|
+
const significand = (exp11 === 0 ? frac : Markup.addDecimal("4503599627370496", frac));
|
|
227
|
+
const e = (exp11 === 0 ? -1074 : exp11 - 1075);
|
|
228
|
+
const t = e + 5;
|
|
229
|
+
if (t >= 0) {
|
|
230
|
+
return Markup.multiplyDecimal(Markup.timesSmall(significand, 3125), Markup.twoPower(t));
|
|
231
|
+
}
|
|
232
|
+
const m = -t;
|
|
233
|
+
const x = Markup.multiplyDecimal(significand, Markup.fivePower(m + 5));
|
|
234
|
+
const half = `5${Markup.zeros(m - 1)}`;
|
|
235
|
+
return Markup.truncateLast(Markup.addDecimal(x, half), m);
|
|
236
|
+
}
|
|
237
|
+
static formatFixed(n) {
|
|
238
|
+
const len = n.length;
|
|
239
|
+
if (len <= 5) {
|
|
240
|
+
return Markup.stripFractionZeros(`0.${Markup.zeros(5 - len)}${n}`);
|
|
241
|
+
}
|
|
242
|
+
const intPart = n.substr(0, len - 5);
|
|
243
|
+
const fracPart = n.substr(len - 5);
|
|
244
|
+
return Markup.stripFractionZeros(intPart + "." + fracPart);
|
|
245
|
+
}
|
|
246
|
+
static timesSmall(digits, factor) {
|
|
247
|
+
let out_b = "";
|
|
248
|
+
let carry = 0;
|
|
249
|
+
let i = digits.length - 1;
|
|
250
|
+
while (i >= 0) {
|
|
251
|
+
const product = ((Number.isNaN(digits.charCodeAt(i)) ? null : digits.charCodeAt(i)) - 48) * factor + carry;
|
|
252
|
+
out_b += String.fromCodePoint(48 + product % 10);
|
|
253
|
+
carry = Math.trunc(product / 10);
|
|
254
|
+
i -= 1;
|
|
255
|
+
}
|
|
256
|
+
while (carry > 0) {
|
|
257
|
+
out_b += String.fromCodePoint(48 + carry % 10);
|
|
258
|
+
carry = Math.trunc(carry / 10);
|
|
259
|
+
}
|
|
260
|
+
return Markup.reverse(out_b);
|
|
261
|
+
}
|
|
262
|
+
static addDecimal(a, b) {
|
|
263
|
+
let out_b = "";
|
|
264
|
+
let i = a.length - 1;
|
|
265
|
+
let j = b.length - 1;
|
|
266
|
+
let carry = 0;
|
|
267
|
+
while (i >= 0 || j >= 0 || carry > 0) {
|
|
268
|
+
const sum = (i >= 0 ? (Number.isNaN(a.charCodeAt(i)) ? null : a.charCodeAt(i)) - 48 : 0) + (j >= 0 ? (Number.isNaN(b.charCodeAt(j)) ? null : b.charCodeAt(j)) - 48 : 0) + carry;
|
|
269
|
+
out_b += String.fromCodePoint(48 + sum % 10);
|
|
270
|
+
carry = Math.trunc(sum / 10);
|
|
271
|
+
i -= 1;
|
|
272
|
+
j -= 1;
|
|
273
|
+
}
|
|
274
|
+
return Markup.reverse(out_b);
|
|
275
|
+
}
|
|
276
|
+
static multiplyDecimal(a, b) {
|
|
277
|
+
let result = "0";
|
|
278
|
+
let shift = 0;
|
|
279
|
+
let i = b.length - 1;
|
|
280
|
+
while (i >= 0) {
|
|
281
|
+
const digit = (Number.isNaN(b.charCodeAt(i)) ? null : b.charCodeAt(i)) - 48;
|
|
282
|
+
if (digit !== 0) {
|
|
283
|
+
let part = Markup.timesSmall(a, digit);
|
|
284
|
+
if (shift > 0) {
|
|
285
|
+
part += Markup.zeros(shift);
|
|
286
|
+
}
|
|
287
|
+
result = Markup.addDecimal(result, part);
|
|
288
|
+
}
|
|
289
|
+
shift += 1;
|
|
290
|
+
i -= 1;
|
|
291
|
+
}
|
|
292
|
+
return result;
|
|
293
|
+
}
|
|
294
|
+
static fivePower(k) {
|
|
295
|
+
let acc = "1";
|
|
296
|
+
for (let i = 0; i < k; i += 1) {
|
|
297
|
+
acc = Markup.timesSmall(acc, 5);
|
|
298
|
+
}
|
|
299
|
+
return acc;
|
|
300
|
+
}
|
|
301
|
+
static twoPower(k) {
|
|
302
|
+
let acc = "1";
|
|
303
|
+
for (let i = 0; i < k; i += 1) {
|
|
304
|
+
acc = Markup.timesSmall(acc, 2);
|
|
305
|
+
}
|
|
306
|
+
return acc;
|
|
307
|
+
}
|
|
308
|
+
static truncateLast(digits, m) {
|
|
309
|
+
if (digits.length <= m) {
|
|
310
|
+
return "0";
|
|
311
|
+
}
|
|
312
|
+
return digits.substr(0, digits.length - m);
|
|
313
|
+
}
|
|
314
|
+
static reverse(s) {
|
|
315
|
+
let out = "";
|
|
316
|
+
let i = s.length - 1;
|
|
317
|
+
while (i >= 0) {
|
|
318
|
+
out += s.charAt(i);
|
|
319
|
+
i -= 1;
|
|
320
|
+
}
|
|
321
|
+
return out;
|
|
322
|
+
}
|
|
323
|
+
static stripFractionZeros(s) {
|
|
324
|
+
const dot = s.indexOf(".");
|
|
325
|
+
if (dot < 0) {
|
|
326
|
+
return s;
|
|
327
|
+
}
|
|
328
|
+
let end = s.length;
|
|
329
|
+
while (end > dot + 1 && readUnit(s, end - 1) === 48) {
|
|
330
|
+
end -= 1;
|
|
331
|
+
}
|
|
332
|
+
if (end === dot + 1) {
|
|
333
|
+
return s.substr(0, dot);
|
|
334
|
+
}
|
|
335
|
+
return s.substr(0, end);
|
|
336
|
+
}
|
|
337
|
+
static zeros(n) {
|
|
338
|
+
let s = "";
|
|
339
|
+
for (let i = 0; i < n; i += 1) {
|
|
340
|
+
s += "0";
|
|
341
|
+
}
|
|
342
|
+
return s;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type AttributeEntry } from "./AttributeEntry.js";
|
|
2
|
+
export interface Text {
|
|
3
|
+
readonly kind: "Text";
|
|
4
|
+
readonly text: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Element {
|
|
7
|
+
readonly kind: "Element";
|
|
8
|
+
readonly tag: string;
|
|
9
|
+
readonly entries: AttributeEntry[];
|
|
10
|
+
readonly children: MarkupArtifact[];
|
|
11
|
+
}
|
|
12
|
+
export type MarkupArtifact = Text | Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type PreparedArtifactOptions } from "./PreparedArtifactOptions.js";
|
|
2
|
+
import { type PreparedArtifactResult } from "./PreparedArtifactResult.js";
|
|
3
|
+
import { type PreparedPlan } from "./PreparedPlan.js";
|
|
4
|
+
export declare class PreparedArtifact {
|
|
5
|
+
static renderPreparedParagraphArtifact(plan: PreparedPlan, locale: string, options: PreparedArtifactOptions): PreparedArtifactResult;
|
|
6
|
+
private static newArtifactState;
|
|
7
|
+
private static semanticContainerFor;
|
|
8
|
+
private static inlineBoxesFor;
|
|
9
|
+
private static inlineStartAt;
|
|
10
|
+
private static inlineEndAt;
|
|
11
|
+
private static rubyAt;
|
|
12
|
+
private static bopomofoAt;
|
|
13
|
+
private static semanticsFor;
|
|
14
|
+
private static crossingSpans;
|
|
15
|
+
private static renderFontFamiliesFor;
|
|
16
|
+
private static rangeContains;
|
|
17
|
+
private static pathSignature;
|
|
18
|
+
private static runChild;
|
|
19
|
+
private static inlineObjectChild;
|
|
20
|
+
private static rubyChild;
|
|
21
|
+
private static bopomofoChild;
|
|
22
|
+
}
|