@clepit/core 0.8.0 → 0.9.0-beta.669
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 +13 -0
- package/dist/core/managers/style.d.ts +7 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ All notable changes to `@clepit/core` are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.9.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- `StyleManager.injectedSheet(id)`: the stylesheet injected under an id, while the document adopts it.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- The editor, renderer and theme overrides adopt their styles as constructed stylesheets (`document.adoptedStyleSheets`) instead of appending `<style>` elements, so a page whose `style-src` omits `'unsafe-inline'` renders them without passing clepit a nonce.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- An editor mounted in an iframe gets its styles: each sheet is constructed by the document's own window, since a document adopts only sheets its window built.
|
|
20
|
+
|
|
8
21
|
## [0.8.0]
|
|
9
22
|
|
|
10
23
|
### Added
|
|
@@ -137,12 +137,17 @@ export declare class StyleManager {
|
|
|
137
137
|
classNames?: BlockClassNames | string;
|
|
138
138
|
}): HTMLElement;
|
|
139
139
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
140
|
+
* Adopts the styles as a constructed stylesheet, which a style-src policy without
|
|
141
|
+
* 'unsafe-inline' admits where an appended style element would be refused.
|
|
142
|
+
* @param styleId - Unique ID for the stylesheet
|
|
142
143
|
* @param styles - CSS styles as a string
|
|
143
144
|
* @returns boolean - true if styles were injected, false if already existed
|
|
144
145
|
*/
|
|
145
146
|
static injectStyles(styleId: string, styles: string): boolean;
|
|
147
|
+
/** The stylesheet injected under `styleId`, while the document still adopts it. */
|
|
148
|
+
static injectedSheet(styleId: string): CSSStyleSheet | undefined;
|
|
149
|
+
private static removeStyles;
|
|
150
|
+
private static injectedSheets;
|
|
146
151
|
private static themeRegistry;
|
|
147
152
|
private static themeSubscribers;
|
|
148
153
|
private static themeMediaQuery?;
|