@wdprlib/parser 4.0.0 → 4.2.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.
Files changed (26) hide show
  1. package/README.md +9 -1
  2. package/dist/index.cjs +345 -64
  3. package/dist/index.d.cts +121 -2
  4. package/dist/index.d.ts +121 -2
  5. package/dist/index.js +317 -36
  6. package/package.json +2 -2
  7. package/src/index.ts +9 -0
  8. package/src/parser/rules/block/module/index.ts +10 -0
  9. package/src/parser/rules/block/module/listpages/extract.ts +9 -0
  10. package/src/parser/rules/block/module/listpages/extraction/tagcloud.ts +25 -0
  11. package/src/parser/rules/block/module/listpages/types/data-requirements.ts +2 -0
  12. package/src/parser/rules/block/module/listpages/url-resolution/fields.ts +4 -4
  13. package/src/parser/rules/block/module/listpages/url-resolution/params.ts +12 -1
  14. package/src/parser/rules/block/module/listpages/url-resolution/resolve.ts +10 -1
  15. package/src/parser/rules/block/module/listpages/url-resolution/value.ts +13 -4
  16. package/src/parser/rules/block/module/mapping.ts +2 -0
  17. package/src/parser/rules/block/module/resolution/contexts.ts +29 -1
  18. package/src/parser/rules/block/module/resolution/data-maps.ts +17 -0
  19. package/src/parser/rules/block/module/resolution/dynamic-modules.ts +29 -2
  20. package/src/parser/rules/block/module/resolution/walk-resolve.ts +28 -4
  21. package/src/parser/rules/block/module/resolve.ts +11 -1
  22. package/src/parser/rules/block/module/tagcloud/index.ts +15 -0
  23. package/src/parser/rules/block/module/tagcloud/parser.ts +127 -0
  24. package/src/parser/rules/block/module/tagcloud/resolve.ts +173 -0
  25. package/src/parser/rules/block/module/tagcloud/types.ts +85 -0
  26. package/src/parser/rules/block/module/types-common.ts +15 -0
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Position as Position2, Point, Version as Version2, Element as Element7, SyntaxTree as SyntaxTree3, ContainerType, ContainerData, AttributeMap, VariableMap, Alignment, LinkType, LinkLocation, LinkLabel, PageRef as PageRef3, ImageSource, FloatAlignment, ListType, ListItem, ListData, CodeBlockData as CodeBlockData2, TabData, TableCell, TableRow, TableData, DefinitionListItem, Module as Module4, CollapsibleData, ClearFloat, AnchorTarget, HeaderType, AlignType, HeadingLevel, Heading, DateItem, Embed, TocEntry as TocEntry2, Diagnostic as Diagnostic2, DiagnosticSeverity, ParseResult as ParseResult3 } from "@wdprlib/ast";
1
+ import { Position as Position2, Point, Version as Version2, Element as Element8, SyntaxTree as SyntaxTree3, ContainerType, ContainerData, AttributeMap, VariableMap, Alignment, LinkType, LinkLocation, LinkLabel, PageRef as PageRef3, ImageSource, FloatAlignment, ListType, ListItem, ListData, CodeBlockData as CodeBlockData2, TabData, TableCell, TableRow, TableData, DefinitionListItem, Module as Module5, CollapsibleData, ClearFloat, AnchorTarget, HeaderType, AlignType, HeadingLevel, Heading, DateItem, Embed, TocEntry as TocEntry2, Diagnostic as Diagnostic2, DiagnosticSeverity, ParseResult as ParseResult3 } from "@wdprlib/ast";
2
2
  import { createPoint, createPosition, text, container, paragraph, bold, italics, heading, lineBreak, horizontalRule, link, list, listItemElements, listItemSubList } from "@wdprlib/ast";
3
3
  import { WikitextMode, WikitextSettings as WikitextSettings4 } from "@wdprlib/ast";
4
4
  import { createSettings, DEFAULT_SETTINGS } from "@wdprlib/ast";
@@ -377,6 +377,83 @@ interface ListUsersVariableContext {
377
377
  */
378
378
  type ListUsersCompiledTemplate = (ctx: ListUsersVariableContext) => string;
379
379
  /**
380
+ *
381
+ * Type definitions for the TagCloud module.
382
+ *
383
+ * The `[[module TagCloud]]` block displays a weighted cloud of page tags.
384
+ * Tag data (tag names and page counts) is supplied by the application via
385
+ * `DataProvider.fetchTagCloud` during the resolution phase.
386
+ *
387
+ * @module
388
+ */
389
+ /**
390
+ * Data requirement for a single TagCloud module instance.
391
+ *
392
+ * Produced by the extraction phase and consumed by the application to
393
+ * determine what data to fetch.
394
+ */
395
+ interface TagCloudDataRequirement {
396
+ /** Unique identifier for this module instance (sequential, 0-based) */
397
+ id: number;
398
+ /** Category filter from the module attributes, or null for all categories */
399
+ category: string | null;
400
+ /** Maximum number of tags to display (already defaulted to 50) */
401
+ limit: number;
402
+ }
403
+ /**
404
+ * A single tag entry with its weight.
405
+ */
406
+ interface TagCloudTagData {
407
+ /** The tag name */
408
+ tag: string;
409
+ /** Number of pages carrying this tag (Wikidot's "weight") */
410
+ weight: number;
411
+ }
412
+ /**
413
+ * External data provided by the application for a single TagCloud module.
414
+ *
415
+ * On success, `category` must be the **normalized** category name (Wikidot's
416
+ * `toUnixName` form, e.g. `"News Foo"` → `"news-foo"`), or null when no
417
+ * category filter applies; it is used verbatim in generated tag link URLs.
418
+ * When the requested category does not exist, return
419
+ * `{ status: "category-not-found", category }` to produce a Wikidot-compatible
420
+ * error block instead of tag links.
421
+ */
422
+ type TagCloudExternalData = {
423
+ status: "ok";
424
+ /** Tags to display (see {@link TagCloudDataFetcher} for ordering) */
425
+ tags: TagCloudTagData[];
426
+ /** Normalized category name used in link URLs, or null for all categories */
427
+ category: string | null;
428
+ } | {
429
+ status: "category-not-found";
430
+ /** The category name that could not be found, used in the error message */
431
+ category: string;
432
+ };
433
+ /**
434
+ * Callback to fetch tag data for a TagCloud module.
435
+ *
436
+ * Called during the resolution phase for each TagCloud module in the AST.
437
+ * Like Wikidot, the fetcher should apply the `category` filter and select at
438
+ * most `limit` tags ordered by weight descending (ties broken by tag name
439
+ * ascending) — this can be delegated to the database. The resolver defensively
440
+ * re-applies this ordering and the limit, then sorts the selected tags by tag
441
+ * name ascending for display.
442
+ *
443
+ * Return null/undefined to skip the module (outputs nothing). Exceptions
444
+ * thrown by the fetcher propagate out of `resolveModules()`; return
445
+ * `{ status: "category-not-found" }` (or catch errors yourself) to render an
446
+ * error instead.
447
+ *
448
+ * @security `requirement.category` originates from **untrusted user input**
449
+ * (the module's wikitext attributes). Never interpolate it into SQL — always
450
+ * use parameterised queries or prepared statements.
451
+ *
452
+ * @param requirement - The data requirement describing what data is needed
453
+ * @returns Tag data, null/undefined to skip, or a Promise of the same
454
+ */
455
+ type TagCloudDataFetcher = (requirement: TagCloudDataRequirement) => TagCloudExternalData | null | undefined | Promise<TagCloudExternalData | null | undefined>;
456
+ /**
380
457
  * Data requirement for a single ListPages module.
381
458
  */
382
459
  interface ListPagesDataRequirement {
@@ -413,6 +490,7 @@ interface ListPagesDataRequirement {
413
490
  interface DataRequirements {
414
491
  listPages: ListPagesDataRequirement[];
415
492
  listUsers: ListUsersDataRequirement[];
493
+ tagCloud: TagCloudDataRequirement[];
416
494
  }
417
495
  /**
418
496
  * User information.
@@ -760,6 +838,19 @@ interface DataProvider {
760
838
  */
761
839
  fetchInclude?: IncludeFetcher;
762
840
  /**
841
+ * Fetch tag weights for `[[module TagCloud]]` expansion.
842
+ *
843
+ * Called once per TagCloud instance with its category filter and limit.
844
+ * Unlike {@link DataProvider.getPageTags} (which returns the current
845
+ * page's own tags for `[[iftags]]`), this callback returns site-wide
846
+ * tag statistics: each tag with the number of pages carrying it.
847
+ *
848
+ * @security `requirement.category` originates from **untrusted user
849
+ * input**. Never interpolate it into SQL — always use parameterised
850
+ * queries or prepared statements.
851
+ */
852
+ fetchTagCloud?: TagCloudDataFetcher;
853
+ /**
763
854
  * Return the current page's tags for `[[iftags]]` evaluation.
764
855
  *
765
856
  * If provided, `[[iftags]]` blocks are evaluated and either kept or
@@ -952,6 +1043,33 @@ declare function isListUsersModule(module: Module3): module is ListUsersModuleDa
952
1043
  * @returns Array of AST elements produced by parsing the rendered template
953
1044
  */
954
1045
  declare function resolveListUsers(_module: ListUsersModuleData, data: ListUsersExternalData, compiledTemplate: ListUsersCompiledTemplate, parse: ParseFunction): Element6[];
1046
+ import { Element as Element7, Module as Module4 } from "@wdprlib/ast";
1047
+ /**
1048
+ * Narrowed type for the tag-cloud variant of the Module discriminated union.
1049
+ */
1050
+ type TagCloudModuleData = Extract<Module4, {
1051
+ module: "tag-cloud";
1052
+ }>;
1053
+ /**
1054
+ * Type guard to check if a Module is a tag-cloud module.
1055
+ *
1056
+ * @param module - A Module discriminated union value
1057
+ * @returns true if the module is a tag-cloud module
1058
+ */
1059
+ declare function isTagCloudModule(module: Module4): module is TagCloudModuleData;
1060
+ /**
1061
+ * Resolve a single TagCloud module by expanding fetched tag data into a
1062
+ * `div.pages-tag-cloud-box` with weighted `a.tag` anchors.
1063
+ *
1064
+ * Font sizes and colors are interpolated linearly between the module's
1065
+ * min/max values based on each tag's weight relative to the weight range of
1066
+ * the selected tags (all tags get the minimum when the range is zero).
1067
+ *
1068
+ * @param module - The tag-cloud module data from the AST
1069
+ * @param data - External tag data fetched by the application
1070
+ * @returns Array of AST elements replacing the module node
1071
+ */
1072
+ declare function resolveTagCloud(module: TagCloudModuleData, data: TagCloudExternalData): Element7[];
955
1073
  import { SyntaxTree as SyntaxTree2 } from "@wdprlib/ast";
956
1074
  /**
957
1075
  * Transform module-generated wikitext before it is parsed back into AST nodes.
@@ -989,6 +1107,7 @@ interface ResolveOptions {
989
1107
  requirements: {
990
1108
  listPages?: ListPagesDataRequirement[];
991
1109
  listUsers?: ListUsersDataRequirement[];
1110
+ tagCloud?: TagCloudDataRequirement[];
992
1111
  };
993
1112
  /**
994
1113
  * URL path for `@URL` parameter resolution (HPC / pagination support).
@@ -1036,4 +1155,4 @@ interface ResolveOptions {
1036
1155
  */
1037
1156
  declare function resolveModules(ast: SyntaxTree2, dataProvider: DataProvider, options: ResolveOptions): Promise<SyntaxTree2>;
1038
1157
  import { STYLE_SLOT_PREFIX } from "@wdprlib/ast";
1039
- export { tokenize, text, resolveModules, resolveListUsers, resolveIncludesWithTrace, resolveIncludesAsync, resolveIncludes, preprocessIftags, parseTags, parseParent, parseOrder, parseNumericSelector, parseDateSelector, parseCategory, parse, paragraph, normalizeQuery, listItemSubList, listItemElements, list, link, lineBreak, italics, isListUsersModule, horizontalRule, heading, extractListUsersVariables, extractIncludeReferences, extractDataRequirements, createToken, createSettings, createPosition, createPoint, container, compileTemplate, compileListUsersTemplate, bold, WikitextSettings4 as WikitextSettings, WikitextMode, Version2 as Version, VariableMap, VariableContext, UserInfo, TokenType, Token, TocEntry2 as TocEntry, TableRow, TableData, TableCell, TabData, SyntaxTree3 as SyntaxTree, SiteContext, STYLE_SLOT_PREFIX, ResolveOptions, ResolveIncludesTraceResult, ResolveIncludesOptions, Position2 as Position, Point, ParserOptions, Parser, ParseResult3 as ParseResult, ParseFunction, PageRef3 as PageRef, PageData, NormalizedTags, NormalizedParent, NormalizedOrder, NormalizedNumericSelector, NormalizedListPagesQuery, NormalizedDateSelector, NormalizedCategory, ModuleSourceTransform, Module4 as Module, ListUsersVariableContext, ListUsersVariable, ListUsersUserData, ListUsersExternalData, ListUsersDataRequirement, ListUsersDataFetcher, ListUsersCompiledTemplate, ListType, ListPagesVariable, ListPagesQuery, ListPagesExternalData, ListPagesDataRequirement, ListPagesDataFetcher, ListItem, ListData, LinkType, LinkLocation, LinkLabel, LexerOptions, Lexer, IncludeReference, IncludeIterationTrace, IncludeFetcher, IncludeDependency, ImageSource, HeadingLevel, Heading, HeaderType, FloatAlignment, ExtractionResult, Embed, Element7 as Element, DiagnosticSeverity, Diagnostic2 as Diagnostic, DefinitionListItem, DateItem, DataRequirements, DataProvider, DEFAULT_SETTINGS, ContainerType, ContainerData, CompiledTemplate, CollapsibleData, CodeBlockData2 as CodeBlockData, ClearFloat, AttributeMap, AsyncIncludeFetcher, AnchorTarget, Alignment, AlignType };
1158
+ export { tokenize, text, resolveTagCloud, resolveModules, resolveListUsers, resolveIncludesWithTrace, resolveIncludesAsync, resolveIncludes, preprocessIftags, parseTags, parseParent, parseOrder, parseNumericSelector, parseDateSelector, parseCategory, parse, paragraph, normalizeQuery, listItemSubList, listItemElements, list, link, lineBreak, italics, isTagCloudModule, isListUsersModule, horizontalRule, heading, extractListUsersVariables, extractIncludeReferences, extractDataRequirements, createToken, createSettings, createPosition, createPoint, container, compileTemplate, compileListUsersTemplate, bold, WikitextSettings4 as WikitextSettings, WikitextMode, Version2 as Version, VariableMap, VariableContext, UserInfo, TokenType, Token, TocEntry2 as TocEntry, TagCloudTagData, TagCloudModuleData, TagCloudExternalData, TagCloudDataRequirement, TagCloudDataFetcher, TableRow, TableData, TableCell, TabData, SyntaxTree3 as SyntaxTree, SiteContext, STYLE_SLOT_PREFIX, ResolveOptions, ResolveIncludesTraceResult, ResolveIncludesOptions, Position2 as Position, Point, ParserOptions, Parser, ParseResult3 as ParseResult, ParseFunction, PageRef3 as PageRef, PageData, NormalizedTags, NormalizedParent, NormalizedOrder, NormalizedNumericSelector, NormalizedListPagesQuery, NormalizedDateSelector, NormalizedCategory, ModuleSourceTransform, Module5 as Module, ListUsersVariableContext, ListUsersVariable, ListUsersUserData, ListUsersExternalData, ListUsersDataRequirement, ListUsersDataFetcher, ListUsersCompiledTemplate, ListType, ListPagesVariable, ListPagesQuery, ListPagesExternalData, ListPagesDataRequirement, ListPagesDataFetcher, ListItem, ListData, LinkType, LinkLocation, LinkLabel, LexerOptions, Lexer, IncludeReference, IncludeIterationTrace, IncludeFetcher, IncludeDependency, ImageSource, HeadingLevel, Heading, HeaderType, FloatAlignment, ExtractionResult, Embed, Element8 as Element, DiagnosticSeverity, Diagnostic2 as Diagnostic, DefinitionListItem, DateItem, DataRequirements, DataProvider, DEFAULT_SETTINGS, ContainerType, ContainerData, CompiledTemplate, CollapsibleData, CodeBlockData2 as CodeBlockData, ClearFloat, AttributeMap, AsyncIncludeFetcher, AnchorTarget, Alignment, AlignType };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Position as Position2, Point, Version as Version2, Element as Element7, SyntaxTree as SyntaxTree3, ContainerType, ContainerData, AttributeMap, VariableMap, Alignment, LinkType, LinkLocation, LinkLabel, PageRef as PageRef3, ImageSource, FloatAlignment, ListType, ListItem, ListData, CodeBlockData as CodeBlockData2, TabData, TableCell, TableRow, TableData, DefinitionListItem, Module as Module4, CollapsibleData, ClearFloat, AnchorTarget, HeaderType, AlignType, HeadingLevel, Heading, DateItem, Embed, TocEntry as TocEntry2, Diagnostic as Diagnostic2, DiagnosticSeverity, ParseResult as ParseResult3 } from "@wdprlib/ast";
1
+ import { Position as Position2, Point, Version as Version2, Element as Element8, SyntaxTree as SyntaxTree3, ContainerType, ContainerData, AttributeMap, VariableMap, Alignment, LinkType, LinkLocation, LinkLabel, PageRef as PageRef3, ImageSource, FloatAlignment, ListType, ListItem, ListData, CodeBlockData as CodeBlockData2, TabData, TableCell, TableRow, TableData, DefinitionListItem, Module as Module5, CollapsibleData, ClearFloat, AnchorTarget, HeaderType, AlignType, HeadingLevel, Heading, DateItem, Embed, TocEntry as TocEntry2, Diagnostic as Diagnostic2, DiagnosticSeverity, ParseResult as ParseResult3 } from "@wdprlib/ast";
2
2
  import { createPoint, createPosition, text, container, paragraph, bold, italics, heading, lineBreak, horizontalRule, link, list, listItemElements, listItemSubList } from "@wdprlib/ast";
3
3
  import { WikitextMode, WikitextSettings as WikitextSettings4 } from "@wdprlib/ast";
4
4
  import { createSettings, DEFAULT_SETTINGS } from "@wdprlib/ast";
@@ -377,6 +377,83 @@ interface ListUsersVariableContext {
377
377
  */
378
378
  type ListUsersCompiledTemplate = (ctx: ListUsersVariableContext) => string;
379
379
  /**
380
+ *
381
+ * Type definitions for the TagCloud module.
382
+ *
383
+ * The `[[module TagCloud]]` block displays a weighted cloud of page tags.
384
+ * Tag data (tag names and page counts) is supplied by the application via
385
+ * `DataProvider.fetchTagCloud` during the resolution phase.
386
+ *
387
+ * @module
388
+ */
389
+ /**
390
+ * Data requirement for a single TagCloud module instance.
391
+ *
392
+ * Produced by the extraction phase and consumed by the application to
393
+ * determine what data to fetch.
394
+ */
395
+ interface TagCloudDataRequirement {
396
+ /** Unique identifier for this module instance (sequential, 0-based) */
397
+ id: number;
398
+ /** Category filter from the module attributes, or null for all categories */
399
+ category: string | null;
400
+ /** Maximum number of tags to display (already defaulted to 50) */
401
+ limit: number;
402
+ }
403
+ /**
404
+ * A single tag entry with its weight.
405
+ */
406
+ interface TagCloudTagData {
407
+ /** The tag name */
408
+ tag: string;
409
+ /** Number of pages carrying this tag (Wikidot's "weight") */
410
+ weight: number;
411
+ }
412
+ /**
413
+ * External data provided by the application for a single TagCloud module.
414
+ *
415
+ * On success, `category` must be the **normalized** category name (Wikidot's
416
+ * `toUnixName` form, e.g. `"News Foo"` → `"news-foo"`), or null when no
417
+ * category filter applies; it is used verbatim in generated tag link URLs.
418
+ * When the requested category does not exist, return
419
+ * `{ status: "category-not-found", category }` to produce a Wikidot-compatible
420
+ * error block instead of tag links.
421
+ */
422
+ type TagCloudExternalData = {
423
+ status: "ok";
424
+ /** Tags to display (see {@link TagCloudDataFetcher} for ordering) */
425
+ tags: TagCloudTagData[];
426
+ /** Normalized category name used in link URLs, or null for all categories */
427
+ category: string | null;
428
+ } | {
429
+ status: "category-not-found";
430
+ /** The category name that could not be found, used in the error message */
431
+ category: string;
432
+ };
433
+ /**
434
+ * Callback to fetch tag data for a TagCloud module.
435
+ *
436
+ * Called during the resolution phase for each TagCloud module in the AST.
437
+ * Like Wikidot, the fetcher should apply the `category` filter and select at
438
+ * most `limit` tags ordered by weight descending (ties broken by tag name
439
+ * ascending) — this can be delegated to the database. The resolver defensively
440
+ * re-applies this ordering and the limit, then sorts the selected tags by tag
441
+ * name ascending for display.
442
+ *
443
+ * Return null/undefined to skip the module (outputs nothing). Exceptions
444
+ * thrown by the fetcher propagate out of `resolveModules()`; return
445
+ * `{ status: "category-not-found" }` (or catch errors yourself) to render an
446
+ * error instead.
447
+ *
448
+ * @security `requirement.category` originates from **untrusted user input**
449
+ * (the module's wikitext attributes). Never interpolate it into SQL — always
450
+ * use parameterised queries or prepared statements.
451
+ *
452
+ * @param requirement - The data requirement describing what data is needed
453
+ * @returns Tag data, null/undefined to skip, or a Promise of the same
454
+ */
455
+ type TagCloudDataFetcher = (requirement: TagCloudDataRequirement) => TagCloudExternalData | null | undefined | Promise<TagCloudExternalData | null | undefined>;
456
+ /**
380
457
  * Data requirement for a single ListPages module.
381
458
  */
382
459
  interface ListPagesDataRequirement {
@@ -413,6 +490,7 @@ interface ListPagesDataRequirement {
413
490
  interface DataRequirements {
414
491
  listPages: ListPagesDataRequirement[];
415
492
  listUsers: ListUsersDataRequirement[];
493
+ tagCloud: TagCloudDataRequirement[];
416
494
  }
417
495
  /**
418
496
  * User information.
@@ -760,6 +838,19 @@ interface DataProvider {
760
838
  */
761
839
  fetchInclude?: IncludeFetcher;
762
840
  /**
841
+ * Fetch tag weights for `[[module TagCloud]]` expansion.
842
+ *
843
+ * Called once per TagCloud instance with its category filter and limit.
844
+ * Unlike {@link DataProvider.getPageTags} (which returns the current
845
+ * page's own tags for `[[iftags]]`), this callback returns site-wide
846
+ * tag statistics: each tag with the number of pages carrying it.
847
+ *
848
+ * @security `requirement.category` originates from **untrusted user
849
+ * input**. Never interpolate it into SQL — always use parameterised
850
+ * queries or prepared statements.
851
+ */
852
+ fetchTagCloud?: TagCloudDataFetcher;
853
+ /**
763
854
  * Return the current page's tags for `[[iftags]]` evaluation.
764
855
  *
765
856
  * If provided, `[[iftags]]` blocks are evaluated and either kept or
@@ -952,6 +1043,33 @@ declare function isListUsersModule(module: Module3): module is ListUsersModuleDa
952
1043
  * @returns Array of AST elements produced by parsing the rendered template
953
1044
  */
954
1045
  declare function resolveListUsers(_module: ListUsersModuleData, data: ListUsersExternalData, compiledTemplate: ListUsersCompiledTemplate, parse: ParseFunction): Element6[];
1046
+ import { Element as Element7, Module as Module4 } from "@wdprlib/ast";
1047
+ /**
1048
+ * Narrowed type for the tag-cloud variant of the Module discriminated union.
1049
+ */
1050
+ type TagCloudModuleData = Extract<Module4, {
1051
+ module: "tag-cloud";
1052
+ }>;
1053
+ /**
1054
+ * Type guard to check if a Module is a tag-cloud module.
1055
+ *
1056
+ * @param module - A Module discriminated union value
1057
+ * @returns true if the module is a tag-cloud module
1058
+ */
1059
+ declare function isTagCloudModule(module: Module4): module is TagCloudModuleData;
1060
+ /**
1061
+ * Resolve a single TagCloud module by expanding fetched tag data into a
1062
+ * `div.pages-tag-cloud-box` with weighted `a.tag` anchors.
1063
+ *
1064
+ * Font sizes and colors are interpolated linearly between the module's
1065
+ * min/max values based on each tag's weight relative to the weight range of
1066
+ * the selected tags (all tags get the minimum when the range is zero).
1067
+ *
1068
+ * @param module - The tag-cloud module data from the AST
1069
+ * @param data - External tag data fetched by the application
1070
+ * @returns Array of AST elements replacing the module node
1071
+ */
1072
+ declare function resolveTagCloud(module: TagCloudModuleData, data: TagCloudExternalData): Element7[];
955
1073
  import { SyntaxTree as SyntaxTree2 } from "@wdprlib/ast";
956
1074
  /**
957
1075
  * Transform module-generated wikitext before it is parsed back into AST nodes.
@@ -989,6 +1107,7 @@ interface ResolveOptions {
989
1107
  requirements: {
990
1108
  listPages?: ListPagesDataRequirement[];
991
1109
  listUsers?: ListUsersDataRequirement[];
1110
+ tagCloud?: TagCloudDataRequirement[];
992
1111
  };
993
1112
  /**
994
1113
  * URL path for `@URL` parameter resolution (HPC / pagination support).
@@ -1036,4 +1155,4 @@ interface ResolveOptions {
1036
1155
  */
1037
1156
  declare function resolveModules(ast: SyntaxTree2, dataProvider: DataProvider, options: ResolveOptions): Promise<SyntaxTree2>;
1038
1157
  import { STYLE_SLOT_PREFIX } from "@wdprlib/ast";
1039
- export { tokenize, text, resolveModules, resolveListUsers, resolveIncludesWithTrace, resolveIncludesAsync, resolveIncludes, preprocessIftags, parseTags, parseParent, parseOrder, parseNumericSelector, parseDateSelector, parseCategory, parse, paragraph, normalizeQuery, listItemSubList, listItemElements, list, link, lineBreak, italics, isListUsersModule, horizontalRule, heading, extractListUsersVariables, extractIncludeReferences, extractDataRequirements, createToken, createSettings, createPosition, createPoint, container, compileTemplate, compileListUsersTemplate, bold, WikitextSettings4 as WikitextSettings, WikitextMode, Version2 as Version, VariableMap, VariableContext, UserInfo, TokenType, Token, TocEntry2 as TocEntry, TableRow, TableData, TableCell, TabData, SyntaxTree3 as SyntaxTree, SiteContext, STYLE_SLOT_PREFIX, ResolveOptions, ResolveIncludesTraceResult, ResolveIncludesOptions, Position2 as Position, Point, ParserOptions, Parser, ParseResult3 as ParseResult, ParseFunction, PageRef3 as PageRef, PageData, NormalizedTags, NormalizedParent, NormalizedOrder, NormalizedNumericSelector, NormalizedListPagesQuery, NormalizedDateSelector, NormalizedCategory, ModuleSourceTransform, Module4 as Module, ListUsersVariableContext, ListUsersVariable, ListUsersUserData, ListUsersExternalData, ListUsersDataRequirement, ListUsersDataFetcher, ListUsersCompiledTemplate, ListType, ListPagesVariable, ListPagesQuery, ListPagesExternalData, ListPagesDataRequirement, ListPagesDataFetcher, ListItem, ListData, LinkType, LinkLocation, LinkLabel, LexerOptions, Lexer, IncludeReference, IncludeIterationTrace, IncludeFetcher, IncludeDependency, ImageSource, HeadingLevel, Heading, HeaderType, FloatAlignment, ExtractionResult, Embed, Element7 as Element, DiagnosticSeverity, Diagnostic2 as Diagnostic, DefinitionListItem, DateItem, DataRequirements, DataProvider, DEFAULT_SETTINGS, ContainerType, ContainerData, CompiledTemplate, CollapsibleData, CodeBlockData2 as CodeBlockData, ClearFloat, AttributeMap, AsyncIncludeFetcher, AnchorTarget, Alignment, AlignType };
1158
+ export { tokenize, text, resolveTagCloud, resolveModules, resolveListUsers, resolveIncludesWithTrace, resolveIncludesAsync, resolveIncludes, preprocessIftags, parseTags, parseParent, parseOrder, parseNumericSelector, parseDateSelector, parseCategory, parse, paragraph, normalizeQuery, listItemSubList, listItemElements, list, link, lineBreak, italics, isTagCloudModule, isListUsersModule, horizontalRule, heading, extractListUsersVariables, extractIncludeReferences, extractDataRequirements, createToken, createSettings, createPosition, createPoint, container, compileTemplate, compileListUsersTemplate, bold, WikitextSettings4 as WikitextSettings, WikitextMode, Version2 as Version, VariableMap, VariableContext, UserInfo, TokenType, Token, TocEntry2 as TocEntry, TagCloudTagData, TagCloudModuleData, TagCloudExternalData, TagCloudDataRequirement, TagCloudDataFetcher, TableRow, TableData, TableCell, TabData, SyntaxTree3 as SyntaxTree, SiteContext, STYLE_SLOT_PREFIX, ResolveOptions, ResolveIncludesTraceResult, ResolveIncludesOptions, Position2 as Position, Point, ParserOptions, Parser, ParseResult3 as ParseResult, ParseFunction, PageRef3 as PageRef, PageData, NormalizedTags, NormalizedParent, NormalizedOrder, NormalizedNumericSelector, NormalizedListPagesQuery, NormalizedDateSelector, NormalizedCategory, ModuleSourceTransform, Module5 as Module, ListUsersVariableContext, ListUsersVariable, ListUsersUserData, ListUsersExternalData, ListUsersDataRequirement, ListUsersDataFetcher, ListUsersCompiledTemplate, ListType, ListPagesVariable, ListPagesQuery, ListPagesExternalData, ListPagesDataRequirement, ListPagesDataFetcher, ListItem, ListData, LinkType, LinkLocation, LinkLabel, LexerOptions, Lexer, IncludeReference, IncludeIterationTrace, IncludeFetcher, IncludeDependency, ImageSource, HeadingLevel, Heading, HeaderType, FloatAlignment, ExtractionResult, Embed, Element8 as Element, DiagnosticSeverity, Diagnostic2 as Diagnostic, DefinitionListItem, DateItem, DataRequirements, DataProvider, DEFAULT_SETTINGS, ContainerType, ContainerData, CompiledTemplate, CollapsibleData, CodeBlockData2 as CodeBlockData, ClearFloat, AttributeMap, AsyncIncludeFetcher, AnchorTarget, Alignment, AlignType };