@makefully/fancifully 0.2.0 → 0.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 (43) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +30 -35
  3. package/dist/Storybook.d.ts +69 -34
  4. package/dist/Storybook.d.ts.map +1 -1
  5. package/dist/fancifully.css +1 -1
  6. package/dist/fancifully.iife.js +4 -4
  7. package/dist/fancifully.js +3105 -2933
  8. package/dist/index.d.ts +9 -7
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/interop/fabricLike.d.ts +124 -0
  11. package/dist/interop/fabricLike.d.ts.map +1 -0
  12. package/dist/{editor → layout}/layoutUnits.d.ts +4 -0
  13. package/dist/{editor → layout}/layoutUnits.d.ts.map +1 -1
  14. package/dist/load/fanciFile.d.ts +6 -0
  15. package/dist/load/fanciFile.d.ts.map +1 -0
  16. package/dist/load/loadEpub.d.ts.map +1 -1
  17. package/dist/nav/Pager.d.ts +10 -3
  18. package/dist/nav/Pager.d.ts.map +1 -1
  19. package/dist/nav/hardback.d.ts +3 -0
  20. package/dist/nav/hardback.d.ts.map +1 -1
  21. package/dist/nav/layoutMode.d.ts +10 -3
  22. package/dist/nav/layoutMode.d.ts.map +1 -1
  23. package/dist/pack/packFanci.d.ts.map +1 -0
  24. package/dist/render/SpreadView.d.ts +20 -2
  25. package/dist/render/SpreadView.d.ts.map +1 -1
  26. package/dist/render/blocks/TextBlock.d.ts.map +1 -1
  27. package/dist/schema/story.d.ts +126 -19
  28. package/dist/schema/story.d.ts.map +1 -1
  29. package/dist/ui/iconifyIcon.d.ts +21 -0
  30. package/dist/ui/iconifyIcon.d.ts.map +1 -0
  31. package/package.json +4 -3
  32. package/dist/editor/EditorChrome.d.ts +0 -33
  33. package/dist/editor/EditorChrome.d.ts.map +0 -1
  34. package/dist/editor/PageCanvas.d.ts +0 -50
  35. package/dist/editor/PageCanvas.d.ts.map +0 -1
  36. package/dist/editor/dropImport.d.ts +0 -16
  37. package/dist/editor/dropImport.d.ts.map +0 -1
  38. package/dist/editor/index.d.ts +0 -7
  39. package/dist/editor/index.d.ts.map +0 -1
  40. package/dist/editor/packFanci.d.ts.map +0 -1
  41. package/dist/editor/storyFabricMap.d.ts +0 -29
  42. package/dist/editor/storyFabricMap.d.ts.map +0 -1
  43. /package/dist/{editor → pack}/packFanci.d.ts +0 -0
@@ -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";
@@ -828,17 +865,43 @@ export declare const storySchema: z.ZodObject<{
828
865
  * Only applies when `frontCover` and/or `backCover` is set.
829
866
  */
830
867
  hardback: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
831
- layout: z.ZodDefault<z.ZodObject<{
832
- /** `single` = one-page; `two-page`; `responsive` = orientation; `auto` = width breakpoint */
833
- mode: z.ZodDefault<z.ZodEnum<["single", "two-page", "responsive", "auto"]>>;
834
- /** Used when `mode` is `auto` (width ≥ breakpoint → two-page). */
835
- singleBreakpoint: z.ZodDefault<z.ZodNumber>;
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;
875
+ }, "strip", z.ZodTypeAny, {
876
+ width: number;
877
+ height: number;
878
+ }, {
879
+ width: number;
880
+ height: number;
881
+ }>>;
882
+ /**
883
+ * Editor alignment rails (margins / gutter). The player ignores these.
884
+ * Show/snap toggles are editor prefs, not story fields.
885
+ */
886
+ guides: z.ZodOptional<z.ZodObject<{
887
+ marginTop: z.ZodDefault<z.ZodNumber>;
888
+ marginRight: z.ZodDefault<z.ZodNumber>;
889
+ marginBottom: z.ZodDefault<z.ZodNumber>;
890
+ marginLeft: z.ZodDefault<z.ZodNumber>;
891
+ /** Snap band around the gutter, in pixels. The split stays at page width. */
892
+ gutterBand: z.ZodDefault<z.ZodNumber>;
836
893
  }, "strip", z.ZodTypeAny, {
837
- mode: "single" | "two-page" | "responsive" | "auto";
838
- singleBreakpoint: number;
894
+ marginTop: number;
895
+ marginRight: number;
896
+ marginBottom: number;
897
+ marginLeft: number;
898
+ gutterBand: number;
839
899
  }, {
840
- mode?: "single" | "two-page" | "responsive" | "auto" | undefined;
841
- singleBreakpoint?: number | undefined;
900
+ marginTop?: number | undefined;
901
+ marginRight?: number | undefined;
902
+ marginBottom?: number | undefined;
903
+ marginLeft?: number | undefined;
904
+ gutterBand?: number | undefined;
842
905
  }>>;
843
906
  fonts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
844
907
  family: z.ZodString;
@@ -901,12 +964,19 @@ export declare const storySchema: z.ZodObject<{
901
964
  background: z.ZodOptional<z.ZodObject<{
902
965
  asset: z.ZodOptional<z.ZodString>;
903
966
  color: z.ZodOptional<z.ZodString>;
967
+ /**
968
+ * Inside face of a cover. When the book is open, this is the rim around
969
+ * the interior pages (the inside of the cover).
970
+ */
971
+ innerColor: z.ZodOptional<z.ZodString>;
904
972
  }, "strip", z.ZodTypeAny, {
905
973
  color?: string | undefined;
906
974
  asset?: string | undefined;
975
+ innerColor?: string | undefined;
907
976
  }, {
908
977
  color?: string | undefined;
909
978
  asset?: string | undefined;
979
+ innerColor?: string | undefined;
910
980
  }>>;
911
981
  readAloud: z.ZodOptional<z.ZodObject<{
912
982
  audio: z.ZodString;
@@ -979,18 +1049,26 @@ export declare const storySchema: z.ZodObject<{
979
1049
  color: z.ZodOptional<z.ZodString>;
980
1050
  textAlign: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
981
1051
  lineHeight: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1052
+ /** Set only when a real bold face of this family is embedded. */
1053
+ fontWeight: z.ZodOptional<z.ZodString>;
1054
+ /** Set only when a real italic face of this family is embedded. */
1055
+ fontStyle: z.ZodOptional<z.ZodString>;
982
1056
  }, "strip", z.ZodTypeAny, {
983
1057
  fontFamily?: string | undefined;
984
1058
  fontSize?: string | undefined;
985
1059
  color?: string | undefined;
986
1060
  textAlign?: "left" | "center" | "right" | undefined;
987
1061
  lineHeight?: string | number | undefined;
1062
+ fontWeight?: string | undefined;
1063
+ fontStyle?: string | undefined;
988
1064
  }, {
989
1065
  fontFamily?: string | undefined;
990
1066
  fontSize?: string | undefined;
991
1067
  color?: string | undefined;
992
1068
  textAlign?: "left" | "center" | "right" | undefined;
993
1069
  lineHeight?: string | number | undefined;
1070
+ fontWeight?: string | undefined;
1071
+ fontStyle?: string | undefined;
994
1072
  }>>;
995
1073
  }, "strip", z.ZodTypeAny, {
996
1074
  type: "text";
@@ -1012,6 +1090,8 @@ export declare const storySchema: z.ZodObject<{
1012
1090
  color?: string | undefined;
1013
1091
  textAlign?: "left" | "center" | "right" | undefined;
1014
1092
  lineHeight?: string | number | undefined;
1093
+ fontWeight?: string | undefined;
1094
+ fontStyle?: string | undefined;
1015
1095
  } | undefined;
1016
1096
  }, {
1017
1097
  type: "text";
@@ -1033,6 +1113,8 @@ export declare const storySchema: z.ZodObject<{
1033
1113
  color?: string | undefined;
1034
1114
  textAlign?: "left" | "center" | "right" | undefined;
1035
1115
  lineHeight?: string | number | undefined;
1116
+ fontWeight?: string | undefined;
1117
+ fontStyle?: string | undefined;
1036
1118
  } | undefined;
1037
1119
  }>, z.ZodObject<{
1038
1120
  id: z.ZodString;
@@ -1214,6 +1296,8 @@ export declare const storySchema: z.ZodObject<{
1214
1296
  color?: string | undefined;
1215
1297
  textAlign?: "left" | "center" | "right" | undefined;
1216
1298
  lineHeight?: string | number | undefined;
1299
+ fontWeight?: string | undefined;
1300
+ fontStyle?: string | undefined;
1217
1301
  } | undefined;
1218
1302
  } | {
1219
1303
  type: "image";
@@ -1254,6 +1338,7 @@ export declare const storySchema: z.ZodObject<{
1254
1338
  background?: {
1255
1339
  color?: string | undefined;
1256
1340
  asset?: string | undefined;
1341
+ innerColor?: string | undefined;
1257
1342
  } | undefined;
1258
1343
  readAloud?: {
1259
1344
  audio: string;
@@ -1269,6 +1354,7 @@ export declare const storySchema: z.ZodObject<{
1269
1354
  background?: {
1270
1355
  color?: string | undefined;
1271
1356
  asset?: string | undefined;
1357
+ innerColor?: string | undefined;
1272
1358
  } | undefined;
1273
1359
  readAloud?: {
1274
1360
  audio: string;
@@ -1299,6 +1385,8 @@ export declare const storySchema: z.ZodObject<{
1299
1385
  color?: string | undefined;
1300
1386
  textAlign?: "left" | "center" | "right" | undefined;
1301
1387
  lineHeight?: string | number | undefined;
1388
+ fontWeight?: string | undefined;
1389
+ fontStyle?: string | undefined;
1302
1390
  } | undefined;
1303
1391
  } | {
1304
1392
  type: "image";
@@ -1339,10 +1427,6 @@ export declare const storySchema: z.ZodObject<{
1339
1427
  }>, "many">;
1340
1428
  }, "strip", z.ZodTypeAny, {
1341
1429
  id: string;
1342
- layout: {
1343
- mode: "single" | "two-page" | "responsive" | "auto";
1344
- singleBreakpoint: number;
1345
- };
1346
1430
  pageSize: {
1347
1431
  width: number;
1348
1432
  height: number;
@@ -1392,6 +1476,8 @@ export declare const storySchema: z.ZodObject<{
1392
1476
  color?: string | undefined;
1393
1477
  textAlign?: "left" | "center" | "right" | undefined;
1394
1478
  lineHeight?: string | number | undefined;
1479
+ fontWeight?: string | undefined;
1480
+ fontStyle?: string | undefined;
1395
1481
  } | undefined;
1396
1482
  } | {
1397
1483
  type: "image";
@@ -1432,6 +1518,7 @@ export declare const storySchema: z.ZodObject<{
1432
1518
  background?: {
1433
1519
  color?: string | undefined;
1434
1520
  asset?: string | undefined;
1521
+ innerColor?: string | undefined;
1435
1522
  } | undefined;
1436
1523
  readAloud?: {
1437
1524
  audio: string;
@@ -1444,6 +1531,17 @@ export declare const storySchema: z.ZodObject<{
1444
1531
  } | undefined;
1445
1532
  }[];
1446
1533
  title?: string | undefined;
1534
+ coverSize?: {
1535
+ width: number;
1536
+ height: number;
1537
+ } | undefined;
1538
+ guides?: {
1539
+ marginTop: number;
1540
+ marginRight: number;
1541
+ marginBottom: number;
1542
+ marginLeft: number;
1543
+ gutterBand: number;
1544
+ } | undefined;
1447
1545
  }, {
1448
1546
  id: string;
1449
1547
  pageSize: {
@@ -1455,6 +1553,7 @@ export declare const storySchema: z.ZodObject<{
1455
1553
  background?: {
1456
1554
  color?: string | undefined;
1457
1555
  asset?: string | undefined;
1556
+ innerColor?: string | undefined;
1458
1557
  } | undefined;
1459
1558
  readAloud?: {
1460
1559
  audio: string;
@@ -1485,6 +1584,8 @@ export declare const storySchema: z.ZodObject<{
1485
1584
  color?: string | undefined;
1486
1585
  textAlign?: "left" | "center" | "right" | undefined;
1487
1586
  lineHeight?: string | number | undefined;
1587
+ fontWeight?: string | undefined;
1588
+ fontStyle?: string | undefined;
1488
1589
  } | undefined;
1489
1590
  } | {
1490
1591
  type: "image";
@@ -1523,14 +1624,21 @@ export declare const storySchema: z.ZodObject<{
1523
1624
  ariaLabel?: string | undefined;
1524
1625
  })[] | undefined;
1525
1626
  }[];
1526
- layout?: {
1527
- mode?: "single" | "two-page" | "responsive" | "auto" | undefined;
1528
- singleBreakpoint?: number | undefined;
1529
- } | undefined;
1530
1627
  title?: string | undefined;
1531
1628
  frontCover?: boolean | undefined;
1532
1629
  backCover?: boolean | undefined;
1533
1630
  hardback?: boolean | undefined;
1631
+ coverSize?: {
1632
+ width: number;
1633
+ height: number;
1634
+ } | undefined;
1635
+ guides?: {
1636
+ marginTop?: number | undefined;
1637
+ marginRight?: number | undefined;
1638
+ marginBottom?: number | undefined;
1639
+ marginLeft?: number | undefined;
1640
+ gutterBand?: number | undefined;
1641
+ } | undefined;
1534
1642
  fonts?: {
1535
1643
  src: string;
1536
1644
  family: string;
@@ -1553,13 +1661,12 @@ export declare const storySchema: z.ZodObject<{
1553
1661
  }> | undefined;
1554
1662
  }>;
1555
1663
  export type Story = z.infer<typeof storySchema>;
1664
+ export type BookGuides = NonNullable<Story['guides']>;
1556
1665
  export type StoryPage = z.infer<typeof pageSchema>;
1557
1666
  export type StoryBlock = z.infer<typeof blockSchema>;
1558
1667
  export type StoryAsset = z.infer<typeof assetSchema>;
1559
1668
  export type Cue = z.infer<typeof cueSchema>;
1560
1669
  export type LayoutBox = z.infer<typeof layoutBoxSchema>;
1561
- export type LayoutMode = 'single' | 'two-page' | 'responsive' | 'auto';
1562
- export type ResolvedLayoutMode = 'single' | 'two-page';
1563
1670
  export type TapAction = z.infer<typeof tapActionSchema>;
1564
1671
  export type AudioChannel = 'vo' | 'sfx' | 'music';
1565
1672
  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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAItB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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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,6 +1,6 @@
1
1
  {
2
2
  "name": "@makefully/fancifully",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "DOM-based interactive storybook engine with SpringRoll audio and VO↔text sync.",
5
5
  "type": "module",
6
6
  "main": "./dist/fancifully.js",
@@ -23,7 +23,7 @@
23
23
  "LICENSE"
24
24
  ],
25
25
  "scripts": {
26
- "dev": "vite --config vite.demo.config.ts",
26
+ "dev": "npm run build",
27
27
  "build": "vite build --config vite.lib.config.ts && tsc -p tsconfig.build.json --emitDeclarationOnly",
28
28
  "test": "tsx --test tests/*.test.ts",
29
29
  "pack:fanci": "node scripts/pack-fanci.mjs",
@@ -54,7 +54,7 @@
54
54
  "author": "Makefully Studios",
55
55
  "license": "MIT",
56
56
  "dependencies": {
57
- "fabric": "^6.6.5",
57
+ "@iconify/utils": "^3.1.7",
58
58
  "fflate": "^0.8.3",
59
59
  "zod": "^3.24.2"
60
60
  },
@@ -67,6 +67,7 @@
67
67
  }
68
68
  },
69
69
  "devDependencies": {
70
+ "@iconify-json/mdi": "^1.2.3",
70
71
  "springroll": "^2.6.0",
71
72
  "tsx": "^4.19.3",
72
73
  "typescript": "^5.8.2",
@@ -1,33 +0,0 @@
1
- export type EditorChromeHandlers = {
2
- onToggleEdit: () => void;
3
- onAddPage: () => void;
4
- onRemovePage: () => void;
5
- onFrontCoverChange: (enabled: boolean) => void;
6
- onBackCoverChange: (enabled: boolean) => void;
7
- onHardbackChange: (enabled: boolean) => void;
8
- onDownload: () => void;
9
- };
10
- export type EditorChromeState = {
11
- editing: boolean;
12
- frontCover: boolean;
13
- backCover: boolean;
14
- hardback: boolean;
15
- canRemovePage: boolean;
16
- };
17
- /**
18
- * Corner Edit / Preview toggle + toolbar (add/remove page, cover toggles, download).
19
- */
20
- export declare class EditorChrome {
21
- readonly element: HTMLElement;
22
- private toggleBtn;
23
- private toolbar;
24
- private frontCoverInput;
25
- private backCoverInput;
26
- private hardbackInput;
27
- private removeBtn;
28
- private handlers;
29
- constructor(handlers: EditorChromeHandlers);
30
- setState(state: EditorChromeState): void;
31
- destroy(): void;
32
- }
33
- //# sourceMappingURL=EditorChrome.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditorChrome.d.ts","sourceRoot":"","sources":["../../src/editor/EditorChrome.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,iBAAiB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,gBAAgB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,qBAAa,YAAY;IACvB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,cAAc,CAAmB;IACzC,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,QAAQ,CAAuB;gBAE3B,QAAQ,EAAE,oBAAoB;IAkE1C,QAAQ,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAWxC,OAAO,IAAI,IAAI;CAGhB"}
@@ -1,50 +0,0 @@
1
- import type { LoadedAssets } from '../load/loadStory.js';
2
- import type { Story, StoryPage } from '../schema/story.js';
3
- export type PageCanvasHost = {
4
- story: Story;
5
- assets: LoadedAssets;
6
- /** Zip-relative path → bytes for packFanci (dropped fonts/images). */
7
- editorFiles: Record<string, Uint8Array>;
8
- blobUrls: string[];
9
- getDefaultFontFamily: () => string | null;
10
- setDefaultFontFamily: (family: string) => void;
11
- /** Apply font to every textbox on every open editor canvas + story text styles. */
12
- applyFontToAllTextboxes: (family: string) => void;
13
- };
14
- /**
15
- * Fabric canvas overlay for one story page leaf.
16
- * Sized to `pageSize` (unscaled); the leaf / book transform scales it with the page.
17
- */
18
- export declare class PageCanvas {
19
- readonly element: HTMLElement;
20
- private canvasEl;
21
- private fabricCanvas;
22
- private page;
23
- private assets;
24
- private pageSize;
25
- private fabricMod;
26
- private dirty;
27
- private host;
28
- private constructor();
29
- static create(page: StoryPage, pageSize: {
30
- width: number;
31
- height: number;
32
- }, host: PageCanvasHost): Promise<PageCanvas>;
33
- private mount;
34
- /** Sync Fabric's CSS/backing store after the overlay is attached to a leaf. */
35
- syncLayout(): void;
36
- get isDirty(): boolean;
37
- markDirty(): void;
38
- /** Apply a font family to every text object on this canvas. */
39
- applyFontToAllText(family: string): void;
40
- /** Commit canvas state into a StoryPage (does not mutate the original). */
41
- commit(): StoryPage;
42
- get pageId(): string;
43
- reload(page: StoryPage): Promise<void>;
44
- destroy(): void;
45
- private handleDrop;
46
- private dropFont;
47
- private dropImage;
48
- private dropText;
49
- }
50
- //# sourceMappingURL=PageCanvas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PageCanvas.d.ts","sourceRoot":"","sources":["../../src/editor/PageCanvas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAoB3D,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,oBAAoB,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAC1C,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,mFAAmF;IACnF,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF;;;GAGG;AACH,qBAAa,UAAU;IACrB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,OAAO,CAAC,QAAQ,CAAoB;IACpC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAoC;IACpD,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,IAAI,CAAiB;IAE7B,OAAO;WAoBM,MAAM,CACjB,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAC3C,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,UAAU,CAAC;YAMR,KAAK;IAiCnB,+EAA+E;IAC/E,UAAU,IAAI,IAAI;IAUlB,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,SAAS,IAAI,IAAI;IAIjB,+DAA+D;IAC/D,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAWxC,2EAA2E;IAC3E,MAAM,IAAI,SAAS;IAQnB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAEK,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAS5C,OAAO,IAAI,IAAI;YAMD,UAAU;YAuCV,QAAQ;YA6BR,SAAS;IAwCvB,OAAO,CAAC,QAAQ;CAqBjB"}
@@ -1,16 +0,0 @@
1
- export type DropKind = 'font' | 'image' | 'text' | 'unknown';
2
- export declare function extensionOf(filename: string): string;
3
- export declare function classifyFile(file: File): DropKind;
4
- /** Family name derived from a font filename (no extension). */
5
- export declare function familyFromFilename(filename: string): string;
6
- export declare function uniqueId(prefix: string): string;
7
- export declare function uniqueFamily(base: string, existing: Iterable<string>): string;
8
- export declare function readFileBytes(file: File): Promise<Uint8Array>;
9
- export declare function loadImageElement(url: string): Promise<HTMLImageElement>;
10
- export declare function registerFontFace(family: string, url: string, descriptors?: {
11
- weight?: string;
12
- style?: string;
13
- }): Promise<FontFace>;
14
- /** Plain text from a drop (files and/or text/plain / text/html). */
15
- export declare function extractDroppedText(dt: DataTransfer): Promise<string | null>;
16
- //# sourceMappingURL=dropImport.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dropImport.d.ts","sourceRoot":"","sources":["../../src/editor/dropImport.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAK7D,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,CAajD;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,CAM7E;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,CAEnE;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAS7E;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,OAAO,CAAC,QAAQ,CAAC,CAQnB;AAED,oEAAoE;AACpE,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBjF"}
@@ -1,7 +0,0 @@
1
- export { EditorChrome, type EditorChromeHandlers, type EditorChromeState } from './EditorChrome.js';
2
- export { PageCanvas, type PageCanvasHost } from './PageCanvas.js';
3
- export { packFanci, downloadBlob, type PackFanciOptions } from './packFanci.js';
4
- export { storyToFabric, fabricToStory, reflowTextboxScale, createEditorTextbox, } from './storyFabricMap.js';
5
- export { boxToPixels, FABRIC_CSS_FONT_SIZE_MULT, htmlToPlainText, plainTextToHtml, resolveCssLineHeight, serializeLayoutBox, toPx, } from './layoutUnits.js';
6
- export { classifyFile, extractDroppedText, familyFromFilename, type DropKind, } from './dropImport.js';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACL,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,yBAAyB,EACzB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,QAAQ,GACd,MAAM,iBAAiB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"packFanci.d.ts","sourceRoot":"","sources":["../../src/editor/packFanci.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACnC,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAyBF;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyD3F;AAED,4CAA4C;AAC5C,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAU/D"}
@@ -1,29 +0,0 @@
1
- import type { Canvas, Textbox } from 'fabric';
2
- import type { LoadedAssets } from '../load/loadStory.js';
3
- import type { StoryPage } from '../schema/story.js';
4
- import { type PageSize } from './layoutUnits.js';
5
- export type FabricModule = typeof import('fabric');
6
- /**
7
- * If anything applies scale to a Textbox (e.g. shift+corner), bake scaleX into
8
- * width and reset scale so glyphs stay the same size and lines reflow.
9
- */
10
- export declare function reflowTextboxScale(textbox: Textbox): void;
11
- export type EditorTextboxOptions = {
12
- blockId: string;
13
- text: string;
14
- left: number;
15
- top: number;
16
- width: number;
17
- fontFamily?: string;
18
- fontSize?: number;
19
- fill?: string;
20
- textAlign?: 'left' | 'center' | 'right';
21
- lineHeight?: number;
22
- };
23
- /** Create a Fabric Textbox configured for editor use (wrap resize, CSS-matched LH). */
24
- export declare function createEditorTextbox(fabric: FabricModule, options: EditorTextboxOptions): Textbox;
25
- /** Load page background + text/image blocks onto a Fabric canvas. Hotspots are skipped. */
26
- export declare function storyToFabric(canvas: Canvas, page: StoryPage, assets: LoadedAssets, fabric: FabricModule): Promise<void>;
27
- /** Write Fabric object geometry/text back into the page. Hotspot blocks are preserved. */
28
- export declare function fabricToStory(canvas: Canvas, page: StoryPage, pageSize?: PageSize): StoryPage;
29
- //# sourceMappingURL=storyFabricMap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storyFabricMap.d.ts","sourceRoot":"","sources":["../../src/editor/storyFabricMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAA6B,OAAO,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC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