@bendyline/squisq 2.2.0 → 2.3.1

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 (36) hide show
  1. package/NOTICE.md +21 -19
  2. package/README.md +8 -8
  3. package/THIRD_PARTY_LICENSES.txt +178 -0
  4. package/dist/{Doc-BubIpWsp.d.ts → Doc-COe-rPQB.d.ts} +6 -4
  5. package/dist/{ImageEditDoc-CGxk5CHc.d.ts → ImageEditDoc-dtKahVyD.d.ts} +1 -1
  6. package/dist/{chunk-I2O6W7DX.js → chunk-3FRUQLQR.js} +37 -13
  7. package/dist/{chunk-7ARJZYQY.js → chunk-E3RXZUNP.js} +2219 -1198
  8. package/dist/{chunk-DYPMOPIW.js → chunk-FYRWV6AJ.js} +1 -1
  9. package/dist/{chunk-FDYDYL77.js → chunk-QWCFK5FN.js} +1 -0
  10. package/dist/{chunk-CB45YGAM.js → chunk-SPTY4C6F.js} +134 -2
  11. package/dist/doc/index.d.ts +290 -7
  12. package/dist/doc/index.js +13 -4
  13. package/dist/generate/index.d.ts +1 -1
  14. package/dist/generate/index.js +0 -1
  15. package/dist/icons/index.js +0 -1
  16. package/dist/imageEdit/index.d.ts +3 -3
  17. package/dist/index.d.ts +6 -6
  18. package/dist/index.js +17 -10
  19. package/dist/jsonForm/index.d.ts +1 -1
  20. package/dist/jsonForm/index.js +1 -1
  21. package/dist/{materializePageSection-wSLA2A1g.d.ts → materializePageSection-BSMOocve.d.ts} +1 -1
  22. package/dist/narration/index.d.ts +1 -1
  23. package/dist/narration/index.js +3 -4
  24. package/dist/random/index.js +0 -1
  25. package/dist/recommend/index.js +1 -2
  26. package/dist/schemas/index.d.ts +17 -5
  27. package/dist/schemas/index.js +3 -1
  28. package/dist/{themeLibrary-DU9mUmVl.d.ts → themeLibrary-BUTWjufL.d.ts} +1 -1
  29. package/dist/timing/index.js +0 -1
  30. package/dist/transform/index.d.ts +2 -2
  31. package/package.json +7 -3
  32. package/dist/chunk-2L55443L.js +0 -0
  33. package/dist/chunk-QKPXHDLR.js +0 -0
  34. package/dist/chunk-WV5ARNDA.js +0 -0
  35. package/dist/chunk-XWNNA3KE.js +0 -0
  36. package/dist/chunk-YZNGMV3G.js +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  expectedSyllablesAt,
3
3
  wordPosAtExpectedSyllables
4
- } from "./chunk-7ARJZYQY.js";
4
+ } from "./chunk-E3RXZUNP.js";
5
5
 
6
6
  // src/narration/types.ts
7
7
  var DEFAULT_FEATURE_CONFIG = Object.freeze({
@@ -2457,6 +2457,7 @@ function pickAutoTemplate(profile, blockIndex = 0) {
2457
2457
  if (profile.hasTimeline) return "timeline";
2458
2458
  if (profile.hasTree) return "tree";
2459
2459
  if (profile.hasTable) return "dataTable";
2460
+ if (profile.hasVideo) return "videoWithCaption";
2460
2461
  if (profile.imageCount >= 2) return "photoGrid";
2461
2462
  if (profile.hasImage) return blockIndex % 2 === 0 ? "leftFeature" : "rightFeature";
2462
2463
  if (profile.hasBlockquote) return "quote";
@@ -2,6 +2,7 @@ import {
2
2
  defaultPageStyle
3
3
  } from "./chunk-2ZWIXGAC.js";
4
4
  import {
5
+ FONT_FALLBACKS,
5
6
  THEME_SCHEMA_VERSION,
6
7
  assertTheme,
7
8
  createTheme,
@@ -11,7 +12,8 @@ import {
11
12
  oklchLighten,
12
13
  oklchSetChroma,
13
14
  pickContrastingText,
14
- relativeLuminance
15
+ relativeLuminance,
16
+ resolveFontFamily
15
17
  } from "./chunk-C33GTPUZ.js";
16
18
 
17
19
  // src/schemas/Doc.ts
@@ -172,6 +174,135 @@ function serializeTheme(theme) {
172
174
  return JSON.stringify(theme, null, 2);
173
175
  }
174
176
 
177
+ // src/schemas/mermaidTheme.ts
178
+ var MERMAID_CHART_COLOR_COUNT = 12;
179
+ function uniqueColors(colors) {
180
+ return colors.filter((color, index) => color && colors.indexOf(color) === index);
181
+ }
182
+ function chartPalette(theme) {
183
+ const schemes = Object.values(theme.colorSchemes);
184
+ const seeds = uniqueColors([
185
+ theme.colors.primary,
186
+ theme.colors.secondary,
187
+ theme.colors.highlight,
188
+ ...schemes.map((scheme) => scheme.accent),
189
+ theme.colors.warning,
190
+ ...schemes.map((scheme) => scheme.bg),
191
+ theme.colors.textMuted,
192
+ theme.colors.backgroundLight
193
+ ]);
194
+ const fallback = theme.colors.primary;
195
+ return Array.from(
196
+ { length: MERMAID_CHART_COLOR_COUNT },
197
+ (_, index) => seeds[index % Math.max(1, seeds.length)] ?? fallback
198
+ );
199
+ }
200
+ function textOn(theme, background) {
201
+ return pickContrastingText(background, theme.colors.text, theme.colors.background);
202
+ }
203
+ function buildMermaidThemeVariables(theme) {
204
+ const { colors } = theme;
205
+ const primaryText = textOn(theme, colors.primary);
206
+ const secondaryText = textOn(theme, colors.secondary);
207
+ const highlightText = textOn(theme, colors.highlight);
208
+ const palette = chartPalette(theme);
209
+ const variables = {
210
+ darkMode: relativeLuminance(colors.background) < 0.5,
211
+ background: colors.background,
212
+ fontFamily: resolveFontFamily(theme.typography.bodyFont, FONT_FALLBACKS.sans),
213
+ primaryColor: colors.primary,
214
+ primaryTextColor: primaryText,
215
+ primaryBorderColor: colors.highlight,
216
+ secondaryColor: colors.secondary,
217
+ secondaryTextColor: secondaryText,
218
+ secondaryBorderColor: colors.primary,
219
+ tertiaryColor: colors.backgroundLight,
220
+ tertiaryTextColor: colors.text,
221
+ tertiaryBorderColor: colors.textMuted,
222
+ textColor: colors.text,
223
+ titleColor: colors.text,
224
+ lineColor: colors.textMuted,
225
+ arrowheadColor: colors.textMuted,
226
+ defaultLinkColor: colors.textMuted,
227
+ mainBkg: colors.primary,
228
+ nodeBkg: colors.primary,
229
+ nodeTextColor: primaryText,
230
+ nodeBorder: colors.highlight,
231
+ clusterBkg: colors.backgroundLight,
232
+ clusterBorder: colors.secondary,
233
+ edgeLabelBackground: colors.background,
234
+ actorBkg: colors.backgroundLight,
235
+ actorBorder: colors.primary,
236
+ actorTextColor: colors.text,
237
+ actorLineColor: colors.textMuted,
238
+ signalColor: colors.textMuted,
239
+ signalTextColor: colors.text,
240
+ labelBoxBkgColor: colors.backgroundLight,
241
+ labelBoxBorderColor: colors.secondary,
242
+ labelTextColor: colors.text,
243
+ loopTextColor: colors.text,
244
+ activationBkgColor: colors.secondary,
245
+ activationBorderColor: colors.primary,
246
+ sequenceNumberColor: primaryText,
247
+ noteBkgColor: colors.highlight,
248
+ noteBorderColor: colors.primary,
249
+ noteTextColor: highlightText,
250
+ sectionBkgColor: colors.backgroundLight,
251
+ altSectionBkgColor: colors.background,
252
+ sectionBkgColor2: colors.primary,
253
+ taskBkgColor: colors.primary,
254
+ taskBorderColor: colors.highlight,
255
+ taskTextColor: primaryText,
256
+ taskTextLightColor: colors.text,
257
+ taskTextDarkColor: colors.text,
258
+ taskTextOutsideColor: colors.text,
259
+ taskTextClickableColor: colors.highlight,
260
+ activeTaskBkgColor: colors.secondary,
261
+ activeTaskBorderColor: colors.highlight,
262
+ doneTaskBkgColor: colors.backgroundLight,
263
+ doneTaskBorderColor: colors.textMuted,
264
+ critBkgColor: colors.warning,
265
+ critBorderColor: colors.highlight,
266
+ todayLineColor: colors.warning,
267
+ gridColor: colors.textMuted,
268
+ pieTitleTextColor: colors.text,
269
+ pieSectionTextColor: colors.text,
270
+ pieLegendTextColor: colors.text,
271
+ pieStrokeColor: colors.background,
272
+ pieOuterStrokeColor: colors.textMuted,
273
+ quadrantPointFill: colors.highlight,
274
+ quadrantPointTextFill: highlightText,
275
+ quadrantXAxisTextFill: colors.text,
276
+ quadrantYAxisTextFill: colors.text,
277
+ quadrantTitleFill: colors.text,
278
+ requirementBackground: colors.backgroundLight,
279
+ requirementBorderColor: colors.primary,
280
+ requirementTextColor: colors.text,
281
+ relationColor: colors.textMuted,
282
+ relationLabelBackground: colors.background,
283
+ relationLabelColor: colors.text,
284
+ commitLabelColor: colors.text,
285
+ commitLabelBackground: colors.backgroundLight,
286
+ tagLabelColor: primaryText,
287
+ tagLabelBackground: colors.primary,
288
+ tagLabelBorder: colors.highlight
289
+ };
290
+ palette.forEach((color, index) => {
291
+ const label = textOn(theme, color);
292
+ variables[`cScale${index}`] = color;
293
+ variables[`cScaleInv${index}`] = label;
294
+ variables[`cScaleLabel${index}`] = label;
295
+ variables[`cScalePeer${index}`] = label;
296
+ variables[`pie${index + 1}`] = color;
297
+ if (index < 8) {
298
+ variables[`git${index}`] = color;
299
+ variables[`gitInv${index}`] = label;
300
+ variables[`gitBranchLabel${index}`] = label;
301
+ }
302
+ });
303
+ return variables;
304
+ }
305
+
175
306
  export {
176
307
  calculateDuration,
177
308
  getSegmentAtTime,
@@ -182,5 +313,6 @@ export {
182
313
  accentToColorScheme,
183
314
  compileTheme,
184
315
  parseTheme,
185
- serializeTheme
316
+ serializeTheme,
317
+ buildMermaidThemeVariables
186
318
  };