kempo-ui 0.0.43 → 0.0.63
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/.github/copilot-instructions.md +11 -0
- package/.github/workflows/publish.yml +66 -0
- package/CONTRIBUTING.md +70 -0
- package/dist/components/Dialog.js +9 -8
- package/dist/components/HtmlEditor.js +91 -0
- package/dist/components/Icon.js +2 -2
- package/dist/components/Main.js +5 -9
- package/dist/components/ShadowComponent.js +1 -1
- package/dist/components/SideMenu.js +1 -1
- package/dist/components/SidePanel.js +46 -35
- package/dist/components/htmlEditorControls/AlignCenter.js +12 -0
- package/dist/components/htmlEditorControls/AlignJustify.js +12 -0
- package/dist/components/htmlEditorControls/AlignLeft.js +12 -0
- package/dist/components/htmlEditorControls/AlignRight.js +12 -0
- package/dist/components/htmlEditorControls/Bold.js +12 -0
- package/dist/components/htmlEditorControls/BulletList.js +12 -0
- package/dist/components/htmlEditorControls/CharacterCount.js +18 -0
- package/dist/components/htmlEditorControls/ClearFormatting.js +12 -0
- package/dist/components/htmlEditorControls/CodeBlock.js +12 -0
- package/dist/components/htmlEditorControls/ControlGroup.js +14 -0
- package/dist/components/htmlEditorControls/ControlSpacer.js +6 -0
- package/dist/components/htmlEditorControls/CreateLink.js +15 -0
- package/dist/components/htmlEditorControls/DropdownControl.js +57 -0
- package/dist/components/htmlEditorControls/FormatBlock.js +12 -0
- package/dist/components/htmlEditorControls/HtmlEditorControl.js +44 -0
- package/dist/components/htmlEditorControls/InlineCode.js +12 -0
- package/dist/components/htmlEditorControls/InsertTable.js +15 -0
- package/dist/components/htmlEditorControls/Italic.js +12 -0
- package/dist/components/htmlEditorControls/Mode.js +9 -0
- package/dist/components/htmlEditorControls/NumberList.js +12 -0
- package/dist/components/htmlEditorControls/Strikethrough.js +12 -0
- package/dist/components/htmlEditorControls/TextBackgroundColor.js +97 -0
- package/dist/components/htmlEditorControls/TextColor.js +97 -0
- package/dist/components/htmlEditorControls/Underline.js +12 -0
- package/dist/components/htmlEditorControls/WordCount.js +18 -0
- package/dist/utils/formatCode.js +1 -0
- package/docs/components/dropdown.html +2 -2
- package/docs/components/html-editor.html +442 -0
- package/docs/components/icon.html +2 -7
- package/docs/components/photo-viewer.html +14 -14
- package/docs/components/side-menu.html +32 -0
- package/docs/components/side-panel-dual.html +70 -0
- package/docs/components/side-panel-scroll.html +176 -0
- package/docs/components/side-panel.html +41 -1
- package/docs/icons/arrow_drop_down.svg +1 -0
- package/docs/icons/circle.svg +1 -0
- package/docs/icons/code.svg +1 -0
- package/docs/icons/code_blocks.svg +1 -0
- package/docs/icons/copy.svg +1 -0
- package/docs/icons/dot.svg +1 -0
- package/docs/icons/format_align_center.svg +1 -0
- package/docs/icons/format_align_justify.svg +1 -0
- package/docs/icons/format_align_left.svg +1 -0
- package/docs/icons/format_align_right.svg +1 -0
- package/docs/icons/format_bold.svg +1 -0
- package/docs/icons/format_clear.svg +1 -0
- package/docs/icons/format_color_fill.svg +1 -0
- package/docs/icons/format_color_text.svg +1 -0
- package/docs/icons/format_h1.svg +1 -0
- package/docs/icons/format_h2.svg +1 -0
- package/docs/icons/format_h3.svg +1 -0
- package/docs/icons/format_h4.svg +1 -0
- package/docs/icons/format_h5.svg +1 -0
- package/docs/icons/format_h6.svg +1 -0
- package/docs/icons/format_italic.svg +1 -0
- package/docs/icons/format_list_bulleted.svg +1 -0
- package/docs/icons/format_list_numbered.svg +1 -0
- package/docs/icons/format_paragraph.svg +1 -0
- package/docs/icons/format_underlined.svg +1 -0
- package/docs/icons/help.svg +1 -0
- package/docs/icons/link.svg +1 -0
- package/docs/icons/more_vert.svg +1 -0
- package/docs/icons/strikethrough_s.svg +1 -0
- package/docs/icons/table.svg +1 -0
- package/docs/icons/wysiwyg.svg +1 -0
- package/docs/index.html +6 -0
- package/docs/nav-1.inc.html +1 -0
- package/docs/nav.inc.html +1 -0
- package/docs/src/components/Dialog.js +9 -8
- package/docs/src/components/HtmlEditor.js +91 -0
- package/docs/src/components/Icon.js +2 -2
- package/docs/src/components/Main.js +5 -9
- package/docs/src/components/ShadowComponent.js +1 -1
- package/docs/src/components/SideMenu.js +1 -1
- package/docs/src/components/SidePanel.js +46 -35
- package/docs/src/components/htmlEditorControls/AlignCenter.js +12 -0
- package/docs/src/components/htmlEditorControls/AlignJustify.js +12 -0
- package/docs/src/components/htmlEditorControls/AlignLeft.js +12 -0
- package/docs/src/components/htmlEditorControls/AlignRight.js +12 -0
- package/docs/src/components/htmlEditorControls/Bold.js +12 -0
- package/docs/src/components/htmlEditorControls/BulletList.js +12 -0
- package/docs/src/components/htmlEditorControls/CharacterCount.js +18 -0
- package/docs/src/components/htmlEditorControls/ClearFormatting.js +12 -0
- package/docs/src/components/htmlEditorControls/CodeBlock.js +12 -0
- package/docs/src/components/htmlEditorControls/ControlGroup.js +14 -0
- package/docs/src/components/htmlEditorControls/ControlSpacer.js +6 -0
- package/docs/src/components/htmlEditorControls/CreateLink.js +15 -0
- package/docs/src/components/htmlEditorControls/DropdownControl.js +57 -0
- package/docs/src/components/htmlEditorControls/FormatBlock.js +12 -0
- package/docs/src/components/htmlEditorControls/HtmlEditorControl.js +44 -0
- package/docs/src/components/htmlEditorControls/InlineCode.js +12 -0
- package/docs/src/components/htmlEditorControls/InsertTable.js +15 -0
- package/docs/src/components/htmlEditorControls/Italic.js +12 -0
- package/docs/src/components/htmlEditorControls/Mode.js +9 -0
- package/docs/src/components/htmlEditorControls/NumberList.js +12 -0
- package/docs/src/components/htmlEditorControls/Strikethrough.js +12 -0
- package/docs/src/components/htmlEditorControls/TextBackgroundColor.js +97 -0
- package/docs/src/components/htmlEditorControls/TextColor.js +97 -0
- package/docs/src/components/htmlEditorControls/Underline.js +12 -0
- package/docs/src/components/htmlEditorControls/WordCount.js +18 -0
- package/docs/src/utils/formatCode.js +1 -0
- package/icons/arrow_drop_down.svg +1 -0
- package/icons/circle.svg +1 -0
- package/icons/code.svg +1 -0
- package/icons/code_blocks.svg +1 -0
- package/icons/copy.svg +1 -0
- package/icons/dot.svg +1 -0
- package/icons/format_align_center.svg +1 -0
- package/icons/format_align_justify.svg +1 -0
- package/icons/format_align_left.svg +1 -0
- package/icons/format_align_right.svg +1 -0
- package/icons/format_bold.svg +1 -0
- package/icons/format_clear.svg +1 -0
- package/icons/format_color_fill.svg +1 -0
- package/icons/format_color_text.svg +1 -0
- package/icons/format_h1.svg +1 -0
- package/icons/format_h2.svg +1 -0
- package/icons/format_h3.svg +1 -0
- package/icons/format_h4.svg +1 -0
- package/icons/format_h5.svg +1 -0
- package/icons/format_h6.svg +1 -0
- package/icons/format_italic.svg +1 -0
- package/icons/format_list_bulleted.svg +1 -0
- package/icons/format_list_numbered.svg +1 -0
- package/icons/format_paragraph.svg +1 -0
- package/icons/format_underlined.svg +1 -0
- package/icons/help.svg +1 -0
- package/icons/link.svg +1 -0
- package/icons/more_vert.svg +1 -0
- package/icons/strikethrough_s.svg +1 -0
- package/icons/table.svg +1 -0
- package/icons/wysiwyg.svg +1 -0
- package/package.json +6 -5
- package/scripts/getIcon.js +52 -0
- package/src/components/Dialog.js +25 -10
- package/src/components/HtmlEditor.js +1548 -0
- package/src/components/Icon.js +6 -3
- package/src/components/Main.js +22 -23
- package/src/components/ShadowComponent.js +0 -1
- package/src/components/SideMenu.js +10 -0
- package/src/components/SidePanel.js +78 -37
- package/src/components/htmlEditorControls/AlignCenter.js +65 -0
- package/src/components/htmlEditorControls/AlignJustify.js +65 -0
- package/src/components/htmlEditorControls/AlignLeft.js +65 -0
- package/src/components/htmlEditorControls/AlignRight.js +65 -0
- package/src/components/htmlEditorControls/Bold.js +65 -0
- package/src/components/htmlEditorControls/BulletList.js +65 -0
- package/src/components/htmlEditorControls/CharacterCount.js +75 -0
- package/src/components/htmlEditorControls/ClearFormatting.js +65 -0
- package/src/components/htmlEditorControls/CodeBlock.js +72 -0
- package/src/components/htmlEditorControls/ControlGroup.js +95 -0
- package/src/components/htmlEditorControls/ControlSpacer.js +23 -0
- package/src/components/htmlEditorControls/CreateLink.js +121 -0
- package/src/components/htmlEditorControls/DropdownControl.js +149 -0
- package/src/components/htmlEditorControls/FormatBlock.js +108 -0
- package/src/components/htmlEditorControls/HtmlEditorControl.js +126 -0
- package/src/components/htmlEditorControls/InlineCode.js +77 -0
- package/src/components/htmlEditorControls/InsertTable.js +171 -0
- package/src/components/htmlEditorControls/Italic.js +65 -0
- package/src/components/htmlEditorControls/Mode.js +66 -0
- package/src/components/htmlEditorControls/NumberList.js +65 -0
- package/src/components/htmlEditorControls/Strikethrough.js +65 -0
- package/src/components/htmlEditorControls/TextBackgroundColor.js +195 -0
- package/src/components/htmlEditorControls/TextColor.js +195 -0
- package/src/components/htmlEditorControls/Underline.js +65 -0
- package/src/components/htmlEditorControls/WordCount.js +76 -0
- package/src/utils/formatCode.js +87 -0
- package/tests/components/Main.browser-test.js +166 -105
- package/tests/components/SidePanel.browser-test.js +62 -8
- package/.github/workflows/publish-major.yml +0 -39
- package/.github/workflows/publish-minor.yml +0 -39
- package/.github/workflows/publish-patch.yml +0 -45
- package/docs/icons/arrow-back.svg +0 -1
- package/docs/icons/arrow-down-double.svg +0 -1
- package/docs/icons/arrow-down.svg +0 -1
- package/docs/icons/arrow-forward.svg +0 -1
- package/docs/icons/arrow-menu-close.svg +0 -1
- package/docs/icons/arrow-menu-open.svg +0 -1
- package/docs/icons/arrow-right.svg +0 -1
- package/docs/icons/arrow-up-double.svg +0 -1
- package/docs/icons/arrow-up.svg +0 -1
- package/docs/icons/chevron-left.svg +0 -1
- package/docs/icons/chevron-right.svg +0 -1
- package/docs/icons/chevron-up.svg +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M200-280v-400h80v160h160v-160h80v400h-80v-160H280v160h-80Zm480 0v-320h-80v-80h160v400h-80Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M120-280v-400h80v160h160v-160h80v400h-80v-160H200v160h-80Zm400 0v-160q0-33 23.5-56.5T600-520h160v-80H520v-80h240q33 0 56.5 23.5T840-600v80q0 33-23.5 56.5T760-440H600v80h240v80H520Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M120-280v-400h80v160h160v-160h80v400h-80v-160H200v160h-80Zm400 0v-80h240v-80H600v-80h160v-80H520v-80h240q33 0 56.5 23.5T840-600v240q0 33-23.5 56.5T760-280H520Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M120-280v-400h80v160h160v-160h80v400h-80v-160H200v160h-80Zm600 0v-120H520v-280h80v200h120v-200h80v200h80v80h-80v120h-80Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M120-280v-400h80v160h160v-160h80v400h-80v-160H200v160h-80Zm400 0v-80h240v-80H520v-240h320v80H600v80h160q33 0 56.5 23.5T840-440v80q0 33-23.5 56.5T760-280H520Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M120-280v-400h80v160h160v-160h80v400h-80v-160H200v160h-80Zm480 0q-33 0-56.5-23.5T520-360v-240q0-33 23.5-56.5T600-680h240v80H600v80h160q33 0 56.5 23.5T840-440v80q0 33-23.5 56.5T760-280H600Zm0-160v80h160v-80H600Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm0-240q-33 0-56.5-23.5T120-720q0-33 23.5-56.5T200-800q33 0 56.5 23.5T280-720q0 33-23.5 56.5T200-640Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M200-120v-80h560v80H200Zm280-160q-101 0-157-63t-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63Z"/></svg>
|
package/icons/help.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M478-240q21 0 35.5-14.5T528-290q0-21-14.5-35.5T478-340q-21 0-35.5 14.5T428-290q0 21 14.5 35.5T478-240Zm-36-154h74q0-33 7.5-52t42.5-52q26-26 41-49.5t15-56.5q0-56-41-86t-97-30q-57 0-92.5 30T342-618l66 26q5-18 22.5-39t53.5-21q32 0 48 17.5t16 38.5q0 20-12 37.5T506-526q-44 39-54 59t-10 73Zm38 314q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>
|
package/icons/link.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"/></svg>
|
package/icons/table.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-480H200v480Zm80-280v-80h400v80H280Zm0 160v-80h240v80H280Z"/></svg>
|
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kempo-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.63",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Lit based web-component library",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "node scripts/build.js",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
9
|
+
"prod": "node scripts/docs.js",
|
|
10
|
+
"dev": "node scripts/docs.js --src",
|
|
11
|
+
"geticon": "node scripts/getIcon.js",
|
|
12
12
|
"test": "npx kempo-test",
|
|
13
13
|
"test:gui": "npx kempo-test --gui",
|
|
14
14
|
"test:browser": "npx kempo-test -b",
|
|
15
15
|
"test:node": "npx kempo-test -n",
|
|
16
|
-
"update-kempo-css": "node scripts/update-kempo-css.js"
|
|
16
|
+
"update-kempo-css": "node scripts/update-kempo-css.js",
|
|
17
|
+
"update-kempo-ui-cdn": "node scripts/update-kempo-ui-cdn.js"
|
|
17
18
|
},
|
|
18
19
|
"repository": {
|
|
19
20
|
"type": "git",
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { spawn } from 'child_process';
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
const iconName = process.argv[2];
|
|
10
|
+
const customName = process.argv[3];
|
|
11
|
+
|
|
12
|
+
if(!iconName){
|
|
13
|
+
console.error('Error: Please provide an icon name');
|
|
14
|
+
console.log('Usage: npm run geticon <icon_name> [custom_name]');
|
|
15
|
+
console.log('Example: npm run geticon format_bold');
|
|
16
|
+
console.log('Example: npm run geticon content_copy copy');
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const fileName = customName || iconName;
|
|
21
|
+
const url = `https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/${iconName}/default/24px.svg`;
|
|
22
|
+
const outputPath = path.join(__dirname, '..', 'icons', `${fileName}.svg`);
|
|
23
|
+
|
|
24
|
+
console.log(`Downloading ${iconName}...`);
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const response = await fetch(url);
|
|
28
|
+
|
|
29
|
+
if(!response.ok){
|
|
30
|
+
throw new Error(`Failed to fetch icon: ${response.status} ${response.statusText}`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let svgContent = await response.text();
|
|
34
|
+
|
|
35
|
+
svgContent = svgContent.replace(/ height="24"/g, '');
|
|
36
|
+
svgContent = svgContent.replace(/ width="24"/g, '');
|
|
37
|
+
svgContent = svgContent.replace(/<path d=/g, '<path fill="currentColor" d=');
|
|
38
|
+
|
|
39
|
+
await fs.writeFile(outputPath, svgContent, 'utf8');
|
|
40
|
+
|
|
41
|
+
console.log(`✓ Successfully downloaded and formatted ${fileName}.svg`);
|
|
42
|
+
console.log(` Saved to: icons/${fileName}.svg`);
|
|
43
|
+
|
|
44
|
+
console.log('\nStarting build in background...');
|
|
45
|
+
spawn('npm', ['run', 'build'], {
|
|
46
|
+
stdio: 'inherit',
|
|
47
|
+
shell: true
|
|
48
|
+
});
|
|
49
|
+
} catch(error){
|
|
50
|
+
console.error(`Error: ${error.message}`);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
package/src/components/Dialog.js
CHANGED
|
@@ -52,9 +52,23 @@ export default class Dialog extends ShadowComponent {
|
|
|
52
52
|
} else if(id === 'cancel') {
|
|
53
53
|
this.cancelAction(event);
|
|
54
54
|
if(!event.defaultPrevented) this.close();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
handleSubmit = event => {
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
this.confirmAction(event);
|
|
61
|
+
if(!event.keepDialogOpen) this.close();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
handleSlotKeydown = event => {
|
|
65
|
+
if(event.key === 'Enter' && this.confirmText) {
|
|
66
|
+
const target = event.target;
|
|
67
|
+
if(target.tagName === 'INPUT' || target.tagName === 'TEXTAREA') {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
const form = this.shadowRoot.querySelector('form');
|
|
70
|
+
if(form) form.requestSubmit();
|
|
71
|
+
}
|
|
58
72
|
}
|
|
59
73
|
}
|
|
60
74
|
|
|
@@ -227,14 +241,15 @@ export default class Dialog extends ShadowComponent {
|
|
|
227
241
|
*/
|
|
228
242
|
render() {
|
|
229
243
|
return html`
|
|
230
|
-
<button id="overlay" aria-label="Close the Dialog" @click=${this.handleClick}></button>
|
|
244
|
+
<button id="overlay" type="button" aria-label="Close the Dialog" @click=${this.handleClick}></button>
|
|
231
245
|
<div id="wrapper">
|
|
232
246
|
<k-focus-capture>
|
|
233
|
-
<
|
|
247
|
+
<form
|
|
234
248
|
id="dialog"
|
|
235
249
|
role="dialog"
|
|
236
250
|
aria-modal="true"
|
|
237
251
|
aria-labelledby="title"
|
|
252
|
+
@submit=${this.handleSubmit}
|
|
238
253
|
>
|
|
239
254
|
<div
|
|
240
255
|
id="header"
|
|
@@ -244,29 +259,29 @@ export default class Dialog extends ShadowComponent {
|
|
|
244
259
|
<slot name="title"></slot>
|
|
245
260
|
</div>
|
|
246
261
|
${this.closeBtn ? html`
|
|
247
|
-
<button id="close" @click=${this.handleClick}>
|
|
262
|
+
<button id="close" type="button" @click=${this.handleClick}>
|
|
248
263
|
<k-icon name="close"></k-icon>
|
|
249
264
|
</button>
|
|
250
265
|
` : ''}
|
|
251
266
|
</div>
|
|
252
267
|
<div id="body">
|
|
253
|
-
<slot></slot>
|
|
268
|
+
<slot @keydown=${this.handleSlotKeydown}></slot>
|
|
254
269
|
</div>
|
|
255
270
|
${this.cancelText || this.confirmText ? html`
|
|
256
271
|
<div id="footer">
|
|
257
272
|
${this.cancelText ? html`
|
|
258
|
-
<button id="cancel" class="${this.cancelClasses}" @click=${this.handleClick}>
|
|
273
|
+
<button id="cancel" type="button" class="${this.cancelClasses}" @click=${this.handleClick}>
|
|
259
274
|
${this.cancelText}
|
|
260
275
|
</button>
|
|
261
276
|
` : ''}
|
|
262
277
|
${this.confirmText ? html`
|
|
263
|
-
<button id="confirm" class="${this.confirmClasses}"
|
|
278
|
+
<button id="confirm" type="submit" class="${this.confirmClasses}">
|
|
264
279
|
${this.confirmText}
|
|
265
280
|
</button>
|
|
266
281
|
` : ''}
|
|
267
282
|
</div>
|
|
268
283
|
` : ''}
|
|
269
|
-
</
|
|
284
|
+
</form>
|
|
270
285
|
</k-focus-capture>
|
|
271
286
|
</div>
|
|
272
287
|
`;
|