@openleaf-editor/core 0.1.0-beta.0 → 0.1.0-beta.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.
@@ -14,6 +14,7 @@
14
14
  */
15
15
  import type { Attrs } from 'prosemirror-model';
16
16
  import type { Command, EditorState } from 'prosemirror-state';
17
+ import { type Align } from './css.js';
17
18
  /**
18
19
  * Is this mark active at the cursor, or across the selection?
19
20
  *
@@ -53,6 +54,46 @@ export declare const toggleOrderedList: Command;
53
54
  export declare const splitListItemCommand: Command;
54
55
  export declare const indentListItem: Command;
55
56
  export declare const outdentListItem: Command;
57
+ /**
58
+ * The alignment of the selection, or null when it has none or is mixed.
59
+ *
60
+ * Null means "no explicit alignment", which is a genuinely different state from
61
+ * "aligned left" and is reported as such: an unaligned paragraph follows the
62
+ * document's reading direction, so it renders right-aligned in Arabic or Hebrew.
63
+ * Reporting it as left would make the left button light up on text that is not
64
+ * left-aligned, and would make `aria-pressed="true"` a lie about a paragraph
65
+ * nobody has aligned.
66
+ *
67
+ * A selection spanning blocks with different alignments also reports null.
68
+ * Showing the first block's value as the state of all of them is a lie the
69
+ * author acts on -- they see "centred", press it to turn it off, and one
70
+ * paragraph they never looked at moves.
71
+ */
72
+ export declare function activeTextAlign(state: EditorState): Align | null;
73
+ /**
74
+ * Set the alignment of every alignable block in the selection. `null` clears it.
75
+ *
76
+ * Reports true whenever there is something to align, even if it already carries
77
+ * this value. The alternative -- returning false because the work is already
78
+ * done -- would make the toolbar render the button for the CURRENT alignment as
79
+ * disabled, since a command's no-dispatch call is what drives enabled state.
80
+ */
81
+ export declare function setTextAlign(align: Align | null): Command;
82
+ /**
83
+ * Toggle an alignment: applying the one already in force clears it.
84
+ *
85
+ * The same reasoning as `toggleHeading`. An author who centred a paragraph by
86
+ * accident reaches for the control they just pressed, and having it do nothing
87
+ * because "centre" is already the value leaves them hunting for an
88
+ * un-centre button that does not exist.
89
+ */
90
+ export declare function toggleTextAlign(align: Align): Command;
91
+ export declare function setTextColor(color: string): Command;
92
+ export declare function setBackgroundColor(color: string): Command;
93
+ export declare const clearTextColor: Command;
94
+ export declare const clearBackgroundColor: Command;
95
+ export declare function activeTextColor(state: EditorState): string | null;
96
+ export declare function activeBackgroundColor(state: EditorState): string | null;
56
97
  export interface LinkAttrs {
57
98
  href: string;
58
99
  title?: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAsB,MAAM,mBAAmB,CAAA;AAOlE,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AA+C7D;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAQ1E;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAiBzF;AAED,oEAAoE;AACpE,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CASvE;AAED,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CASpE;AAED,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,GAAG,IAAI,CAiB3D;AAMD,eAAO,MAAM,UAAU,EAAE,OAA2C,CAAA;AACpE,eAAO,MAAM,YAAY,EAAE,OAAuC,CAAA;AAClE,eAAO,MAAM,eAAe,EAAE,OAA8C,CAAA;AAC5E,eAAO,MAAM,YAAY,EAAE,OAA2C,CAAA;AACtE,eAAO,MAAM,gBAAgB,EAAE,OAAyC,CAAA;AAMxE,eAAO,MAAM,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vE;AAMD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAcjD;AAED,eAAO,MAAM,SAAS,EAAE,OAOvB,CAAA;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAmBtD;AAMD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAEhD,eAAO,MAAM,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAgC,CAAA;AAC9E,eAAO,MAAM,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAgC,CAAA"}
package/dist/commands.js CHANGED
@@ -15,6 +15,7 @@
15
15
  import { redo, undo } from 'prosemirror-history';
16
16
  import { setBlockType, toggleMark, wrapIn } from 'prosemirror-commands';
17
17
  import { liftListItem, sinkListItem, splitListItem, wrapInList, } from 'prosemirror-schema-list';
18
+ import { safeColor } from './css.js';
18
19
  /**
19
20
  * Types are resolved from the state's schema, never from a captured singleton.
20
21
  *
@@ -261,6 +262,188 @@ function toggleList(target) {
261
262
  export const splitListItemCommand = nodeCommand('list_item', (t) => splitListItem(t));
262
263
  export const indentListItem = nodeCommand('list_item', (t) => sinkListItem(t));
263
264
  export const outdentListItem = nodeCommand('list_item', (t) => liftListItem(t));
265
+ /* ------------------------------------------------------------------ *
266
+ * Alignment
267
+ * ------------------------------------------------------------------ */
268
+ /**
269
+ * The text blocks in the selection that can carry an alignment.
270
+ *
271
+ * Membership is decided by asking whether the node carries an `align`
272
+ * attribute, not by naming paragraph and heading. A plugin that adds an
273
+ * alignable block -- a caption, a callout -- gets the toolbar control and the
274
+ * keyboard shortcut for free, and this function does not have to learn its name.
275
+ */
276
+ function alignableBlocks(state) {
277
+ const found = [];
278
+ const { from, to } = state.selection;
279
+ state.doc.nodesBetween(from, to, (node, pos) => {
280
+ if (!node.isTextblock)
281
+ return true;
282
+ // Asked of the node's resolved attributes rather than its type's spec:
283
+ // `spec.attrs` is optional and undeclared in the public typings, whereas
284
+ // every node carries every attribute its type declares.
285
+ if (Object.hasOwn(node.attrs, 'align'))
286
+ found.push({ pos, node });
287
+ // Never descend into a text block: its inline children are not alignable
288
+ // and walking them on every keystroke is work with no result.
289
+ return false;
290
+ });
291
+ return found;
292
+ }
293
+ /**
294
+ * The alignment of the selection, or null when it has none or is mixed.
295
+ *
296
+ * Null means "no explicit alignment", which is a genuinely different state from
297
+ * "aligned left" and is reported as such: an unaligned paragraph follows the
298
+ * document's reading direction, so it renders right-aligned in Arabic or Hebrew.
299
+ * Reporting it as left would make the left button light up on text that is not
300
+ * left-aligned, and would make `aria-pressed="true"` a lie about a paragraph
301
+ * nobody has aligned.
302
+ *
303
+ * A selection spanning blocks with different alignments also reports null.
304
+ * Showing the first block's value as the state of all of them is a lie the
305
+ * author acts on -- they see "centred", press it to turn it off, and one
306
+ * paragraph they never looked at moves.
307
+ */
308
+ export function activeTextAlign(state) {
309
+ const blocks = alignableBlocks(state);
310
+ const first = blocks[0];
311
+ if (!first)
312
+ return null;
313
+ const value = first.node.attrs['align'] ?? null;
314
+ return blocks.every((b) => (b.node.attrs['align'] ?? null) === value) ? value : null;
315
+ }
316
+ /**
317
+ * Set the alignment of every alignable block in the selection. `null` clears it.
318
+ *
319
+ * Reports true whenever there is something to align, even if it already carries
320
+ * this value. The alternative -- returning false because the work is already
321
+ * done -- would make the toolbar render the button for the CURRENT alignment as
322
+ * disabled, since a command's no-dispatch call is what drives enabled state.
323
+ */
324
+ export function setTextAlign(align) {
325
+ return (state, dispatch) => {
326
+ const blocks = alignableBlocks(state);
327
+ if (blocks.length === 0)
328
+ return false;
329
+ if (dispatch) {
330
+ const tr = state.tr;
331
+ for (const { pos, node } of blocks) {
332
+ // No position mapping needed: an attribute-only change replaces a node
333
+ // with one of identical size, so earlier edits cannot shift later
334
+ // positions in this loop.
335
+ tr.setNodeMarkup(pos, undefined, { ...node.attrs, align });
336
+ }
337
+ dispatch(tr.scrollIntoView());
338
+ }
339
+ return true;
340
+ };
341
+ }
342
+ /**
343
+ * Toggle an alignment: applying the one already in force clears it.
344
+ *
345
+ * The same reasoning as `toggleHeading`. An author who centred a paragraph by
346
+ * accident reaches for the control they just pressed, and having it do nothing
347
+ * because "centre" is already the value leaves them hunting for an
348
+ * un-centre button that does not exist.
349
+ */
350
+ export function toggleTextAlign(align) {
351
+ return (state, dispatch, view) => {
352
+ const next = activeTextAlign(state) === align ? null : align;
353
+ return setTextAlign(next)(state, dispatch, view);
354
+ };
355
+ }
356
+ /* ------------------------------------------------------------------ *
357
+ * Colour
358
+ * ------------------------------------------------------------------ */
359
+ /**
360
+ * Apply a colour mark, replacing any existing one of the same kind.
361
+ *
362
+ * Not `toggleMark`: with attributes, toggling means "the same colour twice
363
+ * removes it", so choosing red on text that is already red would clear it --
364
+ * and choosing red on text that is blue would leave two overlapping marks whose
365
+ * winner is decided by mark order. A colour picker is a set operation, so the
366
+ * existing mark is removed first and the new one added over the whole range.
367
+ *
368
+ * With an empty selection the colour goes onto the stored marks, so it applies
369
+ * to what the author types next. That is the same behaviour as pressing Bold on
370
+ * an empty cursor, and leaving it out is the most common complaint about colour
371
+ * pickers -- you choose a colour, type, and get black text.
372
+ */
373
+ function colorCommand(name, color) {
374
+ return (state, dispatch) => {
375
+ const type = markIn(state, name);
376
+ if (!type)
377
+ return false;
378
+ // A colour the schema would refuse is a bug in the caller, not a formatting
379
+ // request. Declining is better than writing an attribute that will be
380
+ // dropped on the next parse, which would look like the editor losing edits.
381
+ const value = color === null ? null : safeColor(color);
382
+ if (color !== null && value === null)
383
+ return false;
384
+ const { empty, from, to } = state.selection;
385
+ if (empty) {
386
+ const current = state.storedMarks ?? state.selection.$from.marks();
387
+ const stripped = current.filter((mark) => mark.type !== type);
388
+ if (value === null && stripped.length === current.length)
389
+ return false;
390
+ if (dispatch) {
391
+ dispatch(state.tr.setStoredMarks(value === null ? stripped : [...stripped, type.create({ color: value })]));
392
+ }
393
+ return true;
394
+ }
395
+ if (value === null && !state.doc.rangeHasMark(from, to, type))
396
+ return false;
397
+ if (dispatch) {
398
+ const tr = state.tr.removeMark(from, to, type);
399
+ if (value !== null)
400
+ tr.addMark(from, to, type.create({ color: value }));
401
+ dispatch(tr.scrollIntoView());
402
+ }
403
+ return true;
404
+ };
405
+ }
406
+ /** Attribute of a colour mark across the selection, or null when absent or mixed. */
407
+ function activeColor(state, name) {
408
+ const type = markIn(state, name);
409
+ if (!type)
410
+ return null;
411
+ const { empty, $from, from, to } = state.selection;
412
+ if (empty) {
413
+ const found = type.isInSet(state.storedMarks ?? $from.marks());
414
+ return found ? found.attrs['color'] : null;
415
+ }
416
+ let value = null;
417
+ let uniform = true;
418
+ state.doc.nodesBetween(from, to, (child) => {
419
+ if (!child.isText)
420
+ return true;
421
+ const found = type.isInSet(child.marks);
422
+ const colour = found ? found.attrs['color'] : null;
423
+ if (value === null && uniform)
424
+ value = colour;
425
+ else if (colour !== value)
426
+ uniform = false;
427
+ return true;
428
+ });
429
+ // Mixed colours report null for the same reason mixed alignment does: a
430
+ // swatch showing one of them invites the author to act on all of them.
431
+ return uniform ? value : null;
432
+ }
433
+ export function setTextColor(color) {
434
+ return colorCommand('text_color', color);
435
+ }
436
+ export function setBackgroundColor(color) {
437
+ return colorCommand('background_color', color);
438
+ }
439
+ export const clearTextColor = colorCommand('text_color', null);
440
+ export const clearBackgroundColor = colorCommand('background_color', null);
441
+ export function activeTextColor(state) {
442
+ return activeColor(state, 'text_color');
443
+ }
444
+ export function activeBackgroundColor(state) {
445
+ return activeColor(state, 'background_color');
446
+ }
264
447
  /**
265
448
  * Apply or update a link across the selection.
266
449
  *
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,GACX,MAAM,yBAAyB,CAAA;AAGhC;;;;;;;;;;;;;;GAcG;AACH,SAAS,MAAM,CAAC,KAAkB,EAAE,IAAY;IAC9C,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC;AAED,SAAS,MAAM,CAAC,KAAkB,EAAE,IAAY;IAC9C,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC;AAED,6EAA6E;AAC7E,SAAS,WAAW,CAAC,IAAY,EAAE,KAAkC;IACnE,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;QAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QACvB,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC3C,CAAC,CAAA;AACH,CAAC;AAED,6EAA6E;AAC7E,SAAS,WAAW,CAAC,IAAY,EAAE,KA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K,EAAE,QAAQ,EAAE,EAAE;QACzB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC;YAAE,OAAO,KAAK,CAAA;QAC5C,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;YACxC,IAAI,CAAC,SAAS;gBAAE,OAAO,KAAK,CAAA;YAC5B,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC;gBAC7B,GAAG,EAAE,KAAK,CAAC,GAAG;gBACd,qEAAqE;gBACrE,0DAA0D;gBAC1D,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,IAAI;gBACtB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI;gBAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI;gBAC1B,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI;aAC7B,CAAC,CAAA;YACF,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC,CAAA;QACjE,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;AACH,CAAC;AAED;;wEAEwE;AAExE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAEhD,MAAM,CAAC,MAAM,OAAO,GAAoC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC9E,MAAM,CAAC,MAAM,OAAO,GAAoC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA"}
package/dist/css.d.ts ADDED
@@ -0,0 +1,124 @@
1
+ /**
2
+ * The CSS the schema is willing to model, and nothing else.
3
+ *
4
+ * Alignment and colour are the two formatting features that cannot be expressed
5
+ * as a tag. `<p align="center">` and `<font color="red">` were removed from HTML
6
+ * years ago; every editor this one is meant to replace -- TinyMCE, CKEditor,
7
+ * Google Docs -- writes `style="text-align:center"` and
8
+ * `<span style="color:#c00">` instead. Matching them is not a preference: it is
9
+ * the difference between reading a customer's existing archive and rewriting it.
10
+ *
11
+ * So OpenLeaf emits a `style` attribute, which means it owes a precise answer to
12
+ * "which declarations, with which values". That answer lives here, in one place,
13
+ * because four separate consumers need to agree on it:
14
+ *
15
+ * the schema -- parsing stored HTML and writing it back
16
+ * the commands -- validating what a toolbar hands them
17
+ * the preservation -- deciding whether a `<span style>` is fully modelled and
18
+ * layer can therefore be unwrapped rather than kept as an atom
19
+ * @openleaf-editor/sanitize -- allowing exactly these declarations server-side
20
+ *
21
+ * Four hand-written copies of a CSS allowlist is the same divergence the
22
+ * sanitize package exists to prevent, one layer down.
23
+ *
24
+ * ## Why a validator rather than a blocklist
25
+ *
26
+ * `style` has a genuinely bad history: `expression()` in old IE executed
27
+ * JavaScript, `url()` fetches, `position:fixed` lets pasted content cover the
28
+ * page with something that looks like your UI. None of that is reachable
29
+ * through a three-property allowlist whose values must match a colour or one of
30
+ * four keywords -- and an allowlist stays safe against whatever CSS gains next,
31
+ * which a list of known-bad functions does not.
32
+ */
33
+ /** The four alignments a toolbar offers. */
34
+ export type Align = 'left' | 'center' | 'right' | 'justify';
35
+ export declare const ALIGNMENTS: readonly Align[];
36
+ /**
37
+ * Declarations the schema models, and therefore the only ones it will write.
38
+ *
39
+ * `@openleaf-editor/sanitize` reads this list to build its own allowlist, so a
40
+ * property added here reaches the server-side policy rather than being stripped
41
+ * from stored content by a policy that never heard of it.
42
+ */
43
+ export declare const MODELLED_PROPERTIES: readonly string[];
44
+ /**
45
+ * The subset a mark can represent, and therefore the subset the preservation
46
+ * layer may unwrap a `<span>` for. `text-align` is deliberately absent: it is a
47
+ * block attribute, so unwrapping the element that carries it loses it.
48
+ */
49
+ export declare const COLOUR_PROPERTIES: readonly string[];
50
+ /**
51
+ * Split a `style` attribute into declarations.
52
+ *
53
+ * Deliberately reads the raw attribute rather than the CSSOM. `element.style`
54
+ * normalizes as it parses -- Chrome turns `#ff0000` into `rgb(255, 0, 0)` -- and
55
+ * anything that reads through it rewrites every hex colour in an archive on the
56
+ * first save. The parse is trivial because the values that survive validation
57
+ * contain no semicolons or quotes; anything that does fails validation and is
58
+ * dropped, so a naive split cannot be tricked into producing a value the
59
+ * validators would not have accepted anyway.
60
+ *
61
+ * Keys are lowercased; values keep their case, because a colour may be a hex
62
+ * digit sequence an author wrote in capitals and there is no reason to change it.
63
+ */
64
+ export declare function parseDeclarations(style: string | null | undefined): Map<string, string>;
65
+ /** Join declarations back into a `style` attribute value, or `null` if empty. */
66
+ export declare function serializeDeclarations(declarations: Map<string, string>): string | null;
67
+ /**
68
+ * The alignment this value means, or null.
69
+ *
70
+ * `start` and `end` are accepted because they are what a bidirectional-aware
71
+ * author writes, and they are resolved against the reading direction rather than
72
+ * dropped: in an RTL document `start` is the right edge. They are NOT preserved
73
+ * as `start`/`end`, which is a real if narrow loss -- an RTL paragraph aligned to
74
+ * `start` comes back as `right`, and stays right if the document's direction
75
+ * later changes. Modelling logical alignment properly means a second attribute
76
+ * and a toolbar that can express it, which is a bigger feature than this one.
77
+ */
78
+ export declare function safeAlign(value: string | null | undefined, dir?: string | null): Align | null;
79
+ export declare function safeColor(value: string | null | undefined): string | null;
80
+ /**
81
+ * Put CSS on an element without losing the author's spelling.
82
+ *
83
+ * ## Why this is not simply `setAttribute('style', css)`
84
+ *
85
+ * ProseMirror's DOM serializer writes `style` with `element.style.cssText = value`,
86
+ * which routes the declaration through the CSSOM -- and the CSSOM rewrites as it
87
+ * parses. `color:#cc0000` comes back out as `color: rgb(204, 0, 0)`. Measured in
88
+ * Chromium and WebKit: `setAttribute` preserves the string exactly, `cssText`
89
+ * does not.
90
+ *
91
+ * The consequence of letting the serializer do it is that opening and saving a
92
+ * document rewrites every hex colour in it into a longer functional form. No
93
+ * information is lost, so it is a normalization rather than a fidelity bug -- but
94
+ * it is a normalization that touches the COMMON case in inherited content, and
95
+ * "we changed every coloured span in your archive" is not a diff this project
96
+ * gets to put in somebody's revision history quietly. So the nodes and marks that
97
+ * emit CSS return a real element and set the attribute themselves.
98
+ *
99
+ * ## Why it then falls back to the CSSOM anyway
100
+ *
101
+ * A strict Content-Security-Policy without `unsafe-inline` in `style-src` blocks
102
+ * a `style` ATTRIBUTE: the attribute stays in the DOM and the browser refuses to
103
+ * parse it, so the paragraph renders unaligned and the console fills with
104
+ * violations. A CSSOM write is not blocked -- the same distinction that makes the
105
+ * toolbar's constructable stylesheet CSP-safe.
106
+ *
107
+ * So: set the attribute, then check whether the browser honoured it, and fall
108
+ * back to `cssText` if it did not. Under an ordinary CSP the author's spelling
109
+ * survives; under a strict one the formatting still renders, at the cost of the
110
+ * normalization. Getting both right in the environment that has both is not
111
+ * possible, and of the two, "it renders" has to win.
112
+ */
113
+ export declare function applyStyleAttribute(el: Element, css: string): void;
114
+ /**
115
+ * Is every declaration in this `style` attribute one the schema models?
116
+ *
117
+ * The preservation layer asks this before unwrapping a `<span style>`. A span
118
+ * carrying only colour is fully representable as marks, so unwrapping it loses
119
+ * nothing and the text inside stays editable. One carrying `font-family` as well
120
+ * is not, and it must stay an opaque preserved atom -- faithful, uneditable, and
121
+ * exactly what happens today rather than a regression.
122
+ */
123
+ export declare function isFullyModelledStyle(style: string | null | undefined, properties?: readonly string[]): boolean;
124
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,4CAA4C;AAC5C,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;AAE3D,eAAO,MAAM,UAAU,EAAE,SAAS,KAAK,EAA2C,CAAA;AAElF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAgD,CAAA;AAEjG;;;;GAIG;AACH,eAAO,MAA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