@greypan/web-ui 1.1.1 → 1.2.1
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/dist/components/back-top/index.js +15 -18
- package/dist/components/back-top/index.js.map +1 -1
- package/dist/components/button/index.js +14 -17
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/layout/index.js +8 -11
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/svg-draw-lines/index.js +13 -16
- package/dist/components/svg-draw-lines/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.js +25 -25
- package/dist/types/react.d.ts +4 -4
- package/dist/types/vue.d.ts +4 -4
- package/package.json +24 -5
- package/.turbo/turbo-build.log +0 -44
- package/.turbo/turbo-test.log +0 -14
- package/CHANGELOG.md +0 -28
- package/dist/node_modules/.pnpm/iconify-icon@3.0.2/node_modules/iconify-icon/dist/iconify-icon.js +0 -1219
- package/dist/node_modules/.pnpm/iconify-icon@3.0.2/node_modules/iconify-icon/dist/iconify-icon.js.map +0 -1
- package/dist/node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js +0 -33
- package/dist/node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js.map +0 -1
- package/dist/node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/lit-html.js +0 -233
- package/dist/node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/lit-html.js.map +0 -1
- package/dist/node_modules/.pnpm/lit@3.3.3/node_modules/lit/index.js +0 -5
- package/public/vite.svg +0 -1
- package/src/assets/common.css +0 -18
- package/src/components/back-top/index.ts +0 -124
- package/src/components/back-top/style.css +0 -25
- package/src/components/button/index.ts +0 -28
- package/src/components/button/style.css +0 -52
- package/src/components/layout/__tests__/layout.spec.ts +0 -7
- package/src/components/layout/index.ts +0 -26
- package/src/components/layout/style.css +0 -50
- package/src/components/svg-draw-lines/index.ts +0 -127
- package/src/components/svg-draw-lines/style.css +0 -21
- package/src/index.ts +0 -4
- package/src/types/react.ts +0 -30
- package/src/types/utils.ts +0 -14
- package/src/types/vue.ts +0 -27
- package/tsconfig.app.json +0 -14
- package/tsconfig.json +0 -8
- package/tsconfig.node.json +0 -18
- package/tsconfig.vitest.json +0 -10
- package/vite.config.ts +0 -40
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import "../../node_modules/.pnpm
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { LitElement as n } from "../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";
|
|
5
|
-
import "../../node_modules/.pnpm/lit@3.3.3/node_modules/lit/index.js";
|
|
6
|
-
import { customElement as r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
7
|
-
import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js";
|
|
8
|
-
import { state as a } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.js";
|
|
1
|
+
import { customElement as e } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
2
|
+
import { property as t } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js";
|
|
3
|
+
import { state as n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.js";
|
|
9
4
|
import "../../node_modules/.pnpm/lit@3.3.3/node_modules/lit/decorators.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
5
|
+
import r from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
6
|
+
import i from "./style.js";
|
|
7
|
+
import "iconify-icon";
|
|
8
|
+
import { LitElement as a, html as o, unsafeCSS as s } from "lit";
|
|
12
9
|
import { getRootScrollTop as c } from "@greypan/browser-kit";
|
|
13
10
|
//#region src/components/back-top/index.ts
|
|
14
|
-
var l = class extends
|
|
11
|
+
var l = class extends a {
|
|
15
12
|
constructor(...e) {
|
|
16
13
|
super(...e), this.smooth = !0, this.threshold = 200, this.visible = !1, this.scrollTarget = window;
|
|
17
14
|
}
|
|
18
15
|
static {
|
|
19
|
-
this.styles =
|
|
16
|
+
this.styles = s(i);
|
|
20
17
|
}
|
|
21
18
|
connectedCallback() {
|
|
22
19
|
super.connectedCallback(), this.computeVisible(), this.onScrollTarget();
|
|
@@ -59,7 +56,7 @@ var l = class extends n {
|
|
|
59
56
|
e.key == "Enter" && (e.preventDefault(), this.toTop());
|
|
60
57
|
}
|
|
61
58
|
render() {
|
|
62
|
-
return
|
|
59
|
+
return o`
|
|
63
60
|
<div role="button" tabindex="0" @click=${this.toTop} @keydown=${this.onEnter}>
|
|
64
61
|
<slot>
|
|
65
62
|
<!-- 默认 slot 加上 tabindex="-1",防止双重 focus -->
|
|
@@ -71,19 +68,19 @@ var l = class extends n {
|
|
|
71
68
|
`;
|
|
72
69
|
}
|
|
73
70
|
};
|
|
74
|
-
|
|
71
|
+
r([t({
|
|
75
72
|
type: Boolean,
|
|
76
73
|
reflect: !0
|
|
77
|
-
})], l.prototype, "smooth", void 0),
|
|
74
|
+
})], l.prototype, "smooth", void 0), r([t({
|
|
78
75
|
type: Number,
|
|
79
76
|
reflect: !0
|
|
80
|
-
})], l.prototype, "threshold", void 0),
|
|
77
|
+
})], l.prototype, "threshold", void 0), r([t({
|
|
81
78
|
type: Boolean,
|
|
82
79
|
reflect: !0
|
|
83
|
-
})], l.prototype, "visible", void 0),
|
|
80
|
+
})], l.prototype, "visible", void 0), r([t({
|
|
84
81
|
type: Object,
|
|
85
82
|
attribute: !1
|
|
86
|
-
})], l.prototype, "scrollTarget", void 0),
|
|
83
|
+
})], l.prototype, "scrollTarget", void 0), r([n()], l.prototype, "eventController", void 0), l = r([e("web-ui-back-top")], l);
|
|
87
84
|
//#endregion
|
|
88
85
|
export { l as WebUiBackTop };
|
|
89
86
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/back-top/index.ts"],"sourcesContent":["import 'iconify-icon'\nimport '@/components/button'\nimport { getRootScrollTop } from '@greypan/browser-kit'\nimport { html, LitElement, type PropertyValues, unsafeCSS } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-back-top')\nexport class WebUiBackTop extends LitElement {\n static styles = unsafeCSS(style)\n\n @property({ type: Boolean, reflect: true }) smooth = true\n @property({ type: Number, reflect: true }) threshold: number = 200\n @property({ type: Boolean, reflect: true }) visible = false\n @property({ type: Object, attribute: false }) scrollTarget: HTMLElement | Window = window\n\n @state() private eventController?: AbortController\n\n override connectedCallback() {\n super.connectedCallback()\n this.computeVisible()\n this.onScrollTarget()\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback()\n this.eventController?.abort()\n }\n\n protected override willUpdate(props: PropertyValues) {\n super.willUpdate(props)\n\n if (props.has('threshold') || props.has('scrollTarget')) {\n this.computeVisible()\n }\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/back-top/index.ts"],"sourcesContent":["import 'iconify-icon'\nimport '@/components/button'\nimport { getRootScrollTop } from '@greypan/browser-kit'\nimport { html, LitElement, type PropertyValues, unsafeCSS } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-back-top')\nexport class WebUiBackTop extends LitElement {\n static styles = unsafeCSS(style)\n\n @property({ type: Boolean, reflect: true }) smooth = true\n @property({ type: Number, reflect: true }) threshold: number = 200\n @property({ type: Boolean, reflect: true }) visible = false\n @property({ type: Object, attribute: false }) scrollTarget: HTMLElement | Window = window\n\n @state() private eventController?: AbortController\n\n override connectedCallback() {\n super.connectedCallback()\n this.computeVisible()\n this.onScrollTarget()\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback()\n this.eventController?.abort()\n }\n\n protected override willUpdate(props: PropertyValues) {\n super.willUpdate(props)\n\n if (props.has('threshold') || props.has('scrollTarget')) {\n this.computeVisible()\n }\n if (props.has('scrollTarget') && this.hasUpdated) {\n this.onScrollTarget()\n }\n }\n\n private get target() {\n if (!this.scrollTarget) {\n return window\n }\n const isRoot =\n this.scrollTarget === window ||\n this.scrollTarget === document.documentElement ||\n this.scrollTarget === document.body\n return isRoot ? window : this.scrollTarget\n }\n\n private onScrollTarget() {\n this.eventController?.abort()\n this.eventController = new AbortController()\n\n this.target.addEventListener(\n 'scroll',\n () => {\n this.computeVisible()\n },\n {\n signal: this.eventController.signal,\n passive: true\n }\n )\n }\n\n private computeVisible() {\n const { target } = this\n let nextVisible: boolean\n if (target === window) {\n nextVisible = getRootScrollTop() >= this.threshold\n } else if (target instanceof HTMLElement) {\n nextVisible = target.scrollTop >= this.threshold\n } else {\n throw new Error('Prop scrollTarget must be HTMLElement or Window.')\n }\n if (nextVisible !== this.visible) {\n this.visible = nextVisible\n this.dispatchEvent(\n new CustomEvent('visible-change', {\n detail: { visible: nextVisible },\n bubbles: true,\n composed: true\n })\n )\n }\n }\n\n toTop() {\n this.target.scrollTo({\n top: 0,\n behavior: this.smooth ? 'smooth' : 'auto'\n })\n }\n\n private onEnter(e: KeyboardEvent) {\n if ((e as KeyboardEvent).key == 'Enter') {\n e.preventDefault()\n this.toTop()\n }\n }\n\n render() {\n return html`\n <div role=\"button\" tabindex=\"0\" @click=${this.toTop} @keydown=${this.onEnter}>\n <slot>\n <!-- 默认 slot 加上 tabindex=\"-1\",防止双重 focus -->\n <web-ui-button tabindex=\"-1\" icon>\n <iconify-icon icon=\"octicon:move-to-top-16\" width=\"16\" height=\"16\"></iconify-icon>\n </web-ui-button>\n </slot>\n </div>\n `\n }\n}\n\nexport interface WebUiBackTop {\n readonly $events: {\n 'visible-change': CustomEvent<{ visible: boolean }>\n }\n}\n"],"mappings":";;;;;;;;;;AASO,IAAA,IAAA,cAA2B,EAAW;;6BAGU,qBACU,oBACT,wBAC6B;;;gBALnE,EAAU,CAAK;;CAS/B,oBAA6B;EAG3B,AAFA,MAAM,kBAAkB,GACxB,KAAK,eAAe,GACpB,KAAK,eAAe;CACtB;CAEA,uBAAgC;EAE9B,AADA,MAAM,qBAAqB,GAC3B,KAAK,iBAAiB,MAAM;CAC9B;CAEA,WAA8B,GAAuB;EAMnD,AALA,MAAM,WAAW,CAAK,IAElB,EAAM,IAAI,WAAW,KAAK,EAAM,IAAI,cAAc,MACpD,KAAK,eAAe,GAElB,EAAM,IAAI,cAAc,KAAK,KAAK,cACpC,KAAK,eAAe;CAExB;CAEA,IAAY,SAAS;EAQnB,OAPK,KAAK,eAIR,KAAK,iBAAiB,UACtB,KAAK,iBAAiB,SAAS,mBAC/B,KAAK,iBAAiB,SAAS,OACjB,SAAS,KAAK,eANrB;CAOX;CAEA,iBAAyB;EAIvB,AAHA,KAAK,iBAAiB,MAAM,GAC5B,KAAK,kBAAkB,IAAI,gBAAgB,GAE3C,KAAK,OAAO,iBACV,gBACM;GACJ,KAAK,eAAe;EACtB,GACA;GACE,QAAQ,KAAK,gBAAgB;GAC7B,SAAS;EACX,CACF;CACF;CAEA,iBAAyB;EACvB,IAAM,EAAE,cAAW,MACf;EACJ,IAAI,MAAW,QACb,IAAc,EAAiB,KAAK,KAAK;OACpC,IAAI,aAAkB,aAC3B,IAAc,EAAO,aAAa,KAAK;OAEvC,MAAU,MAAM,kDAAkD;EAEpE,AAAI,MAAgB,KAAK,YACvB,KAAK,UAAU,GACf,KAAK,cACH,IAAI,YAAY,kBAAkB;GAChC,QAAQ,EAAE,SAAS,EAAY;GAC/B,SAAS;GACT,UAAU;EACZ,CAAC,CACH;CAEJ;CAEA,QAAQ;EACN,KAAK,OAAO,SAAS;GACnB,KAAK;GACL,UAAU,KAAK,SAAS,WAAW;EACrC,CAAC;CACH;CAEA,QAAgB,GAAkB;EAChC,AAAK,EAAoB,OAAO,YAC9B,EAAE,eAAe,GACjB,KAAK,MAAM;CAEf;CAEA,SAAS;EACP,OAAO,CAAI;+CACgC,KAAK,MAAM,YAAY,KAAK,QAAQ;;;;;;;;;CASjF;AACF;GAxGG,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,MACzC,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,MACxC,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,MACzC,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAM,CAAC,CAAA,GAAA,EAAA,WAAA,gBAAA,KAAA,CAAA,MAE3C,EAAM,CAAA,GAAA,EAAA,WAAA,mBAAA,KAAA,CAAA,UATR,EAAc,iBAAiB,CAAA,GAAA,CAAA"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { LitElement as n } from "../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";
|
|
4
|
-
import "../../node_modules/.pnpm/lit@3.3.3/node_modules/lit/index.js";
|
|
5
|
-
import { customElement as r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
6
|
-
import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js";
|
|
1
|
+
import { customElement as e } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
2
|
+
import { property as t } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js";
|
|
7
3
|
import "../../node_modules/.pnpm/lit@3.3.3/node_modules/lit/decorators.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
4
|
+
import n from "./style.js";
|
|
5
|
+
import r from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
6
|
+
import { LitElement as i, html as a, unsafeCSS as o } from "lit";
|
|
10
7
|
//#region src/components/button/index.ts
|
|
11
|
-
var s = class extends
|
|
8
|
+
var s = class extends i {
|
|
12
9
|
constructor(...e) {
|
|
13
10
|
super(...e), this.full = !1, this.primary = !1, this.text = !1, this.icon = !1;
|
|
14
11
|
}
|
|
15
12
|
static {
|
|
16
|
-
this.styles =
|
|
13
|
+
this.styles = o(n);
|
|
17
14
|
}
|
|
18
15
|
render() {
|
|
19
|
-
return
|
|
16
|
+
return a`
|
|
20
17
|
<button>
|
|
21
|
-
${this.icon ?
|
|
18
|
+
${this.icon ? a`<slot></slot>` : a`
|
|
22
19
|
<slot name="prefix"></slot>
|
|
23
20
|
<slot></slot>
|
|
24
21
|
<slot name="suffix"></slot>
|
|
@@ -27,19 +24,19 @@ var s = class extends n {
|
|
|
27
24
|
`;
|
|
28
25
|
}
|
|
29
26
|
};
|
|
30
|
-
|
|
27
|
+
r([t({
|
|
31
28
|
type: Boolean,
|
|
32
29
|
reflect: !0
|
|
33
|
-
})], s.prototype, "full", void 0),
|
|
30
|
+
})], s.prototype, "full", void 0), r([t({
|
|
34
31
|
type: Boolean,
|
|
35
32
|
reflect: !0
|
|
36
|
-
})], s.prototype, "primary", void 0),
|
|
33
|
+
})], s.prototype, "primary", void 0), r([t({
|
|
37
34
|
type: Boolean,
|
|
38
35
|
reflect: !0
|
|
39
|
-
})], s.prototype, "text", void 0),
|
|
36
|
+
})], s.prototype, "text", void 0), r([t({
|
|
40
37
|
type: Boolean,
|
|
41
38
|
reflect: !0
|
|
42
|
-
})], s.prototype, "icon", void 0), s =
|
|
39
|
+
})], s.prototype, "icon", void 0), s = r([e("web-ui-button")], s);
|
|
43
40
|
//#endregion
|
|
44
41
|
export { s as WebUiButton };
|
|
45
42
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/button/index.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-button')\nexport class WebUiButton extends LitElement {\n static styles = unsafeCSS(style)\n\n @property({ type: Boolean, reflect: true }) full = false\n @property({ type: Boolean, reflect: true }) primary = false\n @property({ type: Boolean, reflect: true }) text = false\n @property({ type: Boolean, reflect: true }) icon = false\n\n render() {\n return html`\n <button>\n ${this.icon\n ? html`<slot></slot>`\n : html`\n <slot name=\"prefix\"></slot>\n <slot></slot>\n <slot name=\"suffix\"></slot>\n `}\n </button>\n `\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/button/index.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-button')\nexport class WebUiButton extends LitElement {\n static styles = unsafeCSS(style)\n\n @property({ type: Boolean, reflect: true }) full = false\n @property({ type: Boolean, reflect: true }) primary = false\n @property({ type: Boolean, reflect: true }) text = false\n @property({ type: Boolean, reflect: true }) icon = false\n\n render() {\n return html`\n <button>\n ${this.icon\n ? html`<slot></slot>`\n : html`\n <slot name=\"prefix\"></slot>\n <slot></slot>\n <slot name=\"suffix\"></slot>\n `}\n </button>\n `\n }\n}\n"],"mappings":";;;;;;;AAMO,IAAA,IAAA,cAA0B,EAAW;;2BAGS,mBACG,gBACH,gBACA;;;gBALnC,EAAU,CAAK;;CAO/B,SAAS;EACP,OAAO,CAAI;;UAEL,KAAK,OACH,CAAI,kBACJ,CAAI;;;;cAIF;;;CAGZ;AACF;GAlBG,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,MACzC,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,MACzC,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,MACzC,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,UAP3C,EAAc,eAAe,CAAA,GAAA,CAAA"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { html as t } from "../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/lit-html.js";
|
|
3
|
-
import { LitElement as n } from "../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";
|
|
4
|
-
import "../../node_modules/.pnpm/lit@3.3.3/node_modules/lit/index.js";
|
|
5
|
-
import { customElement as r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
1
|
+
import { customElement as e } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
6
2
|
import "../../node_modules/.pnpm/lit@3.3.3/node_modules/lit/decorators.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
3
|
+
import t from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
4
|
+
import n from "./style.js";
|
|
5
|
+
import { LitElement as r, html as i, unsafeCSS as a } from "lit";
|
|
9
6
|
//#region src/components/layout/index.ts
|
|
10
|
-
var o = class extends
|
|
7
|
+
var o = class extends r {
|
|
11
8
|
static {
|
|
12
|
-
this.styles =
|
|
9
|
+
this.styles = a(n);
|
|
13
10
|
}
|
|
14
11
|
render() {
|
|
15
|
-
return
|
|
12
|
+
return i`
|
|
16
13
|
<header>
|
|
17
14
|
<slot name="header"></slot>
|
|
18
15
|
</header>
|
|
@@ -28,7 +25,7 @@ var o = class extends n {
|
|
|
28
25
|
`;
|
|
29
26
|
}
|
|
30
27
|
};
|
|
31
|
-
o =
|
|
28
|
+
o = t([e("web-ui-layout")], o);
|
|
32
29
|
//#endregion
|
|
33
30
|
export { o as WebUiLayout };
|
|
34
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/layout/index.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-layout')\nexport class WebUiLayout extends LitElement {\n static styles = unsafeCSS(style)\n\n render() {\n return html`\n <header>\n <slot name=\"header\"></slot>\n </header>\n <main>\n <slot></slot>\n </main>\n <aside>\n <div class=\"menu\"><slot name=\"sidebar\"></slot></div>\n </aside>\n <footer>\n <slot name=\"tabbar\"></slot>\n </footer>\n `\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/layout/index.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-layout')\nexport class WebUiLayout extends LitElement {\n static styles = unsafeCSS(style)\n\n render() {\n return html`\n <header>\n <slot name=\"header\"></slot>\n </header>\n <main>\n <slot></slot>\n </main>\n <aside>\n <div class=\"menu\"><slot name=\"sidebar\"></slot></div>\n </aside>\n <footer>\n <slot name=\"tabbar\"></slot>\n </footer>\n `\n }\n}\n"],"mappings":";;;;;;AAMO,IAAA,IAAA,cAA0B,EAAW;;gBAC1B,EAAU,CAAK;;CAE/B,SAAS;EACP,OAAO,CAAI;;;;;;;;;;;;;;CAcb;AACF;OApBC,EAAc,eAAe,CAAA,GAAA,CAAA"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "../../node_modules/.pnpm
|
|
5
|
-
import { customElement as r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
6
|
-
import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js";
|
|
7
|
-
import { state as a } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.js";
|
|
8
|
-
import { query as o } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/query.js";
|
|
1
|
+
import { customElement as e } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
2
|
+
import { property as t } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js";
|
|
3
|
+
import { state as n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.js";
|
|
4
|
+
import { query as r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/query.js";
|
|
9
5
|
import "../../node_modules/.pnpm/lit@3.3.3/node_modules/lit/decorators.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
6
|
+
import i from "../../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js";
|
|
7
|
+
import a from "./style.js";
|
|
8
|
+
import { LitElement as o, html as s, unsafeCSS as c } from "lit";
|
|
12
9
|
//#region src/components/svg-draw-lines/index.ts
|
|
13
|
-
var l = class extends
|
|
10
|
+
var l = class extends o {
|
|
14
11
|
constructor(...e) {
|
|
15
12
|
super(...e), this.duration = 1e3, this.easing = "linear", this.isAnimating = !1, this.svgClone = null;
|
|
16
13
|
}
|
|
17
14
|
static {
|
|
18
|
-
this.styles =
|
|
15
|
+
this.styles = c(a);
|
|
19
16
|
}
|
|
20
17
|
handleSlotChange() {
|
|
21
18
|
this.isAnimating || (this.cloneOriginalSvg(), this.isAnimating = !0, this.startAnimation());
|
|
@@ -74,19 +71,19 @@ var l = class extends n {
|
|
|
74
71
|
this.isAnimating = !1, this.svgClone = null;
|
|
75
72
|
}
|
|
76
73
|
render() {
|
|
77
|
-
return
|
|
74
|
+
return s`
|
|
78
75
|
<slot ?hidden="${this.isAnimating}" @slotchange="${this.handleSlotChange}"></slot>
|
|
79
76
|
${this.isAnimating ? this.svgClone : ""}
|
|
80
77
|
`;
|
|
81
78
|
}
|
|
82
79
|
};
|
|
83
|
-
|
|
80
|
+
i([t({
|
|
84
81
|
type: Number,
|
|
85
82
|
reflect: !0
|
|
86
|
-
})], l.prototype, "duration", void 0),
|
|
83
|
+
})], l.prototype, "duration", void 0), i([t({
|
|
87
84
|
type: String,
|
|
88
85
|
reflect: !0
|
|
89
|
-
})], l.prototype, "easing", void 0),
|
|
86
|
+
})], l.prototype, "easing", void 0), i([n()], l.prototype, "isAnimating", void 0), i([n()], l.prototype, "svgClone", void 0), i([r("slot")], l.prototype, "slotEl", void 0), l = i([e("web-ui-svg-draw-lines")], l);
|
|
90
87
|
//#endregion
|
|
91
88
|
export { l as WebUiSvgDrawLines };
|
|
92
89
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/svg-draw-lines/index.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-svg-draw-lines')\nexport class WebUiSvgDrawLines extends LitElement {\n static styles = unsafeCSS(style)\n\n @property({ type: Number, reflect: true }) duration = 1000\n @property({ type: String, reflect: true }) easing = 'linear'\n\n @state() private isAnimating = false\n @state() private svgClone: SVGSVGElement | null = null\n @query('slot') private slotEl!: HTMLSlotElement\n\n private handleSlotChange() {\n if (this.isAnimating) return\n\n this.cloneOriginalSvg()\n\n this.isAnimating = true\n void this.startAnimation()\n }\n\n private cloneOriginalSvg() {\n const original = this.slotEl.assignedElements({ flatten: true })[0]\n if (!(original instanceof SVGSVGElement)) return\n\n const svgClone = original.cloneNode(true) as SVGSVGElement\n svgClone.classList.add('svg-clone')\n this.svgClone = svgClone\n }\n\n private async startAnimation() {\n if (!this.svgClone) return\n await this.updateComplete\n\n const selectors = 'path, rect, circle, line, polyline, polygon, ellipse'\n const elements = Array.from(this.svgClone.querySelectorAll(selectors)) as SVGGeometryElement[]\n\n const animTasks: SVGGeometryElement[] = []\n let cursor = { x: 0, y: 0 }\n\n // 除 path 外其余几何图形无需额外处理\n // 将绘制多段路径的单 path 先拆分为多 path 并重新插入 dom\n // 再分别计算每个 path 的 total length\n elements.forEach(el => {\n if (el instanceof SVGPathElement) {\n const d = el.getAttribute('d') || ''\n const segments = d.split(/(?=[Mm])/).filter(s => s.trim())\n\n // 无论是一段还是多段,统一处理\n segments.forEach(seg => {\n const pathPart = segments.length > 1 ? (el.cloneNode() as SVGPathElement) : el\n let finalD = seg.startsWith('m') ? `M${cursor.x} ${cursor.y}${seg}` : seg\n\n finalD = this.fixPathGap(pathPart, finalD)\n pathPart.setAttribute('d', finalD)\n\n if (segments.length > 1) el.parentNode?.insertBefore(pathPart, el)\n\n animTasks.push(pathPart)\n\n const end = pathPart.getPointAtLength(pathPart.getTotalLength())\n cursor = { x: end.x, y: end.y }\n })\n\n if (segments.length > 1) el.remove()\n } else {\n animTasks.push(el)\n }\n })\n\n if (animTasks.length === 0) return this.stopAnimation()\n\n const promises = animTasks.map((el, i) => {\n return new Promise<void>(resolve => {\n this.drawLine(el, i, resolve)\n })\n })\n\n await Promise.all(promises)\n this.stopAnimation()\n }\n\n // 缺口修复逻辑\n // 多走 0.1px 触发渲染闭合和确定起始矢量方向\n private fixPathGap(pathEl: SVGPathElement, d: string): string {\n if (/[Zz]\\s*$/.test(d)) {\n pathEl.setAttribute('d', d)\n const p0 = pathEl.getPointAtLength(0)\n const p1 = pathEl.getPointAtLength(0.1)\n\n // 将 Z 替换为回到起点并多走 0.1px 的路径\n return d.replace(/[Zz]\\s*$/, `L${p0.x.toFixed(3)} ${p0.y.toFixed(3)} L${p1.x.toFixed(3)} ${p1.y.toFixed(3)}`)\n }\n return d\n }\n\n private drawLine(el: SVGGeometryElement, index: number, onFinish: () => void) {\n const strokeWidth = parseFloat(getComputedStyle(el).strokeWidth) || 0\n const len = el.getTotalLength() + strokeWidth\n\n el.style.strokeDasharray = `${len}`\n el.style.strokeDashoffset = `${len}`\n\n const anim = el.animate([{ strokeDashoffset: `${len}` }, { strokeDashoffset: '0' }], {\n duration: this.duration,\n easing: this.easing,\n fill: 'forwards'\n })\n anim.onfinish = onFinish\n }\n\n private stopAnimation() {\n this.isAnimating = false\n this.svgClone = null\n }\n\n render() {\n return html`\n <slot ?hidden=\"${this.isAnimating}\" @slotchange=\"${this.handleSlotChange}\"></slot>\n ${this.isAnimating ? this.svgClone : ''}\n `\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/svg-draw-lines/index.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport style from './style.css?inline'\n\n@customElement('web-ui-svg-draw-lines')\nexport class WebUiSvgDrawLines extends LitElement {\n static styles = unsafeCSS(style)\n\n @property({ type: Number, reflect: true }) duration = 1000\n @property({ type: String, reflect: true }) easing = 'linear'\n\n @state() private isAnimating = false\n @state() private svgClone: SVGSVGElement | null = null\n @query('slot') private slotEl!: HTMLSlotElement\n\n private handleSlotChange() {\n if (this.isAnimating) return\n\n this.cloneOriginalSvg()\n\n this.isAnimating = true\n void this.startAnimation()\n }\n\n private cloneOriginalSvg() {\n const original = this.slotEl.assignedElements({ flatten: true })[0]\n if (!(original instanceof SVGSVGElement)) return\n\n const svgClone = original.cloneNode(true) as SVGSVGElement\n svgClone.classList.add('svg-clone')\n this.svgClone = svgClone\n }\n\n private async startAnimation() {\n if (!this.svgClone) return\n await this.updateComplete\n\n const selectors = 'path, rect, circle, line, polyline, polygon, ellipse'\n const elements = Array.from(this.svgClone.querySelectorAll(selectors)) as SVGGeometryElement[]\n\n const animTasks: SVGGeometryElement[] = []\n let cursor = { x: 0, y: 0 }\n\n // 除 path 外其余几何图形无需额外处理\n // 将绘制多段路径的单 path 先拆分为多 path 并重新插入 dom\n // 再分别计算每个 path 的 total length\n elements.forEach(el => {\n if (el instanceof SVGPathElement) {\n const d = el.getAttribute('d') || ''\n const segments = d.split(/(?=[Mm])/).filter(s => s.trim())\n\n // 无论是一段还是多段,统一处理\n segments.forEach(seg => {\n const pathPart = segments.length > 1 ? (el.cloneNode() as SVGPathElement) : el\n let finalD = seg.startsWith('m') ? `M${cursor.x} ${cursor.y}${seg}` : seg\n\n finalD = this.fixPathGap(pathPart, finalD)\n pathPart.setAttribute('d', finalD)\n\n if (segments.length > 1) el.parentNode?.insertBefore(pathPart, el)\n\n animTasks.push(pathPart)\n\n const end = pathPart.getPointAtLength(pathPart.getTotalLength())\n cursor = { x: end.x, y: end.y }\n })\n\n if (segments.length > 1) el.remove()\n } else {\n animTasks.push(el)\n }\n })\n\n if (animTasks.length === 0) return this.stopAnimation()\n\n const promises = animTasks.map((el, i) => {\n return new Promise<void>(resolve => {\n this.drawLine(el, i, resolve)\n })\n })\n\n await Promise.all(promises)\n this.stopAnimation()\n }\n\n // 缺口修复逻辑\n // 多走 0.1px 触发渲染闭合和确定起始矢量方向\n private fixPathGap(pathEl: SVGPathElement, d: string): string {\n if (/[Zz]\\s*$/.test(d)) {\n pathEl.setAttribute('d', d)\n const p0 = pathEl.getPointAtLength(0)\n const p1 = pathEl.getPointAtLength(0.1)\n\n // 将 Z 替换为回到起点并多走 0.1px 的路径\n return d.replace(/[Zz]\\s*$/, `L${p0.x.toFixed(3)} ${p0.y.toFixed(3)} L${p1.x.toFixed(3)} ${p1.y.toFixed(3)}`)\n }\n return d\n }\n\n private drawLine(el: SVGGeometryElement, index: number, onFinish: () => void) {\n const strokeWidth = parseFloat(getComputedStyle(el).strokeWidth) || 0\n const len = el.getTotalLength() + strokeWidth\n\n el.style.strokeDasharray = `${len}`\n el.style.strokeDashoffset = `${len}`\n\n const anim = el.animate([{ strokeDashoffset: `${len}` }, { strokeDashoffset: '0' }], {\n duration: this.duration,\n easing: this.easing,\n fill: 'forwards'\n })\n anim.onfinish = onFinish\n }\n\n private stopAnimation() {\n this.isAnimating = false\n this.svgClone = null\n }\n\n render() {\n return html`\n <slot ?hidden=\"${this.isAnimating}\" @slotchange=\"${this.handleSlotChange}\"></slot>\n ${this.isAnimating ? this.svgClone : ''}\n `\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { adoptStyles as e, getCompatibleStyle as t
|
|
1
|
+
import { adoptStyles as e, getCompatibleStyle as t } from "./css-tag.js";
|
|
2
2
|
//#region ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.js
|
|
3
|
-
var { is:
|
|
3
|
+
var { is: n, defineProperty: r, getOwnPropertyDescriptor: i, getOwnPropertyNames: a, getOwnPropertySymbols: o, getPrototypeOf: s } = Object, c = globalThis, l = c.trustedTypes, u = l ? l.emptyScript : "", d = c.reactiveElementPolyfillSupport, f = (e, t) => e, p = {
|
|
4
4
|
toAttribute(e, t) {
|
|
5
5
|
switch (t) {
|
|
6
6
|
case Boolean:
|
|
7
|
-
e = e ?
|
|
7
|
+
e = e ? u : null;
|
|
8
8
|
break;
|
|
9
9
|
case Object:
|
|
10
10
|
case Array: e = e == null ? e : JSON.stringify(e);
|
|
@@ -29,30 +29,30 @@ var { is: r, defineProperty: i, getOwnPropertyDescriptor: a, getOwnPropertyNames
|
|
|
29
29
|
}
|
|
30
30
|
return n;
|
|
31
31
|
}
|
|
32
|
-
},
|
|
32
|
+
}, m = (e, t) => !n(e, t), h = {
|
|
33
33
|
attribute: !0,
|
|
34
34
|
type: String,
|
|
35
|
-
converter:
|
|
35
|
+
converter: p,
|
|
36
36
|
reflect: !1,
|
|
37
37
|
useDefault: !1,
|
|
38
|
-
hasChanged:
|
|
38
|
+
hasChanged: m
|
|
39
39
|
};
|
|
40
|
-
Symbol.metadata ??= Symbol("metadata"),
|
|
41
|
-
var
|
|
40
|
+
Symbol.metadata ??= Symbol("metadata"), c.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
41
|
+
var g = class extends HTMLElement {
|
|
42
42
|
static addInitializer(e) {
|
|
43
43
|
this._$Ei(), (this.l ??= []).push(e);
|
|
44
44
|
}
|
|
45
45
|
static get observedAttributes() {
|
|
46
46
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
47
47
|
}
|
|
48
|
-
static createProperty(e, t =
|
|
48
|
+
static createProperty(e, t = h) {
|
|
49
49
|
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
50
|
-
let n = Symbol(),
|
|
51
|
-
|
|
50
|
+
let n = Symbol(), i = this.getPropertyDescriptor(e, n, t);
|
|
51
|
+
i !== void 0 && r(this.prototype, e, i);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
static getPropertyDescriptor(e, t, n) {
|
|
55
|
-
let { get: r, set:
|
|
55
|
+
let { get: r, set: a } = i(this.prototype, e) ?? {
|
|
56
56
|
get() {
|
|
57
57
|
return this[t];
|
|
58
58
|
},
|
|
@@ -63,25 +63,25 @@ var _ = class extends HTMLElement {
|
|
|
63
63
|
return {
|
|
64
64
|
get: r,
|
|
65
65
|
set(t) {
|
|
66
|
-
let
|
|
67
|
-
|
|
66
|
+
let i = r?.call(this);
|
|
67
|
+
a?.call(this, t), this.requestUpdate(e, i, n);
|
|
68
68
|
},
|
|
69
69
|
configurable: !0,
|
|
70
70
|
enumerable: !0
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
static getPropertyOptions(e) {
|
|
74
|
-
return this.elementProperties.get(e) ??
|
|
74
|
+
return this.elementProperties.get(e) ?? h;
|
|
75
75
|
}
|
|
76
76
|
static _$Ei() {
|
|
77
|
-
if (this.hasOwnProperty(
|
|
78
|
-
let e =
|
|
77
|
+
if (this.hasOwnProperty(f("elementProperties"))) return;
|
|
78
|
+
let e = s(this);
|
|
79
79
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
80
80
|
}
|
|
81
81
|
static finalize() {
|
|
82
|
-
if (this.hasOwnProperty(
|
|
83
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
84
|
-
let e = this.properties, t = [...
|
|
82
|
+
if (this.hasOwnProperty(f("finalized"))) return;
|
|
83
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(f("properties"))) {
|
|
84
|
+
let e = this.properties, t = [...a(e), ...o(e)];
|
|
85
85
|
for (let n of t) this.createProperty(n, e[n]);
|
|
86
86
|
}
|
|
87
87
|
let e = this[Symbol.metadata];
|
|
@@ -142,14 +142,14 @@ var _ = class extends HTMLElement {
|
|
|
142
142
|
_$ET(e, t) {
|
|
143
143
|
let n = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, n);
|
|
144
144
|
if (r !== void 0 && !0 === n.reflect) {
|
|
145
|
-
let i = (n.converter?.toAttribute === void 0 ?
|
|
145
|
+
let i = (n.converter?.toAttribute === void 0 ? p : n.converter).toAttribute(t, n.type);
|
|
146
146
|
this._$Em = e, i == null ? this.removeAttribute(r) : this.setAttribute(r, i), this._$Em = null;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
_$AK(e, t) {
|
|
150
150
|
let n = this.constructor, r = n._$Eh.get(e);
|
|
151
151
|
if (r !== void 0 && this._$Em !== r) {
|
|
152
|
-
let e = n.getPropertyOptions(r), i = typeof e.converter == "function" ? { fromAttribute: e.converter } : e.converter?.fromAttribute === void 0 ?
|
|
152
|
+
let e = n.getPropertyOptions(r), i = typeof e.converter == "function" ? { fromAttribute: e.converter } : e.converter?.fromAttribute === void 0 ? p : e.converter;
|
|
153
153
|
this._$Em = r;
|
|
154
154
|
let a = i.fromAttribute(t, e.type);
|
|
155
155
|
this[r] = a ?? this._$Ej?.get(r) ?? a, this._$Em = null;
|
|
@@ -158,7 +158,7 @@ var _ = class extends HTMLElement {
|
|
|
158
158
|
requestUpdate(e, t, n, r = !1, i) {
|
|
159
159
|
if (e !== void 0) {
|
|
160
160
|
let a = this.constructor;
|
|
161
|
-
if (!1 === r && (i = this[e]), n ??= a.getPropertyOptions(e), !((n.hasChanged ??
|
|
161
|
+
if (!1 === r && (i = this[e]), n ??= a.getPropertyOptions(e), !((n.hasChanged ?? m)(i, t) || n.useDefault && n.reflect && i === this._$Ej?.get(e) && !this.hasAttribute(a._$Eu(e, n)))) return;
|
|
162
162
|
this.C(e, t, n);
|
|
163
163
|
}
|
|
164
164
|
!1 === this.isUpdatePending && (this._$ES = this._$EP());
|
|
@@ -222,8 +222,8 @@ var _ = class extends HTMLElement {
|
|
|
222
222
|
updated(e) {}
|
|
223
223
|
firstUpdated(e) {}
|
|
224
224
|
};
|
|
225
|
-
|
|
225
|
+
g.elementStyles = [], g.shadowRootOptions = { mode: "open" }, g[f("elementProperties")] = /* @__PURE__ */ new Map(), g[f("finalized")] = /* @__PURE__ */ new Map(), d?.({ ReactiveElement: g }), (c.reactiveElementVersions ??= []).push("2.1.2");
|
|
226
226
|
//#endregion
|
|
227
|
-
export {
|
|
227
|
+
export { g as ReactiveElement, e as adoptStyles, p as defaultConverter, t as getCompatibleStyle, m as notEqual };
|
|
228
228
|
|
|
229
229
|
//# sourceMappingURL=reactive-element.js.map
|
package/dist/types/react.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ type ExtractReactEvents<T> = T extends {
|
|
|
6
6
|
} ? {
|
|
7
7
|
[K in keyof E as `on${string & K}`]?: (e: E[K]) => void;
|
|
8
8
|
} : object;
|
|
9
|
-
export type
|
|
9
|
+
export type LitReactWrapper<T> = DetailedHTMLProps<ExtractProps<OmitLitBase<T>> & ExtractReactEvents<T> & HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
10
10
|
export interface WebUiComponents {
|
|
11
|
-
'web-ui-button':
|
|
12
|
-
'web-ui-back-top':
|
|
13
|
-
'web-ui-layout':
|
|
11
|
+
'web-ui-button': LitReactWrapper<WebUiButton>;
|
|
12
|
+
'web-ui-back-top': LitReactWrapper<WebUiBackTop>;
|
|
13
|
+
'web-ui-layout': LitReactWrapper<WebUiLayout>;
|
|
14
14
|
}
|
|
15
15
|
declare module 'react' {
|
|
16
16
|
namespace JSX {
|
package/dist/types/vue.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ type ExtractVueEvents<T> = T extends {
|
|
|
6
6
|
} ? {
|
|
7
7
|
[K in keyof E as `on${Capitalize<string & K>}`]?: (e: E[K]) => void;
|
|
8
8
|
} : object;
|
|
9
|
-
export type
|
|
9
|
+
export type LitVueWrapper<T> = DefineComponent<ExtractProps<OmitLitBase<T>> & ExtractVueEvents<T>>;
|
|
10
10
|
export interface WebUiComponents {
|
|
11
|
-
'web-ui-button':
|
|
12
|
-
'web-ui-back-top':
|
|
13
|
-
'web-ui-layout':
|
|
11
|
+
'web-ui-button': LitVueWrapper<WebUiButton>;
|
|
12
|
+
'web-ui-back-top': LitVueWrapper<WebUiBackTop>;
|
|
13
|
+
'web-ui-layout': LitVueWrapper<WebUiLayout>;
|
|
14
14
|
}
|
|
15
15
|
declare module 'vue' {
|
|
16
16
|
interface GlobalComponents extends WebUiComponents {
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@greypan/web-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/pan-Z2l0aHVi/mono.git"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
10
13
|
"sideEffects": [
|
|
11
14
|
"./dist/index.js",
|
|
12
15
|
"./dist/components/*/index.js",
|
|
@@ -36,15 +39,31 @@
|
|
|
36
39
|
"dependencies": {
|
|
37
40
|
"iconify-icon": "^3.0.2",
|
|
38
41
|
"lit": "^3.3.3",
|
|
39
|
-
"@greypan/browser-kit": "1.
|
|
40
|
-
"@greypan/js-kit": "1.
|
|
42
|
+
"@greypan/browser-kit": "1.4.0",
|
|
43
|
+
"@greypan/js-kit": "1.3.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"react": "^19.2.7",
|
|
47
|
+
"vue": "^3.5.39"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"react": ">=16",
|
|
51
|
+
"vue": ">=3"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"react": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"vue": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
41
60
|
},
|
|
42
61
|
"browserslist": [
|
|
43
62
|
"defaults"
|
|
44
63
|
],
|
|
64
|
+
"description": "Lit-based web components for React, Vue, and vanilla JS",
|
|
45
65
|
"scripts": {
|
|
46
|
-
"build": "
|
|
47
|
-
"build-only": "vp build",
|
|
66
|
+
"build": "vue-tsc --build && vp build",
|
|
48
67
|
"preview": "vp preview",
|
|
49
68
|
"test": "vp test run",
|
|
50
69
|
"type-check": "vue-tsc --build",
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @greypan/web-ui@1.1.1 build /home/runner/work/mono/mono/packages/web-ui
|
|
3
|
-
> run-p type-check "build-only {@}" --
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
> @greypan/web-ui@1.1.1 type-check /home/runner/work/mono/mono/packages/web-ui
|
|
7
|
-
> vue-tsc --build
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
> @greypan/web-ui@1.1.1 build-only /home/runner/work/mono/mono/packages/web-ui
|
|
11
|
-
> vp build
|
|
12
|
-
|
|
13
|
-
[36mvite v8.1.3 [32mbuilding client environment for production...[36m[39m
|
|
14
|
-
[2K
|
|
15
|
-
rendering chunks...
|
|
16
|
-
[32m
|
|
17
|
-
[36m[unplugin:dts][32m Start generate declaration files...[39m
|
|
18
|
-
[32m[36m[unplugin:dts][32m Declaration files built in 2295ms.
|
|
19
|
-
[39m
|
|
20
|
-
computing gzip size...
|
|
21
|
-
dist/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.js 0.30 kB │ gzip: 0.22 kB │ map: 0.59 kB
|
|
22
|
-
dist/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/base.js 0.32 kB │ gzip: 0.23 kB │ map: 0.64 kB
|
|
23
|
-
dist/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js 0.35 kB │ gzip: 0.23 kB │ map: 0.68 kB
|
|
24
|
-
dist/components/svg-draw-lines/style.js 0.35 kB │ gzip: 0.26 kB │ map: 0.45 kB
|
|
25
|
-
dist/index.js 0.36 kB │ gzip: 0.17 kB
|
|
26
|
-
dist/_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/decorate.js 0.51 kB │ gzip: 0.33 kB
|
|
27
|
-
dist/components/back-top/style.js 0.55 kB │ gzip: 0.31 kB │ map: 0.67 kB
|
|
28
|
-
dist/node_modules/.pnpm/lit@3.3.3/node_modules/lit/decorators.js 0.62 kB │ gzip: 0.20 kB
|
|
29
|
-
dist/components/layout/style.js 0.72 kB │ gzip: 0.41 kB │ map: 0.97 kB
|
|
30
|
-
dist/node_modules/.pnpm/lit@3.3.3/node_modules/lit/index.js 0.76 kB │ gzip: 0.32 kB
|
|
31
|
-
dist/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/query.js 0.76 kB │ gzip: 0.43 kB │ map: 1.34 kB
|
|
32
|
-
dist/components/button/style.js 0.99 kB │ gzip: 0.43 kB │ map: 1.29 kB
|
|
33
|
-
dist/components/layout/index.js 1.29 kB │ gzip: 0.50 kB │ map: 0.86 kB
|
|
34
|
-
dist/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js 1.33 kB │ gzip: 0.69 kB │ map: 2.38 kB
|
|
35
|
-
dist/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.js 1.50 kB │ gzip: 0.78 kB │ map: 2.89 kB
|
|
36
|
-
dist/node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js 1.65 kB │ gzip: 0.71 kB │ map: 2.06 kB
|
|
37
|
-
dist/components/button/index.js 1.75 kB │ gzip: 0.61 kB │ map: 1.43 kB
|
|
38
|
-
dist/components/back-top/index.js 3.72 kB │ gzip: 1.35 kB │ map: 5.15 kB
|
|
39
|
-
dist/components/svg-draw-lines/index.js 3.98 kB │ gzip: 1.50 kB │ map: 6.66 kB
|
|
40
|
-
dist/node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.js 7.85 kB │ gzip: 2.64 kB │ map: 13.43 kB
|
|
41
|
-
dist/node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/lit-html.js 9.27 kB │ gzip: 3.54 kB │ map: 17.03 kB
|
|
42
|
-
dist/node_modules/.pnpm/iconify-icon@3.0.2/node_modules/iconify-icon/dist/iconify-icon.js 29.01 kB │ gzip: 9.28 kB │ map: 97.11 kB
|
|
43
|
-
|
|
44
|
-
[32m✓ built in 2.39s[39m
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @greypan/web-ui@1.1.1 test /home/runner/work/mono/mono/packages/web-ui
|
|
3
|
-
> vp test run
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.9 [39m[90m/home/runner/work/mono/mono/packages/web-ui[39m
|
|
7
|
-
|
|
8
|
-
[32m✓[39m src/components/layout/__tests__/layout.spec.ts [2m([22m[2m1 test[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
9
|
-
|
|
10
|
-
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
11
|
-
[2m Tests [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
12
|
-
[2m Start at [22m 14:32:08
|
|
13
|
-
[2m Duration [22m 4.15s[2m (transform 69ms, setup 0ms, import 119ms, tests 12ms, environment 3.38s)[22m
|
|
14
|
-
|
package/CHANGELOG.md
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# @greypan/web-ui
|
|
2
|
-
|
|
3
|
-
## 1.1.1
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Updated dependencies [ec36e92]
|
|
8
|
-
- @greypan/js-kit@1.1.1
|
|
9
|
-
- @greypan/browser-kit@1.2.1
|
|
10
|
-
|
|
11
|
-
## 1.1.0
|
|
12
|
-
|
|
13
|
-
### Minor Changes
|
|
14
|
-
|
|
15
|
-
- 4dfde81: 完善子包依赖,修复依赖缺失
|
|
16
|
-
|
|
17
|
-
### Patch Changes
|
|
18
|
-
|
|
19
|
-
- Updated dependencies [4dfde81]
|
|
20
|
-
- @greypan/browser-kit@1.2.0
|
|
21
|
-
- @greypan/js-kit@1.1.0
|
|
22
|
-
|
|
23
|
-
## 1.0.1
|
|
24
|
-
|
|
25
|
-
### Patch Changes
|
|
26
|
-
|
|
27
|
-
- Updated dependencies
|
|
28
|
-
- @greypan/browser-kit@1.1.0
|