@bendyline/squisq 1.1.1 → 1.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 (35) hide show
  1. package/dist/{Doc-Cvt2lyzn.d.ts → Doc-Dwn5aHFC.d.ts} +60 -3
  2. package/dist/__tests__/dataTable.test.d.ts +2 -0
  3. package/dist/__tests__/dataTable.test.d.ts.map +1 -0
  4. package/dist/__tests__/dataTable.test.js +110 -0
  5. package/dist/__tests__/dataTable.test.js.map +1 -0
  6. package/dist/{chunk-CORGFIFU.js → chunk-KEFWM2VC.js} +1 -1
  7. package/dist/{chunk-CORGFIFU.js.map → chunk-KEFWM2VC.js.map} +1 -1
  8. package/dist/{chunk-OFU53HI7.js → chunk-QM5PKNPW.js} +1 -1
  9. package/dist/{chunk-OFU53HI7.js.map → chunk-QM5PKNPW.js.map} +1 -1
  10. package/dist/{chunk-3WBJAZZ5.js → chunk-T6WBC3ND.js} +67 -3
  11. package/dist/chunk-T6WBC3ND.js.map +1 -0
  12. package/dist/doc/templates/dataTable.d.ts +14 -0
  13. package/dist/doc/templates/dataTable.d.ts.map +1 -0
  14. package/dist/doc/templates/dataTable.js +73 -0
  15. package/dist/doc/templates/dataTable.js.map +1 -0
  16. package/dist/doc/templates/index.d.ts +1 -0
  17. package/dist/doc/templates/index.d.ts.map +1 -1
  18. package/dist/doc/templates/index.js +3 -0
  19. package/dist/doc/templates/index.js.map +1 -1
  20. package/dist/schemas/BlockTemplates.d.ts +18 -1
  21. package/dist/schemas/BlockTemplates.d.ts.map +1 -1
  22. package/dist/schemas/BlockTemplates.js.map +1 -1
  23. package/dist/schemas/Doc.d.ts +41 -1
  24. package/dist/schemas/Doc.d.ts.map +1 -1
  25. package/dist/schemas/Doc.js.map +1 -1
  26. package/dist/story/index.d.ts +17 -4
  27. package/dist/story/index.js +4 -2
  28. package/dist/{themeLibrary-VOHfPzRB.d.ts → themeLibrary-DLJtGh8-.d.ts} +1 -1
  29. package/package.json +1 -1
  30. package/src/__tests__/dataTable.test.ts +135 -0
  31. package/src/doc/templates/dataTable.ts +84 -0
  32. package/src/doc/templates/index.ts +3 -0
  33. package/src/schemas/BlockTemplates.ts +20 -1
  34. package/src/schemas/Doc.ts +43 -1
  35. package/dist/chunk-3WBJAZZ5.js.map +0 -1
@@ -8,7 +8,7 @@ import {
8
8
  isPersistentLayerTemplate,
9
9
  isTemplateBlock,
10
10
  scaledFontSize2 as scaledFontSize
11
- } from "./chunk-OFU53HI7.js";
11
+ } from "./chunk-QM5PKNPW.js";
12
12
  import {
13
13
  extractPlainText
14
14
  } from "./chunk-QWVRN6I4.js";
@@ -2393,6 +2393,68 @@ function videoPullQuote(input, context) {
2393
2393
  return layers;
2394
2394
  }
2395
2395
 
2396
+ // src/doc/templates/dataTable.ts
2397
+ function dataTable(input, context) {
2398
+ const { title, headers, rows, align, colorScheme } = input;
2399
+ const { theme } = context;
2400
+ const colors = resolveColorScheme(context, colorScheme);
2401
+ const titleFontSize = scaledFontSize(48, context, true);
2402
+ const tableFontSize = scaledFontSize(28, context, false);
2403
+ const layers = [
2404
+ createBackgroundLayer(
2405
+ "bg",
2406
+ `linear-gradient(170deg, ${theme.colors.background} 0%, #0f1520 100%)`
2407
+ )
2408
+ ];
2409
+ if (title) {
2410
+ layers.push({
2411
+ type: "text",
2412
+ id: "title",
2413
+ content: {
2414
+ text: title,
2415
+ style: {
2416
+ fontSize: titleFontSize,
2417
+ fontFamily: getThemeFont(context, "title"),
2418
+ fontWeight: "bold",
2419
+ color: theme.colors.text,
2420
+ textAlign: "center",
2421
+ shadow: true
2422
+ }
2423
+ },
2424
+ position: { x: "50%", y: "10%", width: "80%", anchor: "center" },
2425
+ animation: { type: "fadeIn", duration: 0.8 }
2426
+ });
2427
+ }
2428
+ layers.push({
2429
+ type: "table",
2430
+ id: "table",
2431
+ content: {
2432
+ headers,
2433
+ rows,
2434
+ align,
2435
+ style: {
2436
+ headerBackground: colors.accent,
2437
+ headerColor: colors.text,
2438
+ cellBackground: "rgba(255,255,255,0.05)",
2439
+ cellColor: theme.colors.text,
2440
+ borderColor: "rgba(255,255,255,0.12)",
2441
+ fontSize: tableFontSize,
2442
+ fontFamily: getThemeFont(context, "body"),
2443
+ headerFontFamily: getThemeFont(context, "title"),
2444
+ borderRadius: 8
2445
+ }
2446
+ },
2447
+ position: {
2448
+ x: "10%",
2449
+ y: title ? "18%" : "8%",
2450
+ width: "80%",
2451
+ height: title ? "74%" : "84%"
2452
+ },
2453
+ animation: { type: "fadeIn", duration: 1, delay: title ? 0.4 : 0 }
2454
+ });
2455
+ return layers;
2456
+ }
2457
+
2396
2458
  // src/doc/templates/coverBlock.ts
2397
2459
  function coverBlock(input, context) {
2398
2460
  const { heroSrc, heroAlt, title, subtitle, ambientMotion, heroCredit, heroLicense } = input;
@@ -2509,7 +2571,8 @@ var templateRegistry = {
2509
2571
  comparisonBar,
2510
2572
  pullQuote,
2511
2573
  videoWithCaption,
2512
- videoPullQuote
2574
+ videoPullQuote,
2575
+ dataTable
2513
2576
  };
2514
2577
  function expandTemplateBlock(templateBlock, context) {
2515
2578
  const templateFn = templateRegistry[templateBlock.template];
@@ -3359,6 +3422,7 @@ export {
3359
3422
  pullQuote,
3360
3423
  videoWithCaption,
3361
3424
  videoPullQuote,
3425
+ dataTable,
3362
3426
  coverBlock,
3363
3427
  expandCoverBlock,
3364
3428
  templateRegistry,
@@ -3379,4 +3443,4 @@ export {
3379
3443
  scoreTextSimilarity,
3380
3444
  resolveAudioMapping
3381
3445
  };
3382
- //# sourceMappingURL=chunk-3WBJAZZ5.js.map
3446
+ //# sourceMappingURL=chunk-T6WBC3ND.js.map