@simplysm/angular 14.1.21 → 14.2.2
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/dist/controls/button/sd-additional-button.js +2 -2
- package/dist/controls/button/sd-anchor.d.ts.map +1 -1
- package/dist/controls/button/sd-anchor.js +3 -3
- package/dist/controls/button/sd-button.d.ts.map +1 -1
- package/dist/controls/button/sd-button.js +3 -3
- package/dist/controls/button/sd-modal-select-button.d.ts.map +1 -1
- package/dist/controls/button/sd-modal-select-button.js +2 -2
- package/dist/controls/checkbox/sd-checkbox.d.ts.map +1 -1
- package/dist/controls/checkbox/sd-checkbox.js +3 -3
- package/dist/controls/checkbox/sd-switch.d.ts.map +1 -1
- package/dist/controls/checkbox/sd-switch.js +3 -3
- package/dist/controls/collapse/sd-collapse-icon.d.ts +1 -1
- package/dist/controls/collapse/sd-collapse-icon.d.ts.map +1 -1
- package/dist/controls/collapse/sd-collapse-icon.js +2 -2
- package/dist/controls/collapse/sd-collapse.d.ts +1 -1
- package/dist/controls/collapse/sd-collapse.d.ts.map +1 -1
- package/dist/controls/collapse/sd-collapse.js +2 -2
- package/dist/controls/dropdown/sd-dropdown-popup.d.ts.map +1 -1
- package/dist/controls/dropdown/sd-dropdown-popup.js +2 -2
- package/dist/controls/dropdown/sd-dropdown.js +1 -1
- package/dist/controls/gap/sd-gap.d.ts.map +1 -1
- package/dist/controls/gap/sd-gap.js +5 -7
- package/dist/controls/input/sd-date-range-picker.js +2 -2
- package/dist/controls/input/sd-numpad.d.ts.map +1 -1
- package/dist/controls/input/sd-numpad.js +7 -15
- package/dist/controls/input/sd-range.js +2 -2
- package/dist/controls/input/sd-textarea.js +4 -4
- package/dist/controls/input/sd-textfield.d.ts.map +1 -1
- package/dist/controls/input/sd-textfield.js +10 -10
- package/dist/controls/list/sd-list-item.js +43 -43
- package/dist/controls/list/sd-list.js +2 -2
- package/dist/controls/pagination/sd-pagination.d.ts.map +1 -1
- package/dist/controls/pagination/sd-pagination.js +7 -5
- package/dist/controls/select/sd-select-button.d.ts.map +1 -1
- package/dist/controls/select/sd-select-button.js +4 -4
- package/dist/controls/select/sd-select-item.d.ts.map +1 -1
- package/dist/controls/select/sd-select-item.js +3 -3
- package/dist/controls/select/sd-select.d.ts.map +1 -1
- package/dist/controls/select/sd-select.js +10 -19
- package/dist/controls/tab/sd-tab-item.js +2 -2
- package/dist/controls/tab/sd-tab.js +2 -2
- package/dist/core/busy/sd-busy-container.d.ts.map +1 -1
- package/dist/core/busy/sd-busy-container.js +3 -3
- package/dist/core/modal/sd-modal.d.ts.map +1 -1
- package/dist/core/modal/sd-modal.js +3 -3
- package/dist/core/provideSdAngular.d.ts.map +1 -1
- package/dist/core/provideSdAngular.js +31 -10
- package/dist/core/ripple/setupRipple.js +2 -2
- package/dist/core/setupBgTheme.d.ts +0 -1
- package/dist/core/setupBgTheme.d.ts.map +1 -1
- package/dist/core/setupBgTheme.js +3 -4
- package/dist/core/show-effect/setupRevealOnShow.js +1 -1
- package/dist/core/toast/sd-toast-container.js +2 -2
- package/dist/core/toast/sd-toast.d.ts.map +1 -1
- package/dist/core/toast/sd-toast.js +3 -3
- package/dist/core/validation/setupInvalid.js +5 -5
- package/dist/data/crud/sd-base-container.d.ts +1 -1
- package/dist/data/crud/sd-base-container.d.ts.map +1 -1
- package/dist/data/crud/sd-base-container.js +50 -52
- package/dist/data/crud/sd-crud-detail.d.ts +1 -1
- package/dist/data/crud/sd-crud-detail.d.ts.map +1 -1
- package/dist/data/crud/sd-crud-list.d.ts +3 -3
- package/dist/data/crud/sd-crud-list.d.ts.map +1 -1
- package/dist/data/kanban/sd-kanban-board.js +2 -2
- package/dist/data/kanban/sd-kanban-lane.d.ts.map +1 -1
- package/dist/data/kanban/sd-kanban-lane.js +4 -4
- package/dist/data/kanban/sd-kanban.d.ts.map +1 -1
- package/dist/data/kanban/sd-kanban.js +4 -4
- package/dist/data/permission-table/sd-permission-table.d.ts.map +1 -1
- package/dist/data/permission-table/sd-permission-table.js +5 -17
- package/dist/data/shared-data/sd-shared-data-select-list.d.ts.map +1 -1
- package/dist/data/shared-data/sd-shared-data-select-list.js +5 -19
- package/dist/data/shared-data/sd-shared-data-select.d.ts +2 -2
- package/dist/data/shared-data/sd-shared-data-select.d.ts.map +1 -1
- package/dist/data/shared-data/sd-shared-data-select.js +8 -15
- package/dist/data/sheet/sd-sheet-config.modal.d.ts.map +1 -1
- package/dist/data/sheet/sd-sheet-config.modal.js +7 -9
- package/dist/data/sheet/sd-sheet.d.ts.map +1 -1
- package/dist/data/sheet/sd-sheet.js +10 -12
- package/dist/data/sheet/useSheetCellStyling.d.ts.map +1 -1
- package/dist/data/sheet/useSheetCellStyling.js +1 -1
- package/dist/data/state-preset/sd-state-preset.d.ts +2 -2
- package/dist/data/state-preset/sd-state-preset.d.ts.map +1 -1
- package/dist/data/state-preset/sd-state-preset.js +5 -5
- package/dist/features/editor/sd-markdown-editor.d.ts.map +1 -1
- package/dist/features/editor/sd-markdown-editor.js +85 -34
- package/dist/features/editor/sd-tiptap-editor.d.ts.map +1 -1
- package/dist/features/editor/sd-tiptap-editor.js +192 -61
- package/dist/features/theme/sd-theme-provider.d.ts +18 -1
- package/dist/features/theme/sd-theme-provider.d.ts.map +1 -1
- package/dist/features/theme/sd-theme-provider.js +21 -4
- package/dist/features/theme/sd-theme-selector.d.ts +1 -1
- package/dist/features/theme/sd-theme-selector.d.ts.map +1 -1
- package/dist/features/theme/sd-theme-selector.js +50 -9
- package/dist/features/theme/wcag-contrast.d.ts +9 -0
- package/dist/features/theme/wcag-contrast.d.ts.map +1 -0
- package/dist/features/theme/wcag-contrast.js +83 -0
- package/dist/features/visual/sd-calendar.js +2 -2
- package/dist/features/visual/sd-label.d.ts.map +1 -1
- package/dist/features/visual/sd-label.js +5 -5
- package/dist/features/visual/sd-note.d.ts.map +1 -1
- package/dist/features/visual/sd-note.js +3 -3
- package/dist/features/visual/sd-progress.d.ts.map +1 -1
- package/dist/features/visual/sd-progress.js +3 -3
- package/dist/index.d.ts +12 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -9
- package/dist/layout/sidebar/sd-sidebar-container.d.ts.map +1 -1
- package/dist/layout/sidebar/sd-sidebar-container.js +11 -5
- package/dist/layout/sidebar/sd-sidebar-menu.d.ts.map +1 -1
- package/dist/layout/sidebar/sd-sidebar-menu.js +5 -17
- package/dist/layout/sidebar/sd-sidebar-user.js +32 -32
- package/dist/layout/sidebar/sd-sidebar.d.ts.map +1 -1
- package/dist/layout/sidebar/sd-sidebar.js +3 -3
- package/dist/layout/topbar/sd-topbar-menu.js +5 -5
- package/dist/layout/topbar/sd-topbar.d.ts.map +1 -1
- package/dist/layout/topbar/sd-topbar.js +5 -5
- package/package.json +26 -26
- package/scss/commons/_colors.scss +296 -242
- package/scss/commons/_density.scss +23 -0
- package/scss/commons/_mixins.scss +142 -129
- package/scss/commons/_styles.scss +78 -103
- package/scss/commons/_theme-variables.scss +16 -2
- package/scss/commons/_variables.scss +277 -149
- package/scss/controls/_card.scss +12 -8
- package/scss/controls/_form-box.scss +7 -7
- package/scss/controls/_form-table.scss +7 -7
- package/scss/controls/_table.scss +5 -5
- package/scss/sd-tokens.md +132 -0
- package/scss/styles.scss +3 -4
- package/scss/themes/_variables-blueprint.scss +127 -81
- package/scss/themes/_variables-ide-dark.scss +215 -0
- package/src/controls/button/sd-additional-button.ts +12 -12
- package/src/controls/button/sd-anchor.ts +7 -8
- package/src/controls/button/sd-button.ts +42 -44
- package/src/controls/button/sd-modal-select-button.ts +15 -19
- package/src/controls/checkbox/sd-checkbox.ts +55 -43
- package/src/controls/checkbox/sd-switch.ts +18 -19
- package/src/controls/collapse/sd-collapse-icon.ts +2 -2
- package/src/controls/collapse/sd-collapse.ts +2 -2
- package/src/controls/dropdown/sd-dropdown-popup.ts +10 -12
- package/src/controls/dropdown/sd-dropdown.ts +1 -1
- package/src/controls/gap/sd-gap.ts +11 -9
- package/src/controls/input/sd-date-range-picker.ts +1 -1
- package/src/controls/input/sd-numpad.ts +3 -11
- package/src/controls/input/sd-range.ts +1 -1
- package/src/controls/input/sd-textarea.ts +18 -18
- package/src/controls/input/sd-textfield.ts +39 -37
- package/src/controls/list/sd-list-item.ts +195 -195
- package/src/controls/list/sd-list.ts +8 -8
- package/src/controls/pagination/sd-pagination.ts +4 -2
- package/src/controls/select/sd-select-button.ts +6 -10
- package/src/controls/select/sd-select-item.ts +14 -15
- package/src/controls/select/sd-select.ts +34 -35
- package/src/controls/tab/sd-tab-item.ts +4 -4
- package/src/controls/tab/sd-tab.ts +2 -2
- package/src/core/busy/sd-busy-container.ts +17 -16
- package/src/core/modal/sd-modal.ts +38 -32
- package/src/core/provideSdAngular.ts +34 -10
- package/src/core/ripple/setupRipple.ts +2 -2
- package/src/core/setupBgTheme.ts +5 -14
- package/src/core/show-effect/setupRevealOnShow.ts +1 -1
- package/src/core/toast/sd-toast-container.ts +5 -5
- package/src/core/toast/sd-toast.ts +16 -17
- package/src/core/validation/setupInvalid.ts +5 -5
- package/src/data/crud/sd-base-container.ts +120 -122
- package/src/data/kanban/sd-kanban-board.ts +1 -1
- package/src/data/kanban/sd-kanban-lane.ts +9 -14
- package/src/data/kanban/sd-kanban.ts +9 -19
- package/src/data/permission-table/sd-permission-table.ts +12 -20
- package/src/data/shared-data/sd-shared-data-select-list.ts +5 -19
- package/src/data/shared-data/sd-shared-data-select.ts +11 -28
- package/src/data/sheet/sd-sheet-config.modal.ts +5 -7
- package/src/data/sheet/sd-sheet.ts +29 -28
- package/src/data/sheet/useSheetCellStyling.ts +12 -3
- package/src/data/state-preset/sd-state-preset.ts +16 -16
- package/src/features/editor/sd-markdown-editor.ts +110 -56
- package/src/features/editor/sd-tiptap-editor.ts +214 -81
- package/src/features/theme/sd-theme-provider.ts +28 -3
- package/src/features/theme/sd-theme-selector.ts +21 -2
- package/src/features/theme/wcag-contrast.ts +103 -0
- package/src/features/visual/sd-calendar.ts +8 -8
- package/src/features/visual/sd-label.ts +11 -12
- package/src/features/visual/sd-note.ts +10 -11
- package/src/features/visual/sd-progress.ts +9 -11
- package/src/index.ts +15 -40
- package/src/layout/sidebar/sd-sidebar-container.ts +21 -8
- package/src/layout/sidebar/sd-sidebar-menu.ts +15 -17
- package/src/layout/sidebar/sd-sidebar-user.ts +100 -100
- package/src/layout/sidebar/sd-sidebar.ts +7 -9
- package/src/layout/topbar/sd-topbar-menu.ts +3 -3
- package/src/layout/topbar/sd-topbar.ts +12 -14
- package/styles.css +1641 -2462
- package/scss/themes/_blueprint-surfaces.scss +0 -87
|
@@ -10,31 +10,31 @@ function SdMarkdownEditor_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
10
10
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
11
11
|
i0.ɵɵdomElementStart(0, "div", 0)(1, "div", 2)(2, "button", 3);
|
|
12
12
|
i0.ɵɵdomListener("click", function SdMarkdownEditor_Conditional_0_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("h1")); });
|
|
13
|
-
i0.ɵɵtext(3, "H1");
|
|
13
|
+
i0.ɵɵtext(3, " H1 ");
|
|
14
14
|
i0.ɵɵdomElementEnd();
|
|
15
15
|
i0.ɵɵdomElementStart(4, "button", 4);
|
|
16
16
|
i0.ɵɵdomListener("click", function SdMarkdownEditor_Conditional_0_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("h2")); });
|
|
17
|
-
i0.ɵɵtext(5, "H2");
|
|
17
|
+
i0.ɵɵtext(5, " H2 ");
|
|
18
18
|
i0.ɵɵdomElementEnd()();
|
|
19
19
|
i0.ɵɵdomElementStart(6, "div", 2)(7, "button", 5);
|
|
20
20
|
i0.ɵɵdomListener("click", function SdMarkdownEditor_Conditional_0_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("bold")); });
|
|
21
|
-
i0.ɵɵtext(8, "B");
|
|
21
|
+
i0.ɵɵtext(8, " B ");
|
|
22
22
|
i0.ɵɵdomElementEnd();
|
|
23
23
|
i0.ɵɵdomElementStart(9, "button", 6);
|
|
24
24
|
i0.ɵɵdomListener("click", function SdMarkdownEditor_Conditional_0_Template_button_click_9_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("italic")); });
|
|
25
|
-
i0.ɵɵtext(10, "I");
|
|
25
|
+
i0.ɵɵtext(10, " I ");
|
|
26
26
|
i0.ɵɵdomElementEnd();
|
|
27
27
|
i0.ɵɵdomElementStart(11, "button", 7);
|
|
28
28
|
i0.ɵɵdomListener("click", function SdMarkdownEditor_Conditional_0_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("strike")); });
|
|
29
|
-
i0.ɵɵtext(12, "S");
|
|
29
|
+
i0.ɵɵtext(12, " S ");
|
|
30
30
|
i0.ɵɵdomElementEnd()();
|
|
31
31
|
i0.ɵɵdomElementStart(13, "div", 2)(14, "button", 8);
|
|
32
32
|
i0.ɵɵdomListener("click", function SdMarkdownEditor_Conditional_0_Template_button_click_14_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("bulletList")); });
|
|
33
|
-
i0.ɵɵtext(15, "UL");
|
|
33
|
+
i0.ɵɵtext(15, " UL ");
|
|
34
34
|
i0.ɵɵdomElementEnd();
|
|
35
35
|
i0.ɵɵdomElementStart(16, "button", 9);
|
|
36
36
|
i0.ɵɵdomListener("click", function SdMarkdownEditor_Conditional_0_Template_button_click_16_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("orderedList")); });
|
|
37
|
-
i0.ɵɵtext(17, "OL");
|
|
37
|
+
i0.ɵɵtext(17, " OL ");
|
|
38
38
|
i0.ɵɵdomElementEnd();
|
|
39
39
|
i0.ɵɵdomElementStart(18, "button", 10);
|
|
40
40
|
i0.ɵɵdomListener("click", function SdMarkdownEditor_Conditional_0_Template_button_click_18_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("indent")); });
|
|
@@ -46,11 +46,11 @@ function SdMarkdownEditor_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
46
46
|
i0.ɵɵdomElementEnd()();
|
|
47
47
|
i0.ɵɵdomElementStart(22, "div", 2)(23, "button", 12);
|
|
48
48
|
i0.ɵɵdomListener("click", function SdMarkdownEditor_Conditional_0_Template_button_click_23_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("blockquote")); });
|
|
49
|
-
i0.ɵɵtext(24, "\u275D");
|
|
49
|
+
i0.ɵɵtext(24, " \u275D ");
|
|
50
50
|
i0.ɵɵdomElementEnd();
|
|
51
51
|
i0.ɵɵdomElementStart(25, "button", 13);
|
|
52
52
|
i0.ɵɵdomListener("click", function SdMarkdownEditor_Conditional_0_Template_button_click_25_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("codeBlock")); });
|
|
53
|
-
i0.ɵɵtext(26, "</>");
|
|
53
|
+
i0.ɵɵtext(26, " </> ");
|
|
54
54
|
i0.ɵɵdomElementEnd()();
|
|
55
55
|
i0.ɵɵdomElementStart(27, "div", 2)(28, "button", 14);
|
|
56
56
|
i0.ɵɵdomListener("click", function SdMarkdownEditor_Conditional_0_Template_button_click_28_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("clean")); });
|
|
@@ -77,10 +77,7 @@ function SdMarkdownEditor_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
77
77
|
i0.ɵɵadvance(2);
|
|
78
78
|
i0.ɵɵclassProp("_active", ctx_r1.activeStates().codeBlock);
|
|
79
79
|
} }
|
|
80
|
-
const DEFAULT_EXTENSIONS = [
|
|
81
|
-
StarterKit,
|
|
82
|
-
Markdown,
|
|
83
|
-
];
|
|
80
|
+
const DEFAULT_EXTENSIONS = [StarterKit, Markdown];
|
|
84
81
|
export class SdMarkdownEditor {
|
|
85
82
|
value = model(/* @ts-ignore */
|
|
86
83
|
...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
@@ -206,7 +203,7 @@ export class SdMarkdownEditor {
|
|
|
206
203
|
i0.ɵɵdomElement(1, "div", 1);
|
|
207
204
|
} if (rf & 2) {
|
|
208
205
|
i0.ɵɵconditional(!ctx.disabled() && !ctx.readonly() ? 0 : -1);
|
|
209
|
-
} }, styles: ["sd-markdown-editor {\n display: block;\n position: relative;\n border: 1px solid var(--
|
|
206
|
+
} }, styles: ["sd-markdown-editor {\n display: block;\n position: relative;\n border: 1px solid var(--sd-bd-field);\n border-radius: var(--sd-radius-default);\n background-color: var(--sd-bg-field);\n}\nsd-markdown-editor > ._toolbar {\n display: flex;\n flex-wrap: wrap;\n gap: var(--sd-gap-xs);\n padding: var(--sd-gap-xs);\n border-bottom: 1px solid var(--sd-bd-hairline);\n}\nsd-markdown-editor > ._toolbar > ._btn-group {\n display: flex;\n gap: 1px;\n}\nsd-markdown-editor > ._toolbar > ._btn-group > button {\n padding: var(--sd-gap-xs) var(--sd-gap-sm);\n border: 1px solid var(--sd-bd-hairline);\n border-radius: var(--sd-radius-default);\n background-color: transparent;\n cursor: pointer;\n font-size: var(--sd-font-size-default);\n line-height: 1;\n}\nsd-markdown-editor > ._toolbar > ._btn-group > button._active {\n background-color: var(--sd-bg-primary-solid);\n color: var(--sd-tx-primary-solid);\n}\nsd-markdown-editor > ._toolbar > ._btn-group > button:hover {\n background-color: var(--sd-bg-state-hover);\n}\nsd-markdown-editor > ._toolbar > ._btn-group > button._active:hover {\n background-color: var(--sd-bg-primary-solid);\n}\nsd-markdown-editor > ._editor-container {\n padding: var(--sd-gap-sm);\n min-height: 6.25rem;\n font-family: var(--sd-font-family-field);\n}\nsd-markdown-editor > ._editor-container > .tiptap {\n outline: none;\n}\nsd-markdown-editor > ._editor-container > .tiptap:focus {\n outline: none;\n}\nsd-markdown-editor[data-sd-disabled=true] {\n background-color: var(--sd-bg-disabled);\n color: var(--sd-tx-disabled);\n}\nsd-markdown-editor[data-sd-disabled=true] > ._editor-container > .tiptap {\n cursor: not-allowed;\n}\nsd-markdown-editor[data-sd-readonly=true] > ._editor-container > .tiptap {\n cursor: default;\n}"], encapsulation: 2 });
|
|
210
207
|
}
|
|
211
208
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SdMarkdownEditor, [{
|
|
212
209
|
type: Component,
|
|
@@ -214,32 +211,86 @@ export class SdMarkdownEditor {
|
|
|
214
211
|
@if (!disabled() && !readonly()) {
|
|
215
212
|
<div class="_toolbar">
|
|
216
213
|
<div class="_btn-group">
|
|
217
|
-
<button
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
214
|
+
<button
|
|
215
|
+
type="button"
|
|
216
|
+
data-cmd="h1"
|
|
217
|
+
[class._active]="activeStates().h1"
|
|
218
|
+
(click)="execCmd('h1')"
|
|
219
|
+
>
|
|
220
|
+
H1
|
|
221
|
+
</button>
|
|
222
|
+
<button
|
|
223
|
+
type="button"
|
|
224
|
+
data-cmd="h2"
|
|
225
|
+
[class._active]="activeStates().h2"
|
|
226
|
+
(click)="execCmd('h2')"
|
|
227
|
+
>
|
|
228
|
+
H2
|
|
229
|
+
</button>
|
|
221
230
|
</div>
|
|
222
231
|
<div class="_btn-group">
|
|
223
|
-
<button
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
232
|
+
<button
|
|
233
|
+
type="button"
|
|
234
|
+
data-cmd="bold"
|
|
235
|
+
[class._active]="activeStates().bold"
|
|
236
|
+
(click)="execCmd('bold')"
|
|
237
|
+
>
|
|
238
|
+
B
|
|
239
|
+
</button>
|
|
240
|
+
<button
|
|
241
|
+
type="button"
|
|
242
|
+
data-cmd="italic"
|
|
243
|
+
[class._active]="activeStates().italic"
|
|
244
|
+
(click)="execCmd('italic')"
|
|
245
|
+
>
|
|
246
|
+
I
|
|
247
|
+
</button>
|
|
248
|
+
<button
|
|
249
|
+
type="button"
|
|
250
|
+
data-cmd="strike"
|
|
251
|
+
[class._active]="activeStates().strike"
|
|
252
|
+
(click)="execCmd('strike')"
|
|
253
|
+
>
|
|
254
|
+
S
|
|
255
|
+
</button>
|
|
229
256
|
</div>
|
|
230
257
|
<div class="_btn-group">
|
|
231
|
-
<button
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
258
|
+
<button
|
|
259
|
+
type="button"
|
|
260
|
+
data-cmd="bulletList"
|
|
261
|
+
[class._active]="activeStates().bulletList"
|
|
262
|
+
(click)="execCmd('bulletList')"
|
|
263
|
+
>
|
|
264
|
+
UL
|
|
265
|
+
</button>
|
|
266
|
+
<button
|
|
267
|
+
type="button"
|
|
268
|
+
data-cmd="orderedList"
|
|
269
|
+
[class._active]="activeStates().orderedList"
|
|
270
|
+
(click)="execCmd('orderedList')"
|
|
271
|
+
>
|
|
272
|
+
OL
|
|
273
|
+
</button>
|
|
235
274
|
<button type="button" data-cmd="indent" (click)="execCmd('indent')">→</button>
|
|
236
275
|
<button type="button" data-cmd="outdent" (click)="execCmd('outdent')">←</button>
|
|
237
276
|
</div>
|
|
238
277
|
<div class="_btn-group">
|
|
239
|
-
<button
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
278
|
+
<button
|
|
279
|
+
type="button"
|
|
280
|
+
data-cmd="blockquote"
|
|
281
|
+
[class._active]="activeStates().blockquote"
|
|
282
|
+
(click)="execCmd('blockquote')"
|
|
283
|
+
>
|
|
284
|
+
❝
|
|
285
|
+
</button>
|
|
286
|
+
<button
|
|
287
|
+
type="button"
|
|
288
|
+
data-cmd="codeBlock"
|
|
289
|
+
[class._active]="activeStates().codeBlock"
|
|
290
|
+
(click)="execCmd('codeBlock')"
|
|
291
|
+
>
|
|
292
|
+
</>
|
|
293
|
+
</button>
|
|
243
294
|
</div>
|
|
244
295
|
<div class="_btn-group">
|
|
245
296
|
<button type="button" data-cmd="clean" (click)="execCmd('clean')">Tx</button>
|
|
@@ -250,6 +301,6 @@ export class SdMarkdownEditor {
|
|
|
250
301
|
`, host: {
|
|
251
302
|
"[attr.data-sd-disabled]": "disabled()",
|
|
252
303
|
"[attr.data-sd-readonly]": "readonly()",
|
|
253
|
-
}, styles: ["sd-markdown-editor {\n display: block;\n position: relative;\n border: 1px solid var(--
|
|
304
|
+
}, styles: ["sd-markdown-editor {\n display: block;\n position: relative;\n border: 1px solid var(--sd-bd-field);\n border-radius: var(--sd-radius-default);\n background-color: var(--sd-bg-field);\n}\nsd-markdown-editor > ._toolbar {\n display: flex;\n flex-wrap: wrap;\n gap: var(--sd-gap-xs);\n padding: var(--sd-gap-xs);\n border-bottom: 1px solid var(--sd-bd-hairline);\n}\nsd-markdown-editor > ._toolbar > ._btn-group {\n display: flex;\n gap: 1px;\n}\nsd-markdown-editor > ._toolbar > ._btn-group > button {\n padding: var(--sd-gap-xs) var(--sd-gap-sm);\n border: 1px solid var(--sd-bd-hairline);\n border-radius: var(--sd-radius-default);\n background-color: transparent;\n cursor: pointer;\n font-size: var(--sd-font-size-default);\n line-height: 1;\n}\nsd-markdown-editor > ._toolbar > ._btn-group > button._active {\n background-color: var(--sd-bg-primary-solid);\n color: var(--sd-tx-primary-solid);\n}\nsd-markdown-editor > ._toolbar > ._btn-group > button:hover {\n background-color: var(--sd-bg-state-hover);\n}\nsd-markdown-editor > ._toolbar > ._btn-group > button._active:hover {\n background-color: var(--sd-bg-primary-solid);\n}\nsd-markdown-editor > ._editor-container {\n padding: var(--sd-gap-sm);\n min-height: 6.25rem;\n font-family: var(--sd-font-family-field);\n}\nsd-markdown-editor > ._editor-container > .tiptap {\n outline: none;\n}\nsd-markdown-editor > ._editor-container > .tiptap:focus {\n outline: none;\n}\nsd-markdown-editor[data-sd-disabled=true] {\n background-color: var(--sd-bg-disabled);\n color: var(--sd-tx-disabled);\n}\nsd-markdown-editor[data-sd-disabled=true] > ._editor-container > .tiptap {\n cursor: not-allowed;\n}\nsd-markdown-editor[data-sd-readonly=true] > ._editor-container > .tiptap {\n cursor: default;\n}"] }]
|
|
254
305
|
}], () => [], { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], validatorFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "validatorFn", required: false }] }] }); })();
|
|
255
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdMarkdownEditor, { className: "SdMarkdownEditor", filePath: "packages/angular/src/features/editor/sd-markdown-editor.ts", lineNumber:
|
|
306
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdMarkdownEditor, { className: "SdMarkdownEditor", filePath: "packages/angular/src/features/editor/sd-markdown-editor.ts", lineNumber: 206 }); })();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-tiptap-editor.d.ts","sourceRoot":"","sources":["../../../src/features/editor/sd-tiptap-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAcL,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;;AAqBzD,
|
|
1
|
+
{"version":3,"file":"sd-tiptap-editor.d.ts","sourceRoot":"","sources":["../../../src/features/editor/sd-tiptap-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAcL,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;;AAqBzD,qBAwSa,cAAc;IACzB,KAAK,0DAAmB;IACxB,QAAQ,qEAAiD;IACzD,QAAQ,qEAAiD;IACzD,QAAQ,qEAAiD;IACzD,WAAW,0DAAmB;IAC9B,WAAW,+CAAiB,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,eAAI;IACzE,UAAU,kEAA2B;IAErC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+C;IACtE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsB;IAElD,QAAQ,CAAC,YAAY,WAyCnB;IAEF,qDAAqD;IACrD,MAAM,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAqB;IAE/D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6C;IACtE,YAAY,kEAA8B;IAC1C,WAAW,yBAA6B;IACxC,aAAa,yBAA+B;IAC5C,eAAe,4CAAiC;IAChD,OAAO,4DAAyB;IAChC,iBAAiB,gCAAmC;IACpD,UAAU,sCAA4B;IAEtC,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,eAAe,CAA6B;IAEpD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CASjC;;IA6DH,OAAO,CAAC,aAAa;IAsBrB,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,kBAAkB;yCA3Kf,cAAc;2CAAd,cAAc;CAgL1B"}
|
|
@@ -27,7 +27,7 @@ function SdTiptapEditor_Conditional_0_Conditional_48_Template(rf, ctx) { if (rf
|
|
|
27
27
|
i0.ɵɵrepeaterCreate(1, SdTiptapEditor_Conditional_0_Conditional_48_For_2_Template, 1, 3, "button", 24, i0.ɵɵrepeaterTrackByIdentity);
|
|
28
28
|
i0.ɵɵdomElementStart(3, "button", 25);
|
|
29
29
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Conditional_48_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.applyColor(undefined)); });
|
|
30
|
-
i0.ɵɵtext(4, "\u2715");
|
|
30
|
+
i0.ɵɵtext(4, " \u2715 ");
|
|
31
31
|
i0.ɵɵdomElementEnd()();
|
|
32
32
|
} if (rf & 2) {
|
|
33
33
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
@@ -38,27 +38,27 @@ function SdTiptapEditor_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
38
38
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
39
39
|
i0.ɵɵdomElementStart(0, "div", 1)(1, "div", 2)(2, "button", 3);
|
|
40
40
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("h1")); });
|
|
41
|
-
i0.ɵɵtext(3, "H1");
|
|
41
|
+
i0.ɵɵtext(3, " H1 ");
|
|
42
42
|
i0.ɵɵdomElementEnd();
|
|
43
43
|
i0.ɵɵdomElementStart(4, "button", 4);
|
|
44
44
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("h2")); });
|
|
45
|
-
i0.ɵɵtext(5, "H2");
|
|
45
|
+
i0.ɵɵtext(5, " H2 ");
|
|
46
46
|
i0.ɵɵdomElementEnd()();
|
|
47
47
|
i0.ɵɵdomElementStart(6, "div", 2)(7, "button", 5);
|
|
48
48
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("bold")); });
|
|
49
|
-
i0.ɵɵtext(8, "B");
|
|
49
|
+
i0.ɵɵtext(8, " B ");
|
|
50
50
|
i0.ɵɵdomElementEnd();
|
|
51
51
|
i0.ɵɵdomElementStart(9, "button", 6);
|
|
52
52
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_9_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("italic")); });
|
|
53
|
-
i0.ɵɵtext(10, "I");
|
|
53
|
+
i0.ɵɵtext(10, " I ");
|
|
54
54
|
i0.ɵɵdomElementEnd();
|
|
55
55
|
i0.ɵɵdomElementStart(11, "button", 7);
|
|
56
56
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("underline")); });
|
|
57
|
-
i0.ɵɵtext(12, "U");
|
|
57
|
+
i0.ɵɵtext(12, " U ");
|
|
58
58
|
i0.ɵɵdomElementEnd();
|
|
59
59
|
i0.ɵɵdomElementStart(13, "button", 8);
|
|
60
60
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_13_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("strike")); });
|
|
61
|
-
i0.ɵɵtext(14, "S");
|
|
61
|
+
i0.ɵɵtext(14, " S ");
|
|
62
62
|
i0.ɵɵdomElementEnd()();
|
|
63
63
|
i0.ɵɵdomElementStart(15, "div", 2)(16, "button", 9);
|
|
64
64
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_16_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toggleColorPicker("text")); });
|
|
@@ -72,11 +72,11 @@ function SdTiptapEditor_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
72
72
|
i0.ɵɵdomElementEnd()();
|
|
73
73
|
i0.ɵɵdomElementStart(22, "div", 2)(23, "button", 12);
|
|
74
74
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_23_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("bulletList")); });
|
|
75
|
-
i0.ɵɵtext(24, "UL");
|
|
75
|
+
i0.ɵɵtext(24, " UL ");
|
|
76
76
|
i0.ɵɵdomElementEnd();
|
|
77
77
|
i0.ɵɵdomElementStart(25, "button", 13);
|
|
78
78
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_25_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("orderedList")); });
|
|
79
|
-
i0.ɵɵtext(26, "OL");
|
|
79
|
+
i0.ɵɵtext(26, " OL ");
|
|
80
80
|
i0.ɵɵdomElementEnd();
|
|
81
81
|
i0.ɵɵdomElementStart(27, "button", 14);
|
|
82
82
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_27_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("indent")); });
|
|
@@ -88,27 +88,27 @@ function SdTiptapEditor_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
88
88
|
i0.ɵɵdomElementEnd()();
|
|
89
89
|
i0.ɵɵdomElementStart(31, "div", 2)(32, "button", 16);
|
|
90
90
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_32_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("blockquote")); });
|
|
91
|
-
i0.ɵɵtext(33, "\u275D");
|
|
91
|
+
i0.ɵɵtext(33, " \u275D ");
|
|
92
92
|
i0.ɵɵdomElementEnd();
|
|
93
93
|
i0.ɵɵdomElementStart(34, "button", 17);
|
|
94
94
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_34_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("codeBlock")); });
|
|
95
|
-
i0.ɵɵtext(35, "</>");
|
|
95
|
+
i0.ɵɵtext(35, " </> ");
|
|
96
96
|
i0.ɵɵdomElementEnd()();
|
|
97
97
|
i0.ɵɵdomElementStart(36, "div", 2)(37, "button", 18);
|
|
98
98
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_37_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("alignLeft")); });
|
|
99
|
-
i0.ɵɵtext(38, "\u2261L");
|
|
99
|
+
i0.ɵɵtext(38, " \u2261L ");
|
|
100
100
|
i0.ɵɵdomElementEnd();
|
|
101
101
|
i0.ɵɵdomElementStart(39, "button", 19);
|
|
102
102
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_39_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("alignCenter")); });
|
|
103
|
-
i0.ɵɵtext(40, "\u2261C");
|
|
103
|
+
i0.ɵɵtext(40, " \u2261C ");
|
|
104
104
|
i0.ɵɵdomElementEnd();
|
|
105
105
|
i0.ɵɵdomElementStart(41, "button", 20);
|
|
106
106
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_41_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("alignRight")); });
|
|
107
|
-
i0.ɵɵtext(42, "\u2261R");
|
|
107
|
+
i0.ɵɵtext(42, " \u2261R ");
|
|
108
108
|
i0.ɵɵdomElementEnd();
|
|
109
109
|
i0.ɵɵdomElementStart(43, "button", 21);
|
|
110
110
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_43_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("alignJustify")); });
|
|
111
|
-
i0.ɵɵtext(44, "\u2261J");
|
|
111
|
+
i0.ɵɵtext(44, " \u2261J ");
|
|
112
112
|
i0.ɵɵdomElementEnd()();
|
|
113
113
|
i0.ɵɵdomElementStart(45, "div", 2)(46, "button", 22);
|
|
114
114
|
i0.ɵɵdomListener("click", function SdTiptapEditor_Conditional_0_Template_button_click_46_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.execCmd("clean")); });
|
|
@@ -176,11 +176,46 @@ export class SdTiptapEditor {
|
|
|
176
176
|
_elRef = inject(ElementRef);
|
|
177
177
|
_destroyRef = inject(DestroyRef);
|
|
178
178
|
colorPresets = [
|
|
179
|
-
"#000000",
|
|
180
|
-
"#
|
|
181
|
-
"#
|
|
182
|
-
"#
|
|
183
|
-
"#
|
|
179
|
+
"#000000",
|
|
180
|
+
"#434343",
|
|
181
|
+
"#666666",
|
|
182
|
+
"#999999",
|
|
183
|
+
"#b7b7b7",
|
|
184
|
+
"#cccccc",
|
|
185
|
+
"#d9d9d9",
|
|
186
|
+
"#efefef",
|
|
187
|
+
"#f3f3f3",
|
|
188
|
+
"#ffffff",
|
|
189
|
+
"#980000",
|
|
190
|
+
"#ff0000",
|
|
191
|
+
"#ff9900",
|
|
192
|
+
"#ffff00",
|
|
193
|
+
"#00ff00",
|
|
194
|
+
"#00ffff",
|
|
195
|
+
"#4a86e8",
|
|
196
|
+
"#0000ff",
|
|
197
|
+
"#9900ff",
|
|
198
|
+
"#ff00ff",
|
|
199
|
+
"#e6b8af",
|
|
200
|
+
"#f4cccc",
|
|
201
|
+
"#fce5cd",
|
|
202
|
+
"#fff2cc",
|
|
203
|
+
"#d9ead3",
|
|
204
|
+
"#d0e0e3",
|
|
205
|
+
"#c9daf8",
|
|
206
|
+
"#cfe2f3",
|
|
207
|
+
"#d9d2e9",
|
|
208
|
+
"#ead1dc",
|
|
209
|
+
"#dd7e6b",
|
|
210
|
+
"#ea9999",
|
|
211
|
+
"#f9cb9c",
|
|
212
|
+
"#ffe599",
|
|
213
|
+
"#b6d7a8",
|
|
214
|
+
"#a2c4c9",
|
|
215
|
+
"#a4c2f4",
|
|
216
|
+
"#9fc5e8",
|
|
217
|
+
"#b4a7d6",
|
|
218
|
+
"#d5a6bd",
|
|
184
219
|
];
|
|
185
220
|
/** @internal -- TipTap Editor 인스턴스. 테스트 및 고급 사용자용 */
|
|
186
221
|
editor = signal(undefined, /* @ts-ignore */
|
|
@@ -301,7 +336,7 @@ export class SdTiptapEditor {
|
|
|
301
336
|
i0.ɵɵdomElement(1, "div", 0);
|
|
302
337
|
} if (rf & 2) {
|
|
303
338
|
i0.ɵɵconditional(!ctx.disabled() ? 0 : -1);
|
|
304
|
-
} }, styles: ["sd-tiptap-editor {\n display: block;\n position: relative;\n border: 1px solid var(--
|
|
339
|
+
} }, styles: ["sd-tiptap-editor {\n display: block;\n position: relative;\n border: 1px solid var(--sd-bd-field);\n border-radius: var(--sd-radius-default);\n background-color: var(--sd-bg-field);\n}\nsd-tiptap-editor > ._toolbar {\n display: flex;\n flex-wrap: wrap;\n gap: var(--sd-gap-xs);\n padding: var(--sd-gap-xs);\n border-bottom: 1px solid var(--sd-bd-hairline);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group {\n display: flex;\n gap: 1px;\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button {\n padding: var(--sd-gap-xs) var(--sd-gap-sm);\n border: 1px solid var(--sd-bd-hairline);\n border-radius: var(--sd-radius-default);\n background-color: transparent;\n cursor: pointer;\n font-size: var(--sd-font-size-default);\n line-height: 1;\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button._active {\n background-color: var(--sd-bg-primary-solid);\n color: var(--sd-tx-primary-solid);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button:hover {\n background-color: var(--sd-bg-state-hover);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button._active:hover {\n background-color: var(--sd-bg-primary-solid);\n}\nsd-tiptap-editor > ._color-picker {\n display: flex;\n flex-wrap: wrap;\n gap: 2px;\n padding: var(--sd-gap-xs);\n border-bottom: 1px solid var(--sd-bd-hairline);\n}\nsd-tiptap-editor > ._color-picker > ._color-swatch {\n width: 1.25rem;\n height: 1.25rem;\n border: 1px solid var(--sd-bd-hairline);\n border-radius: 2px;\n cursor: pointer;\n padding: 0;\n}\nsd-tiptap-editor > ._color-picker > ._color-swatch._no-color {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--sd-bg-control);\n font-size: 0.625rem;\n}\nsd-tiptap-editor > ._editor-container {\n padding: var(--sd-gap-sm);\n min-height: 6.25rem;\n font-family: var(--sd-font-family-field);\n}\nsd-tiptap-editor > ._editor-container > .tiptap {\n outline: none;\n}\nsd-tiptap-editor > ._editor-container > .tiptap:focus {\n outline: none;\n}\nsd-tiptap-editor[data-sd-disabled=true] {\n background-color: var(--sd-bg-disabled);\n color: var(--sd-tx-disabled);\n}\nsd-tiptap-editor[data-sd-disabled=true] > ._editor-container > .tiptap {\n cursor: not-allowed;\n}\nsd-tiptap-editor[data-sd-readonly=true] > ._editor-container > .tiptap {\n cursor: default;\n}\nsd-tiptap-editor ._color-btn {\n position: relative;\n}\nsd-tiptap-editor ._color-btn > ._color-indicator {\n display: block;\n height: 2px;\n width: 100%;\n position: absolute;\n bottom: 2px;\n left: 0;\n}"], encapsulation: 2 });
|
|
305
340
|
}
|
|
306
341
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SdTiptapEditor, [{
|
|
307
342
|
type: Component,
|
|
@@ -309,56 +344,148 @@ export class SdTiptapEditor {
|
|
|
309
344
|
@if (!disabled()) {
|
|
310
345
|
<div class="_toolbar">
|
|
311
346
|
<div class="_btn-group">
|
|
312
|
-
<button
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
347
|
+
<button
|
|
348
|
+
type="button"
|
|
349
|
+
data-cmd="h1"
|
|
350
|
+
[class._active]="activeStates().h1"
|
|
351
|
+
(click)="execCmd('h1')"
|
|
352
|
+
>
|
|
353
|
+
H1
|
|
354
|
+
</button>
|
|
355
|
+
<button
|
|
356
|
+
type="button"
|
|
357
|
+
data-cmd="h2"
|
|
358
|
+
[class._active]="activeStates().h2"
|
|
359
|
+
(click)="execCmd('h2')"
|
|
360
|
+
>
|
|
361
|
+
H2
|
|
362
|
+
</button>
|
|
316
363
|
</div>
|
|
317
364
|
<div class="_btn-group">
|
|
318
|
-
<button
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
365
|
+
<button
|
|
366
|
+
type="button"
|
|
367
|
+
data-cmd="bold"
|
|
368
|
+
[class._active]="activeStates().bold"
|
|
369
|
+
(click)="execCmd('bold')"
|
|
370
|
+
>
|
|
371
|
+
B
|
|
372
|
+
</button>
|
|
373
|
+
<button
|
|
374
|
+
type="button"
|
|
375
|
+
data-cmd="italic"
|
|
376
|
+
[class._active]="activeStates().italic"
|
|
377
|
+
(click)="execCmd('italic')"
|
|
378
|
+
>
|
|
379
|
+
I
|
|
380
|
+
</button>
|
|
381
|
+
<button
|
|
382
|
+
type="button"
|
|
383
|
+
data-cmd="underline"
|
|
384
|
+
[class._active]="activeStates().underline"
|
|
385
|
+
(click)="execCmd('underline')"
|
|
386
|
+
>
|
|
387
|
+
U
|
|
388
|
+
</button>
|
|
389
|
+
<button
|
|
390
|
+
type="button"
|
|
391
|
+
data-cmd="strike"
|
|
392
|
+
[class._active]="activeStates().strike"
|
|
393
|
+
(click)="execCmd('strike')"
|
|
394
|
+
>
|
|
395
|
+
S
|
|
396
|
+
</button>
|
|
326
397
|
</div>
|
|
327
398
|
<div class="_btn-group">
|
|
328
|
-
<button
|
|
329
|
-
|
|
399
|
+
<button
|
|
400
|
+
type="button"
|
|
401
|
+
data-cmd="textColor"
|
|
402
|
+
class="_color-btn"
|
|
403
|
+
(click)="toggleColorPicker('text')"
|
|
404
|
+
>
|
|
330
405
|
<span class="_color-indicator" [style.background-color]="activeColor()"></span>
|
|
331
406
|
A
|
|
332
407
|
</button>
|
|
333
|
-
<button
|
|
334
|
-
|
|
408
|
+
<button
|
|
409
|
+
type="button"
|
|
410
|
+
data-cmd="bgColor"
|
|
411
|
+
class="_color-btn"
|
|
412
|
+
(click)="toggleColorPicker('bg')"
|
|
413
|
+
>
|
|
335
414
|
<span class="_color-indicator" [style.background-color]="activeBgColor()"></span>
|
|
336
415
|
BG
|
|
337
416
|
</button>
|
|
338
417
|
</div>
|
|
339
418
|
<div class="_btn-group">
|
|
340
|
-
<button
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
419
|
+
<button
|
|
420
|
+
type="button"
|
|
421
|
+
data-cmd="bulletList"
|
|
422
|
+
[class._active]="activeStates().bulletList"
|
|
423
|
+
(click)="execCmd('bulletList')"
|
|
424
|
+
>
|
|
425
|
+
UL
|
|
426
|
+
</button>
|
|
427
|
+
<button
|
|
428
|
+
type="button"
|
|
429
|
+
data-cmd="orderedList"
|
|
430
|
+
[class._active]="activeStates().orderedList"
|
|
431
|
+
(click)="execCmd('orderedList')"
|
|
432
|
+
>
|
|
433
|
+
OL
|
|
434
|
+
</button>
|
|
344
435
|
<button type="button" data-cmd="indent" (click)="execCmd('indent')">→</button>
|
|
345
436
|
<button type="button" data-cmd="outdent" (click)="execCmd('outdent')">←</button>
|
|
346
437
|
</div>
|
|
347
438
|
<div class="_btn-group">
|
|
348
|
-
<button
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
439
|
+
<button
|
|
440
|
+
type="button"
|
|
441
|
+
data-cmd="blockquote"
|
|
442
|
+
[class._active]="activeStates().blockquote"
|
|
443
|
+
(click)="execCmd('blockquote')"
|
|
444
|
+
>
|
|
445
|
+
❝
|
|
446
|
+
</button>
|
|
447
|
+
<button
|
|
448
|
+
type="button"
|
|
449
|
+
data-cmd="codeBlock"
|
|
450
|
+
[class._active]="activeStates().codeBlock"
|
|
451
|
+
(click)="execCmd('codeBlock')"
|
|
452
|
+
>
|
|
453
|
+
</>
|
|
454
|
+
</button>
|
|
352
455
|
</div>
|
|
353
456
|
<div class="_btn-group">
|
|
354
|
-
<button
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
457
|
+
<button
|
|
458
|
+
type="button"
|
|
459
|
+
data-cmd="alignLeft"
|
|
460
|
+
[class._active]="activeStates().alignLeft"
|
|
461
|
+
(click)="execCmd('alignLeft')"
|
|
462
|
+
>
|
|
463
|
+
≡L
|
|
464
|
+
</button>
|
|
465
|
+
<button
|
|
466
|
+
type="button"
|
|
467
|
+
data-cmd="alignCenter"
|
|
468
|
+
[class._active]="activeStates().alignCenter"
|
|
469
|
+
(click)="execCmd('alignCenter')"
|
|
470
|
+
>
|
|
471
|
+
≡C
|
|
472
|
+
</button>
|
|
473
|
+
<button
|
|
474
|
+
type="button"
|
|
475
|
+
data-cmd="alignRight"
|
|
476
|
+
[class._active]="activeStates().alignRight"
|
|
477
|
+
(click)="execCmd('alignRight')"
|
|
478
|
+
>
|
|
479
|
+
≡R
|
|
480
|
+
</button>
|
|
481
|
+
<button
|
|
482
|
+
type="button"
|
|
483
|
+
data-cmd="alignJustify"
|
|
484
|
+
[class._active]="activeStates().alignJustify"
|
|
485
|
+
(click)="execCmd('alignJustify')"
|
|
486
|
+
>
|
|
487
|
+
≡J
|
|
488
|
+
</button>
|
|
362
489
|
</div>
|
|
363
490
|
<div class="_btn-group">
|
|
364
491
|
<button type="button" data-cmd="clean" (click)="execCmd('clean')">Tx</button>
|
|
@@ -367,13 +494,17 @@ export class SdTiptapEditor {
|
|
|
367
494
|
@if (colorPickerMode() != undefined) {
|
|
368
495
|
<div class="_color-picker">
|
|
369
496
|
@for (color of colorPresets; track color) {
|
|
370
|
-
<button
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
497
|
+
<button
|
|
498
|
+
type="button"
|
|
499
|
+
class="_color-swatch"
|
|
500
|
+
[style.background-color]="color"
|
|
501
|
+
[attr.aria-label]="color"
|
|
502
|
+
(click)="applyColor(color)"
|
|
503
|
+
></button>
|
|
374
504
|
}
|
|
375
|
-
<button type="button" class="_color-swatch _no-color"
|
|
376
|
-
|
|
505
|
+
<button type="button" class="_color-swatch _no-color" (click)="applyColor(undefined)">
|
|
506
|
+
✕
|
|
507
|
+
</button>
|
|
377
508
|
</div>
|
|
378
509
|
}
|
|
379
510
|
}
|
|
@@ -381,6 +512,6 @@ export class SdTiptapEditor {
|
|
|
381
512
|
`, host: {
|
|
382
513
|
"[attr.data-sd-disabled]": "disabled()",
|
|
383
514
|
"[attr.data-sd-readonly]": "readonly()",
|
|
384
|
-
}, styles: ["sd-tiptap-editor {\n display: block;\n position: relative;\n border: 1px solid var(--
|
|
515
|
+
}, styles: ["sd-tiptap-editor {\n display: block;\n position: relative;\n border: 1px solid var(--sd-bd-field);\n border-radius: var(--sd-radius-default);\n background-color: var(--sd-bg-field);\n}\nsd-tiptap-editor > ._toolbar {\n display: flex;\n flex-wrap: wrap;\n gap: var(--sd-gap-xs);\n padding: var(--sd-gap-xs);\n border-bottom: 1px solid var(--sd-bd-hairline);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group {\n display: flex;\n gap: 1px;\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button {\n padding: var(--sd-gap-xs) var(--sd-gap-sm);\n border: 1px solid var(--sd-bd-hairline);\n border-radius: var(--sd-radius-default);\n background-color: transparent;\n cursor: pointer;\n font-size: var(--sd-font-size-default);\n line-height: 1;\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button._active {\n background-color: var(--sd-bg-primary-solid);\n color: var(--sd-tx-primary-solid);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button:hover {\n background-color: var(--sd-bg-state-hover);\n}\nsd-tiptap-editor > ._toolbar > ._btn-group > button._active:hover {\n background-color: var(--sd-bg-primary-solid);\n}\nsd-tiptap-editor > ._color-picker {\n display: flex;\n flex-wrap: wrap;\n gap: 2px;\n padding: var(--sd-gap-xs);\n border-bottom: 1px solid var(--sd-bd-hairline);\n}\nsd-tiptap-editor > ._color-picker > ._color-swatch {\n width: 1.25rem;\n height: 1.25rem;\n border: 1px solid var(--sd-bd-hairline);\n border-radius: 2px;\n cursor: pointer;\n padding: 0;\n}\nsd-tiptap-editor > ._color-picker > ._color-swatch._no-color {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--sd-bg-control);\n font-size: 0.625rem;\n}\nsd-tiptap-editor > ._editor-container {\n padding: var(--sd-gap-sm);\n min-height: 6.25rem;\n font-family: var(--sd-font-family-field);\n}\nsd-tiptap-editor > ._editor-container > .tiptap {\n outline: none;\n}\nsd-tiptap-editor > ._editor-container > .tiptap:focus {\n outline: none;\n}\nsd-tiptap-editor[data-sd-disabled=true] {\n background-color: var(--sd-bg-disabled);\n color: var(--sd-tx-disabled);\n}\nsd-tiptap-editor[data-sd-disabled=true] > ._editor-container > .tiptap {\n cursor: not-allowed;\n}\nsd-tiptap-editor[data-sd-readonly=true] > ._editor-container > .tiptap {\n cursor: default;\n}\nsd-tiptap-editor ._color-btn {\n position: relative;\n}\nsd-tiptap-editor ._color-btn > ._color-indicator {\n display: block;\n height: 2px;\n width: 100%;\n position: absolute;\n bottom: 2px;\n left: 0;\n}"] }]
|
|
385
516
|
}], () => [], { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], validatorFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "validatorFn", required: false }] }], extensions: [{ type: i0.Input, args: [{ isSignal: true, alias: "extensions", required: false }] }] }); })();
|
|
386
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdTiptapEditor, { className: "SdTiptapEditor", filePath: "packages/angular/src/features/editor/sd-tiptap-editor.ts", lineNumber:
|
|
517
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SdTiptapEditor, { className: "SdTiptapEditor", filePath: "packages/angular/src/features/editor/sd-tiptap-editor.ts", lineNumber: 335 }); })();
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
+
export declare const SD_THEMES: readonly [{
|
|
3
|
+
readonly value: "light";
|
|
4
|
+
readonly label: "라이트";
|
|
5
|
+
}, {
|
|
6
|
+
readonly value: "blueprint";
|
|
7
|
+
readonly label: "블루프린트";
|
|
8
|
+
}, {
|
|
9
|
+
readonly value: "ide-dark";
|
|
10
|
+
readonly label: "IDE 다크";
|
|
11
|
+
}];
|
|
12
|
+
export type SdThemeName = (typeof SD_THEMES)[number]["value"];
|
|
13
|
+
export type SdDensity = "normal" | "compact";
|
|
2
14
|
export declare class SdThemeProvider {
|
|
3
|
-
|
|
15
|
+
readonly themes: readonly {
|
|
16
|
+
value: SdThemeName;
|
|
17
|
+
label: string;
|
|
18
|
+
}[];
|
|
19
|
+
theme: import("@angular/core").WritableSignal<"light" | "blueprint" | "ide-dark">;
|
|
20
|
+
density: import("@angular/core").WritableSignal<SdDensity>;
|
|
4
21
|
readonly fontSizePresets: readonly number[];
|
|
5
22
|
fontSize: import("@angular/core").WritableSignal<number>;
|
|
6
23
|
constructor();
|