kempo-ui 0.4.20 → 0.4.21
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/CHANGELOG.md +18 -0
- package/dist/components/Chat.js +10 -10
- package/dist/components/CodeEditor.js +23 -24
- package/dist/components/ControlGroup.js +17 -0
- package/dist/components/HtmlEditor.js +105 -106
- package/dist/components/MarkdownEditor.js +49 -49
- package/dist/components/Pagination.js +11 -11
- package/dist/components/Table.js +1 -1
- package/dist/components/controls/AlignCenter.js +1 -0
- package/dist/components/controls/AlignJustify.js +1 -0
- package/dist/components/controls/AlignLeft.js +1 -0
- package/dist/components/controls/AlignRight.js +1 -0
- package/dist/components/controls/Bold.js +1 -0
- package/dist/components/controls/BulletList.js +1 -0
- package/dist/components/controls/ButtonControl.js +33 -0
- package/dist/components/controls/CharacterCount.js +4 -0
- package/dist/components/controls/ClearFormatting.js +1 -0
- package/dist/components/controls/CodeBlock.js +1 -0
- package/dist/components/controls/Control.js +12 -0
- package/dist/components/controls/CopyCode.js +1 -0
- package/dist/components/controls/CreateLink.js +1 -0
- package/dist/components/controls/EditorTheme.js +30 -0
- package/dist/components/controls/FindReplace.js +1 -0
- package/dist/components/controls/FoldAll.js +1 -0
- package/dist/components/controls/FontSize.js +8 -0
- package/dist/components/controls/FontSizeDecrease.js +1 -0
- package/dist/components/controls/FontSizeIncrease.js +1 -0
- package/dist/components/controls/FormatBlock.js +8 -0
- package/dist/components/controls/FormatCode.js +1 -0
- package/dist/components/controls/Fullscreen.js +1 -0
- package/dist/components/controls/InlineCode.js +1 -0
- package/dist/components/controls/InsertTable.js +1 -0
- package/dist/components/controls/Italic.js +1 -0
- package/dist/components/controls/Language.js +21 -0
- package/dist/components/controls/MdImage.js +23 -0
- package/dist/components/controls/MdLink.js +1 -0
- package/dist/components/controls/MdSpeechToText.js +10 -0
- package/dist/components/controls/MdTable.js +19 -0
- package/dist/components/controls/Menu.js +51 -0
- package/dist/components/controls/Minimap.js +1 -0
- package/dist/components/controls/Mode.js +1 -0
- package/dist/components/controls/NumberList.js +1 -0
- package/dist/components/controls/PgCount.js +1 -0
- package/dist/components/controls/PgFirst.js +1 -0
- package/dist/components/controls/PgGotoPage.js +15 -0
- package/dist/components/controls/PgItemsPerPage.js +12 -0
- package/dist/components/controls/PgLast.js +1 -0
- package/dist/components/controls/PgNext.js +1 -0
- package/dist/components/controls/PgPageInfo.js +3 -0
- package/dist/components/controls/PgPrev.js +1 -0
- package/dist/components/controls/Quote.js +1 -0
- package/dist/components/controls/Redo.js +1 -0
- package/dist/components/{htmlEditorControls/ControlSpacer.js → controls/Spacer.js} +5 -5
- package/dist/components/controls/Strikethrough.js +1 -0
- package/dist/components/controls/TcDeleteRecord.js +1 -0
- package/dist/components/controls/TcDeleteSelected.js +1 -0
- package/dist/components/controls/TcEdit.js +12 -0
- package/dist/components/controls/TcExportCsv.js +3 -0
- package/dist/components/controls/TcExportJson.js +3 -0
- package/dist/components/controls/TcFieldSortHide.js +21 -0
- package/dist/components/controls/TcFilters.js +34 -0
- package/dist/components/controls/TcFirstPage.js +1 -0
- package/dist/components/controls/TcHiddenCount.js +1 -0
- package/dist/components/controls/TcHide.js +1 -0
- package/dist/components/controls/TcLastPage.js +1 -0
- package/dist/components/controls/TcNextPage.js +1 -0
- package/dist/components/controls/TcPageSelect.js +9 -0
- package/dist/components/controls/TcPageSize.js +5 -0
- package/dist/components/controls/TcPrevPage.js +1 -0
- package/dist/components/controls/TcSearch.js +1 -0
- package/dist/components/controls/TcShowAll.js +1 -0
- package/dist/components/controls/TextBackgroundColor.js +26 -0
- package/dist/components/controls/TextColor.js +26 -0
- package/dist/components/controls/Underline.js +1 -0
- package/dist/components/controls/Undo.js +1 -0
- package/dist/components/controls/WordCount.js +4 -0
- package/dist/components/controls/WordWrap.js +1 -0
- package/docs/components/code-editor.html +69 -48
- package/docs/components/html-editor.html +70 -69
- package/docs/components/markdown-editor.html +59 -78
- package/docs/components/pagination.html +51 -51
- package/docs/components/tableControls.html +5 -5
- package/docs/components/tableCustomFields.html +3 -3
- package/docs/components/tableFetchRecords.html +13 -13
- package/docs/components/tableFieldSortHide.html +4 -4
- package/docs/components/tablePagination.html +13 -13
- package/docs/components/tablePlaceholder.html +3 -3
- package/docs/components/tableRecordEditing.html +4 -4
- package/docs/components/tableRecordFiltering.html +5 -5
- package/docs/components/tableRecordHiding.html +7 -7
- package/docs/components/tableRecordSearching.html +3 -3
- package/docs/components/tableRowControls.html +6 -6
- package/docs/components/tableServerSync.html +7 -7
- package/docs/src/components/Chat.js +10 -10
- package/docs/src/components/CodeEditor.js +23 -24
- package/docs/src/components/ControlGroup.js +17 -0
- package/docs/src/components/HtmlEditor.js +105 -106
- package/docs/src/components/MarkdownEditor.js +49 -49
- package/docs/src/components/Pagination.js +11 -11
- package/docs/src/components/Table.js +1 -1
- package/docs/src/components/controls/AlignCenter.js +1 -0
- package/docs/src/components/controls/AlignJustify.js +1 -0
- package/docs/src/components/controls/AlignLeft.js +1 -0
- package/docs/src/components/controls/AlignRight.js +1 -0
- package/docs/src/components/controls/Bold.js +1 -0
- package/docs/src/components/controls/BulletList.js +1 -0
- package/docs/src/components/controls/ButtonControl.js +33 -0
- package/docs/src/components/controls/CharacterCount.js +4 -0
- package/docs/src/components/controls/ClearFormatting.js +1 -0
- package/docs/src/components/controls/CodeBlock.js +1 -0
- package/docs/src/components/controls/Control.js +12 -0
- package/docs/src/components/controls/CopyCode.js +1 -0
- package/docs/src/components/controls/CreateLink.js +1 -0
- package/docs/src/components/controls/EditorTheme.js +30 -0
- package/docs/src/components/controls/FindReplace.js +1 -0
- package/docs/src/components/controls/FoldAll.js +1 -0
- package/docs/src/components/controls/FontSize.js +8 -0
- package/docs/src/components/controls/FontSizeDecrease.js +1 -0
- package/docs/src/components/controls/FontSizeIncrease.js +1 -0
- package/docs/src/components/controls/FormatBlock.js +8 -0
- package/docs/src/components/controls/FormatCode.js +1 -0
- package/docs/src/components/controls/Fullscreen.js +1 -0
- package/docs/src/components/controls/InlineCode.js +1 -0
- package/docs/src/components/controls/InsertTable.js +1 -0
- package/docs/src/components/controls/Italic.js +1 -0
- package/docs/src/components/controls/Language.js +21 -0
- package/docs/src/components/controls/MdImage.js +23 -0
- package/docs/src/components/controls/MdLink.js +1 -0
- package/docs/src/components/controls/MdSpeechToText.js +10 -0
- package/docs/src/components/controls/MdTable.js +19 -0
- package/docs/src/components/controls/Menu.js +51 -0
- package/docs/src/components/controls/Minimap.js +1 -0
- package/docs/src/components/controls/Mode.js +1 -0
- package/docs/src/components/controls/NumberList.js +1 -0
- package/docs/src/components/controls/PgCount.js +1 -0
- package/docs/src/components/controls/PgFirst.js +1 -0
- package/docs/src/components/controls/PgGotoPage.js +15 -0
- package/docs/src/components/controls/PgItemsPerPage.js +12 -0
- package/docs/src/components/controls/PgLast.js +1 -0
- package/docs/src/components/controls/PgNext.js +1 -0
- package/docs/src/components/controls/PgPageInfo.js +3 -0
- package/docs/src/components/controls/PgPrev.js +1 -0
- package/docs/src/components/controls/Quote.js +1 -0
- package/docs/src/components/controls/Redo.js +1 -0
- package/docs/src/components/{codeEditorControls/ControlSpacer.js → controls/Spacer.js} +5 -5
- package/docs/src/components/controls/Strikethrough.js +1 -0
- package/docs/src/components/controls/TcDeleteRecord.js +1 -0
- package/docs/src/components/controls/TcDeleteSelected.js +1 -0
- package/docs/src/components/controls/TcEdit.js +12 -0
- package/docs/src/components/controls/TcExportCsv.js +3 -0
- package/docs/src/components/controls/TcExportJson.js +3 -0
- package/docs/src/components/controls/TcFieldSortHide.js +21 -0
- package/docs/src/components/controls/TcFilters.js +34 -0
- package/docs/src/components/controls/TcFirstPage.js +1 -0
- package/docs/src/components/controls/TcHiddenCount.js +1 -0
- package/docs/src/components/controls/TcHide.js +1 -0
- package/docs/src/components/controls/TcLastPage.js +1 -0
- package/docs/src/components/controls/TcNextPage.js +1 -0
- package/docs/src/components/controls/TcPageSelect.js +9 -0
- package/docs/src/components/controls/TcPageSize.js +5 -0
- package/docs/src/components/controls/TcPrevPage.js +1 -0
- package/docs/src/components/controls/TcSearch.js +1 -0
- package/docs/src/components/controls/TcShowAll.js +1 -0
- package/docs/src/components/controls/TextBackgroundColor.js +26 -0
- package/docs/src/components/controls/TextColor.js +26 -0
- package/docs/src/components/controls/Underline.js +1 -0
- package/docs/src/components/controls/Undo.js +1 -0
- package/docs/src/components/controls/WordCount.js +4 -0
- package/docs/src/components/controls/WordWrap.js +1 -0
- package/docs-src/components/code-editor.page.html +69 -48
- package/docs-src/components/html-editor.page.html +70 -69
- package/docs-src/components/markdown-editor.page.html +59 -78
- package/docs-src/components/pagination.page.html +51 -51
- package/docs-src/components/tableControls.page.html +5 -5
- package/docs-src/components/tableCustomFields.page.html +3 -3
- package/docs-src/components/tableFetchRecords.page.html +13 -13
- package/docs-src/components/tableFieldSortHide.page.html +4 -4
- package/docs-src/components/tablePagination.page.html +13 -13
- package/docs-src/components/tablePlaceholder.page.html +3 -3
- package/docs-src/components/tableRecordEditing.page.html +4 -4
- package/docs-src/components/tableRecordFiltering.page.html +5 -5
- package/docs-src/components/tableRecordHiding.page.html +7 -7
- package/docs-src/components/tableRecordSearching.page.html +3 -3
- package/docs-src/components/tableRowControls.page.html +6 -6
- package/docs-src/components/tableServerSync.page.html +7 -7
- package/llms.txt +37 -3
- package/package.json +1 -1
- package/src/components/Chat.js +14 -14
- package/src/components/CodeEditor.js +26 -32
- package/src/components/{codeEditorControls/ControlGroup.js → ControlGroup.js} +10 -6
- package/src/components/HtmlEditor.js +107 -125
- package/src/components/MarkdownEditor.js +117 -59
- package/src/components/Pagination.js +18 -23
- package/src/components/Table.js +5 -0
- package/src/components/controls/AlignCenter.js +19 -0
- package/src/components/controls/AlignJustify.js +19 -0
- package/src/components/controls/AlignLeft.js +19 -0
- package/src/components/controls/AlignRight.js +19 -0
- package/src/components/controls/Bold.js +19 -0
- package/src/components/controls/BulletList.js +19 -0
- package/src/components/controls/ButtonControl.js +114 -0
- package/src/components/controls/CharacterCount.js +48 -0
- package/src/components/controls/ClearFormatting.js +19 -0
- package/src/components/controls/CodeBlock.js +27 -0
- package/src/components/controls/Control.js +176 -0
- package/src/components/controls/CopyCode.js +19 -0
- package/src/components/controls/CreateLink.js +63 -0
- package/src/components/controls/EditorTheme.js +71 -0
- package/src/components/controls/FindReplace.js +19 -0
- package/src/components/controls/FoldAll.js +35 -0
- package/src/components/controls/FontSize.js +31 -0
- package/src/components/controls/FontSizeDecrease.js +19 -0
- package/src/components/controls/FontSizeIncrease.js +19 -0
- package/src/components/controls/FormatBlock.js +64 -0
- package/src/components/controls/FormatCode.js +19 -0
- package/src/components/controls/Fullscreen.js +42 -0
- package/src/components/controls/InlineCode.js +19 -0
- package/src/components/controls/InsertTable.js +67 -0
- package/src/components/controls/Italic.js +19 -0
- package/src/components/controls/Language.js +69 -0
- package/src/components/controls/MdImage.js +72 -0
- package/src/components/controls/MdLink.js +60 -0
- package/src/components/controls/MdSpeechToText.js +46 -0
- package/src/components/controls/MdTable.js +79 -0
- package/src/components/controls/Menu.js +98 -0
- package/src/components/controls/Minimap.js +36 -0
- package/src/components/controls/Mode.js +30 -0
- package/src/components/controls/NumberList.js +19 -0
- package/src/components/controls/PgCount.js +12 -0
- package/src/components/controls/PgFirst.js +28 -0
- package/src/components/controls/PgGotoPage.js +48 -0
- package/src/components/controls/PgItemsPerPage.js +36 -0
- package/src/components/controls/PgLast.js +28 -0
- package/src/components/controls/PgNext.js +25 -0
- package/src/components/controls/PgPageInfo.js +22 -0
- package/src/components/controls/PgPrev.js +25 -0
- package/src/components/controls/Quote.js +19 -0
- package/src/components/controls/Redo.js +18 -0
- package/src/components/controls/Spacer.js +15 -0
- package/src/components/controls/Strikethrough.js +19 -0
- package/src/components/controls/TcDeleteRecord.js +30 -0
- package/src/components/controls/TcDeleteSelected.js +16 -0
- package/src/components/controls/TcEdit.js +73 -0
- package/src/components/controls/TcExportCsv.js +60 -0
- package/src/components/controls/TcExportJson.js +46 -0
- package/src/components/controls/TcFieldSortHide.js +56 -0
- package/src/components/controls/TcFilters.js +86 -0
- package/src/components/controls/TcFirstPage.js +24 -0
- package/src/components/controls/TcHiddenCount.js +39 -0
- package/src/components/controls/TcHide.js +30 -0
- package/src/components/controls/TcLastPage.js +24 -0
- package/src/components/controls/TcNextPage.js +24 -0
- package/src/components/controls/TcPageSelect.js +36 -0
- package/src/components/controls/TcPageSize.js +23 -0
- package/src/components/controls/TcPrevPage.js +24 -0
- package/src/components/controls/TcSearch.js +34 -0
- package/src/components/controls/TcShowAll.js +18 -0
- package/src/components/controls/TextBackgroundColor.js +84 -0
- package/src/components/controls/TextColor.js +84 -0
- package/src/components/controls/Underline.js +19 -0
- package/src/components/controls/Undo.js +18 -0
- package/src/components/controls/WordCount.js +48 -0
- package/src/components/controls/WordWrap.js +36 -0
- package/tasks/released/0007-code-editor-updates/branch-custom-controls.png +0 -0
- package/tasks/released/0007-code-editor-updates/branch-toolbar.png +0 -0
- package/tasks/released/0007-code-editor-updates/docs-overview.png +0 -0
- package/tasks/released/0007-code-editor-updates/form-integration.png +0 -0
- package/tasks/released/0007-code-editor-updates/live-builtin-controls.png +0 -0
- package/tasks/released/0007-code-editor-updates/live-custom-controls.png +0 -0
- package/tasks/released/0007-code-editor-updates/live-toolbar.png +0 -0
- package/tasks/released/0007-code-editor-updates/local-builtin-controls.png +0 -0
- package/tasks/released/0007-code-editor-updates/local-fixed-builtin.png +0 -0
- package/tasks/released/0007-code-editor-updates/theme-selector.png +0 -0
- package/tasks/released/0007-code-editor-updates.md +96 -0
- package/tests/components/CodeEditor.browser-test.js +0 -42
- package/tests/components/HtmlEditor.browser-test.js +0 -88
- package/tests/components/MarkdownEditor.browser-test.js +0 -72
- package/tests/components/Pagination.browser-test.js +12 -90
- package/tests/components/{htmlEditorControls → controls}/Align.browser-test.js +16 -16
- package/tests/components/{htmlEditorControls → controls}/Bold.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/BulletList.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/CharacterCount.browser-test.js +5 -5
- package/tests/components/{htmlEditorControls → controls}/ClearFormatting.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/CodeBlock.browser-test.js +8 -8
- package/tests/components/controls/Control.browser-test.js +147 -0
- package/tests/components/{htmlEditorControls → controls}/ControlGroup.browser-test.js +9 -9
- package/tests/components/{htmlEditorControls → controls}/ControlSpacer.browser-test.js +4 -4
- package/tests/components/{codeEditorControls → controls}/CopyCode.browser-test.js +8 -8
- package/tests/components/{htmlEditorControls → controls}/CreateLink.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/DropdownControl.browser-test.js +8 -8
- package/tests/components/{codeEditorControls → controls}/EditorTheme.browser-test.js +4 -4
- package/tests/components/{tableControls → controls}/ExportControls.browser-test.js +22 -46
- package/tests/components/{tableControls → controls}/FieldSortHide.browser-test.js +14 -26
- package/tests/components/{tableControls → controls}/Filters.browser-test.js +15 -27
- package/tests/components/{codeEditorControls → controls}/FindReplace.browser-test.js +8 -8
- package/tests/components/{codeEditorControls → controls}/FoldAll.browser-test.js +10 -10
- package/tests/components/{codeEditorControls → controls}/FontSize.browser-test.js +19 -14
- package/tests/components/{htmlEditorControls → controls}/FormatBlock.browser-test.js +9 -9
- package/tests/components/{htmlEditorControls → controls}/FormatCode.browser-test.js +17 -18
- package/tests/components/{codeEditorControls → controls}/Fullscreen.browser-test.js +11 -32
- package/tests/components/{tableControls → controls}/HiddenCount.browser-test.js +4 -4
- package/tests/components/{htmlEditorControls → controls}/InlineCode.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/InsertTable.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/Italic.browser-test.js +7 -7
- package/tests/components/{codeEditorControls → controls}/LanguageSelect.browser-test.js +4 -4
- package/tests/components/{codeEditorControls → controls}/Minimap.browser-test.js +8 -8
- package/tests/components/{htmlEditorControls → controls}/Mode.browser-test.js +7 -7
- package/tests/components/{codeEditorControls → controls}/ModeVisibility.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/NumberList.browser-test.js +7 -7
- package/tests/components/{tableControls → controls}/PaginationControls.browser-test.js +45 -45
- package/tests/components/{tableControls → controls}/RecordControls.browser-test.js +24 -60
- package/tests/components/{tableControls → controls}/Search.browser-test.js +4 -16
- package/tests/components/{htmlEditorControls → controls}/Strikethrough.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/TextBackgroundColor.browser-test.js +5 -5
- package/tests/components/{htmlEditorControls → controls}/TextColor.browser-test.js +5 -5
- package/tests/components/{htmlEditorControls → controls}/Underline.browser-test.js +7 -7
- package/tests/components/{codeEditorControls → controls}/UndoRedo.browser-test.js +15 -15
- package/tests/components/{htmlEditorControls → controls}/WordCount.browser-test.js +5 -5
- package/tests/components/{codeEditorControls → controls}/WordWrap.browser-test.js +8 -8
- package/dist/components/codeEditorControls/CodeEditorControl.js +0 -17
- package/dist/components/codeEditorControls/ControlGroup.js +0 -12
- package/dist/components/codeEditorControls/ControlSpacer.js +0 -6
- package/dist/components/codeEditorControls/CopyCode.js +0 -9
- package/dist/components/codeEditorControls/EditorTheme.js +0 -26
- package/dist/components/codeEditorControls/FindReplace.js +0 -7
- package/dist/components/codeEditorControls/FoldAll.js +0 -7
- package/dist/components/codeEditorControls/FontSize.js +0 -13
- package/dist/components/codeEditorControls/FormatCode.js +0 -9
- package/dist/components/codeEditorControls/Fullscreen.js +0 -12
- package/dist/components/codeEditorControls/LanguageSelect.js +0 -15
- package/dist/components/codeEditorControls/Minimap.js +0 -8
- package/dist/components/codeEditorControls/Redo.js +0 -7
- package/dist/components/codeEditorControls/Undo.js +0 -7
- package/dist/components/codeEditorControls/WordWrap.js +0 -8
- package/dist/components/htmlEditorControls/AlignCenter.js +0 -12
- package/dist/components/htmlEditorControls/AlignJustify.js +0 -12
- package/dist/components/htmlEditorControls/AlignLeft.js +0 -12
- package/dist/components/htmlEditorControls/AlignRight.js +0 -12
- package/dist/components/htmlEditorControls/Bold.js +0 -12
- package/dist/components/htmlEditorControls/BulletList.js +0 -12
- package/dist/components/htmlEditorControls/CharacterCount.js +0 -18
- package/dist/components/htmlEditorControls/ClearFormatting.js +0 -12
- package/dist/components/htmlEditorControls/CodeBlock.js +0 -12
- package/dist/components/htmlEditorControls/ControlGroup.js +0 -12
- package/dist/components/htmlEditorControls/CreateLink.js +0 -15
- package/dist/components/htmlEditorControls/DropdownControl.js +0 -57
- package/dist/components/htmlEditorControls/FormatBlock.js +0 -12
- package/dist/components/htmlEditorControls/FormatCode.js +0 -1
- package/dist/components/htmlEditorControls/HtmlEditorControl.js +0 -44
- package/dist/components/htmlEditorControls/InlineCode.js +0 -12
- package/dist/components/htmlEditorControls/InsertTable.js +0 -15
- package/dist/components/htmlEditorControls/Italic.js +0 -12
- package/dist/components/htmlEditorControls/Mode.js +0 -9
- package/dist/components/htmlEditorControls/NumberList.js +0 -12
- package/dist/components/htmlEditorControls/Strikethrough.js +0 -12
- package/dist/components/htmlEditorControls/TextBackgroundColor.js +0 -97
- package/dist/components/htmlEditorControls/TextColor.js +0 -97
- package/dist/components/htmlEditorControls/Underline.js +0 -12
- package/dist/components/htmlEditorControls/WordCount.js +0 -18
- package/dist/components/markdownEditorControls/Bold.js +0 -11
- package/dist/components/markdownEditorControls/BulletList.js +0 -11
- package/dist/components/markdownEditorControls/Code.js +0 -11
- package/dist/components/markdownEditorControls/FormatBlock.js +0 -30
- package/dist/components/markdownEditorControls/Heading.js +0 -11
- package/dist/components/markdownEditorControls/Image.js +0 -93
- package/dist/components/markdownEditorControls/Italic.js +0 -11
- package/dist/components/markdownEditorControls/Link.js +0 -11
- package/dist/components/markdownEditorControls/MarkdownEditorControl.js +0 -39
- package/dist/components/markdownEditorControls/Menu.js +0 -30
- package/dist/components/markdownEditorControls/NumberedList.js +0 -11
- package/dist/components/markdownEditorControls/Quote.js +0 -11
- package/dist/components/markdownEditorControls/SpeechToText.js +0 -16
- package/dist/components/markdownEditorControls/Strikethrough.js +0 -11
- package/dist/components/markdownEditorControls/Table.js +0 -80
- package/dist/components/paginationControls/FirstPage.js +0 -1
- package/dist/components/paginationControls/GotoPage.js +0 -17
- package/dist/components/paginationControls/ItemsPerPage.js +0 -15
- package/dist/components/paginationControls/LastPage.js +0 -1
- package/dist/components/paginationControls/NextPage.js +0 -1
- package/dist/components/paginationControls/PageCount.js +0 -1
- package/dist/components/paginationControls/PageInfo.js +0 -6
- package/dist/components/paginationControls/PaginationButtonControl.js +0 -20
- package/dist/components/paginationControls/PaginationControl.js +0 -5
- package/dist/components/paginationControls/PrevPage.js +0 -1
- package/dist/components/tableControls/DeleteRecord.js +0 -7
- package/dist/components/tableControls/DeleteSelected.js +0 -7
- package/dist/components/tableControls/Edit.js +0 -18
- package/dist/components/tableControls/ExportCSV.js +0 -8
- package/dist/components/tableControls/ExportJson.js +0 -8
- package/dist/components/tableControls/FieldSortHide.js +0 -25
- package/dist/components/tableControls/Filters.js +0 -46
- package/dist/components/tableControls/FirstPage.js +0 -9
- package/dist/components/tableControls/HiddenCount.js +0 -3
- package/dist/components/tableControls/Hide.js +0 -5
- package/dist/components/tableControls/LastPage.js +0 -9
- package/dist/components/tableControls/NextPage.js +0 -9
- package/dist/components/tableControls/PageSelect.js +0 -22
- package/dist/components/tableControls/PageSize.js +0 -5
- package/dist/components/tableControls/PrevPage.js +0 -9
- package/dist/components/tableControls/Search.js +0 -9
- package/dist/components/tableControls/ShowAll.js +0 -5
- package/dist/components/tableControls/TableControl.js +0 -16
- package/docs/src/components/codeEditorControls/CodeEditorControl.js +0 -17
- package/docs/src/components/codeEditorControls/ControlGroup.js +0 -12
- package/docs/src/components/codeEditorControls/CopyCode.js +0 -9
- package/docs/src/components/codeEditorControls/EditorTheme.js +0 -26
- package/docs/src/components/codeEditorControls/FindReplace.js +0 -7
- package/docs/src/components/codeEditorControls/FoldAll.js +0 -7
- package/docs/src/components/codeEditorControls/FontSize.js +0 -13
- package/docs/src/components/codeEditorControls/FormatCode.js +0 -9
- package/docs/src/components/codeEditorControls/Fullscreen.js +0 -12
- package/docs/src/components/codeEditorControls/LanguageSelect.js +0 -15
- package/docs/src/components/codeEditorControls/Minimap.js +0 -8
- package/docs/src/components/codeEditorControls/Redo.js +0 -7
- package/docs/src/components/codeEditorControls/Undo.js +0 -7
- package/docs/src/components/codeEditorControls/WordWrap.js +0 -8
- package/docs/src/components/htmlEditorControls/AlignCenter.js +0 -12
- package/docs/src/components/htmlEditorControls/AlignJustify.js +0 -12
- package/docs/src/components/htmlEditorControls/AlignLeft.js +0 -12
- package/docs/src/components/htmlEditorControls/AlignRight.js +0 -12
- package/docs/src/components/htmlEditorControls/Bold.js +0 -12
- package/docs/src/components/htmlEditorControls/BulletList.js +0 -12
- package/docs/src/components/htmlEditorControls/CharacterCount.js +0 -18
- package/docs/src/components/htmlEditorControls/ClearFormatting.js +0 -12
- package/docs/src/components/htmlEditorControls/CodeBlock.js +0 -12
- package/docs/src/components/htmlEditorControls/ControlGroup.js +0 -12
- package/docs/src/components/htmlEditorControls/ControlSpacer.js +0 -6
- package/docs/src/components/htmlEditorControls/CreateLink.js +0 -15
- package/docs/src/components/htmlEditorControls/DropdownControl.js +0 -57
- package/docs/src/components/htmlEditorControls/FormatBlock.js +0 -12
- package/docs/src/components/htmlEditorControls/FormatCode.js +0 -1
- package/docs/src/components/htmlEditorControls/HtmlEditorControl.js +0 -44
- package/docs/src/components/htmlEditorControls/InlineCode.js +0 -12
- package/docs/src/components/htmlEditorControls/InsertTable.js +0 -15
- package/docs/src/components/htmlEditorControls/Italic.js +0 -12
- package/docs/src/components/htmlEditorControls/Mode.js +0 -9
- package/docs/src/components/htmlEditorControls/NumberList.js +0 -12
- package/docs/src/components/htmlEditorControls/Strikethrough.js +0 -12
- package/docs/src/components/htmlEditorControls/TextBackgroundColor.js +0 -97
- package/docs/src/components/htmlEditorControls/TextColor.js +0 -97
- package/docs/src/components/htmlEditorControls/Underline.js +0 -12
- package/docs/src/components/htmlEditorControls/WordCount.js +0 -18
- package/docs/src/components/markdownEditorControls/Bold.js +0 -11
- package/docs/src/components/markdownEditorControls/BulletList.js +0 -11
- package/docs/src/components/markdownEditorControls/Code.js +0 -11
- package/docs/src/components/markdownEditorControls/FormatBlock.js +0 -30
- package/docs/src/components/markdownEditorControls/Heading.js +0 -11
- package/docs/src/components/markdownEditorControls/Image.js +0 -93
- package/docs/src/components/markdownEditorControls/Italic.js +0 -11
- package/docs/src/components/markdownEditorControls/Link.js +0 -11
- package/docs/src/components/markdownEditorControls/MarkdownEditorControl.js +0 -39
- package/docs/src/components/markdownEditorControls/Menu.js +0 -30
- package/docs/src/components/markdownEditorControls/NumberedList.js +0 -11
- package/docs/src/components/markdownEditorControls/Quote.js +0 -11
- package/docs/src/components/markdownEditorControls/SpeechToText.js +0 -16
- package/docs/src/components/markdownEditorControls/Strikethrough.js +0 -11
- package/docs/src/components/markdownEditorControls/Table.js +0 -80
- package/docs/src/components/paginationControls/FirstPage.js +0 -1
- package/docs/src/components/paginationControls/GotoPage.js +0 -17
- package/docs/src/components/paginationControls/ItemsPerPage.js +0 -15
- package/docs/src/components/paginationControls/LastPage.js +0 -1
- package/docs/src/components/paginationControls/NextPage.js +0 -1
- package/docs/src/components/paginationControls/PageCount.js +0 -1
- package/docs/src/components/paginationControls/PageInfo.js +0 -6
- package/docs/src/components/paginationControls/PaginationButtonControl.js +0 -20
- package/docs/src/components/paginationControls/PaginationControl.js +0 -5
- package/docs/src/components/paginationControls/PrevPage.js +0 -1
- package/docs/src/components/tableControls/DeleteRecord.js +0 -7
- package/docs/src/components/tableControls/DeleteSelected.js +0 -7
- package/docs/src/components/tableControls/Edit.js +0 -18
- package/docs/src/components/tableControls/ExportCSV.js +0 -8
- package/docs/src/components/tableControls/ExportJson.js +0 -8
- package/docs/src/components/tableControls/FieldSortHide.js +0 -25
- package/docs/src/components/tableControls/Filters.js +0 -46
- package/docs/src/components/tableControls/FirstPage.js +0 -9
- package/docs/src/components/tableControls/HiddenCount.js +0 -3
- package/docs/src/components/tableControls/Hide.js +0 -5
- package/docs/src/components/tableControls/LastPage.js +0 -9
- package/docs/src/components/tableControls/NextPage.js +0 -9
- package/docs/src/components/tableControls/PageSelect.js +0 -22
- package/docs/src/components/tableControls/PageSize.js +0 -5
- package/docs/src/components/tableControls/PrevPage.js +0 -9
- package/docs/src/components/tableControls/Search.js +0 -9
- package/docs/src/components/tableControls/ShowAll.js +0 -5
- package/docs/src/components/tableControls/TableControl.js +0 -16
- package/src/components/codeEditorControls/CodeEditorControl.js +0 -134
- package/src/components/codeEditorControls/ControlSpacer.js +0 -23
- package/src/components/codeEditorControls/CopyCode.js +0 -37
- package/src/components/codeEditorControls/EditorTheme.js +0 -81
- package/src/components/codeEditorControls/FindReplace.js +0 -35
- package/src/components/codeEditorControls/FoldAll.js +0 -49
- package/src/components/codeEditorControls/FontSize.js +0 -45
- package/src/components/codeEditorControls/FormatCode.js +0 -37
- package/src/components/codeEditorControls/Fullscreen.js +0 -72
- package/src/components/codeEditorControls/LanguageSelect.js +0 -74
- package/src/components/codeEditorControls/Minimap.js +0 -60
- package/src/components/codeEditorControls/Redo.js +0 -35
- package/src/components/codeEditorControls/Undo.js +0 -35
- package/src/components/codeEditorControls/WordWrap.js +0 -60
- package/src/components/htmlEditorControls/AlignCenter.js +0 -63
- package/src/components/htmlEditorControls/AlignJustify.js +0 -63
- package/src/components/htmlEditorControls/AlignLeft.js +0 -63
- package/src/components/htmlEditorControls/AlignRight.js +0 -63
- package/src/components/htmlEditorControls/Bold.js +0 -63
- package/src/components/htmlEditorControls/BulletList.js +0 -63
- package/src/components/htmlEditorControls/CharacterCount.js +0 -75
- package/src/components/htmlEditorControls/ClearFormatting.js +0 -63
- package/src/components/htmlEditorControls/CodeBlock.js +0 -64
- package/src/components/htmlEditorControls/ControlGroup.js +0 -70
- package/src/components/htmlEditorControls/ControlSpacer.js +0 -23
- package/src/components/htmlEditorControls/CreateLink.js +0 -115
- package/src/components/htmlEditorControls/DropdownControl.js +0 -149
- package/src/components/htmlEditorControls/FormatBlock.js +0 -106
- package/src/components/htmlEditorControls/FormatCode.js +0 -7
- package/src/components/htmlEditorControls/HtmlEditorControl.js +0 -164
- package/src/components/htmlEditorControls/InlineCode.js +0 -63
- package/src/components/htmlEditorControls/InsertTable.js +0 -126
- package/src/components/htmlEditorControls/Italic.js +0 -63
- package/src/components/htmlEditorControls/Mode.js +0 -68
- package/src/components/htmlEditorControls/NumberList.js +0 -63
- package/src/components/htmlEditorControls/Strikethrough.js +0 -63
- package/src/components/htmlEditorControls/TextBackgroundColor.js +0 -189
- package/src/components/htmlEditorControls/TextColor.js +0 -189
- package/src/components/htmlEditorControls/Underline.js +0 -63
- package/src/components/htmlEditorControls/WordCount.js +0 -76
- package/src/components/markdownEditorControls/Bold.js +0 -30
- package/src/components/markdownEditorControls/BulletList.js +0 -30
- package/src/components/markdownEditorControls/Code.js +0 -39
- package/src/components/markdownEditorControls/FormatBlock.js +0 -102
- package/src/components/markdownEditorControls/Heading.js +0 -46
- package/src/components/markdownEditorControls/Image.js +0 -250
- package/src/components/markdownEditorControls/Italic.js +0 -30
- package/src/components/markdownEditorControls/Link.js +0 -74
- package/src/components/markdownEditorControls/MarkdownEditorControl.js +0 -158
- package/src/components/markdownEditorControls/Menu.js +0 -86
- package/src/components/markdownEditorControls/NumberedList.js +0 -69
- package/src/components/markdownEditorControls/Quote.js +0 -30
- package/src/components/markdownEditorControls/SpeechToText.js +0 -65
- package/src/components/markdownEditorControls/Strikethrough.js +0 -35
- package/src/components/markdownEditorControls/Table.js +0 -165
- package/src/components/paginationControls/FirstPage.js +0 -26
- package/src/components/paginationControls/GotoPage.js +0 -56
- package/src/components/paginationControls/ItemsPerPage.js +0 -44
- package/src/components/paginationControls/LastPage.js +0 -26
- package/src/components/paginationControls/NextPage.js +0 -26
- package/src/components/paginationControls/PageCount.js +0 -10
- package/src/components/paginationControls/PageInfo.js +0 -23
- package/src/components/paginationControls/PaginationButtonControl.js +0 -76
- package/src/components/paginationControls/PaginationControl.js +0 -43
- package/src/components/paginationControls/PrevPage.js +0 -26
- package/src/components/tableControls/DeleteRecord.js +0 -29
- package/src/components/tableControls/DeleteSelected.js +0 -27
- package/src/components/tableControls/Edit.js +0 -86
- package/src/components/tableControls/ExportCSV.js +0 -71
- package/src/components/tableControls/ExportJson.js +0 -55
- package/src/components/tableControls/FieldSortHide.js +0 -76
- package/src/components/tableControls/Filters.js +0 -113
- package/src/components/tableControls/FirstPage.js +0 -65
- package/src/components/tableControls/HiddenCount.js +0 -43
- package/src/components/tableControls/Hide.js +0 -34
- package/src/components/tableControls/LastPage.js +0 -65
- package/src/components/tableControls/NextPage.js +0 -65
- package/src/components/tableControls/PageSelect.js +0 -101
- package/src/components/tableControls/PageSize.js +0 -68
- package/src/components/tableControls/PrevPage.js +0 -65
- package/src/components/tableControls/Search.js +0 -56
- package/src/components/tableControls/ShowAll.js +0 -34
- package/src/components/tableControls/TableControl.js +0 -103
- package/tests/components/tableControls/TableControl.browser-test.js +0 -300
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../../../src/components/
|
|
1
|
+
import '../../../src/components/controls/TcSearch.js';
|
|
2
2
|
import '../../../src/components/Table.js';
|
|
3
3
|
|
|
4
4
|
const sampleRecords = [
|
|
@@ -14,7 +14,7 @@ const createTableWithSearch = async () => {
|
|
|
14
14
|
container.innerHTML = `
|
|
15
15
|
<k-table>
|
|
16
16
|
<div slot="controls">
|
|
17
|
-
<
|
|
17
|
+
<kc-tc-search></kc-tc-search>
|
|
18
18
|
</div>
|
|
19
19
|
</k-table>
|
|
20
20
|
`;
|
|
@@ -25,7 +25,7 @@ const createTableWithSearch = async () => {
|
|
|
25
25
|
table.setRecords([...sampleRecords]);
|
|
26
26
|
await table.updateComplete;
|
|
27
27
|
|
|
28
|
-
const search = container.querySelector('
|
|
28
|
+
const search = container.querySelector('kc-tc-search');
|
|
29
29
|
await search.updateComplete;
|
|
30
30
|
|
|
31
31
|
return { container, table, search };
|
|
@@ -72,18 +72,6 @@ export default {
|
|
|
72
72
|
/*
|
|
73
73
|
Default Values Tests
|
|
74
74
|
*/
|
|
75
|
-
'should have default maxWidth of 200': async ({pass, fail}) => {
|
|
76
|
-
const { container, search } = await createTableWithSearch();
|
|
77
|
-
|
|
78
|
-
if(search.maxWidth !== 200){
|
|
79
|
-
cleanup(container);
|
|
80
|
-
fail(`Expected maxWidth 200, got ${search.maxWidth}`);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
cleanup(container);
|
|
85
|
-
pass('Search has default maxWidth of 200');
|
|
86
|
-
},
|
|
87
75
|
|
|
88
76
|
/*
|
|
89
77
|
Search Behavior Tests
|
|
@@ -262,7 +250,7 @@ export default {
|
|
|
262
250
|
No Table Tests
|
|
263
251
|
*/
|
|
264
252
|
'should handle missing table gracefully': async ({pass, fail}) => {
|
|
265
|
-
const search = document.createElement('
|
|
253
|
+
const search = document.createElement('kc-tc-search');
|
|
266
254
|
document.body.appendChild(search);
|
|
267
255
|
await search.updateComplete;
|
|
268
256
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../../../src/components/HtmlEditor.js';
|
|
2
|
-
import Strikethrough from '../../../src/components/
|
|
2
|
+
import Strikethrough from '../../../src/components/controls/Strikethrough.js';
|
|
3
3
|
|
|
4
4
|
const createEditorWithControl = async () => {
|
|
5
5
|
const container = document.createElement('div');
|
|
6
6
|
container.innerHTML = `
|
|
7
7
|
<k-html-editor>
|
|
8
|
-
<
|
|
8
|
+
<kc-strikethrough slot="toolbar-top-left"></kc-strikethrough>
|
|
9
9
|
</k-html-editor>
|
|
10
10
|
`;
|
|
11
11
|
document.body.appendChild(container);
|
|
12
12
|
const editor = container.querySelector('k-html-editor');
|
|
13
13
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
14
|
-
const control = container.querySelector('
|
|
14
|
+
const control = container.querySelector('kc-strikethrough');
|
|
15
15
|
return { container, editor, control };
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
/*
|
|
24
24
|
Element Creation
|
|
25
25
|
*/
|
|
26
|
-
'should create
|
|
26
|
+
'should create kc-strikethrough element': async ({pass, fail}) => {
|
|
27
27
|
const { container, control } = await createEditorWithControl();
|
|
28
28
|
if(!(control instanceof Strikethrough)){
|
|
29
29
|
cleanup(container);
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
'should render a button': async ({pass, fail}) => {
|
|
47
47
|
const { container, control } = await createEditorWithControl();
|
|
48
48
|
await control.updateComplete;
|
|
49
|
-
const button = control
|
|
49
|
+
const button = control;
|
|
50
50
|
if(!button){
|
|
51
51
|
cleanup(container);
|
|
52
52
|
return fail('Strikethrough should render a button');
|
|
@@ -76,7 +76,7 @@ export default {
|
|
|
76
76
|
*/
|
|
77
77
|
'should find parent editor': async ({pass, fail}) => {
|
|
78
78
|
const { container, editor, control } = await createEditorWithControl();
|
|
79
|
-
if(control.
|
|
79
|
+
if(control.host !== editor){
|
|
80
80
|
cleanup(container);
|
|
81
81
|
return fail('Strikethrough should find its parent k-html-editor');
|
|
82
82
|
}
|
|
@@ -89,7 +89,7 @@ export default {
|
|
|
89
89
|
await control.updateComplete;
|
|
90
90
|
let called = false;
|
|
91
91
|
editor.strikethrough = () => { called = true; };
|
|
92
|
-
control.
|
|
92
|
+
control.click();
|
|
93
93
|
if(!called){
|
|
94
94
|
cleanup(container);
|
|
95
95
|
return fail('Click should call editor.strikethrough()');
|
package/tests/components/{htmlEditorControls → controls}/TextBackgroundColor.browser-test.js
RENAMED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../../../src/components/HtmlEditor.js';
|
|
2
|
-
import TextBackgroundColor from '../../../src/components/
|
|
2
|
+
import TextBackgroundColor from '../../../src/components/controls/TextBackgroundColor.js';
|
|
3
3
|
|
|
4
4
|
const createEditorWithControl = async () => {
|
|
5
5
|
const container = document.createElement('div');
|
|
6
6
|
container.innerHTML = `
|
|
7
7
|
<k-html-editor>
|
|
8
|
-
<
|
|
8
|
+
<kc-text-background-color slot="toolbar-top-left"></kc-text-background-color>
|
|
9
9
|
</k-html-editor>
|
|
10
10
|
`;
|
|
11
11
|
document.body.appendChild(container);
|
|
12
12
|
const editor = container.querySelector('k-html-editor');
|
|
13
13
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
14
|
-
const control = container.querySelector('
|
|
14
|
+
const control = container.querySelector('kc-text-background-color');
|
|
15
15
|
return { container, editor, control };
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
/*
|
|
24
24
|
Element Creation
|
|
25
25
|
*/
|
|
26
|
-
'should create
|
|
26
|
+
'should create kc-text-bg-color element': async ({pass, fail}) => {
|
|
27
27
|
const { container, control } = await createEditorWithControl();
|
|
28
28
|
if(!(control instanceof TextBackgroundColor)){
|
|
29
29
|
cleanup(container);
|
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
*/
|
|
63
63
|
'should find parent editor': async ({pass, fail}) => {
|
|
64
64
|
const { container, editor, control } = await createEditorWithControl();
|
|
65
|
-
if(control.
|
|
65
|
+
if(control.host !== editor){
|
|
66
66
|
cleanup(container);
|
|
67
67
|
return fail('TextBackgroundColor should find its parent k-html-editor');
|
|
68
68
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../../../src/components/HtmlEditor.js';
|
|
2
|
-
import TextColor from '../../../src/components/
|
|
2
|
+
import TextColor from '../../../src/components/controls/TextColor.js';
|
|
3
3
|
|
|
4
4
|
const createEditorWithControl = async () => {
|
|
5
5
|
const container = document.createElement('div');
|
|
6
6
|
container.innerHTML = `
|
|
7
7
|
<k-html-editor>
|
|
8
|
-
<
|
|
8
|
+
<kc-text-color slot="toolbar-top-left"></kc-text-color>
|
|
9
9
|
</k-html-editor>
|
|
10
10
|
`;
|
|
11
11
|
document.body.appendChild(container);
|
|
12
12
|
const editor = container.querySelector('k-html-editor');
|
|
13
13
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
14
|
-
const control = container.querySelector('
|
|
14
|
+
const control = container.querySelector('kc-text-color');
|
|
15
15
|
return { container, editor, control };
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
/*
|
|
24
24
|
Element Creation
|
|
25
25
|
*/
|
|
26
|
-
'should create
|
|
26
|
+
'should create kc-text-color element': async ({pass, fail}) => {
|
|
27
27
|
const { container, control } = await createEditorWithControl();
|
|
28
28
|
if(!(control instanceof TextColor)){
|
|
29
29
|
cleanup(container);
|
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
*/
|
|
63
63
|
'should find parent editor': async ({pass, fail}) => {
|
|
64
64
|
const { container, editor, control } = await createEditorWithControl();
|
|
65
|
-
if(control.
|
|
65
|
+
if(control.host !== editor){
|
|
66
66
|
cleanup(container);
|
|
67
67
|
return fail('TextColor should find its parent k-html-editor');
|
|
68
68
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../../../src/components/HtmlEditor.js';
|
|
2
|
-
import Underline from '../../../src/components/
|
|
2
|
+
import Underline from '../../../src/components/controls/Underline.js';
|
|
3
3
|
|
|
4
4
|
const createEditorWithControl = async () => {
|
|
5
5
|
const container = document.createElement('div');
|
|
6
6
|
container.innerHTML = `
|
|
7
7
|
<k-html-editor>
|
|
8
|
-
<
|
|
8
|
+
<kc-underline slot="toolbar-top-left"></kc-underline>
|
|
9
9
|
</k-html-editor>
|
|
10
10
|
`;
|
|
11
11
|
document.body.appendChild(container);
|
|
12
12
|
const editor = container.querySelector('k-html-editor');
|
|
13
13
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
14
|
-
const control = container.querySelector('
|
|
14
|
+
const control = container.querySelector('kc-underline');
|
|
15
15
|
return { container, editor, control };
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
/*
|
|
24
24
|
Element Creation
|
|
25
25
|
*/
|
|
26
|
-
'should create
|
|
26
|
+
'should create kc-underline element': async ({pass, fail}) => {
|
|
27
27
|
const { container, control } = await createEditorWithControl();
|
|
28
28
|
if(!(control instanceof Underline)){
|
|
29
29
|
cleanup(container);
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
'should render a button': async ({pass, fail}) => {
|
|
47
47
|
const { container, control } = await createEditorWithControl();
|
|
48
48
|
await control.updateComplete;
|
|
49
|
-
const button = control
|
|
49
|
+
const button = control;
|
|
50
50
|
if(!button){
|
|
51
51
|
cleanup(container);
|
|
52
52
|
return fail('Underline should render a button');
|
|
@@ -76,7 +76,7 @@ export default {
|
|
|
76
76
|
*/
|
|
77
77
|
'should find parent editor': async ({pass, fail}) => {
|
|
78
78
|
const { container, editor, control } = await createEditorWithControl();
|
|
79
|
-
if(control.
|
|
79
|
+
if(control.host !== editor){
|
|
80
80
|
cleanup(container);
|
|
81
81
|
return fail('Underline should find its parent k-html-editor');
|
|
82
82
|
}
|
|
@@ -89,7 +89,7 @@ export default {
|
|
|
89
89
|
await control.updateComplete;
|
|
90
90
|
let called = false;
|
|
91
91
|
editor.underline = () => { called = true; };
|
|
92
|
-
control.
|
|
92
|
+
control.click();
|
|
93
93
|
if(!called){
|
|
94
94
|
cleanup(container);
|
|
95
95
|
return fail('Click should call editor.underline()');
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import '../../../src/components/CodeEditor.js';
|
|
2
|
-
import '../../../src/components/
|
|
3
|
-
import '../../../src/components/
|
|
2
|
+
import '../../../src/components/controls/Undo.js';
|
|
3
|
+
import '../../../src/components/controls/Redo.js';
|
|
4
4
|
|
|
5
5
|
const createEditorWithControls = async () => {
|
|
6
6
|
const container = document.createElement('div');
|
|
7
7
|
container.innerHTML = `
|
|
8
8
|
<k-code-editor language="javascript" style="height:200px">
|
|
9
|
-
<
|
|
10
|
-
<
|
|
9
|
+
<kc-undo slot="toolbar-top-left"></kc-undo>
|
|
10
|
+
<kc-redo slot="toolbar-top-left"></kc-redo>
|
|
11
11
|
</k-code-editor>
|
|
12
12
|
`;
|
|
13
13
|
document.body.appendChild(container);
|
|
14
14
|
const editor = container.querySelector('k-code-editor');
|
|
15
15
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
16
|
-
const undo = container.querySelector('
|
|
17
|
-
const redo = container.querySelector('
|
|
16
|
+
const undo = container.querySelector('kc-undo');
|
|
17
|
+
const redo = container.querySelector('kc-redo');
|
|
18
18
|
return { container, editor, undo, redo };
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -23,23 +23,23 @@ const cleanup = container => {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export default {
|
|
26
|
-
'undo should
|
|
26
|
+
'undo should have button role': async ({pass, fail}) => {
|
|
27
27
|
const { container, undo } = await createEditorWithControls();
|
|
28
28
|
await undo.updateComplete;
|
|
29
|
-
if(
|
|
29
|
+
if(undo.getAttribute('role') !== 'button'){
|
|
30
30
|
cleanup(container);
|
|
31
|
-
return fail('Undo should
|
|
31
|
+
return fail('Undo should have role="button"');
|
|
32
32
|
}
|
|
33
33
|
cleanup(container);
|
|
34
34
|
pass();
|
|
35
35
|
},
|
|
36
36
|
|
|
37
|
-
'redo should
|
|
37
|
+
'redo should have button role': async ({pass, fail}) => {
|
|
38
38
|
const { container, redo } = await createEditorWithControls();
|
|
39
39
|
await redo.updateComplete;
|
|
40
|
-
if(
|
|
40
|
+
if(redo.getAttribute('role') !== 'button'){
|
|
41
41
|
cleanup(container);
|
|
42
|
-
return fail('Redo should
|
|
42
|
+
return fail('Redo should have role="button"');
|
|
43
43
|
}
|
|
44
44
|
cleanup(container);
|
|
45
45
|
pass();
|
|
@@ -47,7 +47,7 @@ export default {
|
|
|
47
47
|
|
|
48
48
|
'undo should find parent editor': async ({pass, fail}) => {
|
|
49
49
|
const { container, editor, undo } = await createEditorWithControls();
|
|
50
|
-
if(undo.
|
|
50
|
+
if(undo.host !== editor){
|
|
51
51
|
cleanup(container);
|
|
52
52
|
return fail('Undo should find parent k-code-editor');
|
|
53
53
|
}
|
|
@@ -60,7 +60,7 @@ export default {
|
|
|
60
60
|
await undo.updateComplete;
|
|
61
61
|
let called = false;
|
|
62
62
|
editor.undo = () => { called = true; };
|
|
63
|
-
undo.
|
|
63
|
+
undo.click();
|
|
64
64
|
if(!called){
|
|
65
65
|
cleanup(container);
|
|
66
66
|
return fail('Should call editor.undo() on click');
|
|
@@ -74,7 +74,7 @@ export default {
|
|
|
74
74
|
await redo.updateComplete;
|
|
75
75
|
let called = false;
|
|
76
76
|
editor.redo = () => { called = true; };
|
|
77
|
-
redo.
|
|
77
|
+
redo.click();
|
|
78
78
|
if(!called){
|
|
79
79
|
cleanup(container);
|
|
80
80
|
return fail('Should call editor.redo() on click');
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../../../src/components/HtmlEditor.js';
|
|
2
|
-
import WordCount from '../../../src/components/
|
|
2
|
+
import WordCount from '../../../src/components/controls/WordCount.js';
|
|
3
3
|
|
|
4
4
|
const createEditorWithControl = async () => {
|
|
5
5
|
const container = document.createElement('div');
|
|
6
6
|
container.innerHTML = `
|
|
7
7
|
<k-html-editor>
|
|
8
|
-
<
|
|
8
|
+
<kc-word-count slot="toolbar-bottom-left"></kc-word-count>
|
|
9
9
|
</k-html-editor>
|
|
10
10
|
`;
|
|
11
11
|
document.body.appendChild(container);
|
|
12
12
|
const editor = container.querySelector('k-html-editor');
|
|
13
13
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
14
|
-
const control = container.querySelector('
|
|
14
|
+
const control = container.querySelector('kc-word-count');
|
|
15
15
|
return { container, editor, control };
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
/*
|
|
24
24
|
Element Creation
|
|
25
25
|
*/
|
|
26
|
-
'should create
|
|
26
|
+
'should create kc-word-count element': async ({pass, fail}) => {
|
|
27
27
|
const { container, control } = await createEditorWithControl();
|
|
28
28
|
if(!(control instanceof WordCount)){
|
|
29
29
|
cleanup(container);
|
|
@@ -48,7 +48,7 @@ export default {
|
|
|
48
48
|
*/
|
|
49
49
|
'should find parent editor': async ({pass, fail}) => {
|
|
50
50
|
const { container, editor, control } = await createEditorWithControl();
|
|
51
|
-
if(control.
|
|
51
|
+
if(control.host !== editor){
|
|
52
52
|
cleanup(container);
|
|
53
53
|
return fail('WordCount should find its parent k-html-editor');
|
|
54
54
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../../../src/components/CodeEditor.js';
|
|
2
|
-
import '../../../src/components/
|
|
2
|
+
import '../../../src/components/controls/WordWrap.js';
|
|
3
3
|
|
|
4
4
|
const createEditorWithControl = async () => {
|
|
5
5
|
const container = document.createElement('div');
|
|
6
6
|
container.innerHTML = `
|
|
7
7
|
<k-code-editor language="javascript" style="height:200px">
|
|
8
|
-
<
|
|
8
|
+
<kc-word-wrap slot="toolbar-top-left"></kc-word-wrap>
|
|
9
9
|
</k-code-editor>
|
|
10
10
|
`;
|
|
11
11
|
document.body.appendChild(container);
|
|
12
12
|
const editor = container.querySelector('k-code-editor');
|
|
13
13
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
14
|
-
const control = container.querySelector('
|
|
14
|
+
const control = container.querySelector('kc-word-wrap');
|
|
15
15
|
return { container, editor, control };
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -30,12 +30,12 @@ export default {
|
|
|
30
30
|
pass();
|
|
31
31
|
},
|
|
32
32
|
|
|
33
|
-
'should
|
|
33
|
+
'should have button role': async ({pass, fail}) => {
|
|
34
34
|
const { container, control } = await createEditorWithControl();
|
|
35
35
|
await control.updateComplete;
|
|
36
|
-
if(
|
|
36
|
+
if(control.getAttribute('role') !== 'button'){
|
|
37
37
|
cleanup(container);
|
|
38
|
-
return fail('Should
|
|
38
|
+
return fail('Should have role="button"');
|
|
39
39
|
}
|
|
40
40
|
cleanup(container);
|
|
41
41
|
pass();
|
|
@@ -43,7 +43,7 @@ export default {
|
|
|
43
43
|
|
|
44
44
|
'should find parent editor': async ({pass, fail}) => {
|
|
45
45
|
const { container, editor, control } = await createEditorWithControl();
|
|
46
|
-
if(control.
|
|
46
|
+
if(control.host !== editor){
|
|
47
47
|
cleanup(container);
|
|
48
48
|
return fail('Should find parent k-code-editor');
|
|
49
49
|
}
|
|
@@ -67,7 +67,7 @@ export default {
|
|
|
67
67
|
let called = false;
|
|
68
68
|
const orig = editor.toggleWordWrap.bind(editor);
|
|
69
69
|
editor.toggleWordWrap = () => { called = true; return orig(); };
|
|
70
|
-
control.
|
|
70
|
+
control.click();
|
|
71
71
|
await editor.updateComplete;
|
|
72
72
|
await control.updateComplete;
|
|
73
73
|
if(!called){
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import t from"../ShadowComponent.js";import{css as e}from"../../lit-all.min.js";export default class s extends t{static properties={btnClass:{type:String,attribute:"btn-class"},groupBtnClass:{type:String,attribute:"group-btn-class"},groupLastBtnClass:{type:String,attribute:"group-last-btn-class"},hidden:{type:Boolean,reflect:!0}};constructor(){super(),this.btnClass="b r mq ph",this.groupBtnClass="br ph",this.groupLastBtnClass="ph",this.hidden=!1}connectedCallback(){super.connectedCallback(),this.updateModeVisibility();const t=this.editor;"K-HTML-EDITOR"===t?.tagName&&(this.modeHandler=()=>this.updateModeVisibility(),t.addEventListener("mode-changed",this.modeHandler))}disconnectedCallback(){super.disconnectedCallback(),this.modeHandler&&(this.editor?.removeEventListener("mode-changed",this.modeHandler),this.modeHandler=null)}updated(t){super.updated(t),t.has("hidden")&&this.dispatchEvent(new CustomEvent("control_visibility_change",{bubbles:!0}))}updateModeVisibility(){const t=this.editor;if("K-HTML-EDITOR"===t?.tagName){const e="code"!==t.mode;this.hidden!==e&&(this.hidden=e,this.dispatchEvent(new CustomEvent("control_visibility_change",{bubbles:!0})))}}get editor(){const t=t=>"K-CODE-EDITOR"===t?.tagName||"K-HTML-EDITOR"===t?.tagName;let e=this.getRootNode();for(;e instanceof ShadowRoot;){const s=e.host;if(t(s))return s;e=s.getRootNode()}let s=this.parentElement;for(;s;){if(t(s))return s;s=s.parentElement}return null}get isInGroup(){const t=this.parentElement;return t&&"K-CEC-GROUP"===t.tagName}get isLastInGroup(){if(!this.isInGroup)return!1;const t=Array.from(this.parentElement.children).filter(t=>t.tagName.startsWith("K-CEC-")&&"K-CEC-SPACER"!==t.tagName);return t[t.length-1]===this}get buttonClasses(){let t;return t=this.isInGroup?this.isLastInGroup?this.groupLastBtnClass:this.groupBtnClass:this.btnClass,`no-btn icon-btn ${t}`.trim()}static styles=e`
|
|
2
|
-
:host {
|
|
3
|
-
display: inline-flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
}
|
|
6
|
-
:host([hidden]) {
|
|
7
|
-
display: none !important;
|
|
8
|
-
}
|
|
9
|
-
button {
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
display: inline-flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
min-width: 2rem;
|
|
15
|
-
min-height: 2rem;
|
|
16
|
-
}
|
|
17
|
-
`}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import t from"../ShadowComponent.js";import{html as e,css as i}from"../../lit-all.min.js";export default class s extends t{static properties={hidden:{type:Boolean,reflect:!0}};constructor(){super(),this.hidden=!1}connectedCallback(){super.connectedCallback(),this.hasAttribute("class")||this.setAttribute("class","b r mq"),this.addEventListener("control_visibility_change",this.checkVisibility)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("control_visibility_change",this.checkVisibility)}checkVisibility=t=>{if(t.target===this)return;const e=this.hidden;this.hidden=Array.from(this.children).every(t=>!0===t.hidden),this.hidden!==e&&this.dispatchEvent(new CustomEvent("control_visibility_change",{bubbles:!0}))};static styles=i`
|
|
2
|
-
:host {
|
|
3
|
-
display: inline-flex;
|
|
4
|
-
}
|
|
5
|
-
:host([hidden]) {
|
|
6
|
-
display: none !important;
|
|
7
|
-
}
|
|
8
|
-
::slotted(*) {
|
|
9
|
-
margin-top: -1px;
|
|
10
|
-
margin-bottom: -1px;
|
|
11
|
-
}
|
|
12
|
-
`;render(){return e`<slot></slot>`}}customElements.define("k-cec-group",s);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import t from"./CodeEditorControl.js";import{html as o,css as e}from"../../lit-all.min.js";import"../Icon.js";export default class s extends t{static styles=[t.styles,e`
|
|
2
|
-
:host {
|
|
3
|
-
display: inline-flex;
|
|
4
|
-
}
|
|
5
|
-
`];handleClick=()=>{this.editor?.copyToClipboard()};render(){return o`
|
|
6
|
-
<button class="${this.buttonClasses}" @click="${this.handleClick}" title="Copy Code">
|
|
7
|
-
<k-icon name="content_copy"></k-icon>
|
|
8
|
-
</button>
|
|
9
|
-
`}}customElements.define("k-cec-copy-code",s);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import e from"./CodeEditorControl.js";import{html as t,css as o}from"../../lit-all.min.js";import"../Icon.js";export default class i extends e{static properties={value:{type:String,state:!0}};constructor(){super(),this.value="auto"}connectedCallback(){super.connectedCallback();const e=this.editor;e&&(this.value=e.editorTheme||"auto",this.themeHandler=e=>{this.value=e.detail.editorTheme},e.addEventListener("editor-theme-changed",this.themeHandler))}disconnectedCallback(){super.disconnectedCallback(),this.editor?.removeEventListener("editor-theme-changed",this.themeHandler),this.themeHandler=null}handleChange=e=>{this.editor?.setEditorTheme(e.target.value)};static styles=[e.styles,o`
|
|
2
|
-
:host {
|
|
3
|
-
background-color: var(--input_bg);
|
|
4
|
-
color: var(--input_tc);
|
|
5
|
-
border: var(--input_border_width) solid var(--c_input_border);
|
|
6
|
-
border-radius: var(--radius);
|
|
7
|
-
transition: box-shadow var(--animation_ms);
|
|
8
|
-
position: relative;
|
|
9
|
-
}
|
|
10
|
-
k-icon {
|
|
11
|
-
pointer-events: none;
|
|
12
|
-
position: absolute;
|
|
13
|
-
left: 0.5rem;
|
|
14
|
-
}
|
|
15
|
-
select {
|
|
16
|
-
padding-left: 2rem;
|
|
17
|
-
border: 0;
|
|
18
|
-
}
|
|
19
|
-
`];render(){return t`
|
|
20
|
-
<k-icon name="contrast" style="font-size: 1.125rem; opacity: 0.7;"></k-icon>
|
|
21
|
-
<select .value=${this.value} @change=${this.handleChange} title="Editor Theme">
|
|
22
|
-
<option value="auto">Auto</option>
|
|
23
|
-
<option value="light">Light</option>
|
|
24
|
-
<option value="dark">Dark</option>
|
|
25
|
-
</select>
|
|
26
|
-
`}}customElements.define("k-cec-editor-theme",i);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import e from"./CodeEditorControl.js";import{html as t,css as i}from"../../lit-all.min.js";import"../Icon.js";export default class s extends e{static styles=[e.styles,i`
|
|
2
|
-
:host { display: inline-flex; }
|
|
3
|
-
`];handleClick=()=>{this.editor?.openFind()};render(){return t`
|
|
4
|
-
<button class="${this.buttonClasses}" @click="${this.handleClick}" title="Find & Replace">
|
|
5
|
-
<k-icon name="search"></k-icon>
|
|
6
|
-
</button>
|
|
7
|
-
`}}customElements.define("k-cec-find-replace",s);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import l from"./CodeEditorControl.js";import{html as t,css as o}from"../../lit-all.min.js";import"../Icon.js";export default class e extends l{static properties={folded:{type:Boolean,state:!0}};constructor(){super(),this.folded=!1}handleClick=()=>{this.folded=!this.folded,this.folded?this.editor?.foldAll():this.editor?.unfoldAll()};static styles=[l.styles,o`
|
|
2
|
-
:host { display: inline-flex; }
|
|
3
|
-
`];render(){return t`
|
|
4
|
-
<button class="${this.buttonClasses}" @click="${this.handleClick}" title="${this.folded?"Unfold All":"Fold All"}">
|
|
5
|
-
<k-icon name="${this.folded?"unfold_more":"unfold_less"}"></k-icon>
|
|
6
|
-
</button>
|
|
7
|
-
`}}customElements.define("k-cec-fold-all",e);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import e from"./CodeEditorControl.js";import{html as t,css as s}from"../../lit-all.min.js";import"../Icon.js";export default class n extends e{static styles=[e.styles,s`
|
|
2
|
-
:host {
|
|
3
|
-
display: inline-flex;
|
|
4
|
-
gap: 0;
|
|
5
|
-
}
|
|
6
|
-
`];handleIncrease=()=>{this.editor?.increaseFontSize()};handleDecrease=()=>{this.editor?.decreaseFontSize()};render(){return t`
|
|
7
|
-
<button class="${this.buttonClasses}" @click="${this.handleDecrease}" title="Decrease Font Size">
|
|
8
|
-
<k-icon name="text_decrease"></k-icon>
|
|
9
|
-
</button>
|
|
10
|
-
<button class="${this.buttonClasses}" @click="${this.handleIncrease}" title="Increase Font Size">
|
|
11
|
-
<k-icon name="text_increase"></k-icon>
|
|
12
|
-
</button>
|
|
13
|
-
`}}customElements.define("k-cec-font-size",n);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import t from"./CodeEditorControl.js";import{html as e,css as o}from"../../lit-all.min.js";import"../Icon.js";export default class s extends t{static styles=[t.styles,o`
|
|
2
|
-
:host {
|
|
3
|
-
display: inline-flex;
|
|
4
|
-
}
|
|
5
|
-
`];handleClick=()=>{this.editor?.formatCode()};render(){return e`
|
|
6
|
-
<button class="${this.buttonClasses}" @click="${this.handleClick}" title="Format Code">
|
|
7
|
-
<k-icon name="frame_source"></k-icon>
|
|
8
|
-
</button>
|
|
9
|
-
`}}customElements.define("k-cec-format-code",s);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import e from"./CodeEditorControl.js";import{html as l,css as s}from"../../lit-all.min.js";import"../Icon.js";export default class t extends e{static properties={fullscreen:{type:Boolean,state:!0}};constructor(){super(),this.fullscreen=!1}connectedCallback(){super.connectedCallback();const e=this.editor;e&&(this.fullscreen=e.fullscreen,this.fullscreenHandler=()=>{this.fullscreen=e.fullscreen},e.addEventListener("fullscreen-changed",this.fullscreenHandler))}disconnectedCallback(){super.disconnectedCallback(),this.editor?.removeEventListener("fullscreen-changed",this.fullscreenHandler),this.fullscreenHandler=null}updateModeVisibility(){}handleClick=()=>{this.editor?.toggleFullscreen()};static styles=[e.styles,s`
|
|
2
|
-
:host { display: inline-flex; }
|
|
3
|
-
button.active { background: var(--primary-bg, rgba(0,120,212,0.15)); }
|
|
4
|
-
`];render(){return l`
|
|
5
|
-
<button
|
|
6
|
-
class="${this.buttonClasses} ${this.fullscreen?"active":""}"
|
|
7
|
-
@click="${this.handleClick}"
|
|
8
|
-
title="${this.fullscreen?"Exit Fullscreen":"Fullscreen"}"
|
|
9
|
-
>
|
|
10
|
-
<k-icon name="${this.fullscreen?"fullscreen_exit":"fullscreen"}"></k-icon>
|
|
11
|
-
</button>
|
|
12
|
-
`}}customElements.define("k-cec-fullscreen",t);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import e from"./CodeEditorControl.js";import{html as a,css as t}from"../../lit-all.min.js";import"../Icon.js";const l=["javascript","typescript","html","css","json","markdown","python","java","csharp","cpp","go","rust","php","ruby","sql","xml","yaml","shell","plaintext"];export default class n extends e{static properties={value:{type:String,state:!0}};constructor(){super(),this.value="javascript"}connectedCallback(){super.connectedCallback();const e=this.editor;e&&(this.value=e.language||"javascript",this.languageHandler=e=>{this.value=e.detail.language},e.addEventListener("language-changed",this.languageHandler))}disconnectedCallback(){super.disconnectedCallback(),this.editor?.removeEventListener("language-changed",this.languageHandler),this.languageHandler=null}handleChange=e=>{this.editor?.setLanguage(e.target.value)};static styles=[e.styles,t`
|
|
2
|
-
:host {
|
|
3
|
-
display: inline-flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
padding: 0 0.25rem;
|
|
6
|
-
gap: 0.25rem;
|
|
7
|
-
background-color:
|
|
8
|
-
}
|
|
9
|
-
`];render(){return a`
|
|
10
|
-
<select .value=${this.value} @change=${this.handleChange} title="Language">
|
|
11
|
-
${l.map(e=>a`
|
|
12
|
-
<option value="${e}" ?selected=${this.value===e}>${e}</option>
|
|
13
|
-
`)}
|
|
14
|
-
</select>
|
|
15
|
-
`}}customElements.define("k-cec-language",n);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import i from"./CodeEditorControl.js";import{html as t,css as e}from"../../lit-all.min.js";import"../Icon.js";export default class n extends i{static properties={active:{type:Boolean,state:!0}};constructor(){super(),this.active=!1}connectedCallback(){super.connectedCallback();const i=this.editor;i&&(this.active=i.minimapEnabled,this.minimapHandler=i=>{this.active=i.detail.minimapEnabled},i.addEventListener("minimap-changed",this.minimapHandler))}disconnectedCallback(){super.disconnectedCallback(),this.editor?.removeEventListener("minimap-changed",this.minimapHandler),this.minimapHandler=null}handleClick=()=>{this.editor?.toggleMinimap()};static styles=[i.styles,e`
|
|
2
|
-
:host { display: inline-flex; }
|
|
3
|
-
button.active { background: var(--primary-bg, rgba(0,120,212,0.15)); }
|
|
4
|
-
`];render(){return t`
|
|
5
|
-
<button class="${this.buttonClasses} ${this.active?"active":""}" @click="${this.handleClick}" title="Toggle Minimap">
|
|
6
|
-
<k-icon name="map"></k-icon>
|
|
7
|
-
</button>
|
|
8
|
-
`}}customElements.define("k-cec-minimap",n);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import t from"./CodeEditorControl.js";import{html as e,css as o}from"../../lit-all.min.js";import"../Icon.js";export default class s extends t{static styles=[t.styles,o`
|
|
2
|
-
:host { display: inline-flex; }
|
|
3
|
-
`];handleClick=()=>{this.editor?.redo()};render(){return e`
|
|
4
|
-
<button class="${this.buttonClasses}" @click="${this.handleClick}" title="Redo">
|
|
5
|
-
<k-icon name="redo"></k-icon>
|
|
6
|
-
</button>
|
|
7
|
-
`}}customElements.define("k-cec-redo",s);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import t from"./CodeEditorControl.js";import{html as e,css as o}from"../../lit-all.min.js";import"../Icon.js";export default class s extends t{static styles=[t.styles,o`
|
|
2
|
-
:host { display: inline-flex; }
|
|
3
|
-
`];handleClick=()=>{this.editor?.undo()};render(){return e`
|
|
4
|
-
<button class="${this.buttonClasses}" @click="${this.handleClick}" title="Undo">
|
|
5
|
-
<k-icon name="undo"></k-icon>
|
|
6
|
-
</button>
|
|
7
|
-
`}}customElements.define("k-cec-undo",s);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import t from"./CodeEditorControl.js";import{html as e,css as r}from"../../lit-all.min.js";import"../Icon.js";export default class a extends t{static properties={active:{type:Boolean,state:!0}};constructor(){super(),this.active=!0}connectedCallback(){super.connectedCallback();const t=this.editor;t&&(this.active=t.wordWrap,this.wordWrapHandler=t=>{this.active=t.detail.wordWrap},t.addEventListener("word-wrap-changed",this.wordWrapHandler))}disconnectedCallback(){super.disconnectedCallback(),this.editor?.removeEventListener("word-wrap-changed",this.wordWrapHandler),this.wordWrapHandler=null}handleClick=()=>{this.editor?.toggleWordWrap()};static styles=[t.styles,r`
|
|
2
|
-
:host { display: inline-flex; }
|
|
3
|
-
button.active { background: var(--primary-bg, rgba(0,120,212,0.15)); }
|
|
4
|
-
`];render(){return e`
|
|
5
|
-
<button class="${this.buttonClasses} ${this.active?"active":""}" @click="${this.handleClick}" title="Word Wrap">
|
|
6
|
-
<k-icon name="wrap_text"></k-icon>
|
|
7
|
-
</button>
|
|
8
|
-
`}}customElements.define("k-cec-word-wrap",a);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import t from"./HtmlEditorControl.js";import{html as e,css as i}from"../../lit-all.min.js";import"../Icon.js";export default class o extends t{static properties={editorMode:{type:String,state:!0}};static styles=[t.styles,i`
|
|
2
|
-
:host {
|
|
3
|
-
display: inline-flex;
|
|
4
|
-
}
|
|
5
|
-
`];connectedCallback(){super.connectedCallback(),this.updateEditorMode(),this.editor?.addEventListener("mode-changed",()=>this.updateEditorMode())}handleClick=()=>{this.editor&&this.editor.alignCenter()};updateEditorMode(){this.editor&&(this.editorMode=this.editor.mode)}render(){return this.hidden="code"===this.editorMode,e`
|
|
6
|
-
<button class="${this.buttonClasses}" @click="${this.handleClick}">
|
|
7
|
-
<slot name="icon">
|
|
8
|
-
<k-icon name="format_align_center"></k-icon>
|
|
9
|
-
</slot>
|
|
10
|
-
<slot></slot>
|
|
11
|
-
</button>
|
|
12
|
-
`}}customElements.define("k-hec-align-center",o);
|