@bendyline/squisq 2.13.14 → 2.13.15

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 (35) hide show
  1. package/dist/{Doc-BhvotZx_.d.ts → Doc-C_Sh49ot.d.ts} +59 -6
  2. package/dist/{ImageEditDoc-D8hYio6b.d.ts → ImageEditDoc-Sqw3Tw-R.d.ts} +1 -1
  3. package/dist/{chunk-OIQ2GO2O.js → chunk-2CB37BOU.js} +1 -1
  4. package/dist/{chunk-CTT4XAGO.js → chunk-4HQ7QZKB.js} +2289 -630
  5. package/dist/chunk-C7DKMO4H.js +88 -0
  6. package/dist/{chunk-C4SB3NN4.js → chunk-DDJHIZED.js} +1 -1
  7. package/dist/{chunk-J2G6EOEJ.js → chunk-FYP7GNER.js} +72 -13
  8. package/dist/chunk-N3FQSUVT.js +515 -0
  9. package/dist/{chunk-SGNWO7OF.js → chunk-OFE5RZWW.js} +490 -24
  10. package/dist/{chunk-YQQWE4HG.js → chunk-OJCAKUHW.js} +192 -260
  11. package/dist/{chunk-7MS26OXD.js → chunk-UDPPWYYM.js} +6 -0
  12. package/dist/{chunk-5DFFVW75.js → chunk-Y34KYMAS.js} +1 -1
  13. package/dist/doc/index.d.ts +320 -22
  14. package/dist/doc/index.js +54 -8
  15. package/dist/fence/index.d.ts +1 -1
  16. package/dist/generate/index.d.ts +1 -1
  17. package/dist/imageEdit/index.d.ts +3 -3
  18. package/dist/index.d.ts +8 -8
  19. package/dist/index.js +125 -21
  20. package/dist/jsonForm/index.d.ts +1 -1
  21. package/dist/markdown/index.js +3 -3
  22. package/dist/{materializePageSection-CWxou4mX.d.ts → materializePageSection-Dmf-rf1b.d.ts} +121 -8
  23. package/dist/mediaEdit/index.d.ts +2 -2
  24. package/dist/narration/index.d.ts +1 -1
  25. package/dist/narration/index.js +4 -4
  26. package/dist/recommend/index.d.ts +129 -2
  27. package/dist/recommend/index.js +11 -3
  28. package/dist/schemas/index.d.ts +4 -4
  29. package/dist/{themeLibrary-BIYE6aLw.d.ts → themeLibrary-B4VLovhW.d.ts} +1 -1
  30. package/dist/timing/index.d.ts +66 -2
  31. package/dist/timing/index.js +12 -0
  32. package/dist/transform/index.d.ts +173 -16
  33. package/dist/transform/index.js +55 -16
  34. package/package.json +1 -1
  35. package/dist/chunk-FCB6JLWB.js +0 -125
@@ -1,26 +1,37 @@
1
1
  import {
2
+ PRESENTATION_AUTHOR_LIMITS,
3
+ PRESENTATION_SLIDE_FORMAT,
4
+ PRESENTATION_STORYBOARD_FORMAT,
5
+ addressesAModel,
2
6
  distinctiveStems,
7
+ groundPresentationBeat,
3
8
  groundingSentences,
4
9
  isGroundedParaphrase,
5
10
  isVerbatimQuote,
6
11
  normalizeGroundingText,
7
12
  numbersIn,
13
+ presentationCorrection,
14
+ presentationRetryContext,
15
+ presentationSlidePrompt,
16
+ presentationSlideRequest,
17
+ presentationSlidesToWord,
18
+ presentationStoryboardPrompt,
19
+ presentationStoryboardRequest,
20
+ presentationStoryboardTokens,
21
+ presentationUsesStoryboard,
8
22
  rangeEndOnly,
23
+ readPresentationSlideReply,
24
+ readPresentationStoryboardReply,
9
25
  restatesHeadline,
10
26
  sourceNumbers,
11
27
  spelledNumbers,
12
28
  statedRanges,
13
29
  ungroundedNumber
14
- } from "../chunk-FCB6JLWB.js";
30
+ } from "../chunk-N3FQSUVT.js";
15
31
  import {
16
- AUTHORED_PRESENTATION_LAYOUT,
17
- CONCEPT_TEMPLATES,
18
32
  DEFAULT_TRANSFORM_STYLE_ID,
19
33
  DYNAMIC_PRESENTATION_STYLE,
20
34
  PRESENTATION_HINTS_KEY,
21
- PRESENTATION_KEY,
22
- PRESENTATION_LAYOUTS,
23
- PRESENTATION_LIMITS,
24
35
  allocateTiming,
25
36
  analyzeBlocks,
26
37
  applySavedPresentation,
@@ -29,7 +40,6 @@ import {
29
40
  compilePresentationPlan,
30
41
  conceptBuildSpec,
31
42
  conceptRevealTiming,
32
- conceptTemplate,
33
43
  createPresentationPlan,
34
44
  createTransformStyleRegistry,
35
45
  defaultPresentationHints,
@@ -38,25 +48,35 @@ import {
38
48
  getTransformStyleSummaries,
39
49
  matchPointsToSentences,
40
50
  parsePresentationHints,
41
- parsePresentationPlan,
42
- presentationLayoutFits,
43
51
  presentationPassageKey,
44
52
  presentationSections,
45
- presentationStat,
46
53
  resolveTransformStyle,
47
54
  serializePresentationHints,
48
- serializePresentationPlan,
49
55
  transformNarratedSegment,
50
56
  usesDynamicPresentation
51
- } from "../chunk-YQQWE4HG.js";
52
- import "../chunk-CTT4XAGO.js";
53
- import "../chunk-SGNWO7OF.js";
57
+ } from "../chunk-OJCAKUHW.js";
58
+ import {
59
+ AUTHORED_PRESENTATION_LAYOUT,
60
+ CONCEPT_TEMPLATES,
61
+ PRESENTATION_KEY,
62
+ PRESENTATION_LAYOUTS,
63
+ PRESENTATION_LIMITS,
64
+ conceptTemplate,
65
+ parsePresentationPlan,
66
+ presentationBeatExtras,
67
+ presentationLayoutFits,
68
+ presentationLayoutNeeds,
69
+ presentationLayoutProblem,
70
+ presentationStat,
71
+ serializePresentationPlan
72
+ } from "../chunk-4HQ7QZKB.js";
73
+ import "../chunk-OFE5RZWW.js";
54
74
  import "../chunk-SVN7T6BK.js";
55
75
  import "../chunk-FUBMT6SJ.js";
56
76
  import "../chunk-JNUNNQ74.js";
57
77
  import "../chunk-L7QZORLB.js";
58
- import "../chunk-C4SB3NN4.js";
59
- import "../chunk-7MS26OXD.js";
78
+ import "../chunk-DDJHIZED.js";
79
+ import "../chunk-UDPPWYYM.js";
60
80
  import "../chunk-L3KSFLTP.js";
61
81
  import "../chunk-CZ7AUSLI.js";
62
82
  import "../chunk-P53Z4RYC.js";
@@ -68,10 +88,14 @@ export {
68
88
  CONCEPT_TEMPLATES,
69
89
  DEFAULT_TRANSFORM_STYLE_ID,
70
90
  DYNAMIC_PRESENTATION_STYLE,
91
+ PRESENTATION_AUTHOR_LIMITS,
71
92
  PRESENTATION_HINTS_KEY,
72
93
  PRESENTATION_KEY,
73
94
  PRESENTATION_LAYOUTS,
74
95
  PRESENTATION_LIMITS,
96
+ PRESENTATION_SLIDE_FORMAT,
97
+ PRESENTATION_STORYBOARD_FORMAT,
98
+ addressesAModel,
75
99
  allocateTiming,
76
100
  analyzeBlocks,
77
101
  applySavedPresentation,
@@ -88,6 +112,7 @@ export {
88
112
  extractDocImages,
89
113
  getTransformStyleIds,
90
114
  getTransformStyleSummaries,
115
+ groundPresentationBeat,
91
116
  groundingSentences,
92
117
  isGroundedParaphrase,
93
118
  isVerbatimQuote,
@@ -96,11 +121,25 @@ export {
96
121
  numbersIn,
97
122
  parsePresentationHints,
98
123
  parsePresentationPlan,
124
+ presentationBeatExtras,
125
+ presentationCorrection,
99
126
  presentationLayoutFits,
127
+ presentationLayoutNeeds,
128
+ presentationLayoutProblem,
100
129
  presentationPassageKey,
130
+ presentationRetryContext,
101
131
  presentationSections,
132
+ presentationSlidePrompt,
133
+ presentationSlideRequest,
134
+ presentationSlidesToWord,
102
135
  presentationStat,
136
+ presentationStoryboardPrompt,
137
+ presentationStoryboardRequest,
138
+ presentationStoryboardTokens,
139
+ presentationUsesStoryboard,
103
140
  rangeEndOnly,
141
+ readPresentationSlideReply,
142
+ readPresentationStoryboardReply,
104
143
  resolveTransformStyle,
105
144
  restatesHeadline,
106
145
  serializePresentationHints,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq",
3
- "version": "2.13.14",
3
+ "version": "2.13.15",
4
4
  "description": "Headless utilities for doc/block rendering, spatial math, Markdown, and storage",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -1,125 +0,0 @@
1
- // src/transform/grounding.ts
2
- var NUMBER = /\d[\d,]*(?:\.\d+)?/gu;
3
- function normalizeGroundingText(text) {
4
- return text.toLowerCase().replace(/[‘’ʼ`]/gu, "'").replace(/[“”]/gu, '"').replace(/[–—]/gu, "-").replace(/[^a-z0-9'%\s-]/gu, " ").replace(/\s+/gu, " ").trim();
5
- }
6
- function numbersIn(value) {
7
- if (typeof value === "number") return Number.isFinite(value) ? [String(value)] : [];
8
- return (value.match(NUMBER) ?? []).map((number) => number.replace(/,/gu, ""));
9
- }
10
- var UNIT_WORDS = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine"];
11
- var TEEN_WORDS = [
12
- "ten",
13
- "eleven",
14
- "twelve",
15
- "thirteen",
16
- "fourteen",
17
- "fifteen",
18
- "sixteen",
19
- "seventeen",
20
- "eighteen",
21
- "nineteen"
22
- ];
23
- var TENS_WORDS = ["twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"];
24
- var NUMBER_WORD = new RegExp(
25
- `\\b(?:(${TENS_WORDS.join("|")})(?:[-\\s](${UNIT_WORDS.join("|")}))?|(${[...UNIT_WORDS.slice(1), ...TEEN_WORDS].join("|")}))\\b`,
26
- "giu"
27
- );
28
- function spelledNumbers(source) {
29
- return [...source.matchAll(NUMBER_WORD)].map((match) => {
30
- const [, tens, unit, small] = match;
31
- const value = small ? [...UNIT_WORDS, ...TEEN_WORDS].indexOf(small.toLowerCase()) + 1 : (TENS_WORDS.indexOf(tens.toLowerCase()) + 2) * 10 + (unit ? UNIT_WORDS.indexOf(unit.toLowerCase()) + 1 : 0);
32
- return { value: String(value), index: match.index };
33
- });
34
- }
35
- function sourceNumbers(source) {
36
- return /* @__PURE__ */ new Set([...numbersIn(source), ...spelledNumbers(source).map(({ value }) => value)]);
37
- }
38
- function ungroundedNumber(values, source) {
39
- const stated = typeof source === "string" ? sourceNumbers(source) : source;
40
- const list = Array.isArray(values) ? values : [values];
41
- for (const value of list) {
42
- const missing = numbersIn(value).find((number) => !stated.has(number));
43
- if (missing !== void 0) return missing;
44
- }
45
- return void 0;
46
- }
47
- function groundingSentences(text) {
48
- return (text.match(/[^.!?\n]+[.!?]*/gu) ?? []).map((sentence) => sentence.trim()).filter(Boolean);
49
- }
50
- function isVerbatimQuote(quote, source, options = {}) {
51
- const q = normalizeGroundingText(quote);
52
- if (!q) return false;
53
- if (normalizeGroundingText(source).includes(q)) return true;
54
- const words = q.split(" ").filter((word) => word.length > 1);
55
- if (words.length === 0) return false;
56
- const minShare = options.minShare ?? 0.9;
57
- for (const sentence of options.sentences ?? groundingSentences(source)) {
58
- const present = new Set(normalizeGroundingText(sentence).split(" "));
59
- const hits = words.filter((word) => present.has(word)).length;
60
- if (hits / words.length >= minShare) return true;
61
- }
62
- return false;
63
- }
64
- var COMMON = new Set(
65
- "about after also because been before being both could does each from have into just like more most much only other over same should some such than that their them then there these they this those through very what when where which while will with would your ours".split(
66
- " "
67
- )
68
- );
69
- function distinctiveStems(text) {
70
- return (text.toLowerCase().replace(/[‘’]/gu, "'").replace(/[“”]/gu, '"').replace(/[‐‑]/gu, "-").replace(/[‒–—―]/gu, " ").match(/[\p{L}\p{N}][\p{L}\p{N}'-]*/gu) ?? []).filter((word) => word.length >= 4 && !COMMON.has(word)).map((word) => word.slice(0, 4));
71
- }
72
- function isGroundedParaphrase(text, source, options = {}) {
73
- if (ungroundedNumber(text, source) !== void 0) return false;
74
- const stems = new Set(distinctiveStems(source));
75
- const words = distinctiveStems(text);
76
- const minShare = options.minShare ?? 2 / 3;
77
- return words.filter((word) => stems.has(word)).length >= Math.ceil(words.length * minShare);
78
- }
79
- function restatesHeadline(point, headline) {
80
- const title = distinctiveStems(headline);
81
- const words = distinctiveStems(point);
82
- const shared = words.filter((word) => title.includes(word)).length;
83
- return words.length > 0 && shared >= words.length * 0.6 || title.length >= 3 && title.every((word) => words.includes(word));
84
- }
85
- var RANGE = /(?:\bbetween\s+(\d[\d,]*(?:\.\d+)?)\s+and\s+(\d[\d,]*(?:\.\d+)?))|(?:(\d[\d,]*(?:\.\d+)?)\s*(?:[-–—]|\bto\b)\s*(\d[\d,]*(?:\.\d+)?))/giu;
86
- function statedRanges(source) {
87
- return [...source.matchAll(RANGE)].map((match) => ({
88
- low: (match[1] ?? match[3]).replace(/,/gu, ""),
89
- high: (match[2] ?? match[4]).replace(/,/gu, ""),
90
- text: match[0],
91
- index: match.index
92
- }));
93
- }
94
- function rangeEndOnly(value, source) {
95
- const [number] = numbersIn(value);
96
- if (number === void 0) return void 0;
97
- const ranges = statedRanges(source);
98
- if (ranges.length === 0) return void 0;
99
- if (spelledNumbers(source).some((spelled) => spelled.value === number)) return void 0;
100
- let first;
101
- for (const match of source.matchAll(NUMBER)) {
102
- if (match[0].replace(/,/gu, "") !== number) continue;
103
- const range = ranges.find(
104
- (candidate) => match.index >= candidate.index && match.index < candidate.index + candidate.text.length
105
- );
106
- if (!range) return void 0;
107
- first ?? (first = range);
108
- }
109
- return first;
110
- }
111
-
112
- export {
113
- normalizeGroundingText,
114
- numbersIn,
115
- spelledNumbers,
116
- sourceNumbers,
117
- ungroundedNumber,
118
- groundingSentences,
119
- isVerbatimQuote,
120
- distinctiveStems,
121
- isGroundedParaphrase,
122
- restatesHeadline,
123
- statedRanges,
124
- rangeEndOnly
125
- };