@gmb/bitmark-parser-generator 5.26.0 → 5.27.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/dist/browser/bitmark-parser-generator.min.js +1 -1
- package/dist/browser/bundle-report.html +2 -2
- package/dist/browser/cjs/index.cjs +976 -743
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +120 -62
- package/dist/browser/esm/index.d.ts +120 -62
- package/dist/browser/esm/index.js +976 -743
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/cli/main.js +1014 -754
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +1016 -756
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +120 -62
- package/dist/index.d.ts +120 -62
- package/dist/index.js +1016 -756
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -536,6 +536,14 @@ declare const BitType: {
|
|
|
536
536
|
readonly smartStandardRemarkNonNormativeCollapsible: "smart-standard-remark-non-normative-collapsible";
|
|
537
537
|
readonly smartStandardRemarkNormative: "smart-standard-remark-normative";
|
|
538
538
|
readonly smartStandardRemarkNormativeCollapsible: "smart-standard-remark-normative-collapsible";
|
|
539
|
+
readonly smartStandardRemarkTableExtendedImageNonNormative: "smart-standard-remark-table-extended-image-non-normative";
|
|
540
|
+
readonly smartStandardRemarkTableExtendedImageNonNormativeCollapsible: "smart-standard-remark-table-extended-image-non-normative-collapsible";
|
|
541
|
+
readonly smartStandardRemarkTableExtendedImageNormative: "smart-standard-remark-table-extended-image-normative";
|
|
542
|
+
readonly smartStandardRemarkTableExtendedImageNormativeCollapsible: "smart-standard-remark-table-extended-image-normative-collapsible";
|
|
543
|
+
readonly smartStandardRemarkTableExtendedNonNormative: "smart-standard-remark-table-extended-non-normative";
|
|
544
|
+
readonly smartStandardRemarkTableExtendedNonNormativeCollapsible: "smart-standard-remark-table-extended-non-normative-collapsible";
|
|
545
|
+
readonly smartStandardRemarkTableExtendedNormative: "smart-standard-remark-table-extended-normative";
|
|
546
|
+
readonly smartStandardRemarkTableExtendedNormativeCollapsible: "smart-standard-remark-table-extended-normative-collapsible";
|
|
539
547
|
readonly smartStandardRemarkTableImageNonNormative: "smart-standard-remark-table-image-non-normative";
|
|
540
548
|
readonly smartStandardRemarkTableImageNonNormativeCollapsible: "smart-standard-remark-table-image-non-normative-collapsible";
|
|
541
549
|
readonly smartStandardRemarkTableImageNormative: "smart-standard-remark-table-image-normative";
|
|
@@ -544,6 +552,14 @@ declare const BitType: {
|
|
|
544
552
|
readonly smartStandardRemarkTableNonNormativeCollapsible: "smart-standard-remark-table-non-normative-collapsible";
|
|
545
553
|
readonly smartStandardRemarkTableNormative: "smart-standard-remark-table-normative";
|
|
546
554
|
readonly smartStandardRemarkTableNormativeCollapsible: "smart-standard-remark-table-normative-collapsible";
|
|
555
|
+
readonly smartStandardTableExtendedImageNonNormative: "smart-standard-table-extended-image-non-normative";
|
|
556
|
+
readonly smartStandardTableExtendedImageNonNormativeCollapsible: "smart-standard-table-extended-image-non-normative-collapsible";
|
|
557
|
+
readonly smartStandardTableExtendedImageNormative: "smart-standard-table-extended-image-normative";
|
|
558
|
+
readonly smartStandardTableExtendedImageNormativeCollapsible: "smart-standard-table-extended-image-normative-collapsible";
|
|
559
|
+
readonly smartStandardTableExtendedNonNormative: "smart-standard-table-extended-non-normative";
|
|
560
|
+
readonly smartStandardTableExtendedNonNormativeCollapsible: "smart-standard-table-extended-non-normative-collapsible";
|
|
561
|
+
readonly smartStandardTableExtendedNormative: "smart-standard-table-extended-normative";
|
|
562
|
+
readonly smartStandardTableExtendedNormativeCollapsible: "smart-standard-table-extended-normative-collapsible";
|
|
547
563
|
readonly smartStandardTableImageNonNormative: "smart-standard-table-image-non-normative";
|
|
548
564
|
readonly smartStandardTableImageNonNormativeCollapsible: "smart-standard-table-image-non-normative-collapsible";
|
|
549
565
|
readonly smartStandardTableImageNormative: "smart-standard-table-image-normative";
|
|
@@ -566,10 +582,18 @@ declare const BitType: {
|
|
|
566
582
|
readonly standardNoteNormative: "standard-note-normative";
|
|
567
583
|
readonly standardRemarkNonNormative: "standard-remark-non-normative";
|
|
568
584
|
readonly standardRemarkNormative: "standard-remark-normative";
|
|
585
|
+
readonly standardRemarkTableExtendedImageNonNormative: "standard-remark-table-extended-image-non-normative";
|
|
586
|
+
readonly standardRemarkTableExtendedImageNormative: "standard-remark-table-extended-image-normative";
|
|
587
|
+
readonly standardRemarkTableExtendedNonNormative: "standard-remark-table-extended-non-normative";
|
|
588
|
+
readonly standardRemarkTableExtendedNormative: "standard-remark-table-extended-normative";
|
|
569
589
|
readonly standardRemarkTableImageNonNormative: "standard-remark-table-image-non-normative";
|
|
570
590
|
readonly standardRemarkTableImageNormative: "standard-remark-table-image-normative";
|
|
571
591
|
readonly standardRemarkTableNonNormative: "standard-remark-table-non-normative";
|
|
572
592
|
readonly standardRemarkTableNormative: "standard-remark-table-normative";
|
|
593
|
+
readonly standardTableExtendedImageNonNormative: "standard-table-extended-image-non-normative";
|
|
594
|
+
readonly standardTableExtendedImageNormative: "standard-table-extended-image-normative";
|
|
595
|
+
readonly standardTableExtendedNonNormative: "standard-table-extended-non-normative";
|
|
596
|
+
readonly standardTableExtendedNormative: "standard-table-extended-normative";
|
|
573
597
|
readonly standardTableImageNonNormative: "standard-table-image-non-normative";
|
|
574
598
|
readonly standardTableImageNormative: "standard-table-image-normative";
|
|
575
599
|
readonly standardTableNonNormative: "standard-table-non-normative";
|
|
@@ -3878,6 +3902,20 @@ type CardSetConfigKeyType = EnumType<typeof CardSetConfigKey>;
|
|
|
3878
3902
|
type ExportJsonKey = null | boolean | number | string | ExportJsonKey[] | {
|
|
3879
3903
|
[k: string]: ExportJsonKey;
|
|
3880
3904
|
};
|
|
3905
|
+
/**
|
|
3906
|
+
* Key-pattern value for the HTML backend of the key-pattern language.
|
|
3907
|
+
* See crates/lib/jsonkey_parser/doc/HTML.md (design: PLAN-109).
|
|
3908
|
+
*
|
|
3909
|
+
* Structurally identical to {@link ExportJsonKey} (a recursive JSON value) — the
|
|
3910
|
+
* pattern grammar, sigils, and predicates are shared; only the leaf node model
|
|
3911
|
+
* (and HTML-specific reserved keys such as `@el` / `@attr` / `@children` /
|
|
3912
|
+
* `@text`) differ, and those are validated by the new parser's compiler, not
|
|
3913
|
+
* here. Stored verbatim in the raw configs and emitted under the field name
|
|
3914
|
+
* `htmlKey` when writing assets/config/**\/*.jsonc. Omit when absent.
|
|
3915
|
+
*/
|
|
3916
|
+
type HtmlKey = null | boolean | number | string | HtmlKey[] | {
|
|
3917
|
+
[k: string]: HtmlKey;
|
|
3918
|
+
};
|
|
3881
3919
|
|
|
3882
3920
|
declare abstract class AbstractTagConfig {
|
|
3883
3921
|
readonly type: BitTagConfigKeyTypeType;
|
|
@@ -3889,6 +3927,8 @@ declare abstract class AbstractTagConfig {
|
|
|
3889
3927
|
readonly jsonKey?: string;
|
|
3890
3928
|
readonly exportJsonKey?: ExportJsonKey;
|
|
3891
3929
|
readonly hasExportJsonKey: boolean;
|
|
3930
|
+
readonly htmlKey?: HtmlKey;
|
|
3931
|
+
readonly hasHtmlKey: boolean;
|
|
3892
3932
|
readonly deprecated?: string;
|
|
3893
3933
|
constructor(params: {
|
|
3894
3934
|
type: BitTagConfigKeyTypeType;
|
|
@@ -3900,6 +3940,8 @@ declare abstract class AbstractTagConfig {
|
|
|
3900
3940
|
jsonKey: string | undefined;
|
|
3901
3941
|
exportJsonKey: ExportJsonKey | undefined;
|
|
3902
3942
|
hasExportJsonKey: boolean;
|
|
3943
|
+
htmlKey: HtmlKey | undefined;
|
|
3944
|
+
hasHtmlKey: boolean;
|
|
3903
3945
|
deprecated: string | undefined;
|
|
3904
3946
|
});
|
|
3905
3947
|
}
|
|
@@ -3919,6 +3961,8 @@ declare class MarkupTagConfig extends AbstractTagConfig {
|
|
|
3919
3961
|
jsonKey: string | undefined;
|
|
3920
3962
|
exportJsonKey: ExportJsonKey | undefined;
|
|
3921
3963
|
hasExportJsonKey: boolean;
|
|
3964
|
+
htmlKey: HtmlKey | undefined;
|
|
3965
|
+
hasHtmlKey: boolean;
|
|
3922
3966
|
deprecated: string | undefined;
|
|
3923
3967
|
});
|
|
3924
3968
|
toString(options?: ToStringOptions$6): string;
|
|
@@ -3943,6 +3987,8 @@ declare class PropertyTagConfig extends AbstractTagConfig {
|
|
|
3943
3987
|
jsonKey: string | undefined;
|
|
3944
3988
|
exportJsonKey: ExportJsonKey | undefined;
|
|
3945
3989
|
hasExportJsonKey: boolean;
|
|
3990
|
+
htmlKey: HtmlKey | undefined;
|
|
3991
|
+
hasHtmlKey: boolean;
|
|
3946
3992
|
format: TagFormatType | undefined;
|
|
3947
3993
|
values: string[] | undefined;
|
|
3948
3994
|
defaultValue: string | undefined;
|
|
@@ -3966,6 +4012,8 @@ declare class ResourceTagConfig extends AbstractTagConfig {
|
|
|
3966
4012
|
jsonKey: string | undefined;
|
|
3967
4013
|
exportJsonKey: ExportJsonKey | undefined;
|
|
3968
4014
|
hasExportJsonKey: boolean;
|
|
4015
|
+
htmlKey: HtmlKey | undefined;
|
|
4016
|
+
hasHtmlKey: boolean;
|
|
3969
4017
|
deprecated: string | undefined;
|
|
3970
4018
|
});
|
|
3971
4019
|
toString(options?: ToStringOptions$4): string;
|
|
@@ -3989,8 +4037,10 @@ declare class CardVariantConfig {
|
|
|
3989
4037
|
readonly jsonKey?: string | null;
|
|
3990
4038
|
readonly exportJsonKey?: ExportJsonKey;
|
|
3991
4039
|
readonly hasExportJsonKey: boolean;
|
|
4040
|
+
readonly htmlKey?: HtmlKey;
|
|
4041
|
+
readonly hasHtmlKey: boolean;
|
|
3992
4042
|
readonly format?: TextFormatType;
|
|
3993
|
-
constructor(tags: TagsConfig, bodyAllowed?: boolean, bodyRequired?: boolean, repeatCount?: CountType, jsonKey?: string | null, exportJsonKey?: ExportJsonKey, hasExportJsonKey?: boolean, format?: TextFormatType);
|
|
4043
|
+
constructor(tags: TagsConfig, bodyAllowed?: boolean, bodyRequired?: boolean, repeatCount?: CountType, jsonKey?: string | null, exportJsonKey?: ExportJsonKey, hasExportJsonKey?: boolean, format?: TextFormatType, htmlKey?: HtmlKey, hasHtmlKey?: boolean);
|
|
3994
4044
|
toString(options?: ToStringOptions$3): string;
|
|
3995
4045
|
}
|
|
3996
4046
|
|
|
@@ -4004,8 +4054,10 @@ declare class CardSideConfig {
|
|
|
4004
4054
|
readonly jsonKey: string | null | undefined;
|
|
4005
4055
|
readonly exportJsonKey?: ExportJsonKey;
|
|
4006
4056
|
readonly hasExportJsonKey: boolean;
|
|
4057
|
+
readonly htmlKey?: HtmlKey;
|
|
4058
|
+
readonly hasHtmlKey: boolean;
|
|
4007
4059
|
readonly variants: CardVariantConfig[];
|
|
4008
|
-
constructor(name: string, repeat: boolean, variants: CardVariantConfig[], jsonKey?: string | null, exportJsonKey?: ExportJsonKey, hasExportJsonKey?: boolean);
|
|
4060
|
+
constructor(name: string, repeat: boolean, variants: CardVariantConfig[], jsonKey?: string | null, exportJsonKey?: ExportJsonKey, hasExportJsonKey?: boolean, htmlKey?: HtmlKey, hasHtmlKey?: boolean);
|
|
4009
4061
|
toString(options?: ToStringOptions$2): string;
|
|
4010
4062
|
}
|
|
4011
4063
|
|
|
@@ -4017,10 +4069,14 @@ interface CardSetSection {
|
|
|
4017
4069
|
jsonKey: string;
|
|
4018
4070
|
exportJsonKey?: ExportJsonKey;
|
|
4019
4071
|
hasExportJsonKey?: boolean;
|
|
4072
|
+
htmlKey?: HtmlKey;
|
|
4073
|
+
hasHtmlKey?: boolean;
|
|
4020
4074
|
isDefault?: boolean;
|
|
4021
4075
|
sideJsonKey?: string;
|
|
4022
4076
|
sideExportJsonKey?: ExportJsonKey;
|
|
4023
4077
|
hasSideExportJsonKey?: boolean;
|
|
4078
|
+
sideHtmlKey?: HtmlKey;
|
|
4079
|
+
hasSideHtmlKey?: boolean;
|
|
4024
4080
|
minCount?: number;
|
|
4025
4081
|
maxCount?: number;
|
|
4026
4082
|
}
|
|
@@ -4029,10 +4085,12 @@ declare class CardSetConfig {
|
|
|
4029
4085
|
readonly jsonKey: string | null;
|
|
4030
4086
|
readonly exportJsonKey?: ExportJsonKey;
|
|
4031
4087
|
readonly hasExportJsonKey: boolean;
|
|
4088
|
+
readonly htmlKey?: HtmlKey;
|
|
4089
|
+
readonly hasHtmlKey: boolean;
|
|
4032
4090
|
readonly sections: Record<string, CardSetSection> | undefined;
|
|
4033
4091
|
readonly sides: CardSideConfig[];
|
|
4034
4092
|
get variants(): CardVariantConfig[][];
|
|
4035
|
-
constructor(configKey: CardSetConfigKeyType, jsonKey: string | null, exportJsonKey: ExportJsonKey | undefined, hasExportJsonKey: boolean, sections: Record<string, CardSetSection> | undefined, sides: CardSideConfig[]);
|
|
4093
|
+
constructor(configKey: CardSetConfigKeyType, jsonKey: string | null, exportJsonKey: ExportJsonKey | undefined, hasExportJsonKey: boolean, sections: Record<string, CardSetSection> | undefined, sides: CardSideConfig[], htmlKey?: HtmlKey | undefined, hasHtmlKey?: boolean);
|
|
4036
4094
|
toString(options?: ToStringOptions$1): string;
|
|
4037
4095
|
}
|
|
4038
4096
|
|
|
@@ -6376,6 +6434,65 @@ declare class BitmarkParser {
|
|
|
6376
6434
|
toAst(bitmark: string, _options?: BitmarkParserOptions): BitmarkAst;
|
|
6377
6435
|
}
|
|
6378
6436
|
|
|
6437
|
+
/**
|
|
6438
|
+
* Extract HTML tables and convert them into bitmark table bit-JSON.
|
|
6439
|
+
*
|
|
6440
|
+
* Produces an array of bare `BitJson`-shaped objects (`type` = `table-extended` or `table`) that
|
|
6441
|
+
* can be fed directly into the existing JSON → AST → output pipeline. Cell content is built as
|
|
6442
|
+
* `TextAst` (rich text nodes) directly; the downstream generators handle serialisation and
|
|
6443
|
+
* breakscaping.
|
|
6444
|
+
*
|
|
6445
|
+
* See PLAN-013 for the full specification.
|
|
6446
|
+
*/
|
|
6447
|
+
|
|
6448
|
+
type HtmlTableFormat = 'table' | 'table-extended';
|
|
6449
|
+
interface HtmlTableParseOptions {
|
|
6450
|
+
/** Output bit type. Default `table-extended` (lossless). `table` is lossy. */
|
|
6451
|
+
tableFormat?: HtmlTableFormat;
|
|
6452
|
+
/** Keep unmappable tags as literal text instead of unwrapping them. Default false. */
|
|
6453
|
+
keepUnknownTags?: boolean;
|
|
6454
|
+
/** Called with a human-readable message when information is lost (e.g. lossy `table` output). */
|
|
6455
|
+
onWarning?: (message: string) => void;
|
|
6456
|
+
}
|
|
6457
|
+
/** Loosely-typed table bit JSON (matches a subset of BitJson). */
|
|
6458
|
+
interface TableBitJson {
|
|
6459
|
+
type: HtmlTableFormat;
|
|
6460
|
+
format: 'bitmark++';
|
|
6461
|
+
caption?: TextAst;
|
|
6462
|
+
table: TableJson | TableExtendedJson;
|
|
6463
|
+
}
|
|
6464
|
+
declare class HtmlTableParser {
|
|
6465
|
+
private keepUnknownTags;
|
|
6466
|
+
/**
|
|
6467
|
+
* Parse an HTML string and return one table bit per top-level `<table>`.
|
|
6468
|
+
*/
|
|
6469
|
+
parse(html: string, options?: HtmlTableParseOptions): TableBitJson[];
|
|
6470
|
+
/** Collect every `<table>` element, NOT descending into nested tables. */
|
|
6471
|
+
private collectTopLevelTables;
|
|
6472
|
+
private tableToBit;
|
|
6473
|
+
private rowToCells;
|
|
6474
|
+
private cellToJson;
|
|
6475
|
+
private widthFromCell;
|
|
6476
|
+
private isLossyAsBasic;
|
|
6477
|
+
/**
|
|
6478
|
+
* Convert a cell/li's child nodes into block-level TextAst nodes (paragraphs, lists, images).
|
|
6479
|
+
*/
|
|
6480
|
+
private blockNodes;
|
|
6481
|
+
/** Convert child nodes to a flat list of inline TextNodes, applying the given marks. */
|
|
6482
|
+
private inlineNodes;
|
|
6483
|
+
private inlineFromElement;
|
|
6484
|
+
private inlineText;
|
|
6485
|
+
private serializeOpenTag;
|
|
6486
|
+
private isListTag;
|
|
6487
|
+
private listNode;
|
|
6488
|
+
private listType;
|
|
6489
|
+
private listItemNode;
|
|
6490
|
+
private taskItemNode;
|
|
6491
|
+
private imageNode;
|
|
6492
|
+
/** Trim leading/trailing whitespace from inline content (edges only). */
|
|
6493
|
+
private trimInline;
|
|
6494
|
+
}
|
|
6495
|
+
|
|
6379
6496
|
/**
|
|
6380
6497
|
* Writer to write to a stream.
|
|
6381
6498
|
*/
|
|
@@ -6437,65 +6554,6 @@ declare class FileWriter extends StreamWriter {
|
|
|
6437
6554
|
close(): Promise<void>;
|
|
6438
6555
|
}
|
|
6439
6556
|
|
|
6440
|
-
/**
|
|
6441
|
-
* Extract HTML tables and convert them into bitmark table bit-JSON.
|
|
6442
|
-
*
|
|
6443
|
-
* Produces an array of bare `BitJson`-shaped objects (`type` = `table-extended` or `table`) that
|
|
6444
|
-
* can be fed directly into the existing JSON → AST → output pipeline. Cell content is built as
|
|
6445
|
-
* `TextAst` (rich text nodes) directly; the downstream generators handle serialisation and
|
|
6446
|
-
* breakscaping.
|
|
6447
|
-
*
|
|
6448
|
-
* See PLAN-013 for the full specification.
|
|
6449
|
-
*/
|
|
6450
|
-
|
|
6451
|
-
type HtmlTableFormat = 'table' | 'table-extended';
|
|
6452
|
-
interface HtmlTableParseOptions {
|
|
6453
|
-
/** Output bit type. Default `table-extended` (lossless). `table` is lossy. */
|
|
6454
|
-
tableFormat?: HtmlTableFormat;
|
|
6455
|
-
/** Keep unmappable tags as literal text instead of unwrapping them. Default false. */
|
|
6456
|
-
keepUnknownTags?: boolean;
|
|
6457
|
-
/** Called with a human-readable message when information is lost (e.g. lossy `table` output). */
|
|
6458
|
-
onWarning?: (message: string) => void;
|
|
6459
|
-
}
|
|
6460
|
-
/** Loosely-typed table bit JSON (matches a subset of BitJson). */
|
|
6461
|
-
interface TableBitJson {
|
|
6462
|
-
type: HtmlTableFormat;
|
|
6463
|
-
format: 'bitmark++';
|
|
6464
|
-
caption?: TextAst;
|
|
6465
|
-
table: TableJson | TableExtendedJson;
|
|
6466
|
-
}
|
|
6467
|
-
declare class HtmlTableParser {
|
|
6468
|
-
private keepUnknownTags;
|
|
6469
|
-
/**
|
|
6470
|
-
* Parse an HTML string and return one table bit per top-level `<table>`.
|
|
6471
|
-
*/
|
|
6472
|
-
parse(html: string, options?: HtmlTableParseOptions): TableBitJson[];
|
|
6473
|
-
/** Collect every `<table>` element, NOT descending into nested tables. */
|
|
6474
|
-
private collectTopLevelTables;
|
|
6475
|
-
private tableToBit;
|
|
6476
|
-
private rowToCells;
|
|
6477
|
-
private cellToJson;
|
|
6478
|
-
private widthFromCell;
|
|
6479
|
-
private isLossyAsBasic;
|
|
6480
|
-
/**
|
|
6481
|
-
* Convert a cell/li's child nodes into block-level TextAst nodes (paragraphs, lists, images).
|
|
6482
|
-
*/
|
|
6483
|
-
private blockNodes;
|
|
6484
|
-
/** Convert child nodes to a flat list of inline TextNodes, applying the given marks. */
|
|
6485
|
-
private inlineNodes;
|
|
6486
|
-
private inlineFromElement;
|
|
6487
|
-
private inlineText;
|
|
6488
|
-
private serializeOpenTag;
|
|
6489
|
-
private isListTag;
|
|
6490
|
-
private listNode;
|
|
6491
|
-
private listType;
|
|
6492
|
-
private listItemNode;
|
|
6493
|
-
private taskItemNode;
|
|
6494
|
-
private imageNode;
|
|
6495
|
-
/** Trim leading/trailing whitespace from inline content (edges only). */
|
|
6496
|
-
private trimInline;
|
|
6497
|
-
}
|
|
6498
|
-
|
|
6499
6557
|
/**
|
|
6500
6558
|
* Info options for the parser
|
|
6501
6559
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -536,6 +536,14 @@ declare const BitType: {
|
|
|
536
536
|
readonly smartStandardRemarkNonNormativeCollapsible: "smart-standard-remark-non-normative-collapsible";
|
|
537
537
|
readonly smartStandardRemarkNormative: "smart-standard-remark-normative";
|
|
538
538
|
readonly smartStandardRemarkNormativeCollapsible: "smart-standard-remark-normative-collapsible";
|
|
539
|
+
readonly smartStandardRemarkTableExtendedImageNonNormative: "smart-standard-remark-table-extended-image-non-normative";
|
|
540
|
+
readonly smartStandardRemarkTableExtendedImageNonNormativeCollapsible: "smart-standard-remark-table-extended-image-non-normative-collapsible";
|
|
541
|
+
readonly smartStandardRemarkTableExtendedImageNormative: "smart-standard-remark-table-extended-image-normative";
|
|
542
|
+
readonly smartStandardRemarkTableExtendedImageNormativeCollapsible: "smart-standard-remark-table-extended-image-normative-collapsible";
|
|
543
|
+
readonly smartStandardRemarkTableExtendedNonNormative: "smart-standard-remark-table-extended-non-normative";
|
|
544
|
+
readonly smartStandardRemarkTableExtendedNonNormativeCollapsible: "smart-standard-remark-table-extended-non-normative-collapsible";
|
|
545
|
+
readonly smartStandardRemarkTableExtendedNormative: "smart-standard-remark-table-extended-normative";
|
|
546
|
+
readonly smartStandardRemarkTableExtendedNormativeCollapsible: "smart-standard-remark-table-extended-normative-collapsible";
|
|
539
547
|
readonly smartStandardRemarkTableImageNonNormative: "smart-standard-remark-table-image-non-normative";
|
|
540
548
|
readonly smartStandardRemarkTableImageNonNormativeCollapsible: "smart-standard-remark-table-image-non-normative-collapsible";
|
|
541
549
|
readonly smartStandardRemarkTableImageNormative: "smart-standard-remark-table-image-normative";
|
|
@@ -544,6 +552,14 @@ declare const BitType: {
|
|
|
544
552
|
readonly smartStandardRemarkTableNonNormativeCollapsible: "smart-standard-remark-table-non-normative-collapsible";
|
|
545
553
|
readonly smartStandardRemarkTableNormative: "smart-standard-remark-table-normative";
|
|
546
554
|
readonly smartStandardRemarkTableNormativeCollapsible: "smart-standard-remark-table-normative-collapsible";
|
|
555
|
+
readonly smartStandardTableExtendedImageNonNormative: "smart-standard-table-extended-image-non-normative";
|
|
556
|
+
readonly smartStandardTableExtendedImageNonNormativeCollapsible: "smart-standard-table-extended-image-non-normative-collapsible";
|
|
557
|
+
readonly smartStandardTableExtendedImageNormative: "smart-standard-table-extended-image-normative";
|
|
558
|
+
readonly smartStandardTableExtendedImageNormativeCollapsible: "smart-standard-table-extended-image-normative-collapsible";
|
|
559
|
+
readonly smartStandardTableExtendedNonNormative: "smart-standard-table-extended-non-normative";
|
|
560
|
+
readonly smartStandardTableExtendedNonNormativeCollapsible: "smart-standard-table-extended-non-normative-collapsible";
|
|
561
|
+
readonly smartStandardTableExtendedNormative: "smart-standard-table-extended-normative";
|
|
562
|
+
readonly smartStandardTableExtendedNormativeCollapsible: "smart-standard-table-extended-normative-collapsible";
|
|
547
563
|
readonly smartStandardTableImageNonNormative: "smart-standard-table-image-non-normative";
|
|
548
564
|
readonly smartStandardTableImageNonNormativeCollapsible: "smart-standard-table-image-non-normative-collapsible";
|
|
549
565
|
readonly smartStandardTableImageNormative: "smart-standard-table-image-normative";
|
|
@@ -566,10 +582,18 @@ declare const BitType: {
|
|
|
566
582
|
readonly standardNoteNormative: "standard-note-normative";
|
|
567
583
|
readonly standardRemarkNonNormative: "standard-remark-non-normative";
|
|
568
584
|
readonly standardRemarkNormative: "standard-remark-normative";
|
|
585
|
+
readonly standardRemarkTableExtendedImageNonNormative: "standard-remark-table-extended-image-non-normative";
|
|
586
|
+
readonly standardRemarkTableExtendedImageNormative: "standard-remark-table-extended-image-normative";
|
|
587
|
+
readonly standardRemarkTableExtendedNonNormative: "standard-remark-table-extended-non-normative";
|
|
588
|
+
readonly standardRemarkTableExtendedNormative: "standard-remark-table-extended-normative";
|
|
569
589
|
readonly standardRemarkTableImageNonNormative: "standard-remark-table-image-non-normative";
|
|
570
590
|
readonly standardRemarkTableImageNormative: "standard-remark-table-image-normative";
|
|
571
591
|
readonly standardRemarkTableNonNormative: "standard-remark-table-non-normative";
|
|
572
592
|
readonly standardRemarkTableNormative: "standard-remark-table-normative";
|
|
593
|
+
readonly standardTableExtendedImageNonNormative: "standard-table-extended-image-non-normative";
|
|
594
|
+
readonly standardTableExtendedImageNormative: "standard-table-extended-image-normative";
|
|
595
|
+
readonly standardTableExtendedNonNormative: "standard-table-extended-non-normative";
|
|
596
|
+
readonly standardTableExtendedNormative: "standard-table-extended-normative";
|
|
573
597
|
readonly standardTableImageNonNormative: "standard-table-image-non-normative";
|
|
574
598
|
readonly standardTableImageNormative: "standard-table-image-normative";
|
|
575
599
|
readonly standardTableNonNormative: "standard-table-non-normative";
|
|
@@ -3878,6 +3902,20 @@ type CardSetConfigKeyType = EnumType<typeof CardSetConfigKey>;
|
|
|
3878
3902
|
type ExportJsonKey = null | boolean | number | string | ExportJsonKey[] | {
|
|
3879
3903
|
[k: string]: ExportJsonKey;
|
|
3880
3904
|
};
|
|
3905
|
+
/**
|
|
3906
|
+
* Key-pattern value for the HTML backend of the key-pattern language.
|
|
3907
|
+
* See crates/lib/jsonkey_parser/doc/HTML.md (design: PLAN-109).
|
|
3908
|
+
*
|
|
3909
|
+
* Structurally identical to {@link ExportJsonKey} (a recursive JSON value) — the
|
|
3910
|
+
* pattern grammar, sigils, and predicates are shared; only the leaf node model
|
|
3911
|
+
* (and HTML-specific reserved keys such as `@el` / `@attr` / `@children` /
|
|
3912
|
+
* `@text`) differ, and those are validated by the new parser's compiler, not
|
|
3913
|
+
* here. Stored verbatim in the raw configs and emitted under the field name
|
|
3914
|
+
* `htmlKey` when writing assets/config/**\/*.jsonc. Omit when absent.
|
|
3915
|
+
*/
|
|
3916
|
+
type HtmlKey = null | boolean | number | string | HtmlKey[] | {
|
|
3917
|
+
[k: string]: HtmlKey;
|
|
3918
|
+
};
|
|
3881
3919
|
|
|
3882
3920
|
declare abstract class AbstractTagConfig {
|
|
3883
3921
|
readonly type: BitTagConfigKeyTypeType;
|
|
@@ -3889,6 +3927,8 @@ declare abstract class AbstractTagConfig {
|
|
|
3889
3927
|
readonly jsonKey?: string;
|
|
3890
3928
|
readonly exportJsonKey?: ExportJsonKey;
|
|
3891
3929
|
readonly hasExportJsonKey: boolean;
|
|
3930
|
+
readonly htmlKey?: HtmlKey;
|
|
3931
|
+
readonly hasHtmlKey: boolean;
|
|
3892
3932
|
readonly deprecated?: string;
|
|
3893
3933
|
constructor(params: {
|
|
3894
3934
|
type: BitTagConfigKeyTypeType;
|
|
@@ -3900,6 +3940,8 @@ declare abstract class AbstractTagConfig {
|
|
|
3900
3940
|
jsonKey: string | undefined;
|
|
3901
3941
|
exportJsonKey: ExportJsonKey | undefined;
|
|
3902
3942
|
hasExportJsonKey: boolean;
|
|
3943
|
+
htmlKey: HtmlKey | undefined;
|
|
3944
|
+
hasHtmlKey: boolean;
|
|
3903
3945
|
deprecated: string | undefined;
|
|
3904
3946
|
});
|
|
3905
3947
|
}
|
|
@@ -3919,6 +3961,8 @@ declare class MarkupTagConfig extends AbstractTagConfig {
|
|
|
3919
3961
|
jsonKey: string | undefined;
|
|
3920
3962
|
exportJsonKey: ExportJsonKey | undefined;
|
|
3921
3963
|
hasExportJsonKey: boolean;
|
|
3964
|
+
htmlKey: HtmlKey | undefined;
|
|
3965
|
+
hasHtmlKey: boolean;
|
|
3922
3966
|
deprecated: string | undefined;
|
|
3923
3967
|
});
|
|
3924
3968
|
toString(options?: ToStringOptions$6): string;
|
|
@@ -3943,6 +3987,8 @@ declare class PropertyTagConfig extends AbstractTagConfig {
|
|
|
3943
3987
|
jsonKey: string | undefined;
|
|
3944
3988
|
exportJsonKey: ExportJsonKey | undefined;
|
|
3945
3989
|
hasExportJsonKey: boolean;
|
|
3990
|
+
htmlKey: HtmlKey | undefined;
|
|
3991
|
+
hasHtmlKey: boolean;
|
|
3946
3992
|
format: TagFormatType | undefined;
|
|
3947
3993
|
values: string[] | undefined;
|
|
3948
3994
|
defaultValue: string | undefined;
|
|
@@ -3966,6 +4012,8 @@ declare class ResourceTagConfig extends AbstractTagConfig {
|
|
|
3966
4012
|
jsonKey: string | undefined;
|
|
3967
4013
|
exportJsonKey: ExportJsonKey | undefined;
|
|
3968
4014
|
hasExportJsonKey: boolean;
|
|
4015
|
+
htmlKey: HtmlKey | undefined;
|
|
4016
|
+
hasHtmlKey: boolean;
|
|
3969
4017
|
deprecated: string | undefined;
|
|
3970
4018
|
});
|
|
3971
4019
|
toString(options?: ToStringOptions$4): string;
|
|
@@ -3989,8 +4037,10 @@ declare class CardVariantConfig {
|
|
|
3989
4037
|
readonly jsonKey?: string | null;
|
|
3990
4038
|
readonly exportJsonKey?: ExportJsonKey;
|
|
3991
4039
|
readonly hasExportJsonKey: boolean;
|
|
4040
|
+
readonly htmlKey?: HtmlKey;
|
|
4041
|
+
readonly hasHtmlKey: boolean;
|
|
3992
4042
|
readonly format?: TextFormatType;
|
|
3993
|
-
constructor(tags: TagsConfig, bodyAllowed?: boolean, bodyRequired?: boolean, repeatCount?: CountType, jsonKey?: string | null, exportJsonKey?: ExportJsonKey, hasExportJsonKey?: boolean, format?: TextFormatType);
|
|
4043
|
+
constructor(tags: TagsConfig, bodyAllowed?: boolean, bodyRequired?: boolean, repeatCount?: CountType, jsonKey?: string | null, exportJsonKey?: ExportJsonKey, hasExportJsonKey?: boolean, format?: TextFormatType, htmlKey?: HtmlKey, hasHtmlKey?: boolean);
|
|
3994
4044
|
toString(options?: ToStringOptions$3): string;
|
|
3995
4045
|
}
|
|
3996
4046
|
|
|
@@ -4004,8 +4054,10 @@ declare class CardSideConfig {
|
|
|
4004
4054
|
readonly jsonKey: string | null | undefined;
|
|
4005
4055
|
readonly exportJsonKey?: ExportJsonKey;
|
|
4006
4056
|
readonly hasExportJsonKey: boolean;
|
|
4057
|
+
readonly htmlKey?: HtmlKey;
|
|
4058
|
+
readonly hasHtmlKey: boolean;
|
|
4007
4059
|
readonly variants: CardVariantConfig[];
|
|
4008
|
-
constructor(name: string, repeat: boolean, variants: CardVariantConfig[], jsonKey?: string | null, exportJsonKey?: ExportJsonKey, hasExportJsonKey?: boolean);
|
|
4060
|
+
constructor(name: string, repeat: boolean, variants: CardVariantConfig[], jsonKey?: string | null, exportJsonKey?: ExportJsonKey, hasExportJsonKey?: boolean, htmlKey?: HtmlKey, hasHtmlKey?: boolean);
|
|
4009
4061
|
toString(options?: ToStringOptions$2): string;
|
|
4010
4062
|
}
|
|
4011
4063
|
|
|
@@ -4017,10 +4069,14 @@ interface CardSetSection {
|
|
|
4017
4069
|
jsonKey: string;
|
|
4018
4070
|
exportJsonKey?: ExportJsonKey;
|
|
4019
4071
|
hasExportJsonKey?: boolean;
|
|
4072
|
+
htmlKey?: HtmlKey;
|
|
4073
|
+
hasHtmlKey?: boolean;
|
|
4020
4074
|
isDefault?: boolean;
|
|
4021
4075
|
sideJsonKey?: string;
|
|
4022
4076
|
sideExportJsonKey?: ExportJsonKey;
|
|
4023
4077
|
hasSideExportJsonKey?: boolean;
|
|
4078
|
+
sideHtmlKey?: HtmlKey;
|
|
4079
|
+
hasSideHtmlKey?: boolean;
|
|
4024
4080
|
minCount?: number;
|
|
4025
4081
|
maxCount?: number;
|
|
4026
4082
|
}
|
|
@@ -4029,10 +4085,12 @@ declare class CardSetConfig {
|
|
|
4029
4085
|
readonly jsonKey: string | null;
|
|
4030
4086
|
readonly exportJsonKey?: ExportJsonKey;
|
|
4031
4087
|
readonly hasExportJsonKey: boolean;
|
|
4088
|
+
readonly htmlKey?: HtmlKey;
|
|
4089
|
+
readonly hasHtmlKey: boolean;
|
|
4032
4090
|
readonly sections: Record<string, CardSetSection> | undefined;
|
|
4033
4091
|
readonly sides: CardSideConfig[];
|
|
4034
4092
|
get variants(): CardVariantConfig[][];
|
|
4035
|
-
constructor(configKey: CardSetConfigKeyType, jsonKey: string | null, exportJsonKey: ExportJsonKey | undefined, hasExportJsonKey: boolean, sections: Record<string, CardSetSection> | undefined, sides: CardSideConfig[]);
|
|
4093
|
+
constructor(configKey: CardSetConfigKeyType, jsonKey: string | null, exportJsonKey: ExportJsonKey | undefined, hasExportJsonKey: boolean, sections: Record<string, CardSetSection> | undefined, sides: CardSideConfig[], htmlKey?: HtmlKey | undefined, hasHtmlKey?: boolean);
|
|
4036
4094
|
toString(options?: ToStringOptions$1): string;
|
|
4037
4095
|
}
|
|
4038
4096
|
|
|
@@ -6376,6 +6434,65 @@ declare class BitmarkParser {
|
|
|
6376
6434
|
toAst(bitmark: string, _options?: BitmarkParserOptions): BitmarkAst;
|
|
6377
6435
|
}
|
|
6378
6436
|
|
|
6437
|
+
/**
|
|
6438
|
+
* Extract HTML tables and convert them into bitmark table bit-JSON.
|
|
6439
|
+
*
|
|
6440
|
+
* Produces an array of bare `BitJson`-shaped objects (`type` = `table-extended` or `table`) that
|
|
6441
|
+
* can be fed directly into the existing JSON → AST → output pipeline. Cell content is built as
|
|
6442
|
+
* `TextAst` (rich text nodes) directly; the downstream generators handle serialisation and
|
|
6443
|
+
* breakscaping.
|
|
6444
|
+
*
|
|
6445
|
+
* See PLAN-013 for the full specification.
|
|
6446
|
+
*/
|
|
6447
|
+
|
|
6448
|
+
type HtmlTableFormat = 'table' | 'table-extended';
|
|
6449
|
+
interface HtmlTableParseOptions {
|
|
6450
|
+
/** Output bit type. Default `table-extended` (lossless). `table` is lossy. */
|
|
6451
|
+
tableFormat?: HtmlTableFormat;
|
|
6452
|
+
/** Keep unmappable tags as literal text instead of unwrapping them. Default false. */
|
|
6453
|
+
keepUnknownTags?: boolean;
|
|
6454
|
+
/** Called with a human-readable message when information is lost (e.g. lossy `table` output). */
|
|
6455
|
+
onWarning?: (message: string) => void;
|
|
6456
|
+
}
|
|
6457
|
+
/** Loosely-typed table bit JSON (matches a subset of BitJson). */
|
|
6458
|
+
interface TableBitJson {
|
|
6459
|
+
type: HtmlTableFormat;
|
|
6460
|
+
format: 'bitmark++';
|
|
6461
|
+
caption?: TextAst;
|
|
6462
|
+
table: TableJson | TableExtendedJson;
|
|
6463
|
+
}
|
|
6464
|
+
declare class HtmlTableParser {
|
|
6465
|
+
private keepUnknownTags;
|
|
6466
|
+
/**
|
|
6467
|
+
* Parse an HTML string and return one table bit per top-level `<table>`.
|
|
6468
|
+
*/
|
|
6469
|
+
parse(html: string, options?: HtmlTableParseOptions): TableBitJson[];
|
|
6470
|
+
/** Collect every `<table>` element, NOT descending into nested tables. */
|
|
6471
|
+
private collectTopLevelTables;
|
|
6472
|
+
private tableToBit;
|
|
6473
|
+
private rowToCells;
|
|
6474
|
+
private cellToJson;
|
|
6475
|
+
private widthFromCell;
|
|
6476
|
+
private isLossyAsBasic;
|
|
6477
|
+
/**
|
|
6478
|
+
* Convert a cell/li's child nodes into block-level TextAst nodes (paragraphs, lists, images).
|
|
6479
|
+
*/
|
|
6480
|
+
private blockNodes;
|
|
6481
|
+
/** Convert child nodes to a flat list of inline TextNodes, applying the given marks. */
|
|
6482
|
+
private inlineNodes;
|
|
6483
|
+
private inlineFromElement;
|
|
6484
|
+
private inlineText;
|
|
6485
|
+
private serializeOpenTag;
|
|
6486
|
+
private isListTag;
|
|
6487
|
+
private listNode;
|
|
6488
|
+
private listType;
|
|
6489
|
+
private listItemNode;
|
|
6490
|
+
private taskItemNode;
|
|
6491
|
+
private imageNode;
|
|
6492
|
+
/** Trim leading/trailing whitespace from inline content (edges only). */
|
|
6493
|
+
private trimInline;
|
|
6494
|
+
}
|
|
6495
|
+
|
|
6379
6496
|
/**
|
|
6380
6497
|
* Writer to write to a stream.
|
|
6381
6498
|
*/
|
|
@@ -6437,65 +6554,6 @@ declare class FileWriter extends StreamWriter {
|
|
|
6437
6554
|
close(): Promise<void>;
|
|
6438
6555
|
}
|
|
6439
6556
|
|
|
6440
|
-
/**
|
|
6441
|
-
* Extract HTML tables and convert them into bitmark table bit-JSON.
|
|
6442
|
-
*
|
|
6443
|
-
* Produces an array of bare `BitJson`-shaped objects (`type` = `table-extended` or `table`) that
|
|
6444
|
-
* can be fed directly into the existing JSON → AST → output pipeline. Cell content is built as
|
|
6445
|
-
* `TextAst` (rich text nodes) directly; the downstream generators handle serialisation and
|
|
6446
|
-
* breakscaping.
|
|
6447
|
-
*
|
|
6448
|
-
* See PLAN-013 for the full specification.
|
|
6449
|
-
*/
|
|
6450
|
-
|
|
6451
|
-
type HtmlTableFormat = 'table' | 'table-extended';
|
|
6452
|
-
interface HtmlTableParseOptions {
|
|
6453
|
-
/** Output bit type. Default `table-extended` (lossless). `table` is lossy. */
|
|
6454
|
-
tableFormat?: HtmlTableFormat;
|
|
6455
|
-
/** Keep unmappable tags as literal text instead of unwrapping them. Default false. */
|
|
6456
|
-
keepUnknownTags?: boolean;
|
|
6457
|
-
/** Called with a human-readable message when information is lost (e.g. lossy `table` output). */
|
|
6458
|
-
onWarning?: (message: string) => void;
|
|
6459
|
-
}
|
|
6460
|
-
/** Loosely-typed table bit JSON (matches a subset of BitJson). */
|
|
6461
|
-
interface TableBitJson {
|
|
6462
|
-
type: HtmlTableFormat;
|
|
6463
|
-
format: 'bitmark++';
|
|
6464
|
-
caption?: TextAst;
|
|
6465
|
-
table: TableJson | TableExtendedJson;
|
|
6466
|
-
}
|
|
6467
|
-
declare class HtmlTableParser {
|
|
6468
|
-
private keepUnknownTags;
|
|
6469
|
-
/**
|
|
6470
|
-
* Parse an HTML string and return one table bit per top-level `<table>`.
|
|
6471
|
-
*/
|
|
6472
|
-
parse(html: string, options?: HtmlTableParseOptions): TableBitJson[];
|
|
6473
|
-
/** Collect every `<table>` element, NOT descending into nested tables. */
|
|
6474
|
-
private collectTopLevelTables;
|
|
6475
|
-
private tableToBit;
|
|
6476
|
-
private rowToCells;
|
|
6477
|
-
private cellToJson;
|
|
6478
|
-
private widthFromCell;
|
|
6479
|
-
private isLossyAsBasic;
|
|
6480
|
-
/**
|
|
6481
|
-
* Convert a cell/li's child nodes into block-level TextAst nodes (paragraphs, lists, images).
|
|
6482
|
-
*/
|
|
6483
|
-
private blockNodes;
|
|
6484
|
-
/** Convert child nodes to a flat list of inline TextNodes, applying the given marks. */
|
|
6485
|
-
private inlineNodes;
|
|
6486
|
-
private inlineFromElement;
|
|
6487
|
-
private inlineText;
|
|
6488
|
-
private serializeOpenTag;
|
|
6489
|
-
private isListTag;
|
|
6490
|
-
private listNode;
|
|
6491
|
-
private listType;
|
|
6492
|
-
private listItemNode;
|
|
6493
|
-
private taskItemNode;
|
|
6494
|
-
private imageNode;
|
|
6495
|
-
/** Trim leading/trailing whitespace from inline content (edges only). */
|
|
6496
|
-
private trimInline;
|
|
6497
|
-
}
|
|
6498
|
-
|
|
6499
6557
|
/**
|
|
6500
6558
|
* Info options for the parser
|
|
6501
6559
|
*/
|