aptechka 0.1.3 → 0.1.5
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/lib/Animated-CzBHCHNm.js +130 -0
- package/lib/Animated-DZ_fbJmi.cjs +1 -0
- package/lib/Damped--qBZAdEi.cjs +1 -0
- package/lib/Damped-Bm1kSn1f.js +36 -0
- package/lib/Derived-BS2ja9qa.js +27 -0
- package/lib/Derived-CqmIkTGN.cjs +1 -0
- package/lib/ElementConstructor-DB0xOoat.js +199 -0
- package/lib/ElementConstructor-v1FPLXAW.cjs +1 -0
- package/lib/{SourceManager-vXInLlh_.js → SourceManager-B44FUTig.js} +26 -26
- package/lib/SourceManager-D447KWpH.cjs +1 -0
- package/lib/Store-BOOfmlyv.cjs +1 -0
- package/lib/{Store-qq7IjRLE.js → Store-uTyReFzx.js} +50 -34
- package/lib/Viewport-CDqiD8Ao.cjs +1 -0
- package/lib/Viewport-Cj0i-H5d.js +129 -0
- package/lib/WheelControls-CX9WUbBC.js +83 -0
- package/lib/WheelControls-CfDeGCOU.cjs +1 -0
- package/lib/abstract-elements/AbstractButtonElement.d.ts +5 -0
- package/lib/abstract-elements/index.cjs +1 -0
- package/lib/abstract-elements/index.d.ts +1 -0
- package/lib/abstract-elements/index.js +27 -0
- package/lib/accordion/AccordionElement.d.ts +24 -1
- package/lib/accordion/index.cjs +1 -0
- package/lib/accordion/index.js +166 -0
- package/lib/animation/Animated.d.ts +9 -12
- package/lib/animation/Tweened.d.ts +1 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.d.ts +1 -1
- package/lib/animation/index.js +11 -17
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.d.ts +8 -4
- package/lib/attribute/index.js +44 -35
- package/lib/canvas/index.cjs +1 -0
- package/lib/{canvas-2d → canvas}/index.d.ts +4 -3
- package/lib/canvas/index.js +97 -0
- package/lib/connector/index.cjs +1 -0
- package/lib/connector/index.d.ts +14 -0
- package/lib/connector/index.js +53 -0
- package/lib/controls/WheelControls.d.ts +3 -2
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +23 -27
- package/lib/createStylesheet-74ZP3AZm.js +8 -0
- package/lib/createStylesheet-ChhZFwSX.cjs +1 -0
- package/lib/createTheme-BMH9cRrS.js +15 -0
- package/lib/createTheme-COo8IzPG.cjs +1 -0
- package/lib/custom-element/index.cjs +1 -1
- package/lib/custom-element/index.d.ts +3 -1
- package/lib/custom-element/index.js +19 -9
- package/lib/device/Viewport.d.ts +1 -1
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +5 -121
- package/lib/element-constructor/ElementConstructor.d.ts +11 -15
- package/lib/element-constructor/createStylesheet.d.ts +2 -0
- package/lib/element-constructor/createTheme.d.ts +12 -0
- package/lib/element-constructor/htmlTags.d.ts +115 -113
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.d.ts +2 -1
- package/lib/element-constructor/index.js +387 -1136
- package/lib/element-constructor/svgTags.d.ts +63 -63
- package/lib/element-resizer/index.cjs +1 -0
- package/lib/element-resizer/index.d.ts +9 -0
- package/lib/element-resizer/index.js +64 -0
- package/lib/en3/attachments/En3SourceManager.d.ts +2 -2
- package/lib/en3/index.cjs +7 -7
- package/lib/en3/index.js +252 -242
- package/lib/en3/objects/En3Clip.d.ts +2 -2
- package/lib/events-CoqmkUxo.js +11 -0
- package/lib/events-D68xg4dy.cjs +1 -0
- package/lib/file-EevnUtRj.cjs +1 -0
- package/lib/file-lxi_oXJf.js +13 -0
- package/lib/htmlTags-CNEFIHPp.js +683 -0
- package/lib/htmlTags-CwYHVo9n.cjs +1 -0
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +13 -20
- package/lib/index-DyJhLxk8.js +310 -0
- package/lib/index-tPw9mmLF.cjs +9 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.d.ts +2 -1
- package/lib/intersector/index.js +33 -22
- package/lib/jsx/ComponentWrapper.d.ts +12 -0
- package/lib/jsx/h.d.ts +7 -0
- package/lib/jsx/hooks.d.ts +19 -0
- package/lib/jsx/index.cjs +1 -0
- package/lib/jsx/index.d.ts +4 -0
- package/lib/jsx/index.js +125 -0
- package/lib/jsx/render.d.ts +2 -0
- package/lib/jsx/type.d.ts +185 -0
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +3 -4
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.d.ts +1 -0
- package/lib/layout-box/index.js +113 -99
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +1 -1
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +17 -20
- package/lib/modal/ModalElement.d.ts +12 -0
- package/lib/modal/index.cjs +1 -0
- package/lib/modal/index.d.ts +1 -0
- package/lib/modal/index.js +144 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +1 -1
- package/lib/number-Bo5RdrA1.js +23 -0
- package/lib/number-yVpzMdbQ.cjs +1 -0
- package/lib/popover/PopoverButtonElement.d.ts +14 -0
- package/lib/popover/PopoverElement.d.ts +19 -0
- package/lib/popover/index.cjs +1 -0
- package/lib/popover/index.d.ts +2 -0
- package/lib/popover/index.js +122 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +2 -2
- package/lib/scroll/ScrollElement.d.ts +5 -3
- package/lib/scroll/index.cjs +1 -71
- package/lib/scroll/index.js +349 -314
- package/lib/scroll-entries/index.cjs +1 -1
- package/lib/scroll-entries/index.d.ts +1 -1
- package/lib/scroll-entries/index.js +4 -2
- package/lib/select/SelectElement.d.ts +25 -0
- package/lib/select/SelectHeadElement.d.ts +12 -0
- package/lib/select/SelectOptionElement.d.ts +13 -0
- package/lib/select/SelectUserElement.d.ts +7 -0
- package/lib/select/index.cjs +1 -0
- package/lib/select/index.d.ts +4 -0
- package/lib/select/index.js +7 -0
- package/lib/source/SourceClass.d.ts +1 -1
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.js +13 -18
- package/lib/store/CumulativeResource.d.ts +2 -2
- package/lib/store/Resource.d.ts +1 -1
- package/lib/store/Store.d.ts +55 -9
- package/lib/store/StoreRegistry.d.ts +2 -2
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +2 -1
- package/lib/store/index.js +105 -66
- package/lib/string-BrDhnNUL.js +39 -0
- package/lib/string-DzUwFYSS.cjs +1 -0
- package/lib/studio/StudioElement.d.ts +3 -0
- package/lib/studio/index.cjs +10 -0
- package/lib/studio/index.js +985 -0
- package/lib/studio/studioStorage.d.ts +14 -0
- package/lib/studio/tweaker/TweakerBooleanManagerElement.d.ts +10 -0
- package/lib/studio/tweaker/TweakerColorManagerElement.d.ts +10 -0
- package/lib/studio/tweaker/TweakerElement.d.ts +17 -0
- package/lib/studio/tweaker/TweakerFieldElement.d.ts +20 -0
- package/lib/studio/tweaker/TweakerFolderElement.d.ts +22 -0
- package/lib/studio/tweaker/TweakerLinkManagerElement.d.ts +10 -0
- package/lib/studio/tweaker/TweakerNumberManagerElement.d.ts +17 -0
- package/lib/studio/tweaker/TweakerRangeManagerElement.d.ts +10 -0
- package/lib/studio/tweaker/TweakerSelectManagerElement.d.ts +10 -0
- package/lib/studio/tweaker/TweakerStoreManagerElement.d.ts +7 -0
- package/lib/studio/tweaker/TweakerStringManagerElement.d.ts +12 -0
- package/lib/studio/tweaker/tweakerManagerConstructors.d.ts +5 -0
- package/lib/style-At6aDoqG.cjs +1 -0
- package/lib/style-j2TwriJ_.js +10 -0
- package/lib/theme/index.cjs +1 -0
- package/lib/theme/index.d.ts +90 -0
- package/lib/theme/index.js +34 -0
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +1 -1
- package/lib/utils/events.d.ts +6 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +8 -7
- package/lib/utils/index.js +95 -105
- package/lib/utils/number.d.ts +2 -3
- package/lib/utils/string.d.ts +1 -0
- package/lib/utils/style.d.ts +2 -0
- package/lib/utils/ts-utility.d.ts +2 -0
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +13 -20
- package/lib/window-resizer/index.cjs +1 -0
- package/lib/window-resizer/index.d.ts +9 -0
- package/lib/window-resizer/index.js +46 -0
- package/package.json +91 -28
- package/lib/Damped-DdPj4Sho.cjs +0 -1
- package/lib/Damped-H3PuZwKV.js +0 -152
- package/lib/SourceManager-tmQlXkSD.cjs +0 -1
- package/lib/Store-txkR3wXU.cjs +0 -1
- package/lib/WheelControls-9ZQKSYYq.js +0 -83
- package/lib/WheelControls-TYhGU6oA.cjs +0 -1
- package/lib/canvas-2d/index.cjs +0 -5
- package/lib/canvas-2d/index.js +0 -90
- package/lib/element-constructor/specialObjects.d.ts +0 -2
- package/lib/measurer/CumulativeOffsetLeft.d.ts +0 -4
- package/lib/measurer/CumulativeOffsetTop.d.ts +0 -4
- package/lib/measurer/Meaurer.d.ts +0 -8
- package/lib/measurer/index.cjs +0 -1
- package/lib/measurer/index.d.ts +0 -3
- package/lib/measurer/index.js +0 -48
- package/lib/number-2bR0KBcX.cjs +0 -1
- package/lib/number-bCHB2GAD.js +0 -31
- package/lib/resizer/index.cjs +0 -1
- package/lib/resizer/index.d.ts +0 -10
- package/lib/resizer/index.js +0 -45
- package/lib/string-GmxZA5Nq.js +0 -31
- package/lib/string-WmNOGq16.cjs +0 -1
- package/lib/utils/dev.d.ts +0 -3
- /package/lib/{attributes-w0u-KiIb.js → attributes-69we3byR.js} +0 -0
- /package/lib/{attributes-_2U65GDl.cjs → attributes-Bf2svn4j.cjs} +0 -0
- /package/lib/{browser-S4eq8AeN.js → browser-0zX67oeU.js} +0 -0
- /package/lib/{browser-QbF6EW-w.cjs → browser-CpzFX2xg.cjs} +0 -0
- /package/lib/{dom-bHEwc_xV.js → dom-BY7JhTx5.js} +0 -0
- /package/lib/{dom-QhWsdQS2.cjs → dom-qY2LdCVL.cjs} +0 -0
- /package/lib/{easings-uF-tgahf.js → easings-BKi40vHz.js} +0 -0
- /package/lib/{easings-_wFs9ZWc.cjs → easings-DsS5-Kqc.cjs} +0 -0
- /package/lib/{function-zwSFehNd.js → function-C10DGppn.js} +0 -0
- /package/lib/{function-QP7IreXR.cjs → function-MthRj-GJ.cjs} +0 -0
- /package/lib/{layout-rZzbsLPd.cjs → layout-8ryRAMGJ.cjs} +0 -0
- /package/lib/{layout-5SJlcXTY.js → layout-HoBT_Da2.js} +0 -0
- /package/lib/{math-_a3IpKOc.js → math-BOBiC4TN.js} +0 -0
- /package/lib/{math-FNUBmQPK.cjs → math-GDWEqu7y.cjs} +0 -0
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
function
|
|
3
|
-
return function(
|
|
4
|
-
|
|
1
|
+
import { i as e } from "../browser-0zX67oeU.js";
|
|
2
|
+
function n(o, t) {
|
|
3
|
+
return function(s) {
|
|
4
|
+
e && !customElements.get(o) && customElements.define(o, s, { extends: t });
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
attachShadow(
|
|
7
|
+
const d = e ? window.HTMLElement : class {
|
|
8
|
+
attachShadow() {
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
-
class
|
|
11
|
+
class a extends d {
|
|
12
|
+
openShadow(...t) {
|
|
13
|
+
if (!this.shadowRoot && e) {
|
|
14
|
+
const s = this.attachShadow({ mode: "open" });
|
|
15
|
+
return this.addStylesheet(...t), s;
|
|
16
|
+
}
|
|
17
|
+
return this.shadowRoot;
|
|
18
|
+
}
|
|
19
|
+
addStylesheet(...t) {
|
|
20
|
+
this.shadowRoot && e && this.shadowRoot.adoptedStyleSheets.push(...t);
|
|
21
|
+
}
|
|
12
22
|
}
|
|
13
23
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
24
|
+
a as CustomElement,
|
|
25
|
+
n as define
|
|
16
26
|
};
|
package/lib/device/Viewport.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare class Viewport {
|
|
|
20
20
|
constructor();
|
|
21
21
|
get width(): number;
|
|
22
22
|
get height(): number;
|
|
23
|
-
get store_type(): Store<"mobile" | "tablet" | "notebook" | "desktop" | undefined, import('../store').StoreEntry<"mobile" | "tablet" | "notebook" | "desktop" | undefined>>;
|
|
23
|
+
get store_type(): Store<"mobile" | "tablet" | "notebook" | "desktop" | undefined, keyof import('../store').StoreManagers, import('../store').StoreEntry<"mobile" | "tablet" | "notebook" | "desktop" | undefined>>;
|
|
24
24
|
get pixelRatio(): number;
|
|
25
25
|
}
|
|
26
26
|
export declare const viewport: Viewport;
|
package/lib/device/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Viewport-CDqiD8Ao.cjs");exports.ViewportBreakpoints=e.ViewportBreakpoints;exports.ViewportMediaRules=e.ViewportMediaRules;exports.device=e.device;exports.viewport=e.viewport;
|
package/lib/device/index.js
CHANGED
|
@@ -1,123 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
if (!n.has(t))
|
|
3
|
-
throw TypeError("Cannot " + o);
|
|
4
|
-
};
|
|
5
|
-
var i = (t, n, o) => (W(t, n, "read from private field"), o ? o.call(t) : n.get(t)), s = (t, n, o) => {
|
|
6
|
-
if (n.has(t))
|
|
7
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
-
n instanceof WeakSet ? n.add(t) : n.set(t, o);
|
|
9
|
-
}, e = (t, n, o, v) => (W(t, n, "write to private field"), v ? v.call(t, o) : n.set(t, o), o);
|
|
10
|
-
import { RESIZE_ORDER as k } from "../order/index.js";
|
|
11
|
-
import { resizer as A } from "../resizer/index.js";
|
|
12
|
-
import { i as C } from "../browser-S4eq8AeN.js";
|
|
13
|
-
import { getGPUTier as O } from "detect-gpu";
|
|
14
|
-
import { S as I } from "../Store-qq7IjRLE.js";
|
|
15
|
-
import "../notifier/index.js";
|
|
16
|
-
import "../function-zwSFehNd.js";
|
|
17
|
-
var r, d, l, c, g, m, p, x, u;
|
|
18
|
-
class L {
|
|
19
|
-
constructor() {
|
|
20
|
-
s(this, r, "unknown");
|
|
21
|
-
s(this, d, "unknown");
|
|
22
|
-
s(this, l, 0);
|
|
23
|
-
s(this, c, null);
|
|
24
|
-
s(this, g, !1);
|
|
25
|
-
s(this, m, !1);
|
|
26
|
-
s(this, p, !1);
|
|
27
|
-
s(this, x, !1);
|
|
28
|
-
s(this, u, !1);
|
|
29
|
-
var n, o;
|
|
30
|
-
if (C) {
|
|
31
|
-
e(this, c, O()), i(this, c).then((a) => {
|
|
32
|
-
e(this, d, a.gpu || "unknown"), e(this, l, a.tier);
|
|
33
|
-
}), A.subscribe(() => {
|
|
34
|
-
e(this, g, /Mobi|Android/i.test(navigator.userAgent)), e(this, m, "ontouchstart" in window || navigator.maxTouchPoints > 0), setTimeout(() => {
|
|
35
|
-
e(this, m, "ontouchstart" in window || navigator.maxTouchPoints > 0);
|
|
36
|
-
}, 0);
|
|
37
|
-
}, k.DEVICE);
|
|
38
|
-
{
|
|
39
|
-
const a = document.createElement("canvas"), E = a.getContext("webgl") || a.getContext("experimental-webgl");
|
|
40
|
-
e(this, p, E && E instanceof WebGLRenderingContext || !1);
|
|
41
|
-
}
|
|
42
|
-
{
|
|
43
|
-
const a = document.createElement("canvas");
|
|
44
|
-
a.getContext("2d") && e(this, x, a.toDataURL("image/webp").indexOf("data:image/webp") == 0);
|
|
45
|
-
}
|
|
46
|
-
const v = window.navigator.userAgent, P = ((o = (n = window.navigator) == null ? void 0 : n.userAgentData) == null ? void 0 : o.platform) || window.navigator.platform, D = ["Macintosh", "MacIntel", "MacPPC", "Mac68K", "macOS"], S = ["Win32", "Win64", "Windows", "WinCE"], T = ["iPhone", "iPad", "iPod"];
|
|
47
|
-
D.includes(P) ? (e(this, r, "macOS"), e(this, u, !0)) : T.includes(P) ? (e(this, r, "iOS"), e(this, u, !0)) : S.includes(P) ? e(this, r, "Windows") : /Android/.test(v) ? e(this, r, "Android") : /Linux/.test(P) ? e(this, r, "Linux") : e(this, r, "unknown");
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
get OS() {
|
|
51
|
-
return i(this, r);
|
|
52
|
-
}
|
|
53
|
-
get gpu() {
|
|
54
|
-
return i(this, d);
|
|
55
|
-
}
|
|
56
|
-
get gpuTier() {
|
|
57
|
-
return i(this, l);
|
|
58
|
-
}
|
|
59
|
-
get gpuDetection() {
|
|
60
|
-
return i(this, c);
|
|
61
|
-
}
|
|
62
|
-
get isMobile() {
|
|
63
|
-
return i(this, g);
|
|
64
|
-
}
|
|
65
|
-
get isTouch() {
|
|
66
|
-
return i(this, m);
|
|
67
|
-
}
|
|
68
|
-
get isWebgl() {
|
|
69
|
-
return i(this, p);
|
|
70
|
-
}
|
|
71
|
-
get isWebp() {
|
|
72
|
-
return i(this, x);
|
|
73
|
-
}
|
|
74
|
-
get isApple() {
|
|
75
|
-
return i(this, u);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
r = new WeakMap(), d = new WeakMap(), l = new WeakMap(), c = new WeakMap(), g = new WeakMap(), m = new WeakMap(), p = new WeakMap(), x = new WeakMap(), u = new WeakMap();
|
|
79
|
-
const q = new L();
|
|
80
|
-
var M = /* @__PURE__ */ ((t) => (t.mobile = "600px", t.tablet = "1024px", t.notebook = "1280px", t.desktop = "1281px", t))(M || {}), _ = /* @__PURE__ */ ((t) => (t["<=mobile"] = "(max-width: 600px)", t[">=mobile"] = "(min-width: 601px)", t["<=tablet"] = "(max-width: 1024px)", t[">=tablet"] = "(min-width: 1025px)", t["<=notebook"] = "(max-width: 1280px)", t[">=notebook"] = "(min-width: 1281px)", t["<=desktop"] = "(max-width: 1280px)", t[">=desktop"] = "(min-width: 1281px)", t))(_ || {}), w, f, b, h;
|
|
81
|
-
class y {
|
|
82
|
-
constructor() {
|
|
83
|
-
s(this, w, 0);
|
|
84
|
-
s(this, f, 0);
|
|
85
|
-
s(this, b, 0);
|
|
86
|
-
s(this, h, new I(void 0));
|
|
87
|
-
C && A.subscribe(() => {
|
|
88
|
-
e(this, w, document.documentElement.clientWidth), e(this, f, innerHeight), e(this, b, devicePixelRatio), matchMedia(
|
|
89
|
-
"(max-width: 600px)"
|
|
90
|
-
/* <=mobile */
|
|
91
|
-
).matches ? i(this, h).current = "mobile" : matchMedia(
|
|
92
|
-
"(max-width: 1024px)"
|
|
93
|
-
/* <=tablet */
|
|
94
|
-
).matches ? i(this, h).current = "tablet" : matchMedia(
|
|
95
|
-
"(max-width: 1280px)"
|
|
96
|
-
/* <=notebook */
|
|
97
|
-
).matches ? i(this, h).current = "notebook" : matchMedia(
|
|
98
|
-
"(min-width: 1281px)"
|
|
99
|
-
/* >=desktop */
|
|
100
|
-
).matches && (i(this, h).current = "desktop");
|
|
101
|
-
}, k.DEVICE);
|
|
102
|
-
}
|
|
103
|
-
get width() {
|
|
104
|
-
return i(this, w);
|
|
105
|
-
}
|
|
106
|
-
get height() {
|
|
107
|
-
return i(this, f);
|
|
108
|
-
}
|
|
109
|
-
get store_type() {
|
|
110
|
-
return i(this, h);
|
|
111
|
-
}
|
|
112
|
-
get pixelRatio() {
|
|
113
|
-
return i(this, b);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
w = new WeakMap(), f = new WeakMap(), b = new WeakMap(), h = new WeakMap();
|
|
117
|
-
const F = new y();
|
|
1
|
+
import { V as i, a as o, d as r, v as s } from "../Viewport-Cj0i-H5d.js";
|
|
118
2
|
export {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
3
|
+
i as ViewportBreakpoints,
|
|
4
|
+
o as ViewportMediaRules,
|
|
5
|
+
r as device,
|
|
6
|
+
s as viewport
|
|
123
7
|
};
|
|
@@ -7,7 +7,7 @@ export type ElementConstructorClass = string | Array<string | ElementConstructor
|
|
|
7
7
|
[key: string]: boolean | Store<boolean>;
|
|
8
8
|
};
|
|
9
9
|
export type ElementConstructorStyleToken = Exclude<Extract<keyof CSSStyleDeclaration, string> | `--${string}`, 'length' | 'parentRule'>;
|
|
10
|
-
export type ElementConstructorStyleValue = string | Store<
|
|
10
|
+
export type ElementConstructorStyleValue = string | Store<any>;
|
|
11
11
|
export type ElementConstructorStyle = Partial<{
|
|
12
12
|
[K in ElementConstructorStyleToken]: ElementConstructorStyleValue;
|
|
13
13
|
}>;
|
|
@@ -29,31 +29,28 @@ export type ElementConstructorEvents = Partial<{
|
|
|
29
29
|
export type ElementConstructorNativeAttribute<TagName extends ElementConstructorTagNames, E = ElementConstructorTagNameMap[TagName]> = {
|
|
30
30
|
[K in keyof E]: E[K] extends string ? K : never;
|
|
31
31
|
}[keyof E];
|
|
32
|
-
type ElementConstructorAttributeValue = string | undefined | null | boolean | number | Store<string> | Store<string | undefined | null> | Store<boolean> | Store<boolean | undefined | null> | Store<number> | Store<number | undefined | null>;
|
|
33
32
|
export type ElementConstructorNativeAttributes<T extends ElementConstructorTagNames> = Partial<{
|
|
34
|
-
[K in ElementConstructorNativeAttribute<T>]:
|
|
33
|
+
[K in ElementConstructorNativeAttribute<T>]: any;
|
|
35
34
|
}>;
|
|
36
35
|
export type ElementConstructorCustomAttributes = {
|
|
37
|
-
[key: string]:
|
|
36
|
+
[key: string]: any;
|
|
38
37
|
};
|
|
39
38
|
export type ElementConstructorAttributes<T extends ElementConstructorTagNames> = ElementConstructorNativeAttributes<T> | ElementConstructorCustomAttributes;
|
|
40
|
-
export type ElementConstructorPrimitiveChild = string | number | boolean | null | undefined;
|
|
41
|
-
export type ElementConstructorSimpleChild = ElementConstructorPrimitiveChild | ElementConstructor | Node | Array<ElementConstructorPrimitiveChild> | Array<ElementConstructor> | Array<Node>;
|
|
42
|
-
export type ElementConstructorStoreChild = Store<any>;
|
|
43
|
-
export type ElementConstructorStoreChildren = Store<Array<any>>;
|
|
44
|
-
export type ElementConstructorChildren = Array<ElementConstructorSimpleChild | ElementConstructorStoreChild | ElementConstructorStoreChildren>;
|
|
45
39
|
export type ElementConstructorParent = Node | ElementConstructor;
|
|
46
|
-
export type
|
|
47
|
-
export type
|
|
40
|
+
export type ElementConstructorRefCallback<TagName extends ElementConstructorTagNames> = (element: ElementConstructorTagNameMap[TagName]) => void;
|
|
41
|
+
export type ElementConstructorRef<TagName extends ElementConstructorTagNames> = {
|
|
42
|
+
current: ElementConstructorTagNameMap[TagName];
|
|
43
|
+
};
|
|
44
|
+
export type ElementConstructorTagObject<TagName extends ElementConstructorTagNames = ElementConstructorTagNames> = {
|
|
48
45
|
class?: ElementConstructorClass;
|
|
49
46
|
style?: TagName extends 'style' ? ElementConstructorJSS : ElementConstructorStyle;
|
|
50
47
|
events?: ElementConstructorEvents;
|
|
51
48
|
attributes?: ElementConstructorAttributes<TagName>;
|
|
52
|
-
children?:
|
|
53
|
-
shadowChildren?:
|
|
49
|
+
children?: any;
|
|
50
|
+
shadowChildren?: any;
|
|
54
51
|
parent?: ElementConstructorParent;
|
|
55
52
|
svg?: boolean;
|
|
56
|
-
|
|
53
|
+
ref?: ElementConstructorRefCallback<TagName> | ElementConstructorRef<TagName>;
|
|
57
54
|
};
|
|
58
55
|
export type ElementConstructorObject = Partial<{
|
|
59
56
|
[T in ElementConstructorTagNames]: ElementConstructorTagObject<T>;
|
|
@@ -73,4 +70,3 @@ export declare function element<T extends ElementConstructorTagNames = ElementCo
|
|
|
73
70
|
export declare function element(element: HTMLElement, object: ElementConstructorTagObject<any>): ElementConstructor;
|
|
74
71
|
export declare function elementFactory(object: ElementConstructorObject): () => ElementConstructor;
|
|
75
72
|
export declare function elementFactory(element: HTMLElement, object: ElementConstructorTagObject<any>): () => ElementConstructor;
|
|
76
|
-
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CamelToKebab } from '../utils';
|
|
2
|
+
export interface CreateThemeOptions<P extends string = ''> {
|
|
3
|
+
prefix?: P;
|
|
4
|
+
}
|
|
5
|
+
export declare function createTheme<T extends {
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
}, P extends string = ''>(object: T, options?: CreateThemeOptions<P>): { [K in Extract<keyof T, string>]: {
|
|
8
|
+
var: `var(--${P}${CamelToKebab<K>})`;
|
|
9
|
+
value: T[K];
|
|
10
|
+
}; } & {
|
|
11
|
+
style: { [K_1 in `--${P}${CamelToKebab<Extract<keyof T, string>>}`]: string; };
|
|
12
|
+
};
|