@area8975/ui 0.2.2-dev.46 → 0.2.2-dev.48
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/area8975-ui.mjs +942 -203
- package/fesm2022/area8975-ui.mjs.map +1 -1
- package/package.json +5 -1
- package/types/area8975-ui.d.ts +153 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@area8975/ui",
|
|
3
|
-
"version": "0.2.2-dev.
|
|
3
|
+
"version": "0.2.2-dev.48",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^22.0.0",
|
|
6
6
|
"@angular/core": "^22.0.0",
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
"@ng-icons/core": "^35.0.1",
|
|
9
9
|
"@ng-icons/heroicons": "^35.0.1",
|
|
10
10
|
"@tailwindcss/forms": "^0.5.11",
|
|
11
|
+
"@tiptap/core": "^3.32.2",
|
|
12
|
+
"@tiptap/extensions": "^3.32.2",
|
|
13
|
+
"@tiptap/pm": "^3.32.2",
|
|
14
|
+
"@tiptap/starter-kit": "^3.32.2",
|
|
11
15
|
"apexcharts": "^4.7.0",
|
|
12
16
|
"preline": "^4.2.0",
|
|
13
17
|
"rxjs": "~7.8.0",
|
package/types/area8975-ui.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { ElementRef, EnvironmentProviders, InjectionToken, OnDestroy, OnInit, Provider, Signal, TemplateRef, WritableSignal } from "@angular/core";
|
|
3
3
|
import ApexCharts$1 from "apexcharts";
|
|
4
|
+
import { ChainedCommands, Editor } from "@tiptap/core";
|
|
4
5
|
import { Placement } from "@floating-ui/dom";
|
|
5
6
|
import { Observable } from "rxjs";
|
|
6
7
|
import { IconType } from "@ng-icons/core";
|
|
@@ -1486,6 +1487,156 @@ export declare class UiRadioComponent<ValueType = unknown> {
|
|
|
1486
1487
|
"validationState": "validationStateChange";
|
|
1487
1488
|
}, never, never, true, never>;
|
|
1488
1489
|
}
|
|
1490
|
+
/**
|
|
1491
|
+
* Every tool the editor's toolbar can show. Leaving a formatting tool out of
|
|
1492
|
+
* `tools` also turns that formatting off - its shortcut stops working and
|
|
1493
|
+
* pasted content loses it - so the value only ever holds what the toolbar offers.
|
|
1494
|
+
* `undo` and `redo` only control the buttons; history and its shortcuts are always on.
|
|
1495
|
+
*/
|
|
1496
|
+
export declare const RichTextTools: readonly ["bold", "italic", "underline", "strike", "code", "heading1", "heading2", "heading3", "bulletList", "orderedList", "blockquote", "codeBlock", "horizontalRule", "link", "undo", "redo"];
|
|
1497
|
+
/** @see {@link RichTextTools} */
|
|
1498
|
+
export type RichTextTool = typeof RichTextTools[number];
|
|
1499
|
+
/** The toolbar's groups, in order, with a divider drawn between each. */
|
|
1500
|
+
export declare const RichTextToolGroups: readonly (readonly RichTextTool[])[];
|
|
1501
|
+
/** true is valid, false is invalid, null is not yet validated. */
|
|
1502
|
+
export type RichTextEditorValidation = boolean | null;
|
|
1503
|
+
interface ToolDefinition {
|
|
1504
|
+
label: string;
|
|
1505
|
+
icon: string;
|
|
1506
|
+
/** Whether the tool is "on" at the cursor. Tools without it aren't toggles. */
|
|
1507
|
+
active?: (editor: Editor) => boolean;
|
|
1508
|
+
run: (chain: ChainedCommands) => ChainedCommands;
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* A WYSIWYG editor whose value is an HTML string, with a toolbar of formatting tools.
|
|
1512
|
+
*/
|
|
1513
|
+
export declare class UiRichTextEditorComponent {
|
|
1514
|
+
/** The content as HTML. An empty editor is `''`. */
|
|
1515
|
+
readonly value: import("@angular/core").ModelSignal<string>;
|
|
1516
|
+
readonly classes: import("@angular/core").InputSignal<string>;
|
|
1517
|
+
/** Which toolbar tools to show, and so which formatting is allowed. @see {@link RichTextTools} */
|
|
1518
|
+
readonly tools: import("@angular/core").InputSignal<readonly ("blockquote" | "code" | "link" | "strike" | "bold" | "italic" | "underline" | "heading1" | "heading2" | "heading3" | "bulletList" | "orderedList" | "codeBlock" | "horizontalRule" | "undo" | "redo")[]>;
|
|
1519
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
|
1520
|
+
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
1521
|
+
readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1522
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1523
|
+
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1524
|
+
/** true/false shows valid/invalid styling. null means not validated yet. */
|
|
1525
|
+
readonly validationState: import("@angular/core").ModelSignal<RichTextEditorValidation>;
|
|
1526
|
+
readonly spellcheck: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1527
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
1528
|
+
readonly describedBy: import("@angular/core").InputSignal<string>;
|
|
1529
|
+
readonly focused: import("@angular/core").OutputEmitterRef<FocusEvent>;
|
|
1530
|
+
readonly blurred: import("@angular/core").OutputEmitterRef<FocusEvent>;
|
|
1531
|
+
private readonly injector;
|
|
1532
|
+
private readonly host;
|
|
1533
|
+
private readonly content;
|
|
1534
|
+
private readonly editor;
|
|
1535
|
+
/** Bumped on every editor transaction, so toolbar state re-reads the editor. */
|
|
1536
|
+
private readonly revision;
|
|
1537
|
+
/** The HTML the editor last held, to tell our own updates from outside ones. */
|
|
1538
|
+
private lastHtml;
|
|
1539
|
+
protected readonly contentId: string;
|
|
1540
|
+
protected readonly linkInputId: string;
|
|
1541
|
+
protected readonly linkOpen: import("@angular/core").WritableSignal<boolean>;
|
|
1542
|
+
protected readonly linkHref: import("@angular/core").WritableSignal<string>;
|
|
1543
|
+
/** Index of the toolbar button that takes the toolbar's single tab stop. */
|
|
1544
|
+
protected readonly focusIndex: import("@angular/core").WritableSignal<number>;
|
|
1545
|
+
protected readonly editable: import("@angular/core").Signal<boolean>;
|
|
1546
|
+
protected readonly toolGroups: import("@angular/core").Signal<("blockquote" | "code" | "link" | "strike" | "bold" | "italic" | "underline" | "heading1" | "heading2" | "heading3" | "bulletList" | "orderedList" | "codeBlock" | "horizontalRule" | "undo" | "redo")[][]>;
|
|
1547
|
+
protected readonly flatTools: import("@angular/core").Signal<("blockquote" | "code" | "link" | "strike" | "bold" | "italic" | "underline" | "heading1" | "heading2" | "heading3" | "bulletList" | "orderedList" | "codeBlock" | "horizontalRule" | "undo" | "redo")[]>;
|
|
1548
|
+
protected readonly showToolbar: import("@angular/core").Signal<boolean>;
|
|
1549
|
+
/** Per tool: whether it's on at the cursor, and whether it can run right now. */
|
|
1550
|
+
protected readonly toolState: import("@angular/core").Signal<Record<"blockquote" | "code" | "link" | "strike" | "bold" | "italic" | "underline" | "heading1" | "heading2" | "heading3" | "bulletList" | "orderedList" | "codeBlock" | "horizontalRule" | "undo" | "redo", {
|
|
1551
|
+
active: boolean;
|
|
1552
|
+
enabled: boolean;
|
|
1553
|
+
}>>;
|
|
1554
|
+
protected readonly generatedClasses: import("@angular/core").Signal<string>;
|
|
1555
|
+
/** Attributes for the contenteditable element, which Tiptap renders. */
|
|
1556
|
+
private readonly contentAttributes;
|
|
1557
|
+
/** Each tool left out of `tools` switches its extension off. */
|
|
1558
|
+
private readonly extensions;
|
|
1559
|
+
constructor();
|
|
1560
|
+
protected toolDefinition(tool: RichTextTool): ToolDefinition;
|
|
1561
|
+
protected readonly runTool: (tool: RichTextTool) => void;
|
|
1562
|
+
/** Arrow keys move between toolbar buttons, so the toolbar is one tab stop. */
|
|
1563
|
+
protected readonly onToolbarKeydown: (event: KeyboardEvent) => void;
|
|
1564
|
+
protected readonly openLink: () => void;
|
|
1565
|
+
protected readonly applyLink: () => void;
|
|
1566
|
+
protected readonly removeLink: () => void;
|
|
1567
|
+
protected readonly closeLink: () => void;
|
|
1568
|
+
protected readonly onLinkKeydown: (event: KeyboardEvent) => void;
|
|
1569
|
+
private createEditor;
|
|
1570
|
+
private htmlOf;
|
|
1571
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UiRichTextEditorComponent, never>;
|
|
1572
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UiRichTextEditorComponent, "ui-rich-text-editor", never, {
|
|
1573
|
+
"value": {
|
|
1574
|
+
"alias": "value";
|
|
1575
|
+
"required": true;
|
|
1576
|
+
"isSignal": true;
|
|
1577
|
+
};
|
|
1578
|
+
"classes": {
|
|
1579
|
+
"alias": "classes";
|
|
1580
|
+
"required": false;
|
|
1581
|
+
"isSignal": true;
|
|
1582
|
+
};
|
|
1583
|
+
"tools": {
|
|
1584
|
+
"alias": "tools";
|
|
1585
|
+
"required": false;
|
|
1586
|
+
"isSignal": true;
|
|
1587
|
+
};
|
|
1588
|
+
"id": {
|
|
1589
|
+
"alias": "id";
|
|
1590
|
+
"required": false;
|
|
1591
|
+
"isSignal": true;
|
|
1592
|
+
};
|
|
1593
|
+
"placeholder": {
|
|
1594
|
+
"alias": "placeholder";
|
|
1595
|
+
"required": false;
|
|
1596
|
+
"isSignal": true;
|
|
1597
|
+
};
|
|
1598
|
+
"required": {
|
|
1599
|
+
"alias": "required";
|
|
1600
|
+
"required": false;
|
|
1601
|
+
"isSignal": true;
|
|
1602
|
+
};
|
|
1603
|
+
"disabled": {
|
|
1604
|
+
"alias": "disabled";
|
|
1605
|
+
"required": false;
|
|
1606
|
+
"isSignal": true;
|
|
1607
|
+
};
|
|
1608
|
+
"readonly": {
|
|
1609
|
+
"alias": "readonly";
|
|
1610
|
+
"required": false;
|
|
1611
|
+
"isSignal": true;
|
|
1612
|
+
};
|
|
1613
|
+
"validationState": {
|
|
1614
|
+
"alias": "validationState";
|
|
1615
|
+
"required": false;
|
|
1616
|
+
"isSignal": true;
|
|
1617
|
+
};
|
|
1618
|
+
"spellcheck": {
|
|
1619
|
+
"alias": "spellcheck";
|
|
1620
|
+
"required": false;
|
|
1621
|
+
"isSignal": true;
|
|
1622
|
+
};
|
|
1623
|
+
"ariaLabel": {
|
|
1624
|
+
"alias": "ariaLabel";
|
|
1625
|
+
"required": false;
|
|
1626
|
+
"isSignal": true;
|
|
1627
|
+
};
|
|
1628
|
+
"describedBy": {
|
|
1629
|
+
"alias": "describedBy";
|
|
1630
|
+
"required": false;
|
|
1631
|
+
"isSignal": true;
|
|
1632
|
+
};
|
|
1633
|
+
}, {
|
|
1634
|
+
"value": "valueChange";
|
|
1635
|
+
"validationState": "validationStateChange";
|
|
1636
|
+
"focused": "focused";
|
|
1637
|
+
"blurred": "blurred";
|
|
1638
|
+
}, never, never, true, never>;
|
|
1639
|
+
}
|
|
1489
1640
|
/** Defines if and when a `ui-overlay` should close when the user clicks. */
|
|
1490
1641
|
export type UiOverlayCloseBehaviour = 'none' | 'whenClickOutside' | 'whenClickAnywhere';
|
|
1491
1642
|
export interface UiOverlayOptions {
|
|
@@ -1966,7 +2117,7 @@ export type AvatarSize = typeof AvatarSizes[number];
|
|
|
1966
2117
|
export declare class UiBadgeComponent {
|
|
1967
2118
|
readonly appearance: import("@angular/core").InputSignal<"solid" | "outline" | "soft">;
|
|
1968
2119
|
readonly intent: import("@angular/core").InputSignal<"primary" | "secondary" | "success" | "warning" | "danger">;
|
|
1969
|
-
readonly size: import("@angular/core").InputSignal<"
|
|
2120
|
+
readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg" | "xs">;
|
|
1970
2121
|
readonly generatedClasses: import("@angular/core").Signal<string>;
|
|
1971
2122
|
static ɵfac: i0.ɵɵFactoryDeclaration<UiBadgeComponent, never>;
|
|
1972
2123
|
static ɵcmp: i0.ɵɵComponentDeclaration<UiBadgeComponent, "ui-badge", never, {
|
|
@@ -2001,7 +2152,7 @@ export declare class UiButtonComponent {
|
|
|
2001
2152
|
readonly intent: import("@angular/core").InputSignal<"none" | "primary" | "secondary" | "success" | "warning" | "danger">;
|
|
2002
2153
|
readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg">;
|
|
2003
2154
|
readonly classes: import("@angular/core").InputSignal<string>;
|
|
2004
|
-
readonly type: import("@angular/core").InputSignal<"button" | "
|
|
2155
|
+
readonly type: import("@angular/core").InputSignal<"button" | "submit" | "reset">;
|
|
2005
2156
|
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
2006
2157
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
2007
2158
|
readonly loading: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|