@clepit/core 0.6.0-beta.421 → 0.6.0-beta.425

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 CHANGED
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
16
  - `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.
17
17
  - `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.
18
18
  - `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.
19
+ - `ClepitError` and `ClepitErrorCode`: the package names its own failures by code. `Renderer.render` given a container id that matches no element throws a `ClepitError` with the code `CONTAINER_MISSING`, where it threw a plain `Error`; the message is unchanged, and it is still an `Error`.
19
20
 
20
21
  ### Fixed
21
22
  - An editor given `locale` kept only the language being edited: an edit replaced a field's map of languages with one string. The editor now keeps each block's stored data and writes an edit back into it with the rule both twins share, on every way a block leaves it (`onChange`, `data.extract()`, `blocks.get` and `blocks.getAll`), while `blocks.insert`, `blocks.update` and `data.set` take stored data and show it in the language being edited. A converted block keeps the languages of the fields both types share.
@@ -4,6 +4,7 @@ export declare class JsonView {
4
4
  private static removeEventListeners;
5
5
  private static handleJsonInput;
6
6
  private static validateAndUpdateJson;
7
+ private static markInvalid;
7
8
  static destroy(containerId: string): void;
8
9
  }
9
10
  //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1,6 @@
1
+ export type ClepitErrorCode = 'CONTAINER_MISSING';
2
+ export declare class ClepitError extends Error {
3
+ readonly code: ClepitErrorCode;
4
+ constructor(code: ClepitErrorCode, message: string);
5
+ }
6
+ //# sourceMappingURL=errors.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { Editor } from './core/editor';
2
2
  export { type Backing, type ClepitElement, type DrawContext, domBacking, renderToString, stringBacking, toDomElement } from './core/element';
3
+ export { ClepitError, type ClepitErrorCode } from './core/errors';
3
4
  export { StyleManager } from './core/managers/style';
4
5
  export { Renderer } from './core/renderer';
5
6
  export { activateBlocks } from './core/renderer/activate';