catsjuice / dockbar Goto Github PK
View Code? Open in Web Editor NEWA macOS-like dock component made with WebComponents
Home Page: https://dock.oooo.so
License: MIT License
A macOS-like dock component made with WebComponents
Home Page: https://dock.oooo.so
License: MIT License
Description
When formatting the HTML(usually done by VS Code's auto formatting), the component does not behave as expected. The issue occurs when the HTML is formatted with indents and newline characters. The non-formatted version of the HTML works fine, but after formatting, the functionality breaks.
Steps to reproduce
In packages/dockbar/index.html
, add a new hardcoded dock-item in the dock wrapper
<dock-wrapper class="glass" id="dock">
<dock-item><div class="my-item full flex-center">T</div></dock-item>
</dock-wrapper>
this went well as expected
Format the code above as
<dock-wrapper class="glass" id="dock">
<dock-item>
<div class="my-item full flex-center">T</div>
</dock-item>
</dock-wrapper>
Environment
Additional context
I initially encountered this issue when using VS Code, which automatically formats HTML on save. This issue could be a major inconvenience for developers who have auto-formatting enabled in their IDEs.
I tried this fantastic dockbar in React and it's my first time to use Web Component in React.
I need to add the following type definitions for better use and I still can't get the right props.
declare namespace JSX {
interface IntrinsicElements {
"dock-wrapper": any
"dock-item": any
}
}
Is it a better way that the repo offers dts files?
Or it is just my turn to add them to my repo?
In #9, it fixes the playground import in a hacked way which adds the ./dist
field of the exports
in the package.json
.
I think adding a files
field in the package.json
is a better solution.
./dist
of the publish()
in the .build.mjs
files
in the package.json
{
"files": ["dist"]
}
package.json
such as exports
, main
, module
, and types
pnpm build
and can also run npm pack --dry-run
to see the tarball contents if needAfter doing the above, I think the imports and exports are unified.
When I open the playground, the dockbar doesn't display. The error is following
It seems related to this commit 6a700ea.
So what's wrong with the export definition including dist
?
This issue is related to #1 , it's not working with direction: "vertical"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.