@orangelogic/design-system 2.60.0 → 2.61.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/library/apps/cortex/src/types.d.ts +2 -0
- package/library/chunks/_baseRest.ClTMQtN1.js +67 -0
- package/library/chunks/{_baseUniq.BUihBa8c.js → _baseUniq.Df-fLIBx.js} +53 -56
- package/library/chunks/{amazon_s3.DeaMdPPn.js → amazon_s3.BEMtqafk.js} +1 -1
- package/library/chunks/animate.El-MpOws.js +37 -0
- package/library/chunks/animation-registry.HmpwNuGH.js +34 -0
- package/library/chunks/{animation.B7d72NVK.js → animation.DfUHRQry.js} +10 -8
- package/library/chunks/array.DCtvHiLS.js +81 -0
- package/library/chunks/asset.CG_yXtWK.js +288 -0
- package/library/chunks/{browser.Va59Ix3P.js → browser.BHOCIF_A.js} +18 -16
- package/library/chunks/{button.CtCSNRB3.js → button.P71VJ5xh.js} +75 -74
- package/library/chunks/{button.styles.C8AIO8fd.js → button.styles.Dl5IQLHU.js} +1 -1
- package/library/chunks/{capitalize.CNStXZBq.js → capitalize.WSkCXkNE.js} +1 -1
- package/library/chunks/{chatbot.sm4Rph1v.js → chatbot.BmpIu59L.js} +2 -2
- package/library/chunks/{class-map.CoZTSvbM.js → class-map.BiVq-cVR.js} +1 -1
- package/library/chunks/{color-swatch-group.qJevXs50.js → color-swatch-group.DlLmydlB.js} +116 -127
- package/library/chunks/color-swatch.Bpb_hW2H.js +407 -0
- package/library/chunks/color.vLD2sNTs.js +164 -0
- package/library/chunks/{component.styles.CI-v8BZa.js → component.styles.DMSLciL5.js} +1 -1
- package/library/chunks/{confirm-popover.D2TF1x6K.js → confirm-popover.C1uA36JR.js} +15 -13
- package/library/chunks/{content-builder.WranV3P4.js → content-builder.Bf7kqzDI.js} +1 -1
- package/library/chunks/converters.DkDtLstb.js +11 -0
- package/library/chunks/{cropper.aA0v16xS.js → cropper.BraEEykE.js} +5004 -5024
- package/library/chunks/custom-element.L4WJXn1j.js +14 -0
- package/library/chunks/debounce.DaHuiSGU.js +15 -0
- package/library/chunks/{default-value.CIKAvD5l.js → default-value.COZopaet.js} +1 -1
- package/library/chunks/{dialog.B1TORO6S.js → dialog.C_75RVVz.js} +52 -49
- package/library/chunks/{directive-helpers.DBHob-_L.js → directive-helpers.Dm4rc594.js} +1 -1
- package/library/chunks/dom.CZrJ64Dm.js +92 -0
- package/library/chunks/{dot-pagination.8f2oX_ge.js → dot-pagination.CoCIJsHC.js} +24 -22
- package/library/chunks/{endpoints.BgyupJys.js → endpoints.B7lcoc1N.js} +1 -3
- package/library/chunks/{file-on-demand.Cwgabdyw.js → file-on-demand.B2jNilAj.js} +1829 -1544
- package/library/chunks/{folder-select.DiWCwR-T.js → folder-select.CSEQxIXF.js} +380 -255
- package/library/chunks/{form-control.styles.NE2Q-quE.js → form-control.styles.CUGhvlfT.js} +1 -1
- package/library/chunks/{form.B8u0ywni.js → form.CO12-VK0.js} +1 -1
- package/library/chunks/{guard.BDP4A85K.js → guard.D4axKaMo.js} +1 -1
- package/library/chunks/{header.B_FD8uLt.js → header.Bd3G0-oA.js} +11 -9
- package/library/chunks/{hub-connection.CxfaT11o.js → hub-connection.BxT2b7Nq.js} +4 -3
- package/library/chunks/{i18n.BP2FRO1v.js → i18n.DrzK7TPf.js} +54 -7
- package/library/chunks/identity.ByMq8VxU.js +6 -0
- package/library/chunks/{if-defined.MfEgpxEN.js → if-defined.BRoBj_Rp.js} +1 -1
- package/library/chunks/{iframe.DZm7FiCl.js → iframe.UCj6Ze2A.js} +18 -16
- package/library/chunks/{image.Ycf8RudS.js → image.DZCRhE3G.js} +82 -79
- package/library/chunks/image.mbpyiQpQ.js +82 -0
- package/library/chunks/index.S0wy3rzm.js +373 -0
- package/library/chunks/isObjectLike.D3cpZO39.js +81 -0
- package/library/chunks/{isSymbol.L0C2ND_U.js → isSymbol.huJ_Cvxt.js} +1 -1
- package/library/chunks/lib-cortex-element.CVMmyPMC.js +146 -0
- package/library/chunks/{list-editor.COkw5JKG.js → list-editor.CrLntuM7.js} +75 -79
- package/library/chunks/{custom-element.vnXBMQxc.js → lit-element.jLBm65_O.js} +123 -277
- package/library/chunks/{live.LdB9xEhp.js → live.SCz6M8Gs.js} +2 -2
- package/library/chunks/{mailchimp.BjbPJfd-.js → mailchimp.Bs6uJVsf.js} +1 -1
- package/library/chunks/{modal.BqNLxgs1.js → modal.U1QltQKe.js} +25 -19
- package/library/chunks/{option.D9KJhzHs.js → option.D1u5-cTt.js} +21 -19
- package/library/chunks/{orangelogic.BgbQXkBv.js → orangelogic.TdFfoPUN.js} +1 -1
- package/library/chunks/{overlayscrollbars.aFuRG5Rs.js → overlayscrollbars.XhGWx9Zk.js} +1 -1
- package/library/chunks/{pagination.C2FN4fmO.js → pagination.BI3LONVU.js} +17 -15
- package/library/chunks/{ref.BaCjlzLO.js → ref.bzeTdX0K.js} +2 -2
- package/library/chunks/{repeat.CauKaXyy.js → repeat.DbF2p5ae.js} +2 -2
- package/library/chunks/responsive.CA6dcNiM.js +17 -0
- package/library/chunks/{scroll.DwPiX2Ox.js → scroll.xtO5yojm.js} +3 -2
- package/library/chunks/{slot.DJLm4Dig.js → slot.j5oheLJC.js} +12 -4
- package/library/chunks/{state.Cw55xXlb.js → state.CSDxrqLd.js} +1 -1
- package/library/chunks/{static.BjNkqt7_.js → static.UA3G1Deq.js} +1 -1
- package/library/chunks/string.Cp_XNbnV.js +160 -0
- package/library/chunks/{style-map.CZovMmo_.js → style-map.llVFPd__.js} +1 -1
- package/library/chunks/{tab-group.5fLnWflv.js → tab-group.DxSlcWK0.js} +20 -18
- package/library/chunks/{table.BAr8KKc6.js → table.CY-iMTWV.js} +457 -505
- package/library/chunks/template.CsJd8Pb_.js +20 -0
- package/library/chunks/time.D_uFZqqe.js +118 -0
- package/library/chunks/{toString.CL_lYXbK.js → toString.CRT5zqEU.js} +3 -3
- package/library/chunks/toast.BXNbwZV8.js +25 -0
- package/library/chunks/{tree.CUfvIDyA.js → tree.CNbrP8cY.js} +33 -36
- package/library/chunks/{typography.BFpl0WMA.js → typography.oDzoLbZS.js} +16 -14
- package/library/chunks/{unsafe-html.DyO9_Rsq.js → unsafe-html.Dff7-rCx.js} +1 -1
- package/library/chunks/url.LjsR2sB5.js +15 -0
- package/library/chunks/user-agent.D9aPuOyL.js +4 -0
- package/library/chunks/watch.q1sEjPWL.js +501 -0
- package/library/components/alert.js +38 -35
- package/library/components/animated-image.js +25 -23
- package/library/components/animation.js +7 -5
- package/library/components/array-line-clamp.d.ts +3 -0
- package/library/components/array-line-clamp.js +195 -0
- package/library/components/asset-link-format.js +223 -212
- package/library/components/atoms.js +164 -162
- package/library/components/avatar.js +28 -26
- package/library/components/badge.js +10 -8
- package/library/components/bicolor-picker.js +21 -19
- package/library/components/border-input-group.js +11 -9
- package/library/components/breadcrumb-item.js +14 -12
- package/library/components/breadcrumb.js +24 -22
- package/library/components/button-group.js +26 -24
- package/library/components/button.js +14 -13
- package/library/components/card.js +28 -19
- package/library/components/checkbox.js +29 -23
- package/library/components/color-picker.js +19 -17
- package/library/components/color-swatch-group.js +20 -17
- package/library/components/color-swatch.js +16 -13
- package/library/components/confirm-popover.js +11 -9
- package/library/components/copy-button.js +15 -13
- package/library/components/corner-position-input-group.js +13 -11
- package/library/components/cortex-element.d.ts +3 -0
- package/library/components/cortex-element.js +5 -0
- package/library/components/cropper.js +7 -5
- package/library/components/details.js +23 -20
- package/library/components/dialog.js +19 -16
- package/library/components/divider.js +13 -11
- package/library/components/dot-pagination.js +11 -9
- package/library/components/dot-status.js +10 -8
- package/library/components/drawer.js +63 -51
- package/library/components/dropdown.js +29 -26
- package/library/components/dynamic-select.js +12 -10
- package/library/components/element-clamp.js +28 -25
- package/library/components/file-on-demand.js +21 -20
- package/library/components/folder-select.js +12 -10
- package/library/components/format-bytes.js +11 -10
- package/library/components/format-date.js +11 -9
- package/library/components/format-number.js +16 -15
- package/library/components/format-time.js +118 -9
- package/library/components/grid-item.js +48 -46
- package/library/components/grid.js +31 -29
- package/library/components/header.js +10 -9
- package/library/components/hub-connection.js +6 -5
- package/library/components/icon-button.js +20 -18
- package/library/components/icon.js +17 -15
- package/library/components/iframe.js +10 -8
- package/library/components/image-comparer.js +27 -25
- package/library/components/image.js +14 -11
- package/library/components/include.js +26 -24
- package/library/components/input-group.js +15 -13
- package/library/components/input.js +23 -21
- package/library/components/line-clamp.js +12 -10
- package/library/components/list-editor.js +17 -15
- package/library/components/markdown.js +80 -78
- package/library/components/masonry.js +46 -44
- package/library/components/menu-item.js +151 -136
- package/library/components/menu-label.js +15 -13
- package/library/components/menu-section.js +18 -16
- package/library/components/menu.js +10 -8
- package/library/components/molecules.js +5 -5
- package/library/components/mutation-observer.js +12 -10
- package/library/components/option.js +10 -8
- package/library/components/organisms.js +2 -2
- package/library/components/padding-input-group.js +30 -28
- package/library/components/pagination.js +14 -12
- package/library/components/popup.js +3296 -9
- package/library/components/position-picker.js +12 -10
- package/library/components/progress-bar.js +13 -11
- package/library/components/progress-ring.js +15 -13
- package/library/components/qr-code.js +54 -52
- package/library/components/radio-button.js +19 -17
- package/library/components/radio-card.js +14 -12
- package/library/components/radio-group.js +20 -18
- package/library/components/radio.js +15 -13
- package/library/components/range.js +25 -23
- package/library/components/rating.js +17 -15
- package/library/components/relative-time.js +16 -14
- package/library/components/resize-observer.js +21 -19
- package/library/components/select.js +1442 -25
- package/library/components/shadow-input-group.js +19 -17
- package/library/components/share-option-list.js +20 -18
- package/library/components/sidebar.js +14 -12
- package/library/components/size-input-group.js +35 -33
- package/library/components/skeleton.js +12 -10
- package/library/components/space.js +12 -10
- package/library/components/spinner.js +17 -15
- package/library/components/split-panel.js +15 -13
- package/library/components/step.js +18 -16
- package/library/components/stepper-wizard.js +11 -9
- package/library/components/stepper.js +13 -11
- package/library/components/switch.js +21 -19
- package/library/components/tab-group.js +15 -13
- package/library/components/tab-panel.js +20 -18
- package/library/components/tab.js +18 -16
- package/library/components/table.js +69 -67
- package/library/components/tag.js +11 -9
- package/library/components/textarea.js +20 -18
- package/library/components/timecode.js +98 -8
- package/library/components/tooltip.js +24 -21
- package/library/components/tree-item.js +14 -11
- package/library/components/tree.js +12 -10
- package/library/components/typeface.js +13 -11
- package/library/components/types.js +15487 -15444
- package/library/components/typography.js +6 -4
- package/library/components/video.js +13 -11
- package/library/components/visually-hidden.js +15 -13
- package/library/events.d.ts +1 -0
- package/library/events.js +1 -0
- package/library/package.json +11 -2
- package/library/packages/atoms/src/components/array-line-clamp/array-line-clamp.d.ts +45 -0
- package/library/packages/atoms/src/components/array-line-clamp/array-line-clamp.styles.d.ts +2 -0
- package/library/packages/atoms/src/components/checkbox/checkbox.d.ts +2 -0
- package/library/packages/atoms/src/components/drawer/drawer.d.ts +7 -1
- package/library/packages/atoms/src/components/include/include.d.ts +1 -0
- package/library/packages/atoms/src/components/menu-item/menu-item.d.ts +2 -0
- package/library/packages/atoms/src/components/tree/tree.d.ts +0 -4
- package/library/packages/atoms/src/index.d.ts +1 -0
- package/library/packages/events/src/cx-file-on-demand-load-more.d.ts +8 -0
- package/library/packages/events/src/cx-file-on-demand-pin.d.ts +8 -0
- package/library/packages/events/src/cx-file-on-demand-unpin.d.ts +8 -0
- package/library/packages/events/src/cx-folder-select-search-term-change.d.ts +8 -0
- package/library/packages/events/src/cx-share-option-list-item-selected.d.ts +8 -0
- package/library/packages/events/src/events.d.ts +6 -2
- package/library/packages/molecules/src/asset-picker/asset-picker.d.ts +2 -0
- package/library/packages/molecules/src/cropper/cropper.d.ts +1 -0
- package/library/packages/molecules/src/cropper/react/Cropper.d.ts +1 -0
- package/library/packages/molecules/src/download-format-picker/download-format-picker.d.ts +1 -0
- package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +8 -0
- package/library/packages/molecules/src/folder-select/components/folder-select-tree-item/folder-select-tree-item.d.ts +1 -0
- package/library/packages/molecules/src/folder-select/folder-select.d.ts +6 -1
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +3 -7
- package/library/packages/organisms/src/content-builder/styleController.d.ts +8 -8
- package/library/packages/organisms/src/file-on-demand/components/file-on-demand-asset/file-on-demand-asset.d.ts +80 -0
- package/library/packages/organisms/src/file-on-demand/components/file-on-demand-asset/file-on-demand-asset.styles.d.ts +2 -0
- package/library/packages/organisms/src/file-on-demand/components/file-on-demand-pinned-status.ts/file-on-demand-pinned-status.d.ts +44 -0
- package/library/packages/organisms/src/file-on-demand/file-on-demand.constants.d.ts +1 -0
- package/library/packages/organisms/src/file-on-demand/file-on-demand.d.ts +11 -18
- package/library/packages/organisms/src/file-on-demand/file-on-demand.utils.d.ts +6 -0
- package/library/packages/services/src/api/folder/folder.d.ts +4 -8
- package/library/packages/services/src/api/folder/folder.types.d.ts +2 -1
- package/library/packages/types/src/file-on-demand.d.ts +4 -0
- package/library/packages/types/src/folder-select.d.ts +9 -2
- package/library/packages/utils/src/custom-element/i18n.d.ts +40 -2
- package/library/packages/utils/src/drag-scroll/drag-scroll.d.ts +22 -0
- package/library/packages/utils/src/drag-scroll/index.d.ts +1 -0
- package/library/packages/utils/src/font/font.d.ts +26 -0
- package/library/packages/utils/src/font/index.d.ts +1 -0
- package/library/packages/utils/src/history-manager/history-manager.d.ts +13 -0
- package/library/packages/utils/src/history-manager/index.d.ts +1 -0
- package/library/packages/utils/src/index.d.ts +45 -0
- package/library/packages/utils/src/template/index.d.ts +1 -0
- package/library/packages/utils/src/template/template.d.ts +3 -0
- package/library/react-web-component.d.ts +418 -360
- package/library/utils.d.ts +1 -0
- package/library/utils.js +180 -0
- package/package.json +11 -2
- package/library/chunks/animation-registry.DavRkTTr.js +0 -69
- package/library/chunks/asset.Ba-CxnNM.js +0 -309
- package/library/chunks/color-swatch.DUe3iLLo.js +0 -558
- package/library/chunks/dom.C0OFx7ND.js +0 -78
- package/library/chunks/format-time.BW6-ZWCX.js +0 -226
- package/library/chunks/isObjectLike.z36Fu426.js +0 -34
- package/library/chunks/popup._w5T7x8f.js +0 -3307
- package/library/chunks/select.DfO4de04.js +0 -1441
- package/library/chunks/string.BCk3SmdZ.js +0 -144
- package/library/chunks/timecode.D7XTiQ_3.js +0 -105
- package/library/chunks/watch.BCJD77bD.js +0 -547
- package/library/packages/events/src/cx-load-more.d.ts +0 -8
|
@@ -1,558 +0,0 @@
|
|
|
1
|
-
import z from "../components/copy-button.js";
|
|
2
|
-
import R from "../components/line-clamp.js";
|
|
3
|
-
import E from "../components/resize-observer.js";
|
|
4
|
-
import V from "../components/space.js";
|
|
5
|
-
import { C as G } from "./typography.BFpl0WMA.js";
|
|
6
|
-
import { i as M, n as l, C as S, x as C, c as U } from "./custom-element.vnXBMQxc.js";
|
|
7
|
-
import { c as W } from "./component.styles.CI-v8BZa.js";
|
|
8
|
-
import { T as v } from "./index.C1chwzNp.js";
|
|
9
|
-
import { d as H } from "./popup._w5T7x8f.js";
|
|
10
|
-
import { L as D } from "./i18n.BP2FRO1v.js";
|
|
11
|
-
import { w as h } from "./watch.BCJD77bD.js";
|
|
12
|
-
import { r as d } from "./state.Cw55xXlb.js";
|
|
13
|
-
import { e as L } from "./query.BBf1UFkC.js";
|
|
14
|
-
import { e as k } from "./class-map.CoZTSvbM.js";
|
|
15
|
-
import { o as $ } from "./if-defined.MfEgpxEN.js";
|
|
16
|
-
import { c as T } from "./repeat.CauKaXyy.js";
|
|
17
|
-
import { o as m } from "./style-map.CZovMmo_.js";
|
|
18
|
-
import { n as B } from "./when.Dr1es41R.js";
|
|
19
|
-
var y = /* @__PURE__ */ ((t) => (t.Circle = "circle", t.GridItem = "grid-item", t.Oval = "oval", t))(y || {}), p = /* @__PURE__ */ ((t) => (t.Cmyk = "cmyk", t.Hex = "hex", t.Rgb = "rgb", t.Unknown = "unknown", t))(p || {});
|
|
20
|
-
const O = /^#([0-9A-Fa-f]{3}){1,2}$/, j = /^(\s*(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\s*,){2}\s*(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\s*$/, X = /^(\s*(100|[1-9]?\d)\s*,){3}\s*(100|[1-9]?\d)\s*$/, P = /^#(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/;
|
|
21
|
-
function I(t) {
|
|
22
|
-
return O.test(t) ? "hex" : j.test(t) ? "rgb" : X.test(t) ? "cmyk" : "unknown";
|
|
23
|
-
}
|
|
24
|
-
function _(t, e, s) {
|
|
25
|
-
return "#" + [t, e, s].map((n) => n.toString(16).padStart(2, "0")).join("").toUpperCase();
|
|
26
|
-
}
|
|
27
|
-
function b(t) {
|
|
28
|
-
t = t.trim().replace(/^#/, ""), t.length === 8 && (t = t.slice(0, 6)), t.length === 3 && (t = t.split("").map((s) => s + s).join(""));
|
|
29
|
-
const e = parseInt(t, 16);
|
|
30
|
-
return {
|
|
31
|
-
b: e & 255,
|
|
32
|
-
g: e >> 8 & 255,
|
|
33
|
-
r: e >> 16 & 255
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function F(t, e, s) {
|
|
37
|
-
const n = 1 - t / 255, r = 1 - e / 255, o = 1 - s / 255, a = Math.min(n, r, o);
|
|
38
|
-
return a === 1 ? { c: 0, k: 100, m: 0, y: 0 } : {
|
|
39
|
-
c: Math.round((n - a) / (1 - a) * 100),
|
|
40
|
-
k: Math.round(a * 100),
|
|
41
|
-
m: Math.round((r - a) / (1 - a) * 100),
|
|
42
|
-
y: Math.round((o - a) / (1 - a) * 100)
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function A(t, e, s, n) {
|
|
46
|
-
const r = 255 * (1 - t / 100) * (1 - n / 100), o = 255 * (1 - e / 100) * (1 - n / 100), a = 255 * (1 - s / 100) * (1 - n / 100);
|
|
47
|
-
return { b: Math.round(a), g: Math.round(o), r: Math.round(r) };
|
|
48
|
-
}
|
|
49
|
-
function N(t) {
|
|
50
|
-
switch (t = t.trim(), I(t)) {
|
|
51
|
-
case "hex":
|
|
52
|
-
return { hex: t };
|
|
53
|
-
case "rgb": {
|
|
54
|
-
const s = t.split(",").map((n) => n.trim());
|
|
55
|
-
return {
|
|
56
|
-
blue: parseInt(s[2], 10),
|
|
57
|
-
green: parseInt(s[1], 10),
|
|
58
|
-
red: parseInt(s[0], 10)
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
case "cmyk": {
|
|
62
|
-
const s = t.split(",").map((n) => n.trim());
|
|
63
|
-
return {
|
|
64
|
-
c: parseInt(s[0], 10),
|
|
65
|
-
k: parseInt(s[3], 10),
|
|
66
|
-
m: parseInt(s[1], 10),
|
|
67
|
-
y: parseInt(s[2], 10)
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
default:
|
|
71
|
-
return {};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function u(t, e, s) {
|
|
75
|
-
const n = I(t), r = N(t);
|
|
76
|
-
let o = {};
|
|
77
|
-
if (n === "unknown")
|
|
78
|
-
return "";
|
|
79
|
-
if (n === e)
|
|
80
|
-
return t;
|
|
81
|
-
switch (e) {
|
|
82
|
-
case "hex":
|
|
83
|
-
if (n === "rgb")
|
|
84
|
-
o.hex = _(r.red, r.green, r.blue);
|
|
85
|
-
else if (n === "cmyk") {
|
|
86
|
-
const a = A(r.c, r.m, r.y, r.k);
|
|
87
|
-
o.hex = _(a.r, a.g, a.b);
|
|
88
|
-
} else
|
|
89
|
-
o.hex = r.hex;
|
|
90
|
-
break;
|
|
91
|
-
case "rgb":
|
|
92
|
-
if (n === "hex") {
|
|
93
|
-
const a = b(r.hex);
|
|
94
|
-
o.red = a.r, o.green = a.g, o.blue = a.b;
|
|
95
|
-
} else if (n === "cmyk") {
|
|
96
|
-
const a = A(r.c, r.m, r.y, r.k);
|
|
97
|
-
o.red = a.r, o.green = a.g, o.blue = a.b;
|
|
98
|
-
} else
|
|
99
|
-
Object.assign(o, r);
|
|
100
|
-
break;
|
|
101
|
-
case "cmyk":
|
|
102
|
-
if (n === "rgb")
|
|
103
|
-
o = F(r.red, r.green, r.blue);
|
|
104
|
-
else if (n === "hex") {
|
|
105
|
-
const a = b(r.hex);
|
|
106
|
-
o = F(a.r, a.g, a.b);
|
|
107
|
-
} else
|
|
108
|
-
Object.assign(o, r);
|
|
109
|
-
break;
|
|
110
|
-
default:
|
|
111
|
-
return t;
|
|
112
|
-
}
|
|
113
|
-
return e === "hex" ? o.hex : e === "rgb" ? `${o.red}, ${o.green}, ${o.blue}` : e === "cmyk" ? `${o.c}, ${o.m}, ${o.y}, ${o.k}` : t;
|
|
114
|
-
}
|
|
115
|
-
function K(t, e = "#000", s = "#FFF") {
|
|
116
|
-
if (!((f) => P.test(f))(t))
|
|
117
|
-
return t;
|
|
118
|
-
const { b: r, g: o, r: a } = b(t);
|
|
119
|
-
return 0.299 * a + 0.587 * o + 0.114 * r > 186 ? e : s;
|
|
120
|
-
}
|
|
121
|
-
function Y(t) {
|
|
122
|
-
const e = "light-dark", s = t.toLowerCase().indexOf(e + "(");
|
|
123
|
-
if (s === -1)
|
|
124
|
-
return "";
|
|
125
|
-
const n = t.indexOf("(", s + e.length);
|
|
126
|
-
if (n === -1)
|
|
127
|
-
return "";
|
|
128
|
-
let r = 0, o = -1, a = -1;
|
|
129
|
-
for (let g = n; g < t.length; g++) {
|
|
130
|
-
const x = t[g];
|
|
131
|
-
if (x === "(") {
|
|
132
|
-
r++;
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
if (x === ")") {
|
|
136
|
-
if (r--, r === 0) {
|
|
137
|
-
a = g;
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
x === "," && r === 1 && o === -1 && (o = g);
|
|
143
|
-
}
|
|
144
|
-
if (o === -1 || a === -1)
|
|
145
|
-
return "";
|
|
146
|
-
const w = t.slice(n + 1, o).trim(), f = t.slice(o + 1, a).trim();
|
|
147
|
-
return `${w} ${f}`;
|
|
148
|
-
}
|
|
149
|
-
function Ct(t, e) {
|
|
150
|
-
const s = new v(t), n = new v(e), r = s.isValid ? t : "transparent", o = n.isValid ? e : "transparent";
|
|
151
|
-
return `light-dark(${r}, ${o})`;
|
|
152
|
-
}
|
|
153
|
-
function ft(t) {
|
|
154
|
-
const e = Y(t);
|
|
155
|
-
if (!e)
|
|
156
|
-
return null;
|
|
157
|
-
const s = t.replace(/light-dark\([^()]*(?:\([^()]*\)[^()]*)*\)/i, "").trim();
|
|
158
|
-
return `${e} ${s}`;
|
|
159
|
-
}
|
|
160
|
-
function xt(t) {
|
|
161
|
-
const e = t.match(/([a-zA-Z-]+\([^)]*\))/);
|
|
162
|
-
if (!e)
|
|
163
|
-
return "";
|
|
164
|
-
const s = e[1], n = s.replace(/^[a-zA-Z-]+\(|\)$/g, "").trim(), r = t.replace(s, "").trim(), o = n.replace(/,/g, "").trim();
|
|
165
|
-
return `${r} ${o}`;
|
|
166
|
-
}
|
|
167
|
-
const Z = M`
|
|
168
|
-
:host {
|
|
169
|
-
display: block;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.color-swatch {
|
|
173
|
-
border: 1px solid var(--cx-color-neutral-200);
|
|
174
|
-
display: flex;
|
|
175
|
-
justify-content: center;
|
|
176
|
-
align-items: center;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.color-swatch:focus-visible {
|
|
180
|
-
outline: var(--cx-focus-ring);
|
|
181
|
-
outline-offset: var(--cx-focus-ring-offset);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.color-swatch--circle {
|
|
185
|
-
aspect-ratio: 1 / 1;
|
|
186
|
-
height: auto;
|
|
187
|
-
width: var(--swatch-size, 350px);
|
|
188
|
-
min-width: var(--swatch-size, 230px);
|
|
189
|
-
max-width: 100%;
|
|
190
|
-
border-radius: var(--cx-border-radius-circle);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.color-swatch--oval {
|
|
194
|
-
height: var(--swatch-size, 350px);
|
|
195
|
-
width: 100%;
|
|
196
|
-
border-radius: calc(var(--swatch-size, 350px) / 2);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.color-swatch--grid {
|
|
200
|
-
width: 100%;
|
|
201
|
-
height: var(--swatch-size, 300px);
|
|
202
|
-
min-width: var(--swatch-grid-min-width, 165px);
|
|
203
|
-
border-radius: var(--cx-border-radius-x-large);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.color-swatch__content {
|
|
207
|
-
max-height: 100%;
|
|
208
|
-
padding: var(--swatch-content-padding, 0);
|
|
209
|
-
justify-content: space-between;
|
|
210
|
-
gap: var(--cx-spacing-medium);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.color-swatch--circle > .color-swatch__content {
|
|
214
|
-
max-width: 75%;
|
|
215
|
-
min-width: 50%;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.color-swatch--oval > .color-swatch__content {
|
|
219
|
-
max-width: 85%;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.color-swatch--grid > .color-swatch__content {
|
|
223
|
-
height: 100%;
|
|
224
|
-
width: 100%;
|
|
225
|
-
padding: var(--cx-spacing-large) var(--cx-spacing-medium);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.color-swatch__key::part(base) {
|
|
229
|
-
min-width: 50px;
|
|
230
|
-
height: 100%;
|
|
231
|
-
vertical-align: middle;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.color-swatch__key[variant='small']::part(base) {
|
|
235
|
-
display: inline-block;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.color-swatch__copy-button::part(button) {
|
|
239
|
-
min-height: fit-content;
|
|
240
|
-
height: fit-content;
|
|
241
|
-
border-width: 0 !important;
|
|
242
|
-
background: transparent !important;
|
|
243
|
-
padding: 0;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.color-swatch__copy-button::part(label) {
|
|
247
|
-
height: fit-content;
|
|
248
|
-
padding: 0;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
.color-swatch__value {
|
|
252
|
-
text-transform: none;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.color-swatch__value::part(base) {
|
|
256
|
-
word-break: break-word;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.color-swatch__value-wrapper {
|
|
260
|
-
text-align: left;
|
|
261
|
-
}
|
|
262
|
-
`;
|
|
263
|
-
var q = Object.defineProperty, J = Object.getOwnPropertyDescriptor, c = (t, e, s, n) => {
|
|
264
|
-
for (var r = n > 1 ? void 0 : n ? J(e, s) : e, o = t.length - 1, a; o >= 0; o--)
|
|
265
|
-
(a = t[o]) && (r = (n ? a(e, s, r) : a(r)) || r);
|
|
266
|
-
return n && r && q(e, s, r), r;
|
|
267
|
-
};
|
|
268
|
-
let i = class extends S {
|
|
269
|
-
constructor() {
|
|
270
|
-
super(...arguments), this.localize = new D(this), this.ignoreWatchColorChange = /* @__PURE__ */ new Set(), this.variant = y.Circle, this.name = "", this.hex = "", this.rgb = "", this.cmyk = "", this.pms = "", this.canCopy = !1, this.showCodes = ["HEX", "RGB", "CMYK", "PMS"], this.canFocusCodeOnly = !1, this.noAutoConvert = !1, this.textColor = "#27272A", this.textVariant = "body2", this.lineClamp = 3, this.backgroundColor = "#F9F9F9", this.canFocusContainer = !0, this.isContainerFocused = !1;
|
|
271
|
-
}
|
|
272
|
-
runFirstUpdated() {
|
|
273
|
-
this.handleColorChange();
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Change to default color
|
|
277
|
-
*/
|
|
278
|
-
setDefaultColor() {
|
|
279
|
-
this.backgroundColor = "#F9F9F9", this.textColor = "#27272A";
|
|
280
|
-
}
|
|
281
|
-
handleResize() {
|
|
282
|
-
const t = this.containerEl.offsetWidth;
|
|
283
|
-
t > 315 || this.variant === "grid-item" ? (this.textVariant = "body2", this.rowGap = "x-small", this.lineClamp = 3) : t > 230 ? (this.textVariant = "body3", this.rowGap = "2x-small", this.lineClamp = 2) : (this.textVariant = "small", this.rowGap = "3x-small", this.lineClamp = 1);
|
|
284
|
-
}
|
|
285
|
-
handleVariantChange() {
|
|
286
|
-
this.containerEl && this.handleResize();
|
|
287
|
-
}
|
|
288
|
-
handleCmykChange() {
|
|
289
|
-
if (!this.noAutoConvert) {
|
|
290
|
-
if (this.ignoreWatchColorChange.has("cmyk") || this.cmyk === "" && !this.hasUpdated) {
|
|
291
|
-
this.ignoreWatchColorChange.delete("cmyk");
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
this.ignoreWatchColorChange.add("hex"), this.ignoreWatchColorChange.add("rgb"), this.hex = u(this.cmyk, p.Hex), this.rgb = u(this.cmyk, p.Rgb);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
handleRGBChange() {
|
|
298
|
-
if (!this.noAutoConvert) {
|
|
299
|
-
if (this.ignoreWatchColorChange.has("rgb") || this.rgb === "" && !this.hasUpdated) {
|
|
300
|
-
this.ignoreWatchColorChange.delete("rgb");
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
this.ignoreWatchColorChange.add("hex"), this.ignoreWatchColorChange.add("cmyk"), this.hex = u(this.rgb, p.Hex), this.cmyk = u(this.rgb, p.Cmyk);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
handleHexChange() {
|
|
307
|
-
if (!this.noAutoConvert) {
|
|
308
|
-
if (this.ignoreWatchColorChange.has("hex") || this.hex === "" && !this.hasUpdated) {
|
|
309
|
-
this.ignoreWatchColorChange.delete("hex");
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
this.ignoreWatchColorChange.add("rgb"), this.ignoreWatchColorChange.add("cmyk"), this.rgb = u(this.hex, p.Rgb), this.cmyk = u(this.hex, p.Cmyk);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
async handleColorChange() {
|
|
316
|
-
await this.updateComplete, this.hex && O.test(this.hex) ? (this.textColor = K(this.hex, "#27272A", "#F9F9F9"), this.backgroundColor = this.hex) : this.setDefaultColor();
|
|
317
|
-
}
|
|
318
|
-
handleCanFocusCodeOnlyChange() {
|
|
319
|
-
this.isContainerFocused || (this.canFocusContainer = !this.canFocusCodeOnly);
|
|
320
|
-
}
|
|
321
|
-
handleFocusIn() {
|
|
322
|
-
this.isContainerFocused = !0;
|
|
323
|
-
}
|
|
324
|
-
handleFocusOut() {
|
|
325
|
-
this.isContainerFocused = !1;
|
|
326
|
-
}
|
|
327
|
-
render() {
|
|
328
|
-
const t = [
|
|
329
|
-
{ key: "HEX", value: this.hex },
|
|
330
|
-
{ key: "RGB", value: this.rgb },
|
|
331
|
-
{ key: "CMYK", value: this.cmyk },
|
|
332
|
-
{ key: "PMS", value: this.pms }
|
|
333
|
-
].filter((e) => this.showCodes.includes(e.key));
|
|
334
|
-
return C`
|
|
335
|
-
<cx-resize-observer @cx-resize=${this.handleResize}>
|
|
336
|
-
<div
|
|
337
|
-
part="base"
|
|
338
|
-
tabindex=${$(this.canFocusContainer ? "0" : void 0)}
|
|
339
|
-
class=${k({
|
|
340
|
-
"color-swatch": !0,
|
|
341
|
-
"color-swatch--circle": this.variant === y.Circle,
|
|
342
|
-
"color-swatch--grid": this.variant === y.GridItem,
|
|
343
|
-
"color-swatch--oval": this.variant === y.Oval
|
|
344
|
-
})}
|
|
345
|
-
style=${m({
|
|
346
|
-
backgroundColor: this.backgroundColor
|
|
347
|
-
})}
|
|
348
|
-
@focusin=${this.handleFocusIn}
|
|
349
|
-
@focusout=${this.handleFocusOut}
|
|
350
|
-
>
|
|
351
|
-
<cx-space
|
|
352
|
-
part="content"
|
|
353
|
-
direction="vertical"
|
|
354
|
-
class="color-swatch__content"
|
|
355
|
-
>
|
|
356
|
-
<cx-typography
|
|
357
|
-
variant="h5"
|
|
358
|
-
part="name"
|
|
359
|
-
style=${m({
|
|
360
|
-
"--color": this.textColor
|
|
361
|
-
})}
|
|
362
|
-
>
|
|
363
|
-
${this.name}
|
|
364
|
-
</cx-typography>
|
|
365
|
-
<cx-space
|
|
366
|
-
direction="vertical"
|
|
367
|
-
spacing=${this.rowGap}
|
|
368
|
-
part="content"
|
|
369
|
-
>
|
|
370
|
-
${T(
|
|
371
|
-
t,
|
|
372
|
-
(e) => e.key,
|
|
373
|
-
(e) => C`<cx-space
|
|
374
|
-
direction="horizontal"
|
|
375
|
-
align-items="center"
|
|
376
|
-
spacing="small"
|
|
377
|
-
part="item"
|
|
378
|
-
wrap="nowrap"
|
|
379
|
-
>
|
|
380
|
-
<cx-typography
|
|
381
|
-
variant=${this.textVariant}
|
|
382
|
-
class="color-swatch__key"
|
|
383
|
-
part="key"
|
|
384
|
-
style=${m({
|
|
385
|
-
"--color": this.textColor
|
|
386
|
-
})}
|
|
387
|
-
>
|
|
388
|
-
${e.key}
|
|
389
|
-
</cx-typography>
|
|
390
|
-
${B(
|
|
391
|
-
this.canCopy && e.value !== "",
|
|
392
|
-
() => C`
|
|
393
|
-
<cx-copy-button
|
|
394
|
-
part="copy-button"
|
|
395
|
-
tabindex=${$(
|
|
396
|
-
this.canFocusCodeOnly ? void 0 : "-1"
|
|
397
|
-
)}
|
|
398
|
-
class="color-swatch__copy-button"
|
|
399
|
-
copy-label=${this.localize.term("clickToCopy")}
|
|
400
|
-
focus-copy-label=${this.localize.term(
|
|
401
|
-
"pressEnterOrCtrlCToCopy"
|
|
402
|
-
)}
|
|
403
|
-
label=${`${e.key} ${e.value}`}
|
|
404
|
-
no-icon
|
|
405
|
-
value=${e.value}
|
|
406
|
-
>
|
|
407
|
-
<cx-line-clamp
|
|
408
|
-
lines=${this.lineClamp}
|
|
409
|
-
disabled-tooltip
|
|
410
|
-
class=${k({
|
|
411
|
-
"color-swatch__value-wrapper": !0
|
|
412
|
-
})}
|
|
413
|
-
>
|
|
414
|
-
<cx-typography
|
|
415
|
-
variant=${this.textVariant}
|
|
416
|
-
style=${m({
|
|
417
|
-
"--color": this.textColor
|
|
418
|
-
})}
|
|
419
|
-
class="color-swatch__value"
|
|
420
|
-
part="value"
|
|
421
|
-
>
|
|
422
|
-
${e.value}
|
|
423
|
-
</cx-typography>
|
|
424
|
-
</cx-line-clamp>
|
|
425
|
-
</cx-copy-button>
|
|
426
|
-
`,
|
|
427
|
-
() => C`
|
|
428
|
-
<cx-line-clamp
|
|
429
|
-
lines=${this.lineClamp}
|
|
430
|
-
disabled-tooltip
|
|
431
|
-
class="color-swatch__value-wrapper"
|
|
432
|
-
>
|
|
433
|
-
<cx-typography
|
|
434
|
-
variant=${this.textVariant}
|
|
435
|
-
style=${m({
|
|
436
|
-
"--color": this.textColor
|
|
437
|
-
})}
|
|
438
|
-
class="color-swatch__value"
|
|
439
|
-
part="value"
|
|
440
|
-
>
|
|
441
|
-
${e.value}
|
|
442
|
-
</cx-typography>
|
|
443
|
-
</cx-line-clamp>
|
|
444
|
-
`
|
|
445
|
-
)}
|
|
446
|
-
</cx-space>`
|
|
447
|
-
)}
|
|
448
|
-
</cx-space>
|
|
449
|
-
</cx-space>
|
|
450
|
-
</div>
|
|
451
|
-
</cx-resize-observer>
|
|
452
|
-
`;
|
|
453
|
-
}
|
|
454
|
-
};
|
|
455
|
-
i.styles = [W, Z];
|
|
456
|
-
i.dependencies = {
|
|
457
|
-
"cx-copy-button": z,
|
|
458
|
-
"cx-line-clamp": R,
|
|
459
|
-
"cx-resize-observer": E,
|
|
460
|
-
"cx-space": V,
|
|
461
|
-
"cx-typography": G
|
|
462
|
-
};
|
|
463
|
-
c([
|
|
464
|
-
L(".color-swatch")
|
|
465
|
-
], i.prototype, "containerEl", 2);
|
|
466
|
-
c([
|
|
467
|
-
l({ reflect: !0, type: String })
|
|
468
|
-
], i.prototype, "variant", 2);
|
|
469
|
-
c([
|
|
470
|
-
l({ reflect: !0, type: String })
|
|
471
|
-
], i.prototype, "name", 2);
|
|
472
|
-
c([
|
|
473
|
-
l({ reflect: !0, type: String })
|
|
474
|
-
], i.prototype, "hex", 2);
|
|
475
|
-
c([
|
|
476
|
-
l({ reflect: !0, type: String })
|
|
477
|
-
], i.prototype, "rgb", 2);
|
|
478
|
-
c([
|
|
479
|
-
l({ reflect: !0, type: String })
|
|
480
|
-
], i.prototype, "cmyk", 2);
|
|
481
|
-
c([
|
|
482
|
-
l({ reflect: !0, type: String })
|
|
483
|
-
], i.prototype, "pms", 2);
|
|
484
|
-
c([
|
|
485
|
-
l({ attribute: "can-copy", reflect: !0, type: Boolean })
|
|
486
|
-
], i.prototype, "canCopy", 2);
|
|
487
|
-
c([
|
|
488
|
-
l({
|
|
489
|
-
attribute: "show-codes",
|
|
490
|
-
converter: {
|
|
491
|
-
fromAttribute: (t) => t?.split(" ") ?? [],
|
|
492
|
-
toAttribute: (t) => t.join(" ")
|
|
493
|
-
}
|
|
494
|
-
})
|
|
495
|
-
], i.prototype, "showCodes", 2);
|
|
496
|
-
c([
|
|
497
|
-
l({ attribute: "can-focus-code-only", reflect: !0, type: Boolean })
|
|
498
|
-
], i.prototype, "canFocusCodeOnly", 2);
|
|
499
|
-
c([
|
|
500
|
-
l({ attribute: "no-auto-convert", reflect: !0, type: Boolean })
|
|
501
|
-
], i.prototype, "noAutoConvert", 2);
|
|
502
|
-
c([
|
|
503
|
-
d()
|
|
504
|
-
], i.prototype, "textColor", 2);
|
|
505
|
-
c([
|
|
506
|
-
d()
|
|
507
|
-
], i.prototype, "textVariant", 2);
|
|
508
|
-
c([
|
|
509
|
-
d()
|
|
510
|
-
], i.prototype, "rowGap", 2);
|
|
511
|
-
c([
|
|
512
|
-
d()
|
|
513
|
-
], i.prototype, "lineClamp", 2);
|
|
514
|
-
c([
|
|
515
|
-
d()
|
|
516
|
-
], i.prototype, "backgroundColor", 2);
|
|
517
|
-
c([
|
|
518
|
-
d()
|
|
519
|
-
], i.prototype, "canFocusContainer", 2);
|
|
520
|
-
c([
|
|
521
|
-
d()
|
|
522
|
-
], i.prototype, "isContainerFocused", 2);
|
|
523
|
-
c([
|
|
524
|
-
H(50)
|
|
525
|
-
], i.prototype, "handleResize", 1);
|
|
526
|
-
c([
|
|
527
|
-
h("variant")
|
|
528
|
-
], i.prototype, "handleVariantChange", 1);
|
|
529
|
-
c([
|
|
530
|
-
h("cmyk")
|
|
531
|
-
], i.prototype, "handleCmykChange", 1);
|
|
532
|
-
c([
|
|
533
|
-
h("rgb")
|
|
534
|
-
], i.prototype, "handleRGBChange", 1);
|
|
535
|
-
c([
|
|
536
|
-
h("hex")
|
|
537
|
-
], i.prototype, "handleHexChange", 1);
|
|
538
|
-
c([
|
|
539
|
-
h("hex", { waitUntilFirstUpdate: !0 }),
|
|
540
|
-
h("rgb", { waitUntilFirstUpdate: !0 }),
|
|
541
|
-
h("cmyk", { waitUntilFirstUpdate: !0 })
|
|
542
|
-
], i.prototype, "handleColorChange", 1);
|
|
543
|
-
c([
|
|
544
|
-
h("canFocusCodeOnly", { waitUntilFirstUpdate: !0 })
|
|
545
|
-
], i.prototype, "handleCanFocusCodeOnlyChange", 1);
|
|
546
|
-
i = c([
|
|
547
|
-
U("cx-color-swatch")
|
|
548
|
-
], i);
|
|
549
|
-
export {
|
|
550
|
-
i as C,
|
|
551
|
-
y as a,
|
|
552
|
-
p as b,
|
|
553
|
-
u as c,
|
|
554
|
-
Y as d,
|
|
555
|
-
xt as e,
|
|
556
|
-
Ct as g,
|
|
557
|
-
ft as p
|
|
558
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { s as d } from "./string.BCk3SmdZ.js";
|
|
2
|
-
import { B as l } from "./custom-element.vnXBMQxc.js";
|
|
3
|
-
const g = (e) => e.nodeType === Node.ELEMENT_NODE, h = (e, n) => {
|
|
4
|
-
if (!e)
|
|
5
|
-
return !1;
|
|
6
|
-
let t = e;
|
|
7
|
-
for (; t && t.parentNode; ) {
|
|
8
|
-
if (t.parentNode === n)
|
|
9
|
-
return !0;
|
|
10
|
-
t.parentNode.host ? t = t.parentNode.host : t = t.parentNode;
|
|
11
|
-
}
|
|
12
|
-
return !1;
|
|
13
|
-
}, u = (e = document) => {
|
|
14
|
-
const n = e.activeElement;
|
|
15
|
-
return n ? n.shadowRoot ? u(n.shadowRoot) : n : null;
|
|
16
|
-
}, f = (e, n = document.body, t = "width") => {
|
|
17
|
-
const i = e?.trim();
|
|
18
|
-
if (!i)
|
|
19
|
-
return 0;
|
|
20
|
-
const o = i.split(/\s+/)[0];
|
|
21
|
-
if (o.endsWith("px"))
|
|
22
|
-
return parseFloat(o);
|
|
23
|
-
const s = o.startsWith("-"), r = document.createElement("div");
|
|
24
|
-
r.style[t] = s ? o.substring(1) : o, r.style.position = "absolute", r.style.visibility = "hidden", n.appendChild(r);
|
|
25
|
-
const c = r.getBoundingClientRect(), a = t === "width" ? c.width : c.height;
|
|
26
|
-
return n.removeChild(r), s ? -a : a;
|
|
27
|
-
}, E = (e, n) => {
|
|
28
|
-
const t = n.getBoundingClientRect(), o = (e.clientX - t.left) / t.width * 100;
|
|
29
|
-
return Math.max(0, Math.min(100, o));
|
|
30
|
-
}, w = (e, n) => new Promise((t, i) => {
|
|
31
|
-
const o = document, s = o.querySelector(
|
|
32
|
-
`script[src="${e}"]`
|
|
33
|
-
);
|
|
34
|
-
if (s) {
|
|
35
|
-
if (s.getAttribute("data-loaded") === "true")
|
|
36
|
-
return t();
|
|
37
|
-
s.addEventListener("load", () => t()), s.addEventListener("error", (c) => i(c));
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const r = o.createElement("script");
|
|
41
|
-
r.src = e, r.async = !0, r.onload = () => {
|
|
42
|
-
r.setAttribute("data-loaded", "true"), t();
|
|
43
|
-
}, r.onerror = () => i(new Error(`Failed to load ${e}`)), o.head.appendChild(r);
|
|
44
|
-
});
|
|
45
|
-
function C(e) {
|
|
46
|
-
return [...e].sort((n, t) => {
|
|
47
|
-
const i = n.getBoundingClientRect().top, o = t.getBoundingClientRect().top;
|
|
48
|
-
return i - o;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function M() {
|
|
52
|
-
return window.StackMgr?.GetInstance()?.GetIndex() ?? 99999;
|
|
53
|
-
}
|
|
54
|
-
function R(e) {
|
|
55
|
-
const n = document.createElement("template");
|
|
56
|
-
return l(e, n.content), n.content.firstElementChild;
|
|
57
|
-
}
|
|
58
|
-
function T(e) {
|
|
59
|
-
const n = document.createElement("template");
|
|
60
|
-
return n.innerHTML = d(e), n.content.firstElementChild;
|
|
61
|
-
}
|
|
62
|
-
function N(e, n, t = 0) {
|
|
63
|
-
const i = e.getBoundingClientRect(), o = n.getBoundingClientRect();
|
|
64
|
-
return Math.round(o.left) >= Math.round(i.left) - t && Math.round(o.right) <= Math.round(i.right) + t;
|
|
65
|
-
}
|
|
66
|
-
export {
|
|
67
|
-
T as a,
|
|
68
|
-
E as b,
|
|
69
|
-
f as c,
|
|
70
|
-
M as d,
|
|
71
|
-
u as e,
|
|
72
|
-
h as f,
|
|
73
|
-
R as g,
|
|
74
|
-
g as h,
|
|
75
|
-
N as i,
|
|
76
|
-
w as l,
|
|
77
|
-
C as s
|
|
78
|
-
};
|