simpo-component-library 3.6.854 → 3.6.857
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/esm2022/lib/elements/text-editor/text-editor.component.mjs +49 -67
- package/fesm2022/simpo-component-library.mjs +126 -143
- package/fesm2022/simpo-component-library.mjs.map +1 -1
- package/lib/elements/text-editor/text-editor.component.d.ts +5 -7
- package/package.json +10 -4
- package/simpo-component-library-3.6.857.tgz +0 -0
- package/simpo-component-library-3.6.854.tgz +0 -0
|
@@ -32,15 +32,10 @@ import * as i10$2 from '@angular/material/slider';
|
|
|
32
32
|
import { MatSliderModule, MatSlider } from '@angular/material/slider';
|
|
33
33
|
import * as i10$1 from '@angular/material/progress-spinner';
|
|
34
34
|
import { MatProgressSpinner, MatProgressSpinnerModule, MatSpinner } from '@angular/material/progress-spinner';
|
|
35
|
-
import { Extension, Editor } from '@tiptap/core';
|
|
36
|
-
import StarterKit from '@tiptap/starter-kit';
|
|
37
35
|
import { CdkDrag, CdkDragPlaceholder, moveItemInArray } from '@angular/cdk/drag-drop';
|
|
38
|
-
import { TextStyle } from '@tiptap/extension-text-style';
|
|
39
|
-
import Color from '@tiptap/extension-color';
|
|
40
|
-
import Underline from '@tiptap/extension-underline';
|
|
41
|
-
import TextAlign from '@tiptap/extension-text-align';
|
|
42
36
|
import * as i12 from '@angular/material/form-field';
|
|
43
37
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
38
|
+
import { Extension } from '@tiptap/core';
|
|
44
39
|
import * as i2$2 from '@angular/router';
|
|
45
40
|
import { RouterLink, NavigationEnd } from '@angular/router';
|
|
46
41
|
import * as i1$2 from '@angular/platform-browser';
|
|
@@ -1656,6 +1651,86 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1656
1651
|
args: ['simpoObjectPosition']
|
|
1657
1652
|
}] } });
|
|
1658
1653
|
|
|
1654
|
+
class ContenteditableValueAccessor {
|
|
1655
|
+
constructor(elementRef, renderer) {
|
|
1656
|
+
this.elementRef = elementRef;
|
|
1657
|
+
this.renderer = renderer;
|
|
1658
|
+
this.onTouched = () => { };
|
|
1659
|
+
this.contenteditable = true; // Allow dynamic input
|
|
1660
|
+
this.onChange = (_value) => { };
|
|
1661
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'contenteditable', 'true');
|
|
1662
|
+
}
|
|
1663
|
+
ngAfterViewInit() {
|
|
1664
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'contenteditable', this.contenteditable ? 'true' : 'false');
|
|
1665
|
+
this.observer = new MutationObserver(() => {
|
|
1666
|
+
this.onChange(this.elementRef.nativeElement.innerHTML);
|
|
1667
|
+
});
|
|
1668
|
+
this.observer.observe(this.elementRef.nativeElement, {
|
|
1669
|
+
characterData: true,
|
|
1670
|
+
childList: true,
|
|
1671
|
+
subtree: true,
|
|
1672
|
+
});
|
|
1673
|
+
}
|
|
1674
|
+
ngOnDestroy() {
|
|
1675
|
+
this.observer?.disconnect();
|
|
1676
|
+
}
|
|
1677
|
+
onInput() {
|
|
1678
|
+
this.observer?.disconnect();
|
|
1679
|
+
this.onChange(this.elementRef.nativeElement.innerHTML);
|
|
1680
|
+
}
|
|
1681
|
+
onBlur() {
|
|
1682
|
+
this.onTouched();
|
|
1683
|
+
}
|
|
1684
|
+
writeValue(value) {
|
|
1685
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'innerHTML', value || '');
|
|
1686
|
+
}
|
|
1687
|
+
registerOnChange(onChange) {
|
|
1688
|
+
this.onChange = onChange;
|
|
1689
|
+
}
|
|
1690
|
+
registerOnTouched(onTouched) {
|
|
1691
|
+
this.onTouched = onTouched;
|
|
1692
|
+
}
|
|
1693
|
+
setDisabledState(disabled) {
|
|
1694
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'contenteditable', String(!disabled));
|
|
1695
|
+
}
|
|
1696
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContenteditableValueAccessor, deps: [{ token: ElementRef }, { token: Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1697
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ContenteditableValueAccessor, isStandalone: true, selector: "[contenteditable][ngModel]", inputs: { contenteditable: "contenteditable" }, host: { listeners: { "input": "onInput()", "blur": "onBlur()" } }, providers: [
|
|
1698
|
+
{
|
|
1699
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1700
|
+
useExisting: forwardRef(() => ContenteditableValueAccessor),
|
|
1701
|
+
multi: true,
|
|
1702
|
+
},
|
|
1703
|
+
], ngImport: i0 }); }
|
|
1704
|
+
}
|
|
1705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContenteditableValueAccessor, decorators: [{
|
|
1706
|
+
type: Directive,
|
|
1707
|
+
args: [{
|
|
1708
|
+
selector: '[contenteditable][ngModel]',
|
|
1709
|
+
providers: [
|
|
1710
|
+
{
|
|
1711
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1712
|
+
useExisting: forwardRef(() => ContenteditableValueAccessor),
|
|
1713
|
+
multi: true,
|
|
1714
|
+
},
|
|
1715
|
+
],
|
|
1716
|
+
standalone: true
|
|
1717
|
+
}]
|
|
1718
|
+
}], ctorParameters: () => [{ type: i0.ElementRef, decorators: [{
|
|
1719
|
+
type: Inject,
|
|
1720
|
+
args: [ElementRef]
|
|
1721
|
+
}] }, { type: i0.Renderer2, decorators: [{
|
|
1722
|
+
type: Inject,
|
|
1723
|
+
args: [Renderer2]
|
|
1724
|
+
}] }], propDecorators: { contenteditable: [{
|
|
1725
|
+
type: Input
|
|
1726
|
+
}], onInput: [{
|
|
1727
|
+
type: HostListener,
|
|
1728
|
+
args: ['input']
|
|
1729
|
+
}], onBlur: [{
|
|
1730
|
+
type: HostListener,
|
|
1731
|
+
args: ['blur']
|
|
1732
|
+
}] } });
|
|
1733
|
+
|
|
1659
1734
|
const GradientExtension = Extension.create({
|
|
1660
1735
|
name: 'gradient',
|
|
1661
1736
|
addGlobalAttributes() {
|
|
@@ -1759,94 +1834,13 @@ const FontSize = Extension.create({
|
|
|
1759
1834
|
}
|
|
1760
1835
|
});
|
|
1761
1836
|
|
|
1762
|
-
class ContenteditableValueAccessor {
|
|
1763
|
-
constructor(elementRef, renderer) {
|
|
1764
|
-
this.elementRef = elementRef;
|
|
1765
|
-
this.renderer = renderer;
|
|
1766
|
-
this.onTouched = () => { };
|
|
1767
|
-
this.contenteditable = true; // Allow dynamic input
|
|
1768
|
-
this.onChange = (_value) => { };
|
|
1769
|
-
this.renderer.setAttribute(this.elementRef.nativeElement, 'contenteditable', 'true');
|
|
1770
|
-
}
|
|
1771
|
-
ngAfterViewInit() {
|
|
1772
|
-
this.renderer.setAttribute(this.elementRef.nativeElement, 'contenteditable', this.contenteditable ? 'true' : 'false');
|
|
1773
|
-
this.observer = new MutationObserver(() => {
|
|
1774
|
-
this.onChange(this.elementRef.nativeElement.innerHTML);
|
|
1775
|
-
});
|
|
1776
|
-
this.observer.observe(this.elementRef.nativeElement, {
|
|
1777
|
-
characterData: true,
|
|
1778
|
-
childList: true,
|
|
1779
|
-
subtree: true,
|
|
1780
|
-
});
|
|
1781
|
-
}
|
|
1782
|
-
ngOnDestroy() {
|
|
1783
|
-
this.observer?.disconnect();
|
|
1784
|
-
}
|
|
1785
|
-
onInput() {
|
|
1786
|
-
this.observer?.disconnect();
|
|
1787
|
-
this.onChange(this.elementRef.nativeElement.innerHTML);
|
|
1788
|
-
}
|
|
1789
|
-
onBlur() {
|
|
1790
|
-
this.onTouched();
|
|
1791
|
-
}
|
|
1792
|
-
writeValue(value) {
|
|
1793
|
-
this.renderer.setProperty(this.elementRef.nativeElement, 'innerHTML', value || '');
|
|
1794
|
-
}
|
|
1795
|
-
registerOnChange(onChange) {
|
|
1796
|
-
this.onChange = onChange;
|
|
1797
|
-
}
|
|
1798
|
-
registerOnTouched(onTouched) {
|
|
1799
|
-
this.onTouched = onTouched;
|
|
1800
|
-
}
|
|
1801
|
-
setDisabledState(disabled) {
|
|
1802
|
-
this.renderer.setAttribute(this.elementRef.nativeElement, 'contenteditable', String(!disabled));
|
|
1803
|
-
}
|
|
1804
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContenteditableValueAccessor, deps: [{ token: ElementRef }, { token: Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1805
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ContenteditableValueAccessor, isStandalone: true, selector: "[contenteditable][ngModel]", inputs: { contenteditable: "contenteditable" }, host: { listeners: { "input": "onInput()", "blur": "onBlur()" } }, providers: [
|
|
1806
|
-
{
|
|
1807
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1808
|
-
useExisting: forwardRef(() => ContenteditableValueAccessor),
|
|
1809
|
-
multi: true,
|
|
1810
|
-
},
|
|
1811
|
-
], ngImport: i0 }); }
|
|
1812
|
-
}
|
|
1813
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContenteditableValueAccessor, decorators: [{
|
|
1814
|
-
type: Directive,
|
|
1815
|
-
args: [{
|
|
1816
|
-
selector: '[contenteditable][ngModel]',
|
|
1817
|
-
providers: [
|
|
1818
|
-
{
|
|
1819
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1820
|
-
useExisting: forwardRef(() => ContenteditableValueAccessor),
|
|
1821
|
-
multi: true,
|
|
1822
|
-
},
|
|
1823
|
-
],
|
|
1824
|
-
standalone: true
|
|
1825
|
-
}]
|
|
1826
|
-
}], ctorParameters: () => [{ type: i0.ElementRef, decorators: [{
|
|
1827
|
-
type: Inject,
|
|
1828
|
-
args: [ElementRef]
|
|
1829
|
-
}] }, { type: i0.Renderer2, decorators: [{
|
|
1830
|
-
type: Inject,
|
|
1831
|
-
args: [Renderer2]
|
|
1832
|
-
}] }], propDecorators: { contenteditable: [{
|
|
1833
|
-
type: Input
|
|
1834
|
-
}], onInput: [{
|
|
1835
|
-
type: HostListener,
|
|
1836
|
-
args: ['input']
|
|
1837
|
-
}], onBlur: [{
|
|
1838
|
-
type: HostListener,
|
|
1839
|
-
args: ['blur']
|
|
1840
|
-
}] } });
|
|
1841
|
-
|
|
1842
1837
|
// text-editor.component.ts
|
|
1843
1838
|
class TextEditorComponent {
|
|
1844
|
-
constructor(
|
|
1845
|
-
this.platformId = platformId;
|
|
1839
|
+
constructor() {
|
|
1846
1840
|
this.value = '<p>Hello this is palash makhija</p>';
|
|
1847
1841
|
this.valueChange = new EventEmitter();
|
|
1848
1842
|
this.editable = false;
|
|
1849
|
-
this.
|
|
1843
|
+
this.platformId = inject(PLATFORM_ID);
|
|
1850
1844
|
this.selectedFontSize = '';
|
|
1851
1845
|
this.showToolbar = false;
|
|
1852
1846
|
this.toolbarX = 0;
|
|
@@ -1862,34 +1856,44 @@ class TextEditorComponent {
|
|
|
1862
1856
|
selectedSize: ''
|
|
1863
1857
|
};
|
|
1864
1858
|
this.handleWindowFocus = () => {
|
|
1865
|
-
if (!this.isBrowser)
|
|
1866
|
-
return;
|
|
1867
1859
|
setTimeout(() => {
|
|
1868
1860
|
this.isColorPickerOpen = false;
|
|
1869
1861
|
}, 300);
|
|
1870
1862
|
};
|
|
1871
|
-
this.isBrowser =
|
|
1872
|
-
isPlatformBrowser(this.platformId);
|
|
1873
1863
|
}
|
|
1874
|
-
ngAfterViewInit() {
|
|
1875
|
-
if (
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
this.initializeEditor();
|
|
1864
|
+
async ngAfterViewInit() {
|
|
1865
|
+
if (this.editable &&
|
|
1866
|
+
isPlatformBrowser(this.platformId)) {
|
|
1867
|
+
await this.initializeEditor();
|
|
1879
1868
|
}
|
|
1880
1869
|
}
|
|
1881
1870
|
ngOnDestroy() {
|
|
1882
|
-
if (this.editor
|
|
1871
|
+
if (this.editor &&
|
|
1872
|
+
isPlatformBrowser(this.platformId)) {
|
|
1883
1873
|
this.editor.destroy();
|
|
1884
1874
|
}
|
|
1885
1875
|
}
|
|
1886
|
-
initializeEditor() {
|
|
1887
|
-
if (!this.isBrowser)
|
|
1888
|
-
return;
|
|
1876
|
+
async initializeEditor() {
|
|
1889
1877
|
if (!this.editorElement)
|
|
1890
1878
|
return;
|
|
1879
|
+
// dynamic imports for SSR safety
|
|
1880
|
+
const { Editor } = await import('@tiptap/core');
|
|
1881
|
+
const StarterKit = (await import('@tiptap/starter-kit')).default;
|
|
1882
|
+
const TextStyle = (await import('@tiptap/extension-text-style'))
|
|
1883
|
+
.TextStyle;
|
|
1884
|
+
const Color = (await import('@tiptap/extension-color'))
|
|
1885
|
+
.default;
|
|
1886
|
+
const Underline = (await import('@tiptap/extension-underline'))
|
|
1887
|
+
.default;
|
|
1888
|
+
const TextAlign = (await import('@tiptap/extension-text-align'))
|
|
1889
|
+
.default;
|
|
1891
1890
|
this.editor = new Editor({
|
|
1892
1891
|
element: this.editorElement.nativeElement,
|
|
1892
|
+
editorProps: {
|
|
1893
|
+
attributes: {
|
|
1894
|
+
class: 'ProseMirror'
|
|
1895
|
+
}
|
|
1896
|
+
},
|
|
1893
1897
|
extensions: [
|
|
1894
1898
|
StarterKit,
|
|
1895
1899
|
TextStyle,
|
|
@@ -1913,24 +1917,32 @@ class TextEditorComponent {
|
|
|
1913
1917
|
const html = editor.getHTML();
|
|
1914
1918
|
this.value = html;
|
|
1915
1919
|
this.valueChange.emit(html);
|
|
1920
|
+
this.updateEmptyEditorClass();
|
|
1916
1921
|
}
|
|
1917
1922
|
});
|
|
1923
|
+
this.updateEmptyEditorClass();
|
|
1918
1924
|
}
|
|
1919
|
-
|
|
1920
|
-
if (!this.
|
|
1925
|
+
updateEmptyEditorClass() {
|
|
1926
|
+
if (!this.editorElement)
|
|
1921
1927
|
return;
|
|
1922
|
-
|
|
1928
|
+
const editorWrapper = this.editorElement.nativeElement
|
|
1929
|
+
.closest('.editable-text');
|
|
1930
|
+
if (!editorWrapper)
|
|
1923
1931
|
return;
|
|
1932
|
+
if (this.editor?.isEmpty) {
|
|
1933
|
+
editorWrapper.classList.add('editor-empty');
|
|
1934
|
+
}
|
|
1935
|
+
else {
|
|
1936
|
+
editorWrapper.classList.remove('editor-empty');
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
saveSelection() {
|
|
1924
1940
|
this.savedSelection =
|
|
1925
1941
|
this.editor.state.selection;
|
|
1926
1942
|
}
|
|
1927
1943
|
restoreSelection() {
|
|
1928
|
-
if (!this.isBrowser)
|
|
1929
|
-
return;
|
|
1930
1944
|
if (!this.savedSelection)
|
|
1931
1945
|
return;
|
|
1932
|
-
if (!this.editor)
|
|
1933
|
-
return;
|
|
1934
1946
|
this.editor
|
|
1935
1947
|
.chain()
|
|
1936
1948
|
.focus()
|
|
@@ -1958,8 +1970,6 @@ class TextEditorComponent {
|
|
|
1958
1970
|
});
|
|
1959
1971
|
}
|
|
1960
1972
|
openColorPicker() {
|
|
1961
|
-
if (!this.isBrowser)
|
|
1962
|
-
return;
|
|
1963
1973
|
this.isColorPickerOpen = true;
|
|
1964
1974
|
this.saveSelection();
|
|
1965
1975
|
setTimeout(() => {
|
|
@@ -1967,10 +1977,6 @@ class TextEditorComponent {
|
|
|
1967
1977
|
});
|
|
1968
1978
|
}
|
|
1969
1979
|
handleSelection() {
|
|
1970
|
-
if (!this.isBrowser)
|
|
1971
|
-
return;
|
|
1972
|
-
if (!this.editor)
|
|
1973
|
-
return;
|
|
1974
1980
|
const { from, to } = this.editor.state.selection;
|
|
1975
1981
|
if (from === to) {
|
|
1976
1982
|
if (!this.isColorPickerOpen) {
|
|
@@ -1986,8 +1992,7 @@ class TextEditorComponent {
|
|
|
1986
1992
|
}
|
|
1987
1993
|
const range = selection.getRangeAt(0);
|
|
1988
1994
|
const rect = range.getBoundingClientRect();
|
|
1989
|
-
const editorRect = this.editorElement
|
|
1990
|
-
.nativeElement
|
|
1995
|
+
const editorRect = this.editorElement.nativeElement
|
|
1991
1996
|
.getBoundingClientRect();
|
|
1992
1997
|
this.showToolbar = true;
|
|
1993
1998
|
setTimeout(() => {
|
|
@@ -2013,8 +2018,6 @@ class TextEditorComponent {
|
|
|
2013
2018
|
});
|
|
2014
2019
|
}
|
|
2015
2020
|
toggleBold() {
|
|
2016
|
-
if (!this.editor)
|
|
2017
|
-
return;
|
|
2018
2021
|
this.editor
|
|
2019
2022
|
.chain()
|
|
2020
2023
|
.focus()
|
|
@@ -2022,8 +2025,6 @@ class TextEditorComponent {
|
|
|
2022
2025
|
.run();
|
|
2023
2026
|
}
|
|
2024
2027
|
toggleItalic() {
|
|
2025
|
-
if (!this.editor)
|
|
2026
|
-
return;
|
|
2027
2028
|
this.editor
|
|
2028
2029
|
.chain()
|
|
2029
2030
|
.focus()
|
|
@@ -2031,8 +2032,6 @@ class TextEditorComponent {
|
|
|
2031
2032
|
.run();
|
|
2032
2033
|
}
|
|
2033
2034
|
toggleUnderline() {
|
|
2034
|
-
if (!this.editor)
|
|
2035
|
-
return;
|
|
2036
2035
|
this.editor
|
|
2037
2036
|
.chain()
|
|
2038
2037
|
.focus()
|
|
@@ -2040,8 +2039,6 @@ class TextEditorComponent {
|
|
|
2040
2039
|
.run();
|
|
2041
2040
|
}
|
|
2042
2041
|
toggleOrderedList() {
|
|
2043
|
-
if (!this.editor)
|
|
2044
|
-
return;
|
|
2045
2042
|
this.editor
|
|
2046
2043
|
.chain()
|
|
2047
2044
|
.focus()
|
|
@@ -2049,8 +2046,6 @@ class TextEditorComponent {
|
|
|
2049
2046
|
.run();
|
|
2050
2047
|
}
|
|
2051
2048
|
toggleBulletList() {
|
|
2052
|
-
if (!this.editor)
|
|
2053
|
-
return;
|
|
2054
2049
|
this.editor
|
|
2055
2050
|
.chain()
|
|
2056
2051
|
.focus()
|
|
@@ -2058,8 +2053,6 @@ class TextEditorComponent {
|
|
|
2058
2053
|
.run();
|
|
2059
2054
|
}
|
|
2060
2055
|
setAlign(alignment) {
|
|
2061
|
-
if (!this.editor)
|
|
2062
|
-
return;
|
|
2063
2056
|
this.editor
|
|
2064
2057
|
.chain()
|
|
2065
2058
|
.focus()
|
|
@@ -2067,8 +2060,6 @@ class TextEditorComponent {
|
|
|
2067
2060
|
.run();
|
|
2068
2061
|
}
|
|
2069
2062
|
changeColor() {
|
|
2070
|
-
if (!this.editor)
|
|
2071
|
-
return;
|
|
2072
2063
|
this.restoreSelection();
|
|
2073
2064
|
const { from, to } = this.editor.state.selection;
|
|
2074
2065
|
if (from === to)
|
|
@@ -2091,8 +2082,6 @@ class TextEditorComponent {
|
|
|
2091
2082
|
.run();
|
|
2092
2083
|
}
|
|
2093
2084
|
applyGradient() {
|
|
2094
|
-
if (!this.editor)
|
|
2095
|
-
return;
|
|
2096
2085
|
this.restoreSelection();
|
|
2097
2086
|
const { from, to } = this.editor.state.selection;
|
|
2098
2087
|
if (from === to)
|
|
@@ -2123,8 +2112,6 @@ class TextEditorComponent {
|
|
|
2123
2112
|
.run();
|
|
2124
2113
|
}
|
|
2125
2114
|
onMouseDown() {
|
|
2126
|
-
if (!this.isBrowser)
|
|
2127
|
-
return;
|
|
2128
2115
|
setTimeout(() => {
|
|
2129
2116
|
if (!this.editor)
|
|
2130
2117
|
return;
|
|
@@ -2158,11 +2145,10 @@ class TextEditorComponent {
|
|
|
2158
2145
|
selectCustomFontSize(cssSize, event) {
|
|
2159
2146
|
event.stopPropagation();
|
|
2160
2147
|
this.changeFontSize(cssSize);
|
|
2161
|
-
this.isFontSizeMenuOpen =
|
|
2148
|
+
this.isFontSizeMenuOpen =
|
|
2149
|
+
false;
|
|
2162
2150
|
}
|
|
2163
2151
|
changeFontSize(fontSize) {
|
|
2164
|
-
if (!this.editor)
|
|
2165
|
-
return;
|
|
2166
2152
|
this.selectedFontSize =
|
|
2167
2153
|
fontSize;
|
|
2168
2154
|
const { from, to } = this.editor.state.selection;
|
|
@@ -2180,7 +2166,7 @@ class TextEditorComponent {
|
|
|
2180
2166
|
})
|
|
2181
2167
|
.run();
|
|
2182
2168
|
}
|
|
2183
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextEditorComponent, deps: [
|
|
2169
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2184
2170
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: TextEditorComponent, isStandalone: true, selector: "simpo-text-editor", inputs: { value: "value", editable: "editable", sectionId: "sectionId", label: "label", type: "type" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "document:mousedown": "onMouseDown()" } }, viewQueries: [{ propertyName: "editorElement", first: true, predicate: ["editorContainer"], descendants: true }], ngImport: i0, template: "<!-- text-editor.component.html -->\r\n\r\n<div class=\"editor-container\" *ngIf=\"editable; else viewMode\">\r\n\r\n <!-- FLOATING TOOLBAR -->\r\n <div class=\"toolbar\" *ngIf=\"showToolbar\" [style.top.px]=\"toolbarY\" [style.left.px]=\"toolbarX\" cdkDrag>\r\n <button class=\"tool drag-handle w-auto\" cdkDragHandle>\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-grip-vertical\">\r\n <circle cx=\"9\" cy=\"12\" r=\"1\" />\r\n <circle cx=\"9\" cy=\"5\" r=\"1\" />\r\n <circle cx=\"9\" cy=\"19\" r=\"1\" />\r\n <circle cx=\"15\" cy=\"12\" r=\"1\" />\r\n <circle cx=\"15\" cy=\"5\" r=\"1\" />\r\n <circle cx=\"15\" cy=\"19\" r=\"1\" />\r\n </svg>\r\n </button>\r\n <mat-form-field appearance=\"outline\" class=\"font-size-field\">\r\n\r\n <mat-select [value]=\"selectedFontSize\" (selectionChange)=\"changeFontSize($event.value)\" disableOptionCentering>\r\n\r\n <mat-option value=\"\">\r\n Default\r\n </mat-option>\r\n\r\n <mat-option value=\"clamp(0.75rem, 2vw, 1rem)\">\r\n 14\r\n </mat-option>\r\n\r\n <mat-option value=\"clamp(0.75rem, 2vw, 1.25rem)\">\r\n 16\r\n </mat-option>\r\n\r\n <mat-option value=\"clamp(1rem, 3vw, 1.5rem)\">\r\n 20\r\n </mat-option>\r\n\r\n <mat-option value=\"clamp(1.25rem, 4vw, 2rem)\">\r\n 24\r\n </mat-option>\r\n <mat-option value=\"clamp(2rem, 5vw, 3rem)\">\r\n 32\r\n </mat-option>\r\n <mat-option value=\"clamp(3.1rem, 7vw, 4.5rem)\">\r\n 48\r\n </mat-option>\r\n </mat-select>\r\n\r\n </mat-form-field>\r\n <!-- BOLD -->\r\n <button class=\"tool w-auto\" [class.selectedTool]=\"editor?.isActive('bold')\" (click)=\"toggleBold()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-bold\">\r\n <path d=\"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- ITALIC -->\r\n <button class=\"tool w-auto\" [class.selectedTool]=\"editor?.isActive('italic')\" (click)=\"toggleItalic()\">\r\n\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-italic\">\r\n <line x1=\"19\" x2=\"10\" y1=\"4\" y2=\"4\" />\r\n <line x1=\"14\" x2=\"5\" y1=\"20\" y2=\"20\" />\r\n <line x1=\"15\" x2=\"9\" y1=\"4\" y2=\"20\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- UNDERLINE -->\r\n <button class=\"tool w-auto\" [class.selectedTool]=\"editor?.isActive('underline')\" (click)=\"toggleUnderline()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-underline\">\r\n <path d=\"M6 4v6a6 6 0 0 0 12 0V4\" />\r\n <line x1=\"4\" x2=\"20\" y1=\"20\" y2=\"20\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- ALIGN LEFT -->\r\n <button class=\"tool w-auto\" (click)=\"setAlign('left')\">\r\n\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-align-left\">\r\n <line x1=\"21\" x2=\"3\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"15\" x2=\"3\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"17\" x2=\"3\" y1=\"18\" y2=\"18\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- ALIGN CENTER -->\r\n <button class=\"tool w-auto\" (click)=\"setAlign('center')\">\r\n\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-align-center\">\r\n <line x1=\"21\" x2=\"3\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"17\" x2=\"7\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"19\" x2=\"5\" y1=\"18\" y2=\"18\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- ALIGN RIGHT -->\r\n <button class=\"tool w-auto\" (click)=\"setAlign('right')\">\r\n\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-align-right\">\r\n <line x1=\"21\" x2=\"3\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"21\" x2=\"9\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"21\" x2=\"7\" y1=\"18\" y2=\"18\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- ORDERED LIST -->\r\n <button class=\"tool w-auto\" (click)=\"toggleOrderedList()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-list-ordered\">\r\n <line x1=\"10\" x2=\"21\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"10\" x2=\"21\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"10\" x2=\"21\" y1=\"18\" y2=\"18\" />\r\n <path d=\"M4 6h1v4\" />\r\n <path d=\"M4 10h2\" />\r\n <path d=\"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1\" />\r\n </svg>\r\n </button>\r\n <!-- BULLET LIST -->\r\n <button class=\"tool w-auto\" (click)=\"toggleBulletList()\">\r\n\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-list\">\r\n <line x1=\"8\" x2=\"21\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"8\" x2=\"21\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"8\" x2=\"21\" y1=\"18\" y2=\"18\" />\r\n <line x1=\"3\" x2=\"3.01\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"3\" x2=\"3.01\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"3\" x2=\"3.01\" y1=\"18\" y2=\"18\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- SOLID / GRADIENT -->\r\n <!-- SOLID / GRADIENT -->\r\n <div class=\"colorType\">\r\n\r\n <button class=\"solid w-auto\" [class.solidColorSelected]=\"selectedColorType === 'SOLID'\"\r\n (mousedown)=\"$event.preventDefault()\" (click)=\"switchToSolid($event)\">\r\n Solid\r\n </button>\r\n\r\n <button class=\"gradient w-auto\" [class.gradientColorSelected]=\"selectedColorType === 'GRADIENT'\"\r\n (mousedown)=\"$event.preventDefault()\" (click)=\"switchToGradient($event)\">\r\n Gradient\r\n </button>\r\n\r\n </div>\r\n\r\n <!-- SOLID COLOR -->\r\n <button class=\"tool color-picker-btn w-auto\" *ngIf=\"selectedColorType === 'SOLID'\">\r\n\r\n <mat-icon>format_color_text</mat-icon>\r\n\r\n <input type=\"color\" class=\"hidden-color-picker\" [(ngModel)]=\"selectedColor\" (click)=\"openColorPicker()\"\r\n (input)=\"changeColor()\">\r\n\r\n </button>\r\n\r\n <!-- GRADIENT -->\r\n <div class=\"gradient-picker\" *ngIf=\"selectedColorType === 'GRADIENT'\">\r\n <input type=\"color\" [(ngModel)]=\"primaryColor\" (click)=\"openColorPicker()\" (input)=\"applyGradient()\" />\r\n\r\n <input type=\"color\" [(ngModel)]=\"secondaryColor\" (click)=\"openColorPicker()\" (input)=\"applyGradient()\" />\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n <!-- TIPTAP EDITOR -->\r\n <div #editorContainer class=\"editable-text\">\r\n </div>\r\n\r\n</div>\r\n<ng-template #viewMode>\r\n <div class=\"read-only-text\" [innerHTML]=\"value\">\r\n </div>\r\n</ng-template>", styles: ["*{font-family:var(--website-font-family)}mat-icon{font-family:Material Icons!important}.editor-container{position:relative;width:100%}.editable-text{cursor:text;width:100%;border:1px solid black}.editable-text ::ng-deep p{margin-bottom:0!important}::ng-deep .ProseMirror ol,::ng-deep .ProseMirror ul{padding-left:2rem;margin-left:0;list-style-position:inside}::ng-deep .ProseMirror li{text-align:inherit;margin-bottom:5px}::ng-deep .ProseMirror li p{display:inline}.ProseMirror{outline:none;min-height:120px;padding:5px}.ProseMirror p{margin:0}.toolbar{position:absolute;left:0;top:0;display:flex;align-items:center;gap:5px;background:#fff;padding:8px 14px;border-radius:22px;z-index:100000;box-shadow:#00000029 0 1px 4px;max-width:calc(100vw - 20px);overflow-x:auto;box-sizing:border-box}.tool{background:none;border:none;padding:5px 8px;cursor:pointer;display:flex;align-items:center}.tool:hover{background:#eee;border-radius:5px}.selectedTool{background:var(--primary-bg-color)!important;color:#fff;border-radius:5px}.color-picker-btn{position:relative}.color-picker-btn mat-icon{font-size:22px!important}.hidden-color-picker{position:absolute;inset:0;opacity:0;cursor:pointer}.gradient-text{background:linear-gradient(to right,var(--gradient-start),var(--gradient-end));background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;color:transparent;display:inline-block}.colorType{display:flex;border:1px solid #E9E9E9;border-radius:9px;overflow:hidden}.colorType button{font-size:12px!important;padding:7px 9px!important;border:none;background:#fff;cursor:pointer}.solid{border-right:1px solid #E9E9E9!important}.solidColorSelected,.gradientColorSelected{background:var(--primary-bg-color)!important;color:#fff}.gradient-picker{display:flex;gap:5px}.gradient-picker input{width:32px;height:32px;border:none;padding:0;cursor:pointer}.white-space-nowrap{white-space:nowrap}.font-size-field{width:120px;border:1px solid lightgrey;border-radius:10px}::ng-deep .font-size-field .mat-mdc-form-field-subscript-wrapper{display:none}::ng-deep .font-size-field .mdc-notched-outline{display:none}::ng-deep .font-size-field .mat-mdc-text-field-wrapper{background:transparent!important;padding-left:8px!important;padding-right:8px!important;height:36px!important}::ng-deep .font-size-field .mat-mdc-select-value{font-size:14px;font-weight:600}::ng-deep .mat-mdc-select-panel{border-radius:12px!important}@media screen and (max-width: 475px){.toolbar{max-width:95%;flex-wrap:wrap;row-gap:10px}}@media screen and (max-width: 768px){.toolbar{width:max-content;max-width:calc(100vw - 20px);flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i12.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatFormFieldModule }] }); }
|
|
2185
2171
|
}
|
|
2186
2172
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextEditorComponent, decorators: [{
|
|
@@ -2194,10 +2180,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
2194
2180
|
MatFormFieldModule,
|
|
2195
2181
|
ContenteditableValueAccessor
|
|
2196
2182
|
], template: "<!-- text-editor.component.html -->\r\n\r\n<div class=\"editor-container\" *ngIf=\"editable; else viewMode\">\r\n\r\n <!-- FLOATING TOOLBAR -->\r\n <div class=\"toolbar\" *ngIf=\"showToolbar\" [style.top.px]=\"toolbarY\" [style.left.px]=\"toolbarX\" cdkDrag>\r\n <button class=\"tool drag-handle w-auto\" cdkDragHandle>\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-grip-vertical\">\r\n <circle cx=\"9\" cy=\"12\" r=\"1\" />\r\n <circle cx=\"9\" cy=\"5\" r=\"1\" />\r\n <circle cx=\"9\" cy=\"19\" r=\"1\" />\r\n <circle cx=\"15\" cy=\"12\" r=\"1\" />\r\n <circle cx=\"15\" cy=\"5\" r=\"1\" />\r\n <circle cx=\"15\" cy=\"19\" r=\"1\" />\r\n </svg>\r\n </button>\r\n <mat-form-field appearance=\"outline\" class=\"font-size-field\">\r\n\r\n <mat-select [value]=\"selectedFontSize\" (selectionChange)=\"changeFontSize($event.value)\" disableOptionCentering>\r\n\r\n <mat-option value=\"\">\r\n Default\r\n </mat-option>\r\n\r\n <mat-option value=\"clamp(0.75rem, 2vw, 1rem)\">\r\n 14\r\n </mat-option>\r\n\r\n <mat-option value=\"clamp(0.75rem, 2vw, 1.25rem)\">\r\n 16\r\n </mat-option>\r\n\r\n <mat-option value=\"clamp(1rem, 3vw, 1.5rem)\">\r\n 20\r\n </mat-option>\r\n\r\n <mat-option value=\"clamp(1.25rem, 4vw, 2rem)\">\r\n 24\r\n </mat-option>\r\n <mat-option value=\"clamp(2rem, 5vw, 3rem)\">\r\n 32\r\n </mat-option>\r\n <mat-option value=\"clamp(3.1rem, 7vw, 4.5rem)\">\r\n 48\r\n </mat-option>\r\n </mat-select>\r\n\r\n </mat-form-field>\r\n <!-- BOLD -->\r\n <button class=\"tool w-auto\" [class.selectedTool]=\"editor?.isActive('bold')\" (click)=\"toggleBold()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-bold\">\r\n <path d=\"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- ITALIC -->\r\n <button class=\"tool w-auto\" [class.selectedTool]=\"editor?.isActive('italic')\" (click)=\"toggleItalic()\">\r\n\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-italic\">\r\n <line x1=\"19\" x2=\"10\" y1=\"4\" y2=\"4\" />\r\n <line x1=\"14\" x2=\"5\" y1=\"20\" y2=\"20\" />\r\n <line x1=\"15\" x2=\"9\" y1=\"4\" y2=\"20\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- UNDERLINE -->\r\n <button class=\"tool w-auto\" [class.selectedTool]=\"editor?.isActive('underline')\" (click)=\"toggleUnderline()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-underline\">\r\n <path d=\"M6 4v6a6 6 0 0 0 12 0V4\" />\r\n <line x1=\"4\" x2=\"20\" y1=\"20\" y2=\"20\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- ALIGN LEFT -->\r\n <button class=\"tool w-auto\" (click)=\"setAlign('left')\">\r\n\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-align-left\">\r\n <line x1=\"21\" x2=\"3\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"15\" x2=\"3\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"17\" x2=\"3\" y1=\"18\" y2=\"18\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- ALIGN CENTER -->\r\n <button class=\"tool w-auto\" (click)=\"setAlign('center')\">\r\n\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-align-center\">\r\n <line x1=\"21\" x2=\"3\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"17\" x2=\"7\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"19\" x2=\"5\" y1=\"18\" y2=\"18\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- ALIGN RIGHT -->\r\n <button class=\"tool w-auto\" (click)=\"setAlign('right')\">\r\n\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-align-right\">\r\n <line x1=\"21\" x2=\"3\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"21\" x2=\"9\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"21\" x2=\"7\" y1=\"18\" y2=\"18\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- ORDERED LIST -->\r\n <button class=\"tool w-auto\" (click)=\"toggleOrderedList()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-list-ordered\">\r\n <line x1=\"10\" x2=\"21\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"10\" x2=\"21\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"10\" x2=\"21\" y1=\"18\" y2=\"18\" />\r\n <path d=\"M4 6h1v4\" />\r\n <path d=\"M4 10h2\" />\r\n <path d=\"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1\" />\r\n </svg>\r\n </button>\r\n <!-- BULLET LIST -->\r\n <button class=\"tool w-auto\" (click)=\"toggleBulletList()\">\r\n\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n class=\"lucide lucide-list\">\r\n <line x1=\"8\" x2=\"21\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"8\" x2=\"21\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"8\" x2=\"21\" y1=\"18\" y2=\"18\" />\r\n <line x1=\"3\" x2=\"3.01\" y1=\"6\" y2=\"6\" />\r\n <line x1=\"3\" x2=\"3.01\" y1=\"12\" y2=\"12\" />\r\n <line x1=\"3\" x2=\"3.01\" y1=\"18\" y2=\"18\" />\r\n </svg>\r\n </button>\r\n\r\n <!-- SOLID / GRADIENT -->\r\n <!-- SOLID / GRADIENT -->\r\n <div class=\"colorType\">\r\n\r\n <button class=\"solid w-auto\" [class.solidColorSelected]=\"selectedColorType === 'SOLID'\"\r\n (mousedown)=\"$event.preventDefault()\" (click)=\"switchToSolid($event)\">\r\n Solid\r\n </button>\r\n\r\n <button class=\"gradient w-auto\" [class.gradientColorSelected]=\"selectedColorType === 'GRADIENT'\"\r\n (mousedown)=\"$event.preventDefault()\" (click)=\"switchToGradient($event)\">\r\n Gradient\r\n </button>\r\n\r\n </div>\r\n\r\n <!-- SOLID COLOR -->\r\n <button class=\"tool color-picker-btn w-auto\" *ngIf=\"selectedColorType === 'SOLID'\">\r\n\r\n <mat-icon>format_color_text</mat-icon>\r\n\r\n <input type=\"color\" class=\"hidden-color-picker\" [(ngModel)]=\"selectedColor\" (click)=\"openColorPicker()\"\r\n (input)=\"changeColor()\">\r\n\r\n </button>\r\n\r\n <!-- GRADIENT -->\r\n <div class=\"gradient-picker\" *ngIf=\"selectedColorType === 'GRADIENT'\">\r\n <input type=\"color\" [(ngModel)]=\"primaryColor\" (click)=\"openColorPicker()\" (input)=\"applyGradient()\" />\r\n\r\n <input type=\"color\" [(ngModel)]=\"secondaryColor\" (click)=\"openColorPicker()\" (input)=\"applyGradient()\" />\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n <!-- TIPTAP EDITOR -->\r\n <div #editorContainer class=\"editable-text\">\r\n </div>\r\n\r\n</div>\r\n<ng-template #viewMode>\r\n <div class=\"read-only-text\" [innerHTML]=\"value\">\r\n </div>\r\n</ng-template>", styles: ["*{font-family:var(--website-font-family)}mat-icon{font-family:Material Icons!important}.editor-container{position:relative;width:100%}.editable-text{cursor:text;width:100%;border:1px solid black}.editable-text ::ng-deep p{margin-bottom:0!important}::ng-deep .ProseMirror ol,::ng-deep .ProseMirror ul{padding-left:2rem;margin-left:0;list-style-position:inside}::ng-deep .ProseMirror li{text-align:inherit;margin-bottom:5px}::ng-deep .ProseMirror li p{display:inline}.ProseMirror{outline:none;min-height:120px;padding:5px}.ProseMirror p{margin:0}.toolbar{position:absolute;left:0;top:0;display:flex;align-items:center;gap:5px;background:#fff;padding:8px 14px;border-radius:22px;z-index:100000;box-shadow:#00000029 0 1px 4px;max-width:calc(100vw - 20px);overflow-x:auto;box-sizing:border-box}.tool{background:none;border:none;padding:5px 8px;cursor:pointer;display:flex;align-items:center}.tool:hover{background:#eee;border-radius:5px}.selectedTool{background:var(--primary-bg-color)!important;color:#fff;border-radius:5px}.color-picker-btn{position:relative}.color-picker-btn mat-icon{font-size:22px!important}.hidden-color-picker{position:absolute;inset:0;opacity:0;cursor:pointer}.gradient-text{background:linear-gradient(to right,var(--gradient-start),var(--gradient-end));background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;color:transparent;display:inline-block}.colorType{display:flex;border:1px solid #E9E9E9;border-radius:9px;overflow:hidden}.colorType button{font-size:12px!important;padding:7px 9px!important;border:none;background:#fff;cursor:pointer}.solid{border-right:1px solid #E9E9E9!important}.solidColorSelected,.gradientColorSelected{background:var(--primary-bg-color)!important;color:#fff}.gradient-picker{display:flex;gap:5px}.gradient-picker input{width:32px;height:32px;border:none;padding:0;cursor:pointer}.white-space-nowrap{white-space:nowrap}.font-size-field{width:120px;border:1px solid lightgrey;border-radius:10px}::ng-deep .font-size-field .mat-mdc-form-field-subscript-wrapper{display:none}::ng-deep .font-size-field .mdc-notched-outline{display:none}::ng-deep .font-size-field .mat-mdc-text-field-wrapper{background:transparent!important;padding-left:8px!important;padding-right:8px!important;height:36px!important}::ng-deep .font-size-field .mat-mdc-select-value{font-size:14px;font-weight:600}::ng-deep .mat-mdc-select-panel{border-radius:12px!important}@media screen and (max-width: 475px){.toolbar{max-width:95%;flex-wrap:wrap;row-gap:10px}}@media screen and (max-width: 768px){.toolbar{width:max-content;max-width:calc(100vw - 20px);flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden}}\n"] }]
|
|
2197
|
-
}],
|
|
2198
|
-
type: Inject,
|
|
2199
|
-
args: [PLATFORM_ID]
|
|
2200
|
-
}] }], propDecorators: { value: [{
|
|
2183
|
+
}], propDecorators: { value: [{
|
|
2201
2184
|
type: Input
|
|
2202
2185
|
}], valueChange: [{
|
|
2203
2186
|
type: Output
|