@makefully/fancifully 0.1.0 → 0.3.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 (39) hide show
  1. package/CHANGELOG.md +50 -12
  2. package/LICENSE +21 -21
  3. package/README.md +245 -147
  4. package/dist/Storybook.d.ts +106 -3
  5. package/dist/Storybook.d.ts.map +1 -1
  6. package/dist/fancifully.css +1 -1
  7. package/dist/fancifully.iife.js +4 -8
  8. package/dist/fancifully.js +3538 -1999
  9. package/dist/flip/DefaultFlipStyle.d.ts +11 -0
  10. package/dist/flip/DefaultFlipStyle.d.ts.map +1 -0
  11. package/dist/flip/FlipStyle.d.ts +47 -0
  12. package/dist/flip/FlipStyle.d.ts.map +1 -0
  13. package/dist/flip/index.d.ts +4 -0
  14. package/dist/flip/index.d.ts.map +1 -0
  15. package/dist/index.d.ts +11 -4
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/interop/fabricLike.d.ts +124 -0
  18. package/dist/interop/fabricLike.d.ts.map +1 -0
  19. package/dist/layout/layoutUnits.d.ts +43 -0
  20. package/dist/layout/layoutUnits.d.ts.map +1 -0
  21. package/dist/load/fanciFile.d.ts +6 -0
  22. package/dist/load/fanciFile.d.ts.map +1 -0
  23. package/dist/load/loadEpub.d.ts.map +1 -1
  24. package/dist/nav/Pager.d.ts +27 -5
  25. package/dist/nav/Pager.d.ts.map +1 -1
  26. package/dist/nav/hardback.d.ts +24 -0
  27. package/dist/nav/hardback.d.ts.map +1 -0
  28. package/dist/nav/layoutMode.d.ts +51 -4
  29. package/dist/nav/layoutMode.d.ts.map +1 -1
  30. package/dist/pack/packFanci.d.ts +16 -0
  31. package/dist/pack/packFanci.d.ts.map +1 -0
  32. package/dist/render/SpreadView.d.ts +67 -3
  33. package/dist/render/SpreadView.d.ts.map +1 -1
  34. package/dist/render/blocks/TextBlock.d.ts.map +1 -1
  35. package/dist/schema/story.d.ts +160 -17
  36. package/dist/schema/story.d.ts.map +1 -1
  37. package/dist/ui/iconifyIcon.d.ts +21 -0
  38. package/dist/ui/iconifyIcon.d.ts.map +1 -0
  39. package/package.json +76 -74
@@ -145,18 +145,26 @@ export declare const blockSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
145
145
  color: z.ZodOptional<z.ZodString>;
146
146
  textAlign: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
147
147
  lineHeight: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
148
+ /** Set only when a real bold face of this family is embedded. */
149
+ fontWeight: z.ZodOptional<z.ZodString>;
150
+ /** Set only when a real italic face of this family is embedded. */
151
+ fontStyle: z.ZodOptional<z.ZodString>;
148
152
  }, "strip", z.ZodTypeAny, {
149
153
  fontFamily?: string | undefined;
150
154
  fontSize?: string | undefined;
151
155
  color?: string | undefined;
152
156
  textAlign?: "left" | "center" | "right" | undefined;
153
157
  lineHeight?: string | number | undefined;
158
+ fontWeight?: string | undefined;
159
+ fontStyle?: string | undefined;
154
160
  }, {
155
161
  fontFamily?: string | undefined;
156
162
  fontSize?: string | undefined;
157
163
  color?: string | undefined;
158
164
  textAlign?: "left" | "center" | "right" | undefined;
159
165
  lineHeight?: string | number | undefined;
166
+ fontWeight?: string | undefined;
167
+ fontStyle?: string | undefined;
160
168
  }>>;
161
169
  }, "strip", z.ZodTypeAny, {
162
170
  type: "text";
@@ -178,6 +186,8 @@ export declare const blockSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
178
186
  color?: string | undefined;
179
187
  textAlign?: "left" | "center" | "right" | undefined;
180
188
  lineHeight?: string | number | undefined;
189
+ fontWeight?: string | undefined;
190
+ fontStyle?: string | undefined;
181
191
  } | undefined;
182
192
  }, {
183
193
  type: "text";
@@ -199,6 +209,8 @@ export declare const blockSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
199
209
  color?: string | undefined;
200
210
  textAlign?: "left" | "center" | "right" | undefined;
201
211
  lineHeight?: string | number | undefined;
212
+ fontWeight?: string | undefined;
213
+ fontStyle?: string | undefined;
202
214
  } | undefined;
203
215
  }>, z.ZodObject<{
204
216
  id: z.ZodString;
@@ -363,12 +375,19 @@ export declare const pageSchema: z.ZodObject<{
363
375
  background: z.ZodOptional<z.ZodObject<{
364
376
  asset: z.ZodOptional<z.ZodString>;
365
377
  color: z.ZodOptional<z.ZodString>;
378
+ /**
379
+ * Inside face of a cover. When the book is open, this is the rim around
380
+ * the interior pages (the inside of the cover).
381
+ */
382
+ innerColor: z.ZodOptional<z.ZodString>;
366
383
  }, "strip", z.ZodTypeAny, {
367
384
  color?: string | undefined;
368
385
  asset?: string | undefined;
386
+ innerColor?: string | undefined;
369
387
  }, {
370
388
  color?: string | undefined;
371
389
  asset?: string | undefined;
390
+ innerColor?: string | undefined;
372
391
  }>>;
373
392
  readAloud: z.ZodOptional<z.ZodObject<{
374
393
  audio: z.ZodString;
@@ -441,18 +460,26 @@ export declare const pageSchema: z.ZodObject<{
441
460
  color: z.ZodOptional<z.ZodString>;
442
461
  textAlign: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
443
462
  lineHeight: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
463
+ /** Set only when a real bold face of this family is embedded. */
464
+ fontWeight: z.ZodOptional<z.ZodString>;
465
+ /** Set only when a real italic face of this family is embedded. */
466
+ fontStyle: z.ZodOptional<z.ZodString>;
444
467
  }, "strip", z.ZodTypeAny, {
445
468
  fontFamily?: string | undefined;
446
469
  fontSize?: string | undefined;
447
470
  color?: string | undefined;
448
471
  textAlign?: "left" | "center" | "right" | undefined;
449
472
  lineHeight?: string | number | undefined;
473
+ fontWeight?: string | undefined;
474
+ fontStyle?: string | undefined;
450
475
  }, {
451
476
  fontFamily?: string | undefined;
452
477
  fontSize?: string | undefined;
453
478
  color?: string | undefined;
454
479
  textAlign?: "left" | "center" | "right" | undefined;
455
480
  lineHeight?: string | number | undefined;
481
+ fontWeight?: string | undefined;
482
+ fontStyle?: string | undefined;
456
483
  }>>;
457
484
  }, "strip", z.ZodTypeAny, {
458
485
  type: "text";
@@ -474,6 +501,8 @@ export declare const pageSchema: z.ZodObject<{
474
501
  color?: string | undefined;
475
502
  textAlign?: "left" | "center" | "right" | undefined;
476
503
  lineHeight?: string | number | undefined;
504
+ fontWeight?: string | undefined;
505
+ fontStyle?: string | undefined;
477
506
  } | undefined;
478
507
  }, {
479
508
  type: "text";
@@ -495,6 +524,8 @@ export declare const pageSchema: z.ZodObject<{
495
524
  color?: string | undefined;
496
525
  textAlign?: "left" | "center" | "right" | undefined;
497
526
  lineHeight?: string | number | undefined;
527
+ fontWeight?: string | undefined;
528
+ fontStyle?: string | undefined;
498
529
  } | undefined;
499
530
  }>, z.ZodObject<{
500
531
  id: z.ZodString;
@@ -676,6 +707,8 @@ export declare const pageSchema: z.ZodObject<{
676
707
  color?: string | undefined;
677
708
  textAlign?: "left" | "center" | "right" | undefined;
678
709
  lineHeight?: string | number | undefined;
710
+ fontWeight?: string | undefined;
711
+ fontStyle?: string | undefined;
679
712
  } | undefined;
680
713
  } | {
681
714
  type: "image";
@@ -716,6 +749,7 @@ export declare const pageSchema: z.ZodObject<{
716
749
  background?: {
717
750
  color?: string | undefined;
718
751
  asset?: string | undefined;
752
+ innerColor?: string | undefined;
719
753
  } | undefined;
720
754
  readAloud?: {
721
755
  audio: string;
@@ -731,6 +765,7 @@ export declare const pageSchema: z.ZodObject<{
731
765
  background?: {
732
766
  color?: string | undefined;
733
767
  asset?: string | undefined;
768
+ innerColor?: string | undefined;
734
769
  } | undefined;
735
770
  readAloud?: {
736
771
  audio: string;
@@ -761,6 +796,8 @@ export declare const pageSchema: z.ZodObject<{
761
796
  color?: string | undefined;
762
797
  textAlign?: "left" | "center" | "right" | undefined;
763
798
  lineHeight?: string | number | undefined;
799
+ fontWeight?: string | undefined;
800
+ fontStyle?: string | undefined;
764
801
  } | undefined;
765
802
  } | {
766
803
  type: "image";
@@ -812,15 +849,65 @@ export declare const storySchema: z.ZodObject<{
812
849
  width: number;
813
850
  height: number;
814
851
  }>;
815
- layout: z.ZodDefault<z.ZodObject<{
816
- mode: z.ZodDefault<z.ZodEnum<["single", "two-page", "auto"]>>;
817
- singleBreakpoint: z.ZodDefault<z.ZodNumber>;
852
+ /**
853
+ * First page is a front cover: starts closed (centered); page-flips open to
854
+ * interior content (cover omitted from open spreads).
855
+ */
856
+ frontCover: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
857
+ /**
858
+ * Last page is a back cover: omitted from open spreads; page-flips closed
859
+ * to a centered back cover after the final interior spread.
860
+ */
861
+ backCover: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
862
+ /**
863
+ * Front/back cover boards are larger than interior pages. When open, the
864
+ * cover stays behind the spread so a rim of cover remains visible.
865
+ * Only applies when `frontCover` and/or `backCover` is set.
866
+ */
867
+ hardback: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
868
+ /**
869
+ * Closed cover board size. When hardback is on, the rim is
870
+ * `(coverSize - pageSize) / 2` on each edge. Omitted boards use the default overhang.
871
+ */
872
+ coverSize: z.ZodOptional<z.ZodObject<{
873
+ width: z.ZodNumber;
874
+ height: z.ZodNumber;
818
875
  }, "strip", z.ZodTypeAny, {
819
- mode: "single" | "two-page" | "auto";
820
- singleBreakpoint: number;
876
+ width: number;
877
+ height: number;
821
878
  }, {
822
- mode?: "single" | "two-page" | "auto" | undefined;
823
- singleBreakpoint?: number | undefined;
879
+ width: number;
880
+ height: number;
881
+ }>>;
882
+ /** Editor alignment guides. The player ignores these. */
883
+ guides: z.ZodOptional<z.ZodObject<{
884
+ marginTop: z.ZodDefault<z.ZodNumber>;
885
+ marginRight: z.ZodDefault<z.ZodNumber>;
886
+ marginBottom: z.ZodDefault<z.ZodNumber>;
887
+ marginLeft: z.ZodDefault<z.ZodNumber>;
888
+ /** Snap band around the gutter, in pixels. The split stays at page width. */
889
+ gutterBand: z.ZodDefault<z.ZodNumber>;
890
+ showGuides: z.ZodDefault<z.ZodBoolean>;
891
+ snapGuides: z.ZodDefault<z.ZodBoolean>;
892
+ snapObjects: z.ZodDefault<z.ZodBoolean>;
893
+ }, "strip", z.ZodTypeAny, {
894
+ marginTop: number;
895
+ marginRight: number;
896
+ marginBottom: number;
897
+ marginLeft: number;
898
+ gutterBand: number;
899
+ showGuides: boolean;
900
+ snapGuides: boolean;
901
+ snapObjects: boolean;
902
+ }, {
903
+ marginTop?: number | undefined;
904
+ marginRight?: number | undefined;
905
+ marginBottom?: number | undefined;
906
+ marginLeft?: number | undefined;
907
+ gutterBand?: number | undefined;
908
+ showGuides?: boolean | undefined;
909
+ snapGuides?: boolean | undefined;
910
+ snapObjects?: boolean | undefined;
824
911
  }>>;
825
912
  fonts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
826
913
  family: z.ZodString;
@@ -883,12 +970,19 @@ export declare const storySchema: z.ZodObject<{
883
970
  background: z.ZodOptional<z.ZodObject<{
884
971
  asset: z.ZodOptional<z.ZodString>;
885
972
  color: z.ZodOptional<z.ZodString>;
973
+ /**
974
+ * Inside face of a cover. When the book is open, this is the rim around
975
+ * the interior pages (the inside of the cover).
976
+ */
977
+ innerColor: z.ZodOptional<z.ZodString>;
886
978
  }, "strip", z.ZodTypeAny, {
887
979
  color?: string | undefined;
888
980
  asset?: string | undefined;
981
+ innerColor?: string | undefined;
889
982
  }, {
890
983
  color?: string | undefined;
891
984
  asset?: string | undefined;
985
+ innerColor?: string | undefined;
892
986
  }>>;
893
987
  readAloud: z.ZodOptional<z.ZodObject<{
894
988
  audio: z.ZodString;
@@ -961,18 +1055,26 @@ export declare const storySchema: z.ZodObject<{
961
1055
  color: z.ZodOptional<z.ZodString>;
962
1056
  textAlign: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
963
1057
  lineHeight: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1058
+ /** Set only when a real bold face of this family is embedded. */
1059
+ fontWeight: z.ZodOptional<z.ZodString>;
1060
+ /** Set only when a real italic face of this family is embedded. */
1061
+ fontStyle: z.ZodOptional<z.ZodString>;
964
1062
  }, "strip", z.ZodTypeAny, {
965
1063
  fontFamily?: string | undefined;
966
1064
  fontSize?: string | undefined;
967
1065
  color?: string | undefined;
968
1066
  textAlign?: "left" | "center" | "right" | undefined;
969
1067
  lineHeight?: string | number | undefined;
1068
+ fontWeight?: string | undefined;
1069
+ fontStyle?: string | undefined;
970
1070
  }, {
971
1071
  fontFamily?: string | undefined;
972
1072
  fontSize?: string | undefined;
973
1073
  color?: string | undefined;
974
1074
  textAlign?: "left" | "center" | "right" | undefined;
975
1075
  lineHeight?: string | number | undefined;
1076
+ fontWeight?: string | undefined;
1077
+ fontStyle?: string | undefined;
976
1078
  }>>;
977
1079
  }, "strip", z.ZodTypeAny, {
978
1080
  type: "text";
@@ -994,6 +1096,8 @@ export declare const storySchema: z.ZodObject<{
994
1096
  color?: string | undefined;
995
1097
  textAlign?: "left" | "center" | "right" | undefined;
996
1098
  lineHeight?: string | number | undefined;
1099
+ fontWeight?: string | undefined;
1100
+ fontStyle?: string | undefined;
997
1101
  } | undefined;
998
1102
  }, {
999
1103
  type: "text";
@@ -1015,6 +1119,8 @@ export declare const storySchema: z.ZodObject<{
1015
1119
  color?: string | undefined;
1016
1120
  textAlign?: "left" | "center" | "right" | undefined;
1017
1121
  lineHeight?: string | number | undefined;
1122
+ fontWeight?: string | undefined;
1123
+ fontStyle?: string | undefined;
1018
1124
  } | undefined;
1019
1125
  }>, z.ZodObject<{
1020
1126
  id: z.ZodString;
@@ -1196,6 +1302,8 @@ export declare const storySchema: z.ZodObject<{
1196
1302
  color?: string | undefined;
1197
1303
  textAlign?: "left" | "center" | "right" | undefined;
1198
1304
  lineHeight?: string | number | undefined;
1305
+ fontWeight?: string | undefined;
1306
+ fontStyle?: string | undefined;
1199
1307
  } | undefined;
1200
1308
  } | {
1201
1309
  type: "image";
@@ -1236,6 +1344,7 @@ export declare const storySchema: z.ZodObject<{
1236
1344
  background?: {
1237
1345
  color?: string | undefined;
1238
1346
  asset?: string | undefined;
1347
+ innerColor?: string | undefined;
1239
1348
  } | undefined;
1240
1349
  readAloud?: {
1241
1350
  audio: string;
@@ -1251,6 +1360,7 @@ export declare const storySchema: z.ZodObject<{
1251
1360
  background?: {
1252
1361
  color?: string | undefined;
1253
1362
  asset?: string | undefined;
1363
+ innerColor?: string | undefined;
1254
1364
  } | undefined;
1255
1365
  readAloud?: {
1256
1366
  audio: string;
@@ -1281,6 +1391,8 @@ export declare const storySchema: z.ZodObject<{
1281
1391
  color?: string | undefined;
1282
1392
  textAlign?: "left" | "center" | "right" | undefined;
1283
1393
  lineHeight?: string | number | undefined;
1394
+ fontWeight?: string | undefined;
1395
+ fontStyle?: string | undefined;
1284
1396
  } | undefined;
1285
1397
  } | {
1286
1398
  type: "image";
@@ -1321,14 +1433,13 @@ export declare const storySchema: z.ZodObject<{
1321
1433
  }>, "many">;
1322
1434
  }, "strip", z.ZodTypeAny, {
1323
1435
  id: string;
1324
- layout: {
1325
- mode: "single" | "two-page" | "auto";
1326
- singleBreakpoint: number;
1327
- };
1328
1436
  pageSize: {
1329
1437
  width: number;
1330
1438
  height: number;
1331
1439
  };
1440
+ frontCover: boolean;
1441
+ backCover: boolean;
1442
+ hardback: boolean;
1332
1443
  fonts: {
1333
1444
  src: string;
1334
1445
  family: string;
@@ -1371,6 +1482,8 @@ export declare const storySchema: z.ZodObject<{
1371
1482
  color?: string | undefined;
1372
1483
  textAlign?: "left" | "center" | "right" | undefined;
1373
1484
  lineHeight?: string | number | undefined;
1485
+ fontWeight?: string | undefined;
1486
+ fontStyle?: string | undefined;
1374
1487
  } | undefined;
1375
1488
  } | {
1376
1489
  type: "image";
@@ -1411,6 +1524,7 @@ export declare const storySchema: z.ZodObject<{
1411
1524
  background?: {
1412
1525
  color?: string | undefined;
1413
1526
  asset?: string | undefined;
1527
+ innerColor?: string | undefined;
1414
1528
  } | undefined;
1415
1529
  readAloud?: {
1416
1530
  audio: string;
@@ -1423,6 +1537,20 @@ export declare const storySchema: z.ZodObject<{
1423
1537
  } | undefined;
1424
1538
  }[];
1425
1539
  title?: string | undefined;
1540
+ coverSize?: {
1541
+ width: number;
1542
+ height: number;
1543
+ } | undefined;
1544
+ guides?: {
1545
+ marginTop: number;
1546
+ marginRight: number;
1547
+ marginBottom: number;
1548
+ marginLeft: number;
1549
+ gutterBand: number;
1550
+ showGuides: boolean;
1551
+ snapGuides: boolean;
1552
+ snapObjects: boolean;
1553
+ } | undefined;
1426
1554
  }, {
1427
1555
  id: string;
1428
1556
  pageSize: {
@@ -1434,6 +1562,7 @@ export declare const storySchema: z.ZodObject<{
1434
1562
  background?: {
1435
1563
  color?: string | undefined;
1436
1564
  asset?: string | undefined;
1565
+ innerColor?: string | undefined;
1437
1566
  } | undefined;
1438
1567
  readAloud?: {
1439
1568
  audio: string;
@@ -1464,6 +1593,8 @@ export declare const storySchema: z.ZodObject<{
1464
1593
  color?: string | undefined;
1465
1594
  textAlign?: "left" | "center" | "right" | undefined;
1466
1595
  lineHeight?: string | number | undefined;
1596
+ fontWeight?: string | undefined;
1597
+ fontStyle?: string | undefined;
1467
1598
  } | undefined;
1468
1599
  } | {
1469
1600
  type: "image";
@@ -1502,11 +1633,24 @@ export declare const storySchema: z.ZodObject<{
1502
1633
  ariaLabel?: string | undefined;
1503
1634
  })[] | undefined;
1504
1635
  }[];
1505
- layout?: {
1506
- mode?: "single" | "two-page" | "auto" | undefined;
1507
- singleBreakpoint?: number | undefined;
1508
- } | undefined;
1509
1636
  title?: string | undefined;
1637
+ frontCover?: boolean | undefined;
1638
+ backCover?: boolean | undefined;
1639
+ hardback?: boolean | undefined;
1640
+ coverSize?: {
1641
+ width: number;
1642
+ height: number;
1643
+ } | undefined;
1644
+ guides?: {
1645
+ marginTop?: number | undefined;
1646
+ marginRight?: number | undefined;
1647
+ marginBottom?: number | undefined;
1648
+ marginLeft?: number | undefined;
1649
+ gutterBand?: number | undefined;
1650
+ showGuides?: boolean | undefined;
1651
+ snapGuides?: boolean | undefined;
1652
+ snapObjects?: boolean | undefined;
1653
+ } | undefined;
1510
1654
  fonts?: {
1511
1655
  src: string;
1512
1656
  family: string;
@@ -1529,13 +1673,12 @@ export declare const storySchema: z.ZodObject<{
1529
1673
  }> | undefined;
1530
1674
  }>;
1531
1675
  export type Story = z.infer<typeof storySchema>;
1676
+ export type BookGuides = NonNullable<Story['guides']>;
1532
1677
  export type StoryPage = z.infer<typeof pageSchema>;
1533
1678
  export type StoryBlock = z.infer<typeof blockSchema>;
1534
1679
  export type StoryAsset = z.infer<typeof assetSchema>;
1535
1680
  export type Cue = z.infer<typeof cueSchema>;
1536
1681
  export type LayoutBox = z.infer<typeof layoutBoxSchema>;
1537
- export type LayoutMode = 'single' | 'two-page' | 'auto';
1538
- export type ResolvedLayoutMode = 'single' | 'two-page';
1539
1682
  export type TapAction = z.infer<typeof tapActionSchema>;
1540
1683
  export type AudioChannel = 'vo' | 'sfx' | 'music';
1541
1684
  export declare function parseStory(data: unknown): Story;
@@ -1 +1 @@
1
- {"version":3,"file":"story.d.ts","sourceRoot":"","sources":["../../src/schema/story.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB,wCAAoC,CAAC;AAEnE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;EAQ1B,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;EAKpB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkBtB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQ1B,CAAC;AAmCH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8GvE,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAChD,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACnD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACrD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAC5C,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,KAAK,GAAG,OAAO,CAAC;AAElD,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,CAE/C"}
@@ -0,0 +1,21 @@
1
+ export type MdiIconName = 'chevron-left' | 'chevron-right' | 'book-open-page-variant' | 'pencil' | 'eye' | 'download' | 'cog' | 'file-plus' | 'file-remove' | 'book' | 'book-open-outline' | 'book-variant' | 'folder-open' | 'drag-vertical' | 'close' | 'plus';
2
+ export type ButtonIconContent = {
3
+ icon: MdiIconName;
4
+ /** Visible or screen-reader label */
5
+ label: string;
6
+ /** Hide label visually (keep for assistive tech). */
7
+ iconOnly?: boolean;
8
+ };
9
+ /**
10
+ * Build an inline SVG from the offline MDI subset (`currentColor` fill).
11
+ */
12
+ export declare function createMdiIcon(name: MdiIconName, opts?: {
13
+ className?: string;
14
+ size?: string;
15
+ }): HTMLElement;
16
+ /**
17
+ * Replace button children with an Iconify icon + label.
18
+ * Always sets `title` / `aria-label` so narrow icon-only chrome keeps a tooltip.
19
+ */
20
+ export declare function setButtonIconContent(btn: HTMLElement, content: ButtonIconContent): void;
21
+ //# sourceMappingURL=iconifyIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconifyIcon.d.ts","sourceRoot":"","sources":["../../src/ui/iconifyIcon.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,eAAe,GACf,wBAAwB,GACxB,QAAQ,GACR,KAAK,GACL,UAAU,GACV,KAAK,GACL,WAAW,GACX,aAAa,GACb,MAAM,GACN,mBAAmB,GACnB,cAAc,GACd,aAAa,GACb,eAAe,GACf,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,WAAW,EACjB,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/C,WAAW,CAYb;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAQvF"}
package/package.json CHANGED
@@ -1,74 +1,76 @@
1
- {
2
- "name": "@makefully/fancifully",
3
- "version": "0.1.0",
4
- "description": "DOM-based interactive storybook engine with SpringRoll audio and VO↔text sync.",
5
- "type": "module",
6
- "main": "./dist/fancifully.js",
7
- "module": "./dist/fancifully.js",
8
- "types": "./dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/fancifully.js",
13
- "default": "./dist/fancifully.js"
14
- },
15
- "./fancifully.css": "./dist/fancifully.css",
16
- "./iife": "./dist/fancifully.iife.js",
17
- "./package.json": "./package.json"
18
- },
19
- "files": [
20
- "dist",
21
- "README.md",
22
- "CHANGELOG.md",
23
- "LICENSE"
24
- ],
25
- "scripts": {
26
- "dev": "vite --config vite.demo.config.ts",
27
- "build": "vite build --config vite.lib.config.ts && tsc -p tsconfig.build.json --emitDeclarationOnly",
28
- "test": "tsx --test tests/*.test.ts",
29
- "pack:fanci": "node scripts/pack-fanci.mjs demo/public/stories/demo demo/public/stories/demo.fanci",
30
- "pack:check": "npm pack --dry-run",
31
- "prepack": "npm run build",
32
- "prepublishOnly": "npm test && npm run build"
33
- },
34
- "publishConfig": {
35
- "access": "public"
36
- },
37
- "repository": {
38
- "type": "git",
39
- "url": "git+https://github.com/Makefully-Studios/fancifully.git"
40
- },
41
- "bugs": {
42
- "url": "https://github.com/Makefully-Studios/fancifully/issues"
43
- },
44
- "homepage": "https://github.com/Makefully-Studios/fancifully#readme",
45
- "keywords": [
46
- "fancifully",
47
- "storybook",
48
- "interactive",
49
- "read-aloud",
50
- "epub",
51
- "springroll",
52
- "makefully"
53
- ],
54
- "author": "Makefully Studios",
55
- "license": "MIT",
56
- "dependencies": {
57
- "fflate": "^0.8.3",
58
- "zod": "^3.24.2"
59
- },
60
- "peerDependencies": {
61
- "springroll": "^2.6.0"
62
- },
63
- "peerDependenciesMeta": {
64
- "springroll": {
65
- "optional": true
66
- }
67
- },
68
- "devDependencies": {
69
- "springroll": "^2.6.0",
70
- "tsx": "^4.19.3",
71
- "typescript": "^5.8.2",
72
- "vite": "^6.0.7"
73
- }
74
- }
1
+ {
2
+ "name": "@makefully/fancifully",
3
+ "version": "0.3.0",
4
+ "description": "DOM-based interactive storybook engine with SpringRoll audio and VO↔text sync.",
5
+ "type": "module",
6
+ "main": "./dist/fancifully.js",
7
+ "module": "./dist/fancifully.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/fancifully.js",
13
+ "default": "./dist/fancifully.js"
14
+ },
15
+ "./fancifully.css": "./dist/fancifully.css",
16
+ "./iife": "./dist/fancifully.iife.js",
17
+ "./package.json": "./package.json"
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "README.md",
22
+ "CHANGELOG.md",
23
+ "LICENSE"
24
+ ],
25
+ "scripts": {
26
+ "dev": "npm run build",
27
+ "build": "vite build --config vite.lib.config.ts && tsc -p tsconfig.build.json --emitDeclarationOnly",
28
+ "test": "tsx --test tests/*.test.ts",
29
+ "pack:fanci": "node scripts/pack-fanci.mjs",
30
+ "pack:check": "npm pack --dry-run",
31
+ "prepack": "npm run build",
32
+ "prepublishOnly": "npm test && npm run build"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/Makefully-Studios/fancifully.git"
40
+ },
41
+ "bugs": {
42
+ "url": "https://github.com/Makefully-Studios/fancifully/issues"
43
+ },
44
+ "homepage": "https://github.com/Makefully-Studios/fancifully#readme",
45
+ "keywords": [
46
+ "fancifully",
47
+ "storybook",
48
+ "interactive",
49
+ "read-aloud",
50
+ "epub",
51
+ "springroll",
52
+ "makefully"
53
+ ],
54
+ "author": "Makefully Studios",
55
+ "license": "MIT",
56
+ "dependencies": {
57
+ "@iconify/utils": "^3.1.7",
58
+ "fflate": "^0.8.3",
59
+ "zod": "^3.24.2"
60
+ },
61
+ "peerDependencies": {
62
+ "springroll": "^2.6.0"
63
+ },
64
+ "peerDependenciesMeta": {
65
+ "springroll": {
66
+ "optional": true
67
+ }
68
+ },
69
+ "devDependencies": {
70
+ "@iconify-json/mdi": "^1.2.3",
71
+ "springroll": "^2.6.0",
72
+ "tsx": "^4.19.3",
73
+ "typescript": "^5.8.2",
74
+ "vite": "^6.0.7"
75
+ }
76
+ }