@podlite/schema 0.0.82 → 0.0.84

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 (43) hide show
  1. package/CHANGELOG.podlite +24 -0
  2. package/esm/ast-inerator.js +1 -3
  3. package/esm/ast-inerator.js.map +1 -1
  4. package/esm/grammar.js +531 -416
  5. package/esm/grammar.js.map +1 -1
  6. package/esm/helpers/flatten-deep.d.ts +2 -0
  7. package/esm/helpers/flatten-deep.js +32 -0
  8. package/esm/helpers/flatten-deep.js.map +1 -0
  9. package/esm/helpers/makeInterator.js +3 -6
  10. package/esm/helpers/makeInterator.js.map +1 -1
  11. package/esm/helpers/makeTransformer.js +1 -3
  12. package/esm/helpers/makeTransformer.js.map +1 -1
  13. package/esm/index.d.ts +1 -0
  14. package/esm/index.js +1 -0
  15. package/esm/index.js.map +1 -1
  16. package/esm/pluggableParser.js +9 -4
  17. package/esm/pluggableParser.js.map +1 -1
  18. package/esm/plugin-group-items.d.ts +4 -1
  19. package/esm/plugin-group-items.js +41 -7
  20. package/esm/plugin-group-items.js.map +1 -1
  21. package/esm/plugin-tables.js +62 -17
  22. package/esm/plugin-tables.js.map +1 -1
  23. package/esm/types.d.ts +1 -1
  24. package/esm/version.d.ts +1 -1
  25. package/esm/version.js +1 -1
  26. package/lib/ast-inerator.js +2 -4
  27. package/lib/grammar.js +531 -416
  28. package/lib/helpers/flatten-deep.d.ts +2 -0
  29. package/lib/helpers/flatten-deep.js +35 -0
  30. package/lib/helpers/makeInterator.js +3 -6
  31. package/lib/helpers/makeTransformer.js +2 -4
  32. package/lib/index.d.ts +1 -0
  33. package/lib/index.js +4 -2
  34. package/lib/pluggableParser.js +9 -4
  35. package/lib/plugin-group-items.d.ts +4 -1
  36. package/lib/plugin-group-items.js +42 -7
  37. package/lib/plugin-tables.js +66 -21
  38. package/lib/types.d.ts +1 -1
  39. package/lib/version.d.ts +1 -1
  40. package/lib/version.js +1 -1
  41. package/package.json +3 -3
  42. package/schema/AstTree.json +1 -0
  43. package/schema/PodliteDocument.json +1 -0
package/CHANGELOG.podlite CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  =head1 Upcoming
4
4
 
5
+ =head1 0.0.84
6
+
7
+ =item a paragraph with thousands of markup codes is parsed and made into a document in time that grows with its length
8
+
9
+ =item the items of a long list at one level are grouped in time that grows with their number
10
+
11
+ =item a list is nested no deeper than 50 levels: deeper items stand in the 50th level with the level the author wrote, and the parser reports C<list-too-deep> once for each such list, instead of running out of stack
12
+
13
+ =item once a separator stands between two groups of table rows, each group is one row, the last one and those of a table with no header too; a table with a single group keeps a row on each line
14
+
15
+ =item a long list in an attribute value, in parentheses or in C<:allow>, is parsed in time that grows with its length; 16000 elements no longer overflow the stack
16
+
17
+ =item a table reports every row it pads or truncates, with the row's number, also next to a report about mixed separators or an attribute value that could not be read
18
+
19
+ =item a table read from a source says that the source cannot be read, is empty or is left to the renderer also next to an attribute value that could not be read; when the dropped value is the one the source needed, both are said
20
+
21
+ =head1 0.0.83
22
+
23
+ =item A table drawn with C<|> or C<+> whose rows each stand on one line splits every line by its own separators: wide spaces stay inside a cell, the empty cells between bars and at an edge bar are kept, and a plus in the text of a barred line stays text
24
+
25
+ =item C<nanoid> 3.3.20 or later instead of exactly 3.1.30: in 3.1.30 a call with a fractional size anywhere in the process left every next id the same
26
+
27
+ =item C<json-pointer> 0.6.2 or later is required: 0.6.1 let a crafted pointer pollute the prototype through C<set>; the schema only reads with C<get>
28
+
5
29
  =head1 0.0.81
6
30
 
7
31
  =item the Markdown output builds the address of a heading from the line it writes for that heading, read the way a reader of Markdown reads it, so a link reaches the heading the author named: an alias in a heading, a link inside code, a title with only a no-break space and a heading inside a block the output does not write no longer move the addresses of the headings after them. The text of a picture is not part of an address. A heading whose code holds a link to this document, and the heading it links to, are named, so the line does not depend on the address. A named anchor no longer takes the address a reader builds for another heading: it gets a number, as a repeat does; a title and a block named in capitals with an id follow the same rule, and no anchor is written where a reader builds the same address for that very heading. The schema reads these lines with C<marked>, held at one version. C<toAny> takes an optional C<prepare>, which lets an exporter walk the tree once aside before the walk
@@ -1,13 +1,11 @@
1
1
  import { makePlug, makeRule } from './helpers/makeQuery.js';
2
+ import { flattenDeep } from './helpers/flatten-deep.js';
2
3
  // skip warnings for semantic blocks
3
4
  export function isSemanticBlock(node) {
4
5
  const name = node.name || '';
5
6
  const isTypeBlock = (node.type || '') === 'block';
6
7
  return isTypeBlock && name === name.toUpperCase();
7
8
  }
8
- function flattenDeep(arr) {
9
- return arr.reduce((acc, val) => (Array.isArray(val) ? acc.concat(flattenDeep(val)) : acc.concat(val)), []);
10
- }
11
9
  export const makeInterator = rule => {
12
10
  let rules = [];
13
11
  function use(key, fn) {
@@ -1 +1 @@
1
- {"version":3,"file":"ast-inerator.js","sourceRoot":"","sources":["../src/ast-inerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACxD,oCAAoC;AACpC,MAAM,UAAU,eAAe,CAAC,IAAI;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAA;IAC5B,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,KAAK,OAAO,CAAA;IACjD,OAAO,WAAW,IAAI,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,CAAA;AACnD,CAAC;AAED,SAAS,WAAW,CAAC,GAAG;IACtB,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAC5G,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG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