@ai-matrx/print 0.12.22 → 0.12.24

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.
@@ -259,6 +259,174 @@ function mathTextHtml(text) {
259
259
  });
260
260
  }
261
261
 
262
+ // src/flashcards-meta.ts
263
+ var flashcardsPrinterMeta = {
264
+ label: "Print flashcards",
265
+ variants: [
266
+ {
267
+ id: "portrait-6up-duplex",
268
+ label: "Portrait 6-up \u2014 duplex (recommended)",
269
+ description: "6 cards per page (2 columns \xD7 3 rows), portrait. Split down the middle and into thirds. Fronts and backs on alternating pages \u2014 backs are mirrored so they align perfectly when duplex-printed (flip on long edge) and cut into 6"
270
+ },
271
+ {
272
+ id: "portrait-6up-stacked",
273
+ label: "Portrait 6-up \u2014 all fronts then all backs",
274
+ description: "6 cards per page (2 columns \xD7 3 rows), portrait. All front pages first, then all back pages \u2014 cut all sheets together for a matching deck"
275
+ },
276
+ {
277
+ id: "landscape-duplex",
278
+ label: "Landscape cut sheet \u2014 duplex (double-sided)",
279
+ description: "4 cards per page, landscape. Fronts and backs on alternating pages \u2014 backs are mirrored so they align perfectly when you flip and cut"
280
+ },
281
+ {
282
+ id: "landscape-stacked",
283
+ label: "Landscape cut sheet \u2014 all fronts then all backs",
284
+ description: "4 cards per page, landscape. All front pages first, then all back pages \u2014 cut all sheets together for a matching deck"
285
+ },
286
+ {
287
+ id: "avery-5388",
288
+ label: 'Avery 5388 \u2014 3\xD75" index cards (3 per page)',
289
+ description: "Prints to Avery 5388 card stock. 3 cards per page, portrait. Front page then back page per set of 3 \u2014 load the sheet twice to print both sides"
290
+ },
291
+ {
292
+ id: "cut-cards",
293
+ label: "Cut-out cards (portrait)",
294
+ description: "4 per page with cut lines \u2014 front and back shown together per card"
295
+ },
296
+ {
297
+ id: "both-sides",
298
+ label: "Both sides per card",
299
+ description: "Front and back shown together \u2014 best for review or sharing"
300
+ },
301
+ {
302
+ id: "study-sheet",
303
+ label: "Study sheet (table)",
304
+ description: "Compact two-column table \u2014 all cards on one or two pages"
305
+ },
306
+ {
307
+ id: "front-only",
308
+ label: "Questions only (self-test)",
309
+ description: "Front side with blank space to write answers \u2014 print and quiz yourself"
310
+ },
311
+ {
312
+ id: "back-only",
313
+ label: "Answers only",
314
+ description: "Definitions / answers without the questions"
315
+ }
316
+ ],
317
+ settings: [
318
+ {
319
+ type: "range",
320
+ id: "cardRange",
321
+ label: "Cards to print",
322
+ description: "Leave blank to print the whole deck",
323
+ fromId: "fromCard",
324
+ toId: "toCard",
325
+ defaultFrom: 0,
326
+ defaultTo: 0,
327
+ min: 1,
328
+ fromPlaceholder: "1",
329
+ toPlaceholder: "end"
330
+ },
331
+ {
332
+ type: "boolean",
333
+ id: "showSideLabel",
334
+ label: "Show side label",
335
+ description: 'Prints "Front" or "Back" in the corner of each card',
336
+ defaultValue: false,
337
+ appliesTo: [
338
+ "landscape-duplex",
339
+ "landscape-stacked",
340
+ "portrait-6up-duplex",
341
+ "portrait-6up-stacked",
342
+ "avery-5388"
343
+ ]
344
+ },
345
+ {
346
+ type: "boolean",
347
+ id: "showCardNumber",
348
+ label: "Show card number",
349
+ description: "Prints #1, #2 \u2026 in the corner of each card",
350
+ defaultValue: false,
351
+ appliesTo: [
352
+ "landscape-duplex",
353
+ "landscape-stacked",
354
+ "portrait-6up-duplex",
355
+ "portrait-6up-stacked",
356
+ "avery-5388"
357
+ ]
358
+ },
359
+ {
360
+ type: "boolean",
361
+ id: "showTickMarks",
362
+ label: "Show cut tick marks",
363
+ description: "Small marks at each cut intersection \u2014 where to make each cut",
364
+ defaultValue: false,
365
+ appliesTo: [
366
+ "landscape-duplex",
367
+ "landscape-stacked",
368
+ "portrait-6up-duplex",
369
+ "portrait-6up-stacked"
370
+ ]
371
+ },
372
+ {
373
+ type: "boolean",
374
+ id: "showCutLines",
375
+ label: "Show full cut lines",
376
+ description: "Dashed lines all the way across the page \u2014 helps if you don't have a ruler",
377
+ defaultValue: false,
378
+ appliesTo: [
379
+ "landscape-duplex",
380
+ "landscape-stacked",
381
+ "portrait-6up-duplex",
382
+ "portrait-6up-stacked"
383
+ ]
384
+ },
385
+ {
386
+ type: "boolean",
387
+ id: "lightBackText",
388
+ label: "Light back text (reduce show-through)",
389
+ description: "Prints the back side in dark gray instead of black \u2014 ink is lighter and less visible through the paper",
390
+ defaultValue: false,
391
+ appliesTo: [
392
+ "landscape-duplex",
393
+ "landscape-stacked",
394
+ "portrait-6up-duplex",
395
+ "portrait-6up-stacked",
396
+ "avery-5388"
397
+ ]
398
+ },
399
+ {
400
+ type: "boolean",
401
+ id: "mirrorBack",
402
+ label: "Mirror back text (best show-through prevention)",
403
+ description: "Flips back text horizontally \u2014 any ink that bleeds through reads backwards and is unrecognizable from the front",
404
+ defaultValue: false,
405
+ appliesTo: [
406
+ "landscape-duplex",
407
+ "landscape-stacked",
408
+ "portrait-6up-duplex",
409
+ "portrait-6up-stacked",
410
+ "avery-5388"
411
+ ]
412
+ },
413
+ {
414
+ type: "boolean",
415
+ id: "showImages",
416
+ label: "Print face images",
417
+ description: "Includes each card's front/back image when it has one. The fixed-geometry formats (landscape, 6-up, Avery) are text-only by design",
418
+ defaultValue: true,
419
+ appliesTo: [
420
+ "cut-cards",
421
+ "both-sides",
422
+ "study-sheet",
423
+ "front-only",
424
+ "back-only"
425
+ ]
426
+ }
427
+ ]
428
+ };
429
+
262
430
  // src/flashcards.ts
263
431
  var import_html_escape3 = require("@ai-matrx/kit/html-escape");
264
432
  var SETTING_DEFAULTS = {
@@ -1535,170 +1703,7 @@ function deriveTitle(data) {
1535
1703
  return "Flashcards";
1536
1704
  }
1537
1705
  var flashcardsPrinter = {
1538
- label: "Print flashcards",
1539
- variants: [
1540
- {
1541
- id: "portrait-6up-duplex",
1542
- label: "Portrait 6-up \u2014 duplex (recommended)",
1543
- description: "6 cards per page (2 columns \xD7 3 rows), portrait. Split down the middle and into thirds. Fronts and backs on alternating pages \u2014 backs are mirrored so they align perfectly when duplex-printed (flip on long edge) and cut into 6"
1544
- },
1545
- {
1546
- id: "portrait-6up-stacked",
1547
- label: "Portrait 6-up \u2014 all fronts then all backs",
1548
- description: "6 cards per page (2 columns \xD7 3 rows), portrait. All front pages first, then all back pages \u2014 cut all sheets together for a matching deck"
1549
- },
1550
- {
1551
- id: "landscape-duplex",
1552
- label: "Landscape cut sheet \u2014 duplex (double-sided)",
1553
- description: "4 cards per page, landscape. Fronts and backs on alternating pages \u2014 backs are mirrored so they align perfectly when you flip and cut"
1554
- },
1555
- {
1556
- id: "landscape-stacked",
1557
- label: "Landscape cut sheet \u2014 all fronts then all backs",
1558
- description: "4 cards per page, landscape. All front pages first, then all back pages \u2014 cut all sheets together for a matching deck"
1559
- },
1560
- {
1561
- id: "avery-5388",
1562
- label: 'Avery 5388 \u2014 3\xD75" index cards (3 per page)',
1563
- description: "Prints to Avery 5388 card stock. 3 cards per page, portrait. Front page then back page per set of 3 \u2014 load the sheet twice to print both sides"
1564
- },
1565
- {
1566
- id: "cut-cards",
1567
- label: "Cut-out cards (portrait)",
1568
- description: "4 per page with cut lines \u2014 front and back shown together per card"
1569
- },
1570
- {
1571
- id: "both-sides",
1572
- label: "Both sides per card",
1573
- description: "Front and back shown together \u2014 best for review or sharing"
1574
- },
1575
- {
1576
- id: "study-sheet",
1577
- label: "Study sheet (table)",
1578
- description: "Compact two-column table \u2014 all cards on one or two pages"
1579
- },
1580
- {
1581
- id: "front-only",
1582
- label: "Questions only (self-test)",
1583
- description: "Front side with blank space to write answers \u2014 print and quiz yourself"
1584
- },
1585
- {
1586
- id: "back-only",
1587
- label: "Answers only",
1588
- description: "Definitions / answers without the questions"
1589
- }
1590
- ],
1591
- settings: [
1592
- {
1593
- type: "range",
1594
- id: "cardRange",
1595
- label: "Cards to print",
1596
- description: "Leave blank to print the whole deck",
1597
- fromId: "fromCard",
1598
- toId: "toCard",
1599
- defaultFrom: 0,
1600
- defaultTo: 0,
1601
- min: 1,
1602
- fromPlaceholder: "1",
1603
- toPlaceholder: "end"
1604
- },
1605
- {
1606
- type: "boolean",
1607
- id: "showSideLabel",
1608
- label: "Show side label",
1609
- description: 'Prints "Front" or "Back" in the corner of each card',
1610
- defaultValue: false,
1611
- appliesTo: [
1612
- "landscape-duplex",
1613
- "landscape-stacked",
1614
- "portrait-6up-duplex",
1615
- "portrait-6up-stacked",
1616
- "avery-5388"
1617
- ]
1618
- },
1619
- {
1620
- type: "boolean",
1621
- id: "showCardNumber",
1622
- label: "Show card number",
1623
- description: "Prints #1, #2 \u2026 in the corner of each card",
1624
- defaultValue: false,
1625
- appliesTo: [
1626
- "landscape-duplex",
1627
- "landscape-stacked",
1628
- "portrait-6up-duplex",
1629
- "portrait-6up-stacked",
1630
- "avery-5388"
1631
- ]
1632
- },
1633
- {
1634
- type: "boolean",
1635
- id: "showTickMarks",
1636
- label: "Show cut tick marks",
1637
- description: "Small marks at each cut intersection \u2014 where to make each cut",
1638
- defaultValue: false,
1639
- appliesTo: [
1640
- "landscape-duplex",
1641
- "landscape-stacked",
1642
- "portrait-6up-duplex",
1643
- "portrait-6up-stacked"
1644
- ]
1645
- },
1646
- {
1647
- type: "boolean",
1648
- id: "showCutLines",
1649
- label: "Show full cut lines",
1650
- description: "Dashed lines all the way across the page \u2014 helps if you don't have a ruler",
1651
- defaultValue: false,
1652
- appliesTo: [
1653
- "landscape-duplex",
1654
- "landscape-stacked",
1655
- "portrait-6up-duplex",
1656
- "portrait-6up-stacked"
1657
- ]
1658
- },
1659
- {
1660
- type: "boolean",
1661
- id: "lightBackText",
1662
- label: "Light back text (reduce show-through)",
1663
- description: "Prints the back side in dark gray instead of black \u2014 ink is lighter and less visible through the paper",
1664
- defaultValue: false,
1665
- appliesTo: [
1666
- "landscape-duplex",
1667
- "landscape-stacked",
1668
- "portrait-6up-duplex",
1669
- "portrait-6up-stacked",
1670
- "avery-5388"
1671
- ]
1672
- },
1673
- {
1674
- type: "boolean",
1675
- id: "mirrorBack",
1676
- label: "Mirror back text (best show-through prevention)",
1677
- description: "Flips back text horizontally \u2014 any ink that bleeds through reads backwards and is unrecognizable from the front",
1678
- defaultValue: false,
1679
- appliesTo: [
1680
- "landscape-duplex",
1681
- "landscape-stacked",
1682
- "portrait-6up-duplex",
1683
- "portrait-6up-stacked",
1684
- "avery-5388"
1685
- ]
1686
- },
1687
- {
1688
- type: "boolean",
1689
- id: "showImages",
1690
- label: "Print face images",
1691
- description: "Includes each card's front/back image when it has one. The fixed-geometry formats (landscape, 6-up, Avery) are text-only by design",
1692
- defaultValue: true,
1693
- appliesTo: [
1694
- "cut-cards",
1695
- "both-sides",
1696
- "study-sheet",
1697
- "front-only",
1698
- "back-only"
1699
- ]
1700
- }
1701
- ],
1706
+ ...flashcardsPrinterMeta,
1702
1707
  print(data, variantId = "portrait-6up-duplex", rawSettings) {
1703
1708
  const allCards = extractCards(data);
1704
1709
  const title = deriveTitle(data);