aptechka 0.83.1 → 0.84.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/lib/Animation-BUD5w3AB.js +110 -0
- package/lib/Animation-BtUdarQ7.cjs +1 -0
- package/lib/Composed-BI5oe4Ij.cjs +1 -0
- package/lib/Composed-BaevH-MP.js +75 -0
- package/lib/Damped-BHm2IuyN.cjs +1 -0
- package/lib/Damped-Ds17AUU-.js +57 -0
- package/lib/DerivedArray-BePrxcLC.js +63 -0
- package/lib/DerivedArray-xYBpcTp8.cjs +1 -0
- package/lib/DragControls-BgTBgiue.js +233 -0
- package/lib/DragControls-FmiuZDKq.cjs +1 -0
- package/lib/LocalLinks-BdqYzt1b.js +65 -0
- package/lib/LocalLinks-D1mYcA-B.cjs +1 -0
- package/lib/PageAnnouncerElement-CJ-MfwJ8.cjs +1 -0
- package/lib/PageAnnouncerElement-HcphPbXZ.js +28 -0
- package/lib/PageScroll-CrfCwDA4.js +65 -0
- package/lib/PageScroll-IlOCUUte.cjs +1 -0
- package/lib/SourceElement-DC726HMy.js +265 -0
- package/lib/SourceElement-DNyrQby1.cjs +5 -0
- package/lib/Store-BRTHeZmO.js +158 -0
- package/lib/Store-DZnOrofs.cjs +1 -0
- package/lib/Tweened-3UYSwrvs.cjs +1 -0
- package/lib/Tweened-DabaFaHX.js +48 -0
- package/lib/Viewport-0n1C_IoN.js +113 -0
- package/lib/Viewport-D26fEJOk.cjs +1 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +97 -93
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +6 -6
- package/lib/api-fetcher/index.cjs +1 -1
- package/lib/api-fetcher/index.js +67 -66
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +37 -34
- package/lib/attributes-BADnRZpK.cjs +1 -0
- package/lib/attributes-FObgMNCf.js +36 -0
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +240 -232
- package/lib/cache/index.cjs +1 -1
- package/lib/cache/index.js +26 -23
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +61 -59
- package/lib/canvas-BP1ceie3.cjs +1 -0
- package/lib/canvas-DsglKco1.js +40 -0
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +44 -41
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +6 -6
- package/lib/coordinates--JG1U6kQ.js +29 -0
- package/lib/coordinates-DQ9XV9M1.cjs +1 -0
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +1 -1
- package/lib/css-property/index.js +40 -37
- package/lib/css-unit-parser/index.cjs +2 -2
- package/lib/css-unit-parser/index.js +22 -19
- package/lib/css-value-parser/index.cjs +1 -1
- package/lib/css-value-parser/index.js +13 -11
- package/lib/custom-elements-BfZCJde6.cjs +1 -0
- package/lib/custom-elements-HEMuF7yH.js +27 -0
- package/lib/dev/index.cjs +2 -1
- package/lib/dev/index.d.ts +1 -0
- package/lib/dev/index.js +24 -10
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +5 -5
- package/lib/dom-B40i6NXw.cjs +1 -0
- package/lib/dom-D8D-_9ty.js +108 -0
- package/lib/easings-BSGJFMAo.js +40 -0
- package/lib/easings-BWq0pPLq.cjs +1 -0
- package/lib/element-CqD0jqBJ.cjs +1 -0
- package/lib/element-DKw5H-Tu.js +10 -0
- package/lib/element-linked-store/index.cjs +1 -1
- package/lib/element-linked-store/index.js +53 -52
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +47 -44
- package/lib/en3/index.cjs +4 -4
- package/lib/en3/index.js +191 -185
- package/lib/events-Ds-TuvYW.js +9 -0
- package/lib/events-UlGk63iC.cjs +1 -0
- package/lib/file-DwQs6bB6.js +28 -0
- package/lib/file-RHfA3OS-.cjs +1 -0
- package/lib/function-H4b_gTg6.cjs +1 -0
- package/lib/function-UmbPrOHm.js +19 -0
- package/lib/gestures-DmKKNnh4.js +14 -0
- package/lib/gestures-DtYbQr49.cjs +1 -0
- package/lib/history/index.cjs +1 -1
- package/lib/history/index.js +24 -21
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +27 -24
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +17 -13
- package/lib/index-ClTMVKJp.js +183 -0
- package/lib/index-DZ44osDT.cjs +1 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +3 -3
- package/lib/jsx/ComponentElement.d.ts +4 -0
- package/lib/jsx/h.d.ts +7 -16
- package/lib/jsx/hooks/component/useStylesheet.d.ts +1 -1
- package/lib/jsx/hooks/cssProperty.d.ts +6 -0
- package/lib/jsx/hooks/resize.d.ts +4 -0
- package/lib/jsx/hooks/store.d.ts +1 -2
- package/lib/jsx/hooks/ticker.d.ts +5 -0
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.d.ts +4 -4
- package/lib/jsx/index.js +170 -349
- package/lib/jsx/plugins/vite/index.cjs +49 -0
- package/lib/jsx/plugins/vite/index.d.ts +38 -0
- package/lib/jsx/plugins/vite/index.js +104 -0
- package/lib/jsx/render.d.ts +2 -0
- package/lib/jsx/type.d.ts +228 -190
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +86 -84
- package/lib/layout-C26zkY7D.js +35 -0
- package/lib/layout-CnGLl7oe.cjs +1 -0
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +220 -217
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +48 -45
- package/lib/local-links/index.cjs +1 -1
- package/lib/local-links/index.js +2 -2
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +48 -45
- package/lib/math-C-knY2TL.cjs +1 -0
- package/lib/math-r8V23YFe.js +57 -0
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +28 -25
- package/lib/metadata-BNdkmeeD.js +15 -0
- package/lib/metadata-BrHUfpV9.cjs +1 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +561 -556
- package/lib/morph-BtgB1YQP.js +256 -0
- package/lib/morph-Buhxq-X0.cjs +1 -0
- package/lib/need_redo_tweaker/index.cjs +4 -4
- package/lib/need_redo_tweaker/index.js +862 -835
- package/lib/notifier/index.cjs +1 -1
- package/lib/notifier/index.js +29 -26
- package/lib/number-Bu4sGvW7.cjs +1 -0
- package/lib/number-DiVt2xnh.js +47 -0
- package/lib/object-CiIdEmJx.js +98 -0
- package/lib/object-DTY_W6xG.cjs +1 -0
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.js +3 -3
- package/lib/page-announcer/index.cjs +1 -1
- package/lib/page-announcer/index.js +2 -2
- package/lib/page-scroll/index.cjs +1 -1
- package/lib/page-scroll/index.js +2 -2
- package/lib/pixel-perfect/index.cjs +4 -4
- package/lib/pixel-perfect/index.js +43 -40
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +125 -123
- package/lib/polyfills-CG1XJNia.js +28 -0
- package/lib/polyfills-DZCuDBkA.cjs +1 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +249 -245
- package/lib/radio/index.cjs +1 -1
- package/lib/radio/index.js +58 -55
- package/lib/render-H9BjFLZ3.cjs +1 -0
- package/lib/render-LpimRXgl.js +354 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +196 -194
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +890 -878
- package/lib/scroll-D2tOpCnP.cjs +1 -0
- package/lib/scroll-DoNeuIgT.js +41 -0
- package/lib/scroll-entries/index.cjs +1 -1
- package/lib/scroll-entries/index.js +37 -34
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +213 -209
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +102 -98
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +29 -26
- package/lib/slicer/index.cjs +1 -1
- package/lib/slicer/index.js +118 -113
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +5 -5
- package/lib/spa/index.cjs +1 -1
- package/lib/spa/index.js +94 -94
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +2 -2
- package/lib/store/index.js +10 -8
- package/lib/string-B3lm2b7v.js +84 -0
- package/lib/string-CbRNzmd9.cjs +1 -0
- package/lib/style-DBoQWK0d.js +14 -0
- package/lib/style-IDJ6db6n.cjs +1 -0
- package/lib/stylesheet-CBTuup4f.js +28 -0
- package/lib/stylesheet-xM7sMeuo.cjs +1 -0
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +4 -120
- package/lib/url-CPCO10Sy.cjs +1 -0
- package/lib/url-CWCY_qe_.js +124 -0
- package/lib/utils/attributes.d.ts +2 -0
- package/lib/utils/dom.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +260 -226
- package/lib/utils/polyfills.d.ts +1 -1
- package/lib/utils/timeouts.d.ts +6 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +35 -33
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +27 -24
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +56 -54
- package/package.json +11 -24
- package/lib/Animation-BzTjZIE-.js +0 -108
- package/lib/Animation-C39Ah-LM.cjs +0 -1
- package/lib/Composed-C-TV9te3.cjs +0 -1
- package/lib/Composed-DyAWjEXE.js +0 -121
- package/lib/Damped-CRusiRIV.js +0 -56
- package/lib/Damped-Prr0iKu1.cjs +0 -1
- package/lib/DragControls-8rNZwQrs.cjs +0 -1
- package/lib/DragControls-DBNdMBA4.js +0 -228
- package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
- package/lib/LocalLinks-DFZFpbjs.js +0 -62
- package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
- package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
- package/lib/PageScroll-0LxFblry.js +0 -62
- package/lib/PageScroll-BXJUQwG7.cjs +0 -1
- package/lib/SourceElement-BHqPFbna.cjs +0 -5
- package/lib/SourceElement-DjbHjynf.js +0 -260
- package/lib/Store-Blf4msDz.cjs +0 -1
- package/lib/Store-ZThXYBQd.js +0 -152
- package/lib/Tweened-Bw1Cn1PJ.js +0 -47
- package/lib/Tweened-DWtk9E-O.cjs +0 -1
- package/lib/Viewport-BxCr0GlB.cjs +0 -1
- package/lib/Viewport-Dt-d9DPi.js +0 -109
- package/lib/attributes-69we3byR.js +0 -10
- package/lib/attributes-Bf2svn4j.cjs +0 -1
- package/lib/canvas-CU5Xjahf.cjs +0 -1
- package/lib/canvas-DeZ0SLUJ.js +0 -34
- package/lib/coordinates-CgdGoSYs.js +0 -24
- package/lib/coordinates-D8Np3cPD.cjs +0 -1
- package/lib/custom-elements-DBnCK7Zx.js +0 -24
- package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
- package/lib/dom-BETkVSSZ.js +0 -82
- package/lib/dom-CBLlqORw.cjs +0 -1
- package/lib/easings-BEmRlrDd.js +0 -38
- package/lib/easings-GegIwET5.cjs +0 -1
- package/lib/element-CGVl1jA-.js +0 -7
- package/lib/element-yhcBhsho.cjs +0 -1
- package/lib/events-CsVF98U6.js +0 -6
- package/lib/events-KVanG9sR.cjs +0 -1
- package/lib/file-DSpfWdd9.cjs +0 -1
- package/lib/file-GHShUlue.js +0 -24
- package/lib/function-C10DGppn.js +0 -17
- package/lib/function-MthRj-GJ.cjs +0 -1
- package/lib/gestures-C7gbKx11.cjs +0 -1
- package/lib/gestures-CcXV6fCp.js +0 -11
- package/lib/index-OE2INULi.cjs +0 -1
- package/lib/index-e9eDuagL.js +0 -65
- package/lib/jsx/hydrate.d.ts +0 -1
- package/lib/jsx/integrations/astro/client.cjs +0 -1
- package/lib/jsx/integrations/astro/client.d.ts +0 -2
- package/lib/jsx/integrations/astro/client.js +0 -50
- package/lib/jsx/integrations/astro/index.cjs +0 -1
- package/lib/jsx/integrations/astro/index.d.ts +0 -2
- package/lib/jsx/integrations/astro/index.js +0 -54
- package/lib/jsx/integrations/astro/server.cjs +0 -1
- package/lib/jsx/integrations/astro/server.d.ts +0 -3
- package/lib/jsx/integrations/astro/server.js +0 -35
- package/lib/jsx/plugins/vite.d.ts +0 -21
- package/lib/layout-BSMtwCga.js +0 -29
- package/lib/layout-Ctc2p3uz.cjs +0 -1
- package/lib/math-BOBiC4TN.js +0 -45
- package/lib/math-GDWEqu7y.cjs +0 -1
- package/lib/metadata-BcYZ5w3T.cjs +0 -1
- package/lib/metadata-jfowcCyz.js +0 -12
- package/lib/morph-B6sGhLCi.cjs +0 -1
- package/lib/morph-BQErz7qP.js +0 -242
- package/lib/number-ChAm68cm.cjs +0 -1
- package/lib/number-CumqY64S.js +0 -40
- package/lib/object-CcMK4y_r.js +0 -87
- package/lib/object-baN9pgbU.cjs +0 -1
- package/lib/polyfills-DJrTJQky.js +0 -24
- package/lib/polyfills-Df4r-ETT.cjs +0 -1
- package/lib/render-DQs7rIoN.cjs +0 -1
- package/lib/render-D_0FCWEu.js +0 -18
- package/lib/scroll-BA2WnUrb.cjs +0 -1
- package/lib/scroll-DY5senkF.js +0 -37
- package/lib/string-BlMQbe8b.js +0 -70
- package/lib/string-DUXXtU8v.cjs +0 -1
- package/lib/style-At6aDoqG.cjs +0 -1
- package/lib/style-j2TwriJ_.js +0 -10
- package/lib/stylesheet-5_o7PFzM.cjs +0 -1
- package/lib/stylesheet-DdBzowZY.js +0 -24
- package/lib/url-CHgcNwJ1.cjs +0 -1
- package/lib/url-CYgo5vrG.js +0 -113
- package/lib/vite-C-i3hVDL.js +0 -75
- package/lib/vite-DzanPumM.cjs +0 -44
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
3
4
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
6
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
7
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
8
|
+
import { i as isBrowser } from "../index-ClTMVKJp.js";
|
|
7
9
|
import "construct-style-sheets-polyfill";
|
|
8
|
-
import "../
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
const ns = /* @__PURE__ */ new Set([
|
|
10
|
+
import { S as Store, s as storeRegistry, a as activeStores } from "../Store-BRTHeZmO.js";
|
|
11
|
+
import { c as createJSONAndSave } from "../file-DwQs6bB6.js";
|
|
12
|
+
import { d as debounce } from "../function-UmbPrOHm.js";
|
|
13
|
+
import { s as setupDrag } from "../gestures-DmKKNnh4.js";
|
|
14
|
+
import { connector } from "../connector/index.js";
|
|
15
|
+
import { c as camelToKebab, u as uncapitalize } from "../string-B3lm2b7v.js";
|
|
16
|
+
import { i as isESClass } from "../object-CiIdEmJx.js";
|
|
17
|
+
import { a as ViewportMediaRules } from "../Viewport-0n1C_IoN.js";
|
|
18
|
+
import { c as clamp } from "../math-r8V23YFe.js";
|
|
19
|
+
import { t as toStep } from "../number-DiVt2xnh.js";
|
|
20
|
+
import { n as nullishCoalescing } from "../polyfills-CG1XJNia.js";
|
|
21
|
+
import { elementResizer } from "../element-resizer/index.js";
|
|
22
|
+
import { g as getElementTransitionDurationMS } from "../style-DBoQWK0d.js";
|
|
23
|
+
const knownSvgTags = /* @__PURE__ */ new Set([
|
|
23
24
|
// 'a', 'style', 'title', 'script',
|
|
24
25
|
"animate",
|
|
25
26
|
"animateMotion",
|
|
@@ -84,241 +85,241 @@ const ns = /* @__PURE__ */ new Set([
|
|
|
84
85
|
"view",
|
|
85
86
|
"use"
|
|
86
87
|
]);
|
|
87
|
-
var
|
|
88
|
-
const
|
|
89
|
-
constructor(...
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}),
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}),
|
|
106
|
-
});
|
|
107
|
-
if (
|
|
108
|
-
const
|
|
109
|
-
|
|
88
|
+
var _node, _connectCallbacks, _disconnectCallbacks, _connectorUnsubscribeCallback, _storeRootElements, _events, _ElementConstructor_instances, createNode_fn, isSvgOrHtmlElement_fn, applyProperties_fn, watchNode_fn, createClassList_fn, manageStringStoreClass_fn, manageBooleanStoreClass_fn, createStyle_fn, createAttributeStyle_fn, createJSSStyle_fn, setStyleProperty_fn, createEvents_fn, attachEvents_fn, detachEvents_fn, createAttributes_fn, setAttribute_fn, createChildren_fn, appendChild_fn, getNode_fn, getOrCreateNode_fn, _connect, _disconnect;
|
|
89
|
+
const _ElementConstructor = class _ElementConstructor {
|
|
90
|
+
constructor(...args) {
|
|
91
|
+
__privateAdd(this, _ElementConstructor_instances);
|
|
92
|
+
__privateAdd(this, _node, null);
|
|
93
|
+
__privateAdd(this, _connectCallbacks, /* @__PURE__ */ new Set());
|
|
94
|
+
__privateAdd(this, _disconnectCallbacks, /* @__PURE__ */ new Set());
|
|
95
|
+
__privateAdd(this, _connectorUnsubscribeCallback);
|
|
96
|
+
__privateAdd(this, _storeRootElements);
|
|
97
|
+
__privateAdd(this, _events);
|
|
98
|
+
__privateAdd(this, _connect, /* @__PURE__ */ __name((node) => {
|
|
99
|
+
__privateGet(this, _connectCallbacks).forEach((callback) => {
|
|
100
|
+
callback(node);
|
|
101
|
+
}), __privateGet(this, _connectCallbacks).clear();
|
|
102
|
+
}, "#connect"));
|
|
103
|
+
__privateAdd(this, _disconnect, /* @__PURE__ */ __name((node, expired) => {
|
|
104
|
+
__privateGet(this, _disconnectCallbacks).forEach((callback) => {
|
|
105
|
+
callback(node, expired);
|
|
106
|
+
}), __privateGet(this, _disconnectCallbacks).clear(), __privateMethod(this, _ElementConstructor_instances, detachEvents_fn).call(this);
|
|
107
|
+
}, "#disconnect"));
|
|
108
|
+
if (isBrowser) {
|
|
109
|
+
const p1 = args[0], p2 = args[1];
|
|
110
|
+
__privateSet(this, _node, __privateMethod(this, _ElementConstructor_instances, createNode_fn).call(this, p1, p2 == null ? void 0 : p2.forceSvg)), __privateMethod(this, _ElementConstructor_instances, applyProperties_fn).call(this, p2);
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
get node() {
|
|
113
|
-
return
|
|
114
|
+
return __privateGet(this, _node);
|
|
114
115
|
}
|
|
115
|
-
set node(
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
...
|
|
119
|
-
]),
|
|
116
|
+
set node(v) {
|
|
117
|
+
var _a;
|
|
118
|
+
__privateMethod(this, _ElementConstructor_instances, detachEvents_fn).call(this), __privateSet(this, _node, v), (_a = __privateGet(this, _connectorUnsubscribeCallback)) == null || _a.call(this), __privateGet(this, _node) instanceof Element && __privateSet(this, _storeRootElements, [
|
|
119
|
+
...__privateGet(this, _node).querySelectorAll("store-root")
|
|
120
|
+
]), __privateMethod(this, _ElementConstructor_instances, attachEvents_fn).call(this), __privateMethod(this, _ElementConstructor_instances, watchNode_fn).call(this);
|
|
120
121
|
}
|
|
121
122
|
};
|
|
122
|
-
|
|
123
|
-
let
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
else if (typeof
|
|
127
|
-
if (!
|
|
128
|
-
|
|
129
|
-
else if (
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
} else
|
|
123
|
+
_node = new WeakMap(), _connectCallbacks = new WeakMap(), _disconnectCallbacks = new WeakMap(), _connectorUnsubscribeCallback = new WeakMap(), _storeRootElements = new WeakMap(), _events = new WeakMap(), _ElementConstructor_instances = new WeakSet(), createNode_fn = /* @__PURE__ */ __name(function(value, forceSvg) {
|
|
124
|
+
let node = null;
|
|
125
|
+
if (value instanceof Node)
|
|
126
|
+
node = value;
|
|
127
|
+
else if (typeof value == "string")
|
|
128
|
+
if (!value.includes("<") && value.includes("-"))
|
|
129
|
+
node = new (customElements.get(value))();
|
|
130
|
+
else if (value.includes("<")) {
|
|
131
|
+
const wrapper = document.createElement("div");
|
|
132
|
+
wrapper.innerHTML = value, node = wrapper.firstElementChild;
|
|
133
|
+
} else knownSvgTags.has(value) || forceSvg ? node = document.createElementNS(
|
|
133
134
|
"http://www.w3.org/2000/svg",
|
|
134
|
-
|
|
135
|
-
) :
|
|
135
|
+
value
|
|
136
|
+
) : node = document.createElement(value);
|
|
136
137
|
else
|
|
137
|
-
|
|
138
|
-
return
|
|
139
|
-
},
|
|
140
|
-
return
|
|
141
|
-
},
|
|
142
|
-
if (!
|
|
143
|
-
const
|
|
144
|
-
delete
|
|
145
|
-
let
|
|
146
|
-
for (const
|
|
147
|
-
const
|
|
148
|
-
|
|
138
|
+
node = document.createElement("div");
|
|
139
|
+
return node;
|
|
140
|
+
}, "#createNode"), isSvgOrHtmlElement_fn = /* @__PURE__ */ __name(function(node) {
|
|
141
|
+
return node instanceof HTMLElement || node instanceof SVGElement;
|
|
142
|
+
}, "#isSvgOrHtmlElement"), applyProperties_fn = /* @__PURE__ */ __name(function(properties) {
|
|
143
|
+
if (!properties) return;
|
|
144
|
+
const isSvgOrHtml = __privateMethod(this, _ElementConstructor_instances, isSvgOrHtmlElement_fn).call(this, __privateGet(this, _node)), ref = properties.ref;
|
|
145
|
+
delete properties.ref, properties != null && properties.onConnect && (__privateGet(this, _connectCallbacks).add(properties.onConnect), delete properties.onConnect), properties != null && properties.onDisconnect && (__privateGet(this, _disconnectCallbacks).add(properties.onDisconnect), delete properties.onDisconnect);
|
|
146
|
+
let attributes, events;
|
|
147
|
+
for (const propertyName in properties) {
|
|
148
|
+
const value = properties[propertyName];
|
|
149
|
+
propertyName === "class" && isSvgOrHtml ? __privateMethod(this, _ElementConstructor_instances, createClassList_fn).call(this, value) : propertyName === "style" && isSvgOrHtml ? __privateMethod(this, _ElementConstructor_instances, createStyle_fn).call(this, value) : propertyName === "lightChildren" ? __privateMethod(this, _ElementConstructor_instances, createChildren_fn).call(this, __privateGet(this, _node), value) : propertyName === "children" ? __privateMethod(this, _ElementConstructor_instances, createChildren_fn).call(this, __privateGet(this, _node) instanceof Element ? __privateGet(this, _node).shadowRoot || __privateGet(this, _node) : __privateGet(this, _node), value) : propertyName === "connectedClass" ? __privateGet(this, _connectCallbacks).add(() => {
|
|
149
150
|
requestAnimationFrame(() => {
|
|
150
|
-
|
|
151
|
-
typeof
|
|
151
|
+
__privateGet(this, _node).classList.add(
|
|
152
|
+
typeof value == "boolean" ? "connected" : value
|
|
152
153
|
);
|
|
153
154
|
});
|
|
154
|
-
}) :
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
if (
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
155
|
+
}) : propertyName.startsWith("on") ? (events || (events = {}), events[propertyName] = value) : (attributes || (attributes = {}), attributes[propertyName] = value);
|
|
156
|
+
}
|
|
157
|
+
__privateMethod(this, _ElementConstructor_instances, createAttributes_fn).call(this, attributes), __privateMethod(this, _ElementConstructor_instances, createEvents_fn).call(this, events), ref && (typeof ref == "function" ? ref(__privateGet(this, _node)) : ref.current = __privateGet(this, _node)), __privateMethod(this, _ElementConstructor_instances, watchNode_fn).call(this);
|
|
158
|
+
}, "#applyProperties"), watchNode_fn = /* @__PURE__ */ __name(function() {
|
|
159
|
+
if (isBrowser && (__privateGet(this, _disconnectCallbacks).size || __privateGet(this, _connectCallbacks).size)) {
|
|
160
|
+
const watchNode = __privateGet(this, _node) instanceof DocumentFragment ? __privateGet(this, _node).firstChild : __privateGet(this, _node);
|
|
161
|
+
__privateSet(this, _connectorUnsubscribeCallback, connector.subscribe(
|
|
162
|
+
watchNode,
|
|
162
163
|
{
|
|
163
|
-
connectCallback:
|
|
164
|
-
disconnectCallback:
|
|
164
|
+
connectCallback: __privateGet(this, _connect),
|
|
165
|
+
disconnectCallback: __privateGet(this, _disconnect),
|
|
165
166
|
unsubscribeAfterDisconnect: !0,
|
|
166
167
|
maxWaitSec: 20
|
|
167
168
|
}
|
|
168
169
|
));
|
|
169
170
|
}
|
|
170
|
-
},
|
|
171
|
-
if (
|
|
172
|
-
if (typeof
|
|
173
|
-
|
|
174
|
-
else if (Array.isArray(
|
|
175
|
-
|
|
176
|
-
|
|
171
|
+
}, "#watchNode"), createClassList_fn = /* @__PURE__ */ __name(function(classObject) {
|
|
172
|
+
if (classObject) {
|
|
173
|
+
if (typeof classObject == "string")
|
|
174
|
+
__privateGet(this, _node).classList.add(classObject);
|
|
175
|
+
else if (Array.isArray(classObject))
|
|
176
|
+
classObject.forEach((v) => {
|
|
177
|
+
v && __privateMethod(this, _ElementConstructor_instances, createClassList_fn).call(this, v);
|
|
177
178
|
});
|
|
178
|
-
else if (typeof
|
|
179
|
-
if (
|
|
180
|
-
|
|
179
|
+
else if (typeof classObject == "object")
|
|
180
|
+
if (classObject instanceof Store)
|
|
181
|
+
__privateMethod(this, _ElementConstructor_instances, manageStringStoreClass_fn).call(this, classObject);
|
|
181
182
|
else
|
|
182
|
-
for (const
|
|
183
|
-
const
|
|
184
|
-
|
|
183
|
+
for (const className in classObject) {
|
|
184
|
+
const isActive = classObject[className];
|
|
185
|
+
isActive instanceof Store ? __privateMethod(this, _ElementConstructor_instances, manageBooleanStoreClass_fn).call(this, className, isActive) : isActive ? __privateGet(this, _node).classList.add(className) : __privateGet(this, _node).classList.remove(className);
|
|
185
186
|
}
|
|
186
187
|
} else return;
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}),
|
|
193
|
-
|
|
188
|
+
}, "#createClassList"), manageStringStoreClass_fn = /* @__PURE__ */ __name(function(store) {
|
|
189
|
+
__privateGet(this, _disconnectCallbacks).add(
|
|
190
|
+
store.subscribe(({ current, previous }) => {
|
|
191
|
+
previous && [previous].flat().forEach((v) => {
|
|
192
|
+
v && __privateGet(this, _node).classList.remove(v);
|
|
193
|
+
}), current && [current].flat().forEach((v) => {
|
|
194
|
+
v && __privateGet(this, _node).classList.add(v);
|
|
194
195
|
});
|
|
195
196
|
})
|
|
196
197
|
);
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
}, "#manageStringStoreClass"), manageBooleanStoreClass_fn = /* @__PURE__ */ __name(function(className, store) {
|
|
199
|
+
__privateGet(this, _disconnectCallbacks).add(
|
|
200
|
+
store.subscribe(({ current }) => {
|
|
201
|
+
current ? __privateGet(this, _node).classList.add(className) : __privateGet(this, _node).classList.remove(className);
|
|
201
202
|
})
|
|
202
203
|
);
|
|
203
|
-
},
|
|
204
|
-
if (!
|
|
204
|
+
}, "#manageBooleanStoreClass"), createStyle_fn = /* @__PURE__ */ __name(function(object) {
|
|
205
|
+
if (!object)
|
|
205
206
|
return;
|
|
206
|
-
|
|
207
|
-
},
|
|
208
|
-
for (const
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
207
|
+
__privateGet(this, _node).tagName === "style" || __privateGet(this, _node).tagName === "STYLE" ? __privateMethod(this, _ElementConstructor_instances, createJSSStyle_fn).call(this, object) : __privateMethod(this, _ElementConstructor_instances, createAttributeStyle_fn).call(this, object);
|
|
208
|
+
}, "#createStyle"), createAttributeStyle_fn = /* @__PURE__ */ __name(function(object) {
|
|
209
|
+
for (const k in object) {
|
|
210
|
+
const token = k, value = object[token];
|
|
211
|
+
value instanceof Store ? __privateGet(this, _disconnectCallbacks).add(
|
|
212
|
+
value.subscribe(({ current }) => {
|
|
213
|
+
__privateMethod(this, _ElementConstructor_instances, setStyleProperty_fn).call(this, token, current);
|
|
213
214
|
})
|
|
214
|
-
) :
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
for (const
|
|
218
|
-
const
|
|
219
|
-
if (typeof
|
|
220
|
-
|
|
221
|
-
document.createTextNode(`${
|
|
222
|
-
),
|
|
223
|
-
else if (
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
215
|
+
) : __privateMethod(this, _ElementConstructor_instances, setStyleProperty_fn).call(this, token, value);
|
|
216
|
+
}
|
|
217
|
+
}, "#createAttributeStyle"), createJSSStyle_fn = /* @__PURE__ */ __name(function(object) {
|
|
218
|
+
for (const key in object) {
|
|
219
|
+
const value = object[key];
|
|
220
|
+
if (typeof value == "object" && !(value instanceof Store))
|
|
221
|
+
__privateGet(this, _node).appendChild(
|
|
222
|
+
document.createTextNode(`${key} {`)
|
|
223
|
+
), __privateMethod(this, _ElementConstructor_instances, createJSSStyle_fn).call(this, value), __privateGet(this, _node).appendChild(document.createTextNode("}"));
|
|
224
|
+
else if (value instanceof Store) {
|
|
225
|
+
const text = document.createTextNode("");
|
|
226
|
+
__privateGet(this, _disconnectCallbacks).add(
|
|
227
|
+
value.subscribe((e) => {
|
|
228
|
+
e.current ? text.nodeValue = `${camelToKebab(key)}: ${e.current};` : text.nodeValue = "";
|
|
228
229
|
})
|
|
229
|
-
),
|
|
230
|
+
), __privateGet(this, _node).appendChild(text);
|
|
230
231
|
} else
|
|
231
|
-
|
|
232
|
-
document.createTextNode(`${
|
|
232
|
+
__privateGet(this, _node).appendChild(
|
|
233
|
+
document.createTextNode(`${camelToKebab(key)}: ${value};`)
|
|
233
234
|
);
|
|
234
235
|
}
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
},
|
|
238
|
-
if (
|
|
239
|
-
|
|
240
|
-
for (const
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
),
|
|
244
|
-
typeof
|
|
245
|
-
name:
|
|
246
|
-
callback:
|
|
247
|
-
options:
|
|
248
|
-
}) : typeof
|
|
249
|
-
name:
|
|
250
|
-
callback:
|
|
236
|
+
}, "#createJSSStyle"), setStyleProperty_fn = /* @__PURE__ */ __name(function(token, value) {
|
|
237
|
+
token.includes("--") ? value ? __privateGet(this, _node).style.setProperty(token, value.toString()) : __privateGet(this, _node).style.removeProperty(token) : value ? __privateGet(this, _node).style[token] = value.toString() : __privateGet(this, _node).style[token] = "";
|
|
238
|
+
}, "#setStyleProperty"), createEvents_fn = /* @__PURE__ */ __name(function(events) {
|
|
239
|
+
if (events) {
|
|
240
|
+
__privateGet(this, _events) || __privateSet(this, _events, []);
|
|
241
|
+
for (const k in events) {
|
|
242
|
+
const eventName = k, readyEventName = uncapitalize(
|
|
243
|
+
eventName.split("on").slice(1).join("on")
|
|
244
|
+
), listener = events[eventName];
|
|
245
|
+
typeof listener == "object" ? __privateGet(this, _events).push({
|
|
246
|
+
name: readyEventName,
|
|
247
|
+
callback: listener.callback,
|
|
248
|
+
options: listener.options
|
|
249
|
+
}) : typeof listener == "function" && __privateGet(this, _events).push({
|
|
250
|
+
name: readyEventName,
|
|
251
|
+
callback: listener
|
|
251
252
|
});
|
|
252
253
|
}
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
var
|
|
257
|
-
(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
254
|
+
__privateMethod(this, _ElementConstructor_instances, attachEvents_fn).call(this);
|
|
255
|
+
}
|
|
256
|
+
}, "#createEvents"), attachEvents_fn = /* @__PURE__ */ __name(function() {
|
|
257
|
+
var _a;
|
|
258
|
+
(_a = __privateGet(this, _events)) == null || _a.forEach((event) => {
|
|
259
|
+
__privateGet(this, _node).addEventListener(
|
|
260
|
+
event.name,
|
|
261
|
+
event.callback,
|
|
262
|
+
event.options
|
|
262
263
|
);
|
|
263
264
|
});
|
|
264
|
-
},
|
|
265
|
-
var
|
|
266
|
-
(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
265
|
+
}, "#attachEvents"), detachEvents_fn = /* @__PURE__ */ __name(function() {
|
|
266
|
+
var _a;
|
|
267
|
+
(_a = __privateGet(this, _events)) == null || _a.forEach((event) => {
|
|
268
|
+
__privateGet(this, _node).removeEventListener(
|
|
269
|
+
event.name,
|
|
270
|
+
event.callback,
|
|
271
|
+
event.options
|
|
271
272
|
);
|
|
272
273
|
});
|
|
273
|
-
},
|
|
274
|
-
for (const
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
274
|
+
}, "#detachEvents"), createAttributes_fn = /* @__PURE__ */ __name(function(attributes) {
|
|
275
|
+
for (const attributeName in attributes) {
|
|
276
|
+
const value = attributes[attributeName];
|
|
277
|
+
value instanceof Store ? __privateGet(this, _disconnectCallbacks).add(
|
|
278
|
+
value.subscribe(({ current }) => {
|
|
279
|
+
__privateMethod(this, _ElementConstructor_instances, setAttribute_fn).call(this, attributeName, current);
|
|
279
280
|
})
|
|
280
|
-
) :
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
var
|
|
284
|
-
const
|
|
285
|
-
if (
|
|
286
|
-
|
|
287
|
-
else if (
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
|
|
281
|
+
) : __privateMethod(this, _ElementConstructor_instances, setAttribute_fn).call(this, attributeName, value);
|
|
282
|
+
}
|
|
283
|
+
}, "#createAttributes"), setAttribute_fn = /* @__PURE__ */ __name(function(name, value) {
|
|
284
|
+
var _a, _b;
|
|
285
|
+
const element2 = __privateGet(this, _node);
|
|
286
|
+
if (name in element2 && !((_b = (_a = element2.constructor) == null ? void 0 : _a.observedAttributes) != null && _b.includes(name)))
|
|
287
|
+
value != null && (element2[name] = value.toString());
|
|
288
|
+
else if (value != null) {
|
|
289
|
+
const str = value.toString();
|
|
290
|
+
name.includes("xlink") ? element2.setAttributeNS("http://www.w3.org/1999/xlink", name, str) : element2.setAttribute(name, str);
|
|
291
|
+
}
|
|
292
|
+
}, "#setAttribute"), createChildren_fn = /* @__PURE__ */ __name(function(root, children) {
|
|
293
|
+
children && (children = [children].flat(), children.forEach((child) => {
|
|
294
|
+
if (child instanceof Store) {
|
|
295
|
+
const storeRootElement = document.createElement("div");
|
|
296
|
+
storeRootElement.style.display = "contents", root.appendChild(storeRootElement), __privateGet(this, _storeRootElements) || __privateSet(this, _storeRootElements, []);
|
|
297
|
+
const storeRootElementIndex = __privateGet(this, _storeRootElements).length;
|
|
298
|
+
storeRootElement.setAttribute("store-root", ""), __privateGet(this, _storeRootElements).push(storeRootElement), __privateGet(this, _disconnectCallbacks).add(
|
|
299
|
+
child.subscribe(({ current, previous }) => {
|
|
300
|
+
const rootElement = __privateGet(this, _storeRootElements)[storeRootElementIndex];
|
|
301
|
+
rootElement.dispatchEvent(
|
|
301
302
|
new CustomEvent("beforeChildrenChange", {
|
|
302
303
|
bubbles: !0,
|
|
303
304
|
composed: !0
|
|
304
305
|
})
|
|
305
306
|
);
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}),
|
|
310
|
-
if (
|
|
311
|
-
if (
|
|
312
|
-
const
|
|
313
|
-
|
|
307
|
+
const currentNodes = Array.from(rootElement.childNodes), currentItems = Array.isArray(current) ? current : [current], previousItems = Array.isArray(previous) ? previous : [previous], nodesToDelete = [], similarPreviousItems = [];
|
|
308
|
+
currentNodes.length && previousItems.forEach((previousItem, index) => {
|
|
309
|
+
currentItems.includes(previousItem) ? similarPreviousItems.push(previousItem) : nodesToDelete.push(currentNodes[index]);
|
|
310
|
+
}), currentItems.forEach((currentItem, index) => {
|
|
311
|
+
if (similarPreviousItems[index] != null) {
|
|
312
|
+
if (currentItem !== similarPreviousItems[index]) {
|
|
313
|
+
const newNode = __privateMethod(this, _ElementConstructor_instances, getNode_fn).call(this, currentItem), currentNode = currentNodes[index];
|
|
314
|
+
newNode instanceof Node && !currentNode.isEqualNode(newNode) ? rootElement.replaceChild(newNode, currentNode) : rootElement.removeChild(currentNode);
|
|
314
315
|
}
|
|
315
316
|
} else {
|
|
316
|
-
const
|
|
317
|
-
|
|
317
|
+
const newNode = __privateMethod(this, _ElementConstructor_instances, getNode_fn).call(this, currentItem);
|
|
318
|
+
newNode instanceof Node && storeRootElement.appendChild(newNode);
|
|
318
319
|
}
|
|
319
|
-
}),
|
|
320
|
-
|
|
321
|
-
}),
|
|
320
|
+
}), nodesToDelete.forEach((node) => {
|
|
321
|
+
rootElement.removeChild(node);
|
|
322
|
+
}), rootElement.dispatchEvent(
|
|
322
323
|
new CustomEvent("afterChildrenChange", {
|
|
323
324
|
bubbles: !0,
|
|
324
325
|
composed: !0
|
|
@@ -326,82 +327,93 @@ d = new WeakMap(), I = new WeakMap(), y = new WeakMap(), we = new WeakMap(), H =
|
|
|
326
327
|
);
|
|
327
328
|
})
|
|
328
329
|
);
|
|
329
|
-
} else if (
|
|
330
|
-
|
|
331
|
-
else if (
|
|
332
|
-
|
|
330
|
+
} else if (child instanceof _ElementConstructor)
|
|
331
|
+
__privateMethod(this, _ElementConstructor_instances, appendChild_fn).call(this, root, child.node);
|
|
332
|
+
else if (child instanceof Function)
|
|
333
|
+
__privateMethod(this, _ElementConstructor_instances, createChildren_fn).call(this, root, isESClass(child) ? new child() : child());
|
|
333
334
|
else {
|
|
334
|
-
const
|
|
335
|
-
|
|
335
|
+
const childNodeOrUndefined = __privateMethod(this, _ElementConstructor_instances, getOrCreateNode_fn).call(this, child);
|
|
336
|
+
childNodeOrUndefined instanceof Node && __privateMethod(this, _ElementConstructor_instances, appendChild_fn).call(this, root, childNodeOrUndefined);
|
|
336
337
|
}
|
|
337
338
|
}));
|
|
338
|
-
},
|
|
339
|
-
!(
|
|
340
|
-
[...document.head.querySelectorAll("style")].find((
|
|
341
|
-
}),
|
|
342
|
-
|
|
343
|
-
})) :
|
|
344
|
-
},
|
|
345
|
-
return
|
|
346
|
-
},
|
|
347
|
-
if (
|
|
348
|
-
return
|
|
349
|
-
if (
|
|
350
|
-
const
|
|
351
|
-
if (
|
|
352
|
-
const
|
|
353
|
-
return
|
|
339
|
+
}, "#createChildren"), appendChild_fn = /* @__PURE__ */ __name(function(root, node) {
|
|
340
|
+
!(root instanceof ShadowRoot) && node instanceof HTMLElement && node.tagName === "STYLE" ? (__privateGet(this, _connectCallbacks).add(() => {
|
|
341
|
+
[...document.head.querySelectorAll("style")].find((s) => s.outerHTML === node.outerHTML) || document.head.appendChild(node);
|
|
342
|
+
}), __privateGet(this, _disconnectCallbacks).add(() => {
|
|
343
|
+
node.remove();
|
|
344
|
+
})) : root.appendChild(node);
|
|
345
|
+
}, "#appendChild"), getNode_fn = /* @__PURE__ */ __name(function(child) {
|
|
346
|
+
return child instanceof _ElementConstructor ? child.node : typeof child == "function" ? isESClass(child) ? new child() : child() : __privateMethod(this, _ElementConstructor_instances, getOrCreateNode_fn).call(this, child);
|
|
347
|
+
}, "#getNode"), getOrCreateNode_fn = /* @__PURE__ */ __name(function(child) {
|
|
348
|
+
if (child instanceof Node)
|
|
349
|
+
return child;
|
|
350
|
+
if (child != null) {
|
|
351
|
+
const str = String(child);
|
|
352
|
+
if (str.trim().startsWith("<") && str.trim().endsWith(">")) {
|
|
353
|
+
const wrapper = document.createElement("div");
|
|
354
|
+
return wrapper.innerHTML = str, wrapper.firstElementChild;
|
|
354
355
|
} else
|
|
355
|
-
return document.createTextNode(
|
|
356
|
+
return document.createTextNode(str);
|
|
356
357
|
} else
|
|
357
358
|
return;
|
|
358
|
-
},
|
|
359
|
-
let
|
|
360
|
-
function
|
|
361
|
-
return new
|
|
359
|
+
}, "#getOrCreateNode"), _connect = new WeakMap(), _disconnect = new WeakMap(), __name(_ElementConstructor, "ElementConstructor");
|
|
360
|
+
let ElementConstructor = _ElementConstructor;
|
|
361
|
+
function element(...args) {
|
|
362
|
+
return new ElementConstructor(...args);
|
|
362
363
|
}
|
|
363
|
-
|
|
364
|
-
|
|
364
|
+
__name(element, "element");
|
|
365
|
+
function a(object2) {
|
|
366
|
+
return new ElementConstructor("a", object2);
|
|
365
367
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
+
__name(a, "a");
|
|
369
|
+
function button(object2) {
|
|
370
|
+
return new ElementConstructor("button", object2);
|
|
368
371
|
}
|
|
369
|
-
|
|
370
|
-
|
|
372
|
+
__name(button, "button");
|
|
373
|
+
function div(object2) {
|
|
374
|
+
return new ElementConstructor("div", object2);
|
|
371
375
|
}
|
|
372
|
-
|
|
373
|
-
|
|
376
|
+
__name(div, "div");
|
|
377
|
+
function input(object2) {
|
|
378
|
+
return new ElementConstructor("input", object2);
|
|
374
379
|
}
|
|
375
|
-
|
|
376
|
-
|
|
380
|
+
__name(input, "input");
|
|
381
|
+
function label(object2) {
|
|
382
|
+
return new ElementConstructor("label", object2);
|
|
377
383
|
}
|
|
378
|
-
|
|
379
|
-
|
|
384
|
+
__name(label, "label");
|
|
385
|
+
function slot(object2) {
|
|
386
|
+
return new ElementConstructor("slot", object2);
|
|
380
387
|
}
|
|
381
|
-
|
|
382
|
-
|
|
388
|
+
__name(slot, "slot");
|
|
389
|
+
function span(object2) {
|
|
390
|
+
return new ElementConstructor("span", object2);
|
|
383
391
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
392
|
+
__name(span, "span");
|
|
393
|
+
function style(object2) {
|
|
394
|
+
return new ElementConstructor("style", {
|
|
395
|
+
style: object2
|
|
387
396
|
});
|
|
388
397
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
398
|
+
__name(style, "style");
|
|
399
|
+
function createStylesheet(object) {
|
|
400
|
+
const sheet = new CSSStyleSheet();
|
|
401
|
+
return sheet.replaceSync(style(object).node.innerHTML), sheet;
|
|
392
402
|
}
|
|
393
|
-
|
|
394
|
-
|
|
403
|
+
__name(createStylesheet, "createStylesheet");
|
|
404
|
+
function createTheme(object, options) {
|
|
405
|
+
const prefix = options == null ? void 0 : options.prefix, result = {
|
|
395
406
|
style: {}
|
|
396
407
|
};
|
|
397
|
-
for (const
|
|
398
|
-
|
|
399
|
-
var: `var(--${
|
|
400
|
-
value:
|
|
401
|
-
},
|
|
402
|
-
return
|
|
408
|
+
for (const key in object)
|
|
409
|
+
result[key] = {
|
|
410
|
+
var: `var(--${prefix}${camelToKebab(key)})`,
|
|
411
|
+
value: object[key]
|
|
412
|
+
}, result.style[`--${prefix}${camelToKebab(key)}`] = object[key];
|
|
413
|
+
return result;
|
|
403
414
|
}
|
|
404
|
-
|
|
415
|
+
__name(createTheme, "createTheme");
|
|
416
|
+
const aptechkaTheme = createTheme(
|
|
405
417
|
{
|
|
406
418
|
colorMain: "#1c1c1c",
|
|
407
419
|
colorMainAux: "#282828",
|
|
@@ -412,13 +424,13 @@ const f = rs(
|
|
|
412
424
|
},
|
|
413
425
|
{ prefix: "aptechka-" }
|
|
414
426
|
);
|
|
415
|
-
if (
|
|
416
|
-
const
|
|
417
|
-
":root":
|
|
427
|
+
if (isBrowser) {
|
|
428
|
+
const styleNode = style({
|
|
429
|
+
":root": aptechkaTheme.style
|
|
418
430
|
}).node;
|
|
419
|
-
|
|
431
|
+
styleNode.setAttribute("data-permanent", ""), document.head.appendChild(styleNode);
|
|
420
432
|
}
|
|
421
|
-
const
|
|
433
|
+
const resetIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M20.536 3.464C19.07 2 16.714 2 12 2C7.286 2 4.929 2 3.464 3.464C2 4.93 2 7.286 2 12c0 4.714 0 7.071 1.464 8.535C4.93 22 7.286 22 12 22c4.714 0 7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536M16.75 12a.75.75 0 0 1-.75.75H9.81l1.72 1.72a.75.75 0 1 1-1.06 1.06l-3-3a.75.75 0 0 1 0-1.06l3-3a.75.75 0 1 1 1.06 1.06l-1.72 1.72H16a.75.75 0 0 1 .75.75" clip-rule="evenodd"/></svg>', copyIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path d="M15.24 2h-3.894c-1.764 0-3.162 0-4.255.148c-1.126.152-2.037.472-2.755 1.193c-.719.721-1.038 1.636-1.189 2.766C3 7.205 3 8.608 3 10.379v5.838c0 1.508.92 2.8 2.227 3.342c-.067-.91-.067-2.185-.067-3.247v-5.01c0-1.281 0-2.386.118-3.27c.127-.948.413-1.856 1.147-2.593c.734-.737 1.639-1.024 2.583-1.152c.88-.118 1.98-.118 3.257-.118h3.07c1.276 0 2.374 0 3.255.118A3.601 3.601 0 0 0 15.24 2Z"/><path d="M6.6 11.397c0-2.726 0-4.089.844-4.936c.843-.847 2.2-.847 4.916-.847h2.88c2.715 0 4.073 0 4.917.847c.843.847.843 2.21.843 4.936v4.82c0 2.726 0 4.089-.843 4.936c-.844.847-2.202.847-4.917.847h-2.88c-2.715 0-4.073 0-4.916-.847c-.844-.847-.844-2.21-.844-4.936v-4.82Z"/></svg>', downloadIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10-5.75a.75.75 0 0 1 .75.75v5.19l1.72-1.72a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 1 1 1.06-1.06l1.72 1.72V7a.75.75 0 0 1 .75-.75Zm-4 10a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5H8Z" clip-rule="evenodd"/></svg>', uploadIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Zm10 5.75a.75.75 0 0 0 .75-.75v-5.19l1.72 1.72a.75.75 0 1 0 1.06-1.06l-3-3a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l1.72-1.72V17c0 .414.336.75.75.75Zm-4-10a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 0 1.5H8Z" clip-rule="evenodd"/></svg>', arrowIcon = `<svg
|
|
422
434
|
xmlns="http://www.w3.org/2000/svg"
|
|
423
435
|
width="32"
|
|
424
436
|
height="32"
|
|
@@ -427,57 +439,58 @@ const $t = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewB
|
|
|
427
439
|
<path d="m12.37 15.835l6.43-6.63C19.201 8.79 18.958 8 18.43 8H5.57c-.528 0-.771.79-.37 1.205l6.43 6.63c.213.22.527.22.74 0Z" />
|
|
428
440
|
</svg>
|
|
429
441
|
`;
|
|
430
|
-
var
|
|
431
|
-
class
|
|
442
|
+
var _localStorageStudioName, _openedPanels, _changedSizes;
|
|
443
|
+
const _TweakerStorage = class _TweakerStorage {
|
|
432
444
|
constructor() {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
this.scrollValue = 0,
|
|
445
|
+
__privateAdd(this, _localStorageStudioName);
|
|
446
|
+
__privateAdd(this, _openedPanels);
|
|
447
|
+
__privateAdd(this, _changedSizes);
|
|
448
|
+
this.scrollValue = 0, __privateSet(this, _localStorageStudioName, ""), __privateSet(this, _openedPanels, []), __privateSet(this, _changedSizes, {}), __privateSet(this, _localStorageStudioName, storeRegistry.name + "-tweaker");
|
|
437
449
|
}
|
|
438
|
-
openPanel(
|
|
439
|
-
|
|
450
|
+
openPanel(key) {
|
|
451
|
+
__privateGet(this, _openedPanels).includes(key) || __privateGet(this, _openedPanels).push(key);
|
|
440
452
|
}
|
|
441
|
-
closePanel(
|
|
442
|
-
|
|
453
|
+
closePanel(key) {
|
|
454
|
+
__privateSet(this, _openedPanels, __privateGet(this, _openedPanels).filter((v) => v !== key));
|
|
443
455
|
}
|
|
444
|
-
isPanelOpened(
|
|
445
|
-
return
|
|
456
|
+
isPanelOpened(key) {
|
|
457
|
+
return __privateGet(this, _openedPanels).includes(key);
|
|
446
458
|
}
|
|
447
|
-
changedSizes(
|
|
448
|
-
return
|
|
459
|
+
changedSizes(key) {
|
|
460
|
+
return __privateGet(this, _changedSizes)[key];
|
|
449
461
|
}
|
|
450
|
-
changeSize(
|
|
451
|
-
|
|
462
|
+
changeSize(key, value) {
|
|
463
|
+
value ? __privateGet(this, _changedSizes)[key] = value : delete __privateGet(this, _changedSizes)[key];
|
|
452
464
|
}
|
|
453
465
|
save() {
|
|
454
|
-
const
|
|
455
|
-
openedPanels:
|
|
456
|
-
changedSizes:
|
|
466
|
+
const state = {
|
|
467
|
+
openedPanels: __privateGet(this, _openedPanels),
|
|
468
|
+
changedSizes: __privateGet(this, _changedSizes),
|
|
457
469
|
scrollValue: this.scrollValue
|
|
458
470
|
};
|
|
459
|
-
localStorage.setItem(
|
|
471
|
+
localStorage.setItem(__privateGet(this, _localStorageStudioName), JSON.stringify(state)), storeRegistry.saveState();
|
|
460
472
|
}
|
|
461
473
|
load() {
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
if (
|
|
474
|
+
storeRegistry.loadState();
|
|
475
|
+
const stringState = localStorage.getItem(__privateGet(this, _localStorageStudioName));
|
|
476
|
+
if (stringState)
|
|
465
477
|
try {
|
|
466
|
-
const
|
|
467
|
-
|
|
478
|
+
const state = JSON.parse(stringState);
|
|
479
|
+
state.openedPanels && __privateSet(this, _openedPanels, state.openedPanels), state.changedSizes && __privateSet(this, _changedSizes, state.changedSizes), state.scrollValue && (this.scrollValue = state.scrollValue);
|
|
468
480
|
} catch (e) {
|
|
469
481
|
console.error(e);
|
|
470
482
|
}
|
|
471
483
|
}
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
|
|
484
|
+
};
|
|
485
|
+
_localStorageStudioName = new WeakMap(), _openedPanels = new WeakMap(), _changedSizes = new WeakMap(), __name(_TweakerStorage, "TweakerStorage");
|
|
486
|
+
let TweakerStorage = _TweakerStorage;
|
|
487
|
+
const tweakerStorage = new TweakerStorage(), checkIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path d="m243.33 90.91l-128.41 128.4a16 16 0 0 1-22.63 0l-71.62-72a16 16 0 0 1 0-22.61l24-24a16 16 0 0 1 22.57-.06l36.64 35.27l.11.11l92.73-91.37a16 16 0 0 1 22.58 0l24 23.56a16 16 0 0 1 .03 22.7Z"/></svg>', stylesheet$c = createStylesheet({
|
|
475
488
|
":host": {
|
|
476
489
|
position: "relative",
|
|
477
490
|
display: "inline-block",
|
|
478
491
|
width: "30px",
|
|
479
492
|
height: "30px",
|
|
480
|
-
borderRadius:
|
|
493
|
+
borderRadius: aptechkaTheme.borderRadiusSmall.var,
|
|
481
494
|
overflow: "hidden"
|
|
482
495
|
},
|
|
483
496
|
"label, .fake": {
|
|
@@ -500,12 +513,12 @@ const C = new hs(), cs = '<svg xmlns="http://www.w3.org/2000/svg" width="32" hei
|
|
|
500
513
|
display: "flex",
|
|
501
514
|
alignItems: "center",
|
|
502
515
|
justifyContent: "center",
|
|
503
|
-
backgroundColor:
|
|
516
|
+
backgroundColor: aptechkaTheme.colorMainAux.var
|
|
504
517
|
},
|
|
505
518
|
".default svg": {
|
|
506
519
|
width: "60%",
|
|
507
520
|
height: "60%",
|
|
508
|
-
fill:
|
|
521
|
+
fill: aptechkaTheme.colorFont.var,
|
|
509
522
|
opacity: 0,
|
|
510
523
|
transition: "var(--duration-short)"
|
|
511
524
|
},
|
|
@@ -513,88 +526,89 @@ const C = new hs(), cs = '<svg xmlns="http://www.w3.org/2000/svg" width="32" hei
|
|
|
513
526
|
opacity: 1
|
|
514
527
|
}
|
|
515
528
|
});
|
|
516
|
-
var
|
|
517
|
-
const
|
|
529
|
+
var _inputElement, _internals, _CheckboxElement_instances, setFormValue_fn;
|
|
530
|
+
const _CheckboxElement = class _CheckboxElement extends HTMLElement {
|
|
518
531
|
constructor() {
|
|
519
532
|
super();
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
children:
|
|
533
|
+
__privateAdd(this, _CheckboxElement_instances);
|
|
534
|
+
__privateAdd(this, _inputElement, null);
|
|
535
|
+
__privateAdd(this, _internals);
|
|
536
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
537
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$c], __privateSet(this, _internals, this.attachInternals()), element(this, {
|
|
538
|
+
children: label({
|
|
526
539
|
children: [
|
|
527
|
-
|
|
540
|
+
span({
|
|
528
541
|
class: "fake",
|
|
529
|
-
children:
|
|
542
|
+
children: slot({
|
|
530
543
|
children: [
|
|
531
|
-
|
|
544
|
+
span({
|
|
532
545
|
class: "default",
|
|
533
|
-
children: [
|
|
546
|
+
children: [checkIcon]
|
|
534
547
|
})
|
|
535
548
|
]
|
|
536
549
|
})
|
|
537
550
|
}),
|
|
538
|
-
|
|
539
|
-
ref: (
|
|
540
|
-
|
|
541
|
-
},
|
|
551
|
+
input({
|
|
552
|
+
ref: /* @__PURE__ */ __name((e) => {
|
|
553
|
+
__privateSet(this, _inputElement, e), e.required = this.hasAttribute("required"), e.value = this.getAttribute("value") || "", e.checked = this.hasAttribute("checked"), e.name = this.getAttribute("name") || "", __privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this);
|
|
554
|
+
}, "ref"),
|
|
542
555
|
class: "real",
|
|
543
556
|
type: "checkbox",
|
|
544
|
-
onChange: () => {
|
|
545
|
-
|
|
557
|
+
onChange: /* @__PURE__ */ __name(() => {
|
|
558
|
+
__privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this), this.dispatchEvent(
|
|
546
559
|
new Event("change", {
|
|
547
560
|
composed: !0
|
|
548
561
|
})
|
|
549
562
|
);
|
|
550
|
-
}
|
|
563
|
+
}, "onChange")
|
|
551
564
|
})
|
|
552
565
|
]
|
|
553
566
|
})
|
|
554
567
|
});
|
|
555
568
|
}
|
|
556
569
|
get checked() {
|
|
557
|
-
return
|
|
570
|
+
return __privateGet(this, _inputElement).checked;
|
|
558
571
|
}
|
|
559
|
-
set checked(
|
|
560
|
-
|
|
572
|
+
set checked(state) {
|
|
573
|
+
__privateGet(this, _inputElement).checked = state, __privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this);
|
|
561
574
|
}
|
|
562
575
|
get value() {
|
|
563
|
-
return
|
|
576
|
+
return __privateGet(this, _inputElement).value;
|
|
564
577
|
}
|
|
565
|
-
set value(
|
|
566
|
-
|
|
578
|
+
set value(value) {
|
|
579
|
+
__privateGet(this, _inputElement).value = value, __privateMethod(this, _CheckboxElement_instances, setFormValue_fn).call(this);
|
|
567
580
|
}
|
|
568
581
|
};
|
|
569
|
-
|
|
570
|
-
this.checked ?
|
|
571
|
-
},
|
|
572
|
-
let
|
|
573
|
-
|
|
574
|
-
var
|
|
575
|
-
class
|
|
576
|
-
constructor(...
|
|
582
|
+
_inputElement = new WeakMap(), _internals = new WeakMap(), _CheckboxElement_instances = new WeakSet(), setFormValue_fn = /* @__PURE__ */ __name(function() {
|
|
583
|
+
this.checked ? __privateGet(this, _internals).setFormValue(this.value) : __privateGet(this, _internals).setFormValue(null), this.classList.toggle("checked", this.checked);
|
|
584
|
+
}, "#setFormValue"), __name(_CheckboxElement, "CheckboxElement"), _CheckboxElement.formAssociated = !0;
|
|
585
|
+
let CheckboxElement = _CheckboxElement;
|
|
586
|
+
isBrowser && !customElements.get("e-checkbox") && customElements.define("e-checkbox", CheckboxElement);
|
|
587
|
+
var _stores;
|
|
588
|
+
const _TweakerStoreManagerElement = class _TweakerStoreManagerElement extends HTMLElement {
|
|
589
|
+
constructor(...stores) {
|
|
577
590
|
super();
|
|
578
|
-
|
|
579
|
-
|
|
591
|
+
__privateAdd(this, _stores);
|
|
592
|
+
__privateSet(this, _stores, stores);
|
|
580
593
|
}
|
|
581
|
-
addStore(
|
|
582
|
-
|
|
594
|
+
addStore(store) {
|
|
595
|
+
__privateGet(this, _stores).push(store);
|
|
583
596
|
}
|
|
584
597
|
get firstStore() {
|
|
585
|
-
return
|
|
598
|
+
return __privateGet(this, _stores)[0];
|
|
586
599
|
}
|
|
587
600
|
get stores() {
|
|
588
|
-
return
|
|
601
|
+
return __privateGet(this, _stores);
|
|
589
602
|
}
|
|
590
|
-
updateStores(
|
|
591
|
-
|
|
592
|
-
|
|
603
|
+
updateStores(value) {
|
|
604
|
+
__privateGet(this, _stores).forEach((store) => {
|
|
605
|
+
store.current = value;
|
|
593
606
|
});
|
|
594
607
|
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
|
|
608
|
+
};
|
|
609
|
+
_stores = new WeakMap(), __name(_TweakerStoreManagerElement, "TweakerStoreManagerElement");
|
|
610
|
+
let TweakerStoreManagerElement = _TweakerStoreManagerElement;
|
|
611
|
+
const stylesheet$b = createStylesheet({
|
|
598
612
|
":host": {
|
|
599
613
|
width: "100%",
|
|
600
614
|
display: "inline-flex",
|
|
@@ -604,34 +618,35 @@ const us = E({
|
|
|
604
618
|
"--size": "calc(var(--height-input) * 0.8)",
|
|
605
619
|
width: "var(--size)",
|
|
606
620
|
height: "var(--size)",
|
|
607
|
-
borderRadius:
|
|
621
|
+
borderRadius: aptechkaTheme.borderRadiusSmall.var
|
|
608
622
|
}
|
|
609
|
-
})
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
e.adoptedStyleSheets = [...e.adoptedStyleSheets, us], g(this, {
|
|
623
|
+
}), _TweakerBooleanManagerElement = class _TweakerBooleanManagerElement extends TweakerStoreManagerElement {
|
|
624
|
+
constructor(...stores) {
|
|
625
|
+
super(...stores);
|
|
626
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
627
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$b], element(this, {
|
|
615
628
|
children: [
|
|
616
|
-
|
|
617
|
-
onChange: (
|
|
618
|
-
this.updateStores(
|
|
619
|
-
},
|
|
620
|
-
ref: (
|
|
621
|
-
this.firstStore.subscribe((
|
|
622
|
-
|
|
629
|
+
element("e-checkbox", {
|
|
630
|
+
onChange: /* @__PURE__ */ __name((e) => {
|
|
631
|
+
this.updateStores(e.currentTarget.checked);
|
|
632
|
+
}, "onChange"),
|
|
633
|
+
ref: /* @__PURE__ */ __name((e) => {
|
|
634
|
+
this.firstStore.subscribe((d) => {
|
|
635
|
+
e.checked = d.current;
|
|
623
636
|
});
|
|
624
|
-
}
|
|
637
|
+
}, "ref")
|
|
625
638
|
})
|
|
626
639
|
]
|
|
627
640
|
});
|
|
628
641
|
}
|
|
629
|
-
}
|
|
630
|
-
|
|
642
|
+
};
|
|
643
|
+
__name(_TweakerBooleanManagerElement, "TweakerBooleanManagerElement");
|
|
644
|
+
let TweakerBooleanManagerElement = _TweakerBooleanManagerElement;
|
|
645
|
+
isBrowser && !customElements.get("e-tweaker-boolean-manager") && customElements.define(
|
|
631
646
|
"e-tweaker-boolean-manager",
|
|
632
|
-
|
|
647
|
+
TweakerBooleanManagerElement
|
|
633
648
|
);
|
|
634
|
-
const
|
|
649
|
+
const stylesheet$a = createStylesheet({
|
|
635
650
|
":host": {
|
|
636
651
|
width: "100%",
|
|
637
652
|
display: "inline-flex",
|
|
@@ -642,7 +657,7 @@ const fs = E({
|
|
|
642
657
|
height: "var(--height-input)",
|
|
643
658
|
padding: "0",
|
|
644
659
|
background: "none",
|
|
645
|
-
borderRadius:
|
|
660
|
+
borderRadius: aptechkaTheme.borderRadius.var,
|
|
646
661
|
border: "none",
|
|
647
662
|
blockSize: "unset"
|
|
648
663
|
},
|
|
@@ -650,52 +665,54 @@ const fs = E({
|
|
|
650
665
|
boxSizing: "border-box",
|
|
651
666
|
padding: "0px",
|
|
652
667
|
border: "none",
|
|
653
|
-
borderRadius:
|
|
668
|
+
borderRadius: aptechkaTheme.borderRadius.var,
|
|
654
669
|
height: "calc(var(--height-input) * 0.93)"
|
|
655
670
|
}
|
|
656
|
-
})
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
e.adoptedStyleSheets = [...e.adoptedStyleSheets, fs], g(this, {
|
|
671
|
+
}), _TweakerColorManagerElement = class _TweakerColorManagerElement extends TweakerStoreManagerElement {
|
|
672
|
+
constructor(...stores) {
|
|
673
|
+
super(...stores);
|
|
674
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
675
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$a], element(this, {
|
|
662
676
|
children: [
|
|
663
|
-
|
|
677
|
+
input({
|
|
664
678
|
type: "color",
|
|
665
679
|
value: this.firstStore,
|
|
666
|
-
onInput: (
|
|
667
|
-
this.updateStores(
|
|
668
|
-
}
|
|
680
|
+
onInput: /* @__PURE__ */ __name((e) => {
|
|
681
|
+
this.updateStores(e.currentTarget.value);
|
|
682
|
+
}, "onInput")
|
|
669
683
|
})
|
|
670
684
|
]
|
|
671
685
|
});
|
|
672
686
|
}
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
|
|
687
|
+
};
|
|
688
|
+
__name(_TweakerColorManagerElement, "TweakerColorManagerElement");
|
|
689
|
+
let TweakerColorManagerElement = _TweakerColorManagerElement;
|
|
690
|
+
isBrowser && !customElements.get("e-tweaker-color-manager") && customElements.define("e-tweaker-color-manager", TweakerColorManagerElement);
|
|
691
|
+
const stylesheet$9 = createStylesheet({
|
|
676
692
|
a: {
|
|
677
693
|
color: "inherit",
|
|
678
694
|
fontSize: "var(--font-size-small)"
|
|
679
695
|
}
|
|
680
|
-
})
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
e.adoptedStyleSheets = [...e.adoptedStyleSheets, ms], g(this, {
|
|
696
|
+
}), _TweakerLinkManagerElement = class _TweakerLinkManagerElement extends TweakerStoreManagerElement {
|
|
697
|
+
constructor(...stores) {
|
|
698
|
+
var _a;
|
|
699
|
+
super(...stores);
|
|
700
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
701
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$9], element(this, {
|
|
687
702
|
children: [
|
|
688
|
-
|
|
703
|
+
a({
|
|
689
704
|
href: this.firstStore,
|
|
690
|
-
target: (
|
|
705
|
+
target: (_a = this.firstStore.__manager) != null && _a.sameWindow ? "_self" : "_blank",
|
|
691
706
|
children: this.firstStore
|
|
692
707
|
})
|
|
693
708
|
]
|
|
694
709
|
});
|
|
695
710
|
}
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
|
|
711
|
+
};
|
|
712
|
+
__name(_TweakerLinkManagerElement, "TweakerLinkManagerElement");
|
|
713
|
+
let TweakerLinkManagerElement = _TweakerLinkManagerElement;
|
|
714
|
+
isBrowser && !customElements.get("e-tweaker-link-manager") && customElements.define("e-tweaker-link-manager", TweakerLinkManagerElement);
|
|
715
|
+
const stylesheet$8 = createStylesheet({
|
|
699
716
|
":host": {
|
|
700
717
|
width: "100%",
|
|
701
718
|
display: "flex",
|
|
@@ -720,7 +737,7 @@ const ps = E({
|
|
|
720
737
|
margin: "0",
|
|
721
738
|
padding: "0 var(--gap-small)",
|
|
722
739
|
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
723
|
-
borderRadius:
|
|
740
|
+
borderRadius: aptechkaTheme.borderRadius.var
|
|
724
741
|
},
|
|
725
742
|
".drag": {
|
|
726
743
|
position: "relative",
|
|
@@ -736,12 +753,12 @@ const ps = E({
|
|
|
736
753
|
width: "100%",
|
|
737
754
|
zIndex: "-1",
|
|
738
755
|
height: "1px",
|
|
739
|
-
borderBottom: `1px solid ${
|
|
756
|
+
borderBottom: `1px solid ${aptechkaTheme.colorFont.var}`,
|
|
740
757
|
transform: "translateY(-50%)",
|
|
741
758
|
opacity: "0.3"
|
|
742
759
|
},
|
|
743
760
|
":host(.infinite) .drag::before": {
|
|
744
|
-
borderBottom: `1px dashed ${
|
|
761
|
+
borderBottom: `1px dashed ${aptechkaTheme.colorFont.var}`
|
|
745
762
|
},
|
|
746
763
|
".drag-knob": {
|
|
747
764
|
"--size": "calc(var(--height-input) * 0.4)",
|
|
@@ -751,96 +768,96 @@ const ps = E({
|
|
|
751
768
|
".drag-knob-inner": {
|
|
752
769
|
width: "100%",
|
|
753
770
|
height: "100%",
|
|
754
|
-
backgroundColor:
|
|
755
|
-
borderRadius:
|
|
771
|
+
backgroundColor: aptechkaTheme.colorFont.var,
|
|
772
|
+
borderRadius: aptechkaTheme.borderRadiusSmall.var,
|
|
756
773
|
transition: "opacity var(--duration-short)"
|
|
757
774
|
},
|
|
758
775
|
":host(.infinite) .grabbing .drag-knob-inner": {
|
|
759
776
|
opacity: 0.3
|
|
760
777
|
}
|
|
761
778
|
});
|
|
762
|
-
var
|
|
763
|
-
class
|
|
764
|
-
constructor(...
|
|
765
|
-
var
|
|
766
|
-
super(...
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
const
|
|
779
|
-
return
|
|
780
|
-
const
|
|
781
|
-
i
|
|
782
|
-
}),
|
|
783
|
-
});
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
const
|
|
787
|
-
|
|
788
|
-
}),
|
|
789
|
-
});
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
});
|
|
793
|
-
const
|
|
794
|
-
|
|
795
|
-
class:
|
|
796
|
-
children:
|
|
779
|
+
var _inputElements, _knobElements, _step, _min, _max, _ease, _type, _isFinite, _isDragging, _storeMiddleware, _storeChangeListener, _TweakerNumberManagerElement_instances, getArray_fn, updateKnobPositions_fn, getDistance_fn, getKnobPosition_fn, _resizeListener;
|
|
780
|
+
const _TweakerNumberManagerElement = class _TweakerNumberManagerElement extends TweakerStoreManagerElement {
|
|
781
|
+
constructor(...stores) {
|
|
782
|
+
var _a, _b, _c, _d;
|
|
783
|
+
super(...stores);
|
|
784
|
+
__privateAdd(this, _TweakerNumberManagerElement_instances);
|
|
785
|
+
__privateAdd(this, _inputElements, []);
|
|
786
|
+
__privateAdd(this, _knobElements, []);
|
|
787
|
+
__privateAdd(this, _step);
|
|
788
|
+
__privateAdd(this, _min);
|
|
789
|
+
__privateAdd(this, _max);
|
|
790
|
+
__privateAdd(this, _ease);
|
|
791
|
+
__privateAdd(this, _type);
|
|
792
|
+
__privateAdd(this, _isFinite);
|
|
793
|
+
__privateAdd(this, _isDragging, !1);
|
|
794
|
+
__privateAdd(this, _storeMiddleware, /* @__PURE__ */ __name((value) => {
|
|
795
|
+
const arr = __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this, value);
|
|
796
|
+
return arr.map((v, i) => {
|
|
797
|
+
const number = typeof v == "string" ? parseFloat(v) || __privateGet(this, _min) : v, clamped = clamp(number, __privateGet(this, _min), __privateGet(this, _max)), fixed = toStep(clamped, __privateGet(this, _step));
|
|
798
|
+
arr[i] = fixed;
|
|
799
|
+
}), __privateGet(this, _type) === "number" ? arr[0] : arr;
|
|
800
|
+
}, "#storeMiddleware"));
|
|
801
|
+
__privateAdd(this, _storeChangeListener, /* @__PURE__ */ __name(() => {
|
|
802
|
+
__privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this).map((v, i) => {
|
|
803
|
+
const inputElement = __privateGet(this, _inputElements)[i];
|
|
804
|
+
inputElement && (inputElement.value = (v || 0).toString());
|
|
805
|
+
}), __privateMethod(this, _TweakerNumberManagerElement_instances, updateKnobPositions_fn).call(this);
|
|
806
|
+
}, "#storeChangeListener"));
|
|
807
|
+
__privateAdd(this, _resizeListener, /* @__PURE__ */ __name(() => {
|
|
808
|
+
__privateMethod(this, _TweakerNumberManagerElement_instances, updateKnobPositions_fn).call(this);
|
|
809
|
+
}, "#resizeListener"));
|
|
810
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
811
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$8], __privateSet(this, _min, nullishCoalescing((_a = this.firstStore.__manager) == null ? void 0 : _a.min, -1 / 0)), __privateSet(this, _max, nullishCoalescing((_b = this.firstStore.__manager) == null ? void 0 : _b.max, 1 / 0)), __privateSet(this, _step, ((_c = this.firstStore.__manager) == null ? void 0 : _c.step) || 0.01), __privateSet(this, _ease, ((_d = this.firstStore.__manager) == null ? void 0 : _d.ease) || 1), __privateSet(this, _type, Array.isArray(this.firstStore.current) ? "array" : "number"), __privateSet(this, _isFinite, isFinite(__privateGet(this, _max)) && isFinite(__privateGet(this, _min))), element(this, {
|
|
812
|
+
class: __privateGet(this, _isFinite) ? "" : "infinite",
|
|
813
|
+
children: __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this).map((v, i) => div({
|
|
797
814
|
class: "inputs-wrapper",
|
|
798
815
|
children: [
|
|
799
|
-
|
|
816
|
+
input({
|
|
800
817
|
type: "number",
|
|
801
|
-
step:
|
|
802
|
-
min:
|
|
803
|
-
max:
|
|
804
|
-
ref: (
|
|
805
|
-
value:
|
|
806
|
-
onChange: () => {
|
|
818
|
+
step: __privateGet(this, _step),
|
|
819
|
+
min: __privateGet(this, _min),
|
|
820
|
+
max: __privateGet(this, _max),
|
|
821
|
+
ref: /* @__PURE__ */ __name((e) => __privateGet(this, _inputElements).push(e), "ref"),
|
|
822
|
+
value: v,
|
|
823
|
+
onChange: /* @__PURE__ */ __name(() => {
|
|
807
824
|
this.updateStores(
|
|
808
|
-
|
|
825
|
+
__privateGet(this, _inputElements).map((el) => parseFloat(el.value))
|
|
809
826
|
);
|
|
810
|
-
}
|
|
827
|
+
}, "onChange")
|
|
811
828
|
}),
|
|
812
|
-
|
|
829
|
+
div({
|
|
813
830
|
class: "drag",
|
|
814
831
|
children: [
|
|
815
|
-
|
|
832
|
+
div({
|
|
816
833
|
class: "drag-knob",
|
|
817
|
-
ref: (
|
|
818
|
-
onPointerdown: (
|
|
819
|
-
|
|
820
|
-
const
|
|
821
|
-
if (
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
(
|
|
825
|
-
const
|
|
826
|
-
if (
|
|
827
|
-
const
|
|
828
|
-
|
|
834
|
+
ref: /* @__PURE__ */ __name((e) => __privateGet(this, _knobElements).push(e), "ref"),
|
|
835
|
+
onPointerdown: /* @__PURE__ */ __name((grabEvent) => {
|
|
836
|
+
grabEvent.preventDefault(), __privateSet(this, _isDragging, !0);
|
|
837
|
+
const arr = __privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this), startValue = arr[i], knobElement = __privateGet(this, _knobElements)[i], inputElement = __privateGet(this, _inputElements)[i];
|
|
838
|
+
if (knobElement && inputElement) {
|
|
839
|
+
const knobParentElement = knobElement.parentElement, distance = __privateMethod(this, _TweakerNumberManagerElement_instances, getDistance_fn).call(this);
|
|
840
|
+
knobParentElement.classList.add("grabbing"), setupDrag(
|
|
841
|
+
(moveEvent) => {
|
|
842
|
+
const delta = moveEvent.x - grabEvent.x, del = __privateGet(this, _isFinite) ? knobParentElement.offsetWidth / (distance || 1) : 1, newValue = startValue + delta / del * __privateGet(this, _ease);
|
|
843
|
+
if (arr[i] = newValue, !__privateGet(this, _isFinite)) {
|
|
844
|
+
const pos = __privateMethod(this, _TweakerNumberManagerElement_instances, getKnobPosition_fn).call(this, knobElement, 0);
|
|
845
|
+
knobElement.style.transform = `translateX(${pos + delta}px)`;
|
|
829
846
|
}
|
|
830
|
-
this.updateStores([...
|
|
847
|
+
this.updateStores([...arr]);
|
|
831
848
|
},
|
|
832
849
|
() => {
|
|
833
|
-
if (
|
|
834
|
-
const
|
|
835
|
-
|
|
836
|
-
|
|
850
|
+
if (__privateSet(this, _isDragging, !1), !__privateGet(this, _isFinite)) {
|
|
851
|
+
const pos = __privateMethod(this, _TweakerNumberManagerElement_instances, getKnobPosition_fn).call(this, knobElement, 0);
|
|
852
|
+
knobElement.style.transition = "transform 0.1s", knobElement.style.transform = `translateX(${pos}px)`, knobParentElement.classList.remove("grabbing"), setTimeout(() => {
|
|
853
|
+
knobElement.style.transition = "";
|
|
837
854
|
}, 100);
|
|
838
855
|
}
|
|
839
856
|
}
|
|
840
857
|
);
|
|
841
858
|
}
|
|
842
|
-
},
|
|
843
|
-
children:
|
|
859
|
+
}, "onPointerdown"),
|
|
860
|
+
children: div({
|
|
844
861
|
class: "drag-knob-inner"
|
|
845
862
|
})
|
|
846
863
|
})
|
|
@@ -851,46 +868,49 @@ class Bt extends pe {
|
|
|
851
868
|
});
|
|
852
869
|
}
|
|
853
870
|
connectedCallback() {
|
|
854
|
-
this.firstStore.addMiddleware(
|
|
871
|
+
this.firstStore.addMiddleware(__privateGet(this, _storeMiddleware)), this.firstStore.subscribe(__privateGet(this, _storeChangeListener)), elementResizer.subscribe(this, __privateGet(this, _resizeListener));
|
|
855
872
|
}
|
|
856
873
|
disconnectedCallback() {
|
|
857
|
-
this.firstStore.removeMiddleware(
|
|
874
|
+
this.firstStore.removeMiddleware(__privateGet(this, _storeMiddleware)), this.firstStore.unsubscribe(__privateGet(this, _storeChangeListener)), elementResizer.unsubscribe(__privateGet(this, _resizeListener));
|
|
858
875
|
}
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
return Array.isArray(
|
|
862
|
-
},
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
if (
|
|
866
|
-
const
|
|
867
|
-
|
|
876
|
+
};
|
|
877
|
+
_inputElements = new WeakMap(), _knobElements = new WeakMap(), _step = new WeakMap(), _min = new WeakMap(), _max = new WeakMap(), _ease = new WeakMap(), _type = new WeakMap(), _isFinite = new WeakMap(), _isDragging = new WeakMap(), _storeMiddleware = new WeakMap(), _storeChangeListener = new WeakMap(), _TweakerNumberManagerElement_instances = new WeakSet(), getArray_fn = /* @__PURE__ */ __name(function(value = this.firstStore.current) {
|
|
878
|
+
return Array.isArray(value) ? value : [value];
|
|
879
|
+
}, "#getArray"), updateKnobPositions_fn = /* @__PURE__ */ __name(function() {
|
|
880
|
+
__privateMethod(this, _TweakerNumberManagerElement_instances, getArray_fn).call(this).map((v, i) => {
|
|
881
|
+
const knobElement = __privateGet(this, _knobElements)[i];
|
|
882
|
+
if (knobElement && (!__privateGet(this, _isDragging) || __privateGet(this, _isDragging) && __privateGet(this, _isFinite))) {
|
|
883
|
+
const position = __privateMethod(this, _TweakerNumberManagerElement_instances, getKnobPosition_fn).call(this, knobElement, v);
|
|
884
|
+
knobElement.style.transform = `translateX(${position}px)`;
|
|
868
885
|
}
|
|
869
886
|
});
|
|
870
|
-
},
|
|
871
|
-
return
|
|
872
|
-
},
|
|
873
|
-
const
|
|
874
|
-
return (
|
|
875
|
-
},
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
887
|
+
}, "#updateKnobPositions"), getDistance_fn = /* @__PURE__ */ __name(function() {
|
|
888
|
+
return __privateGet(this, _isFinite) ? __privateGet(this, _max) - __privateGet(this, _min) : 0;
|
|
889
|
+
}, "#getDistance"), getKnobPosition_fn = /* @__PURE__ */ __name(function(knobElement, inputValue) {
|
|
890
|
+
const parentElement = knobElement.parentElement, distance = __privateMethod(this, _TweakerNumberManagerElement_instances, getDistance_fn).call(this), progress = distance ? inputValue / distance : 0.5;
|
|
891
|
+
return (parentElement.offsetWidth - knobElement.offsetWidth) * progress;
|
|
892
|
+
}, "#getKnobPosition"), _resizeListener = new WeakMap(), __name(_TweakerNumberManagerElement, "TweakerNumberManagerElement");
|
|
893
|
+
let TweakerNumberManagerElement = _TweakerNumberManagerElement;
|
|
894
|
+
isBrowser && !customElements.get("e-tweaker-number-manager") && customElements.define("e-tweaker-number-manager", TweakerNumberManagerElement);
|
|
895
|
+
function dispatchSizeChangeEvent(node) {
|
|
896
|
+
node.dispatchEvent(
|
|
879
897
|
new CustomEvent("sizeChange", {
|
|
880
898
|
bubbles: !0,
|
|
881
899
|
composed: !0
|
|
882
900
|
})
|
|
883
901
|
);
|
|
884
902
|
}
|
|
885
|
-
|
|
886
|
-
|
|
903
|
+
__name(dispatchSizeChangeEvent, "dispatchSizeChangeEvent");
|
|
904
|
+
function dispatchBeforeSizeChangeEvent(node) {
|
|
905
|
+
node.dispatchEvent(
|
|
887
906
|
new CustomEvent("beforeSizeChange", {
|
|
888
907
|
bubbles: !0,
|
|
889
908
|
composed: !0
|
|
890
909
|
})
|
|
891
910
|
);
|
|
892
911
|
}
|
|
893
|
-
|
|
912
|
+
__name(dispatchBeforeSizeChangeEvent, "dispatchBeforeSizeChangeEvent");
|
|
913
|
+
const stylesheet$7 = createStylesheet({
|
|
894
914
|
":host": {
|
|
895
915
|
position: "relative"
|
|
896
916
|
},
|
|
@@ -925,112 +945,113 @@ const bs = E({
|
|
|
925
945
|
paddingTop: "var(--gap, 0px)"
|
|
926
946
|
}
|
|
927
947
|
});
|
|
928
|
-
var
|
|
929
|
-
const
|
|
948
|
+
var _internals2, _value, _bodyElement, _opened, _timeoutId, _resizeObserver, _resizeObserverListener, _SelectElement_instances, dispatchToggleEvent_fn;
|
|
949
|
+
const _SelectElement = class _SelectElement extends HTMLElement {
|
|
930
950
|
constructor() {
|
|
931
951
|
super();
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
});
|
|
942
|
-
if (
|
|
943
|
-
const
|
|
944
|
-
|
|
952
|
+
__privateAdd(this, _SelectElement_instances);
|
|
953
|
+
__privateAdd(this, _internals2, null);
|
|
954
|
+
__privateAdd(this, _value, "");
|
|
955
|
+
__privateAdd(this, _bodyElement, null);
|
|
956
|
+
__privateAdd(this, _opened, !1);
|
|
957
|
+
__privateAdd(this, _timeoutId);
|
|
958
|
+
__privateAdd(this, _resizeObserver, null);
|
|
959
|
+
__privateAdd(this, _resizeObserverListener, /* @__PURE__ */ __name(() => {
|
|
960
|
+
dispatchSizeChangeEvent(this);
|
|
961
|
+
}, "#resizeObserverListener"));
|
|
962
|
+
if (isBrowser) {
|
|
963
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
964
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$7], __privateSet(this, _internals2, this.attachInternals()), __privateSet(this, _resizeObserver, new ResizeObserver(__privateGet(this, _resizeObserverListener))), element(this, {
|
|
945
965
|
children: [
|
|
946
|
-
|
|
966
|
+
button({
|
|
947
967
|
class: "head",
|
|
948
|
-
children:
|
|
949
|
-
onClick: () => {
|
|
968
|
+
children: slot({ name: "head" }),
|
|
969
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
950
970
|
this.opened ? this.close() : this.open();
|
|
951
|
-
}
|
|
971
|
+
}, "onClick")
|
|
952
972
|
}),
|
|
953
|
-
|
|
973
|
+
div({
|
|
954
974
|
class: "body",
|
|
955
975
|
style: {
|
|
956
976
|
height: "0px"
|
|
957
977
|
},
|
|
958
|
-
children:
|
|
978
|
+
children: div({
|
|
959
979
|
class: "body-inner",
|
|
960
|
-
children:
|
|
980
|
+
children: slot()
|
|
961
981
|
}),
|
|
962
|
-
ref: (
|
|
963
|
-
|
|
964
|
-
}
|
|
982
|
+
ref: /* @__PURE__ */ __name((e) => {
|
|
983
|
+
__privateSet(this, _bodyElement, e);
|
|
984
|
+
}, "ref")
|
|
965
985
|
})
|
|
966
986
|
]
|
|
967
987
|
});
|
|
968
988
|
}
|
|
969
989
|
}
|
|
970
990
|
get value() {
|
|
971
|
-
return
|
|
991
|
+
return __privateGet(this, _value);
|
|
972
992
|
}
|
|
973
|
-
set value(
|
|
974
|
-
|
|
993
|
+
set value(value) {
|
|
994
|
+
__privateSet(this, _value, value), this.dispatchEvent(
|
|
975
995
|
new Event("change", {
|
|
976
996
|
bubbles: !0,
|
|
977
997
|
composed: !0
|
|
978
998
|
})
|
|
979
|
-
),
|
|
999
|
+
), __privateGet(this, _internals2).setFormValue(__privateGet(this, _value));
|
|
980
1000
|
}
|
|
981
1001
|
get internals() {
|
|
982
|
-
return
|
|
1002
|
+
return __privateGet(this, _internals2);
|
|
983
1003
|
}
|
|
984
1004
|
get opened() {
|
|
985
|
-
return
|
|
1005
|
+
return __privateGet(this, _opened);
|
|
986
1006
|
}
|
|
987
1007
|
open() {
|
|
988
|
-
clearTimeout(
|
|
989
|
-
this.classList.add("opened"),
|
|
1008
|
+
clearTimeout(__privateGet(this, _timeoutId)), __privateSet(this, _opened, !0), __privateGet(this, _bodyElement).style.display = "grid", this.classList.add("triggered"), setTimeout(() => {
|
|
1009
|
+
this.classList.add("opened"), __privateGet(this, _bodyElement).style.height = __privateGet(this, _bodyElement).scrollHeight + "px", __privateMethod(this, _SelectElement_instances, dispatchToggleEvent_fn).call(this);
|
|
990
1010
|
}, 0);
|
|
991
1011
|
}
|
|
992
1012
|
close() {
|
|
993
|
-
|
|
994
|
-
this.classList.remove("triggered"),
|
|
995
|
-
},
|
|
1013
|
+
__privateSet(this, _opened, !1), __privateGet(this, _bodyElement).style.height = "0px", this.classList.remove("opened"), __privateMethod(this, _SelectElement_instances, dispatchToggleEvent_fn).call(this), __privateSet(this, _timeoutId, setTimeout(() => {
|
|
1014
|
+
this.classList.remove("triggered"), __privateGet(this, _bodyElement).style.display = "none";
|
|
1015
|
+
}, getElementTransitionDurationMS(__privateGet(this, _bodyElement))));
|
|
996
1016
|
}
|
|
997
1017
|
connectedCallback() {
|
|
998
|
-
|
|
1018
|
+
__privateGet(this, _resizeObserver).observe(__privateGet(this, _bodyElement));
|
|
999
1019
|
}
|
|
1000
1020
|
disconnectedCallback() {
|
|
1001
|
-
clearTimeout(
|
|
1021
|
+
clearTimeout(__privateGet(this, _timeoutId)), __privateGet(this, _resizeObserver).disconnect();
|
|
1002
1022
|
}
|
|
1003
1023
|
};
|
|
1004
|
-
|
|
1005
|
-
|
|
1024
|
+
_internals2 = new WeakMap(), _value = new WeakMap(), _bodyElement = new WeakMap(), _opened = new WeakMap(), _timeoutId = new WeakMap(), _resizeObserver = new WeakMap(), _resizeObserverListener = new WeakMap(), _SelectElement_instances = new WeakSet(), dispatchToggleEvent_fn = /* @__PURE__ */ __name(function() {
|
|
1025
|
+
dispatchBeforeSizeChangeEvent(this), this.dispatchEvent(
|
|
1006
1026
|
new CustomEvent("selectToggle", {
|
|
1007
1027
|
bubbles: !0,
|
|
1008
1028
|
composed: !0,
|
|
1009
1029
|
detail: {
|
|
1010
|
-
opened:
|
|
1030
|
+
opened: __privateGet(this, _opened)
|
|
1011
1031
|
}
|
|
1012
1032
|
})
|
|
1013
1033
|
);
|
|
1014
|
-
},
|
|
1015
|
-
let
|
|
1016
|
-
|
|
1017
|
-
var
|
|
1018
|
-
class
|
|
1034
|
+
}, "#dispatchToggleEvent"), __name(_SelectElement, "SelectElement"), _SelectElement.formAssociated = !0;
|
|
1035
|
+
let SelectElement = _SelectElement;
|
|
1036
|
+
isBrowser && !customElements.get("e-select") && customElements.define("e-select", SelectElement);
|
|
1037
|
+
var _selectElement;
|
|
1038
|
+
const _SelectUserElement = class _SelectUserElement extends HTMLElement {
|
|
1019
1039
|
constructor() {
|
|
1020
1040
|
super(...arguments);
|
|
1021
|
-
|
|
1041
|
+
__privateAdd(this, _selectElement, null);
|
|
1022
1042
|
}
|
|
1023
1043
|
get selectElement() {
|
|
1024
|
-
return
|
|
1044
|
+
return __privateGet(this, _selectElement);
|
|
1025
1045
|
}
|
|
1026
1046
|
connectedCallback() {
|
|
1027
|
-
var
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1047
|
+
var _a, _b;
|
|
1048
|
+
const selectElement = (_b = (_a = this.assignedSlot) == null ? void 0 : _a.getRootNode()) == null ? void 0 : _b.host;
|
|
1049
|
+
selectElement ? __privateSet(this, _selectElement, selectElement) : console.log(this, "e-select not found");
|
|
1030
1050
|
}
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1051
|
+
};
|
|
1052
|
+
_selectElement = new WeakMap(), __name(_SelectUserElement, "SelectUserElement");
|
|
1053
|
+
let SelectUserElement = _SelectUserElement;
|
|
1054
|
+
const stylesheet$6 = createStylesheet({
|
|
1034
1055
|
":host": {
|
|
1035
1056
|
width: "100%",
|
|
1036
1057
|
height: "40px",
|
|
@@ -1038,25 +1059,25 @@ const ws = E({
|
|
|
1038
1059
|
alignItems: "center"
|
|
1039
1060
|
}
|
|
1040
1061
|
});
|
|
1041
|
-
var
|
|
1042
|
-
class
|
|
1062
|
+
var _changeListener, _SelectOptionElement_instances, pick_fn;
|
|
1063
|
+
const _SelectOptionElement = class _SelectOptionElement extends SelectUserElement {
|
|
1043
1064
|
constructor() {
|
|
1044
1065
|
super();
|
|
1045
|
-
|
|
1046
|
-
|
|
1066
|
+
__privateAdd(this, _SelectOptionElement_instances);
|
|
1067
|
+
__privateAdd(this, _changeListener, /* @__PURE__ */ __name(() => {
|
|
1047
1068
|
this.selectElement.value === this.value ? this.style.display = "none" : this.style.display = "";
|
|
1048
|
-
});
|
|
1049
|
-
if (
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1069
|
+
}, "#changeListener"));
|
|
1070
|
+
if (isBrowser) {
|
|
1071
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
1072
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$6], element(this, {
|
|
1052
1073
|
tabindex: 0,
|
|
1053
|
-
onClick: () => {
|
|
1054
|
-
|
|
1055
|
-
},
|
|
1056
|
-
onKeydown: (
|
|
1057
|
-
|
|
1058
|
-
},
|
|
1059
|
-
children:
|
|
1074
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
1075
|
+
__privateMethod(this, _SelectOptionElement_instances, pick_fn).call(this);
|
|
1076
|
+
}, "onClick"),
|
|
1077
|
+
onKeydown: /* @__PURE__ */ __name((e) => {
|
|
1078
|
+
e.code === "Space" && __privateMethod(this, _SelectOptionElement_instances, pick_fn).call(this);
|
|
1079
|
+
}, "onKeydown"),
|
|
1080
|
+
children: slot()
|
|
1060
1081
|
});
|
|
1061
1082
|
}
|
|
1062
1083
|
}
|
|
@@ -1064,19 +1085,20 @@ class vs extends Ot {
|
|
|
1064
1085
|
return (this.hasAttribute("value") ? this.getAttribute("value") : this.innerText) || "";
|
|
1065
1086
|
}
|
|
1066
1087
|
connectedCallback() {
|
|
1067
|
-
super.connectedCallback(), this.hasAttribute("default") && (this.selectElement.value || (this.selectElement.value = this.value)), this.selectElement.addEventListener("change",
|
|
1068
|
-
|
|
1088
|
+
super.connectedCallback(), this.hasAttribute("default") && (this.selectElement.value || (this.selectElement.value = this.value)), this.selectElement.addEventListener("change", __privateGet(this, _changeListener)), setTimeout(() => {
|
|
1089
|
+
__privateGet(this, _changeListener).call(this);
|
|
1069
1090
|
});
|
|
1070
1091
|
}
|
|
1071
1092
|
disconnectedCallback() {
|
|
1072
|
-
this.selectElement.removeEventListener("change",
|
|
1093
|
+
this.selectElement.removeEventListener("change", __privateGet(this, _changeListener));
|
|
1073
1094
|
}
|
|
1074
|
-
}
|
|
1075
|
-
le = new WeakMap(), Le = new WeakSet(), mt = function() {
|
|
1076
|
-
this.selectElement.value = this.value, this.selectElement.close();
|
|
1077
1095
|
};
|
|
1078
|
-
|
|
1079
|
-
|
|
1096
|
+
_changeListener = new WeakMap(), _SelectOptionElement_instances = new WeakSet(), pick_fn = /* @__PURE__ */ __name(function() {
|
|
1097
|
+
this.selectElement.value = this.value, this.selectElement.close();
|
|
1098
|
+
}, "#pick"), __name(_SelectOptionElement, "SelectOptionElement");
|
|
1099
|
+
let SelectOptionElement = _SelectOptionElement;
|
|
1100
|
+
isBrowser && !customElements.get("e-select-option") && customElements.define("e-select-option", SelectOptionElement);
|
|
1101
|
+
const stylesheet$5 = createStylesheet({
|
|
1080
1102
|
":host": {
|
|
1081
1103
|
width: "100%",
|
|
1082
1104
|
height: "40px",
|
|
@@ -1088,7 +1110,7 @@ const ys = E({
|
|
|
1088
1110
|
flexShrink: "0",
|
|
1089
1111
|
width: "var(--arrow-size, 1em)",
|
|
1090
1112
|
height: "var(--arrow-size, 1em)",
|
|
1091
|
-
fill: `var(--arrow-color, ${
|
|
1113
|
+
fill: `var(--arrow-color, ${aptechkaTheme.colorMain.var})`,
|
|
1092
1114
|
transitionProperty: "transform",
|
|
1093
1115
|
transitionDuration: "var(--duration, var(--duration-short))"
|
|
1094
1116
|
},
|
|
@@ -1096,47 +1118,48 @@ const ys = E({
|
|
|
1096
1118
|
transform: "scaleY(-1)"
|
|
1097
1119
|
}
|
|
1098
1120
|
});
|
|
1099
|
-
var
|
|
1100
|
-
class
|
|
1121
|
+
var _valueElement, _changeListener2, _toggleListener;
|
|
1122
|
+
const _SelectHeadElement = class _SelectHeadElement extends SelectUserElement {
|
|
1101
1123
|
constructor() {
|
|
1102
1124
|
super();
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
const
|
|
1125
|
+
__privateAdd(this, _valueElement, null);
|
|
1126
|
+
__privateAdd(this, _changeListener2, /* @__PURE__ */ __name(() => {
|
|
1127
|
+
const currentOption = this.selectElement.shadowRoot.querySelector(
|
|
1106
1128
|
".body slot"
|
|
1107
|
-
).assignedElements().find((
|
|
1108
|
-
|
|
1109
|
-
});
|
|
1110
|
-
|
|
1129
|
+
).assignedElements().find((e) => e.value === this.selectElement.value);
|
|
1130
|
+
currentOption && (__privateGet(this, _valueElement).innerHTML = currentOption.innerHTML);
|
|
1131
|
+
}, "#changeListener"));
|
|
1132
|
+
__privateAdd(this, _toggleListener, /* @__PURE__ */ __name(() => {
|
|
1111
1133
|
this.classList.toggle("opened", this.selectElement.opened);
|
|
1112
|
-
});
|
|
1113
|
-
if (
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1134
|
+
}, "#toggleListener"));
|
|
1135
|
+
if (isBrowser) {
|
|
1136
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
1137
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$5], element(this, {
|
|
1116
1138
|
children: [
|
|
1117
|
-
|
|
1118
|
-
|
|
1139
|
+
slot(),
|
|
1140
|
+
slot({
|
|
1119
1141
|
name: "arrow",
|
|
1120
|
-
children:
|
|
1142
|
+
children: element(arrowIcon, { class: "default-arrow" })
|
|
1121
1143
|
})
|
|
1122
1144
|
]
|
|
1123
1145
|
}), this.slot = "head";
|
|
1124
1146
|
}
|
|
1125
1147
|
}
|
|
1126
1148
|
connectedCallback() {
|
|
1127
|
-
super.connectedCallback(),
|
|
1149
|
+
super.connectedCallback(), __privateSet(this, _valueElement, this.querySelector("[data-value-holder]") || this), this.selectElement.addEventListener("change", __privateGet(this, _changeListener2)), __privateGet(this, _changeListener2).call(this), this.selectElement.addEventListener("selectToggle", __privateGet(this, _toggleListener));
|
|
1128
1150
|
}
|
|
1129
1151
|
disconnectedCallback() {
|
|
1130
|
-
this.selectElement.removeEventListener("change",
|
|
1152
|
+
this.selectElement.removeEventListener("change", __privateGet(this, _changeListener2)), this.selectElement.removeEventListener("selectToggle", __privateGet(this, _toggleListener));
|
|
1131
1153
|
}
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1154
|
+
};
|
|
1155
|
+
_valueElement = new WeakMap(), _changeListener2 = new WeakMap(), _toggleListener = new WeakMap(), __name(_SelectHeadElement, "SelectHeadElement");
|
|
1156
|
+
let SelectHeadElement = _SelectHeadElement;
|
|
1157
|
+
isBrowser && !customElements.get("e-select-head") && customElements.define("e-select-head", SelectHeadElement);
|
|
1158
|
+
const stylesheet$4 = createStylesheet({
|
|
1136
1159
|
"e-select": {
|
|
1137
1160
|
display: "block",
|
|
1138
1161
|
width: "100%",
|
|
1139
|
-
"--arrow-color":
|
|
1162
|
+
"--arrow-color": aptechkaTheme.colorFont.var
|
|
1140
1163
|
},
|
|
1141
1164
|
"e-select-head": {
|
|
1142
1165
|
width: "100%",
|
|
@@ -1153,54 +1176,55 @@ const ks = E({
|
|
|
1153
1176
|
fontSize: "var(--font-size-small)"
|
|
1154
1177
|
},
|
|
1155
1178
|
"e-select-option:hover": {
|
|
1156
|
-
color:
|
|
1179
|
+
color: aptechkaTheme.colorActive.var
|
|
1157
1180
|
},
|
|
1158
1181
|
svg: {
|
|
1159
1182
|
width: "16px",
|
|
1160
1183
|
height: "16px",
|
|
1161
|
-
fill:
|
|
1184
|
+
fill: aptechkaTheme.colorFont.var,
|
|
1162
1185
|
transitionProperty: "transform",
|
|
1163
1186
|
transitionDuration: "var(--duration-short)"
|
|
1164
1187
|
},
|
|
1165
1188
|
".opened svg": {
|
|
1166
1189
|
transform: "scaleY(-1)"
|
|
1167
1190
|
}
|
|
1168
|
-
})
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
children: g("e-select", {
|
|
1191
|
+
}), _TweakerSelectManagerElement = class _TweakerSelectManagerElement extends TweakerStoreManagerElement {
|
|
1192
|
+
constructor(...stores) {
|
|
1193
|
+
var _a;
|
|
1194
|
+
super(...stores);
|
|
1195
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
1196
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$4];
|
|
1197
|
+
const variants = ((_a = this.firstStore.__manager) == null ? void 0 : _a.variants) || [];
|
|
1198
|
+
element(this, {
|
|
1199
|
+
children: element("e-select", {
|
|
1178
1200
|
value: this.firstStore,
|
|
1179
|
-
onChange: (
|
|
1180
|
-
this.updateStores(
|
|
1181
|
-
},
|
|
1201
|
+
onChange: /* @__PURE__ */ __name((e) => {
|
|
1202
|
+
this.updateStores(e.currentTarget.value);
|
|
1203
|
+
}, "onChange"),
|
|
1182
1204
|
lightChildren: [
|
|
1183
|
-
|
|
1205
|
+
element("e-select-head", {
|
|
1184
1206
|
lightChildren: [
|
|
1185
|
-
|
|
1207
|
+
span({
|
|
1186
1208
|
"data-value-holder": ""
|
|
1187
1209
|
})
|
|
1188
1210
|
]
|
|
1189
1211
|
}),
|
|
1190
1212
|
// @ts-ignore
|
|
1191
|
-
...
|
|
1192
|
-
(
|
|
1193
|
-
lightChildren:
|
|
1194
|
-
default:
|
|
1213
|
+
...variants.map(
|
|
1214
|
+
(v, i) => element("e-select-option", {
|
|
1215
|
+
lightChildren: v,
|
|
1216
|
+
default: i === 0 ? !0 : null
|
|
1195
1217
|
})
|
|
1196
1218
|
)
|
|
1197
1219
|
]
|
|
1198
1220
|
})
|
|
1199
1221
|
});
|
|
1200
1222
|
}
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1223
|
+
};
|
|
1224
|
+
__name(_TweakerSelectManagerElement, "TweakerSelectManagerElement");
|
|
1225
|
+
let TweakerSelectManagerElement = _TweakerSelectManagerElement;
|
|
1226
|
+
isBrowser && !customElements.get("e-tweaker-select-manager") && customElements.define("e-tweaker-select-manager", TweakerSelectManagerElement);
|
|
1227
|
+
const stylesheet$3 = createStylesheet({
|
|
1204
1228
|
":host": {
|
|
1205
1229
|
width: "100%",
|
|
1206
1230
|
display: "flex",
|
|
@@ -1219,44 +1243,45 @@ const Es = E({
|
|
|
1219
1243
|
margin: "0",
|
|
1220
1244
|
padding: "0 var(--gap-small)",
|
|
1221
1245
|
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
1222
|
-
borderRadius:
|
|
1246
|
+
borderRadius: aptechkaTheme.borderRadius.var
|
|
1223
1247
|
}
|
|
1224
|
-
})
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
e.adoptedStyleSheets = [...e.adoptedStyleSheets, Es], g(this, {
|
|
1248
|
+
}), _TweakerStringManagerElement = class _TweakerStringManagerElement extends TweakerStoreManagerElement {
|
|
1249
|
+
constructor(...stores) {
|
|
1250
|
+
super(...stores);
|
|
1251
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
1252
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$3], element(this, {
|
|
1230
1253
|
children: [
|
|
1231
|
-
|
|
1254
|
+
input({
|
|
1232
1255
|
class: "text-input",
|
|
1233
1256
|
type: "string",
|
|
1234
1257
|
value: this.firstStore,
|
|
1235
|
-
onChange: (
|
|
1258
|
+
onChange: /* @__PURE__ */ __name((e) => {
|
|
1236
1259
|
this.updateStores(
|
|
1237
|
-
|
|
1260
|
+
e.currentTarget.value
|
|
1238
1261
|
);
|
|
1239
|
-
}
|
|
1262
|
+
}, "onChange")
|
|
1240
1263
|
})
|
|
1241
1264
|
]
|
|
1242
1265
|
});
|
|
1243
1266
|
}
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1267
|
+
};
|
|
1268
|
+
__name(_TweakerStringManagerElement, "TweakerStringManagerElement");
|
|
1269
|
+
let TweakerStringManagerElement = _TweakerStringManagerElement;
|
|
1270
|
+
isBrowser && !customElements.get("e-tweaker-string-manager") && customElements.define("e-tweaker-string-manager", TweakerStringManagerElement);
|
|
1271
|
+
const tweakerManagerConstructors = {
|
|
1272
|
+
boolean: TweakerBooleanManagerElement,
|
|
1273
|
+
color: TweakerColorManagerElement,
|
|
1274
|
+
link: TweakerLinkManagerElement,
|
|
1275
|
+
number: TweakerNumberManagerElement,
|
|
1276
|
+
select: TweakerSelectManagerElement,
|
|
1277
|
+
string: TweakerStringManagerElement
|
|
1278
|
+
}, stylesheet$2 = createStylesheet({
|
|
1254
1279
|
":host": {
|
|
1255
1280
|
display: "grid",
|
|
1256
1281
|
gridAutoFlow: "column",
|
|
1257
1282
|
gridTemplateColumns: "0.5fr 1fr",
|
|
1258
1283
|
alignItems: "center",
|
|
1259
|
-
color:
|
|
1284
|
+
color: aptechkaTheme.colorFont.var,
|
|
1260
1285
|
gap: "var(--gap-medium)"
|
|
1261
1286
|
},
|
|
1262
1287
|
":host(.disabled)": {
|
|
@@ -1279,7 +1304,7 @@ const xs = {
|
|
|
1279
1304
|
margin: "0",
|
|
1280
1305
|
border: "none",
|
|
1281
1306
|
background: "none",
|
|
1282
|
-
fill:
|
|
1307
|
+
fill: aptechkaTheme.colorFont.var,
|
|
1283
1308
|
transitionDuration: "var(--duration-short)",
|
|
1284
1309
|
transitionProperty: "fill, opacity",
|
|
1285
1310
|
opacity: "0"
|
|
@@ -1288,105 +1313,106 @@ const xs = {
|
|
|
1288
1313
|
opacity: "1"
|
|
1289
1314
|
},
|
|
1290
1315
|
".head-button:hover": {
|
|
1291
|
-
fill:
|
|
1316
|
+
fill: aptechkaTheme.colorActive.var
|
|
1292
1317
|
},
|
|
1293
1318
|
".head-button svg": {
|
|
1294
1319
|
width: "100%",
|
|
1295
1320
|
height: "100%"
|
|
1296
1321
|
}
|
|
1297
1322
|
});
|
|
1298
|
-
var
|
|
1299
|
-
class
|
|
1300
|
-
constructor(
|
|
1301
|
-
var
|
|
1323
|
+
var _stores2, _key, _name, _pointerEnter, _storeManager, _storesChangeListener, _keydownListener;
|
|
1324
|
+
const _TweakerFieldElement = class _TweakerFieldElement extends HTMLElement {
|
|
1325
|
+
constructor(parameters) {
|
|
1326
|
+
var _a, _b;
|
|
1302
1327
|
super();
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
});
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1328
|
+
__privateAdd(this, _stores2, []);
|
|
1329
|
+
__privateAdd(this, _key);
|
|
1330
|
+
__privateAdd(this, _name);
|
|
1331
|
+
__privateAdd(this, _pointerEnter, !1);
|
|
1332
|
+
__privateAdd(this, _storeManager);
|
|
1333
|
+
__privateAdd(this, _storesChangeListener, /* @__PURE__ */ __name(() => {
|
|
1334
|
+
activeStores.current.find((s) => __privateGet(this, _stores2).includes(s)) || this.remove();
|
|
1335
|
+
}, "#storesChangeListener"));
|
|
1336
|
+
__privateAdd(this, _keydownListener, /* @__PURE__ */ __name((e) => {
|
|
1337
|
+
__privateGet(this, _pointerEnter) && ((e.metaKey || e.ctrlKey) && e.code === "KeyC" ? navigator.clipboard.writeText(__privateGet(this, _stores2)[0].current) : (e.metaKey || e.ctrlKey) && e.code === "KeyR" && (__privateGet(this, _stores2).forEach((store) => {
|
|
1338
|
+
store.reset();
|
|
1314
1339
|
}), e.preventDefault()));
|
|
1315
|
-
});
|
|
1316
|
-
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1319
|
-
|
|
1340
|
+
}, "#keydownListener"));
|
|
1341
|
+
__privateSet(this, _stores2, [parameters.store]), __privateSet(this, _key, parameters.store.name), __privateSet(this, _name, __privateGet(this, _key).split(".").slice(-1).toString());
|
|
1342
|
+
const type = ((_a = parameters.store.__manager) == null ? void 0 : _a.type) || "string";
|
|
1343
|
+
__privateSet(this, _storeManager, new tweakerManagerConstructors[type](
|
|
1344
|
+
__privateGet(this, _stores2)[0]
|
|
1320
1345
|
));
|
|
1321
|
-
const
|
|
1322
|
-
|
|
1346
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
1347
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$2], element(this, {
|
|
1323
1348
|
class: {
|
|
1324
|
-
disabled: ((
|
|
1325
|
-
},
|
|
1326
|
-
onPointerleave: () => {
|
|
1327
|
-
c(this, ue, !1);
|
|
1328
|
-
},
|
|
1329
|
-
onPointerenter: () => {
|
|
1330
|
-
c(this, ue, !0);
|
|
1349
|
+
disabled: ((_b = parameters.store.__manager) == null ? void 0 : _b.disabled) || !1
|
|
1331
1350
|
},
|
|
1351
|
+
onPointerleave: /* @__PURE__ */ __name(() => {
|
|
1352
|
+
__privateSet(this, _pointerEnter, !1);
|
|
1353
|
+
}, "onPointerleave"),
|
|
1354
|
+
onPointerenter: /* @__PURE__ */ __name(() => {
|
|
1355
|
+
__privateSet(this, _pointerEnter, !0);
|
|
1356
|
+
}, "onPointerenter"),
|
|
1332
1357
|
children: [
|
|
1333
|
-
|
|
1358
|
+
div({
|
|
1334
1359
|
class: "head",
|
|
1335
1360
|
children: [
|
|
1336
|
-
|
|
1337
|
-
|
|
1361
|
+
div({ class: "name", children: __privateGet(this, _name) + ":" }),
|
|
1362
|
+
div({
|
|
1338
1363
|
class: "head-buttons",
|
|
1339
1364
|
children: [
|
|
1340
|
-
|
|
1365
|
+
button({
|
|
1341
1366
|
class: "head-button",
|
|
1342
|
-
children:
|
|
1343
|
-
onClick: () => {
|
|
1344
|
-
navigator.clipboard.writeText(
|
|
1345
|
-
}
|
|
1367
|
+
children: copyIcon,
|
|
1368
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
1369
|
+
navigator.clipboard.writeText(__privateGet(this, _stores2)[0].current);
|
|
1370
|
+
}, "onClick")
|
|
1346
1371
|
}),
|
|
1347
|
-
|
|
1372
|
+
button({
|
|
1348
1373
|
class: "head-button",
|
|
1349
|
-
children:
|
|
1350
|
-
onClick: () => {
|
|
1351
|
-
|
|
1352
|
-
|
|
1374
|
+
children: resetIcon,
|
|
1375
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
1376
|
+
__privateGet(this, _stores2).forEach((store) => {
|
|
1377
|
+
store.reset();
|
|
1353
1378
|
});
|
|
1354
|
-
}
|
|
1379
|
+
}, "onClick")
|
|
1355
1380
|
})
|
|
1356
1381
|
]
|
|
1357
1382
|
})
|
|
1358
1383
|
]
|
|
1359
1384
|
}),
|
|
1360
|
-
|
|
1385
|
+
__privateGet(this, _storeManager)
|
|
1361
1386
|
]
|
|
1362
1387
|
});
|
|
1363
1388
|
}
|
|
1364
1389
|
get key() {
|
|
1365
|
-
return
|
|
1390
|
+
return __privateGet(this, _key);
|
|
1366
1391
|
}
|
|
1367
1392
|
get name() {
|
|
1368
|
-
return
|
|
1393
|
+
return __privateGet(this, _name);
|
|
1369
1394
|
}
|
|
1370
1395
|
get stores() {
|
|
1371
|
-
return
|
|
1396
|
+
return __privateGet(this, _stores2);
|
|
1372
1397
|
}
|
|
1373
|
-
addStore(
|
|
1374
|
-
|
|
1398
|
+
addStore(store) {
|
|
1399
|
+
__privateGet(this, _storeManager).addStore(store);
|
|
1375
1400
|
}
|
|
1376
1401
|
connectedCallback() {
|
|
1377
|
-
|
|
1402
|
+
activeStores.subscribe(__privateGet(this, _storesChangeListener)), addEventListener("keydown", __privateGet(this, _keydownListener)), dispatchSizeChangeEvent(this);
|
|
1378
1403
|
}
|
|
1379
1404
|
disconnectedCallback() {
|
|
1380
|
-
|
|
1405
|
+
activeStores.unsubscribe(__privateGet(this, _storesChangeListener)), removeEventListener("keydown", __privateGet(this, _keydownListener));
|
|
1381
1406
|
}
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1407
|
+
};
|
|
1408
|
+
_stores2 = new WeakMap(), _key = new WeakMap(), _name = new WeakMap(), _pointerEnter = new WeakMap(), _storeManager = new WeakMap(), _storesChangeListener = new WeakMap(), _keydownListener = new WeakMap(), __name(_TweakerFieldElement, "TweakerFieldElement");
|
|
1409
|
+
let TweakerFieldElement = _TweakerFieldElement;
|
|
1410
|
+
isBrowser && !customElements.get("e-tweaker-field") && customElements.define("e-tweaker-field", TweakerFieldElement);
|
|
1411
|
+
const stylesheet$1 = createStylesheet({
|
|
1386
1412
|
".wrapper": {
|
|
1387
1413
|
boxSizing: "border-box",
|
|
1388
1414
|
backgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
1389
|
-
borderRadius:
|
|
1415
|
+
borderRadius: aptechkaTheme.borderRadius.var
|
|
1390
1416
|
},
|
|
1391
1417
|
".head": {
|
|
1392
1418
|
boxSizing: "border-box",
|
|
@@ -1397,12 +1423,12 @@ const Ls = E({
|
|
|
1397
1423
|
display: "flex",
|
|
1398
1424
|
alignItems: "center",
|
|
1399
1425
|
justifyContent: "space-between",
|
|
1400
|
-
backgroundColor:
|
|
1401
|
-
borderRadius:
|
|
1426
|
+
backgroundColor: aptechkaTheme.colorMainAux.var,
|
|
1427
|
+
borderRadius: aptechkaTheme.borderRadius.var
|
|
1402
1428
|
},
|
|
1403
1429
|
".name": {
|
|
1404
1430
|
fontSize: "var(--font-size-large)",
|
|
1405
|
-
color:
|
|
1431
|
+
color: aptechkaTheme.colorFont.var
|
|
1406
1432
|
},
|
|
1407
1433
|
".body": {
|
|
1408
1434
|
display: "none",
|
|
@@ -1430,127 +1456,127 @@ const Ls = E({
|
|
|
1430
1456
|
".arrow": {
|
|
1431
1457
|
width: "20px",
|
|
1432
1458
|
height: "20px",
|
|
1433
|
-
fill:
|
|
1459
|
+
fill: aptechkaTheme.colorFont.var,
|
|
1434
1460
|
transition: "transform var(--duration-short)"
|
|
1435
1461
|
},
|
|
1436
1462
|
".opened .arrow": {
|
|
1437
1463
|
transform: "scaleY(-1)"
|
|
1438
1464
|
}
|
|
1439
1465
|
});
|
|
1440
|
-
var
|
|
1441
|
-
const
|
|
1442
|
-
constructor(
|
|
1466
|
+
var _key2, _head, _content, _mutationObserver, _bodyElement2, _contentElement, _contentRootElement, _mutationListener;
|
|
1467
|
+
const _TweakerFolderElement = class _TweakerFolderElement extends HTMLElement {
|
|
1468
|
+
constructor(parameters) {
|
|
1443
1469
|
super();
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
let
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
}),
|
|
1456
|
-
(
|
|
1457
|
-
),
|
|
1458
|
-
});
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1470
|
+
__privateAdd(this, _key2);
|
|
1471
|
+
__privateAdd(this, _head, new Store(null));
|
|
1472
|
+
__privateAdd(this, _content, new Store([]));
|
|
1473
|
+
__privateAdd(this, _mutationObserver);
|
|
1474
|
+
__privateAdd(this, _bodyElement2, null);
|
|
1475
|
+
__privateAdd(this, _contentElement, null);
|
|
1476
|
+
__privateAdd(this, _contentRootElement, null);
|
|
1477
|
+
__privateAdd(this, _mutationListener, /* @__PURE__ */ __name((mutations) => {
|
|
1478
|
+
let removedNodes = [], addedNodes = [];
|
|
1479
|
+
mutations.forEach((m) => {
|
|
1480
|
+
removedNodes = [...removedNodes, ...m.removedNodes], addedNodes = [...addedNodes, ...m.addedNodes];
|
|
1481
|
+
}), __privateGet(this, _content).current = __privateGet(this, _content).current.filter(
|
|
1482
|
+
(v) => !removedNodes.includes(v)
|
|
1483
|
+
), __privateGet(this, _key2) && !__privateGet(this, _content).current.length && !addedNodes.length && this.remove();
|
|
1484
|
+
}, "#mutationListener"));
|
|
1485
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
1486
|
+
shadow.adoptedStyleSheets = [...shadow.adoptedStyleSheets, stylesheet$1], __privateSet(this, _key2, parameters.key), __privateSet(this, _mutationObserver, new MutationObserver(__privateGet(this, _mutationListener))), element(this, {
|
|
1461
1487
|
children: [
|
|
1462
|
-
|
|
1488
|
+
div({
|
|
1463
1489
|
class: "wrapper",
|
|
1464
1490
|
children: [
|
|
1465
|
-
|
|
1491
|
+
div({
|
|
1466
1492
|
class: "head",
|
|
1467
|
-
onClick: (
|
|
1468
|
-
this.classList.toggle("opened"), this.classList.contains("opened") ?
|
|
1469
|
-
},
|
|
1493
|
+
onClick: /* @__PURE__ */ __name((e) => {
|
|
1494
|
+
this.classList.toggle("opened"), this.classList.contains("opened") ? tweakerStorage.openPanel(__privateGet(this, _key2)) : tweakerStorage.closePanel(__privateGet(this, _key2));
|
|
1495
|
+
}, "onClick"),
|
|
1470
1496
|
children: [
|
|
1471
|
-
|
|
1497
|
+
__privateGet(this, _key2) ? div({
|
|
1472
1498
|
class: "name",
|
|
1473
|
-
children: [
|
|
1499
|
+
children: [__privateGet(this, _key2).split(".").slice(-1).toString()]
|
|
1474
1500
|
}) : null,
|
|
1475
|
-
|
|
1476
|
-
|
|
1501
|
+
__privateGet(this, _head),
|
|
1502
|
+
element(arrowIcon, {
|
|
1477
1503
|
class: "arrow"
|
|
1478
1504
|
})
|
|
1479
1505
|
]
|
|
1480
1506
|
}),
|
|
1481
|
-
|
|
1507
|
+
div({
|
|
1482
1508
|
class: "body",
|
|
1483
|
-
ref: (
|
|
1484
|
-
|
|
1485
|
-
},
|
|
1486
|
-
children:
|
|
1509
|
+
ref: /* @__PURE__ */ __name((e) => {
|
|
1510
|
+
__privateSet(this, _bodyElement2, e);
|
|
1511
|
+
}, "ref"),
|
|
1512
|
+
children: div({
|
|
1487
1513
|
class: "body-content",
|
|
1488
|
-
children:
|
|
1489
|
-
ref: (
|
|
1490
|
-
|
|
1491
|
-
}
|
|
1514
|
+
children: __privateGet(this, _content),
|
|
1515
|
+
ref: /* @__PURE__ */ __name((e) => {
|
|
1516
|
+
__privateSet(this, _contentElement, e), __privateSet(this, _contentRootElement, e.firstElementChild);
|
|
1517
|
+
}, "ref")
|
|
1492
1518
|
})
|
|
1493
1519
|
})
|
|
1494
1520
|
]
|
|
1495
1521
|
})
|
|
1496
1522
|
]
|
|
1497
|
-
}),
|
|
1523
|
+
}), parameters != null && parameters.storeBox && this.handleStore(parameters.storeBox);
|
|
1498
1524
|
}
|
|
1499
1525
|
get key() {
|
|
1500
|
-
return
|
|
1526
|
+
return __privateGet(this, _key2);
|
|
1501
1527
|
}
|
|
1502
1528
|
get head() {
|
|
1503
|
-
return
|
|
1529
|
+
return __privateGet(this, _head);
|
|
1504
1530
|
}
|
|
1505
1531
|
get content() {
|
|
1506
|
-
return
|
|
1532
|
+
return __privateGet(this, _content);
|
|
1507
1533
|
}
|
|
1508
1534
|
get bodyElement() {
|
|
1509
|
-
return
|
|
1535
|
+
return __privateGet(this, _bodyElement2);
|
|
1510
1536
|
}
|
|
1511
1537
|
get contentElement() {
|
|
1512
|
-
return
|
|
1538
|
+
return __privateGet(this, _contentElement);
|
|
1513
1539
|
}
|
|
1514
1540
|
connectedCallback() {
|
|
1515
|
-
|
|
1541
|
+
tweakerStorage.isPanelOpened(__privateGet(this, _key2)) && this.classList.add("opened"), setTimeout(() => {
|
|
1516
1542
|
this.classList.add("transition-allowed");
|
|
1517
|
-
}),
|
|
1543
|
+
}), __privateGet(this, _mutationObserver).observe(__privateGet(this, _contentRootElement), {
|
|
1518
1544
|
childList: !0
|
|
1519
1545
|
});
|
|
1520
1546
|
}
|
|
1521
|
-
handleStore(
|
|
1522
|
-
if (
|
|
1523
|
-
const
|
|
1524
|
-
|
|
1525
|
-
store:
|
|
1526
|
-
remainingFolders:
|
|
1527
|
-
}) :
|
|
1528
|
-
...
|
|
1529
|
-
new
|
|
1530
|
-
key
|
|
1547
|
+
handleStore(storeBox) {
|
|
1548
|
+
if (storeBox.remainingFolders.length) {
|
|
1549
|
+
const splittedName = storeBox.store.name.split("."), key = splittedName.slice(0, splittedName.length - storeBox.remainingFolders.length).join("."), found = __privateGet(this, _content).current.find((v) => v.key === key);
|
|
1550
|
+
found instanceof _TweakerFolderElement ? found.handleStore({
|
|
1551
|
+
store: storeBox.store,
|
|
1552
|
+
remainingFolders: storeBox.remainingFolders.slice(1)
|
|
1553
|
+
}) : __privateGet(this, _content).current = [
|
|
1554
|
+
...__privateGet(this, _content).current,
|
|
1555
|
+
new _TweakerFolderElement({
|
|
1556
|
+
key,
|
|
1531
1557
|
storeBox: {
|
|
1532
|
-
store:
|
|
1533
|
-
remainingFolders:
|
|
1558
|
+
store: storeBox.store,
|
|
1559
|
+
remainingFolders: storeBox.remainingFolders.slice(1)
|
|
1534
1560
|
}
|
|
1535
1561
|
})
|
|
1536
1562
|
];
|
|
1537
1563
|
} else {
|
|
1538
|
-
const
|
|
1539
|
-
(
|
|
1564
|
+
const found = __privateGet(this, _content).current.find(
|
|
1565
|
+
(v) => v.key === storeBox.store.name
|
|
1540
1566
|
);
|
|
1541
|
-
|
|
1542
|
-
...
|
|
1543
|
-
new
|
|
1544
|
-
store:
|
|
1567
|
+
found instanceof TweakerFieldElement ? found.addStore(storeBox.store) : __privateGet(this, _content).current = [
|
|
1568
|
+
...__privateGet(this, _content).current,
|
|
1569
|
+
new TweakerFieldElement({
|
|
1570
|
+
store: storeBox.store
|
|
1545
1571
|
})
|
|
1546
1572
|
];
|
|
1547
1573
|
}
|
|
1548
1574
|
}
|
|
1549
1575
|
};
|
|
1550
|
-
|
|
1551
|
-
let
|
|
1552
|
-
|
|
1553
|
-
const
|
|
1576
|
+
_key2 = new WeakMap(), _head = new WeakMap(), _content = new WeakMap(), _mutationObserver = new WeakMap(), _bodyElement2 = new WeakMap(), _contentElement = new WeakMap(), _contentRootElement = new WeakMap(), _mutationListener = new WeakMap(), __name(_TweakerFolderElement, "TweakerFolderElement");
|
|
1577
|
+
let TweakerFolderElement = _TweakerFolderElement;
|
|
1578
|
+
isBrowser && !customElements.get("e-tweaker-folder") && customElements.define("e-tweaker-folder", TweakerFolderElement);
|
|
1579
|
+
const stylesheet = createStylesheet({
|
|
1554
1580
|
":host": {
|
|
1555
1581
|
"--tweaker-width": "550px",
|
|
1556
1582
|
"--tweaker-offset": "20px",
|
|
@@ -1569,8 +1595,8 @@ const Ts = E({
|
|
|
1569
1595
|
top: "var(--tweaker-offset)",
|
|
1570
1596
|
right: "var(--tweaker-offset)",
|
|
1571
1597
|
width: "var(--tweaker-width)",
|
|
1572
|
-
backgroundColor:
|
|
1573
|
-
borderRadius:
|
|
1598
|
+
backgroundColor: aptechkaTheme.colorMain.var,
|
|
1599
|
+
borderRadius: aptechkaTheme.borderRadius.var,
|
|
1574
1600
|
transition: "opacity 0.1s",
|
|
1575
1601
|
zIndex: "100",
|
|
1576
1602
|
opacity: "0.1"
|
|
@@ -1599,12 +1625,12 @@ const Ts = E({
|
|
|
1599
1625
|
margin: "0",
|
|
1600
1626
|
background: "none",
|
|
1601
1627
|
border: "none",
|
|
1602
|
-
fill:
|
|
1628
|
+
fill: aptechkaTheme.colorFont.var,
|
|
1603
1629
|
transitionProperty: "fill",
|
|
1604
1630
|
transitionDuration: "var(--duration-short)"
|
|
1605
1631
|
},
|
|
1606
1632
|
".tweaker-button:hover": {
|
|
1607
|
-
fill:
|
|
1633
|
+
fill: aptechkaTheme.colorActive.var
|
|
1608
1634
|
},
|
|
1609
1635
|
".tweaker-button svg": {
|
|
1610
1636
|
width: "100%",
|
|
@@ -1625,7 +1651,7 @@ const Ts = E({
|
|
|
1625
1651
|
":host .body-content::-webkit-scrollbar": {
|
|
1626
1652
|
display: "none"
|
|
1627
1653
|
},
|
|
1628
|
-
[`@media ${
|
|
1654
|
+
[`@media ${ViewportMediaRules["<=mobile"]}`]: {
|
|
1629
1655
|
":host": {
|
|
1630
1656
|
position: "absolute",
|
|
1631
1657
|
top: "0",
|
|
@@ -1642,125 +1668,126 @@ const Ts = E({
|
|
|
1642
1668
|
}
|
|
1643
1669
|
}
|
|
1644
1670
|
});
|
|
1645
|
-
var
|
|
1646
|
-
class
|
|
1671
|
+
var _scrollRestored, _unloadListener, _storesChangeListener2;
|
|
1672
|
+
const _TweakerElement = class _TweakerElement extends TweakerFolderElement {
|
|
1647
1673
|
constructor() {
|
|
1648
1674
|
super({
|
|
1649
1675
|
key: ""
|
|
1650
1676
|
});
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
});
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
if (
|
|
1658
|
-
const
|
|
1677
|
+
__privateAdd(this, _scrollRestored, !1);
|
|
1678
|
+
__privateAdd(this, _unloadListener, /* @__PURE__ */ __name(() => {
|
|
1679
|
+
tweakerStorage.save();
|
|
1680
|
+
}, "#unloadListener"));
|
|
1681
|
+
__privateAdd(this, _storesChangeListener2, debounce(() => {
|
|
1682
|
+
activeStores.current.forEach((store) => {
|
|
1683
|
+
if (store.name) {
|
|
1684
|
+
const sname = store.name.split(".");
|
|
1659
1685
|
this.handleStore({
|
|
1660
|
-
store
|
|
1661
|
-
remainingFolders:
|
|
1686
|
+
store,
|
|
1687
|
+
remainingFolders: sname.length > 1 ? sname.slice(0, -1) : []
|
|
1662
1688
|
});
|
|
1663
1689
|
}
|
|
1664
|
-
}),
|
|
1665
|
-
top:
|
|
1690
|
+
}), __privateGet(this, _scrollRestored) || (__privateSet(this, _scrollRestored, !0), this.contentElement.scroll({
|
|
1691
|
+
top: tweakerStorage.scrollValue
|
|
1666
1692
|
}), this.contentElement.addEventListener("scroll", () => {
|
|
1667
|
-
|
|
1693
|
+
tweakerStorage.scrollValue = this.contentElement.scrollTop;
|
|
1668
1694
|
}));
|
|
1669
1695
|
}, 10));
|
|
1670
|
-
|
|
1696
|
+
tweakerStorage.load(), this.shadowRoot.adoptedStyleSheets = [
|
|
1671
1697
|
...this.shadowRoot.adoptedStyleSheets,
|
|
1672
|
-
|
|
1698
|
+
stylesheet
|
|
1673
1699
|
], this.head.current = [
|
|
1674
|
-
|
|
1700
|
+
div({
|
|
1675
1701
|
class: "tweaker-buttons",
|
|
1676
|
-
onClick: (e) => {
|
|
1702
|
+
onClick: /* @__PURE__ */ __name((e) => {
|
|
1677
1703
|
e.stopPropagation();
|
|
1678
|
-
},
|
|
1704
|
+
}, "onClick"),
|
|
1679
1705
|
children: [
|
|
1680
|
-
|
|
1706
|
+
button({
|
|
1681
1707
|
class: "tweaker-button",
|
|
1682
|
-
children:
|
|
1683
|
-
onClick: () => {
|
|
1684
|
-
|
|
1685
|
-
}
|
|
1708
|
+
children: resetIcon,
|
|
1709
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
1710
|
+
storeRegistry.resetState();
|
|
1711
|
+
}, "onClick")
|
|
1686
1712
|
}),
|
|
1687
|
-
|
|
1713
|
+
button({
|
|
1688
1714
|
class: ["tweaker-button"],
|
|
1689
|
-
children: [
|
|
1690
|
-
onClick: () => {
|
|
1715
|
+
children: [copyIcon],
|
|
1716
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
1691
1717
|
navigator.clipboard.writeText(
|
|
1692
|
-
JSON.stringify(
|
|
1718
|
+
JSON.stringify(storeRegistry.getState())
|
|
1693
1719
|
);
|
|
1694
|
-
}
|
|
1720
|
+
}, "onClick")
|
|
1695
1721
|
}),
|
|
1696
|
-
|
|
1722
|
+
button({
|
|
1697
1723
|
class: "tweaker-button",
|
|
1698
|
-
children:
|
|
1699
|
-
onClick: () => {
|
|
1700
|
-
|
|
1701
|
-
}
|
|
1724
|
+
children: downloadIcon,
|
|
1725
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
1726
|
+
createJSONAndSave(storeRegistry.name, storeRegistry.getState());
|
|
1727
|
+
}, "onClick")
|
|
1702
1728
|
}),
|
|
1703
|
-
|
|
1729
|
+
label({
|
|
1704
1730
|
class: "tweaker-button",
|
|
1705
1731
|
children: [
|
|
1706
|
-
|
|
1707
|
-
|
|
1732
|
+
uploadIcon,
|
|
1733
|
+
input({
|
|
1708
1734
|
type: "file",
|
|
1709
1735
|
style: {
|
|
1710
1736
|
display: "none"
|
|
1711
1737
|
},
|
|
1712
|
-
onChange: (e) => {
|
|
1713
|
-
var
|
|
1714
|
-
const
|
|
1715
|
-
if (
|
|
1716
|
-
const
|
|
1717
|
-
|
|
1718
|
-
var
|
|
1719
|
-
const
|
|
1720
|
-
|
|
1721
|
-
},
|
|
1738
|
+
onChange: /* @__PURE__ */ __name((e) => {
|
|
1739
|
+
var _a;
|
|
1740
|
+
const file = (_a = e.currentTarget.files) == null ? void 0 : _a[0];
|
|
1741
|
+
if (file) {
|
|
1742
|
+
const reader = new FileReader();
|
|
1743
|
+
reader.onload = (e2) => {
|
|
1744
|
+
var _a2, _b;
|
|
1745
|
+
const result = (_b = (_a2 = e2.target) == null ? void 0 : _a2.result) == null ? void 0 : _b.toString();
|
|
1746
|
+
result && storeRegistry.loadState(result);
|
|
1747
|
+
}, reader.readAsText(file);
|
|
1722
1748
|
}
|
|
1723
|
-
}
|
|
1749
|
+
}, "onChange")
|
|
1724
1750
|
})
|
|
1725
1751
|
]
|
|
1726
1752
|
})
|
|
1727
1753
|
]
|
|
1728
1754
|
})
|
|
1729
|
-
],
|
|
1755
|
+
], element(this.bodyElement, {
|
|
1730
1756
|
children: [
|
|
1731
|
-
|
|
1757
|
+
div({
|
|
1732
1758
|
class: "resize",
|
|
1733
|
-
onPointerdown: (
|
|
1734
|
-
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1737
|
-
(
|
|
1738
|
-
const
|
|
1739
|
-
this.style.width =
|
|
1759
|
+
onPointerdown: /* @__PURE__ */ __name((grabEvent) => {
|
|
1760
|
+
grabEvent.preventDefault();
|
|
1761
|
+
const rect = this.getBoundingClientRect(), scrollValue = this.contentElement.scrollTop;
|
|
1762
|
+
setupDrag(
|
|
1763
|
+
(moveEvent) => {
|
|
1764
|
+
const dx = grabEvent.x - moveEvent.x, newSize = Math.max(400, rect.width + dx);
|
|
1765
|
+
this.style.width = newSize + "px", tweakerStorage.changeSize("tweaker", newSize);
|
|
1740
1766
|
},
|
|
1741
1767
|
() => {
|
|
1742
1768
|
setTimeout(() => {
|
|
1743
1769
|
this.contentElement.scroll({
|
|
1744
|
-
top:
|
|
1770
|
+
top: scrollValue
|
|
1745
1771
|
});
|
|
1746
1772
|
}, 10);
|
|
1747
1773
|
}
|
|
1748
1774
|
);
|
|
1749
|
-
},
|
|
1750
|
-
onDblclick: () => {
|
|
1751
|
-
this.style.width = "",
|
|
1752
|
-
}
|
|
1775
|
+
}, "onPointerdown"),
|
|
1776
|
+
onDblclick: /* @__PURE__ */ __name(() => {
|
|
1777
|
+
this.style.width = "", tweakerStorage.changeSize("tweaker", null);
|
|
1778
|
+
}, "onDblclick")
|
|
1753
1779
|
})
|
|
1754
1780
|
]
|
|
1755
1781
|
});
|
|
1756
1782
|
}
|
|
1757
1783
|
connectedCallback() {
|
|
1758
|
-
super.connectedCallback(), window.addEventListener("beforeunload",
|
|
1784
|
+
super.connectedCallback(), window.addEventListener("beforeunload", __privateGet(this, _unloadListener)), activeStores.subscribe(__privateGet(this, _storesChangeListener2)), tweakerStorage.changedSizes("tweaker") && (this.style.width = tweakerStorage.changedSizes("tweaker") + "px");
|
|
1759
1785
|
}
|
|
1760
1786
|
disconnectedCallback() {
|
|
1761
|
-
window.removeEventListener("beforeunload",
|
|
1787
|
+
window.removeEventListener("beforeunload", __privateGet(this, _unloadListener)), tweakerStorage.save(), activeStores.unsubscribe(__privateGet(this, _storesChangeListener2));
|
|
1762
1788
|
}
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1789
|
+
};
|
|
1790
|
+
_scrollRestored = new WeakMap(), _unloadListener = new WeakMap(), _storesChangeListener2 = new WeakMap(), __name(_TweakerElement, "TweakerElement");
|
|
1791
|
+
let TweakerElement = _TweakerElement;
|
|
1792
|
+
isBrowser && !customElements.get("e-tweaker") && customElements.define("e-tweaker", TweakerElement);
|
|
1793
|
+
isBrowser && document.body.appendChild(new TweakerElement());
|