Skip to content

Commit

Permalink
revert changes to define
Browse files Browse the repository at this point in the history
  • Loading branch information
SuaYoo committed Jun 12, 2024
1 parent 222e13d commit 9dafef2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 31 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"flexsearch": "^0.7.31",
"keyword-mark-element": "^0.2.0",
"lit": "^2.8.0",
"lodash": "^4.17.21",
"marked": "^4.0.10",
"mime-types": "^2.1.32",
"minimist": "^1.2.5",
Expand Down
36 changes: 7 additions & 29 deletions src/shoelace.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,8 @@
import kebabCase from "lodash/fp/kebabCase";

// Cherry-picked Shoelace components
// Import .component and register manually to avoid name collision
// See https://github.com/shoelace-style/shoelace/issues/705
import SlAlert from "@shoelace-style/shoelace/dist/components/alert/alert.component.js";
import SlButton from "@shoelace-style/shoelace/dist/components/button/button.component.js";
import SlCopyButton from "@shoelace-style/shoelace/dist/components/copy-button/copy-button.component.js";
import SlDialog from "@shoelace-style/shoelace/dist/components/dialog/dialog.component.js";
import SlDropdown from "@shoelace-style/shoelace/dist/components/dropdown/dropdown.component.js";
import SlMenu from "@shoelace-style/shoelace/dist/components/menu/menu.component.js";
import SlMenuItem from "@shoelace-style/shoelace/dist/components/menu-item/menu-item.component.js";

// Shoelace components should only be registered if needed
// to prevent issues with callers, e.g. Browsertrix.
[
SlAlert,
SlButton,
SlCopyButton,
SlDialog,
SlDropdown,
SlMenu,
SlMenuItem,
].forEach((slClass) => {
const name = kebabCase(slClass.name);

if (!customElements.get(name)) {
customElements.define(name, slClass);
}
});
import "@shoelace-style/shoelace/dist/components/alert/alert.js";
import "@shoelace-style/shoelace/dist/components/button/button.js";
import "@shoelace-style/shoelace/dist/components/copy-button/copy-button.js";
import "@shoelace-style/shoelace/dist/components/dialog/dialog.js";
import "@shoelace-style/shoelace/dist/components/dropdown/dropdown.js";
import "@shoelace-style/shoelace/dist/components/menu/menu.js";
import "@shoelace-style/shoelace/dist/components/menu-item/menu-item.js";
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3669,7 +3669,7 @@ lodash.merge@^4.6.2:
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==

lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21:
lodash@^4.17.14, lodash@^4.17.15:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down

0 comments on commit 9dafef2

Please sign in to comment.