@ai-matrx/print 0.12.21 → 0.12.23

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.
@@ -223,6 +223,174 @@ function mathTextHtml(text) {
223
223
  });
224
224
  }
225
225
 
226
+ // src/flashcards-meta.ts
227
+ var flashcardsPrinterMeta = {
228
+ label: "Print flashcards",
229
+ variants: [
230
+ {
231
+ id: "portrait-6up-duplex",
232
+ label: "Portrait 6-up \u2014 duplex (recommended)",
233
+ 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"
234
+ },
235
+ {
236
+ id: "portrait-6up-stacked",
237
+ label: "Portrait 6-up \u2014 all fronts then all backs",
238
+ 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"
239
+ },
240
+ {
241
+ id: "landscape-duplex",
242
+ label: "Landscape cut sheet \u2014 duplex (double-sided)",
243
+ 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"
244
+ },
245
+ {
246
+ id: "landscape-stacked",
247
+ label: "Landscape cut sheet \u2014 all fronts then all backs",
248
+ description: "4 cards per page, landscape. All front pages first, then all back pages \u2014 cut all sheets together for a matching deck"
249
+ },
250
+ {
251
+ id: "avery-5388",
252
+ label: 'Avery 5388 \u2014 3\xD75" index cards (3 per page)',
253
+ 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"
254
+ },
255
+ {
256
+ id: "cut-cards",
257
+ label: "Cut-out cards (portrait)",
258
+ description: "4 per page with cut lines \u2014 front and back shown together per card"
259
+ },
260
+ {
261
+ id: "both-sides",
262
+ label: "Both sides per card",
263
+ description: "Front and back shown together \u2014 best for review or sharing"
264
+ },
265
+ {
266
+ id: "study-sheet",
267
+ label: "Study sheet (table)",
268
+ description: "Compact two-column table \u2014 all cards on one or two pages"
269
+ },
270
+ {
271
+ id: "front-only",
272
+ label: "Questions only (self-test)",
273
+ description: "Front side with blank space to write answers \u2014 print and quiz yourself"
274
+ },
275
+ {
276
+ id: "back-only",
277
+ label: "Answers only",
278
+ description: "Definitions / answers without the questions"
279
+ }
280
+ ],
281
+ settings: [
282
+ {
283
+ type: "range",
284
+ id: "cardRange",
285
+ label: "Cards to print",
286
+ description: "Leave blank to print the whole deck",
287
+ fromId: "fromCard",
288
+ toId: "toCard",
289
+ defaultFrom: 0,
290
+ defaultTo: 0,
291
+ min: 1,
292
+ fromPlaceholder: "1",
293
+ toPlaceholder: "end"
294
+ },
295
+ {
296
+ type: "boolean",
297
+ id: "showSideLabel",
298
+ label: "Show side label",
299
+ description: 'Prints "Front" or "Back" in the corner of each card',
300
+ defaultValue: false,
301
+ appliesTo: [
302
+ "landscape-duplex",
303
+ "landscape-stacked",
304
+ "portrait-6up-duplex",
305
+ "portrait-6up-stacked",
306
+ "avery-5388"
307
+ ]
308
+ },
309
+ {
310
+ type: "boolean",
311
+ id: "showCardNumber",
312
+ label: "Show card number",
313
+ description: "Prints #1, #2 \u2026 in the corner of each card",
314
+ defaultValue: false,
315
+ appliesTo: [
316
+ "landscape-duplex",
317
+ "landscape-stacked",
318
+ "portrait-6up-duplex",
319
+ "portrait-6up-stacked",
320
+ "avery-5388"
321
+ ]
322
+ },
323
+ {
324
+ type: "boolean",
325
+ id: "showTickMarks",
326
+ label: "Show cut tick marks",
327
+ description: "Small marks at each cut intersection \u2014 where to make each cut",
328
+ defaultValue: false,
329
+ appliesTo: [
330
+ "landscape-duplex",
331
+ "landscape-stacked",
332
+ "portrait-6up-duplex",
333
+ "portrait-6up-stacked"
334
+ ]
335
+ },
336
+ {
337
+ type: "boolean",
338
+ id: "showCutLines",
339
+ label: "Show full cut lines",
340
+ description: "Dashed lines all the way across the page \u2014 helps if you don't have a ruler",
341
+ defaultValue: false,
342
+ appliesTo: [
343
+ "landscape-duplex",
344
+ "landscape-stacked",
345
+ "portrait-6up-duplex",
346
+ "portrait-6up-stacked"
347
+ ]
348
+ },
349
+ {
350
+ type: "boolean",
351
+ id: "lightBackText",
352
+ label: "Light back text (reduce show-through)",
353
+ description: "Prints the back side in dark gray instead of black \u2014 ink is lighter and less visible through the paper",
354
+ defaultValue: false,
355
+ appliesTo: [
356
+ "landscape-duplex",
357
+ "landscape-stacked",
358
+ "portrait-6up-duplex",
359
+ "portrait-6up-stacked",
360
+ "avery-5388"
361
+ ]
362
+ },
363
+ {
364
+ type: "boolean",
365
+ id: "mirrorBack",
366
+ label: "Mirror back text (best show-through prevention)",
367
+ description: "Flips back text horizontally \u2014 any ink that bleeds through reads backwards and is unrecognizable from the front",
368
+ defaultValue: false,
369
+ appliesTo: [
370
+ "landscape-duplex",
371
+ "landscape-stacked",
372
+ "portrait-6up-duplex",
373
+ "portrait-6up-stacked",
374
+ "avery-5388"
375
+ ]
376
+ },
377
+ {
378
+ type: "boolean",
379
+ id: "showImages",
380
+ label: "Print face images",
381
+ 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",
382
+ defaultValue: true,
383
+ appliesTo: [
384
+ "cut-cards",
385
+ "both-sides",
386
+ "study-sheet",
387
+ "front-only",
388
+ "back-only"
389
+ ]
390
+ }
391
+ ]
392
+ };
393
+
226
394
  // src/flashcards.ts
227
395
  import { escapeHtml as escapeHtml3 } from "@ai-matrx/kit/html-escape";
228
396
  var SETTING_DEFAULTS = {
@@ -1499,170 +1667,7 @@ function deriveTitle(data) {
1499
1667
  return "Flashcards";
1500
1668
  }
1501
1669
  var flashcardsPrinter = {
1502
- label: "Print flashcards",
1503
- variants: [
1504
- {
1505
- id: "portrait-6up-duplex",
1506
- label: "Portrait 6-up \u2014 duplex (recommended)",
1507
- 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"
1508
- },
1509
- {
1510
- id: "portrait-6up-stacked",
1511
- label: "Portrait 6-up \u2014 all fronts then all backs",
1512
- 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"
1513
- },
1514
- {
1515
- id: "landscape-duplex",
1516
- label: "Landscape cut sheet \u2014 duplex (double-sided)",
1517
- 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"
1518
- },
1519
- {
1520
- id: "landscape-stacked",
1521
- label: "Landscape cut sheet \u2014 all fronts then all backs",
1522
- description: "4 cards per page, landscape. All front pages first, then all back pages \u2014 cut all sheets together for a matching deck"
1523
- },
1524
- {
1525
- id: "avery-5388",
1526
- label: 'Avery 5388 \u2014 3\xD75" index cards (3 per page)',
1527
- 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"
1528
- },
1529
- {
1530
- id: "cut-cards",
1531
- label: "Cut-out cards (portrait)",
1532
- description: "4 per page with cut lines \u2014 front and back shown together per card"
1533
- },
1534
- {
1535
- id: "both-sides",
1536
- label: "Both sides per card",
1537
- description: "Front and back shown together \u2014 best for review or sharing"
1538
- },
1539
- {
1540
- id: "study-sheet",
1541
- label: "Study sheet (table)",
1542
- description: "Compact two-column table \u2014 all cards on one or two pages"
1543
- },
1544
- {
1545
- id: "front-only",
1546
- label: "Questions only (self-test)",
1547
- description: "Front side with blank space to write answers \u2014 print and quiz yourself"
1548
- },
1549
- {
1550
- id: "back-only",
1551
- label: "Answers only",
1552
- description: "Definitions / answers without the questions"
1553
- }
1554
- ],
1555
- settings: [
1556
- {
1557
- type: "range",
1558
- id: "cardRange",
1559
- label: "Cards to print",
1560
- description: "Leave blank to print the whole deck",
1561
- fromId: "fromCard",
1562
- toId: "toCard",
1563
- defaultFrom: 0,
1564
- defaultTo: 0,
1565
- min: 1,
1566
- fromPlaceholder: "1",
1567
- toPlaceholder: "end"
1568
- },
1569
- {
1570
- type: "boolean",
1571
- id: "showSideLabel",
1572
- label: "Show side label",
1573
- description: 'Prints "Front" or "Back" in the corner of each card',
1574
- defaultValue: false,
1575
- appliesTo: [
1576
- "landscape-duplex",
1577
- "landscape-stacked",
1578
- "portrait-6up-duplex",
1579
- "portrait-6up-stacked",
1580
- "avery-5388"
1581
- ]
1582
- },
1583
- {
1584
- type: "boolean",
1585
- id: "showCardNumber",
1586
- label: "Show card number",
1587
- description: "Prints #1, #2 \u2026 in the corner of each card",
1588
- defaultValue: false,
1589
- appliesTo: [
1590
- "landscape-duplex",
1591
- "landscape-stacked",
1592
- "portrait-6up-duplex",
1593
- "portrait-6up-stacked",
1594
- "avery-5388"
1595
- ]
1596
- },
1597
- {
1598
- type: "boolean",
1599
- id: "showTickMarks",
1600
- label: "Show cut tick marks",
1601
- description: "Small marks at each cut intersection \u2014 where to make each cut",
1602
- defaultValue: false,
1603
- appliesTo: [
1604
- "landscape-duplex",
1605
- "landscape-stacked",
1606
- "portrait-6up-duplex",
1607
- "portrait-6up-stacked"
1608
- ]
1609
- },
1610
- {
1611
- type: "boolean",
1612
- id: "showCutLines",
1613
- label: "Show full cut lines",
1614
- description: "Dashed lines all the way across the page \u2014 helps if you don't have a ruler",
1615
- defaultValue: false,
1616
- appliesTo: [
1617
- "landscape-duplex",
1618
- "landscape-stacked",
1619
- "portrait-6up-duplex",
1620
- "portrait-6up-stacked"
1621
- ]
1622
- },
1623
- {
1624
- type: "boolean",
1625
- id: "lightBackText",
1626
- label: "Light back text (reduce show-through)",
1627
- description: "Prints the back side in dark gray instead of black \u2014 ink is lighter and less visible through the paper",
1628
- defaultValue: false,
1629
- appliesTo: [
1630
- "landscape-duplex",
1631
- "landscape-stacked",
1632
- "portrait-6up-duplex",
1633
- "portrait-6up-stacked",
1634
- "avery-5388"
1635
- ]
1636
- },
1637
- {
1638
- type: "boolean",
1639
- id: "mirrorBack",
1640
- label: "Mirror back text (best show-through prevention)",
1641
- description: "Flips back text horizontally \u2014 any ink that bleeds through reads backwards and is unrecognizable from the front",
1642
- defaultValue: false,
1643
- appliesTo: [
1644
- "landscape-duplex",
1645
- "landscape-stacked",
1646
- "portrait-6up-duplex",
1647
- "portrait-6up-stacked",
1648
- "avery-5388"
1649
- ]
1650
- },
1651
- {
1652
- type: "boolean",
1653
- id: "showImages",
1654
- label: "Print face images",
1655
- 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",
1656
- defaultValue: true,
1657
- appliesTo: [
1658
- "cut-cards",
1659
- "both-sides",
1660
- "study-sheet",
1661
- "front-only",
1662
- "back-only"
1663
- ]
1664
- }
1665
- ],
1670
+ ...flashcardsPrinterMeta,
1666
1671
  print(data, variantId = "portrait-6up-duplex", rawSettings) {
1667
1672
  const allCards = extractCards(data);
1668
1673
  const title = deriveTitle(data);