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