@h-k-dev/angular-email-editor 0.0.5 → 0.0.7
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 +6 -6
- package/fesm2022/h-k-dev-angular-email-editor-suggestion-menu.mjs.map +1 -1
- package/fesm2022/h-k-dev-angular-email-editor.mjs +1607 -109
- 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 +553 -35
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.7",
|
|
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
|
* }
|