@makefully/fancifully 0.2.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.
- package/CHANGELOG.md +19 -0
- package/README.md +30 -35
- package/dist/Storybook.d.ts +69 -34
- package/dist/Storybook.d.ts.map +1 -1
- package/dist/fancifully.css +1 -1
- package/dist/fancifully.iife.js +4 -4
- package/dist/fancifully.js +3139 -2967
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/interop/fabricLike.d.ts +124 -0
- package/dist/interop/fabricLike.d.ts.map +1 -0
- package/dist/{editor → layout}/layoutUnits.d.ts +4 -0
- package/dist/{editor → layout}/layoutUnits.d.ts.map +1 -1
- package/dist/load/fanciFile.d.ts +6 -0
- package/dist/load/fanciFile.d.ts.map +1 -0
- package/dist/load/loadEpub.d.ts.map +1 -1
- package/dist/nav/Pager.d.ts +10 -3
- package/dist/nav/Pager.d.ts.map +1 -1
- package/dist/nav/hardback.d.ts +3 -0
- package/dist/nav/hardback.d.ts.map +1 -1
- package/dist/nav/layoutMode.d.ts +10 -3
- package/dist/nav/layoutMode.d.ts.map +1 -1
- package/dist/pack/packFanci.d.ts.map +1 -0
- package/dist/render/SpreadView.d.ts +20 -2
- package/dist/render/SpreadView.d.ts.map +1 -1
- package/dist/render/blocks/TextBlock.d.ts.map +1 -1
- package/dist/schema/story.d.ts +138 -19
- package/dist/schema/story.d.ts.map +1 -1
- package/dist/ui/iconifyIcon.d.ts +21 -0
- package/dist/ui/iconifyIcon.d.ts.map +1 -0
- package/package.json +4 -3
- package/dist/editor/EditorChrome.d.ts +0 -33
- package/dist/editor/EditorChrome.d.ts.map +0 -1
- package/dist/editor/PageCanvas.d.ts +0 -50
- package/dist/editor/PageCanvas.d.ts.map +0 -1
- package/dist/editor/dropImport.d.ts +0 -16
- package/dist/editor/dropImport.d.ts.map +0 -1
- package/dist/editor/index.d.ts +0 -7
- package/dist/editor/index.d.ts.map +0 -1
- package/dist/editor/packFanci.d.ts.map +0 -1
- package/dist/editor/storyFabricMap.d.ts +0 -29
- package/dist/editor/storyFabricMap.d.ts.map +0 -1
- /package/dist/{editor → pack}/packFanci.d.ts +0 -0
package/dist/schema/story.d.ts
CHANGED
|
@@ -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,49 @@ 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
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
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
|
+
/** 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>;
|
|
836
893
|
}, "strip", z.ZodTypeAny, {
|
|
837
|
-
|
|
838
|
-
|
|
894
|
+
marginTop: number;
|
|
895
|
+
marginRight: number;
|
|
896
|
+
marginBottom: number;
|
|
897
|
+
marginLeft: number;
|
|
898
|
+
gutterBand: number;
|
|
899
|
+
showGuides: boolean;
|
|
900
|
+
snapGuides: boolean;
|
|
901
|
+
snapObjects: boolean;
|
|
839
902
|
}, {
|
|
840
|
-
|
|
841
|
-
|
|
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;
|
|
842
911
|
}>>;
|
|
843
912
|
fonts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
844
913
|
family: z.ZodString;
|
|
@@ -901,12 +970,19 @@ export declare const storySchema: z.ZodObject<{
|
|
|
901
970
|
background: z.ZodOptional<z.ZodObject<{
|
|
902
971
|
asset: z.ZodOptional<z.ZodString>;
|
|
903
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>;
|
|
904
978
|
}, "strip", z.ZodTypeAny, {
|
|
905
979
|
color?: string | undefined;
|
|
906
980
|
asset?: string | undefined;
|
|
981
|
+
innerColor?: string | undefined;
|
|
907
982
|
}, {
|
|
908
983
|
color?: string | undefined;
|
|
909
984
|
asset?: string | undefined;
|
|
985
|
+
innerColor?: string | undefined;
|
|
910
986
|
}>>;
|
|
911
987
|
readAloud: z.ZodOptional<z.ZodObject<{
|
|
912
988
|
audio: z.ZodString;
|
|
@@ -979,18 +1055,26 @@ export declare const storySchema: z.ZodObject<{
|
|
|
979
1055
|
color: z.ZodOptional<z.ZodString>;
|
|
980
1056
|
textAlign: z.ZodOptional<z.ZodEnum<["left", "center", "right"]>>;
|
|
981
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>;
|
|
982
1062
|
}, "strip", z.ZodTypeAny, {
|
|
983
1063
|
fontFamily?: string | undefined;
|
|
984
1064
|
fontSize?: string | undefined;
|
|
985
1065
|
color?: string | undefined;
|
|
986
1066
|
textAlign?: "left" | "center" | "right" | undefined;
|
|
987
1067
|
lineHeight?: string | number | undefined;
|
|
1068
|
+
fontWeight?: string | undefined;
|
|
1069
|
+
fontStyle?: string | undefined;
|
|
988
1070
|
}, {
|
|
989
1071
|
fontFamily?: string | undefined;
|
|
990
1072
|
fontSize?: string | undefined;
|
|
991
1073
|
color?: string | undefined;
|
|
992
1074
|
textAlign?: "left" | "center" | "right" | undefined;
|
|
993
1075
|
lineHeight?: string | number | undefined;
|
|
1076
|
+
fontWeight?: string | undefined;
|
|
1077
|
+
fontStyle?: string | undefined;
|
|
994
1078
|
}>>;
|
|
995
1079
|
}, "strip", z.ZodTypeAny, {
|
|
996
1080
|
type: "text";
|
|
@@ -1012,6 +1096,8 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1012
1096
|
color?: string | undefined;
|
|
1013
1097
|
textAlign?: "left" | "center" | "right" | undefined;
|
|
1014
1098
|
lineHeight?: string | number | undefined;
|
|
1099
|
+
fontWeight?: string | undefined;
|
|
1100
|
+
fontStyle?: string | undefined;
|
|
1015
1101
|
} | undefined;
|
|
1016
1102
|
}, {
|
|
1017
1103
|
type: "text";
|
|
@@ -1033,6 +1119,8 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1033
1119
|
color?: string | undefined;
|
|
1034
1120
|
textAlign?: "left" | "center" | "right" | undefined;
|
|
1035
1121
|
lineHeight?: string | number | undefined;
|
|
1122
|
+
fontWeight?: string | undefined;
|
|
1123
|
+
fontStyle?: string | undefined;
|
|
1036
1124
|
} | undefined;
|
|
1037
1125
|
}>, z.ZodObject<{
|
|
1038
1126
|
id: z.ZodString;
|
|
@@ -1214,6 +1302,8 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1214
1302
|
color?: string | undefined;
|
|
1215
1303
|
textAlign?: "left" | "center" | "right" | undefined;
|
|
1216
1304
|
lineHeight?: string | number | undefined;
|
|
1305
|
+
fontWeight?: string | undefined;
|
|
1306
|
+
fontStyle?: string | undefined;
|
|
1217
1307
|
} | undefined;
|
|
1218
1308
|
} | {
|
|
1219
1309
|
type: "image";
|
|
@@ -1254,6 +1344,7 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1254
1344
|
background?: {
|
|
1255
1345
|
color?: string | undefined;
|
|
1256
1346
|
asset?: string | undefined;
|
|
1347
|
+
innerColor?: string | undefined;
|
|
1257
1348
|
} | undefined;
|
|
1258
1349
|
readAloud?: {
|
|
1259
1350
|
audio: string;
|
|
@@ -1269,6 +1360,7 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1269
1360
|
background?: {
|
|
1270
1361
|
color?: string | undefined;
|
|
1271
1362
|
asset?: string | undefined;
|
|
1363
|
+
innerColor?: string | undefined;
|
|
1272
1364
|
} | undefined;
|
|
1273
1365
|
readAloud?: {
|
|
1274
1366
|
audio: string;
|
|
@@ -1299,6 +1391,8 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1299
1391
|
color?: string | undefined;
|
|
1300
1392
|
textAlign?: "left" | "center" | "right" | undefined;
|
|
1301
1393
|
lineHeight?: string | number | undefined;
|
|
1394
|
+
fontWeight?: string | undefined;
|
|
1395
|
+
fontStyle?: string | undefined;
|
|
1302
1396
|
} | undefined;
|
|
1303
1397
|
} | {
|
|
1304
1398
|
type: "image";
|
|
@@ -1339,10 +1433,6 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1339
1433
|
}>, "many">;
|
|
1340
1434
|
}, "strip", z.ZodTypeAny, {
|
|
1341
1435
|
id: string;
|
|
1342
|
-
layout: {
|
|
1343
|
-
mode: "single" | "two-page" | "responsive" | "auto";
|
|
1344
|
-
singleBreakpoint: number;
|
|
1345
|
-
};
|
|
1346
1436
|
pageSize: {
|
|
1347
1437
|
width: number;
|
|
1348
1438
|
height: number;
|
|
@@ -1392,6 +1482,8 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1392
1482
|
color?: string | undefined;
|
|
1393
1483
|
textAlign?: "left" | "center" | "right" | undefined;
|
|
1394
1484
|
lineHeight?: string | number | undefined;
|
|
1485
|
+
fontWeight?: string | undefined;
|
|
1486
|
+
fontStyle?: string | undefined;
|
|
1395
1487
|
} | undefined;
|
|
1396
1488
|
} | {
|
|
1397
1489
|
type: "image";
|
|
@@ -1432,6 +1524,7 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1432
1524
|
background?: {
|
|
1433
1525
|
color?: string | undefined;
|
|
1434
1526
|
asset?: string | undefined;
|
|
1527
|
+
innerColor?: string | undefined;
|
|
1435
1528
|
} | undefined;
|
|
1436
1529
|
readAloud?: {
|
|
1437
1530
|
audio: string;
|
|
@@ -1444,6 +1537,20 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1444
1537
|
} | undefined;
|
|
1445
1538
|
}[];
|
|
1446
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;
|
|
1447
1554
|
}, {
|
|
1448
1555
|
id: string;
|
|
1449
1556
|
pageSize: {
|
|
@@ -1455,6 +1562,7 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1455
1562
|
background?: {
|
|
1456
1563
|
color?: string | undefined;
|
|
1457
1564
|
asset?: string | undefined;
|
|
1565
|
+
innerColor?: string | undefined;
|
|
1458
1566
|
} | undefined;
|
|
1459
1567
|
readAloud?: {
|
|
1460
1568
|
audio: string;
|
|
@@ -1485,6 +1593,8 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1485
1593
|
color?: string | undefined;
|
|
1486
1594
|
textAlign?: "left" | "center" | "right" | undefined;
|
|
1487
1595
|
lineHeight?: string | number | undefined;
|
|
1596
|
+
fontWeight?: string | undefined;
|
|
1597
|
+
fontStyle?: string | undefined;
|
|
1488
1598
|
} | undefined;
|
|
1489
1599
|
} | {
|
|
1490
1600
|
type: "image";
|
|
@@ -1523,14 +1633,24 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1523
1633
|
ariaLabel?: string | undefined;
|
|
1524
1634
|
})[] | undefined;
|
|
1525
1635
|
}[];
|
|
1526
|
-
layout?: {
|
|
1527
|
-
mode?: "single" | "two-page" | "responsive" | "auto" | undefined;
|
|
1528
|
-
singleBreakpoint?: number | undefined;
|
|
1529
|
-
} | undefined;
|
|
1530
1636
|
title?: string | undefined;
|
|
1531
1637
|
frontCover?: boolean | undefined;
|
|
1532
1638
|
backCover?: boolean | undefined;
|
|
1533
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;
|
|
1534
1654
|
fonts?: {
|
|
1535
1655
|
src: string;
|
|
1536
1656
|
family: string;
|
|
@@ -1553,13 +1673,12 @@ export declare const storySchema: z.ZodObject<{
|
|
|
1553
1673
|
}> | undefined;
|
|
1554
1674
|
}>;
|
|
1555
1675
|
export type Story = z.infer<typeof storySchema>;
|
|
1676
|
+
export type BookGuides = NonNullable<Story['guides']>;
|
|
1556
1677
|
export type StoryPage = z.infer<typeof pageSchema>;
|
|
1557
1678
|
export type StoryBlock = z.infer<typeof blockSchema>;
|
|
1558
1679
|
export type StoryAsset = z.infer<typeof assetSchema>;
|
|
1559
1680
|
export type Cue = z.infer<typeof cueSchema>;
|
|
1560
1681
|
export type LayoutBox = z.infer<typeof layoutBoxSchema>;
|
|
1561
|
-
export type LayoutMode = 'single' | 'two-page' | 'responsive' | 'auto';
|
|
1562
|
-
export type ResolvedLayoutMode = 'single' | 'two-page';
|
|
1563
1682
|
export type TapAction = z.infer<typeof tapActionSchema>;
|
|
1564
1683
|
export type AudioChannel = 'vo' | 'sfx' | 'music';
|
|
1565
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;
|
|
1
|
+
{"version":3,"file":"story.d.ts","sourceRoot":"","sources":["../../src/schema/story.ts"],"names":[],"mappings":"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"}
|
|
@@ -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.
|
|
3
|
+
"version": "0.3.0",
|
|
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": "
|
|
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
|
-
"
|
|
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"}
|
package/dist/editor/index.d.ts
DELETED
|
@@ -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;AACzD,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAQL,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,YAAY,GAAG,cAAc,QAAQ,CAAC,CAAC;AAQnD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAUzD;AAWD,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,uFAAuF;AACvF,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAqCT;AAED,2FAA2F;AAC3F,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CA8Ff;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,QAAQ,CAAC,EAAE,QAAQ,GAClB,SAAS,CA0FX"}
|
|
File without changes
|