@ankhorage/zora 3.0.1 → 3.1.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 +12 -0
- package/README.md +1 -1
- package/dist/components/card/meta.d.ts +1 -1
- package/dist/components/form/types.d.ts.map +1 -1
- package/dist/components/form/types.js.map +1 -1
- package/dist/components/media-card/types.d.ts.map +1 -1
- package/dist/components/media-card/types.js.map +1 -1
- package/dist/components/text/Text.d.ts.map +1 -1
- package/dist/components/text/Text.js +2 -2
- package/dist/components/text/Text.js.map +1 -1
- package/dist/components/text/types.d.ts +2 -1
- package/dist/components/text/types.d.ts.map +1 -1
- package/dist/components/text/types.js.map +1 -1
- package/dist/foundation/meta.d.ts +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/layout/screen/meta.d.ts +1 -1
- package/dist/layout/screen-section/meta.d.ts +1 -1
- package/dist/metadata/allowedChildren.d.ts +3 -3
- package/dist/metadata/allowedChildren.d.ts.map +1 -1
- package/dist/metadata/allowedChildren.js +1 -0
- package/dist/metadata/allowedChildren.js.map +1 -1
- package/dist/metadata/bindableComponentMeta.d.ts +485 -0
- package/dist/metadata/bindableComponentMeta.d.ts.map +1 -1
- package/dist/metadata/bindableComponentMeta.js +102 -0
- package/dist/metadata/bindableComponentMeta.js.map +1 -1
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +2 -0
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/metadata/themeRecipeTypes.d.ts.map +1 -1
- package/dist/metadata/themeRecipeTypes.js.map +1 -1
- package/dist/metadata/types.d.ts.map +1 -1
- package/dist/metadata/types.js.map +1 -1
- package/dist/patterns/message-bubble/meta.d.ts +1 -1
- package/dist/patterns/notice/meta.d.ts +1 -1
- package/dist/patterns/panel/meta.d.ts +1 -1
- package/dist/patterns/post-card/meta.d.ts +1 -1
- package/dist/patterns/reader/ReaderSurface.d.ts +11 -0
- package/dist/patterns/reader/ReaderSurface.d.ts.map +1 -0
- package/dist/patterns/reader/ReaderSurface.js +95 -0
- package/dist/patterns/reader/ReaderSurface.js.map +1 -0
- package/dist/patterns/reader/index.d.ts +4 -0
- package/dist/patterns/reader/index.d.ts.map +1 -0
- package/dist/patterns/reader/index.js +3 -0
- package/dist/patterns/reader/index.js.map +1 -0
- package/dist/patterns/reader/meta.d.ts +328 -0
- package/dist/patterns/reader/meta.d.ts.map +1 -0
- package/dist/patterns/reader/meta.js +293 -0
- package/dist/patterns/reader/meta.js.map +1 -0
- package/dist/patterns/reader/resolveReaderProgress.d.ts +6 -0
- package/dist/patterns/reader/resolveReaderProgress.d.ts.map +1 -0
- package/dist/patterns/reader/resolveReaderProgress.js +17 -0
- package/dist/patterns/reader/resolveReaderProgress.js.map +1 -0
- package/dist/patterns/reader/types.d.ts +69 -0
- package/dist/patterns/reader/types.d.ts.map +1 -0
- package/dist/patterns/reader/types.js +2 -0
- package/dist/patterns/reader/types.js.map +1 -0
- package/dist/patterns/scanner/meta.d.ts +2 -2
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +2 -0
- package/dist/registry.js.map +1 -1
- package/dist/theme/useZoraTheme.d.ts +1 -1
- package/package.json +11 -12
- package/src/components/form/types.ts +1 -2
- package/src/components/media-card/types.ts +1 -3
- package/src/components/text/Text.tsx +2 -0
- package/src/components/text/types.ts +7 -1
- package/src/expo57Migration.test.ts +18 -14
- package/src/index.ts +14 -0
- package/src/interactionPolicy.test.ts +30 -0
- package/src/metadata/allowedChildren.ts +1 -0
- package/src/metadata/bindableComponentMeta.test.ts +30 -0
- package/src/metadata/bindableComponentMeta.ts +102 -0
- package/src/metadata/componentMeta.test.ts +36 -0
- package/src/metadata/componentMeta.ts +2 -0
- package/src/metadata/themeRecipeTypes.ts +1 -3
- package/src/metadata/types.ts +1 -6
- package/src/patterns/reader/ReaderSurface.test.ts +46 -0
- package/src/patterns/reader/ReaderSurface.tsx +348 -0
- package/src/patterns/reader/index.ts +15 -0
- package/src/patterns/reader/meta.ts +296 -0
- package/src/patterns/reader/resolveReaderProgress.test.ts +31 -0
- package/src/patterns/reader/resolveReaderProgress.ts +29 -0
- package/src/patterns/reader/types.ts +80 -0
- package/src/registry.ts +2 -0
- package/src/showcaseCoverage.test.ts +1 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
export declare const readerSurfaceMeta: {
|
|
2
|
+
readonly name: "ReaderSurface";
|
|
3
|
+
readonly category: "pattern";
|
|
4
|
+
readonly description: "Adapter-neutral EPUB and PDF reader shell with controlled chrome, progress, and navigation events.";
|
|
5
|
+
readonly directManifestNode: true;
|
|
6
|
+
readonly requirements: {
|
|
7
|
+
readonly capabilities: readonly [{
|
|
8
|
+
readonly capability: "ebookReader";
|
|
9
|
+
}];
|
|
10
|
+
};
|
|
11
|
+
readonly allowedChildren: readonly [];
|
|
12
|
+
readonly blueprint: {
|
|
13
|
+
readonly label: "Reader";
|
|
14
|
+
readonly defaultProps: {
|
|
15
|
+
readonly format: "epub";
|
|
16
|
+
readonly status: "idle";
|
|
17
|
+
readonly showChrome: true;
|
|
18
|
+
readonly readerColorScheme: "system";
|
|
19
|
+
readonly fontScale: 1;
|
|
20
|
+
readonly lineHeight: "normal";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly events: {
|
|
24
|
+
readonly previousPage: {
|
|
25
|
+
readonly label: "Previous page";
|
|
26
|
+
readonly eventType: "reader.previousPage";
|
|
27
|
+
readonly description: "Requests navigation to the previous page.";
|
|
28
|
+
readonly payloadFields: readonly [];
|
|
29
|
+
};
|
|
30
|
+
readonly nextPage: {
|
|
31
|
+
readonly label: "Next page";
|
|
32
|
+
readonly eventType: "reader.nextPage";
|
|
33
|
+
readonly description: "Requests navigation to the next page.";
|
|
34
|
+
readonly payloadFields: readonly [];
|
|
35
|
+
};
|
|
36
|
+
readonly locationChange: {
|
|
37
|
+
readonly label: "Location change";
|
|
38
|
+
readonly eventType: "reader.locationChange";
|
|
39
|
+
readonly description: "Emitted by the adapter after the destination has been displayed.";
|
|
40
|
+
readonly payloadFields: readonly [{
|
|
41
|
+
readonly path: "format";
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
readonly label: "Format";
|
|
44
|
+
}, {
|
|
45
|
+
readonly path: "locator";
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly label: "Opaque locator";
|
|
48
|
+
}, {
|
|
49
|
+
readonly path: "page";
|
|
50
|
+
readonly type: "number";
|
|
51
|
+
readonly label: "Page";
|
|
52
|
+
}, {
|
|
53
|
+
readonly path: "pageCount";
|
|
54
|
+
readonly type: "number";
|
|
55
|
+
readonly label: "Page count";
|
|
56
|
+
}, {
|
|
57
|
+
readonly path: "progression";
|
|
58
|
+
readonly type: "number";
|
|
59
|
+
readonly label: "Progression";
|
|
60
|
+
}, {
|
|
61
|
+
readonly path: "chapterId";
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
readonly label: "Chapter ID";
|
|
64
|
+
}, {
|
|
65
|
+
readonly path: "chapterTitle";
|
|
66
|
+
readonly type: "string";
|
|
67
|
+
readonly label: "Chapter title";
|
|
68
|
+
}, {
|
|
69
|
+
readonly path: "trigger";
|
|
70
|
+
readonly type: "string";
|
|
71
|
+
readonly label: "Navigation trigger";
|
|
72
|
+
}];
|
|
73
|
+
};
|
|
74
|
+
readonly openContents: {
|
|
75
|
+
readonly label: "Open contents";
|
|
76
|
+
readonly eventType: "reader.openContents";
|
|
77
|
+
readonly description: "Requests the app-owned table of contents.";
|
|
78
|
+
readonly payloadFields: readonly [];
|
|
79
|
+
};
|
|
80
|
+
readonly openAppearance: {
|
|
81
|
+
readonly label: "Open appearance";
|
|
82
|
+
readonly eventType: "reader.openAppearance";
|
|
83
|
+
readonly description: "Requests the app-owned reader appearance controls.";
|
|
84
|
+
readonly payloadFields: readonly [];
|
|
85
|
+
};
|
|
86
|
+
readonly toggleHighlight: {
|
|
87
|
+
readonly label: "Toggle highlight";
|
|
88
|
+
readonly eventType: "reader.toggleHighlight";
|
|
89
|
+
readonly description: "Requests the app-owned highlight action.";
|
|
90
|
+
readonly payloadFields: readonly [];
|
|
91
|
+
};
|
|
92
|
+
readonly openExternalLink: {
|
|
93
|
+
readonly label: "Open external link";
|
|
94
|
+
readonly eventType: "reader.openExternalLink";
|
|
95
|
+
readonly description: "Emitted when publication content requests an external URL.";
|
|
96
|
+
readonly payloadFields: readonly [{
|
|
97
|
+
readonly path: "url";
|
|
98
|
+
readonly type: "string";
|
|
99
|
+
readonly label: "URL";
|
|
100
|
+
}];
|
|
101
|
+
};
|
|
102
|
+
readonly readerError: {
|
|
103
|
+
readonly label: "Reader error";
|
|
104
|
+
readonly eventType: "reader.error";
|
|
105
|
+
readonly description: "Emitted when the adapter rejects or cannot load a document.";
|
|
106
|
+
readonly payloadFields: readonly [{
|
|
107
|
+
readonly path: "code";
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
readonly label: "Error code";
|
|
110
|
+
}, {
|
|
111
|
+
readonly path: "format";
|
|
112
|
+
readonly type: "string";
|
|
113
|
+
readonly label: "Format";
|
|
114
|
+
}, {
|
|
115
|
+
readonly path: "message";
|
|
116
|
+
readonly type: "string";
|
|
117
|
+
readonly label: "Message";
|
|
118
|
+
}];
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
readonly slots: {
|
|
122
|
+
readonly viewport: {
|
|
123
|
+
readonly label: "Reader viewport adapter";
|
|
124
|
+
readonly allowedChildren: readonly [];
|
|
125
|
+
};
|
|
126
|
+
readonly headerActions: {
|
|
127
|
+
readonly label: "Header actions";
|
|
128
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ReaderSurface"];
|
|
129
|
+
};
|
|
130
|
+
readonly footerActions: {
|
|
131
|
+
readonly label: "Footer actions";
|
|
132
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ReaderSurface"];
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
readonly props: {
|
|
136
|
+
readonly source: {
|
|
137
|
+
readonly type: "media";
|
|
138
|
+
readonly category: "Document";
|
|
139
|
+
readonly label: "Source";
|
|
140
|
+
readonly mediaKinds: readonly ["file"];
|
|
141
|
+
};
|
|
142
|
+
readonly format: {
|
|
143
|
+
readonly type: "enum";
|
|
144
|
+
readonly category: "Document";
|
|
145
|
+
readonly label: "Format";
|
|
146
|
+
readonly enum: readonly ["epub", "pdf"];
|
|
147
|
+
readonly default: "epub";
|
|
148
|
+
};
|
|
149
|
+
readonly location: {
|
|
150
|
+
readonly type: "string";
|
|
151
|
+
readonly category: "State";
|
|
152
|
+
readonly label: "Location";
|
|
153
|
+
};
|
|
154
|
+
readonly status: {
|
|
155
|
+
readonly type: "enum";
|
|
156
|
+
readonly category: "State";
|
|
157
|
+
readonly label: "Status";
|
|
158
|
+
readonly enum: readonly ["idle", "loading", "ready", "error"];
|
|
159
|
+
readonly default: "idle";
|
|
160
|
+
};
|
|
161
|
+
readonly page: {
|
|
162
|
+
readonly type: "number";
|
|
163
|
+
readonly category: "State";
|
|
164
|
+
readonly label: "Page";
|
|
165
|
+
};
|
|
166
|
+
readonly pageCount: {
|
|
167
|
+
readonly type: "number";
|
|
168
|
+
readonly category: "State";
|
|
169
|
+
readonly label: "Page count";
|
|
170
|
+
};
|
|
171
|
+
readonly progress: {
|
|
172
|
+
readonly type: "number";
|
|
173
|
+
readonly category: "State";
|
|
174
|
+
readonly label: "Progress";
|
|
175
|
+
};
|
|
176
|
+
readonly canGoPrevious: {
|
|
177
|
+
readonly type: "boolean";
|
|
178
|
+
readonly category: "State";
|
|
179
|
+
readonly label: "Can go previous";
|
|
180
|
+
};
|
|
181
|
+
readonly canGoNext: {
|
|
182
|
+
readonly type: "boolean";
|
|
183
|
+
readonly category: "State";
|
|
184
|
+
readonly label: "Can go next";
|
|
185
|
+
};
|
|
186
|
+
readonly title: {
|
|
187
|
+
readonly type: "string";
|
|
188
|
+
readonly category: "Content";
|
|
189
|
+
readonly label: "Title";
|
|
190
|
+
};
|
|
191
|
+
readonly subtitle: {
|
|
192
|
+
readonly type: "string";
|
|
193
|
+
readonly category: "Content";
|
|
194
|
+
readonly label: "Subtitle";
|
|
195
|
+
};
|
|
196
|
+
readonly chapterLabel: {
|
|
197
|
+
readonly type: "string";
|
|
198
|
+
readonly category: "Content";
|
|
199
|
+
readonly label: "Chapter label";
|
|
200
|
+
};
|
|
201
|
+
readonly pageLabel: {
|
|
202
|
+
readonly type: "string";
|
|
203
|
+
readonly category: "Content";
|
|
204
|
+
readonly label: "Page label";
|
|
205
|
+
};
|
|
206
|
+
readonly previousPageLabel: {
|
|
207
|
+
readonly type: "string";
|
|
208
|
+
readonly category: "Content";
|
|
209
|
+
readonly label: "Previous page label";
|
|
210
|
+
readonly default: "Previous page";
|
|
211
|
+
};
|
|
212
|
+
readonly nextPageLabel: {
|
|
213
|
+
readonly type: "string";
|
|
214
|
+
readonly category: "Content";
|
|
215
|
+
readonly label: "Next page label";
|
|
216
|
+
readonly default: "Next page";
|
|
217
|
+
};
|
|
218
|
+
readonly contentsLabel: {
|
|
219
|
+
readonly type: "string";
|
|
220
|
+
readonly category: "Content";
|
|
221
|
+
readonly label: "Contents label";
|
|
222
|
+
readonly default: "Table of contents";
|
|
223
|
+
};
|
|
224
|
+
readonly appearanceLabel: {
|
|
225
|
+
readonly type: "string";
|
|
226
|
+
readonly category: "Content";
|
|
227
|
+
readonly label: "Appearance label";
|
|
228
|
+
readonly default: "Reading appearance";
|
|
229
|
+
};
|
|
230
|
+
readonly highlightLabel: {
|
|
231
|
+
readonly type: "string";
|
|
232
|
+
readonly category: "Content";
|
|
233
|
+
readonly label: "Highlight label";
|
|
234
|
+
readonly default: "Toggle highlight";
|
|
235
|
+
};
|
|
236
|
+
readonly loadingLabel: {
|
|
237
|
+
readonly type: "string";
|
|
238
|
+
readonly category: "Content";
|
|
239
|
+
readonly label: "Loading label";
|
|
240
|
+
readonly default: "Loading document…";
|
|
241
|
+
};
|
|
242
|
+
readonly errorTitle: {
|
|
243
|
+
readonly type: "string";
|
|
244
|
+
readonly category: "Content";
|
|
245
|
+
readonly label: "Error title";
|
|
246
|
+
readonly default: "Unable to open this document.";
|
|
247
|
+
};
|
|
248
|
+
readonly unavailableTitle: {
|
|
249
|
+
readonly type: "string";
|
|
250
|
+
readonly category: "Content";
|
|
251
|
+
readonly label: "Unavailable title";
|
|
252
|
+
readonly default: "Reader preview unavailable.";
|
|
253
|
+
};
|
|
254
|
+
readonly showChrome: {
|
|
255
|
+
readonly type: "boolean";
|
|
256
|
+
readonly category: "Chrome";
|
|
257
|
+
readonly label: "Show chrome";
|
|
258
|
+
readonly default: true;
|
|
259
|
+
};
|
|
260
|
+
readonly readerColorScheme: {
|
|
261
|
+
readonly type: "enum";
|
|
262
|
+
readonly category: "Appearance";
|
|
263
|
+
readonly label: "Color scheme";
|
|
264
|
+
readonly enum: readonly ["system", "light", "dark", "sepia"];
|
|
265
|
+
readonly default: "system";
|
|
266
|
+
};
|
|
267
|
+
readonly fontScale: {
|
|
268
|
+
readonly type: "number";
|
|
269
|
+
readonly category: "Appearance";
|
|
270
|
+
readonly label: "Font scale";
|
|
271
|
+
readonly default: 1;
|
|
272
|
+
};
|
|
273
|
+
readonly lineHeight: {
|
|
274
|
+
readonly type: "enum";
|
|
275
|
+
readonly category: "Appearance";
|
|
276
|
+
readonly label: "Line height";
|
|
277
|
+
readonly enum: readonly ["compact", "normal", "relaxed"];
|
|
278
|
+
readonly default: "normal";
|
|
279
|
+
};
|
|
280
|
+
readonly highlighted: {
|
|
281
|
+
readonly type: "boolean";
|
|
282
|
+
readonly category: "State";
|
|
283
|
+
readonly label: "Highlighted";
|
|
284
|
+
readonly default: false;
|
|
285
|
+
};
|
|
286
|
+
readonly onPreviousPage: {
|
|
287
|
+
readonly type: "action";
|
|
288
|
+
readonly category: "Events";
|
|
289
|
+
readonly label: "Previous page action";
|
|
290
|
+
};
|
|
291
|
+
readonly onNextPage: {
|
|
292
|
+
readonly type: "action";
|
|
293
|
+
readonly category: "Events";
|
|
294
|
+
readonly label: "Next page action";
|
|
295
|
+
};
|
|
296
|
+
readonly onLocationChange: {
|
|
297
|
+
readonly type: "action";
|
|
298
|
+
readonly category: "Events";
|
|
299
|
+
readonly label: "Location change action";
|
|
300
|
+
};
|
|
301
|
+
readonly onOpenContents: {
|
|
302
|
+
readonly type: "action";
|
|
303
|
+
readonly category: "Events";
|
|
304
|
+
readonly label: "Open contents action";
|
|
305
|
+
};
|
|
306
|
+
readonly onOpenAppearance: {
|
|
307
|
+
readonly type: "action";
|
|
308
|
+
readonly category: "Events";
|
|
309
|
+
readonly label: "Open appearance action";
|
|
310
|
+
};
|
|
311
|
+
readonly onToggleHighlight: {
|
|
312
|
+
readonly type: "action";
|
|
313
|
+
readonly category: "Events";
|
|
314
|
+
readonly label: "Toggle highlight action";
|
|
315
|
+
};
|
|
316
|
+
readonly onOpenExternalLink: {
|
|
317
|
+
readonly type: "action";
|
|
318
|
+
readonly category: "Events";
|
|
319
|
+
readonly label: "Open external link action";
|
|
320
|
+
};
|
|
321
|
+
readonly onReaderError: {
|
|
322
|
+
readonly type: "action";
|
|
323
|
+
readonly category: "Events";
|
|
324
|
+
readonly label: "Reader error action";
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/patterns/reader/meta.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkSQ,CAAC"}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { CONTAINER_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';
|
|
2
|
+
const EMPTY_EVENT_FIELDS = [];
|
|
3
|
+
export const readerSurfaceMeta = {
|
|
4
|
+
name: 'ReaderSurface',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
description: 'Adapter-neutral EPUB and PDF reader shell with controlled chrome, progress, and navigation events.',
|
|
7
|
+
directManifestNode: true,
|
|
8
|
+
requirements: {
|
|
9
|
+
capabilities: [{ capability: 'ebookReader' }],
|
|
10
|
+
},
|
|
11
|
+
allowedChildren: [],
|
|
12
|
+
blueprint: {
|
|
13
|
+
label: 'Reader',
|
|
14
|
+
defaultProps: {
|
|
15
|
+
format: 'epub',
|
|
16
|
+
status: 'idle',
|
|
17
|
+
showChrome: true,
|
|
18
|
+
readerColorScheme: 'system',
|
|
19
|
+
fontScale: 1,
|
|
20
|
+
lineHeight: 'normal',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
events: {
|
|
24
|
+
previousPage: {
|
|
25
|
+
label: 'Previous page',
|
|
26
|
+
eventType: 'reader.previousPage',
|
|
27
|
+
description: 'Requests navigation to the previous page.',
|
|
28
|
+
payloadFields: EMPTY_EVENT_FIELDS,
|
|
29
|
+
},
|
|
30
|
+
nextPage: {
|
|
31
|
+
label: 'Next page',
|
|
32
|
+
eventType: 'reader.nextPage',
|
|
33
|
+
description: 'Requests navigation to the next page.',
|
|
34
|
+
payloadFields: EMPTY_EVENT_FIELDS,
|
|
35
|
+
},
|
|
36
|
+
locationChange: {
|
|
37
|
+
label: 'Location change',
|
|
38
|
+
eventType: 'reader.locationChange',
|
|
39
|
+
description: 'Emitted by the adapter after the destination has been displayed.',
|
|
40
|
+
payloadFields: [
|
|
41
|
+
{ path: 'format', type: 'string', label: 'Format' },
|
|
42
|
+
{ path: 'locator', type: 'string', label: 'Opaque locator' },
|
|
43
|
+
{ path: 'page', type: 'number', label: 'Page' },
|
|
44
|
+
{ path: 'pageCount', type: 'number', label: 'Page count' },
|
|
45
|
+
{ path: 'progression', type: 'number', label: 'Progression' },
|
|
46
|
+
{ path: 'chapterId', type: 'string', label: 'Chapter ID' },
|
|
47
|
+
{ path: 'chapterTitle', type: 'string', label: 'Chapter title' },
|
|
48
|
+
{ path: 'trigger', type: 'string', label: 'Navigation trigger' },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
openContents: {
|
|
52
|
+
label: 'Open contents',
|
|
53
|
+
eventType: 'reader.openContents',
|
|
54
|
+
description: 'Requests the app-owned table of contents.',
|
|
55
|
+
payloadFields: EMPTY_EVENT_FIELDS,
|
|
56
|
+
},
|
|
57
|
+
openAppearance: {
|
|
58
|
+
label: 'Open appearance',
|
|
59
|
+
eventType: 'reader.openAppearance',
|
|
60
|
+
description: 'Requests the app-owned reader appearance controls.',
|
|
61
|
+
payloadFields: EMPTY_EVENT_FIELDS,
|
|
62
|
+
},
|
|
63
|
+
toggleHighlight: {
|
|
64
|
+
label: 'Toggle highlight',
|
|
65
|
+
eventType: 'reader.toggleHighlight',
|
|
66
|
+
description: 'Requests the app-owned highlight action.',
|
|
67
|
+
payloadFields: EMPTY_EVENT_FIELDS,
|
|
68
|
+
},
|
|
69
|
+
openExternalLink: {
|
|
70
|
+
label: 'Open external link',
|
|
71
|
+
eventType: 'reader.openExternalLink',
|
|
72
|
+
description: 'Emitted when publication content requests an external URL.',
|
|
73
|
+
payloadFields: [{ path: 'url', type: 'string', label: 'URL' }],
|
|
74
|
+
},
|
|
75
|
+
readerError: {
|
|
76
|
+
label: 'Reader error',
|
|
77
|
+
eventType: 'reader.error',
|
|
78
|
+
description: 'Emitted when the adapter rejects or cannot load a document.',
|
|
79
|
+
payloadFields: [
|
|
80
|
+
{ path: 'code', type: 'string', label: 'Error code' },
|
|
81
|
+
{ path: 'format', type: 'string', label: 'Format' },
|
|
82
|
+
{ path: 'message', type: 'string', label: 'Message' },
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
slots: {
|
|
87
|
+
viewport: {
|
|
88
|
+
label: 'Reader viewport adapter',
|
|
89
|
+
allowedChildren: [],
|
|
90
|
+
},
|
|
91
|
+
headerActions: {
|
|
92
|
+
label: 'Header actions',
|
|
93
|
+
allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],
|
|
94
|
+
},
|
|
95
|
+
footerActions: {
|
|
96
|
+
label: 'Footer actions',
|
|
97
|
+
allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
props: {
|
|
101
|
+
source: {
|
|
102
|
+
type: 'media',
|
|
103
|
+
category: 'Document',
|
|
104
|
+
label: 'Source',
|
|
105
|
+
mediaKinds: ['file'],
|
|
106
|
+
},
|
|
107
|
+
format: {
|
|
108
|
+
type: 'enum',
|
|
109
|
+
category: 'Document',
|
|
110
|
+
label: 'Format',
|
|
111
|
+
enum: ['epub', 'pdf'],
|
|
112
|
+
default: 'epub',
|
|
113
|
+
},
|
|
114
|
+
location: {
|
|
115
|
+
type: 'string',
|
|
116
|
+
category: 'State',
|
|
117
|
+
label: 'Location',
|
|
118
|
+
},
|
|
119
|
+
status: {
|
|
120
|
+
type: 'enum',
|
|
121
|
+
category: 'State',
|
|
122
|
+
label: 'Status',
|
|
123
|
+
enum: ['idle', 'loading', 'ready', 'error'],
|
|
124
|
+
default: 'idle',
|
|
125
|
+
},
|
|
126
|
+
page: {
|
|
127
|
+
type: 'number',
|
|
128
|
+
category: 'State',
|
|
129
|
+
label: 'Page',
|
|
130
|
+
},
|
|
131
|
+
pageCount: {
|
|
132
|
+
type: 'number',
|
|
133
|
+
category: 'State',
|
|
134
|
+
label: 'Page count',
|
|
135
|
+
},
|
|
136
|
+
progress: {
|
|
137
|
+
type: 'number',
|
|
138
|
+
category: 'State',
|
|
139
|
+
label: 'Progress',
|
|
140
|
+
},
|
|
141
|
+
canGoPrevious: {
|
|
142
|
+
type: 'boolean',
|
|
143
|
+
category: 'State',
|
|
144
|
+
label: 'Can go previous',
|
|
145
|
+
},
|
|
146
|
+
canGoNext: {
|
|
147
|
+
type: 'boolean',
|
|
148
|
+
category: 'State',
|
|
149
|
+
label: 'Can go next',
|
|
150
|
+
},
|
|
151
|
+
title: {
|
|
152
|
+
type: 'string',
|
|
153
|
+
category: 'Content',
|
|
154
|
+
label: 'Title',
|
|
155
|
+
},
|
|
156
|
+
subtitle: {
|
|
157
|
+
type: 'string',
|
|
158
|
+
category: 'Content',
|
|
159
|
+
label: 'Subtitle',
|
|
160
|
+
},
|
|
161
|
+
chapterLabel: {
|
|
162
|
+
type: 'string',
|
|
163
|
+
category: 'Content',
|
|
164
|
+
label: 'Chapter label',
|
|
165
|
+
},
|
|
166
|
+
pageLabel: {
|
|
167
|
+
type: 'string',
|
|
168
|
+
category: 'Content',
|
|
169
|
+
label: 'Page label',
|
|
170
|
+
},
|
|
171
|
+
previousPageLabel: {
|
|
172
|
+
type: 'string',
|
|
173
|
+
category: 'Content',
|
|
174
|
+
label: 'Previous page label',
|
|
175
|
+
default: 'Previous page',
|
|
176
|
+
},
|
|
177
|
+
nextPageLabel: {
|
|
178
|
+
type: 'string',
|
|
179
|
+
category: 'Content',
|
|
180
|
+
label: 'Next page label',
|
|
181
|
+
default: 'Next page',
|
|
182
|
+
},
|
|
183
|
+
contentsLabel: {
|
|
184
|
+
type: 'string',
|
|
185
|
+
category: 'Content',
|
|
186
|
+
label: 'Contents label',
|
|
187
|
+
default: 'Table of contents',
|
|
188
|
+
},
|
|
189
|
+
appearanceLabel: {
|
|
190
|
+
type: 'string',
|
|
191
|
+
category: 'Content',
|
|
192
|
+
label: 'Appearance label',
|
|
193
|
+
default: 'Reading appearance',
|
|
194
|
+
},
|
|
195
|
+
highlightLabel: {
|
|
196
|
+
type: 'string',
|
|
197
|
+
category: 'Content',
|
|
198
|
+
label: 'Highlight label',
|
|
199
|
+
default: 'Toggle highlight',
|
|
200
|
+
},
|
|
201
|
+
loadingLabel: {
|
|
202
|
+
type: 'string',
|
|
203
|
+
category: 'Content',
|
|
204
|
+
label: 'Loading label',
|
|
205
|
+
default: 'Loading document…',
|
|
206
|
+
},
|
|
207
|
+
errorTitle: {
|
|
208
|
+
type: 'string',
|
|
209
|
+
category: 'Content',
|
|
210
|
+
label: 'Error title',
|
|
211
|
+
default: 'Unable to open this document.',
|
|
212
|
+
},
|
|
213
|
+
unavailableTitle: {
|
|
214
|
+
type: 'string',
|
|
215
|
+
category: 'Content',
|
|
216
|
+
label: 'Unavailable title',
|
|
217
|
+
default: 'Reader preview unavailable.',
|
|
218
|
+
},
|
|
219
|
+
showChrome: {
|
|
220
|
+
type: 'boolean',
|
|
221
|
+
category: 'Chrome',
|
|
222
|
+
label: 'Show chrome',
|
|
223
|
+
default: true,
|
|
224
|
+
},
|
|
225
|
+
readerColorScheme: {
|
|
226
|
+
type: 'enum',
|
|
227
|
+
category: 'Appearance',
|
|
228
|
+
label: 'Color scheme',
|
|
229
|
+
enum: ['system', 'light', 'dark', 'sepia'],
|
|
230
|
+
default: 'system',
|
|
231
|
+
},
|
|
232
|
+
fontScale: {
|
|
233
|
+
type: 'number',
|
|
234
|
+
category: 'Appearance',
|
|
235
|
+
label: 'Font scale',
|
|
236
|
+
default: 1,
|
|
237
|
+
},
|
|
238
|
+
lineHeight: {
|
|
239
|
+
type: 'enum',
|
|
240
|
+
category: 'Appearance',
|
|
241
|
+
label: 'Line height',
|
|
242
|
+
enum: ['compact', 'normal', 'relaxed'],
|
|
243
|
+
default: 'normal',
|
|
244
|
+
},
|
|
245
|
+
highlighted: {
|
|
246
|
+
type: 'boolean',
|
|
247
|
+
category: 'State',
|
|
248
|
+
label: 'Highlighted',
|
|
249
|
+
default: false,
|
|
250
|
+
},
|
|
251
|
+
onPreviousPage: {
|
|
252
|
+
type: 'action',
|
|
253
|
+
category: 'Events',
|
|
254
|
+
label: 'Previous page action',
|
|
255
|
+
},
|
|
256
|
+
onNextPage: {
|
|
257
|
+
type: 'action',
|
|
258
|
+
category: 'Events',
|
|
259
|
+
label: 'Next page action',
|
|
260
|
+
},
|
|
261
|
+
onLocationChange: {
|
|
262
|
+
type: 'action',
|
|
263
|
+
category: 'Events',
|
|
264
|
+
label: 'Location change action',
|
|
265
|
+
},
|
|
266
|
+
onOpenContents: {
|
|
267
|
+
type: 'action',
|
|
268
|
+
category: 'Events',
|
|
269
|
+
label: 'Open contents action',
|
|
270
|
+
},
|
|
271
|
+
onOpenAppearance: {
|
|
272
|
+
type: 'action',
|
|
273
|
+
category: 'Events',
|
|
274
|
+
label: 'Open appearance action',
|
|
275
|
+
},
|
|
276
|
+
onToggleHighlight: {
|
|
277
|
+
type: 'action',
|
|
278
|
+
category: 'Events',
|
|
279
|
+
label: 'Toggle highlight action',
|
|
280
|
+
},
|
|
281
|
+
onOpenExternalLink: {
|
|
282
|
+
type: 'action',
|
|
283
|
+
category: 'Events',
|
|
284
|
+
label: 'Open external link action',
|
|
285
|
+
},
|
|
286
|
+
onReaderError: {
|
|
287
|
+
type: 'action',
|
|
288
|
+
category: 'Events',
|
|
289
|
+
label: 'Reader error action',
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
};
|
|
293
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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pB,OAAO,EAAE,KAAK;SACf;QACD,cAAc,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,sBAAsB;SAC9B;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,kBAAkB;SAC1B;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,wBAAwB;SAChC;QACD,cAAc,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,sBAAsB;SAC9B;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,wBAAwB;SAChC;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,yBAAyB;SACjC;QACD,kBAAkB,EAAE;YAClB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,2BAA2B;SACnC;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,qBAAqB;SAC7B;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\nimport { CONTAINER_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';\n\nconst EMPTY_EVENT_FIELDS = [] as const;\n\nexport const readerSurfaceMeta = {\n name: 'ReaderSurface',\n category: 'pattern',\n description:\n 'Adapter-neutral EPUB and PDF reader shell with controlled chrome, progress, and navigation events.',\n directManifestNode: true,\n requirements: {\n capabilities: [{ capability: 'ebookReader' }],\n },\n allowedChildren: [],\n blueprint: {\n label: 'Reader',\n defaultProps: {\n format: 'epub',\n status: 'idle',\n showChrome: true,\n readerColorScheme: 'system',\n fontScale: 1,\n lineHeight: 'normal',\n },\n },\n events: {\n previousPage: {\n label: 'Previous page',\n eventType: 'reader.previousPage',\n description: 'Requests navigation to the previous page.',\n payloadFields: EMPTY_EVENT_FIELDS,\n },\n nextPage: {\n label: 'Next page',\n eventType: 'reader.nextPage',\n description: 'Requests navigation to the next page.',\n payloadFields: EMPTY_EVENT_FIELDS,\n },\n locationChange: {\n label: 'Location change',\n eventType: 'reader.locationChange',\n description: 'Emitted by the adapter after the destination has been displayed.',\n payloadFields: [\n { path: 'format', type: 'string', label: 'Format' },\n { path: 'locator', type: 'string', label: 'Opaque locator' },\n { path: 'page', type: 'number', label: 'Page' },\n { path: 'pageCount', type: 'number', label: 'Page count' },\n { path: 'progression', type: 'number', label: 'Progression' },\n { path: 'chapterId', type: 'string', label: 'Chapter ID' },\n { path: 'chapterTitle', type: 'string', label: 'Chapter title' },\n { path: 'trigger', type: 'string', label: 'Navigation trigger' },\n ],\n },\n openContents: {\n label: 'Open contents',\n eventType: 'reader.openContents',\n description: 'Requests the app-owned table of contents.',\n payloadFields: EMPTY_EVENT_FIELDS,\n },\n openAppearance: {\n label: 'Open appearance',\n eventType: 'reader.openAppearance',\n description: 'Requests the app-owned reader appearance controls.',\n payloadFields: EMPTY_EVENT_FIELDS,\n },\n toggleHighlight: {\n label: 'Toggle highlight',\n eventType: 'reader.toggleHighlight',\n description: 'Requests the app-owned highlight action.',\n payloadFields: EMPTY_EVENT_FIELDS,\n },\n openExternalLink: {\n label: 'Open external link',\n eventType: 'reader.openExternalLink',\n description: 'Emitted when publication content requests an external URL.',\n payloadFields: [{ path: 'url', type: 'string', label: 'URL' }],\n },\n readerError: {\n label: 'Reader error',\n eventType: 'reader.error',\n description: 'Emitted when the adapter rejects or cannot load a document.',\n payloadFields: [\n { path: 'code', type: 'string', label: 'Error code' },\n { path: 'format', type: 'string', label: 'Format' },\n { path: 'message', type: 'string', label: 'Message' },\n ],\n },\n },\n slots: {\n viewport: {\n label: 'Reader viewport adapter',\n allowedChildren: [],\n },\n headerActions: {\n label: 'Header actions',\n allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],\n },\n footerActions: {\n label: 'Footer actions',\n allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],\n },\n },\n props: {\n source: {\n type: 'media',\n category: 'Document',\n label: 'Source',\n mediaKinds: ['file'],\n },\n format: {\n type: 'enum',\n category: 'Document',\n label: 'Format',\n enum: ['epub', 'pdf'],\n default: 'epub',\n },\n location: {\n type: 'string',\n category: 'State',\n label: 'Location',\n },\n status: {\n type: 'enum',\n category: 'State',\n label: 'Status',\n enum: ['idle', 'loading', 'ready', 'error'],\n default: 'idle',\n },\n page: {\n type: 'number',\n category: 'State',\n label: 'Page',\n },\n pageCount: {\n type: 'number',\n category: 'State',\n label: 'Page count',\n },\n progress: {\n type: 'number',\n category: 'State',\n label: 'Progress',\n },\n canGoPrevious: {\n type: 'boolean',\n category: 'State',\n label: 'Can go previous',\n },\n canGoNext: {\n type: 'boolean',\n category: 'State',\n label: 'Can go next',\n },\n title: {\n type: 'string',\n category: 'Content',\n label: 'Title',\n },\n subtitle: {\n type: 'string',\n category: 'Content',\n label: 'Subtitle',\n },\n chapterLabel: {\n type: 'string',\n category: 'Content',\n label: 'Chapter label',\n },\n pageLabel: {\n type: 'string',\n category: 'Content',\n label: 'Page label',\n },\n previousPageLabel: {\n type: 'string',\n category: 'Content',\n label: 'Previous page label',\n default: 'Previous page',\n },\n nextPageLabel: {\n type: 'string',\n category: 'Content',\n label: 'Next page label',\n default: 'Next page',\n },\n contentsLabel: {\n type: 'string',\n category: 'Content',\n label: 'Contents label',\n default: 'Table of contents',\n },\n appearanceLabel: {\n type: 'string',\n category: 'Content',\n label: 'Appearance label',\n default: 'Reading appearance',\n },\n highlightLabel: {\n type: 'string',\n category: 'Content',\n label: 'Highlight label',\n default: 'Toggle highlight',\n },\n loadingLabel: {\n type: 'string',\n category: 'Content',\n label: 'Loading label',\n default: 'Loading document…',\n },\n errorTitle: {\n type: 'string',\n category: 'Content',\n label: 'Error title',\n default: 'Unable to open this document.',\n },\n unavailableTitle: {\n type: 'string',\n category: 'Content',\n label: 'Unavailable title',\n default: 'Reader preview unavailable.',\n },\n showChrome: {\n type: 'boolean',\n category: 'Chrome',\n label: 'Show chrome',\n default: true,\n },\n readerColorScheme: {\n type: 'enum',\n category: 'Appearance',\n label: 'Color scheme',\n enum: ['system', 'light', 'dark', 'sepia'],\n default: 'system',\n },\n fontScale: {\n type: 'number',\n category: 'Appearance',\n label: 'Font scale',\n default: 1,\n },\n lineHeight: {\n type: 'enum',\n category: 'Appearance',\n label: 'Line height',\n enum: ['compact', 'normal', 'relaxed'],\n default: 'normal',\n },\n highlighted: {\n type: 'boolean',\n category: 'State',\n label: 'Highlighted',\n default: false,\n },\n onPreviousPage: {\n type: 'action',\n category: 'Events',\n label: 'Previous page action',\n },\n onNextPage: {\n type: 'action',\n category: 'Events',\n label: 'Next page action',\n },\n onLocationChange: {\n type: 'action',\n category: 'Events',\n label: 'Location change action',\n },\n onOpenContents: {\n type: 'action',\n category: 'Events',\n label: 'Open contents action',\n },\n onOpenAppearance: {\n type: 'action',\n category: 'Events',\n label: 'Open appearance action',\n },\n onToggleHighlight: {\n type: 'action',\n category: 'Events',\n label: 'Toggle highlight action',\n },\n onOpenExternalLink: {\n type: 'action',\n category: 'Events',\n label: 'Open external link action',\n },\n onReaderError: {\n type: 'action',\n category: 'Events',\n label: 'Reader error action',\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveReaderProgress.d.ts","sourceRoot":"","sources":["../../../src/patterns/reader/resolveReaderProgress.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,IAAI,EACJ,SAAS,GACV,EAAE;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAoBT"}
|