@clepit/core 0.6.0-beta.415 → 0.6.0-beta.416
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 +2 -0
- package/dist/core/renderer/page.d.ts +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
13
13
|
- Six `blockToolbarLabels` keys for the image block's own words: `imageDropTitle`, `imageDropAction`, `imageDropFormats`, `imageUploading`, `imageUploadFailed` and `imageInvalidType`, in English when absent. The drop area's delete button takes the `delete` label as its tooltip and its `aria-label`. Each state carries a test id (`image-drop`, `image-drop-title`, `image-uploading`, `image-upload-failed`, `image-invalid-type` and the rest).
|
|
14
14
|
- `UploadRefusal` and `UploadNotice`: an image uploader that rejects with `new UploadRefusal({ title, body, action, remove })` turns the block into a framed notice in the host's words, in place of the drop area: the title, the reason, the action as a link opening in a new tab (http and https only; left out when absent) and a Remove that deletes the block. Any other rejection still shows the failed-upload line. Test ids `image-refusal`, `image-refusal-title`, `image-refusal-body`, `image-refusal-action` and `image-refusal-remove`.
|
|
15
15
|
- `PublicPage.alternates` and `PublicPage.notice`: `renderPage` writes one `<link rel="alternate">` per hreflang and address pair, and draws the notice (a title and a line, test id `public-page-notice`) below the page title with its own styles. A page passing neither renders exactly as before.
|
|
16
|
+
- `pageMetadata`, `renderNotice` and `noticeStylesheet`: a host that frames a public page in its own chrome writes the page's description, canonical, language and link-preview tags and draws its language notice exactly as `renderPage` does, which now draws both through them.
|
|
17
|
+
- `PublicPage.scheme`: `renderPage` draws the page in `light` or `dark` only, by setting `data-clepit-theme` on `<body>` (the attribute the theme's tokens resolve under) and a `color-scheme` meta so the browser's own canvas and text follow it. A page passing no scheme renders exactly as before.
|
|
16
18
|
|
|
17
19
|
### Fixed
|
|
18
20
|
- The inline toolbar no longer leaves a hidden copy of the rewrite menu behind each time a new selection repaints it, so each rewrite action exists once in the page.
|
|
@@ -10,6 +10,7 @@ export type PublicPage = {
|
|
|
10
10
|
canonicalUrl?: string;
|
|
11
11
|
alternates?: PublicPageAlternate[];
|
|
12
12
|
notice?: PublicPageNotice;
|
|
13
|
+
scheme?: 'light' | 'dark';
|
|
13
14
|
};
|
|
14
15
|
export type PublicPageAlternate = {
|
|
15
16
|
href: string;
|
|
@@ -19,6 +20,9 @@ export type PublicPageNotice = {
|
|
|
19
20
|
body: string;
|
|
20
21
|
title: string;
|
|
21
22
|
};
|
|
23
|
+
export declare const noticeStylesheet: () => string;
|
|
24
|
+
export declare const renderNotice: (notice: PublicPageNotice) => string;
|
|
25
|
+
export declare const pageMetadata: (page: Pick<PublicPage, "alternates" | "canonicalUrl" | "description" | "title">) => string;
|
|
22
26
|
/**
|
|
23
27
|
* Every stylesheet a drawn document needs, as text.
|
|
24
28
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { StyleManager } from './core/managers/style';
|
|
|
4
4
|
export { Renderer } from './core/renderer';
|
|
5
5
|
export { activateBlocks } from './core/renderer/activate';
|
|
6
6
|
export { drawBlock } from './core/renderer/draw';
|
|
7
|
-
export { type PublicPage, type PublicPageAlternate, type PublicPageNotice, pageStylesheet, renderBlocks, renderPage } from './core/renderer/page';
|
|
7
|
+
export { noticeStylesheet, type PublicPage, type PublicPageAlternate, type PublicPageNotice, pageMetadata, pageStylesheet, renderBlocks, renderNotice, renderPage } from './core/renderer/page';
|
|
8
8
|
export { type ThemeTokens, tokensToLightDarkBlock } from './core/theme';
|
|
9
9
|
export { UploadRefusal } from './core/upload-refusal';
|
|
10
10
|
export { EMBED_ENGLISH, EMBED_TOOL_NAMES, embedLabel } from './tools/block/embed/output';
|