@webx-ui/module-blocks 0.8.1 → 0.8.3

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.
@@ -5,6 +5,10 @@ import { BlockThumbnail } from './types';
5
5
  * An iframe rather than inline markup because a block's styles are a block's business — a
6
6
  * stray `h2 { }` in one type would otherwise restyle the whole list of cards — and because
7
7
  * the thumbnail is a picture of the site, not a part of the panel.
8
+ *
9
+ * Drawn in the site's own clothes when the site has a stage: its stylesheets and fonts, and
10
+ * the wrappers the block sits in on a page, without the header, the footer or any script
11
+ * (see `siteShell`). Bare until that arrives, and bare where there is none.
8
12
  */
9
13
  type __VLS_Props = {
10
14
  thumbnail: BlockThumbnail | null;
package/dist/frame.d.ts CHANGED
@@ -104,3 +104,22 @@ export interface StageInput {
104
104
  * and the runtime, and nothing of the panel. `srcdoc` takes it.
105
105
  */
106
106
  export declare function stageDocument(input: StageInput): string;
107
+ /** Where a thumbnail's block goes in a {@link siteShell}. */
108
+ export declare const SHELL_PLACE = "<!--wx-thumb-->";
109
+ /**
110
+ * The stage page with the page taken out: what a thumbnail needs of the site to look like it.
111
+ *
112
+ * Kept from the head: the stylesheets, the `<style>` elements and the font preloads — the
113
+ * look. Kept from the body: only the chain of elements the block's place sits in, each one
114
+ * empty but for the next, so a rule like `.site-main > section` still finds its parent. The
115
+ * header, the footer, the popups and every script are left behind: a card in a list is a
116
+ * picture, and a site's script in forty of them is forty newsletter popups.
117
+ *
118
+ * Null when the page has no place for a block — then there is nothing to put the block in.
119
+ */
120
+ export declare function siteShell(html: string, url: string): string | null;
121
+ /** A thumbnail's document: the block in the site's shell, its own styles last. */
122
+ export declare function thumbDocument(shell: string, input: {
123
+ html: string;
124
+ styles: string;
125
+ }): string;