bookcover-web 0.21.0 → 0.22.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.
@@ -112,7 +112,19 @@ export type HostMessage = InitMessage | {
112
112
  *
113
113
  * 'bg_suggestion_selected' asks the host for the bytes behind one of the BgSuggestions it sent
114
114
  * in InitMessage, carrying that suggestion's id verbatim. The host answers with
115
- * 'bg_suggestion_resolved'. */
115
+ * 'bg_suggestion_resolved'.
116
+ *
117
+ * 'error' relays an unexpected widget failure, since a cross-origin host can't observe the
118
+ * iframe's errors itself. It is purely informational — it never stands in for 'cancelled' or
119
+ * changes what data/finished mean, and the editor carries on (or not) exactly as it would
120
+ * have standalone. `message` is always plain text, never an Error object (structured clone
121
+ * drops or mangles those across browsers): "<ErrorType>: <message>\n\n<stack>", plus a
122
+ * trailing paragraph of context where the widget has some (e.g. Vue's error info). `build` is
123
+ * the widget's short commit hash, suffixed "-dirty" for a build from a modified tree, and null
124
+ * from a dev server. Noise (cross-origin "Script error.", ResizeObserver loops, cancelled
125
+ * fetches, browser extensions) is filtered out, each distinct message is sent at most once
126
+ * per page load, and no more than 20 in total. Like 'ready', one raised before the host's
127
+ * InitMessage arrives is posted with target origin '*'. */
116
128
  export type WidgetMessage = {
117
129
  type: 'ready';
118
130
  } | {
@@ -132,5 +144,9 @@ export type WidgetMessage = {
132
144
  } | {
133
145
  type: 'bg_suggestion_selected';
134
146
  id: string;
147
+ } | {
148
+ type: 'error';
149
+ message: string;
150
+ build: string | null;
135
151
  };
136
152
  //# sourceMappingURL=embed_types.d.ts.map
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export type { CoverSchema, TitlePosition, FontConfig, OutputFormat, SplitResult,
4
4
  export type { BundledFont, CjkVariant, CustomFont } from 'typst-fonts';
5
5
  export { font_file_url } from 'typst-fonts/web';
6
6
  export { get_fonts, get_bundled_font } from 'typst-fonts';
7
- export { list_patterns, collect_fonts, collect_all_fonts, default_spine_title, list_vector_backgrounds, find_vector_background, list_builtin_icons, find_builtin_icon, icon_categories, suggested_icons, generate_palette, cover_schema } from 'bookcover-core';
7
+ export { list_patterns, collect_fonts, collect_all_fonts, default_spine_title, list_vector_backgrounds, find_vector_background, load_vector_background_svg, recolor_vector_svg, list_builtin_icons, find_builtin_icon, icon_categories, suggested_icons, generate_palette, cover_schema } from 'bookcover-core';
8
8
  export type { IconCategory } from 'bookcover-core';
9
9
  export { tinted_contrast_text, pick_vivid_tint, synthesize_fill, blend_regions, region_hex, all_image_regions, analyze_pixel_regions, get_builtin_bg, get_builtin_bg_regions, BG_PREVIEW_DIR, VECTOR_BG_AUTO_COLOR, resolve_colors, darken_hsl } from 'bookcover-core';
10
10
  export type { RegionStats, ImageRegions, ResolvedColors, BuiltinBg } from 'bookcover-core';
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { base_font } from 'typst-fonts';
7
7
  import { load_fonts_prefix, font_urls_for as build_font_urls, fetch_font_bytes, fonts_to_blob_urls, revoke_blob_urls } from 'typst-fonts/web';
8
8
  export { font_file_url } from 'typst-fonts/web';
9
9
  export { get_fonts, get_bundled_font } from 'typst-fonts';
10
- export { list_patterns, collect_fonts, collect_all_fonts, default_spine_title, list_vector_backgrounds, find_vector_background, list_builtin_icons, find_builtin_icon, icon_categories, suggested_icons, generate_palette, cover_schema } from 'bookcover-core';
10
+ export { list_patterns, collect_fonts, collect_all_fonts, default_spine_title, list_vector_backgrounds, find_vector_background, load_vector_background_svg, recolor_vector_svg, list_builtin_icons, find_builtin_icon, icon_categories, suggested_icons, generate_palette, cover_schema } from 'bookcover-core';
11
11
  export { tinted_contrast_text, pick_vivid_tint, synthesize_fill, blend_regions, region_hex, all_image_regions, analyze_pixel_regions, get_builtin_bg, get_builtin_bg_regions, BG_PREVIEW_DIR, VECTOR_BG_AUTO_COLOR, resolve_colors, darken_hsl } from 'bookcover-core';
12
12
  // Form state + form->schema conversion, so hosts can derive the renderable schema themselves
13
13
  export { make_blank_form_values, build_schema, curly_quotes, parse_font_family, find_pattern, derive_colors, hex_override_to_hsl, hex_to_hsl, is_dark_color, warn_unknown } from 'bookcover-core';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bookcover-web",
3
- "version": "0.21.0",
3
+ "version": "0.22.1",
4
4
  "license": "MIT-0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,7 +39,7 @@
39
39
  "@myriaddreamin/typst-ts-renderer": "0.7.0",
40
40
  "@myriaddreamin/typst-ts-web-compiler": "0.7.0",
41
41
  "@myriaddreamin/typst.ts": "0.7.0",
42
- "bookcover-core": "^0.21.0",
42
+ "bookcover-core": "^0.22.1",
43
43
  "typst-fonts": "^0.1.0"
44
44
  },
45
45
  "sideEffects": false