kempo-ui 0.4.19 → 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 +20 -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/0006-create-pagination-component.md +1 -1
- 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/tasks/0006-create-pagination-component/screenshot-01-top.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-02-controls.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-03-preconfigured.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-04-live-demo-page1.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-05-live-demo-page2.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-06-live-demo-last-page.png +0 -0
- package/tasks/0006-create-pagination-component/screenshot-07-js-reference.png +0 -0
- package/tasks/0006-create-pagination-component.md +0 -136
- package/tests/components/tableControls/TableControl.browser-test.js +0 -300
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ButtonControl from './ButtonControl.js';
|
|
2
|
+
import { html } from '../../lit-all.min.js';
|
|
3
|
+
import '../Icon.js';
|
|
4
|
+
|
|
5
|
+
export default class AlignJustify extends ButtonControl {
|
|
6
|
+
static requires = ['alignJustify'];
|
|
7
|
+
static hostMode = 'visual';
|
|
8
|
+
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
if(!this.hasAttribute('title')) this.title = 'Justify';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
handleAction() { this.host?.alignJustify?.(); }
|
|
15
|
+
|
|
16
|
+
render() { return html`<slot><k-icon name="format_align_justify"></k-icon></slot>`; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
customElements.define('kc-align-justify', AlignJustify);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ButtonControl from './ButtonControl.js';
|
|
2
|
+
import { html } from '../../lit-all.min.js';
|
|
3
|
+
import '../Icon.js';
|
|
4
|
+
|
|
5
|
+
export default class AlignLeft extends ButtonControl {
|
|
6
|
+
static requires = ['alignLeft'];
|
|
7
|
+
static hostMode = 'visual';
|
|
8
|
+
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
if(!this.hasAttribute('title')) this.title = 'Align Left';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
handleAction() { this.host?.alignLeft?.(); }
|
|
15
|
+
|
|
16
|
+
render() { return html`<slot><k-icon name="format_align_left"></k-icon></slot>`; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
customElements.define('kc-align-left', AlignLeft);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ButtonControl from './ButtonControl.js';
|
|
2
|
+
import { html } from '../../lit-all.min.js';
|
|
3
|
+
import '../Icon.js';
|
|
4
|
+
|
|
5
|
+
export default class AlignRight extends ButtonControl {
|
|
6
|
+
static requires = ['alignRight'];
|
|
7
|
+
static hostMode = 'visual';
|
|
8
|
+
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
if(!this.hasAttribute('title')) this.title = 'Align Right';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
handleAction() { this.host?.alignRight?.(); }
|
|
15
|
+
|
|
16
|
+
render() { return html`<slot><k-icon name="format_align_right"></k-icon></slot>`; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
customElements.define('kc-align-right', AlignRight);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ButtonControl from './ButtonControl.js';
|
|
2
|
+
import { html } from '../../lit-all.min.js';
|
|
3
|
+
import '../Icon.js';
|
|
4
|
+
|
|
5
|
+
export default class Bold extends ButtonControl {
|
|
6
|
+
static requires = ['bold'];
|
|
7
|
+
static hostMode = ['visual', 'write'];
|
|
8
|
+
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
if(!this.hasAttribute('title')) this.title = 'Bold';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
handleAction() { this.host?.bold?.(); }
|
|
15
|
+
|
|
16
|
+
render() { return html`<slot><k-icon name="format_bold"></k-icon></slot>`; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
customElements.define('kc-bold', Bold);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ButtonControl from './ButtonControl.js';
|
|
2
|
+
import { html } from '../../lit-all.min.js';
|
|
3
|
+
import '../Icon.js';
|
|
4
|
+
|
|
5
|
+
export default class BulletList extends ButtonControl {
|
|
6
|
+
static requires = ['bulletList'];
|
|
7
|
+
static hostMode = ['visual', 'write'];
|
|
8
|
+
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
if(!this.hasAttribute('title')) this.title = 'Bulleted List';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
handleAction() { this.host?.bulletList?.(); }
|
|
15
|
+
|
|
16
|
+
render() { return html`<slot><k-icon name="format_list_bulleted"></k-icon></slot>`; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
customElements.define('kc-bullet-list', BulletList);
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import Control from './Control.js';
|
|
2
|
+
import { css, html } from '../../lit-all.min.js';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
Base class for clickable controls. The host element IS the button —
|
|
6
|
+
no internal <button> is rendered. Subclasses override handleAction()
|
|
7
|
+
with the click behavior. Disabled state (from Control.updateHostSupport
|
|
8
|
+
or external) blocks click propagation.
|
|
9
|
+
|
|
10
|
+
Subclasses typically:
|
|
11
|
+
static requires = ['methodName']
|
|
12
|
+
handleAction() { this.host?.methodName?.(); }
|
|
13
|
+
render() { return html`<k-icon name="..."></k-icon>`; }
|
|
14
|
+
*/
|
|
15
|
+
export default class ButtonControl extends Control {
|
|
16
|
+
/*
|
|
17
|
+
Lifecycle Callbacks
|
|
18
|
+
*/
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
super.connectedCallback();
|
|
21
|
+
if(!this.hasAttribute('role')) this.setAttribute('role', 'button');
|
|
22
|
+
if(!this.hasAttribute('tabindex')) this.tabIndex = this.disabled ? -1 : 0;
|
|
23
|
+
this.setAttribute('aria-disabled', String(!!this.disabled));
|
|
24
|
+
this.addEventListener('click', this.handleClick);
|
|
25
|
+
this.addEventListener('keydown', this.handleKeyDown);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
disconnectedCallback() {
|
|
29
|
+
super.disconnectedCallback();
|
|
30
|
+
this.removeEventListener('click', this.handleClick);
|
|
31
|
+
this.removeEventListener('keydown', this.handleKeyDown);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
updated(changed) {
|
|
35
|
+
super.updated(changed);
|
|
36
|
+
if(changed.has('disabled')){
|
|
37
|
+
this.tabIndex = this.disabled ? -1 : 0;
|
|
38
|
+
this.setAttribute('aria-disabled', String(this.disabled));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/*
|
|
43
|
+
Public Methods (override in subclasses)
|
|
44
|
+
*/
|
|
45
|
+
handleAction() {}
|
|
46
|
+
|
|
47
|
+
/*
|
|
48
|
+
Event Handlers
|
|
49
|
+
*/
|
|
50
|
+
handleClick = e => {
|
|
51
|
+
if(this.disabled){
|
|
52
|
+
e.stopImmediatePropagation();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
this.handleAction();
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
handleKeyDown = e => {
|
|
59
|
+
if(this.disabled) return;
|
|
60
|
+
if(e.key === 'Enter' || e.key === ' '){
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
this.click();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
Rendering — subclasses override
|
|
68
|
+
*/
|
|
69
|
+
render() {
|
|
70
|
+
return html`<slot></slot>`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
Styles
|
|
75
|
+
*/
|
|
76
|
+
static styles = [
|
|
77
|
+
Control.styles,
|
|
78
|
+
css`
|
|
79
|
+
:host {
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
min-width: 2rem;
|
|
83
|
+
min-height: 2rem;
|
|
84
|
+
background: transparent;
|
|
85
|
+
border: 1px solid var(--c_border);
|
|
86
|
+
border-radius: var(--radius);
|
|
87
|
+
margin: var(--spacer_q);
|
|
88
|
+
padding: var(--spacer_h);
|
|
89
|
+
color: inherit;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
outline: none;
|
|
92
|
+
font-size: inherit;
|
|
93
|
+
user-select: none;
|
|
94
|
+
transition: background-color var(--animation_ms), box-shadow var(--animation_ms);
|
|
95
|
+
}
|
|
96
|
+
:host(:not([disabled]):hover) {
|
|
97
|
+
background: oklch(from var(--c_bg__inv) l c h / 0.15);
|
|
98
|
+
}
|
|
99
|
+
:host(:not([disabled]):focus),
|
|
100
|
+
:host(:not([disabled]):focus-visible) {
|
|
101
|
+
box-shadow: var(--focus_shadow);
|
|
102
|
+
z-index: 1;
|
|
103
|
+
}
|
|
104
|
+
:host([disabled]) {
|
|
105
|
+
cursor: default;
|
|
106
|
+
}
|
|
107
|
+
:host([active]) {
|
|
108
|
+
background: oklch(from var(--c_primary) l c h / 0.18);
|
|
109
|
+
}
|
|
110
|
+
`
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
customElements.define('kc-button', ButtonControl);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import Control from './Control.js';
|
|
2
|
+
import { html, css } from '../../lit-all.min.js';
|
|
3
|
+
|
|
4
|
+
export default class CharacterCount extends Control {
|
|
5
|
+
static hostEvents = ['change', 'ready'];
|
|
6
|
+
|
|
7
|
+
static properties = {
|
|
8
|
+
...Control.properties,
|
|
9
|
+
count: { type: Number, state: true }
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.count = 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
super.connectedCallback();
|
|
19
|
+
setTimeout(() => this.updateCount(), 0);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
willUpdate(changed) {
|
|
23
|
+
super.willUpdate?.(changed);
|
|
24
|
+
this.updateCount();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
updateCount() {
|
|
28
|
+
const host = this.host;
|
|
29
|
+
if(!host || typeof host.getValue !== 'function') return;
|
|
30
|
+
const val = host.getValue() || '';
|
|
31
|
+
const text = val.includes('<') ? (new DOMParser().parseFromString(val, 'text/html').body.innerText || '') : val;
|
|
32
|
+
this.count = text.length;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
render() {
|
|
36
|
+
return html`<span class="character-count"><slot name="label">Characters:</slot> ${this.count}</span>`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static styles = [
|
|
40
|
+
Control.styles,
|
|
41
|
+
css`
|
|
42
|
+
:host { align-items: center; padding: 0 0.5rem; font-size: 0.875rem; color: var(--tc_muted, #666); }
|
|
43
|
+
.character-count { display: flex; align-items: center; gap: 0.25rem; }
|
|
44
|
+
`
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
customElements.define('kc-character-count', CharacterCount);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ButtonControl from './ButtonControl.js';
|
|
2
|
+
import { html } from '../../lit-all.min.js';
|
|
3
|
+
import '../Icon.js';
|
|
4
|
+
|
|
5
|
+
export default class ClearFormatting extends ButtonControl {
|
|
6
|
+
static requires = ['removeFormat'];
|
|
7
|
+
static hostMode = 'visual';
|
|
8
|
+
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
if(!this.hasAttribute('title')) this.title = 'Clear Formatting';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
handleAction() { this.host?.removeFormat?.(); }
|
|
15
|
+
|
|
16
|
+
render() { return html`<slot><k-icon name="format_clear"></k-icon></slot>`; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
customElements.define('kc-clear-formatting', ClearFormatting);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import ButtonControl from './ButtonControl.js';
|
|
2
|
+
import { html } from '../../lit-all.min.js';
|
|
3
|
+
import '../Icon.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Toggles between paragraph and <pre> code block in visual mode.
|
|
7
|
+
Calls host.formatBlock('pre') or 'p' based on isSelectionInCodeBlock.
|
|
8
|
+
*/
|
|
9
|
+
export default class CodeBlock extends ButtonControl {
|
|
10
|
+
static requires = ['formatBlock'];
|
|
11
|
+
static hostMode = 'visual';
|
|
12
|
+
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
super.connectedCallback();
|
|
15
|
+
if(!this.hasAttribute('title')) this.title = 'Code Block';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
handleAction() {
|
|
19
|
+
const host = this.host;
|
|
20
|
+
const inCode = host?.isSelectionInCodeBlock?.();
|
|
21
|
+
host?.formatBlock?.(inCode ? 'p' : 'pre');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
render() { return html`<slot><k-icon name="code_blocks"></k-icon></slot>`; }
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
customElements.define('kc-code-block', CodeBlock);
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import ShadowComponent from '../ShadowComponent.js';
|
|
2
|
+
import { css } from '../../lit-all.min.js';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
Base class for all controls (kc-*). A control finds its host via
|
|
6
|
+
closest('[controlled]') and disables itself if the host does not
|
|
7
|
+
implement the methods declared in static requires.
|
|
8
|
+
|
|
9
|
+
Subclasses can declare:
|
|
10
|
+
static requires = ['methodName', ...] // host methods that must exist;
|
|
11
|
+
// missing → disabled
|
|
12
|
+
static hostMode = 'mode-name' // optional: only visible when
|
|
13
|
+
// host.mode === this value. If
|
|
14
|
+
// host has no `mode` property,
|
|
15
|
+
// always visible.
|
|
16
|
+
static hostEvents = ['evt', ...] // host events that trigger
|
|
17
|
+
// requestUpdate() on this control
|
|
18
|
+
|
|
19
|
+
*/
|
|
20
|
+
export default class Control extends ShadowComponent {
|
|
21
|
+
static properties = {
|
|
22
|
+
hidden: { type: Boolean, reflect: true },
|
|
23
|
+
disabled: { type: Boolean, reflect: true }
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
static requires = [];
|
|
27
|
+
static hostEvents = [];
|
|
28
|
+
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
this.hidden = false;
|
|
32
|
+
this.disabled = false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/*
|
|
36
|
+
Lifecycle Callbacks
|
|
37
|
+
*/
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
super.connectedCallback();
|
|
40
|
+
const host = this.host;
|
|
41
|
+
this.boundHost = host;
|
|
42
|
+
this.updateHostSupport();
|
|
43
|
+
if(host){
|
|
44
|
+
this.modeHandler = () => {
|
|
45
|
+
this.updateModeVisibility();
|
|
46
|
+
this.requestUpdate();
|
|
47
|
+
};
|
|
48
|
+
host.addEventListener('mode-changed', this.modeHandler);
|
|
49
|
+
this.hostEventHandler = () => this.requestUpdate();
|
|
50
|
+
for(const evt of this.constructor.hostEvents || []){
|
|
51
|
+
host.addEventListener(evt, this.hostEventHandler);
|
|
52
|
+
}
|
|
53
|
+
this.updateModeVisibility();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
disconnectedCallback() {
|
|
58
|
+
super.disconnectedCallback();
|
|
59
|
+
if(this.boundHost){
|
|
60
|
+
if(this.modeHandler) this.boundHost.removeEventListener('mode-changed', this.modeHandler);
|
|
61
|
+
if(this.hostEventHandler){
|
|
62
|
+
for(const evt of this.constructor.hostEvents || []){
|
|
63
|
+
this.boundHost.removeEventListener(evt, this.hostEventHandler);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
this.modeHandler = null;
|
|
68
|
+
this.hostEventHandler = null;
|
|
69
|
+
this.boundHost = null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
updated(changed) {
|
|
73
|
+
super.updated(changed);
|
|
74
|
+
if(changed.has('hidden')){
|
|
75
|
+
this.dispatchEvent(new CustomEvent('control_visibility_change', { bubbles: true }));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/*
|
|
80
|
+
Host Discovery & Support
|
|
81
|
+
*/
|
|
82
|
+
get host() {
|
|
83
|
+
if(this.boundHost) return this.boundHost;
|
|
84
|
+
let current = this.getRootNode();
|
|
85
|
+
while(current instanceof ShadowRoot){
|
|
86
|
+
const h = current.host;
|
|
87
|
+
const found = h?.closest?.('[controlled]') || (h?.hasAttribute?.('controlled') ? h : null);
|
|
88
|
+
if(found) return found;
|
|
89
|
+
current = h.getRootNode();
|
|
90
|
+
}
|
|
91
|
+
return this.closest('[controlled]');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
updateHostSupport() {
|
|
95
|
+
const host = this.host;
|
|
96
|
+
const required = this.constructor.requires || [];
|
|
97
|
+
const supported = host && required.every(m => typeof host[m] === 'function');
|
|
98
|
+
const shouldDisable = !supported;
|
|
99
|
+
if(this.disabled !== shouldDisable) this.disabled = shouldDisable;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
updateModeVisibility() {
|
|
103
|
+
const required = this.constructor.hostMode;
|
|
104
|
+
if(!required) return;
|
|
105
|
+
const host = this.host;
|
|
106
|
+
if(!host) return;
|
|
107
|
+
/* If the host doesn't track modes (no `mode` property), the control
|
|
108
|
+
is always visible — mode-restricted controls only filter on hosts
|
|
109
|
+
that actually have modes. */
|
|
110
|
+
if(!('mode' in host)) return;
|
|
111
|
+
const allowed = Array.isArray(required) ? required : [required];
|
|
112
|
+
const shouldHide = !allowed.includes(host.mode);
|
|
113
|
+
if(this.hidden !== shouldHide) this.hidden = shouldHide;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/*
|
|
117
|
+
Static Helpers
|
|
118
|
+
*/
|
|
119
|
+
static load = (() => {
|
|
120
|
+
const TAG_RE = /<(kc-[a-z][a-z0-9-]*|k-control-group)\b/g;
|
|
121
|
+
const loaded = new Set();
|
|
122
|
+
|
|
123
|
+
const tagToPath = (tag) => {
|
|
124
|
+
if(tag === 'k-control-group') return '../ControlGroup.js';
|
|
125
|
+
const pascal = tag.slice('kc-'.length).split('-').map(s => s.charAt(0).toUpperCase() + s.slice(1)).join('');
|
|
126
|
+
return `./${pascal}.js`;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const collectTags = (t, tags = new Set()) => {
|
|
130
|
+
if(!t) return tags;
|
|
131
|
+
if(Array.isArray(t)){ t.forEach(i => collectTags(i, tags)); return tags; }
|
|
132
|
+
if(t.strings){
|
|
133
|
+
for(const s of t.strings){
|
|
134
|
+
let m; TAG_RE.lastIndex = 0;
|
|
135
|
+
while((m = TAG_RE.exec(s)) !== null) tags.add(m[1]);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if(typeof t === 'object'){
|
|
139
|
+
for(const v of Object.values(t)){
|
|
140
|
+
if(v && (Array.isArray(v) || v.strings)) collectTags(v, tags);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return tags;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
return async (templates) => {
|
|
147
|
+
const tags = collectTags(templates);
|
|
148
|
+
const base = new URL('./', import.meta.url).href;
|
|
149
|
+
const imports = [];
|
|
150
|
+
for(const tag of tags){
|
|
151
|
+
if(loaded.has(tag)) continue;
|
|
152
|
+
loaded.add(tag);
|
|
153
|
+
imports.push(import(/* @vite-ignore */ new URL(tagToPath(tag), base).href));
|
|
154
|
+
}
|
|
155
|
+
if(imports.length) await Promise.all(imports);
|
|
156
|
+
};
|
|
157
|
+
})()
|
|
158
|
+
|
|
159
|
+
/*
|
|
160
|
+
Styles
|
|
161
|
+
*/
|
|
162
|
+
static styles = css`
|
|
163
|
+
:host {
|
|
164
|
+
display: inline-flex;
|
|
165
|
+
}
|
|
166
|
+
:host([hidden]) {
|
|
167
|
+
display: none !important;
|
|
168
|
+
}
|
|
169
|
+
:host([disabled]) {
|
|
170
|
+
opacity: 0.5;
|
|
171
|
+
pointer-events: none;
|
|
172
|
+
}
|
|
173
|
+
`;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
customElements.define('kc-control', Control);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ButtonControl from './ButtonControl.js';
|
|
2
|
+
import { html } from '../../lit-all.min.js';
|
|
3
|
+
import '../Icon.js';
|
|
4
|
+
|
|
5
|
+
export default class CopyCode extends ButtonControl {
|
|
6
|
+
static requires = ['copyToClipboard'];
|
|
7
|
+
static hostMode = 'code';
|
|
8
|
+
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
if(!this.hasAttribute('title')) this.title = 'Copy Code';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
handleAction() { this.host?.copyToClipboard?.(); }
|
|
15
|
+
|
|
16
|
+
render() { return html`<slot><k-icon name="content_copy"></k-icon></slot>`; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
customElements.define('kc-copy-code', CopyCode);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import ButtonControl from './ButtonControl.js';
|
|
2
|
+
import { html } from '../../lit-all.min.js';
|
|
3
|
+
import '../Icon.js';
|
|
4
|
+
import Dialog from '../Dialog.js';
|
|
5
|
+
|
|
6
|
+
export default class CreateLink extends ButtonControl {
|
|
7
|
+
static requires = ['createLink'];
|
|
8
|
+
static hostMode = 'visual';
|
|
9
|
+
|
|
10
|
+
connectedCallback() {
|
|
11
|
+
super.connectedCallback();
|
|
12
|
+
if(!this.hasAttribute('title')) this.title = 'Insert Link';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
handleAction() {
|
|
16
|
+
const host = this.host;
|
|
17
|
+
if(!host) return;
|
|
18
|
+
const selectedText = host.getSelectedText?.() || '';
|
|
19
|
+
|
|
20
|
+
const urlInput = document.createElement('input');
|
|
21
|
+
urlInput.type = 'text';
|
|
22
|
+
urlInput.placeholder = 'https://example.com';
|
|
23
|
+
urlInput.style.cssText = 'padding: 0.5rem; border: 1px solid var(--c_border); border-radius: var(--radius); font: inherit;';
|
|
24
|
+
|
|
25
|
+
const textInput = document.createElement('input');
|
|
26
|
+
textInput.type = 'text';
|
|
27
|
+
textInput.placeholder = 'Enter link text';
|
|
28
|
+
textInput.value = selectedText;
|
|
29
|
+
textInput.style.cssText = 'padding: 0.5rem; border: 1px solid var(--c_border); border-radius: var(--radius); font: inherit;';
|
|
30
|
+
|
|
31
|
+
const content = document.createElement('div');
|
|
32
|
+
content.className = 'p';
|
|
33
|
+
content.style.cssText = 'display: flex; flex-direction: column; gap: 1rem;';
|
|
34
|
+
content.innerHTML = `
|
|
35
|
+
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
|
|
36
|
+
<label style="font-weight: bold;">URL</label>
|
|
37
|
+
</div>
|
|
38
|
+
<div style="display: flex; flex-direction: column; gap: 0.5rem;">
|
|
39
|
+
<label style="font-weight: bold;">Link Text</label>
|
|
40
|
+
</div>
|
|
41
|
+
`;
|
|
42
|
+
content.children[0].appendChild(urlInput);
|
|
43
|
+
content.children[1].appendChild(textInput);
|
|
44
|
+
|
|
45
|
+
Dialog.create(content, {
|
|
46
|
+
title: 'Create Link',
|
|
47
|
+
cancelText: 'Cancel',
|
|
48
|
+
confirmText: 'Insert Link',
|
|
49
|
+
confirmClasses: 'success ml',
|
|
50
|
+
confirmAction: (event) => {
|
|
51
|
+
const url = urlInput.value.trim();
|
|
52
|
+
const text = textInput.value.trim();
|
|
53
|
+
if(!url){ event.keepDialogOpen = true; return; }
|
|
54
|
+
if(host.selection && (!text || text === selectedText)) host.createLink(url);
|
|
55
|
+
else host.createLinkWithText?.(url, text || url);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
render() { return html`<slot><k-icon name="link"></k-icon></slot>`; }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
customElements.define('kc-create-link', CreateLink);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import Control from './Control.js';
|
|
2
|
+
import { html, css } from '../../lit-all.min.js';
|
|
3
|
+
import '../Icon.js';
|
|
4
|
+
|
|
5
|
+
export default class EditorTheme extends Control {
|
|
6
|
+
static requires = ['setEditorTheme'];
|
|
7
|
+
static hostMode = 'code';
|
|
8
|
+
static hostEvents = ['editor-theme-changed'];
|
|
9
|
+
|
|
10
|
+
static properties = {
|
|
11
|
+
...Control.properties,
|
|
12
|
+
value: { type: String, state: true }
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.value = 'auto';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
connectedCallback() {
|
|
21
|
+
super.connectedCallback();
|
|
22
|
+
if(this.host) this.value = this.host.editorTheme || 'auto';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
willUpdate(changed) {
|
|
26
|
+
super.willUpdate?.(changed);
|
|
27
|
+
if(this.host) this.value = this.host.editorTheme || 'auto';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
handleChange = e => { this.host?.setEditorTheme?.(e.target.value); };
|
|
31
|
+
|
|
32
|
+
static styles = [
|
|
33
|
+
Control.styles,
|
|
34
|
+
css`
|
|
35
|
+
:host {
|
|
36
|
+
position: relative;
|
|
37
|
+
background-color: var(--input_bg);
|
|
38
|
+
color: var(--input_tc);
|
|
39
|
+
border: var(--input_border_width) solid var(--c_input_border);
|
|
40
|
+
border-radius: var(--radius);
|
|
41
|
+
transition: box-shadow var(--animation_ms);
|
|
42
|
+
margin-right: var(--spacer_q);
|
|
43
|
+
}
|
|
44
|
+
k-icon {
|
|
45
|
+
position: absolute;
|
|
46
|
+
left: 0.5rem;
|
|
47
|
+
top: 50%;
|
|
48
|
+
transform: translateY(-50%);
|
|
49
|
+
pointer-events: none;
|
|
50
|
+
}
|
|
51
|
+
select {
|
|
52
|
+
border: 0;
|
|
53
|
+
padding: var(--spacer_h) 1rem var(--spacer_h) 2rem;
|
|
54
|
+
min-height: 2.5rem;
|
|
55
|
+
}
|
|
56
|
+
`
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
render() {
|
|
60
|
+
return html`
|
|
61
|
+
<k-icon name="contrast"></k-icon>
|
|
62
|
+
<select .value=${this.value} @change=${this.handleChange} title="Editor Theme">
|
|
63
|
+
<option value="auto">Auto</option>
|
|
64
|
+
<option value="light">Light</option>
|
|
65
|
+
<option value="dark">Dark</option>
|
|
66
|
+
</select>
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
customElements.define('kc-editor-theme', EditorTheme);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ButtonControl from './ButtonControl.js';
|
|
2
|
+
import { html } from '../../lit-all.min.js';
|
|
3
|
+
import '../Icon.js';
|
|
4
|
+
|
|
5
|
+
export default class FindReplace extends ButtonControl {
|
|
6
|
+
static requires = ['openFind'];
|
|
7
|
+
static hostMode = 'code';
|
|
8
|
+
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
if(!this.hasAttribute('title')) this.title = 'Find & Replace';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
handleAction() { this.host?.openFind?.(); }
|
|
15
|
+
|
|
16
|
+
render() { return html`<slot><k-icon name="search"></k-icon></slot>`; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
customElements.define('kc-find-replace', FindReplace);
|