xmlui 0.10.20 → 0.10.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{index-Ckhnrf1F.mjs → index-BiS4wEuu.mjs} +740 -698
- package/dist/lib/{initMock-qnCFw6Zc.mjs → initMock-CB_cMi6U.mjs} +1 -1
- package/dist/lib/xmlui.mjs +1 -1
- package/dist/metadata/{collectedComponentMetadata-Dg7P-zOz.mjs → collectedComponentMetadata-MFUg6aSX.mjs} +734 -693
- package/dist/metadata/{initMock-ZyyFNOpL.mjs → initMock-Dw9wrVkQ.mjs} +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +3 -3
- package/dist/scripts/package.json +3 -6
- package/dist/scripts/src/components/App/App.js +4 -4
- package/dist/scripts/src/components/App/AppNative.js +1 -1
- package/dist/scripts/src/components/DateInput/DateInputNative.js +0 -1
- package/dist/scripts/src/components/Form/FormNative.js +0 -1
- package/dist/scripts/src/components/IFrame/IFrameNative.js +0 -2
- package/dist/scripts/src/components/Text/Text.js +5 -1
- package/dist/scripts/src/components/Text/Text.spec.js +317 -0
- package/dist/scripts/src/components/Text/TextNative.js +112 -1
- package/dist/scripts/src/components/TimeInput/TimeInputNative.js +0 -1
- package/dist/scripts/src/components/Timer/TimerNative.js +0 -1
- package/dist/scripts/src/components/Tree/TreeNative.js +7 -12
- package/dist/standalone/xmlui-standalone.umd.js +35 -35
- package/package.json +3 -6
|
@@ -2,12 +2,12 @@ var _a;
|
|
|
2
2
|
import "./index.css";
|
|
3
3
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import React__default, { useRef, useInsertionEffect, useCallback, forwardRef, useState, useEffect, useId, cloneElement, useMemo, useContext, useLayoutEffect, createContext, memo, Fragment as Fragment$1,
|
|
5
|
+
import React__default, { useRef, useInsertionEffect, useCallback, forwardRef, useState, useEffect, useId, cloneElement, useMemo, useContext, useLayoutEffect, createContext, memo, Fragment as Fragment$1, useReducer, isValidElement, useDeferredValue, createElement, startTransition, useTransition, Children } from "react";
|
|
6
6
|
import require$$0, { flushSync, createPortal } from "react-dom";
|
|
7
7
|
import yaml from "js-yaml";
|
|
8
8
|
import { useQuery, useInfiniteQuery, QueryClientProvider, QueryClient } from "@tanstack/react-query";
|
|
9
9
|
import produce, { createDraft, finishDraft, enableMapSet } from "immer";
|
|
10
|
-
import { throttle, get, isNil, omitBy, isUndefined, noop as noop$2, isPlainObject,
|
|
10
|
+
import { throttle, get, isNil, omitBy, isUndefined, noop as noop$2, isPlainObject, isEmpty, isEqual, union, uniq, orderBy as orderBy$1, isObject, isArray, groupBy, sortBy, omit, isNumber, isString as isString$1, set, isNaN as isNaN$1, cloneDeep, merge, defaultTo, capitalize, unset, setWith, keyBy, pick } from "lodash-es";
|
|
11
11
|
import { formatDistanceToNow, parse, format, parseISO, isValid, isToday, isYesterday, isTomorrow, isThisWeek, formatRelative, isThisYear, isSameDay, differenceInMinutes } from "date-fns";
|
|
12
12
|
import { l as labelPositionMd, o as orientationOptionMd, v as validationStatusMd, b as alignmentOptionValues, i as isSizeType, L as LinkTargetMd, c as alignmentOptionMd, d as iconPositionMd, e as buttonTypesMd, s as sizeMd, f as buttonThemeMd, g as buttonVariantMd, h as layoutOptionKeys, T as TextVariantElement, V as VariantPropsKeys, j as variantOptionsMd, k as scrollAnchoringValues, m as buttonThemeNames, n as iconPositionNames, p as buttonVariantNames, t as triggerPositionNames, q as httpMethodNames, r as orientationOptionValues, u as viewportSizeNames, M as MetadataProvider } from "./metadata-utils-BTIt1_wE.mjs";
|
|
13
13
|
import classnames from "classnames";
|
|
@@ -21,15 +21,13 @@ import { useLocation, NavLink as NavLink$1, Link, useNavigate, Routes, Route, Na
|
|
|
21
21
|
import { Helmet, HelmetProvider } from "react-helmet-async";
|
|
22
22
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
23
23
|
import { useContextSelector, createContext as createContext$1 } from "use-context-selector";
|
|
24
|
-
import {
|
|
25
|
-
import AutoSizer from "react-virtualized-auto-sizer";
|
|
24
|
+
import { Virtualizer } from "virtua";
|
|
26
25
|
import { F as Parser, G as T_CALCULATED_MEMBER_ACCESS_EXPRESSION, H as T_MEMBER_ACCESS_EXPRESSION, I as T_IDENTIFIER, J as T_PREFIX_OP_EXPRESSION, K as T_FUNCTION_DECLARATION, L as T_ARROW_EXPRESSION, M as createXmlUiTreeNodeId, O as T_EMPTY_STATEMENT, Q as T_SWITCH_STATEMENT, R as T_TRY_STATEMENT, V as T_THROW_STATEMENT, W as T_FOR_OF_STATEMENT, X as T_FOR_IN_STATEMENT, Y as T_FOR_STATEMENT, Z as T_EXPRESSION_STATEMENT, _ as T_BREAK_STATEMENT, $ as T_CONTINUE_STATEMENT, a0 as T_DO_WHILE_STATEMENT, a1 as T_WHILE_STATEMENT, a2 as T_RETURN_STATEMENT, a3 as T_IF_STATEMENT, a4 as T_CONST_STATEMENT, a5 as T_LET_STATEMENT, a6 as T_ARROW_EXPRESSION_STATEMENT, a7 as T_BLOCK_STATEMENT, a8 as T_VAR_STATEMENT, a9 as T_ASSIGNMENT_EXPRESSION, aa as T_LITERAL, ab as T_SPREAD_EXPRESSION, ac as T_FUNCTION_INVOCATION_EXPRESSION, ad as T_POSTFIX_OP_EXPRESSION, ae as T_CONDITIONAL_EXPRESSION, af as T_BINARY_EXPRESSION, ag as T_UNARY_EXPRESSION, ah as T_OBJECT_LITERAL, ai as T_ARRAY_LITERAL, aj as T_SEQUENCE_EXPRESSION, ak as T_TEMPLATE_LITERAL_EXPRESSION, al as T_VAR_DECLARATION, am as T_DESTRUCTURE, h as createXmlUiParser, w as nodeToComponentDef, D as DiagnosticCategory, E as ErrCodes, S as SyntaxKind, an as PARSED_MARK_PROP, ao as collectCodeBehindFromSource, ap as removeCodeBehindTokensFromTree } from "./transform-Tooy42EB.mjs";
|
|
27
26
|
import { useReactTable, getPaginationRowModel, getCoreRowModel, flexRender } from "@tanstack/react-table";
|
|
28
27
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
29
28
|
import { RenderPropSticky } from "react-sticky-el";
|
|
30
29
|
import * as dropzone from "react-dropzone";
|
|
31
30
|
import toast, { Toaster, ToastBar } from "react-hot-toast";
|
|
32
|
-
import { Virtualizer } from "virtua";
|
|
33
31
|
import memoizeOne from "memoize-one";
|
|
34
32
|
import { Popover, PopoverTrigger, Portal as Portal$1, PopoverContent, PopoverPortal } from "@radix-ui/react-popover";
|
|
35
33
|
import { FocusScope } from "@radix-ui/react-focus-scope";
|
|
@@ -4850,6 +4848,7 @@ function App({
|
|
|
4850
4848
|
name,
|
|
4851
4849
|
className,
|
|
4852
4850
|
applyDefaultContentPadding,
|
|
4851
|
+
registerComponentApi,
|
|
4853
4852
|
...rest
|
|
4854
4853
|
}) {
|
|
4855
4854
|
const { getThemeVar } = useTheme();
|
|
@@ -6249,7 +6248,7 @@ function hierarchyToNative(hierarchyData, fieldConfig) {
|
|
|
6249
6248
|
treeItemsById
|
|
6250
6249
|
};
|
|
6251
6250
|
}
|
|
6252
|
-
const TreeRow = memo(({ index,
|
|
6251
|
+
const TreeRow = memo(({ index, data }) => {
|
|
6253
6252
|
const {
|
|
6254
6253
|
nodes,
|
|
6255
6254
|
toggleNode,
|
|
@@ -6306,7 +6305,7 @@ const TreeRow = memo(({ index, style: style2, data }) => {
|
|
|
6306
6305
|
);
|
|
6307
6306
|
const nodeWithState = treeItem;
|
|
6308
6307
|
const isLoading = nodeWithState.loadingState === "loading";
|
|
6309
|
-
return /* @__PURE__ */ jsx("div", { style: {
|
|
6308
|
+
return /* @__PURE__ */ jsx("div", { style: { width: "100%", display: "flex" }, children: /* @__PURE__ */ jsxs(
|
|
6310
6309
|
"div",
|
|
6311
6310
|
{
|
|
6312
6311
|
className: classnames(styles$16.rowWrapper, {
|
|
@@ -6897,10 +6896,6 @@ const TreeComponent = memo((props) => {
|
|
|
6897
6896
|
animateExpand,
|
|
6898
6897
|
expandRotation
|
|
6899
6898
|
]);
|
|
6900
|
-
const getItemKey = useCallback((index, data2) => {
|
|
6901
|
-
const node = data2.nodes[index];
|
|
6902
|
-
return (node == null ? void 0 : node.key) || (node == null ? void 0 : node.id) || `fallback-${index}`;
|
|
6903
|
-
}, []);
|
|
6904
6899
|
const treeApiMethods = useMemo(() => {
|
|
6905
6900
|
return {
|
|
6906
6901
|
// Expansion methods
|
|
@@ -7076,14 +7071,14 @@ const TreeComponent = memo((props) => {
|
|
|
7076
7071
|
(item2) => String(item2.key) === String(nodeId)
|
|
7077
7072
|
);
|
|
7078
7073
|
if (nodeIndex >= 0 && listRef.current) {
|
|
7079
|
-
listRef.current.
|
|
7074
|
+
listRef.current.scrollToIndex(nodeIndex, { align: "center" });
|
|
7080
7075
|
}
|
|
7081
7076
|
}, 0);
|
|
7082
7077
|
},
|
|
7083
7078
|
scrollToItem: (nodeId) => {
|
|
7084
7079
|
const nodeIndex = findNodeIndexById(nodeId);
|
|
7085
7080
|
if (nodeIndex >= 0 && listRef.current) {
|
|
7086
|
-
listRef.current.
|
|
7081
|
+
listRef.current.scrollToIndex(nodeIndex, { align: "center" });
|
|
7087
7082
|
}
|
|
7088
7083
|
},
|
|
7089
7084
|
appendNode: (parentNodeId, nodeData) => {
|
|
@@ -7400,19 +7395,8 @@ const TreeComponent = memo((props) => {
|
|
|
7400
7395
|
onFocus: handleTreeFocus,
|
|
7401
7396
|
onBlur: handleTreeBlur,
|
|
7402
7397
|
onKeyDown: handleKeyDown,
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
{
|
|
7406
|
-
ref: listRef,
|
|
7407
|
-
height,
|
|
7408
|
-
itemCount: itemData.nodes.length,
|
|
7409
|
-
itemData,
|
|
7410
|
-
itemSize: itemHeight,
|
|
7411
|
-
itemKey: getItemKey,
|
|
7412
|
-
width,
|
|
7413
|
-
children: TreeRow
|
|
7414
|
-
}
|
|
7415
|
-
) })
|
|
7398
|
+
style: { height: "100%", overflow: "auto" },
|
|
7399
|
+
children: /* @__PURE__ */ jsx(Virtualizer, { ref: listRef, children: flatTreeData.map((node, index) => /* @__PURE__ */ jsx(TreeRow, { index, data: itemData }, node.key)) })
|
|
7416
7400
|
}
|
|
7417
7401
|
);
|
|
7418
7402
|
});
|
|
@@ -10798,6 +10782,576 @@ const styles$13 = {
|
|
|
10798
10782
|
breakKeep,
|
|
10799
10783
|
breakHyphenate
|
|
10800
10784
|
};
|
|
10785
|
+
function hashString(str) {
|
|
10786
|
+
let hash = 5381;
|
|
10787
|
+
let i = str.length;
|
|
10788
|
+
while (i) {
|
|
10789
|
+
hash = hash * 33 ^ str.charCodeAt(--i);
|
|
10790
|
+
}
|
|
10791
|
+
let s = (hash >>> 0).toString(36);
|
|
10792
|
+
return s;
|
|
10793
|
+
}
|
|
10794
|
+
function toKebabCase(str) {
|
|
10795
|
+
if (str.startsWith("--")) {
|
|
10796
|
+
return str;
|
|
10797
|
+
}
|
|
10798
|
+
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
10799
|
+
}
|
|
10800
|
+
function stableJSONStringify(obj) {
|
|
10801
|
+
return JSON.stringify(obj);
|
|
10802
|
+
}
|
|
10803
|
+
class StyleRegistry {
|
|
10804
|
+
constructor() {
|
|
10805
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
10806
|
+
this.rootClasses = /* @__PURE__ */ new Set();
|
|
10807
|
+
this.injected = /* @__PURE__ */ new Set();
|
|
10808
|
+
this.refCounts = /* @__PURE__ */ new Map();
|
|
10809
|
+
this.ssrHashes = /* @__PURE__ */ new Set();
|
|
10810
|
+
}
|
|
10811
|
+
register(styles2) {
|
|
10812
|
+
const key = stableJSONStringify(styles2);
|
|
10813
|
+
const styleHash = hashString(key);
|
|
10814
|
+
const cachedEntry = this.cache.get(styleHash);
|
|
10815
|
+
if (cachedEntry) {
|
|
10816
|
+
return cachedEntry;
|
|
10817
|
+
}
|
|
10818
|
+
const className = `css-${styleHash}`;
|
|
10819
|
+
const css = this._generateCss(`.${className}`, styles2);
|
|
10820
|
+
const entry = { className, styleHash, css };
|
|
10821
|
+
this.cache.set(styleHash, entry);
|
|
10822
|
+
return entry;
|
|
10823
|
+
}
|
|
10824
|
+
/**
|
|
10825
|
+
* [PRIVATE] Recursively generates CSS rules from a style object.
|
|
10826
|
+
* This is the new, more powerful engine.
|
|
10827
|
+
* @param selector - The CSS selector for the current context (e.g., '.css-123' or '&:hover').
|
|
10828
|
+
* @param styles - The style object to process.
|
|
10829
|
+
* @returns A string of CSS rules.
|
|
10830
|
+
*/
|
|
10831
|
+
_generateCss(selector, styles2) {
|
|
10832
|
+
const directProps = [];
|
|
10833
|
+
const nestedRules = [];
|
|
10834
|
+
for (const key in styles2) {
|
|
10835
|
+
const value = styles2[key];
|
|
10836
|
+
if (typeof value === "object" && value !== null) {
|
|
10837
|
+
nestedRules.push(this._processNestedRule(selector, key, value));
|
|
10838
|
+
} else {
|
|
10839
|
+
directProps.push(`${toKebabCase(key)}:${value};`);
|
|
10840
|
+
}
|
|
10841
|
+
}
|
|
10842
|
+
let finalCss = "";
|
|
10843
|
+
if (directProps.length > 0) {
|
|
10844
|
+
finalCss += `${selector} {${directProps.join("")}}`;
|
|
10845
|
+
}
|
|
10846
|
+
finalCss += nestedRules.join("");
|
|
10847
|
+
return finalCss;
|
|
10848
|
+
}
|
|
10849
|
+
_processNestedRule(parentSelector, nestedKey, nestedStyles) {
|
|
10850
|
+
if (nestedKey.startsWith("@")) {
|
|
10851
|
+
return `${nestedKey}{${this._generateCss(parentSelector, nestedStyles)}}`;
|
|
10852
|
+
}
|
|
10853
|
+
const newSelector = nestedKey.replace(/&/g, parentSelector);
|
|
10854
|
+
return this._generateCss(newSelector, nestedStyles);
|
|
10855
|
+
}
|
|
10856
|
+
getSsrStyles() {
|
|
10857
|
+
const allCss = Array.from(this.cache.values()).map((entry) => entry.css).join("");
|
|
10858
|
+
return `@layer dynamic {${allCss}}`;
|
|
10859
|
+
}
|
|
10860
|
+
/**
|
|
10861
|
+
* Adds a class name to be applied to the <html> tag.
|
|
10862
|
+
*/
|
|
10863
|
+
addRootClasses(classNames) {
|
|
10864
|
+
classNames.forEach((className) => {
|
|
10865
|
+
this.rootClasses.add(className);
|
|
10866
|
+
});
|
|
10867
|
+
}
|
|
10868
|
+
/**
|
|
10869
|
+
* Returns a space-separated string of all collected html classes.
|
|
10870
|
+
*/
|
|
10871
|
+
getRootClasses() {
|
|
10872
|
+
return Array.from(this.rootClasses).join(" ");
|
|
10873
|
+
}
|
|
10874
|
+
// NEW: A helper to safely get the current reference count.
|
|
10875
|
+
getRefCount(styleHash) {
|
|
10876
|
+
return this.refCounts.get(styleHash) || 0;
|
|
10877
|
+
}
|
|
10878
|
+
/**
|
|
10879
|
+
* Increments the reference count for a given style hash.
|
|
10880
|
+
*/
|
|
10881
|
+
incrementRef(styleHash) {
|
|
10882
|
+
const newCount = (this.refCounts.get(styleHash) || 0) + 1;
|
|
10883
|
+
this.refCounts.set(styleHash, newCount);
|
|
10884
|
+
}
|
|
10885
|
+
/**
|
|
10886
|
+
* Decrements the reference count for a given style hash.
|
|
10887
|
+
* @returns {number} The new reference count.
|
|
10888
|
+
*/
|
|
10889
|
+
decrementRef(styleHash) {
|
|
10890
|
+
const currentCount = this.refCounts.get(styleHash) || 0;
|
|
10891
|
+
const newCount = Math.max(0, currentCount - 1);
|
|
10892
|
+
if (newCount > 0) {
|
|
10893
|
+
this.refCounts.set(styleHash, newCount);
|
|
10894
|
+
} else {
|
|
10895
|
+
this.refCounts.delete(styleHash);
|
|
10896
|
+
}
|
|
10897
|
+
return newCount;
|
|
10898
|
+
}
|
|
10899
|
+
}
|
|
10900
|
+
const IndexerContext = React__default.createContext({
|
|
10901
|
+
indexing: false
|
|
10902
|
+
});
|
|
10903
|
+
function useIndexerContext() {
|
|
10904
|
+
return useContext(IndexerContext);
|
|
10905
|
+
}
|
|
10906
|
+
const StyleContext = createContext(null);
|
|
10907
|
+
function StyleProvider({
|
|
10908
|
+
children,
|
|
10909
|
+
styleRegistry = new StyleRegistry(),
|
|
10910
|
+
forceNew = false
|
|
10911
|
+
// Optional prop to force a new registry
|
|
10912
|
+
}) {
|
|
10913
|
+
const parentRegistry = useContext(StyleContext);
|
|
10914
|
+
const [registry] = useState(() => {
|
|
10915
|
+
const newRegistry = styleRegistry;
|
|
10916
|
+
if (typeof window !== "undefined") {
|
|
10917
|
+
const ssrTag = document.querySelector('style[data-style-registry="true"]');
|
|
10918
|
+
const ssrHashes = ssrTag == null ? void 0 : ssrTag.getAttribute("data-ssr-hashes");
|
|
10919
|
+
if (ssrHashes) {
|
|
10920
|
+
let hashes = ssrHashes.split(",");
|
|
10921
|
+
newRegistry.ssrHashes = new Set(hashes);
|
|
10922
|
+
newRegistry.injected = new Set(hashes);
|
|
10923
|
+
}
|
|
10924
|
+
}
|
|
10925
|
+
return newRegistry;
|
|
10926
|
+
});
|
|
10927
|
+
if (parentRegistry && !forceNew) {
|
|
10928
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
10929
|
+
}
|
|
10930
|
+
return /* @__PURE__ */ jsx(StyleContext.Provider, { value: registry, children });
|
|
10931
|
+
}
|
|
10932
|
+
function useStyleRegistry() {
|
|
10933
|
+
const registry = useContext(StyleContext);
|
|
10934
|
+
if (registry === null) {
|
|
10935
|
+
throw new Error("Component must be used within a StyleProvider");
|
|
10936
|
+
}
|
|
10937
|
+
return registry;
|
|
10938
|
+
}
|
|
10939
|
+
function useComponentStyle(styles2) {
|
|
10940
|
+
const rootStyle = useMemo(() => {
|
|
10941
|
+
return !styles2 || Object.keys(styles2).length === 0 ? EMPTY_OBJECT : {
|
|
10942
|
+
"&": styles2
|
|
10943
|
+
// "@container style(--screenSize: 1) or @container style(--screenSize: 2) ... etc": responsiveSizes,
|
|
10944
|
+
};
|
|
10945
|
+
}, [styles2]);
|
|
10946
|
+
return useStyles(rootStyle);
|
|
10947
|
+
}
|
|
10948
|
+
const StyleInjectionTargetContext = createContext(null);
|
|
10949
|
+
function useDomRoot() {
|
|
10950
|
+
const domRoot = useContext(StyleInjectionTargetContext);
|
|
10951
|
+
return domRoot;
|
|
10952
|
+
}
|
|
10953
|
+
function useStyles(styles2, { prepend } = EMPTY_OBJECT) {
|
|
10954
|
+
const { indexing } = useIndexerContext();
|
|
10955
|
+
const domRoot = useDomRoot();
|
|
10956
|
+
const injectionTarget = typeof document === "undefined" ? null : domRoot instanceof ShadowRoot ? domRoot : document.head;
|
|
10957
|
+
const registry = useStyleRegistry();
|
|
10958
|
+
const { className, styleHash } = useMemo(() => {
|
|
10959
|
+
if (indexing || !styles2 || styles2 === EMPTY_OBJECT || Object.keys(styles2).length === 0) {
|
|
10960
|
+
return { className: void 0, styleHash: void 0 };
|
|
10961
|
+
}
|
|
10962
|
+
return registry.register(styles2);
|
|
10963
|
+
}, [indexing, registry, styles2]);
|
|
10964
|
+
useInsertionEffect(() => {
|
|
10965
|
+
if (!styleHash || registry.injected.has(styleHash)) {
|
|
10966
|
+
return;
|
|
10967
|
+
}
|
|
10968
|
+
const { css } = registry.cache.get(styleHash) || {};
|
|
10969
|
+
if (css) {
|
|
10970
|
+
const styleElement = document.createElement("style");
|
|
10971
|
+
styleElement.setAttribute("data-style-hash", styleHash);
|
|
10972
|
+
styleElement.innerHTML = `@layer dynamic {
|
|
10973
|
+
${css}
|
|
10974
|
+
}`;
|
|
10975
|
+
if (prepend) {
|
|
10976
|
+
injectionTarget.insertBefore(styleElement, injectionTarget.firstChild.nextSibling);
|
|
10977
|
+
} else {
|
|
10978
|
+
injectionTarget.appendChild(styleElement);
|
|
10979
|
+
}
|
|
10980
|
+
registry.injected.add(styleHash);
|
|
10981
|
+
}
|
|
10982
|
+
}, [registry, styleHash, injectionTarget]);
|
|
10983
|
+
useEffect(() => {
|
|
10984
|
+
if (!styleHash) {
|
|
10985
|
+
return;
|
|
10986
|
+
}
|
|
10987
|
+
registry.incrementRef(styleHash);
|
|
10988
|
+
return () => {
|
|
10989
|
+
registry.decrementRef(styleHash);
|
|
10990
|
+
setTimeout(() => {
|
|
10991
|
+
var _a2;
|
|
10992
|
+
if (registry.getRefCount(styleHash) === 0 && !registry.ssrHashes.has(styleHash)) {
|
|
10993
|
+
registry.injected.delete(styleHash);
|
|
10994
|
+
(_a2 = injectionTarget.querySelector(`style[data-style-hash="${styleHash}"]`)) == null ? void 0 : _a2.remove();
|
|
10995
|
+
}
|
|
10996
|
+
}, 0);
|
|
10997
|
+
};
|
|
10998
|
+
}, [injectionTarget, registry, styleHash]);
|
|
10999
|
+
return className;
|
|
11000
|
+
}
|
|
11001
|
+
const THEME_VAR_PREFIX = "xmlui";
|
|
11002
|
+
const themeVarCapturesRegex = /(\$[a-zA-Z][a-zA-Z0-9-_]*)/g;
|
|
11003
|
+
const booleanRegex = /^(true|false)$/;
|
|
11004
|
+
const starSizeRegex = /^\d*\*$/;
|
|
11005
|
+
const defaultCompResult = {
|
|
11006
|
+
cssProps: {},
|
|
11007
|
+
issues: /* @__PURE__ */ new Set()
|
|
11008
|
+
};
|
|
11009
|
+
function resolveLayoutProps(layoutProps = EMPTY_OBJECT, layoutContext) {
|
|
11010
|
+
const result = {
|
|
11011
|
+
cssProps: {},
|
|
11012
|
+
issues: /* @__PURE__ */ new Set()
|
|
11013
|
+
};
|
|
11014
|
+
if (!!getOrientation(layoutContext)) {
|
|
11015
|
+
result.cssProps.flexShrink = 0;
|
|
11016
|
+
}
|
|
11017
|
+
collectCss("width");
|
|
11018
|
+
const horizontalStarSize = getHorizontalStarSize(result.cssProps.width, layoutContext);
|
|
11019
|
+
if (horizontalStarSize !== null) {
|
|
11020
|
+
result.cssProps.flex = horizontalStarSize;
|
|
11021
|
+
result.cssProps.flexShrink = 1;
|
|
11022
|
+
}
|
|
11023
|
+
collectCss("minWidth");
|
|
11024
|
+
collectCss("maxWidth");
|
|
11025
|
+
collectCss("height");
|
|
11026
|
+
const verticalStarSize = getVerticalStarSize(result.cssProps.height, layoutContext);
|
|
11027
|
+
if (verticalStarSize !== null) {
|
|
11028
|
+
result.cssProps.flex = verticalStarSize;
|
|
11029
|
+
result.cssProps.flexShrink = 1;
|
|
11030
|
+
}
|
|
11031
|
+
collectCss("minHeight");
|
|
11032
|
+
collectCss("maxHeight");
|
|
11033
|
+
collectCss("top");
|
|
11034
|
+
collectCss("right");
|
|
11035
|
+
collectCss("bottom");
|
|
11036
|
+
collectCss("left");
|
|
11037
|
+
collectCss("gap");
|
|
11038
|
+
collectCss("padding");
|
|
11039
|
+
const paddingHorizontal = transformLayoutValue("paddingHorizontal");
|
|
11040
|
+
if (paddingHorizontal) {
|
|
11041
|
+
result.cssProps.paddingLeft = paddingHorizontal;
|
|
11042
|
+
result.cssProps.paddingRight = paddingHorizontal;
|
|
11043
|
+
}
|
|
11044
|
+
collectCss("paddingRight");
|
|
11045
|
+
collectCss("paddingLeft");
|
|
11046
|
+
const paddingVertical = transformLayoutValue("paddingVertical");
|
|
11047
|
+
if (paddingVertical) {
|
|
11048
|
+
result.cssProps.paddingTop = paddingVertical;
|
|
11049
|
+
result.cssProps.paddingBottom = paddingVertical;
|
|
11050
|
+
}
|
|
11051
|
+
collectCss("paddingTop");
|
|
11052
|
+
collectCss("paddingBottom");
|
|
11053
|
+
collectCss("margin");
|
|
11054
|
+
const marginHorizontal = transformLayoutValue("marginHorizontal");
|
|
11055
|
+
if (marginHorizontal) {
|
|
11056
|
+
result.cssProps.marginLeft = marginHorizontal;
|
|
11057
|
+
result.cssProps.marginRight = marginHorizontal;
|
|
11058
|
+
}
|
|
11059
|
+
collectCss("marginRight");
|
|
11060
|
+
collectCss("marginLeft");
|
|
11061
|
+
const marginVertical = transformLayoutValue("marginVertical");
|
|
11062
|
+
if (marginVertical) {
|
|
11063
|
+
result.cssProps.marginTop = marginVertical;
|
|
11064
|
+
result.cssProps.marginBottom = marginVertical;
|
|
11065
|
+
}
|
|
11066
|
+
collectCss("marginTop");
|
|
11067
|
+
collectCss("marginBottom");
|
|
11068
|
+
collectCss("border");
|
|
11069
|
+
const horizontalBorder = transformLayoutValue("borderHorizontal");
|
|
11070
|
+
if (horizontalBorder) {
|
|
11071
|
+
result.cssProps.borderLeft = horizontalBorder;
|
|
11072
|
+
result.cssProps.borderRight = horizontalBorder;
|
|
11073
|
+
}
|
|
11074
|
+
collectCss("borderRight");
|
|
11075
|
+
collectCss("borderLeft");
|
|
11076
|
+
const verticalBorder = transformLayoutValue("borderVertical");
|
|
11077
|
+
if (verticalBorder) {
|
|
11078
|
+
result.cssProps.borderTop = verticalBorder;
|
|
11079
|
+
result.cssProps.borderBottom = verticalBorder;
|
|
11080
|
+
}
|
|
11081
|
+
collectCss("borderTop");
|
|
11082
|
+
collectCss("borderBottom");
|
|
11083
|
+
collectCss("borderColor");
|
|
11084
|
+
collectCss("borderStyle");
|
|
11085
|
+
collectCss("borderWidth");
|
|
11086
|
+
collectCss("borderRadius");
|
|
11087
|
+
collectCss("radiusTopLeft", "borderTopLeftRadius");
|
|
11088
|
+
collectCss("radiusTopRight", "borderTopRightRadius");
|
|
11089
|
+
collectCss("radiusBottomLeft", "borderBottomLeftRadius");
|
|
11090
|
+
collectCss("radiusBottomRight", "borderBottomRightRadius");
|
|
11091
|
+
collectCss("color");
|
|
11092
|
+
collectCss("fontFamily");
|
|
11093
|
+
collectCss("fontSize");
|
|
11094
|
+
collectCss("fontWeight");
|
|
11095
|
+
collectCss("fontStyle");
|
|
11096
|
+
collectCss("fontVariant");
|
|
11097
|
+
collectCss("lineBreak");
|
|
11098
|
+
collectCss("textDecoration");
|
|
11099
|
+
collectCss("textDecorationLine");
|
|
11100
|
+
collectCss("textDecorationColor");
|
|
11101
|
+
collectCss("textDecorationStyle");
|
|
11102
|
+
collectCss("textDecorationThickness");
|
|
11103
|
+
collectCss("textIndent");
|
|
11104
|
+
collectCss("textShadow");
|
|
11105
|
+
collectCss("textUnderlineOffset");
|
|
11106
|
+
collectCss("userSelect");
|
|
11107
|
+
collectCss("letterSpacing");
|
|
11108
|
+
collectCss("textTransform");
|
|
11109
|
+
collectCss("lineHeight");
|
|
11110
|
+
collectCss("textAlign");
|
|
11111
|
+
collectCss("textAlignLast");
|
|
11112
|
+
collectCss("textWrap");
|
|
11113
|
+
collectCss("wordBreak");
|
|
11114
|
+
collectCss("wordSpacing");
|
|
11115
|
+
collectCss("wordWrap");
|
|
11116
|
+
collectCss("writingMode");
|
|
11117
|
+
collectCss("backgroundColor");
|
|
11118
|
+
collectCss("background");
|
|
11119
|
+
collectCss("boxShadow");
|
|
11120
|
+
collectCss("direction");
|
|
11121
|
+
collectCss("overflowX");
|
|
11122
|
+
collectCss("overflowY");
|
|
11123
|
+
collectCss("zIndex");
|
|
11124
|
+
collectCss("opacity");
|
|
11125
|
+
collectCss("zoom");
|
|
11126
|
+
collectCss("cursor");
|
|
11127
|
+
collectCss("whiteSpace");
|
|
11128
|
+
collectCss("transform");
|
|
11129
|
+
collectCss("outline");
|
|
11130
|
+
collectCss("outlineWidth");
|
|
11131
|
+
collectCss("outlineColor");
|
|
11132
|
+
collectCss("outlineStyle");
|
|
11133
|
+
collectCss("outlineOffset");
|
|
11134
|
+
const wrapContent = transformLayoutValue("wrapContent");
|
|
11135
|
+
if (wrapContent) {
|
|
11136
|
+
result.cssProps.flexWrap = wrapContent === "true" ? "wrap" : "nowrap";
|
|
11137
|
+
}
|
|
11138
|
+
collectCss("canShrink", "flexShrink");
|
|
11139
|
+
const canShrink = transformLayoutValue("canShrink");
|
|
11140
|
+
if (canShrink) {
|
|
11141
|
+
result.cssProps.flexShrink = canShrink === "true" ? 1 : 0;
|
|
11142
|
+
}
|
|
11143
|
+
if (isEmpty(result.cssProps) && isEmpty(result.issues)) {
|
|
11144
|
+
return defaultCompResult;
|
|
11145
|
+
}
|
|
11146
|
+
return result;
|
|
11147
|
+
function transformLayoutValue(prop) {
|
|
11148
|
+
var _a2, _b;
|
|
11149
|
+
const defValue = resolveSingleValue();
|
|
11150
|
+
if (((_a2 = layoutContext == null ? void 0 : layoutContext.mediaSize) == null ? void 0 : _a2.sizeIndex) !== void 0) {
|
|
11151
|
+
const sizeIndex = (_b = layoutContext.mediaSize) == null ? void 0 : _b.sizeIndex;
|
|
11152
|
+
const xsValue = resolveSingleValue("xs");
|
|
11153
|
+
const smValue = resolveSingleValue("sm");
|
|
11154
|
+
const mdValue = resolveSingleValue("md");
|
|
11155
|
+
const lgValue = resolveSingleValue("lg");
|
|
11156
|
+
const xlValue = resolveSingleValue("xl");
|
|
11157
|
+
const xxlValue = resolveSingleValue("xxl");
|
|
11158
|
+
let mergedValue;
|
|
11159
|
+
switch (sizeIndex) {
|
|
11160
|
+
case 0:
|
|
11161
|
+
mergedValue = xsValue ?? smValue ?? mdValue;
|
|
11162
|
+
break;
|
|
11163
|
+
case 1:
|
|
11164
|
+
mergedValue = smValue ?? mdValue;
|
|
11165
|
+
break;
|
|
11166
|
+
case 2:
|
|
11167
|
+
mergedValue = mdValue;
|
|
11168
|
+
break;
|
|
11169
|
+
case 3:
|
|
11170
|
+
mergedValue = lgValue;
|
|
11171
|
+
break;
|
|
11172
|
+
case 4:
|
|
11173
|
+
mergedValue = xlValue ?? lgValue;
|
|
11174
|
+
break;
|
|
11175
|
+
case 5:
|
|
11176
|
+
mergedValue = xxlValue ?? xlValue ?? lgValue;
|
|
11177
|
+
break;
|
|
11178
|
+
}
|
|
11179
|
+
return mergedValue ?? defValue;
|
|
11180
|
+
}
|
|
11181
|
+
return defValue;
|
|
11182
|
+
function resolveSingleValue(sizeTag = "") {
|
|
11183
|
+
const fullProp = sizeTag ? `${prop}-${sizeTag}` : prop;
|
|
11184
|
+
let singleInput = layoutProps[fullProp];
|
|
11185
|
+
if (singleInput == void 0) {
|
|
11186
|
+
return;
|
|
11187
|
+
}
|
|
11188
|
+
if (typeof singleInput === "string") {
|
|
11189
|
+
singleInput = singleInput.trim();
|
|
11190
|
+
} else {
|
|
11191
|
+
singleInput = singleInput.toString();
|
|
11192
|
+
}
|
|
11193
|
+
const value = singleInput ? singleInput.replace(
|
|
11194
|
+
themeVarCapturesRegex,
|
|
11195
|
+
(match) => toCssVar(match.trim())
|
|
11196
|
+
) : void 0;
|
|
11197
|
+
if (singleInput !== value) {
|
|
11198
|
+
return value;
|
|
11199
|
+
}
|
|
11200
|
+
const propPatterns = layoutPatterns[prop];
|
|
11201
|
+
if (!propPatterns || propPatterns.length === 0) {
|
|
11202
|
+
return value;
|
|
11203
|
+
}
|
|
11204
|
+
for (const pattern of propPatterns) {
|
|
11205
|
+
if (pattern.test(value)) {
|
|
11206
|
+
return value;
|
|
11207
|
+
}
|
|
11208
|
+
}
|
|
11209
|
+
result.issues.add(fullProp);
|
|
11210
|
+
return value;
|
|
11211
|
+
}
|
|
11212
|
+
}
|
|
11213
|
+
function collectCss(prop, propCssName = "") {
|
|
11214
|
+
const value = transformLayoutValue(prop);
|
|
11215
|
+
if (value) {
|
|
11216
|
+
result.cssProps[propCssName || prop] = value;
|
|
11217
|
+
}
|
|
11218
|
+
}
|
|
11219
|
+
function getHorizontalStarSize(size, layoutContext2) {
|
|
11220
|
+
if (!size) return null;
|
|
11221
|
+
const orientation = getOrientation(layoutContext2);
|
|
11222
|
+
return orientation === "horizontal" && starSizeRegex.test(size.toString()) ? getStarSizeNumber(size.toString()) : null;
|
|
11223
|
+
}
|
|
11224
|
+
function getVerticalStarSize(size, layoutContext2) {
|
|
11225
|
+
if (!size) return null;
|
|
11226
|
+
const orientation = getOrientation(layoutContext2);
|
|
11227
|
+
return orientation === "vertical" && starSizeRegex.test(size.toString()) ? getStarSizeNumber(size.toString()) : null;
|
|
11228
|
+
}
|
|
11229
|
+
function getStarSizeNumber(input2) {
|
|
11230
|
+
if (starSizeRegex.test(input2)) {
|
|
11231
|
+
const numberPart = input2.slice(0, -1);
|
|
11232
|
+
return numberPart === "" ? 1 : parseInt(numberPart, 10);
|
|
11233
|
+
}
|
|
11234
|
+
return null;
|
|
11235
|
+
}
|
|
11236
|
+
function getOrientation(layoutContext2) {
|
|
11237
|
+
if (!layoutContext2) return;
|
|
11238
|
+
let orientation = (layoutContext2 == null ? void 0 : layoutContext2.type) === "Stack" && (layoutContext2 == null ? void 0 : layoutContext2.orientation);
|
|
11239
|
+
return orientation == null ? void 0 : orientation.toString();
|
|
11240
|
+
}
|
|
11241
|
+
}
|
|
11242
|
+
function toCssVar(c) {
|
|
11243
|
+
return `var(--${THEME_VAR_PREFIX}-${c.substring(1)})`;
|
|
11244
|
+
}
|
|
11245
|
+
const layoutPatterns = {
|
|
11246
|
+
// --- Dimensions
|
|
11247
|
+
width: [],
|
|
11248
|
+
minWidth: [],
|
|
11249
|
+
maxWidth: [],
|
|
11250
|
+
height: [],
|
|
11251
|
+
minHeight: [],
|
|
11252
|
+
maxHeight: [],
|
|
11253
|
+
gap: [],
|
|
11254
|
+
// --- Positions
|
|
11255
|
+
top: [],
|
|
11256
|
+
right: [],
|
|
11257
|
+
bottom: [],
|
|
11258
|
+
left: [],
|
|
11259
|
+
// --- Border
|
|
11260
|
+
border: [],
|
|
11261
|
+
borderTop: [],
|
|
11262
|
+
borderRight: [],
|
|
11263
|
+
borderBottom: [],
|
|
11264
|
+
borderLeft: [],
|
|
11265
|
+
borderColor: [],
|
|
11266
|
+
borderStyle: [],
|
|
11267
|
+
borderWidth: [],
|
|
11268
|
+
borderHorizontal: [],
|
|
11269
|
+
borderVertical: [],
|
|
11270
|
+
// --- Border radius
|
|
11271
|
+
borderRadius: [],
|
|
11272
|
+
radiusTopLeft: [],
|
|
11273
|
+
radiusTopRight: [],
|
|
11274
|
+
radiusBottomLeft: [],
|
|
11275
|
+
radiusBottomRight: [],
|
|
11276
|
+
// --- Padding
|
|
11277
|
+
padding: [],
|
|
11278
|
+
paddingHorizontal: [],
|
|
11279
|
+
paddingVertical: [],
|
|
11280
|
+
paddingTop: [],
|
|
11281
|
+
paddingRight: [],
|
|
11282
|
+
paddingBottom: [],
|
|
11283
|
+
paddingLeft: [],
|
|
11284
|
+
// --- Margin
|
|
11285
|
+
margin: [],
|
|
11286
|
+
marginHorizontal: [],
|
|
11287
|
+
marginVertical: [],
|
|
11288
|
+
marginTop: [],
|
|
11289
|
+
marginRight: [],
|
|
11290
|
+
marginBottom: [],
|
|
11291
|
+
marginLeft: [],
|
|
11292
|
+
// --- Other
|
|
11293
|
+
backgroundColor: [],
|
|
11294
|
+
background: [],
|
|
11295
|
+
boxShadow: [],
|
|
11296
|
+
direction: [],
|
|
11297
|
+
overflowX: [],
|
|
11298
|
+
overflowY: [],
|
|
11299
|
+
zIndex: [],
|
|
11300
|
+
opacity: [],
|
|
11301
|
+
// --- Typography
|
|
11302
|
+
color: [],
|
|
11303
|
+
fontFamily: [],
|
|
11304
|
+
fontSize: [],
|
|
11305
|
+
fontWeight: [],
|
|
11306
|
+
fontStyle: [booleanRegex],
|
|
11307
|
+
fontVariant: [],
|
|
11308
|
+
lineBreak: [],
|
|
11309
|
+
textDecoration: [],
|
|
11310
|
+
userSelect: [],
|
|
11311
|
+
letterSpacing: [],
|
|
11312
|
+
textTransform: [],
|
|
11313
|
+
lineHeight: [],
|
|
11314
|
+
textAlign: [],
|
|
11315
|
+
textWrap: [],
|
|
11316
|
+
textAlignLast: [],
|
|
11317
|
+
textIndent: [],
|
|
11318
|
+
textShadow: [],
|
|
11319
|
+
wordBreak: [],
|
|
11320
|
+
wordSpacing: [],
|
|
11321
|
+
wordWrap: [],
|
|
11322
|
+
writingMode: [],
|
|
11323
|
+
// --- Content rendering
|
|
11324
|
+
wrapContent: [],
|
|
11325
|
+
canShrink: [],
|
|
11326
|
+
// --- Other
|
|
11327
|
+
cursor: [],
|
|
11328
|
+
zoom: [],
|
|
11329
|
+
whiteSpace: [],
|
|
11330
|
+
textDecorationLine: [],
|
|
11331
|
+
textDecorationColor: [],
|
|
11332
|
+
textDecorationStyle: [],
|
|
11333
|
+
textDecorationThickness: [],
|
|
11334
|
+
textUnderlineOffset: [],
|
|
11335
|
+
transform: [],
|
|
11336
|
+
// --- Outline
|
|
11337
|
+
outline: [],
|
|
11338
|
+
outlineWidth: [],
|
|
11339
|
+
outlineColor: [],
|
|
11340
|
+
outlineStyle: [],
|
|
11341
|
+
outlineOffset: [],
|
|
11342
|
+
// --- Animation
|
|
11343
|
+
transition: []
|
|
11344
|
+
};
|
|
11345
|
+
const customVariantCache = /* @__PURE__ */ new Map();
|
|
11346
|
+
function setCustomVariantCache(variant, entry) {
|
|
11347
|
+
customVariantCache.set(variant, {
|
|
11348
|
+
...entry,
|
|
11349
|
+
createdAt: Date.now()
|
|
11350
|
+
});
|
|
11351
|
+
}
|
|
11352
|
+
function hasCustomVariantCache(variant) {
|
|
11353
|
+
return customVariantCache.has(variant);
|
|
11354
|
+
}
|
|
10801
11355
|
const defaultProps$11 = {
|
|
10802
11356
|
maxLines: 0,
|
|
10803
11357
|
preserveLinebreaks: false,
|
|
@@ -10838,6 +11392,56 @@ const Text = forwardRef(function Text2({
|
|
|
10838
11392
|
if (!variant || !TextVariantElement[variant]) return "div";
|
|
10839
11393
|
return TextVariantElement[variant];
|
|
10840
11394
|
}, [variant]);
|
|
11395
|
+
const isCustomVariant = useMemo(() => {
|
|
11396
|
+
return variant && !TextVariantElement[variant];
|
|
11397
|
+
}, [variant]);
|
|
11398
|
+
const variantSpec = useMemo(
|
|
11399
|
+
() => {
|
|
11400
|
+
if (!isCustomVariant) return EMPTY_OBJECT;
|
|
11401
|
+
const subject = `-Text-${variant}`;
|
|
11402
|
+
const cssInput = {
|
|
11403
|
+
color: toCssVar(`$textColor${subject}`),
|
|
11404
|
+
"font-family": toCssVar(`$fontFamily${subject}`),
|
|
11405
|
+
"font-size": toCssVar(`$fontSize${subject}`),
|
|
11406
|
+
"font-style": toCssVar(`$fontStyle${subject}`),
|
|
11407
|
+
"font-weight": toCssVar(`$fontWeight${subject}`),
|
|
11408
|
+
"font-stretch": toCssVar(`$fontStretch${subject}`),
|
|
11409
|
+
"text-decoration-line": toCssVar(`$textDecorationLine${subject}`),
|
|
11410
|
+
"text-decoration-color": toCssVar(`$textDecorationColor${subject}`),
|
|
11411
|
+
"text-decoration-style": toCssVar(`$textDecorationStyle${subject}`),
|
|
11412
|
+
"text-decoration-thickness": toCssVar(`$textDecorationThickness${subject}`),
|
|
11413
|
+
"text-underline-offset": toCssVar(`$textUnderlineOffset${subject}`),
|
|
11414
|
+
"line-height": toCssVar(`$lineHeight${subject}`),
|
|
11415
|
+
"background-color": toCssVar(`$backgroundColor${subject}`),
|
|
11416
|
+
"text-transform": toCssVar(`$textTransform${subject}`),
|
|
11417
|
+
"letter-spacing": toCssVar(`$letterSpacing${subject}`),
|
|
11418
|
+
"word-spacing": toCssVar(`$wordSpacing${subject}`),
|
|
11419
|
+
"text-shadow": toCssVar(`$textShadow${subject}`),
|
|
11420
|
+
"text-indent": toCssVar(`$textIndent${subject}`),
|
|
11421
|
+
"text-align": toCssVar(`$textAlign${subject}`),
|
|
11422
|
+
"text-align-last": toCssVar(`$textAlignLast${subject}`),
|
|
11423
|
+
"word-break": toCssVar(`$wordBreak${subject}`),
|
|
11424
|
+
"word-wrap": toCssVar(`$wordWrap${subject}`),
|
|
11425
|
+
direction: toCssVar(`$direction${subject}`),
|
|
11426
|
+
"writing-mode": toCssVar(`$writingMode${subject}`),
|
|
11427
|
+
"line-break": toCssVar(`$lineBreak${subject}`)
|
|
11428
|
+
};
|
|
11429
|
+
return cssInput;
|
|
11430
|
+
},
|
|
11431
|
+
[isCustomVariant, variant]
|
|
11432
|
+
);
|
|
11433
|
+
const customVariantClassName = useComponentStyle(variantSpec);
|
|
11434
|
+
useEffect(() => {
|
|
11435
|
+
if (isCustomVariant && variant && customVariantClassName) {
|
|
11436
|
+
if (!hasCustomVariantCache(variant)) {
|
|
11437
|
+
setCustomVariantCache(variant, {
|
|
11438
|
+
className: customVariantClassName,
|
|
11439
|
+
cssText: ""
|
|
11440
|
+
// Will be populated when CSS generation is implemented
|
|
11441
|
+
});
|
|
11442
|
+
}
|
|
11443
|
+
}
|
|
11444
|
+
}, [isCustomVariant, variant, customVariantClassName]);
|
|
10841
11445
|
const overflowClasses = useMemo(() => {
|
|
10842
11446
|
const classes = {};
|
|
10843
11447
|
if (!overflowMode) {
|
|
@@ -10893,7 +11497,8 @@ const Text = forwardRef(function Text2({
|
|
|
10893
11497
|
className: classnames(
|
|
10894
11498
|
syntaxHighlightClasses,
|
|
10895
11499
|
styles$13.text,
|
|
10896
|
-
|
|
11500
|
+
// Use custom variant className if it's a custom variant, otherwise use predefined variant style
|
|
11501
|
+
isCustomVariant ? customVariantClassName : styles$13[variant || "default"],
|
|
10897
11502
|
{
|
|
10898
11503
|
[styles$13.preserveLinebreaks]: preserveLinebreaks2,
|
|
10899
11504
|
...overflowClasses,
|
|
@@ -10920,7 +11525,7 @@ const TextMd = createMetadata({
|
|
|
10920
11525
|
`The text to be displayed. This value can also be set via nesting the text into the \`${COMP$1n}\` component.`
|
|
10921
11526
|
),
|
|
10922
11527
|
variant: {
|
|
10923
|
-
description: "An optional string value that provides named presets for text variants with a unique combination of font style, weight, size, color, and other parameters. If not defined, the text uses the current style of its context.",
|
|
11528
|
+
description: "An optional string value that provides named presets for text variants with a unique combination of font style, weight, size, color, and other parameters. If not defined, the text uses the current style of its context. In addition to predefined variants, you can specify custom variant names and style them using theme variables with the pattern `{cssProperty}-Text-{variantName}` (e.g., `textColor-Text-brandTitle`, `fontSize-Text-highlight`). See the documentation for a complete list of supported CSS properties.",
|
|
10924
11529
|
availableValues: variantOptionsMd
|
|
10925
11530
|
},
|
|
10926
11531
|
maxLines: d(
|
|
@@ -11223,458 +11828,114 @@ const SelectionStore = ({
|
|
|
11223
11828
|
return {
|
|
11224
11829
|
selectedItems,
|
|
11225
11830
|
setSelectedRowIds,
|
|
11226
|
-
refreshSelection,
|
|
11227
|
-
idKey
|
|
11228
|
-
};
|
|
11229
|
-
}, [refreshSelection, selectedItems, setSelectedRowIds, idKey]);
|
|
11230
|
-
return /* @__PURE__ */ jsx(SelectionContext.Provider, { value: contextValue2, children });
|
|
11231
|
-
};
|
|
11232
|
-
const SelectionContext = React__default.createContext(null);
|
|
11233
|
-
function useSelectionContext() {
|
|
11234
|
-
return useContext(SelectionContext);
|
|
11235
|
-
}
|
|
11236
|
-
const parsedHVarCache = {};
|
|
11237
|
-
function parseHVar(input2) {
|
|
11238
|
-
if (parsedHVarCache[input2] !== void 0) {
|
|
11239
|
-
return parsedHVarCache[input2];
|
|
11240
|
-
}
|
|
11241
|
-
const parts = input2.split(/-[A-Z]+/);
|
|
11242
|
-
if (parts.length !== 2) {
|
|
11243
|
-
parsedHVarCache[input2] = null;
|
|
11244
|
-
return parsedHVarCache[input2];
|
|
11245
|
-
}
|
|
11246
|
-
const firstPart = parts[0];
|
|
11247
|
-
const classessParts = firstPart.split(":");
|
|
11248
|
-
const attribute = classessParts[classessParts.length - 1];
|
|
11249
|
-
const classes = classessParts.length > 1 ? classessParts.slice(0, classessParts.length - 1) : [];
|
|
11250
|
-
const secondPart = input2.substring(firstPart.length + 1);
|
|
11251
|
-
const [compName, ...rest] = secondPart.split("-");
|
|
11252
|
-
const traitsAndStates = secondPart.substring(compName.length).split("--");
|
|
11253
|
-
const states = [];
|
|
11254
|
-
const traits = [];
|
|
11255
|
-
traitsAndStates.forEach((part) => {
|
|
11256
|
-
if (!part.includes("-") && part) {
|
|
11257
|
-
states.push(part);
|
|
11258
|
-
} else {
|
|
11259
|
-
part.split("-").forEach((trait) => {
|
|
11260
|
-
if (trait) {
|
|
11261
|
-
traits.push(trait);
|
|
11262
|
-
}
|
|
11263
|
-
});
|
|
11264
|
-
}
|
|
11265
|
-
});
|
|
11266
|
-
parsedHVarCache[input2] = {
|
|
11267
|
-
classes,
|
|
11268
|
-
attribute,
|
|
11269
|
-
component: compName,
|
|
11270
|
-
traits,
|
|
11271
|
-
states
|
|
11272
|
-
};
|
|
11273
|
-
return parsedHVarCache[input2];
|
|
11274
|
-
}
|
|
11275
|
-
function createCombinations(arr = []) {
|
|
11276
|
-
const stateCombinations = [];
|
|
11277
|
-
for (let i = 1; i <= arr.length; i++) {
|
|
11278
|
-
for (let j = 0; j <= arr.length - i; j++) {
|
|
11279
|
-
stateCombinations.push(arr.slice(j, j + i));
|
|
11280
|
-
}
|
|
11281
|
-
}
|
|
11282
|
-
return stateCombinations.sort((a, b) => b.length - a.length);
|
|
11283
|
-
}
|
|
11284
|
-
function matchThemeVar(themeVar, availableThemeVars = []) {
|
|
11285
|
-
const hvar = parseHVar(themeVar);
|
|
11286
|
-
if (!hvar) {
|
|
11287
|
-
return;
|
|
11288
|
-
}
|
|
11289
|
-
const stateCombinations = createCombinations(hvar.states);
|
|
11290
|
-
const traitCombinations = createCombinations(hvar.traits);
|
|
11291
|
-
const sortedTraitCombinations = [];
|
|
11292
|
-
traitCombinations.forEach((traitComb) => {
|
|
11293
|
-
let result = "";
|
|
11294
|
-
traitComb.forEach((t) => {
|
|
11295
|
-
result = `${result}-${t}`;
|
|
11296
|
-
});
|
|
11297
|
-
sortedTraitCombinations.push(result);
|
|
11298
|
-
});
|
|
11299
|
-
sortedTraitCombinations.push("");
|
|
11300
|
-
const sortedStateCombinations = [];
|
|
11301
|
-
stateCombinations.forEach((stateComb) => {
|
|
11302
|
-
let result = "";
|
|
11303
|
-
stateComb.forEach((s) => {
|
|
11304
|
-
result = `${result}--${s}`;
|
|
11305
|
-
});
|
|
11306
|
-
sortedStateCombinations.push(result);
|
|
11307
|
-
});
|
|
11308
|
-
sortedStateCombinations.push("");
|
|
11309
|
-
const componentParts = [hvar.component, ...hvar.classes];
|
|
11310
|
-
const from = [];
|
|
11311
|
-
sortedStateCombinations.forEach((stateComb) => {
|
|
11312
|
-
sortedTraitCombinations.forEach((traitComb) => {
|
|
11313
|
-
componentParts.forEach((componentPart) => {
|
|
11314
|
-
from.push(`${hvar.attribute}-${componentPart}${traitComb}${stateComb}`);
|
|
11315
|
-
});
|
|
11316
|
-
});
|
|
11317
|
-
});
|
|
11318
|
-
let matchedValue;
|
|
11319
|
-
for (let i = availableThemeVars.length - 1; i >= 0; i--) {
|
|
11320
|
-
const themeVars2 = availableThemeVars[i];
|
|
11321
|
-
let foundValue = from.find((themeVar2) => themeVars2[themeVar2] !== void 0);
|
|
11322
|
-
if (foundValue) {
|
|
11323
|
-
matchedValue = foundValue;
|
|
11324
|
-
break;
|
|
11325
|
-
}
|
|
11326
|
-
}
|
|
11327
|
-
const forValue = from[0];
|
|
11328
|
-
return {
|
|
11329
|
-
forValue,
|
|
11330
|
-
matchedValue,
|
|
11331
|
-
from
|
|
11332
|
-
};
|
|
11333
|
-
}
|
|
11334
|
-
const THEME_VAR_PREFIX = "xmlui";
|
|
11335
|
-
const themeVarCapturesRegex = /(\$[a-zA-Z][a-zA-Z0-9-_]*)/g;
|
|
11336
|
-
const booleanRegex = /^(true|false)$/;
|
|
11337
|
-
const starSizeRegex = /^\d*\*$/;
|
|
11338
|
-
const defaultCompResult = {
|
|
11339
|
-
cssProps: {},
|
|
11340
|
-
issues: /* @__PURE__ */ new Set()
|
|
11341
|
-
};
|
|
11342
|
-
function resolveLayoutProps(layoutProps = EMPTY_OBJECT, layoutContext) {
|
|
11343
|
-
const result = {
|
|
11344
|
-
cssProps: {},
|
|
11345
|
-
issues: /* @__PURE__ */ new Set()
|
|
11346
|
-
};
|
|
11347
|
-
if (!!getOrientation(layoutContext)) {
|
|
11348
|
-
result.cssProps.flexShrink = 0;
|
|
11349
|
-
}
|
|
11350
|
-
collectCss("width");
|
|
11351
|
-
const horizontalStarSize = getHorizontalStarSize(result.cssProps.width, layoutContext);
|
|
11352
|
-
if (horizontalStarSize !== null) {
|
|
11353
|
-
result.cssProps.flex = horizontalStarSize;
|
|
11354
|
-
result.cssProps.flexShrink = 1;
|
|
11355
|
-
}
|
|
11356
|
-
collectCss("minWidth");
|
|
11357
|
-
collectCss("maxWidth");
|
|
11358
|
-
collectCss("height");
|
|
11359
|
-
const verticalStarSize = getVerticalStarSize(result.cssProps.height, layoutContext);
|
|
11360
|
-
if (verticalStarSize !== null) {
|
|
11361
|
-
result.cssProps.flex = verticalStarSize;
|
|
11362
|
-
result.cssProps.flexShrink = 1;
|
|
11363
|
-
}
|
|
11364
|
-
collectCss("minHeight");
|
|
11365
|
-
collectCss("maxHeight");
|
|
11366
|
-
collectCss("top");
|
|
11367
|
-
collectCss("right");
|
|
11368
|
-
collectCss("bottom");
|
|
11369
|
-
collectCss("left");
|
|
11370
|
-
collectCss("gap");
|
|
11371
|
-
collectCss("padding");
|
|
11372
|
-
const paddingHorizontal = transformLayoutValue("paddingHorizontal");
|
|
11373
|
-
if (paddingHorizontal) {
|
|
11374
|
-
result.cssProps.paddingLeft = paddingHorizontal;
|
|
11375
|
-
result.cssProps.paddingRight = paddingHorizontal;
|
|
11376
|
-
}
|
|
11377
|
-
collectCss("paddingRight");
|
|
11378
|
-
collectCss("paddingLeft");
|
|
11379
|
-
const paddingVertical = transformLayoutValue("paddingVertical");
|
|
11380
|
-
if (paddingVertical) {
|
|
11381
|
-
result.cssProps.paddingTop = paddingVertical;
|
|
11382
|
-
result.cssProps.paddingBottom = paddingVertical;
|
|
11383
|
-
}
|
|
11384
|
-
collectCss("paddingTop");
|
|
11385
|
-
collectCss("paddingBottom");
|
|
11386
|
-
collectCss("margin");
|
|
11387
|
-
const marginHorizontal = transformLayoutValue("marginHorizontal");
|
|
11388
|
-
if (marginHorizontal) {
|
|
11389
|
-
result.cssProps.marginLeft = marginHorizontal;
|
|
11390
|
-
result.cssProps.marginRight = marginHorizontal;
|
|
11391
|
-
}
|
|
11392
|
-
collectCss("marginRight");
|
|
11393
|
-
collectCss("marginLeft");
|
|
11394
|
-
const marginVertical = transformLayoutValue("marginVertical");
|
|
11395
|
-
if (marginVertical) {
|
|
11396
|
-
result.cssProps.marginTop = marginVertical;
|
|
11397
|
-
result.cssProps.marginBottom = marginVertical;
|
|
11398
|
-
}
|
|
11399
|
-
collectCss("marginTop");
|
|
11400
|
-
collectCss("marginBottom");
|
|
11401
|
-
collectCss("border");
|
|
11402
|
-
const horizontalBorder = transformLayoutValue("borderHorizontal");
|
|
11403
|
-
if (horizontalBorder) {
|
|
11404
|
-
result.cssProps.borderLeft = horizontalBorder;
|
|
11405
|
-
result.cssProps.borderRight = horizontalBorder;
|
|
11406
|
-
}
|
|
11407
|
-
collectCss("borderRight");
|
|
11408
|
-
collectCss("borderLeft");
|
|
11409
|
-
const verticalBorder = transformLayoutValue("borderVertical");
|
|
11410
|
-
if (verticalBorder) {
|
|
11411
|
-
result.cssProps.borderTop = verticalBorder;
|
|
11412
|
-
result.cssProps.borderBottom = verticalBorder;
|
|
11413
|
-
}
|
|
11414
|
-
collectCss("borderTop");
|
|
11415
|
-
collectCss("borderBottom");
|
|
11416
|
-
collectCss("borderColor");
|
|
11417
|
-
collectCss("borderStyle");
|
|
11418
|
-
collectCss("borderWidth");
|
|
11419
|
-
collectCss("borderRadius");
|
|
11420
|
-
collectCss("radiusTopLeft", "borderTopLeftRadius");
|
|
11421
|
-
collectCss("radiusTopRight", "borderTopRightRadius");
|
|
11422
|
-
collectCss("radiusBottomLeft", "borderBottomLeftRadius");
|
|
11423
|
-
collectCss("radiusBottomRight", "borderBottomRightRadius");
|
|
11424
|
-
collectCss("color");
|
|
11425
|
-
collectCss("fontFamily");
|
|
11426
|
-
collectCss("fontSize");
|
|
11427
|
-
collectCss("fontWeight");
|
|
11428
|
-
collectCss("fontStyle");
|
|
11429
|
-
collectCss("fontVariant");
|
|
11430
|
-
collectCss("lineBreak");
|
|
11431
|
-
collectCss("textDecoration");
|
|
11432
|
-
collectCss("textDecorationLine");
|
|
11433
|
-
collectCss("textDecorationColor");
|
|
11434
|
-
collectCss("textDecorationStyle");
|
|
11435
|
-
collectCss("textDecorationThickness");
|
|
11436
|
-
collectCss("textIndent");
|
|
11437
|
-
collectCss("textShadow");
|
|
11438
|
-
collectCss("textUnderlineOffset");
|
|
11439
|
-
collectCss("userSelect");
|
|
11440
|
-
collectCss("letterSpacing");
|
|
11441
|
-
collectCss("textTransform");
|
|
11442
|
-
collectCss("lineHeight");
|
|
11443
|
-
collectCss("textAlign");
|
|
11444
|
-
collectCss("textAlignLast");
|
|
11445
|
-
collectCss("textWrap");
|
|
11446
|
-
collectCss("wordBreak");
|
|
11447
|
-
collectCss("wordSpacing");
|
|
11448
|
-
collectCss("wordWrap");
|
|
11449
|
-
collectCss("writingMode");
|
|
11450
|
-
collectCss("backgroundColor");
|
|
11451
|
-
collectCss("background");
|
|
11452
|
-
collectCss("boxShadow");
|
|
11453
|
-
collectCss("direction");
|
|
11454
|
-
collectCss("overflowX");
|
|
11455
|
-
collectCss("overflowY");
|
|
11456
|
-
collectCss("zIndex");
|
|
11457
|
-
collectCss("opacity");
|
|
11458
|
-
collectCss("zoom");
|
|
11459
|
-
collectCss("cursor");
|
|
11460
|
-
collectCss("whiteSpace");
|
|
11461
|
-
collectCss("transform");
|
|
11462
|
-
collectCss("outline");
|
|
11463
|
-
collectCss("outlineWidth");
|
|
11464
|
-
collectCss("outlineColor");
|
|
11465
|
-
collectCss("outlineStyle");
|
|
11466
|
-
collectCss("outlineOffset");
|
|
11467
|
-
const wrapContent = transformLayoutValue("wrapContent");
|
|
11468
|
-
if (wrapContent) {
|
|
11469
|
-
result.cssProps.flexWrap = wrapContent === "true" ? "wrap" : "nowrap";
|
|
11470
|
-
}
|
|
11471
|
-
collectCss("canShrink", "flexShrink");
|
|
11472
|
-
const canShrink = transformLayoutValue("canShrink");
|
|
11473
|
-
if (canShrink) {
|
|
11474
|
-
result.cssProps.flexShrink = canShrink === "true" ? 1 : 0;
|
|
11831
|
+
refreshSelection,
|
|
11832
|
+
idKey
|
|
11833
|
+
};
|
|
11834
|
+
}, [refreshSelection, selectedItems, setSelectedRowIds, idKey]);
|
|
11835
|
+
return /* @__PURE__ */ jsx(SelectionContext.Provider, { value: contextValue2, children });
|
|
11836
|
+
};
|
|
11837
|
+
const SelectionContext = React__default.createContext(null);
|
|
11838
|
+
function useSelectionContext() {
|
|
11839
|
+
return useContext(SelectionContext);
|
|
11840
|
+
}
|
|
11841
|
+
const parsedHVarCache = {};
|
|
11842
|
+
function parseHVar(input2) {
|
|
11843
|
+
if (parsedHVarCache[input2] !== void 0) {
|
|
11844
|
+
return parsedHVarCache[input2];
|
|
11475
11845
|
}
|
|
11476
|
-
|
|
11477
|
-
|
|
11846
|
+
const parts = input2.split(/-[A-Z]+/);
|
|
11847
|
+
if (parts.length !== 2) {
|
|
11848
|
+
parsedHVarCache[input2] = null;
|
|
11849
|
+
return parsedHVarCache[input2];
|
|
11478
11850
|
}
|
|
11479
|
-
|
|
11480
|
-
|
|
11481
|
-
|
|
11482
|
-
|
|
11483
|
-
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11488
|
-
|
|
11489
|
-
|
|
11490
|
-
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
|
|
11494
|
-
|
|
11495
|
-
break;
|
|
11496
|
-
case 1:
|
|
11497
|
-
mergedValue = smValue ?? mdValue;
|
|
11498
|
-
break;
|
|
11499
|
-
case 2:
|
|
11500
|
-
mergedValue = mdValue;
|
|
11501
|
-
break;
|
|
11502
|
-
case 3:
|
|
11503
|
-
mergedValue = lgValue;
|
|
11504
|
-
break;
|
|
11505
|
-
case 4:
|
|
11506
|
-
mergedValue = xlValue ?? lgValue;
|
|
11507
|
-
break;
|
|
11508
|
-
case 5:
|
|
11509
|
-
mergedValue = xxlValue ?? xlValue ?? lgValue;
|
|
11510
|
-
break;
|
|
11511
|
-
}
|
|
11512
|
-
return mergedValue ?? defValue;
|
|
11513
|
-
}
|
|
11514
|
-
return defValue;
|
|
11515
|
-
function resolveSingleValue(sizeTag = "") {
|
|
11516
|
-
const fullProp = sizeTag ? `${prop}-${sizeTag}` : prop;
|
|
11517
|
-
let singleInput = layoutProps[fullProp];
|
|
11518
|
-
if (singleInput == void 0) {
|
|
11519
|
-
return;
|
|
11520
|
-
}
|
|
11521
|
-
if (typeof singleInput === "string") {
|
|
11522
|
-
singleInput = singleInput.trim();
|
|
11523
|
-
} else {
|
|
11524
|
-
singleInput = singleInput.toString();
|
|
11525
|
-
}
|
|
11526
|
-
const value = singleInput ? singleInput.replace(
|
|
11527
|
-
themeVarCapturesRegex,
|
|
11528
|
-
(match) => toCssVar(match.trim())
|
|
11529
|
-
) : void 0;
|
|
11530
|
-
if (singleInput !== value) {
|
|
11531
|
-
return value;
|
|
11532
|
-
}
|
|
11533
|
-
const propPatterns = layoutPatterns[prop];
|
|
11534
|
-
if (!propPatterns || propPatterns.length === 0) {
|
|
11535
|
-
return value;
|
|
11536
|
-
}
|
|
11537
|
-
for (const pattern of propPatterns) {
|
|
11538
|
-
if (pattern.test(value)) {
|
|
11539
|
-
return value;
|
|
11851
|
+
const firstPart = parts[0];
|
|
11852
|
+
const classessParts = firstPart.split(":");
|
|
11853
|
+
const attribute = classessParts[classessParts.length - 1];
|
|
11854
|
+
const classes = classessParts.length > 1 ? classessParts.slice(0, classessParts.length - 1) : [];
|
|
11855
|
+
const secondPart = input2.substring(firstPart.length + 1);
|
|
11856
|
+
const [compName, ...rest] = secondPart.split("-");
|
|
11857
|
+
const traitsAndStates = secondPart.substring(compName.length).split("--");
|
|
11858
|
+
const states = [];
|
|
11859
|
+
const traits = [];
|
|
11860
|
+
traitsAndStates.forEach((part) => {
|
|
11861
|
+
if (!part.includes("-") && part) {
|
|
11862
|
+
states.push(part);
|
|
11863
|
+
} else {
|
|
11864
|
+
part.split("-").forEach((trait) => {
|
|
11865
|
+
if (trait) {
|
|
11866
|
+
traits.push(trait);
|
|
11540
11867
|
}
|
|
11541
|
-
}
|
|
11542
|
-
result.issues.add(fullProp);
|
|
11543
|
-
return value;
|
|
11868
|
+
});
|
|
11544
11869
|
}
|
|
11545
|
-
}
|
|
11546
|
-
|
|
11547
|
-
|
|
11548
|
-
|
|
11549
|
-
|
|
11870
|
+
});
|
|
11871
|
+
parsedHVarCache[input2] = {
|
|
11872
|
+
classes,
|
|
11873
|
+
attribute,
|
|
11874
|
+
component: compName,
|
|
11875
|
+
traits,
|
|
11876
|
+
states
|
|
11877
|
+
};
|
|
11878
|
+
return parsedHVarCache[input2];
|
|
11879
|
+
}
|
|
11880
|
+
function createCombinations(arr = []) {
|
|
11881
|
+
const stateCombinations = [];
|
|
11882
|
+
for (let i = 1; i <= arr.length; i++) {
|
|
11883
|
+
for (let j = 0; j <= arr.length - i; j++) {
|
|
11884
|
+
stateCombinations.push(arr.slice(j, j + i));
|
|
11550
11885
|
}
|
|
11551
11886
|
}
|
|
11552
|
-
|
|
11553
|
-
|
|
11554
|
-
|
|
11555
|
-
|
|
11556
|
-
|
|
11557
|
-
|
|
11558
|
-
if (!size) return null;
|
|
11559
|
-
const orientation = getOrientation(layoutContext2);
|
|
11560
|
-
return orientation === "vertical" && starSizeRegex.test(size.toString()) ? getStarSizeNumber(size.toString()) : null;
|
|
11887
|
+
return stateCombinations.sort((a, b) => b.length - a.length);
|
|
11888
|
+
}
|
|
11889
|
+
function matchThemeVar(themeVar, availableThemeVars = []) {
|
|
11890
|
+
const hvar = parseHVar(themeVar);
|
|
11891
|
+
if (!hvar) {
|
|
11892
|
+
return;
|
|
11561
11893
|
}
|
|
11562
|
-
|
|
11563
|
-
|
|
11564
|
-
|
|
11565
|
-
|
|
11894
|
+
const stateCombinations = createCombinations(hvar.states);
|
|
11895
|
+
const traitCombinations = createCombinations(hvar.traits);
|
|
11896
|
+
const sortedTraitCombinations = [];
|
|
11897
|
+
traitCombinations.forEach((traitComb) => {
|
|
11898
|
+
let result = "";
|
|
11899
|
+
traitComb.forEach((t) => {
|
|
11900
|
+
result = `${result}-${t}`;
|
|
11901
|
+
});
|
|
11902
|
+
sortedTraitCombinations.push(result);
|
|
11903
|
+
});
|
|
11904
|
+
sortedTraitCombinations.push("");
|
|
11905
|
+
const sortedStateCombinations = [];
|
|
11906
|
+
stateCombinations.forEach((stateComb) => {
|
|
11907
|
+
let result = "";
|
|
11908
|
+
stateComb.forEach((s) => {
|
|
11909
|
+
result = `${result}--${s}`;
|
|
11910
|
+
});
|
|
11911
|
+
sortedStateCombinations.push(result);
|
|
11912
|
+
});
|
|
11913
|
+
sortedStateCombinations.push("");
|
|
11914
|
+
const componentParts = [hvar.component, ...hvar.classes];
|
|
11915
|
+
const from = [];
|
|
11916
|
+
sortedStateCombinations.forEach((stateComb) => {
|
|
11917
|
+
sortedTraitCombinations.forEach((traitComb) => {
|
|
11918
|
+
componentParts.forEach((componentPart) => {
|
|
11919
|
+
from.push(`${hvar.attribute}-${componentPart}${traitComb}${stateComb}`);
|
|
11920
|
+
});
|
|
11921
|
+
});
|
|
11922
|
+
});
|
|
11923
|
+
let matchedValue;
|
|
11924
|
+
for (let i = availableThemeVars.length - 1; i >= 0; i--) {
|
|
11925
|
+
const themeVars2 = availableThemeVars[i];
|
|
11926
|
+
let foundValue = from.find((themeVar2) => themeVars2[themeVar2] !== void 0);
|
|
11927
|
+
if (foundValue) {
|
|
11928
|
+
matchedValue = foundValue;
|
|
11929
|
+
break;
|
|
11566
11930
|
}
|
|
11567
|
-
return null;
|
|
11568
|
-
}
|
|
11569
|
-
function getOrientation(layoutContext2) {
|
|
11570
|
-
if (!layoutContext2) return;
|
|
11571
|
-
let orientation = (layoutContext2 == null ? void 0 : layoutContext2.type) === "Stack" && (layoutContext2 == null ? void 0 : layoutContext2.orientation);
|
|
11572
|
-
return orientation == null ? void 0 : orientation.toString();
|
|
11573
11931
|
}
|
|
11932
|
+
const forValue = from[0];
|
|
11933
|
+
return {
|
|
11934
|
+
forValue,
|
|
11935
|
+
matchedValue,
|
|
11936
|
+
from
|
|
11937
|
+
};
|
|
11574
11938
|
}
|
|
11575
|
-
function toCssVar(c) {
|
|
11576
|
-
return `var(--${THEME_VAR_PREFIX}-${c.substring(1)})`;
|
|
11577
|
-
}
|
|
11578
|
-
const layoutPatterns = {
|
|
11579
|
-
// --- Dimensions
|
|
11580
|
-
width: [],
|
|
11581
|
-
minWidth: [],
|
|
11582
|
-
maxWidth: [],
|
|
11583
|
-
height: [],
|
|
11584
|
-
minHeight: [],
|
|
11585
|
-
maxHeight: [],
|
|
11586
|
-
gap: [],
|
|
11587
|
-
// --- Positions
|
|
11588
|
-
top: [],
|
|
11589
|
-
right: [],
|
|
11590
|
-
bottom: [],
|
|
11591
|
-
left: [],
|
|
11592
|
-
// --- Border
|
|
11593
|
-
border: [],
|
|
11594
|
-
borderTop: [],
|
|
11595
|
-
borderRight: [],
|
|
11596
|
-
borderBottom: [],
|
|
11597
|
-
borderLeft: [],
|
|
11598
|
-
borderColor: [],
|
|
11599
|
-
borderStyle: [],
|
|
11600
|
-
borderWidth: [],
|
|
11601
|
-
borderHorizontal: [],
|
|
11602
|
-
borderVertical: [],
|
|
11603
|
-
// --- Border radius
|
|
11604
|
-
borderRadius: [],
|
|
11605
|
-
radiusTopLeft: [],
|
|
11606
|
-
radiusTopRight: [],
|
|
11607
|
-
radiusBottomLeft: [],
|
|
11608
|
-
radiusBottomRight: [],
|
|
11609
|
-
// --- Padding
|
|
11610
|
-
padding: [],
|
|
11611
|
-
paddingHorizontal: [],
|
|
11612
|
-
paddingVertical: [],
|
|
11613
|
-
paddingTop: [],
|
|
11614
|
-
paddingRight: [],
|
|
11615
|
-
paddingBottom: [],
|
|
11616
|
-
paddingLeft: [],
|
|
11617
|
-
// --- Margin
|
|
11618
|
-
margin: [],
|
|
11619
|
-
marginHorizontal: [],
|
|
11620
|
-
marginVertical: [],
|
|
11621
|
-
marginTop: [],
|
|
11622
|
-
marginRight: [],
|
|
11623
|
-
marginBottom: [],
|
|
11624
|
-
marginLeft: [],
|
|
11625
|
-
// --- Other
|
|
11626
|
-
backgroundColor: [],
|
|
11627
|
-
background: [],
|
|
11628
|
-
boxShadow: [],
|
|
11629
|
-
direction: [],
|
|
11630
|
-
overflowX: [],
|
|
11631
|
-
overflowY: [],
|
|
11632
|
-
zIndex: [],
|
|
11633
|
-
opacity: [],
|
|
11634
|
-
// --- Typography
|
|
11635
|
-
color: [],
|
|
11636
|
-
fontFamily: [],
|
|
11637
|
-
fontSize: [],
|
|
11638
|
-
fontWeight: [],
|
|
11639
|
-
fontStyle: [booleanRegex],
|
|
11640
|
-
fontVariant: [],
|
|
11641
|
-
lineBreak: [],
|
|
11642
|
-
textDecoration: [],
|
|
11643
|
-
userSelect: [],
|
|
11644
|
-
letterSpacing: [],
|
|
11645
|
-
textTransform: [],
|
|
11646
|
-
lineHeight: [],
|
|
11647
|
-
textAlign: [],
|
|
11648
|
-
textWrap: [],
|
|
11649
|
-
textAlignLast: [],
|
|
11650
|
-
textIndent: [],
|
|
11651
|
-
textShadow: [],
|
|
11652
|
-
wordBreak: [],
|
|
11653
|
-
wordSpacing: [],
|
|
11654
|
-
wordWrap: [],
|
|
11655
|
-
writingMode: [],
|
|
11656
|
-
// --- Content rendering
|
|
11657
|
-
wrapContent: [],
|
|
11658
|
-
canShrink: [],
|
|
11659
|
-
// --- Other
|
|
11660
|
-
cursor: [],
|
|
11661
|
-
zoom: [],
|
|
11662
|
-
whiteSpace: [],
|
|
11663
|
-
textDecorationLine: [],
|
|
11664
|
-
textDecorationColor: [],
|
|
11665
|
-
textDecorationStyle: [],
|
|
11666
|
-
textDecorationThickness: [],
|
|
11667
|
-
textUnderlineOffset: [],
|
|
11668
|
-
transform: [],
|
|
11669
|
-
// --- Outline
|
|
11670
|
-
outline: [],
|
|
11671
|
-
outlineWidth: [],
|
|
11672
|
-
outlineColor: [],
|
|
11673
|
-
outlineStyle: [],
|
|
11674
|
-
outlineOffset: [],
|
|
11675
|
-
// --- Animation
|
|
11676
|
-
transition: []
|
|
11677
|
-
};
|
|
11678
11939
|
function isThemeVarName(varName) {
|
|
11679
11940
|
return typeof varName === "string" && (varName == null ? void 0 : varName.startsWith("$"));
|
|
11680
11941
|
}
|
|
@@ -15781,7 +16042,6 @@ const IFrame = memo(forwardRef(function IFrame2({
|
|
|
15781
16042
|
...rest
|
|
15782
16043
|
}, ref) {
|
|
15783
16044
|
const iframeRef = useRef(null);
|
|
15784
|
-
useImperativeHandle(ref, () => iframeRef.current, []);
|
|
15785
16045
|
useEffect(() => {
|
|
15786
16046
|
registerComponentApi == null ? void 0 : registerComponentApi({
|
|
15787
16047
|
postMessage: (message, targetOrigin = "*") => {
|
|
@@ -22107,7 +22367,6 @@ const Form = forwardRef(function({
|
|
|
22107
22367
|
...rest
|
|
22108
22368
|
}, ref) {
|
|
22109
22369
|
const formRef = useRef(null);
|
|
22110
|
-
useImperativeHandle(ref, () => formRef.current);
|
|
22111
22370
|
const [confirmSubmitModalVisible, setConfirmSubmitModalVisible] = useState(false);
|
|
22112
22371
|
const requestModalFormClose = useModalFormClose();
|
|
22113
22372
|
const isEnabled2 = enabled2 && !formState.submitInProgress;
|
|
@@ -24227,7 +24486,7 @@ function ApiInterceptorProvider({
|
|
|
24227
24486
|
return;
|
|
24228
24487
|
}
|
|
24229
24488
|
void (async () => {
|
|
24230
|
-
const { initMock } = await import("./initMock-
|
|
24489
|
+
const { initMock } = await import("./initMock-CB_cMi6U.mjs");
|
|
24231
24490
|
const apiInstance2 = await initMock(interceptor);
|
|
24232
24491
|
setApiInstance(apiInstance2);
|
|
24233
24492
|
setInitialized(true);
|
|
@@ -24244,7 +24503,7 @@ function ApiInterceptorProvider({
|
|
|
24244
24503
|
if (process.env.VITE_MOCK_ENABLED) {
|
|
24245
24504
|
const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
|
|
24246
24505
|
useWorker ? import("./apiInterceptorWorker-QiltRtq1.mjs") : Promise.resolve({ createApiInterceptorWorker: () => null }),
|
|
24247
|
-
import("./initMock-
|
|
24506
|
+
import("./initMock-CB_cMi6U.mjs")
|
|
24248
24507
|
]);
|
|
24249
24508
|
if (interceptor || forceInitialize) {
|
|
24250
24509
|
const apiInstance2 = await initMock(interceptor || {});
|
|
@@ -24281,7 +24540,7 @@ function ApiInterceptorProvider({
|
|
|
24281
24540
|
void (async () => {
|
|
24282
24541
|
const [{ createApiInterceptorWorker }, { initMock }] = await Promise.all([
|
|
24283
24542
|
import("./apiInterceptorWorker-QiltRtq1.mjs"),
|
|
24284
|
-
import("./initMock-
|
|
24543
|
+
import("./initMock-CB_cMi6U.mjs")
|
|
24285
24544
|
]);
|
|
24286
24545
|
const apiInstance2 = await initMock(interceptor);
|
|
24287
24546
|
await createApiInterceptorWorker(apiInstance2, parentInterceptorWorker);
|
|
@@ -24383,12 +24642,6 @@ const ComponentRegistryContext = React__default.createContext(null);
|
|
|
24383
24642
|
function useComponentRegistry() {
|
|
24384
24643
|
return useContext(ComponentRegistryContext);
|
|
24385
24644
|
}
|
|
24386
|
-
const IndexerContext = React__default.createContext({
|
|
24387
|
-
indexing: false
|
|
24388
|
-
});
|
|
24389
|
-
function useIndexerContext() {
|
|
24390
|
-
return useContext(IndexerContext);
|
|
24391
|
-
}
|
|
24392
24645
|
const themeVars$e = `'{"padding-NestedApp": "var(--xmlui-padding-NestedApp)", "paddingHorizontal-NestedApp": "var(--xmlui-paddingHorizontal-NestedApp, var(--xmlui-padding-NestedApp))", "paddingVertical-NestedApp": "var(--xmlui-paddingVertical-NestedApp, var(--xmlui-padding-NestedApp))", "paddingLeft-NestedApp": "var(--xmlui-paddingLeft-NestedApp, var(--xmlui-paddingHorizontal-NestedApp, var(--xmlui-padding-NestedApp)))", "paddingRight-NestedApp": "var(--xmlui-paddingRight-NestedApp, var(--xmlui-paddingHorizontal-NestedApp, var(--xmlui-padding-NestedApp)))", "paddingTop-NestedApp": "var(--xmlui-paddingTop-NestedApp, var(--xmlui-paddingVertical-NestedApp, var(--xmlui-padding-NestedApp)))", "paddingBottom-NestedApp": "var(--xmlui-paddingBottom-NestedApp, var(--xmlui-paddingVertical-NestedApp, var(--xmlui-padding-NestedApp)))", "border-NestedApp": "var(--xmlui-border-NestedApp)", "borderHorizontal-NestedApp": "var(--xmlui-borderHorizontal-NestedApp, var(--xmlui-border-NestedApp))", "borderVertical-NestedApp": "var(--xmlui-borderVertical-NestedApp, var(--xmlui-border-NestedApp))", "borderLeft-NestedApp": "var(--xmlui-borderLeft-NestedApp, var(--xmlui-borderHorizontal-NestedApp, var(--xmlui-border-NestedApp)))", "borderRight-NestedApp": "var(--xmlui-borderRight-NestedApp, var(--xmlui-borderHorizontal-NestedApp, var(--xmlui-border-NestedApp)))", "borderTop-NestedApp": "var(--xmlui-borderTop-NestedApp, var(--xmlui-borderVertical-NestedApp, var(--xmlui-border-NestedApp)))", "borderBottom-NestedApp": "var(--xmlui-borderBottom-NestedApp, var(--xmlui-borderVertical-NestedApp, var(--xmlui-border-NestedApp)))", "borderWidth-NestedApp": "var(--xmlui-borderWidth-NestedApp)", "borderHorizontalWidth-NestedApp": "var(--xmlui-borderHorizontalWidth-NestedApp, var(--xmlui-borderWidth-NestedApp))", "borderLeftWidth-NestedApp": "var(--xmlui-borderLeftWidth-NestedApp, var(--xmlui-borderHorizontalWidth-NestedApp, var(--xmlui-borderWidth-NestedApp)))", "borderRightWidth-NestedApp": "var(--xmlui-borderRightWidth-NestedApp, var(--xmlui-borderHorizontalWidth-NestedApp, var(--xmlui-borderWidth-NestedApp)))", "borderVerticalWidth-NestedApp": "var(--xmlui-borderVerticalWidth-NestedApp, var(--xmlui-borderWidth-NestedApp))", "borderTopWidth-NestedApp": "var(--xmlui-borderTopWidth-NestedApp, var(--xmlui-borderVerticalWidth-NestedApp, var(--xmlui-borderWidth-NestedApp)))", "borderBottomWidth-NestedApp": "var(--xmlui-borderBottomWidth-NestedApp, var(--xmlui-borderVerticalWidth-NestedApp, var(--xmlui-borderWidth-NestedApp)))", "borderStyle-NestedApp": "var(--xmlui-borderStyle-NestedApp)", "borderHorizontalStyle-NestedApp": "var(--xmlui-borderHorizontalStyle-NestedApp, var(--xmlui-borderStyle-NestedApp))", "borderLeftStyle-NestedApp": "var(--xmlui-borderLeftStyle-NestedApp, var(--xmlui-borderHorizontalStyle-NestedApp, var(--xmlui-borderStyle-NestedApp)))", "borderRightStyle-NestedApp": "var(--xmlui-borderRightStyle-NestedApp, var(--xmlui-borderHorizontalStyle-NestedApp, var(--xmlui-borderStyle-NestedApp)))", "borderVerticalStyle-NestedApp": "var(--xmlui-borderVerticalStyle-NestedApp, var(--xmlui-borderStyle-NestedApp))", "borderTopStyle-NestedApp": "var(--xmlui-borderTopStyle-NestedApp, var(--xmlui-borderVerticalStyle-NestedApp, var(--xmlui-borderStyle-NestedApp)))", "borderBottomStyle-NestedApp": "var(--xmlui-borderBottomStyle-NestedApp, var(--xmlui-borderVerticalStyle-NestedApp, var(--xmlui-borderStyle-NestedApp)))", "borderColor-NestedApp": "var(--xmlui-borderColor-NestedApp)", "borderHorizontalColor-NestedApp": "var(--xmlui-borderHorizontalColor-NestedApp, var(--xmlui-borderColor-NestedApp))", "borderLeftColor-NestedApp": "var(--xmlui-borderLeftColor-NestedApp, var(--xmlui-borderHorizontalColor-NestedApp, var(--xmlui-borderColor-NestedApp)))", "borderRightColor-NestedApp": "var(--xmlui-borderRightColor-NestedApp, var(--xmlui-borderHorizontalColor-NestedApp, var(--xmlui-borderColor-NestedApp)))", "borderVerticalColor-NestedApp": "var(--xmlui-borderVerticalColor-NestedApp, var(--xmlui-borderColor-NestedApp))", "borderTopColor-NestedApp": "var(--xmlui-borderTopColor-NestedApp, var(--xmlui-borderVerticalColor-NestedApp, var(--xmlui-borderColor-NestedApp)))", "borderBottomColor-NestedApp": "var(--xmlui-borderBottomColor-NestedApp, var(--xmlui-borderVerticalColor-NestedApp, var(--xmlui-borderColor-NestedApp)))", "borderStartStartRadius-NestedApp": "var(--xmlui-borderStartStartRadius-NestedApp, var(--xmlui-borderRadius-NestedApp))", "borderStartEndRadius-NestedApp": "var(--xmlui-borderStartEndRadius-NestedApp, var(--xmlui-borderRadius-NestedApp))", "borderEndStartRadius-NestedApp": "var(--xmlui-borderEndStartRadius-NestedApp, var(--xmlui-borderRadius-NestedApp))", "borderEndEndRadius-NestedApp": "var(--xmlui-borderEndEndRadius-NestedApp, var(--xmlui-borderRadius-NestedApp))", "textColor-header-NestedApp": "var(--xmlui-textColor-header-NestedApp)", "fontFamily-header-NestedApp": "var(--xmlui-fontFamily-header-NestedApp)", "fontSize-header-NestedApp": "var(--xmlui-fontSize-header-NestedApp)", "fontStyle-header-NestedApp": "var(--xmlui-fontStyle-header-NestedApp)", "fontVariant-header-NestedApp": "var(--xmlui-fontVariant-header-NestedApp)", "fontWeight-header-NestedApp": "var(--xmlui-fontWeight-header-NestedApp)", "fontStretch-header-NestedApp": "var(--xmlui-fontStretch-header-NestedApp)", "textDecorationLine-header-NestedApp": "var(--xmlui-textDecorationLine-header-NestedApp)", "textDecorationColor-header-NestedApp": "var(--xmlui-textDecorationColor-header-NestedApp)", "textDecorationStyle-header-NestedApp": "var(--xmlui-textDecorationStyle-header-NestedApp)", "textDecorationThickness-header-NestedApp": "var(--xmlui-textDecorationThickness-header-NestedApp)", "textUnderlineOffset-header-NestedApp": "var(--xmlui-textUnderlineOffset-header-NestedApp)", "lineHeight-header-NestedApp": "var(--xmlui-lineHeight-header-NestedApp)", "backgroundColor-header-NestedApp": "var(--xmlui-backgroundColor-header-NestedApp)", "textTransform-header-NestedApp": "var(--xmlui-textTransform-header-NestedApp)", "letterSpacing-header-NestedApp": "var(--xmlui-letterSpacing-header-NestedApp)", "wordSpacing-header-NestedApp": "var(--xmlui-wordSpacing-header-NestedApp)", "textShadow-header-NestedApp": "var(--xmlui-textShadow-header-NestedApp)", "textIndent-header-NestedApp": "var(--xmlui-textIndent-header-NestedApp)", "textAlign-header-NestedApp": "var(--xmlui-textAlign-header-NestedApp)", "textAlignLast-header-NestedApp": "var(--xmlui-textAlignLast-header-NestedApp)", "wordBreak-header-NestedApp": "var(--xmlui-wordBreak-header-NestedApp)", "wordWrap-header-NestedApp": "var(--xmlui-wordWrap-header-NestedApp)", "direction-header-NestedApp": "var(--xmlui-direction-header-NestedApp)", "writingMode-header-NestedApp": "var(--xmlui-writingMode-header-NestedApp)", "lineBreak-header-NestedApp": "var(--xmlui-lineBreak-header-NestedApp)", "backgroundColor-frame-NestedApp": "var(--xmlui-backgroundColor-frame-NestedApp)", "gap-frame-NestedApp": "var(--xmlui-gap-frame-NestedApp)", "marginTop-NestedApp": "var(--xmlui-marginTop-NestedApp)", "marginBottom-NestedApp": "var(--xmlui-marginBottom-NestedApp)", "boxShadow-NestedApp": "var(--xmlui-boxShadow-NestedApp)", "backgroundColor-viewControls-NestedApp": "var(--xmlui-backgroundColor-viewControls-NestedApp)", "borderRadius-viewControls-NestedApp": "var(--xmlui-borderRadius-viewControls-NestedApp)", "padding-viewControls-NestedApp": "var(--xmlui-padding-viewControls-NestedApp)", "paddingVertical-viewControls-button-NestedApp": "var(--xmlui-paddingVertical-viewControls-button-NestedApp)", "paddingHorizontal-viewControls-button-NestedApp": "var(--xmlui-paddingHorizontal-viewControls-button-NestedApp)", "borderRadius-NestedApp": "var(--xmlui-borderRadius-NestedApp)", "borderBottom-header-NestedApp": "var(--xmlui-borderBottom-header-NestedApp)", "height-logo-splitView-NestedApp": "var(--xmlui-height-logo-splitView-NestedApp)", "width-logo-splitView-NestedApp": "var(--xmlui-width-logo-splitView-NestedApp)", "width-controls-NestedApp": "var(--xmlui-width-controls-NestedApp)", "padding-button-splitView-NestedApp": "var(--xmlui-padding-button-splitView-NestedApp)", "width-button-splitView-NestedApp": "var(--xmlui-width-button-splitView-NestedApp)", "height-button-splitView-NestedApp": "var(--xmlui-height-button-splitView-NestedApp)", "backgroundColor-code-splitView-NestedApp": "var(--xmlui-backgroundColor-code-splitView-NestedApp)", "backgroundColor-button-splitView-NestedApp--active": "var(--xmlui-backgroundColor-button-splitView-NestedApp--active)", "color-button-splitView-NestedApp": "var(--xmlui-color-button-splitView-NestedApp)", "color-button-splitView-NestedApp--active": "var(--xmlui-color-button-splitView-NestedApp--active)", "borderRadius-button-splitView-NestedApp": "var(--xmlui-borderRadius-button-splitView-NestedApp)", "borderColor-button-splitView-NestedApp": "var(--xmlui-borderColor-button-splitView-NestedApp)", "color-loadingText-NestedApp": "var(--xmlui-color-loadingText-NestedApp)"}'`;
|
|
24393
24646
|
const nestedAppPlaceholder = "_nestedAppPlaceholder_2bz33_14";
|
|
24394
24647
|
const loadingContainer = "_loadingContainer_2bz33_21";
|
|
@@ -24439,216 +24692,6 @@ const styles$w = {
|
|
|
24439
24692
|
shadowRoot,
|
|
24440
24693
|
content: content$2
|
|
24441
24694
|
};
|
|
24442
|
-
function hashString(str) {
|
|
24443
|
-
let hash = 5381;
|
|
24444
|
-
let i = str.length;
|
|
24445
|
-
while (i) {
|
|
24446
|
-
hash = hash * 33 ^ str.charCodeAt(--i);
|
|
24447
|
-
}
|
|
24448
|
-
let s = (hash >>> 0).toString(36);
|
|
24449
|
-
return s;
|
|
24450
|
-
}
|
|
24451
|
-
function toKebabCase(str) {
|
|
24452
|
-
if (str.startsWith("--")) {
|
|
24453
|
-
return str;
|
|
24454
|
-
}
|
|
24455
|
-
return str.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
24456
|
-
}
|
|
24457
|
-
function stableJSONStringify(obj) {
|
|
24458
|
-
return JSON.stringify(obj);
|
|
24459
|
-
}
|
|
24460
|
-
class StyleRegistry {
|
|
24461
|
-
constructor() {
|
|
24462
|
-
this.cache = /* @__PURE__ */ new Map();
|
|
24463
|
-
this.rootClasses = /* @__PURE__ */ new Set();
|
|
24464
|
-
this.injected = /* @__PURE__ */ new Set();
|
|
24465
|
-
this.refCounts = /* @__PURE__ */ new Map();
|
|
24466
|
-
this.ssrHashes = /* @__PURE__ */ new Set();
|
|
24467
|
-
}
|
|
24468
|
-
register(styles2) {
|
|
24469
|
-
const key = stableJSONStringify(styles2);
|
|
24470
|
-
const styleHash = hashString(key);
|
|
24471
|
-
const cachedEntry = this.cache.get(styleHash);
|
|
24472
|
-
if (cachedEntry) {
|
|
24473
|
-
return cachedEntry;
|
|
24474
|
-
}
|
|
24475
|
-
const className = `css-${styleHash}`;
|
|
24476
|
-
const css = this._generateCss(`.${className}`, styles2);
|
|
24477
|
-
const entry = { className, styleHash, css };
|
|
24478
|
-
this.cache.set(styleHash, entry);
|
|
24479
|
-
return entry;
|
|
24480
|
-
}
|
|
24481
|
-
/**
|
|
24482
|
-
* [PRIVATE] Recursively generates CSS rules from a style object.
|
|
24483
|
-
* This is the new, more powerful engine.
|
|
24484
|
-
* @param selector - The CSS selector for the current context (e.g., '.css-123' or '&:hover').
|
|
24485
|
-
* @param styles - The style object to process.
|
|
24486
|
-
* @returns A string of CSS rules.
|
|
24487
|
-
*/
|
|
24488
|
-
_generateCss(selector, styles2) {
|
|
24489
|
-
const directProps = [];
|
|
24490
|
-
const nestedRules = [];
|
|
24491
|
-
for (const key in styles2) {
|
|
24492
|
-
const value = styles2[key];
|
|
24493
|
-
if (typeof value === "object" && value !== null) {
|
|
24494
|
-
nestedRules.push(this._processNestedRule(selector, key, value));
|
|
24495
|
-
} else {
|
|
24496
|
-
directProps.push(`${toKebabCase(key)}:${value};`);
|
|
24497
|
-
}
|
|
24498
|
-
}
|
|
24499
|
-
let finalCss = "";
|
|
24500
|
-
if (directProps.length > 0) {
|
|
24501
|
-
finalCss += `${selector} {${directProps.join("")}}`;
|
|
24502
|
-
}
|
|
24503
|
-
finalCss += nestedRules.join("");
|
|
24504
|
-
return finalCss;
|
|
24505
|
-
}
|
|
24506
|
-
_processNestedRule(parentSelector, nestedKey, nestedStyles) {
|
|
24507
|
-
if (nestedKey.startsWith("@")) {
|
|
24508
|
-
return `${nestedKey}{${this._generateCss(parentSelector, nestedStyles)}}`;
|
|
24509
|
-
}
|
|
24510
|
-
const newSelector = nestedKey.replace(/&/g, parentSelector);
|
|
24511
|
-
return this._generateCss(newSelector, nestedStyles);
|
|
24512
|
-
}
|
|
24513
|
-
getSsrStyles() {
|
|
24514
|
-
const allCss = Array.from(this.cache.values()).map((entry) => entry.css).join("");
|
|
24515
|
-
return `@layer dynamic {${allCss}}`;
|
|
24516
|
-
}
|
|
24517
|
-
/**
|
|
24518
|
-
* Adds a class name to be applied to the <html> tag.
|
|
24519
|
-
*/
|
|
24520
|
-
addRootClasses(classNames) {
|
|
24521
|
-
classNames.forEach((className) => {
|
|
24522
|
-
this.rootClasses.add(className);
|
|
24523
|
-
});
|
|
24524
|
-
}
|
|
24525
|
-
/**
|
|
24526
|
-
* Returns a space-separated string of all collected html classes.
|
|
24527
|
-
*/
|
|
24528
|
-
getRootClasses() {
|
|
24529
|
-
return Array.from(this.rootClasses).join(" ");
|
|
24530
|
-
}
|
|
24531
|
-
// NEW: A helper to safely get the current reference count.
|
|
24532
|
-
getRefCount(styleHash) {
|
|
24533
|
-
return this.refCounts.get(styleHash) || 0;
|
|
24534
|
-
}
|
|
24535
|
-
/**
|
|
24536
|
-
* Increments the reference count for a given style hash.
|
|
24537
|
-
*/
|
|
24538
|
-
incrementRef(styleHash) {
|
|
24539
|
-
const newCount = (this.refCounts.get(styleHash) || 0) + 1;
|
|
24540
|
-
this.refCounts.set(styleHash, newCount);
|
|
24541
|
-
}
|
|
24542
|
-
/**
|
|
24543
|
-
* Decrements the reference count for a given style hash.
|
|
24544
|
-
* @returns {number} The new reference count.
|
|
24545
|
-
*/
|
|
24546
|
-
decrementRef(styleHash) {
|
|
24547
|
-
const currentCount = this.refCounts.get(styleHash) || 0;
|
|
24548
|
-
const newCount = Math.max(0, currentCount - 1);
|
|
24549
|
-
if (newCount > 0) {
|
|
24550
|
-
this.refCounts.set(styleHash, newCount);
|
|
24551
|
-
} else {
|
|
24552
|
-
this.refCounts.delete(styleHash);
|
|
24553
|
-
}
|
|
24554
|
-
return newCount;
|
|
24555
|
-
}
|
|
24556
|
-
}
|
|
24557
|
-
const StyleContext = createContext(null);
|
|
24558
|
-
function StyleProvider({
|
|
24559
|
-
children,
|
|
24560
|
-
styleRegistry = new StyleRegistry(),
|
|
24561
|
-
forceNew = false
|
|
24562
|
-
// Optional prop to force a new registry
|
|
24563
|
-
}) {
|
|
24564
|
-
const parentRegistry = useContext(StyleContext);
|
|
24565
|
-
const [registry] = useState(() => {
|
|
24566
|
-
const newRegistry = styleRegistry;
|
|
24567
|
-
if (typeof window !== "undefined") {
|
|
24568
|
-
const ssrTag = document.querySelector('style[data-style-registry="true"]');
|
|
24569
|
-
const ssrHashes = ssrTag == null ? void 0 : ssrTag.getAttribute("data-ssr-hashes");
|
|
24570
|
-
if (ssrHashes) {
|
|
24571
|
-
let hashes = ssrHashes.split(",");
|
|
24572
|
-
newRegistry.ssrHashes = new Set(hashes);
|
|
24573
|
-
newRegistry.injected = new Set(hashes);
|
|
24574
|
-
}
|
|
24575
|
-
}
|
|
24576
|
-
return newRegistry;
|
|
24577
|
-
});
|
|
24578
|
-
if (parentRegistry && !forceNew) {
|
|
24579
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
24580
|
-
}
|
|
24581
|
-
return /* @__PURE__ */ jsx(StyleContext.Provider, { value: registry, children });
|
|
24582
|
-
}
|
|
24583
|
-
function useStyleRegistry() {
|
|
24584
|
-
const registry = useContext(StyleContext);
|
|
24585
|
-
if (registry === null) {
|
|
24586
|
-
throw new Error("Component must be used within a StyleProvider");
|
|
24587
|
-
}
|
|
24588
|
-
return registry;
|
|
24589
|
-
}
|
|
24590
|
-
function useComponentStyle(styles2) {
|
|
24591
|
-
const rootStyle = useMemo(() => {
|
|
24592
|
-
return !styles2 || Object.keys(styles2).length === 0 ? EMPTY_OBJECT : {
|
|
24593
|
-
"&": styles2
|
|
24594
|
-
// "@container style(--screenSize: 1) or @container style(--screenSize: 2) ... etc": responsiveSizes,
|
|
24595
|
-
};
|
|
24596
|
-
}, [styles2]);
|
|
24597
|
-
return useStyles(rootStyle);
|
|
24598
|
-
}
|
|
24599
|
-
const StyleInjectionTargetContext = createContext(null);
|
|
24600
|
-
function useDomRoot() {
|
|
24601
|
-
const domRoot = useContext(StyleInjectionTargetContext);
|
|
24602
|
-
return domRoot;
|
|
24603
|
-
}
|
|
24604
|
-
function useStyles(styles2, { prepend } = EMPTY_OBJECT) {
|
|
24605
|
-
const { indexing } = useIndexerContext();
|
|
24606
|
-
const domRoot = useDomRoot();
|
|
24607
|
-
const injectionTarget = typeof document === "undefined" ? null : domRoot instanceof ShadowRoot ? domRoot : document.head;
|
|
24608
|
-
const registry = useStyleRegistry();
|
|
24609
|
-
const { className, styleHash } = useMemo(() => {
|
|
24610
|
-
if (indexing || !styles2 || styles2 === EMPTY_OBJECT || Object.keys(styles2).length === 0) {
|
|
24611
|
-
return { className: void 0, styleHash: void 0 };
|
|
24612
|
-
}
|
|
24613
|
-
return registry.register(styles2);
|
|
24614
|
-
}, [indexing, registry, styles2]);
|
|
24615
|
-
useInsertionEffect(() => {
|
|
24616
|
-
if (!styleHash || registry.injected.has(styleHash)) {
|
|
24617
|
-
return;
|
|
24618
|
-
}
|
|
24619
|
-
const { css } = registry.cache.get(styleHash) || {};
|
|
24620
|
-
if (css) {
|
|
24621
|
-
const styleElement = document.createElement("style");
|
|
24622
|
-
styleElement.setAttribute("data-style-hash", styleHash);
|
|
24623
|
-
styleElement.innerHTML = `@layer dynamic {
|
|
24624
|
-
${css}
|
|
24625
|
-
}`;
|
|
24626
|
-
if (prepend) {
|
|
24627
|
-
injectionTarget.insertBefore(styleElement, injectionTarget.firstChild.nextSibling);
|
|
24628
|
-
} else {
|
|
24629
|
-
injectionTarget.appendChild(styleElement);
|
|
24630
|
-
}
|
|
24631
|
-
registry.injected.add(styleHash);
|
|
24632
|
-
}
|
|
24633
|
-
}, [registry, styleHash, injectionTarget]);
|
|
24634
|
-
useEffect(() => {
|
|
24635
|
-
if (!styleHash) {
|
|
24636
|
-
return;
|
|
24637
|
-
}
|
|
24638
|
-
registry.incrementRef(styleHash);
|
|
24639
|
-
return () => {
|
|
24640
|
-
registry.decrementRef(styleHash);
|
|
24641
|
-
setTimeout(() => {
|
|
24642
|
-
var _a2;
|
|
24643
|
-
if (registry.getRefCount(styleHash) === 0 && !registry.ssrHashes.has(styleHash)) {
|
|
24644
|
-
registry.injected.delete(styleHash);
|
|
24645
|
-
(_a2 = injectionTarget.querySelector(`style[data-style-hash="${styleHash}"]`)) == null ? void 0 : _a2.remove();
|
|
24646
|
-
}
|
|
24647
|
-
}, 0);
|
|
24648
|
-
};
|
|
24649
|
-
}, [injectionTarget, registry, styleHash]);
|
|
24650
|
-
return className;
|
|
24651
|
-
}
|
|
24652
24695
|
function AnimatedLogo() {
|
|
24653
24696
|
return /* @__PURE__ */ jsxs("div", { className: styles$w.loadingContainer, children: [
|
|
24654
24697
|
/* @__PURE__ */ jsx("div", { className: styles$w.loadingText, children: "Loading XMLUI App..." }),
|
|
@@ -28692,7 +28735,7 @@ const AppMd = createMetadata({
|
|
|
28692
28735
|
}
|
|
28693
28736
|
}
|
|
28694
28737
|
});
|
|
28695
|
-
function AppNode({ node, extractValue, renderChild: renderChild2, className, lookupEventHandler }) {
|
|
28738
|
+
function AppNode({ node, extractValue, renderChild: renderChild2, className, lookupEventHandler, registerComponentApi }) {
|
|
28696
28739
|
const processedNavRef = useRef(false);
|
|
28697
28740
|
const layoutType = useMemo(
|
|
28698
28741
|
() => extractValue(node.props.layout),
|
|
@@ -28908,6 +28951,7 @@ function AppNode({ node, extractValue, renderChild: renderChild2, className, loo
|
|
|
28908
28951
|
navPanelDef: NavPanel3,
|
|
28909
28952
|
logoContentDef: node.props.logoTemplate,
|
|
28910
28953
|
renderChild: renderChild2,
|
|
28954
|
+
registerComponentApi,
|
|
28911
28955
|
children: [
|
|
28912
28956
|
renderedContent,
|
|
28913
28957
|
/* @__PURE__ */ jsx(SearchIndexCollector, { Pages: Pages2, renderChild: renderChild2 })
|
|
@@ -29039,7 +29083,7 @@ function PageIndexer({
|
|
|
29039
29083
|
const appRenderer = createComponentRenderer(
|
|
29040
29084
|
COMP$T,
|
|
29041
29085
|
AppMd,
|
|
29042
|
-
({ node, extractValue, renderChild: renderChild2, className, lookupEventHandler }) => {
|
|
29086
|
+
({ node, extractValue, renderChild: renderChild2, className, lookupEventHandler, registerComponentApi }) => {
|
|
29043
29087
|
return /* @__PURE__ */ jsx(
|
|
29044
29088
|
AppNode,
|
|
29045
29089
|
{
|
|
@@ -29047,7 +29091,8 @@ const appRenderer = createComponentRenderer(
|
|
|
29047
29091
|
renderChild: renderChild2,
|
|
29048
29092
|
extractValue,
|
|
29049
29093
|
className,
|
|
29050
|
-
lookupEventHandler
|
|
29094
|
+
lookupEventHandler,
|
|
29095
|
+
registerComponentApi
|
|
29051
29096
|
}
|
|
29052
29097
|
);
|
|
29053
29098
|
}
|
|
@@ -34837,7 +34882,6 @@ const DateInput = forwardRef(function DateInputNative({
|
|
|
34837
34882
|
return null;
|
|
34838
34883
|
}
|
|
34839
34884
|
}, [day2, month2, year2]);
|
|
34840
|
-
useImperativeHandle(ref, () => dateInputRef.current);
|
|
34841
34885
|
useEffect(() => {
|
|
34842
34886
|
if (registerComponentApi) {
|
|
34843
34887
|
registerComponentApi({
|
|
@@ -36164,7 +36208,6 @@ const TimeInputNative = forwardRef(function TimeInputNative2({
|
|
|
36164
36208
|
const s24 = (second2 || "00").padStart(2, "0");
|
|
36165
36209
|
return `${h24}:${m24}:${s24}`;
|
|
36166
36210
|
}, [hour2, minute2, second2, amPm, is12HourFormat]);
|
|
36167
|
-
useImperativeHandle(ref, () => timeInputRef.current);
|
|
36168
36211
|
useEffect(() => {
|
|
36169
36212
|
if (registerComponentApi) {
|
|
36170
36213
|
registerComponentApi({
|
|
@@ -36911,7 +36954,6 @@ const Timer = forwardRef(function Timer2({
|
|
|
36911
36954
|
isPaused: () => isPaused,
|
|
36912
36955
|
isRunning: () => isRunning && !isPaused
|
|
36913
36956
|
}), [pause, resume, isPaused, isRunning]);
|
|
36914
|
-
useImperativeHandle(forwardedRef, () => timerApi, [timerApi]);
|
|
36915
36957
|
useEffect(() => {
|
|
36916
36958
|
if (registerComponentApi) {
|
|
36917
36959
|
registerComponentApi(timerApi);
|
|
@@ -45756,7 +45798,7 @@ function IconProvider({ children }) {
|
|
|
45756
45798
|
/* @__PURE__ */ jsx("svg", { style: { display: "none" }, ref: spriteRootRef })
|
|
45757
45799
|
] });
|
|
45758
45800
|
}
|
|
45759
|
-
const version = "0.10.
|
|
45801
|
+
const version = "0.10.21";
|
|
45760
45802
|
const miscellaneousUtils = {
|
|
45761
45803
|
capitalize,
|
|
45762
45804
|
pluralize: pluralize$1,
|