@tricoteuses/tisseuse 0.12.4 → 0.12.6

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/server.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as e, a as t, g as n, gn as r, o as i, t as a } from "./html-Ds2IZ1nn.js";
1
+ import { $ as e, a as t, g as n, gn as r, o as i, t as a } from "./html-C6wrEfXU.js";
2
2
  import * as o from "node:crypto";
3
3
  import s from "fs-extra";
4
4
  import c from "node:path";
@@ -1,6 +1,22 @@
1
1
  import { PortionSelector } from '../../../lib/extractors/article_portions.js';
2
2
  import { ActionTarget, TextAstReference } from '../../../lib/text_parsers/ast.js';
3
3
  import { FragmentPosition } from '../../../lib/text_parsers/fragments.js';
4
+ export type ActionReplacement = {
5
+ type: "text";
6
+ text: string;
7
+ } | {
8
+ type: "following_table";
9
+ };
10
+ export type ActionCitation = {
11
+ type: "citation";
12
+ text: string;
13
+ sourcePosition: FragmentPosition;
14
+ };
15
+ export type ActionTableTarget = {
16
+ type: "table";
17
+ rowIndex?: number;
18
+ columnIndex?: number;
19
+ };
4
20
  export type ActionDirective = {
5
21
  kind: "insert_after" | "insert_before";
6
22
  targetType: ActionTarget;
@@ -8,6 +24,8 @@ export type ActionDirective = {
8
24
  portionSelectors: PortionSelector[];
9
25
  targetText: string;
10
26
  insertText: string;
27
+ citation?: ActionCitation;
28
+ tableTarget?: ActionTableTarget;
11
29
  sourcePosition: FragmentPosition;
12
30
  sourceText: string;
13
31
  } | {
@@ -16,6 +34,9 @@ export type ActionDirective = {
16
34
  reference: TextAstReference;
17
35
  portionSelectors: PortionSelector[];
18
36
  replacementText: string;
37
+ replacement: ActionReplacement;
38
+ citation?: ActionCitation;
39
+ tableTarget?: ActionTableTarget;
19
40
  sourcePosition: FragmentPosition;
20
41
  sourceText: string;
21
42
  } | {
@@ -25,6 +46,8 @@ export type ActionDirective = {
25
46
  portionSelectors: PortionSelector[];
26
47
  targetText: string;
27
48
  replacementText: string;
49
+ replacement: ActionReplacement;
50
+ tableTarget?: ActionTableTarget;
28
51
  sourcePosition: FragmentPosition;
29
52
  sourceText: string;
30
53
  } | {
@@ -34,6 +57,7 @@ export type ActionDirective = {
34
57
  portionSelectors: PortionSelector[];
35
58
  targetText: string;
36
59
  occurrenceIndex?: number;
60
+ tableTarget?: ActionTableTarget;
37
61
  sourcePosition: FragmentPosition;
38
62
  sourceText: string;
39
63
  } | {
@@ -41,6 +65,7 @@ export type ActionDirective = {
41
65
  targetType: ActionTarget;
42
66
  reference: TextAstReference;
43
67
  portionSelectors: PortionSelector[];
68
+ tableTarget?: ActionTableTarget;
44
69
  sourcePosition: FragmentPosition;
45
70
  sourceText: string;
46
71
  } | {
@@ -53,6 +53,7 @@ export type ArticlePortionMatch = {
53
53
  pathEnd: ArticlePortionNode[];
54
54
  };
55
55
  export declare const ITEM_PREFIX_RE: RegExp;
56
+ export declare const BARE_ITEM_PREFIX_RE: RegExp;
56
57
  export declare function isRomanNumeral(token: string): boolean;
57
58
  export declare function buildArticlePortionTreeFromHtml(html: string): ArticlePortionArticle;
58
59
  export declare function extractPortionSelectors(reference: TextAstReference): PortionSelector[];
@@ -4,7 +4,7 @@ export { assertNever } from './asserts.js';
4
4
  export { newAssembleeObjectCache, newLegifranceObjectCache, newObjectCache, type AssembleeObjectCache, type AssembleeObjectType, type LegifranceObjectCache, type ObjectCache, } from './cache.js';
5
5
  export { formatLongDate } from './dates.js';
6
6
  export { extractBillDefinitions } from './extractors/definitions.js';
7
- export { extractActionDirectivesFromHtml, extractActionDirectivesFromText, type ActionDirective, } from './extractors/action_directives.js';
7
+ export { extractActionDirectivesFromHtml, extractActionDirectivesFromText, type ActionCitation, type ActionDirective, type ActionReplacement, type ActionTableTarget, } from './extractors/action_directives.js';
8
8
  export { extractTextLinks, iterReferenceLinks, type ArticleDefinition, type ArticleExternalLink, type ArticleInternalLink, type ArticleLink, type DefinitionOrLink, type DivisionExternalLink, type DivisionLink, type ExtractedLinkDb, type TextEuropeanLink, type TextExternalLink, type TextLink, type TextLinksParserState, } from './extractors/links.js';
9
9
  export { extractCitationReferences, extractReferences, extractReferencesWithOriginalTransformations, getExtractedReferences, getExtractedReferencesWithOriginalTransformations, } from './extractors/references.js';
10
10
  export { buildArticlePortionTreeFromHtml, extractPortionSelectors, resolvePortionSelector, type ArticlePortionArticle, type ArticlePortionDivision, type ArticlePortionItem, type ArticlePortionAlinea, type ArticlePortionMatch, type ArticlePortionNode, type PortionSelector, type PortionSelectorStep, } from './extractors/article_portions.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tricoteuses/tisseuse",
3
3
  "description": "Find links in/to French legislative documents",
4
- "version": "0.12.4",
4
+ "version": "0.12.6",
5
5
  "keywords": [
6
6
  "Assemblée nationale",
7
7
  "France",