@h-k-dev/angular-email-editor 0.0.4 → 0.0.6
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/fesm2022/h-k-dev-angular-email-editor-actions.mjs +20 -9
- package/fesm2022/h-k-dev-angular-email-editor-actions.mjs.map +1 -1
- package/fesm2022/h-k-dev-angular-email-editor-address-input.mjs +5 -6
- package/fesm2022/h-k-dev-angular-email-editor-address-input.mjs.map +1 -1
- package/fesm2022/h-k-dev-angular-email-editor-suggestion-menu.mjs +26 -7
- package/fesm2022/h-k-dev-angular-email-editor-suggestion-menu.mjs.map +1 -1
- package/fesm2022/h-k-dev-angular-email-editor.mjs +399 -96
- package/fesm2022/h-k-dev-angular-email-editor.mjs.map +1 -1
- package/package.json +1 -1
- package/types/h-k-dev-angular-email-editor-actions.d.ts +16 -7
- package/types/h-k-dev-angular-email-editor-address-input.d.ts +2 -1
- package/types/h-k-dev-angular-email-editor-suggestion-menu.d.ts +6 -6
- package/types/h-k-dev-angular-email-editor.d.ts +144 -30
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-k-dev/angular-email-editor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "An email editor for Angular on ProseMirror — a visual composer and an HTML source editor over one schema that is the vocabulary of email HTML.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "h-k-dev",
|
|
@@ -2,6 +2,7 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { Signal, Injector } from '@angular/core';
|
|
3
3
|
import { EditorState } from 'prosemirror-state';
|
|
4
4
|
import { EditorAction, Editor } from '@h-k-dev/angular-email-editor';
|
|
5
|
+
import * as _h_k_dev_angular_email_editor_actions from '@h-k-dev/angular-email-editor/actions';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* An editor's state as a signal: the text, the selection, the stored marks —
|
|
@@ -81,7 +82,7 @@ interface EditorActions {
|
|
|
81
82
|
*
|
|
82
83
|
* readonly actions = injectActions(() => this.editor());
|
|
83
84
|
*
|
|
84
|
-
* <button [
|
|
85
|
+
* <button emailAction="bold" [emailActionFrom]="actions">…</button>
|
|
85
86
|
*
|
|
86
87
|
* `editor` is read reactively: when it changes — a composer switching to its
|
|
87
88
|
* code view — the actions are the new editor's. Its kit decides what exists:
|
|
@@ -103,11 +104,15 @@ declare function injectActions(editor: () => Editor | undefined, options?: {
|
|
|
103
104
|
* Makes the host's own control the trigger of an editor action: a click runs
|
|
104
105
|
* it, and the control says what the action's state is.
|
|
105
106
|
*
|
|
106
|
-
* <button mat-icon-button
|
|
107
|
-
* [disabled]="bold.disabled()">
|
|
107
|
+
* <button mat-icon-button emailAction="bold" [emailActionFrom]="actions"
|
|
108
|
+
* #bold="emailAction" [disabled]="bold.disabled()">
|
|
108
109
|
* <mat-icon>format_bold</mat-icon>
|
|
109
110
|
* </button>
|
|
110
111
|
*
|
|
112
|
+
* The action is named by its id, and looked up in the list it is from
|
|
113
|
+
* (`injectActions`) here, in a `computed`: a template binds values and reads
|
|
114
|
+
* signals, it calls no lookup of its own.
|
|
115
|
+
*
|
|
111
116
|
* Behaviour only, and ARIA only where the host's widget has not spoken:
|
|
112
117
|
* - `aria-pressed` for a toggle, and `aria-disabled` when it cannot run —
|
|
113
118
|
* both off with `[emailActionAria]="false"` for a widget that writes its own
|
|
@@ -124,9 +129,13 @@ declare function injectActions(editor: () => Editor | undefined, options?: {
|
|
|
124
129
|
* dialog, a picker) never has focus taken from what it opened.
|
|
125
130
|
*/
|
|
126
131
|
declare class ActionTrigger {
|
|
127
|
-
/** The action to trigger
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
/** The id of the action to trigger. */
|
|
133
|
+
readonly id: _angular_core.InputSignal<string>;
|
|
134
|
+
/** The actions it is one of — what `injectActions` returned. */
|
|
135
|
+
readonly from: _angular_core.InputSignal<EditorActions>;
|
|
136
|
+
/** The action itself. `undefined` (no editor yet, or a kit without it) is a
|
|
137
|
+
trigger with nothing to do: disabled. */
|
|
138
|
+
readonly action: _angular_core.Signal<_h_k_dev_angular_email_editor_actions.BoundAction | undefined>;
|
|
130
139
|
/** Whether this directive writes `aria-pressed` and `aria-disabled`. */
|
|
131
140
|
readonly aria: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
132
141
|
/** Whether the caret returns to the editor after the action ran. */
|
|
@@ -140,7 +149,7 @@ declare class ActionTrigger {
|
|
|
140
149
|
/** Runs the action, as a click does. False when it did not apply. */
|
|
141
150
|
run(): boolean;
|
|
142
151
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ActionTrigger, never>;
|
|
143
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ActionTrigger, "[emailAction]", ["emailAction"], { "
|
|
152
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ActionTrigger, "[emailAction]", ["emailAction"], { "id": { "alias": "emailAction"; "required": true; "isSignal": true; }; "from": { "alias": "emailActionFrom"; "required": true; "isSignal": true; }; "aria": { "alias": "emailActionAria"; "required": false; "isSignal": true; }; "returnFocus": { "alias": "emailActionFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
144
153
|
}
|
|
145
154
|
|
|
146
155
|
export { ActionTrigger, editorState, injectActions };
|
|
@@ -242,9 +242,10 @@ declare class AddressInput implements FormValueControl<string[]> {
|
|
|
242
242
|
select(address: string | null): void;
|
|
243
243
|
/** The chips as rendered, for the commands that are the chip's own. */
|
|
244
244
|
protected readonly chips: _angular_core.Signal<readonly AddressChip[]>;
|
|
245
|
+
/** What a chip's id starts with; its index ends it. */
|
|
246
|
+
protected readonly chipIdPrefix: string;
|
|
245
247
|
/** The active chip's id, for the input's `aria-activedescendant`. */
|
|
246
248
|
protected readonly activeId: _angular_core.Signal<string | null>;
|
|
247
|
-
protected chipId(index: number): string;
|
|
248
249
|
/** The cap is reached: a further address is refused. */
|
|
249
250
|
readonly full: _angular_core.Signal<boolean>;
|
|
250
251
|
/** Full, and nothing in it to fix: the input hides — the chips say
|
|
@@ -156,14 +156,14 @@ declare class SuggestionMenuItem {
|
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
158
|
* A heading in a suggestion menu's list: the words of a section
|
|
159
|
-
* (`SuggestionItem.section
|
|
160
|
-
*
|
|
161
|
-
* takes no highlight, no click, and no place
|
|
162
|
-
* the way a chat's slash menu heads its groups.
|
|
159
|
+
* (`SuggestionItem.section`), shown where the section changes from one row
|
|
160
|
+
* to the next — the state says where, and in which words, as each item's
|
|
161
|
+
* `heading`. Never an option: it takes no highlight, no click, and no place
|
|
162
|
+
* in the count — presentation, the way a chat's slash menu heads its groups.
|
|
163
163
|
*
|
|
164
164
|
* @for (item of state.items; track item.id) {
|
|
165
|
-
* @if (item.
|
|
166
|
-
* <div email-suggestion-menu-section>{{
|
|
165
|
+
* @if (item.heading; as heading) {
|
|
166
|
+
* <div email-suggestion-menu-section>{{ heading }}</div>
|
|
167
167
|
* }
|
|
168
168
|
* <div email-suggestion-menu-item [item]="item">…</div>
|
|
169
169
|
* }
|
|
@@ -35,8 +35,8 @@ interface SuggestionItemBase {
|
|
|
35
35
|
/** The heading a renderer groups rows under — a stable id (`'blocks'`,
|
|
36
36
|
`'styling'`, `'color'`), worded by the trigger's `sections` (see
|
|
37
37
|
`SuggestionTrigger`). Rows are listed in the order given, so a
|
|
38
|
-
section's rows are listed together, and
|
|
39
|
-
where the section changes. */
|
|
38
|
+
section's rows are listed together, and the menu's state says the
|
|
39
|
+
heading where the section changes (`ListedSuggestion.heading`). */
|
|
40
40
|
section?: string;
|
|
41
41
|
/** A colour the row shows in an icon's place — a palette's rows. */
|
|
42
42
|
swatch?: string;
|
|
@@ -2235,8 +2235,12 @@ declare const InlineAtomSelection: _h_k_dev_angular_email_editor.FunctionalExten
|
|
|
2235
2235
|
40% of the container, in every client and in the editor alike). The
|
|
2236
2236
|
offset serializes as `margin-left` — inline margins on tables are what
|
|
2237
2237
|
Outlook's own Word composer emits, so its engine reads them, and a client
|
|
2238
|
-
that strips them degrades the table gracefully to left-aligned.
|
|
2239
|
-
|
|
2238
|
+
that strips them degrades the table gracefully to left-aligned.
|
|
2239
|
+
`spacing` (px, or null for none) is the room above and below the table —
|
|
2240
|
+
`margin-top`/`margin-bottom`, block only, never the sides: real space
|
|
2241
|
+
between the table and the lines of text around it, which a client that
|
|
2242
|
+
strips it degrades to a table flush against its neighbours. */
|
|
2243
|
+
declare const tableStyle: (width: number, offset: number, spacing?: number | null) => string;
|
|
2240
2244
|
/** How a cell's content sits across its width. The same three the rest of the
|
|
2241
2245
|
editor aligns by (a paragraph's `align`), so one set of buttons drives
|
|
2242
2246
|
both — and `left` is the default, which canonicalizes to `null` and
|
|
@@ -2262,13 +2266,31 @@ declare function parsePadding(dom: HTMLElement): string | null;
|
|
|
2262
2266
|
`<td>` is the bulletproof border in email — Outlook's Word engine renders
|
|
2263
2267
|
it), with `border-collapse` on the table keeping the grid single-lined. */
|
|
2264
2268
|
declare const TABLE_BORDER_COLOR = "rgb(208, 215, 229)";
|
|
2265
|
-
/** The
|
|
2266
|
-
the rendered email is readable
|
|
2267
|
-
|
|
2268
|
-
table td` rule): a bordered and a plain table feel identical while
|
|
2269
|
-
composing; only what the recipient gets differs — the preset ships its
|
|
2270
|
-
padding, the plain table ships none unless authored. */
|
|
2269
|
+
/** The *real* cell padding a bordered or borderless table ships —
|
|
2270
|
+
Excel-style breathing room, so the rendered email is readable. A layout
|
|
2271
|
+
table ships none unless authored, and is drawn flush in the editor too. */
|
|
2271
2272
|
declare const TABLE_CELL_PADDING = "8px 12px";
|
|
2273
|
+
/** The room a bordered or borderless table keeps above and below itself, in
|
|
2274
|
+
px — real (`margin-top`/`margin-bottom` on the table, see `tableStyle`),
|
|
2275
|
+
so the email sets the table off from the text around it exactly as the
|
|
2276
|
+
editor does. Block only: the sides stay on the text column. */
|
|
2277
|
+
declare const TABLE_BLOCK_SPACING = 16;
|
|
2278
|
+
/**
|
|
2279
|
+
* The three tables the editor inserts — drawn in the editor exactly as the
|
|
2280
|
+
* email draws them:
|
|
2281
|
+
* - `bordered` — the default: a grid line on every cell
|
|
2282
|
+
* (`TABLE_BORDER_COLOR`), real cell padding (`TABLE_CELL_PADDING`) and
|
|
2283
|
+
* real room above and below the table (`TABLE_BLOCK_SPACING`);
|
|
2284
|
+
* - `borderless` — the same real padding and room, no lines;
|
|
2285
|
+
* - `layout` — none of it: the table sits flush against its neighbours and
|
|
2286
|
+
* its content flush in its cells, in the editor and the email alike. For
|
|
2287
|
+
* arranging content side by side, where the author owns every pixel.
|
|
2288
|
+
*
|
|
2289
|
+
* Not a node attr: the kind is just the cells' `border` and `padding` and
|
|
2290
|
+
* the table's `spacing`, which is all the email carries, so a parsed table
|
|
2291
|
+
* needs no hint to come back as the kind it was inserted as.
|
|
2292
|
+
*/
|
|
2293
|
+
type TableKind = 'bordered' | 'borderless' | 'layout';
|
|
2272
2294
|
/** Canonical percentage: one decimal at most, no trailing zero (25%, 33.3%). */
|
|
2273
2295
|
declare const formatPct: (n: number) => string;
|
|
2274
2296
|
/** No column below 10%: at 320px that is ~32px — the width where a column
|
|
@@ -2426,6 +2448,11 @@ declare const Column: _h_k_dev_angular_email_editor.NodeExtension;
|
|
|
2426
2448
|
/** The column container: a plain `<div>` whose direct children are column
|
|
2427
2449
|
divs. The child check discriminates it from an ordinary paragraph div. */
|
|
2428
2450
|
declare const Columns: _h_k_dev_angular_email_editor.NodeExtension;
|
|
2451
|
+
/** How many empty lines a fresh column starts with. Two, not one: the block
|
|
2452
|
+
has no padding of the editor's own, so a one-line column is a sliver the
|
|
2453
|
+
eye reads as a stray rule rather than a place to write — two lines give
|
|
2454
|
+
it the shape of a column, the way /table starts with rows to fill. */
|
|
2455
|
+
declare const COLUMN_STARTING_LINES = 2;
|
|
2429
2456
|
/** Exposed for the app to detect when the cursor is inside a columns block. */
|
|
2430
2457
|
declare function findColumnsContext(state: EditorState): {
|
|
2431
2458
|
pos: number;
|
|
@@ -2446,6 +2473,14 @@ declare const addColumn: Command;
|
|
|
2446
2473
|
declare const removeColumn: Command;
|
|
2447
2474
|
/** Deletes the whole columns block (the table's `deleteTable` sibling). */
|
|
2448
2475
|
declare const deleteColumns: Command;
|
|
2476
|
+
/** The `+` pill on the block's right flank: an empty column after the last,
|
|
2477
|
+
up to {@link MAX_COLUMNS}; every cap re-splits evenly. Addressed by the
|
|
2478
|
+
block's position, not the caret — the pill acts on the block it is on. */
|
|
2479
|
+
declare function appendColumn(pos: number): Command;
|
|
2480
|
+
/** The `−` pill on the block's left flank: the last column goes — the `+`'s
|
|
2481
|
+
exact inverse — and the rest re-split evenly. Refuses on the last one
|
|
2482
|
+
left: the block itself goes by selecting it whole and pressing Delete. */
|
|
2483
|
+
declare function removeLastColumn(pos: number): Command;
|
|
2449
2484
|
/** Sets (or clears) the `background` of the `column` the cursor is in. */
|
|
2450
2485
|
declare function setColumnBackground(color: string | null): Command;
|
|
2451
2486
|
/**
|
|
@@ -2721,6 +2756,25 @@ declare const BLOCK_MENU_FOCUS_KEY = "Alt-F10";
|
|
|
2721
2756
|
*/
|
|
2722
2757
|
declare const createBlockMenu: (options: BlockMenuOptions) => FunctionalExtension;
|
|
2723
2758
|
|
|
2759
|
+
/**
|
|
2760
|
+
* An item as the menu lists it: the item, and the heading it opens. A
|
|
2761
|
+
* renderer shows `heading` above the row — a template reads it, it works out
|
|
2762
|
+
* nothing:
|
|
2763
|
+
*
|
|
2764
|
+
* @for (item of state.items; track item.id) {
|
|
2765
|
+
* @if (item.heading; as heading) {
|
|
2766
|
+
* <div email-suggestion-menu-section>{{ heading }}</div>
|
|
2767
|
+
* }
|
|
2768
|
+
* …
|
|
2769
|
+
* }
|
|
2770
|
+
*/
|
|
2771
|
+
type ListedSuggestion = SuggestionItem & {
|
|
2772
|
+
/** The words of the item's section where the section starts — the first
|
|
2773
|
+
row, or the previous row's section is another; null on every other row
|
|
2774
|
+
and on an item with no section. Worded by the trigger's `sections`,
|
|
2775
|
+
else the library's ({@link suggestionSectionTitles}), else the id. */
|
|
2776
|
+
readonly heading: string | null;
|
|
2777
|
+
};
|
|
2724
2778
|
interface SuggestionMenuState {
|
|
2725
2779
|
open: boolean;
|
|
2726
2780
|
/** The trigger this state answers to — `/`, `{{`, `@`. A menu of several
|
|
@@ -2740,8 +2794,9 @@ interface SuggestionMenuState {
|
|
|
2740
2794
|
/** Items matching the query: static matches ranked title-first (given
|
|
2741
2795
|
order within a tier), then what a source answered for this query — the
|
|
2742
2796
|
menu's {@link SuggestionMenuOptions.source} at level 1, the group's
|
|
2743
|
-
children source at level 2. Titles and keywords are already translated
|
|
2744
|
-
|
|
2797
|
+
children source at level 2. Titles and keywords are already translated,
|
|
2798
|
+
and each item says the heading it opens ({@link ListedSuggestion}). */
|
|
2799
|
+
items: ListedSuggestion[];
|
|
2745
2800
|
/** Index of the keyboard-highlighted item. */
|
|
2746
2801
|
activeIndex: number;
|
|
2747
2802
|
/** A source's first page for the current query is in flight (or waiting
|
|
@@ -2777,11 +2832,6 @@ interface SuggestionMenuState {
|
|
|
2777
2832
|
editor points at the highlighted one (`aria-activedescendant`), and the
|
|
2778
2833
|
pointer's highlight finds its row by it. */
|
|
2779
2834
|
optionId: (index: number) => string;
|
|
2780
|
-
/** The heading for a section id (an item's `section`): the trigger's
|
|
2781
|
-
`sections` wording, else the library's own ({@link
|
|
2782
|
-
suggestionSectionTitles}), else the id itself. Asked as headings are
|
|
2783
|
-
rendered, so a function given as `sections` is heard afresh. */
|
|
2784
|
-
sectionTitle: (id: string) => string;
|
|
2785
2835
|
/** Applies an item. A command item removes the trigger and query text,
|
|
2786
2836
|
then runs its command; a group rewrites the query to `<word> `,
|
|
2787
2837
|
opening level 2. */
|
|
@@ -2904,9 +2954,10 @@ interface SuggestionTrigger {
|
|
|
2904
2954
|
i18n?: Readonly<Record<string, SuggestionItemLabel>> | ((id: string) => SuggestionItemLabel | undefined);
|
|
2905
2955
|
/**
|
|
2906
2956
|
* The headings of the items' sections (`SuggestionItem.section`), by id:
|
|
2907
|
-
* a map, or a function of the id, asked whenever
|
|
2908
|
-
*
|
|
2909
|
-
*
|
|
2957
|
+
* a map, or a function of the id, asked whenever the menu reports its
|
|
2958
|
+
* items (each item's {@link ListedSuggestion.heading}) — hand it a
|
|
2959
|
+
* translation service's lookup and a language switch reaches the
|
|
2960
|
+
* headings too. What it leaves out is worded by the library
|
|
2910
2961
|
* ({@link suggestionSectionTitles}), and an id neither knows shows as it
|
|
2911
2962
|
* is.
|
|
2912
2963
|
*/
|
|
@@ -2997,6 +3048,57 @@ interface SuggestionMenuOptions extends Partial<SuggestionTrigger> {
|
|
|
2997
3048
|
*/
|
|
2998
3049
|
declare const createSuggestionMenu: (options: SuggestionMenuOptions) => FunctionalExtension;
|
|
2999
3050
|
|
|
3051
|
+
/** The page a {@link pagedSource} asks its `with` to encode: how many rows
|
|
3052
|
+
are listed already (the offset), and how many to fetch. */
|
|
3053
|
+
interface SuggestionPageRequest {
|
|
3054
|
+
skip: number;
|
|
3055
|
+
limit: number;
|
|
3056
|
+
}
|
|
3057
|
+
/** Where a {@link pagedSource} fetches from: anything with a `find` — a
|
|
3058
|
+
backend model's client, a service. */
|
|
3059
|
+
interface SuggestionFrom<TFilter, TRow> {
|
|
3060
|
+
/** The rows for a filter. Hand the signal on to `fetch` / `HttpClient`:
|
|
3061
|
+
it aborts once the answer is no longer wanted. */
|
|
3062
|
+
find(filter: TFilter, signal: AbortSignal): readonly TRow[] | Promise<readonly TRow[]>;
|
|
3063
|
+
}
|
|
3064
|
+
interface PagedSourceOptions<TFilter, TRow, T extends SuggestionItem> {
|
|
3065
|
+
/** What fetches the rows. */
|
|
3066
|
+
from: SuggestionFrom<TFilter, TRow>;
|
|
3067
|
+
/** The filter for a query and a page, in the transport's own shape: a
|
|
3068
|
+
LoopBack `{ where, order, skip, limit }`, a search index's
|
|
3069
|
+
`{ q, offset, limit }`. The query is as typed — trim it here if the
|
|
3070
|
+
backend should not see the spaces. */
|
|
3071
|
+
with: (query: string, page: SuggestionPageRequest) => TFilter;
|
|
3072
|
+
/** A row as a suggestion. Its `id` is the row's own key — the id the
|
|
3073
|
+
backend has, never one made from the words shown: the menu tracks a row
|
|
3074
|
+
by it and lists an id once, so a page that repeats a row (rows that
|
|
3075
|
+
moved between requests) adds nothing. */
|
|
3076
|
+
map: (row: TRow) => T;
|
|
3077
|
+
/** Rows a page asks for. A page with fewer is the last one.
|
|
3078
|
+
@default 20 */
|
|
3079
|
+
pageSize?: number;
|
|
3080
|
+
}
|
|
3081
|
+
/**
|
|
3082
|
+
* A {@link SuggestionSource} for a backend that pages by offset — the
|
|
3083
|
+
* paging written once: a query and a page become a filter (`with`), the
|
|
3084
|
+
* filter becomes rows (`from`), each row a suggestion (`map`). The cursor
|
|
3085
|
+
* is the next page's offset; a short page ends the list.
|
|
3086
|
+
*
|
|
3087
|
+
* createSuggestionMenu({
|
|
3088
|
+
* trigger: '{{',
|
|
3089
|
+
* source: pagedSource({
|
|
3090
|
+
* from: { find: (filter, signal) => api.mergeTags(filter, signal) },
|
|
3091
|
+
* with: (query, { skip, limit }) => ({ where: { path: { ilike: `%${query}%` } }, skip, limit }),
|
|
3092
|
+
* map: (row) => ({ id: row.path, title: row.label, command: insertMergeTag(row.path) }),
|
|
3093
|
+
* }),
|
|
3094
|
+
* …
|
|
3095
|
+
* });
|
|
3096
|
+
*
|
|
3097
|
+
* Anything else — a cursor of the backend's own, a merged answer of two
|
|
3098
|
+
* calls — is a {@link SuggestionSource} written by hand.
|
|
3099
|
+
*/
|
|
3100
|
+
declare function pagedSource<TFilter, TRow, T extends SuggestionItem>(options: PagedSourceOptions<TFilter, TRow, T>): SuggestionSource<T>;
|
|
3101
|
+
|
|
3000
3102
|
/** Where a stream is writing: what it has written so far. */
|
|
3001
3103
|
interface ContentStreamRange {
|
|
3002
3104
|
from: number;
|
|
@@ -3201,19 +3303,31 @@ interface MenuAnchor {
|
|
|
3201
3303
|
top: number;
|
|
3202
3304
|
bottom: number;
|
|
3203
3305
|
}
|
|
3306
|
+
/** Where a floating menu goes, in its scroll container's content coordinates. */
|
|
3307
|
+
interface MenuPlacement {
|
|
3308
|
+
left: number;
|
|
3309
|
+
top: number;
|
|
3310
|
+
/** The most the box may be tall there: set only when it fits on neither
|
|
3311
|
+
side of the line at full height, so it is shrunk to the side with more
|
|
3312
|
+
room. Null when it fits as it is. */
|
|
3313
|
+
maxHeight: number | null;
|
|
3314
|
+
}
|
|
3204
3315
|
/**
|
|
3205
3316
|
* Where a floating menu goes for an anchor line: under it, clamped to its
|
|
3206
3317
|
* scroll container, flipped above when below would overflow the visible
|
|
3207
|
-
* area.
|
|
3208
|
-
*
|
|
3209
|
-
*
|
|
3318
|
+
* area. When it fits on neither side it goes to the side with more room and
|
|
3319
|
+
* says how tall it may be there (`maxHeight`) — flip, then size, as Floating
|
|
3320
|
+
* UI does — so the container never clips it.
|
|
3321
|
+
*
|
|
3322
|
+
* Read-only — it measures and returns, and the caller writes `left` / `top`
|
|
3323
|
+
* (and the height cap) in its own write phase, so measuring never follows a
|
|
3324
|
+
* write in the same task. The element must be `position: absolute` inside a
|
|
3210
3325
|
* `position: relative` scroll container; its size is read as rendered, so
|
|
3211
|
-
* call it after its contents are in.
|
|
3326
|
+
* call it after its contents are in. A caller that caps the box itself
|
|
3327
|
+
* passes `height`, the box's height without that cap — a box measured at the
|
|
3328
|
+
* last cap would choose its side by the old room, not its own size.
|
|
3212
3329
|
*/
|
|
3213
|
-
declare function measureMenuPlacement(anchor: MenuAnchor, element: HTMLElement, offset: number):
|
|
3214
|
-
left: number;
|
|
3215
|
-
top: number;
|
|
3216
|
-
} | null;
|
|
3330
|
+
declare function measureMenuPlacement(anchor: MenuAnchor, element: HTMLElement, offset: number, height?: number): MenuPlacement | null;
|
|
3217
3331
|
|
|
3218
3332
|
/**
|
|
3219
3333
|
* An *expression dialect*: what the `{{…}}` tokens mean. The merge-tag mark
|
|
@@ -3937,5 +4051,5 @@ declare class InlineImages extends InlineImageStore {
|
|
|
3937
4051
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
3938
4052
|
}
|
|
3939
4053
|
|
|
3940
|
-
export { AUTHORED_ATTR, AUTHORED_SPEC_KEY, AUTHORED_STYLE_DEFAULTS_KEY, AuthoredEnter, BLOCKQUOTE_STYLE, BLOCK_MENU_FOCUS_KEY, BUTTON_FILL, BUTTON_STYLE, BaseKeymap, Blockquote, Bold, BulletList, Button, CARET_ROOM, CLIENT_LABELS, COMMENT_TAG, CONTENT_ATTRS, CSS_SUPPORT, ClearFormatting, CodeLine, CodeLineIndent, Column, ColumnResize, Columns, ColumnsResize, DOCUMENT_CLASS, DOCUMENT_TAGS, DUAL_BACKGROUND_MIN_RATIO, DUAL_CONTRAST_DARK, DUAL_CONTRAST_LIGHT, DUAL_CONTRAST_MIN_RATIO, Divider, Document$1 as Document, DocumentStyles, EMAIL_ATTRIBUTES, EMAIL_CSS_PROPERTIES, EMAIL_SAFE_STYLE_PROPERTIES, EMAIL_SAFE_TAGS, EMAIL_TAGS, EMAIL_TAG_ATTRIBUTES, EmailParagraph, FILE_CHOOSER_POINTER_WAIT, FILL_TEXT_COLOR, FILL_TEXT_COLOR_LIGHT, FILL_TEXT_COLOR_RGB, FOLD_WIDTH, FORMAT_WIDTH, GMAIL_CLIP_BYTES, GUIDES_ACTIVE_CLASS, GUIDES_PEEK_CLASS, GUIDES_PEEK_DELAY_MS, Gapcursor, HEADING_SIZES, HardBreak, Heading, History, HtmlComment, HtmlCommentInline, HtmlElement, HtmlInline, HtmlLanguage, HtmlRaw, HtmlTextElement, HtmlVoid, HtmlVoidBlock, IMPORT_VIEWPORT_WIDTH, INDENT_MAX, INDENT_STEP, INLINE_TAGS, INLINE_VOID_TAGS, IN_SELECTION_CLASS, Image, InlineAtomSelection, InlineImageStore, InlineImages, Italic, LIST_STYLE, LayoutGuides, Link, ListItem, MAX_COLUMNS, MAX_IMAGE_WIDTH, MAX_MERGE_TAG_LENGTH, MAX_UNBROKEN_RUN, MIN_COLUMN_CAP, MIN_COLUMN_PCT, MIN_FONT_SIZE, MIN_IMAGE_WIDTH, MIN_TABLE_PCT, MJML_WORLDLY_HTML, MergeTag, NoTextDrag, OrderedList, PARSE_SCOPE_KEY, PLACEHOLDER_WIDTH, Paragraph, PasteHygiene, QuotedHistory, REFUSED_TAGS, RENDERING_CLIENTS, SECTION_CONTENT_MAX, SECTION_INSET, SECTION_PADDING, STACK_CLASS, STACK_RULE, Section, SplitKeepingMarks, TABLE_BORDER_COLOR, TABLE_CELL_PADDING, TABLE_SECTION_TAGS, TYPING_REST, Table, TableCell, TableRow, Text, TextStyle, UNSET_BUTTON_HREF, Underline, VOID_TAGS, acceptProposal, addColumn, addColumnAtEnd, addRowAtEnd, analyzeAngularExpression, angularDialect, angularRequiredFields, applyAuthoredAttributes, applyEmailVocabulary, attributeString, authoredAttribute, authoredMarkupOf, authoredViewAttributes, bareButtons, buttonStyle, canonicalHead, canonicalMergeTagInner, canonicalRender, caretCellPos, caretInsideMergeTag, claimedImageFiles, clearCells, clientList, columnCaps, columnWidths, completionContextAt, containerStyle, contrastRatio, correctStoredMistakes, createAngularExpressions, createBlockMenu, createBubbleMenu, createButtonEdit, createContentProposal, createContentStream, createDOMParser, createEditor, createHtmlAutocomplete, createHtmlLanguage, createImageDrag, createInlineImages, createMergeTagResolution, createOffsetMapper, createQuotedHistory, createSchema, createSendIntent, createSourceMarks, createSuggestionMenu, createTableHandles, declarationProperty, declaredBackground, decodeDataUrl, defaultBubbleShouldShow, defineExtension, defineMark, defineNode, deleteColumns, deleteFullySelected, discardProposal, distributePadding, docText, dropDeadOfficeClasses, dropHidden, dropMediaQueries, dropZeroSizedWhitespace, duplicateColumn, duplicateRow, editQuotedHistory, effectiveWidths, emailBackgroundPalette, emailDocument, emailExtensions, emailPlainText, emailSizeBudget, emailTextPalette, embedsAsLinks, entitySpans, escapeAttribute, escapeText, expressionDialect, expressionDialectKey, extensionActions, extensionSuggestions, fillTextColor, filledPlaceholderAttrs, filterEmailStyle, findColumnContext, findColumnsContext, findCssIssues, findListDepth, findSectionContext, findTableContext, fitImageWidth, foldHTML, formatHTML, formatPct, forwardDocument, forwardQuote, hasBlockChildren, hasDocumentEnvelope, headingStyle, holdsBlock, holdsColumn, hrefProblem, htmlSourceExtensions, imageDropTarget, importLoss, importedDocument, inheritTextStyles, inheritedMarkup, inlineBootstrapTableBorders, inlineImageCids, inlineImageRegistry, inlineImagesKey, inlineStyles, insertHTML, insertMergeTag, isActionEnabled, isBlock, isBlockLevel, isBlockish, isBooleanAttribute, isEmailAttribute, isEmailCssProperty, isEmailTag, isFillTextColor, isInlineAtom, isMarkActive, isMergeTagExpression, isMergeTagPath, isNodeActive, isPadded, isProposing, isQuotedHistoryFolded, isSafeColor, isSafeFontFamily, isSafeFontSize, isSafeUrl, isSectionImageUrl, isStreaming, italicStarInputRegex, italicStarPasteRegex, italicUnderscoreInputRegex, italicUnderscorePasteRegex, keepGmailRules, layoutBlockAt, linkClickPlugin, linkPastePlugin, linkRangeAt, lintHTML, lowerInlinesAroundBlocks, markAttrsOf, markStackingColumns, marksAcrossBreak, materializeComments, measureMenuPlacement, mediaMatches, mergeTagAt, mergeTagExpressions, mergeTagFields, mergeTagRanges, mergeTagResolutionPending, moveColumn, moveRow, normalizeCommentText, normalizeCss, normalizeHref, normalizeMergeTagText, noteOwnWidths, openFileChooser, openTag, openTags, outlookColumns, paddingOf, parseAngularExpression, parseDocument, parseFontFamily, parseFontSize, parseHTML, parsePadding, parseRules, parseTextTransform, passesDualBackground, passesDualContrast, preserveExtensions, preservedAttributes, promoteInlineImages, promoteMergeTags, proposalRange, proposeContent, quotedHistory, readEnvelope, readImageFile, realizeComments, relativeLuminance, removeColumn, removeQuotedHistory, renderForClient, renderedPath, repairLinkSchemes, repairTables, replaceHTML, replyDocument, replyEnvelope, replyQuote, reviseProposal, rewriteInlineImageSources, richTextExtensions, ruleForScope, ruleScope, sanitizePastedHTML, scanHTML, scanMergeTags, scopeOf, scopedDocumentCss, selectColumn, selectRow, selectedButton, selectedImage, selectedImageAlt, selectedMarkAtom, selectionInsideMergeTag, serializeDocument, serializeToHTML, setCellBackground, setColumnBackground, setColumnBoundary, setColumnsBoundary, setQuotedHistory, setSectionBackground, setSectionImage, setTableBox, setTableWidth, soleInlineAtom, splitDeclarations, splitListItemKeepMarks, starInputRegex, starPasteRegex, stopProposal, streamContent, streamedRange, streamingRange, suggestionSectionTitles, tableStyle, textOffsetAt, textRegions, toEmailSafeColor, toInboundMessage, toggleList, trimInlineBoxes, underscoreInputRegex, underscorePasteRegex, unwrapLayoutTables, unwrapOfficeParagraphMarks, verbatimElement, videoPage, watchMenuScroll, withAttribute, withAuthoredMarkup, withQuoted, withQuotedHistory, withStyleDeclaration, withoutAttribute, withoutStyleDeclaration };
|
|
3941
|
-
export type { AngularExpressionsOptions, AngularNode, AttributePairs, AuthoredElement, AuthoredMarkup, AutocompleteItem, AutocompleteOptions, AutocompleteState, BlockMenuOptions, BlockMenuState, BubbleMenuOptions, BubbleMenuState, ButtonEditOptions, ButtonEditTarget, CellAlignment, CellVerticalAlignment, ClientRenderingOptions, CommandFactory, CompletionContext, ComposeSeedLabels, ComposeSeedOptions, ContentProposalOptions, ContentProposalState, ContentStreamOptions, ContentStreamRange, ContentStreamReveal, ContentStreamRun, ContentStreamState, ContentStreamWriter, CssSupportIssue, DocumentEnvelope, Editor, EditorAction, EditorOptions, EmailClient, EmailDocumentOptions, ExpressionDiagnostic, ExpressionDialect, ExpressionIssue, Extension, ExtensionContext, FunctionalExtension, HrefProblem, HtmlDiagnostic, HtmlLanguageOptions, HtmlScan, HtmlTag, HtmlToken, HtmlTokenType, ImageAttrs, ImageDragOptions, ImageDropTarget, ImportLoss, InboundMessage, InlineAtomAt, InlineImage, InlineImageRegistry, InlineImageStoreOptions, LayoutBlock, LayoutBlockType, LinkAttrs, LinkRange, MarkExtension, MenuAnchor, MenuScroll, MenuScrollApi, MergeTagRange, MergeTagResolutionOptions, MergeTagResolutionReport, NodeExtension, PaletteColor, ParagraphAlignment, ParseMode, ParseOptions, ParsedAddressLike, ParsedEmailLike, PromotedInlineImages, QuotedHistoryLabel, QuotedHistoryLabels, QuotedHistoryOptions, RenderingClient, ReplyEnvelope, ReplyEnvelopeOptions, ReplyKind, RuleScope, SendIntent, SendIntentOptions, SizeBudget, SourceMarksOptions, SourceOptions, StreamContentOptions, SuggestionAllowProps, SuggestionCommandItem, SuggestionGroup, SuggestionItem, SuggestionItemLabel, SuggestionMenuOptions, SuggestionMenuState, SuggestionPage, SuggestionRect, SuggestionRequest, SuggestionSource, SuggestionTrigger, TableHandleTarget, TableHandlesOptions, TextTransform };
|
|
4054
|
+
export { AUTHORED_ATTR, AUTHORED_SPEC_KEY, AUTHORED_STYLE_DEFAULTS_KEY, AuthoredEnter, BLOCKQUOTE_STYLE, BLOCK_MENU_FOCUS_KEY, BUTTON_FILL, BUTTON_STYLE, BaseKeymap, Blockquote, Bold, BulletList, Button, CARET_ROOM, CLIENT_LABELS, COLUMN_STARTING_LINES, COMMENT_TAG, CONTENT_ATTRS, CSS_SUPPORT, ClearFormatting, CodeLine, CodeLineIndent, Column, ColumnResize, Columns, ColumnsResize, DOCUMENT_CLASS, DOCUMENT_TAGS, DUAL_BACKGROUND_MIN_RATIO, DUAL_CONTRAST_DARK, DUAL_CONTRAST_LIGHT, DUAL_CONTRAST_MIN_RATIO, Divider, Document$1 as Document, DocumentStyles, EMAIL_ATTRIBUTES, EMAIL_CSS_PROPERTIES, EMAIL_SAFE_STYLE_PROPERTIES, EMAIL_SAFE_TAGS, EMAIL_TAGS, EMAIL_TAG_ATTRIBUTES, EmailParagraph, FILE_CHOOSER_POINTER_WAIT, FILL_TEXT_COLOR, FILL_TEXT_COLOR_LIGHT, FILL_TEXT_COLOR_RGB, FOLD_WIDTH, FORMAT_WIDTH, GMAIL_CLIP_BYTES, GUIDES_ACTIVE_CLASS, GUIDES_PEEK_CLASS, GUIDES_PEEK_DELAY_MS, Gapcursor, HEADING_SIZES, HardBreak, Heading, History, HtmlComment, HtmlCommentInline, HtmlElement, HtmlInline, HtmlLanguage, HtmlRaw, HtmlTextElement, HtmlVoid, HtmlVoidBlock, IMPORT_VIEWPORT_WIDTH, INDENT_MAX, INDENT_STEP, INLINE_TAGS, INLINE_VOID_TAGS, IN_SELECTION_CLASS, Image, InlineAtomSelection, InlineImageStore, InlineImages, Italic, LIST_STYLE, LayoutGuides, Link, ListItem, MAX_COLUMNS, MAX_IMAGE_WIDTH, MAX_MERGE_TAG_LENGTH, MAX_UNBROKEN_RUN, MIN_COLUMN_CAP, MIN_COLUMN_PCT, MIN_FONT_SIZE, MIN_IMAGE_WIDTH, MIN_TABLE_PCT, MJML_WORLDLY_HTML, MergeTag, NoTextDrag, OrderedList, PARSE_SCOPE_KEY, PLACEHOLDER_WIDTH, Paragraph, PasteHygiene, QuotedHistory, REFUSED_TAGS, RENDERING_CLIENTS, SECTION_CONTENT_MAX, SECTION_INSET, SECTION_PADDING, STACK_CLASS, STACK_RULE, Section, SplitKeepingMarks, TABLE_BLOCK_SPACING, TABLE_BORDER_COLOR, TABLE_CELL_PADDING, TABLE_SECTION_TAGS, TYPING_REST, Table, TableCell, TableRow, Text, TextStyle, UNSET_BUTTON_HREF, Underline, VOID_TAGS, acceptProposal, addColumn, addColumnAtEnd, addRowAtEnd, analyzeAngularExpression, angularDialect, angularRequiredFields, appendColumn, applyAuthoredAttributes, applyEmailVocabulary, attributeString, authoredAttribute, authoredMarkupOf, authoredViewAttributes, bareButtons, buttonStyle, canonicalHead, canonicalMergeTagInner, canonicalRender, caretCellPos, caretInsideMergeTag, claimedImageFiles, clearCells, clientList, columnCaps, columnWidths, completionContextAt, containerStyle, contrastRatio, correctStoredMistakes, createAngularExpressions, createBlockMenu, createBubbleMenu, createButtonEdit, createContentProposal, createContentStream, createDOMParser, createEditor, createHtmlAutocomplete, createHtmlLanguage, createImageDrag, createInlineImages, createMergeTagResolution, createOffsetMapper, createQuotedHistory, createSchema, createSendIntent, createSourceMarks, createSuggestionMenu, createTableHandles, declarationProperty, declaredBackground, decodeDataUrl, defaultBubbleShouldShow, defineExtension, defineMark, defineNode, deleteColumns, deleteFullySelected, discardProposal, distributePadding, docText, dropDeadOfficeClasses, dropHidden, dropMediaQueries, dropZeroSizedWhitespace, duplicateColumn, duplicateRow, editQuotedHistory, effectiveWidths, emailBackgroundPalette, emailDocument, emailExtensions, emailPlainText, emailSizeBudget, emailTextPalette, embedsAsLinks, entitySpans, escapeAttribute, escapeText, expressionDialect, expressionDialectKey, extensionActions, extensionSuggestions, fillTextColor, filledPlaceholderAttrs, filterEmailStyle, findColumnContext, findColumnsContext, findCssIssues, findListDepth, findSectionContext, findTableContext, fitImageWidth, foldHTML, formatHTML, formatPct, forwardDocument, forwardQuote, hasBlockChildren, hasDocumentEnvelope, headingStyle, holdsBlock, holdsColumn, hrefProblem, htmlSourceExtensions, imageDropTarget, importLoss, importedDocument, inheritTextStyles, inheritedMarkup, inlineBootstrapTableBorders, inlineImageCids, inlineImageRegistry, inlineImagesKey, inlineStyles, insertHTML, insertMergeTag, isActionEnabled, isBlock, isBlockLevel, isBlockish, isBooleanAttribute, isEmailAttribute, isEmailCssProperty, isEmailTag, isFillTextColor, isInlineAtom, isMarkActive, isMergeTagExpression, isMergeTagPath, isNodeActive, isPadded, isProposing, isQuotedHistoryFolded, isSafeColor, isSafeFontFamily, isSafeFontSize, isSafeUrl, isSectionImageUrl, isStreaming, italicStarInputRegex, italicStarPasteRegex, italicUnderscoreInputRegex, italicUnderscorePasteRegex, keepGmailRules, layoutBlockAt, linkClickPlugin, linkPastePlugin, linkRangeAt, lintHTML, lowerInlinesAroundBlocks, markAttrsOf, markStackingColumns, marksAcrossBreak, materializeComments, measureMenuPlacement, mediaMatches, mergeTagAt, mergeTagExpressions, mergeTagFields, mergeTagRanges, mergeTagResolutionPending, moveColumn, moveRow, normalizeCommentText, normalizeCss, normalizeHref, normalizeMergeTagText, noteOwnWidths, openFileChooser, openTag, openTags, outlookColumns, paddingOf, pagedSource, parseAngularExpression, parseDocument, parseFontFamily, parseFontSize, parseHTML, parsePadding, parseRules, parseTextTransform, passesDualBackground, passesDualContrast, preserveExtensions, preservedAttributes, promoteInlineImages, promoteMergeTags, proposalRange, proposeContent, quotedHistory, readEnvelope, readImageFile, realizeComments, relativeLuminance, removeColumn, removeLastColumn, removeQuotedHistory, renderForClient, renderedPath, repairLinkSchemes, repairTables, replaceHTML, replyDocument, replyEnvelope, replyQuote, reviseProposal, rewriteInlineImageSources, richTextExtensions, ruleForScope, ruleScope, sanitizePastedHTML, scanHTML, scanMergeTags, scopeOf, scopedDocumentCss, selectColumn, selectRow, selectedButton, selectedImage, selectedImageAlt, selectedMarkAtom, selectionInsideMergeTag, serializeDocument, serializeToHTML, setCellBackground, setColumnBackground, setColumnBoundary, setColumnsBoundary, setQuotedHistory, setSectionBackground, setSectionImage, setTableBox, setTableWidth, soleInlineAtom, splitDeclarations, splitListItemKeepMarks, starInputRegex, starPasteRegex, stopProposal, streamContent, streamedRange, streamingRange, suggestionSectionTitles, tableStyle, textOffsetAt, textRegions, toEmailSafeColor, toInboundMessage, toggleList, trimInlineBoxes, underscoreInputRegex, underscorePasteRegex, unwrapLayoutTables, unwrapOfficeParagraphMarks, verbatimElement, videoPage, watchMenuScroll, withAttribute, withAuthoredMarkup, withQuoted, withQuotedHistory, withStyleDeclaration, withoutAttribute, withoutStyleDeclaration };
|
|
4055
|
+
export type { AngularExpressionsOptions, AngularNode, AttributePairs, AuthoredElement, AuthoredMarkup, AutocompleteItem, AutocompleteOptions, AutocompleteState, BlockMenuOptions, BlockMenuState, BubbleMenuOptions, BubbleMenuState, ButtonEditOptions, ButtonEditTarget, CellAlignment, CellVerticalAlignment, ClientRenderingOptions, CommandFactory, CompletionContext, ComposeSeedLabels, ComposeSeedOptions, ContentProposalOptions, ContentProposalState, ContentStreamOptions, ContentStreamRange, ContentStreamReveal, ContentStreamRun, ContentStreamState, ContentStreamWriter, CssSupportIssue, DocumentEnvelope, Editor, EditorAction, EditorOptions, EmailClient, EmailDocumentOptions, ExpressionDiagnostic, ExpressionDialect, ExpressionIssue, Extension, ExtensionContext, FunctionalExtension, HrefProblem, HtmlDiagnostic, HtmlLanguageOptions, HtmlScan, HtmlTag, HtmlToken, HtmlTokenType, ImageAttrs, ImageDragOptions, ImageDropTarget, ImportLoss, InboundMessage, InlineAtomAt, InlineImage, InlineImageRegistry, InlineImageStoreOptions, LayoutBlock, LayoutBlockType, LinkAttrs, LinkRange, ListedSuggestion, MarkExtension, MenuAnchor, MenuPlacement, MenuScroll, MenuScrollApi, MergeTagRange, MergeTagResolutionOptions, MergeTagResolutionReport, NodeExtension, PagedSourceOptions, PaletteColor, ParagraphAlignment, ParseMode, ParseOptions, ParsedAddressLike, ParsedEmailLike, PromotedInlineImages, QuotedHistoryLabel, QuotedHistoryLabels, QuotedHistoryOptions, RenderingClient, ReplyEnvelope, ReplyEnvelopeOptions, ReplyKind, RuleScope, SendIntent, SendIntentOptions, SizeBudget, SourceMarksOptions, SourceOptions, StreamContentOptions, SuggestionAllowProps, SuggestionCommandItem, SuggestionFrom, SuggestionGroup, SuggestionItem, SuggestionItemLabel, SuggestionMenuOptions, SuggestionMenuState, SuggestionPage, SuggestionPageRequest, SuggestionRect, SuggestionRequest, SuggestionSource, SuggestionTrigger, TableHandleTarget, TableHandlesOptions, TableKind, TextTransform };
|