@chaibuilder/sdk 1.3.0-beta.6 → 1.3.0-beta.8
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/CodeEditor-1LboGb1I.cjs +91 -0
- package/dist/CodeEditor-BKgZeXwz.js +91 -0
- package/dist/STRINGS-3Sn_NeX1.cjs +9 -0
- package/dist/STRINGS-DdpfVlsV.js +10 -0
- package/dist/Topbar-B8IS6y4H.js +135 -0
- package/dist/Topbar-DXC7DFU1.cjs +135 -0
- package/dist/UnsplashImages-CjJ5szAy.cjs +215 -0
- package/dist/UnsplashImages-Ck9qpKR0.js +215 -0
- package/dist/UploadImages-DW1mj4MB.cjs +117 -0
- package/dist/UploadImages-DgAMZ8GR.js +117 -0
- package/dist/context-menu-BLbuduri.cjs +1073 -0
- package/dist/context-menu-BgtRnByf.js +1042 -0
- package/dist/controls-8EZmm0Ns.js +234 -0
- package/dist/controls-DaW52RjX.cjs +233 -0
- package/dist/core.cjs +82 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +74 -74
- package/dist/iconBase-BSrIcOaG.cjs +146 -0
- package/dist/iconBase-CWgVxu0A.js +147 -0
- package/dist/index-Bjw2sUN2.cjs +12139 -0
- package/dist/index-D8_rAW8B.js +12124 -0
- package/dist/jsx-runtime-B6vEU3CM.cjs +925 -0
- package/dist/jsx-runtime-ClFauRgV.js +926 -0
- package/dist/plugin-BYwesM58.cjs +54 -0
- package/dist/plugin-BiDLHDo3.cjs +114 -0
- package/dist/plugin-BukD7GJR.js +115 -0
- package/dist/plugin-tVAEvXiS.js +55 -0
- package/dist/render.cjs +208 -2
- package/dist/render.js +171 -125
- package/dist/runtime.cjs +26 -1
- package/dist/runtime.js +16 -16
- package/dist/style.css +1529 -2
- package/dist/tailwind.cjs +78 -1
- package/dist/tailwind.js +21 -19
- package/dist/ui.cjs +392 -1
- package/dist/ui.js +268 -257
- package/dist/web-blocks.cjs +1241 -3
- package/dist/web-blocks.js +764 -555
- package/package.json +1 -1
- package/dist/CodeEditor-CIj-zefC.cjs +0 -1
- package/dist/CodeEditor-Dg8G9eNI.js +0 -77
- package/dist/STRINGS-eiGM83kj.js +0 -7
- package/dist/STRINGS-ew98weUe.cjs +0 -1
- package/dist/Topbar-DnBBEcVI.js +0 -113
- package/dist/Topbar-HnONG7Hb.cjs +0 -1
- package/dist/UnsplashImages-BUjFvJDU.cjs +0 -1
- package/dist/UnsplashImages-DPqU7_If.js +0 -189
- package/dist/UploadImages-BA3AIppS.js +0 -101
- package/dist/UploadImages-C-rAULbD.cjs +0 -1
- package/dist/context-menu-BbqLeYFX.js +0 -979
- package/dist/context-menu-DfAXjmc8.cjs +0 -1
- package/dist/controls-C4n5ycp4.cjs +0 -1
- package/dist/controls-Com-zYCq.js +0 -234
- package/dist/iconBase-Cn2BsTrq.cjs +0 -1
- package/dist/iconBase-DHfFLkem.js +0 -124
- package/dist/index-Cd9gI_fI.js +0 -9235
- package/dist/index-D1Arkf5C.cjs +0 -63
- package/dist/jsx-runtime-BYECrxsp.cjs +0 -30
- package/dist/jsx-runtime-DGlMoOmv.js +0 -630
- package/dist/plugin-BOEoR5jk.js +0 -44
- package/dist/plugin-COMQcYlW.cjs +0 -1
- package/dist/plugin-Dw854zFv.js +0 -107
- package/dist/plugin-I9XxF65G.cjs +0 -1
package/dist/core.js
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import { r
|
|
2
|
-
import { g as
|
|
3
|
-
import { registerChaiBlock
|
|
4
|
-
import { useTranslation
|
|
5
|
-
import { default as
|
|
1
|
+
import { r, s, n, A, t, B, l, q, j, v, m, w, D, I, k, x, T, U, y, o, E, z, N, O, $, J, ae, a1, d, M, P, Q, p, u, R, S, V, W, X, Y, G, H, Z, _, g, ad, a0, f, a2, a3, e, a6, a5, a4, a, aa, ab, ac, a7, a9, a8, K, b, c } from "./index-D8_rAW8B.js";
|
|
2
|
+
import { g as g2, c as c2 } from "./iconBase-CWgVxu0A.js";
|
|
3
|
+
import { registerChaiBlock } from "@chaibuilder/runtime";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { default as default2 } from "i18next";
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
7
|
+
r as AISetContext,
|
|
8
|
+
s as AIUserPrompt,
|
|
9
|
+
n as AddBlocksDialog,
|
|
10
|
+
A as AddBlocksPanel,
|
|
11
|
+
t as BlockAttributesEditor,
|
|
12
|
+
B as BlockPropsEditor,
|
|
13
|
+
l as BlockStyleEditor,
|
|
14
|
+
q as CHAI_BUILDER_EVENTS,
|
|
15
|
+
j as ChaiBuilderCanvas,
|
|
16
|
+
v as ChaiBuilderEditor,
|
|
17
|
+
m as ChaiDraggableBlock,
|
|
18
|
+
w as DarkModeSwitcher,
|
|
19
|
+
D as DefaultChaiBlocks,
|
|
20
|
+
I as ImportHTML,
|
|
21
|
+
k as Outline,
|
|
22
|
+
x as ScreenSizes,
|
|
23
|
+
T as ThemeOptions,
|
|
24
|
+
U as UILibraries,
|
|
25
|
+
y as UndoRedo,
|
|
26
|
+
o as emitChaiBuilderMsg,
|
|
27
|
+
g2 as generateBlockId,
|
|
28
|
+
E as getBlocksFromHTML,
|
|
29
|
+
z as getClassValueAndUnit,
|
|
30
|
+
default2 as i18n,
|
|
31
|
+
c2 as mergeClasses,
|
|
32
|
+
registerChaiBlock,
|
|
33
|
+
N as useAddBlock,
|
|
34
|
+
O as useAddClassesToBlocks,
|
|
35
|
+
$ as useBlockHighlight,
|
|
36
|
+
J as useBlocksStore,
|
|
37
|
+
ae as useBlocksStoreUndoableActions,
|
|
38
|
+
a1 as useBrandingOptions,
|
|
39
|
+
d as useBuilderProp,
|
|
40
|
+
M as useBuilderReset,
|
|
41
|
+
P as useCanvasWidth,
|
|
42
|
+
Q as useCanvasZoom,
|
|
43
|
+
p as useChaiBuilderMsgListener,
|
|
44
|
+
u as useCodeEditor,
|
|
45
|
+
R as useCopyBlockIds,
|
|
46
|
+
S as useCopyToClipboard,
|
|
47
|
+
V as useCurrentPage,
|
|
48
|
+
W as useCutBlockIds,
|
|
49
|
+
X as useDarkMode,
|
|
50
|
+
Y as useDuplicateBlocks,
|
|
51
|
+
G as useGlobalBlocksList,
|
|
52
|
+
H as useGlobalBlocksStore,
|
|
53
|
+
Z as useHiddenBlockIds,
|
|
54
|
+
_ as useHighlightBlockId,
|
|
55
|
+
g as useLanguages,
|
|
56
|
+
ad as useLayoutVariant,
|
|
57
|
+
a0 as usePasteBlocks,
|
|
58
|
+
f as usePreviewMode,
|
|
59
|
+
a2 as useRemoveBlocks,
|
|
60
|
+
a3 as useRemoveClassesFromBlocks,
|
|
61
|
+
e as useSavePage,
|
|
62
|
+
a6 as useSelectedBlock,
|
|
63
|
+
a5 as useSelectedBlockAllClasses,
|
|
64
|
+
a4 as useSelectedBlockCurrentClasses,
|
|
65
|
+
a as useSelectedBlockIds,
|
|
66
|
+
aa as useSelectedBlocksDisplayChild,
|
|
67
|
+
ab as useSelectedBreakpoints,
|
|
68
|
+
ac as useSelectedStylingBlocks,
|
|
69
|
+
a7 as useStylingBreakpoint,
|
|
70
|
+
a9 as useStylingState,
|
|
71
|
+
useTranslation,
|
|
72
|
+
a8 as useUILibraryBlocks,
|
|
73
|
+
K as useUndoManager,
|
|
74
|
+
b as useUpdateBlocksProps,
|
|
75
|
+
c as useUpdateBlocksPropsRealtime
|
|
76
76
|
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
require("lodash-es");
|
|
3
|
+
const clsx = require("clsx");
|
|
4
|
+
const tailwindMerge = require("tailwind-merge");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
function generateUUID(length = 6, chars = "abcdefghijklmnopqrstuvwxyzABCD") {
|
|
7
|
+
let result = "";
|
|
8
|
+
for (let i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
const getBreakpointValue = (width) => width >= 1536 ? "2XL" : width >= 1280 ? "XL" : width >= 1024 ? "LG" : width >= 768 ? "MD" : width >= 640 ? "SM" : "XS";
|
|
12
|
+
const cn = (...inputs) => tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
13
|
+
var DefaultContext = {
|
|
14
|
+
color: void 0,
|
|
15
|
+
size: void 0,
|
|
16
|
+
className: void 0,
|
|
17
|
+
style: void 0,
|
|
18
|
+
attr: void 0
|
|
19
|
+
};
|
|
20
|
+
var IconContext = React.createContext && /* @__PURE__ */ React.createContext(DefaultContext);
|
|
21
|
+
var _excluded = ["attr", "size", "title"];
|
|
22
|
+
function _objectWithoutProperties(source, excluded) {
|
|
23
|
+
if (source == null) return {};
|
|
24
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
25
|
+
var key, i;
|
|
26
|
+
if (Object.getOwnPropertySymbols) {
|
|
27
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
28
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
29
|
+
key = sourceSymbolKeys[i];
|
|
30
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
31
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
32
|
+
target[key] = source[key];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
}
|
|
37
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
38
|
+
if (source == null) return {};
|
|
39
|
+
var target = {};
|
|
40
|
+
for (var key in source) {
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
42
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
43
|
+
target[key] = source[key];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return target;
|
|
47
|
+
}
|
|
48
|
+
function _extends() {
|
|
49
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
50
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
51
|
+
var source = arguments[i];
|
|
52
|
+
for (var key in source) {
|
|
53
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
54
|
+
target[key] = source[key];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return target;
|
|
59
|
+
};
|
|
60
|
+
return _extends.apply(this, arguments);
|
|
61
|
+
}
|
|
62
|
+
function ownKeys(e, r) {
|
|
63
|
+
var t = Object.keys(e);
|
|
64
|
+
if (Object.getOwnPropertySymbols) {
|
|
65
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
66
|
+
r && (o = o.filter(function(r2) {
|
|
67
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
68
|
+
})), t.push.apply(t, o);
|
|
69
|
+
}
|
|
70
|
+
return t;
|
|
71
|
+
}
|
|
72
|
+
function _objectSpread(e) {
|
|
73
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
74
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
75
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
76
|
+
_defineProperty(e, r2, t[r2]);
|
|
77
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
78
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return e;
|
|
82
|
+
}
|
|
83
|
+
function _defineProperty(obj, key, value) {
|
|
84
|
+
key = _toPropertyKey(key);
|
|
85
|
+
if (key in obj) {
|
|
86
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
87
|
+
} else {
|
|
88
|
+
obj[key] = value;
|
|
89
|
+
}
|
|
90
|
+
return obj;
|
|
91
|
+
}
|
|
92
|
+
function _toPropertyKey(t) {
|
|
93
|
+
var i = _toPrimitive(t, "string");
|
|
94
|
+
return "symbol" == typeof i ? i : i + "";
|
|
95
|
+
}
|
|
96
|
+
function _toPrimitive(t, r) {
|
|
97
|
+
if ("object" != typeof t || !t) return t;
|
|
98
|
+
var e = t[Symbol.toPrimitive];
|
|
99
|
+
if (void 0 !== e) {
|
|
100
|
+
var i = e.call(t, r || "default");
|
|
101
|
+
if ("object" != typeof i) return i;
|
|
102
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
103
|
+
}
|
|
104
|
+
return ("string" === r ? String : Number)(t);
|
|
105
|
+
}
|
|
106
|
+
function Tree2Element(tree) {
|
|
107
|
+
return tree && tree.map((node, i) => /* @__PURE__ */ React.createElement(node.tag, _objectSpread({
|
|
108
|
+
key: i
|
|
109
|
+
}, node.attr), Tree2Element(node.child)));
|
|
110
|
+
}
|
|
111
|
+
function GenIcon(data) {
|
|
112
|
+
return (props) => /* @__PURE__ */ React.createElement(IconBase, _extends({
|
|
113
|
+
attr: _objectSpread({}, data.attr)
|
|
114
|
+
}, props), Tree2Element(data.child));
|
|
115
|
+
}
|
|
116
|
+
function IconBase(props) {
|
|
117
|
+
var elem = (conf) => {
|
|
118
|
+
var {
|
|
119
|
+
attr,
|
|
120
|
+
size,
|
|
121
|
+
title
|
|
122
|
+
} = props, svgProps = _objectWithoutProperties(props, _excluded);
|
|
123
|
+
var computedSize = size || conf.size || "1em";
|
|
124
|
+
var className;
|
|
125
|
+
if (conf.className) className = conf.className;
|
|
126
|
+
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
127
|
+
return /* @__PURE__ */ React.createElement("svg", _extends({
|
|
128
|
+
stroke: "currentColor",
|
|
129
|
+
fill: "currentColor",
|
|
130
|
+
strokeWidth: "0"
|
|
131
|
+
}, conf.attr, attr, svgProps, {
|
|
132
|
+
className,
|
|
133
|
+
style: _objectSpread(_objectSpread({
|
|
134
|
+
color: props.color || conf.color
|
|
135
|
+
}, conf.style), props.style),
|
|
136
|
+
height: computedSize,
|
|
137
|
+
width: computedSize,
|
|
138
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
139
|
+
}), title && /* @__PURE__ */ React.createElement("title", null, title), props.children);
|
|
140
|
+
};
|
|
141
|
+
return IconContext !== void 0 ? /* @__PURE__ */ React.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
|
142
|
+
}
|
|
143
|
+
exports.GenIcon = GenIcon;
|
|
144
|
+
exports.cn = cn;
|
|
145
|
+
exports.generateUUID = generateUUID;
|
|
146
|
+
exports.getBreakpointValue = getBreakpointValue;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import "lodash-es";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
import React__default from "react";
|
|
5
|
+
function generateUUID(length = 6, chars = "abcdefghijklmnopqrstuvwxyzABCD") {
|
|
6
|
+
let result = "";
|
|
7
|
+
for (let i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
|
|
8
|
+
return result;
|
|
9
|
+
}
|
|
10
|
+
const getBreakpointValue = (width) => width >= 1536 ? "2XL" : width >= 1280 ? "XL" : width >= 1024 ? "LG" : width >= 768 ? "MD" : width >= 640 ? "SM" : "XS";
|
|
11
|
+
const cn = (...inputs) => twMerge(clsx(inputs));
|
|
12
|
+
var DefaultContext = {
|
|
13
|
+
color: void 0,
|
|
14
|
+
size: void 0,
|
|
15
|
+
className: void 0,
|
|
16
|
+
style: void 0,
|
|
17
|
+
attr: void 0
|
|
18
|
+
};
|
|
19
|
+
var IconContext = React__default.createContext && /* @__PURE__ */ React__default.createContext(DefaultContext);
|
|
20
|
+
var _excluded = ["attr", "size", "title"];
|
|
21
|
+
function _objectWithoutProperties(source, excluded) {
|
|
22
|
+
if (source == null) return {};
|
|
23
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
24
|
+
var key, i;
|
|
25
|
+
if (Object.getOwnPropertySymbols) {
|
|
26
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
27
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
28
|
+
key = sourceSymbolKeys[i];
|
|
29
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
30
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
31
|
+
target[key] = source[key];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
}
|
|
36
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
37
|
+
if (source == null) return {};
|
|
38
|
+
var target = {};
|
|
39
|
+
for (var key in source) {
|
|
40
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
41
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
42
|
+
target[key] = source[key];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return target;
|
|
46
|
+
}
|
|
47
|
+
function _extends() {
|
|
48
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
49
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
50
|
+
var source = arguments[i];
|
|
51
|
+
for (var key in source) {
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
53
|
+
target[key] = source[key];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return target;
|
|
58
|
+
};
|
|
59
|
+
return _extends.apply(this, arguments);
|
|
60
|
+
}
|
|
61
|
+
function ownKeys(e, r) {
|
|
62
|
+
var t = Object.keys(e);
|
|
63
|
+
if (Object.getOwnPropertySymbols) {
|
|
64
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
65
|
+
r && (o = o.filter(function(r2) {
|
|
66
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
67
|
+
})), t.push.apply(t, o);
|
|
68
|
+
}
|
|
69
|
+
return t;
|
|
70
|
+
}
|
|
71
|
+
function _objectSpread(e) {
|
|
72
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
73
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
74
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
75
|
+
_defineProperty(e, r2, t[r2]);
|
|
76
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
77
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return e;
|
|
81
|
+
}
|
|
82
|
+
function _defineProperty(obj, key, value) {
|
|
83
|
+
key = _toPropertyKey(key);
|
|
84
|
+
if (key in obj) {
|
|
85
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
86
|
+
} else {
|
|
87
|
+
obj[key] = value;
|
|
88
|
+
}
|
|
89
|
+
return obj;
|
|
90
|
+
}
|
|
91
|
+
function _toPropertyKey(t) {
|
|
92
|
+
var i = _toPrimitive(t, "string");
|
|
93
|
+
return "symbol" == typeof i ? i : i + "";
|
|
94
|
+
}
|
|
95
|
+
function _toPrimitive(t, r) {
|
|
96
|
+
if ("object" != typeof t || !t) return t;
|
|
97
|
+
var e = t[Symbol.toPrimitive];
|
|
98
|
+
if (void 0 !== e) {
|
|
99
|
+
var i = e.call(t, r || "default");
|
|
100
|
+
if ("object" != typeof i) return i;
|
|
101
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
102
|
+
}
|
|
103
|
+
return ("string" === r ? String : Number)(t);
|
|
104
|
+
}
|
|
105
|
+
function Tree2Element(tree) {
|
|
106
|
+
return tree && tree.map((node, i) => /* @__PURE__ */ React__default.createElement(node.tag, _objectSpread({
|
|
107
|
+
key: i
|
|
108
|
+
}, node.attr), Tree2Element(node.child)));
|
|
109
|
+
}
|
|
110
|
+
function GenIcon(data) {
|
|
111
|
+
return (props) => /* @__PURE__ */ React__default.createElement(IconBase, _extends({
|
|
112
|
+
attr: _objectSpread({}, data.attr)
|
|
113
|
+
}, props), Tree2Element(data.child));
|
|
114
|
+
}
|
|
115
|
+
function IconBase(props) {
|
|
116
|
+
var elem = (conf) => {
|
|
117
|
+
var {
|
|
118
|
+
attr,
|
|
119
|
+
size,
|
|
120
|
+
title
|
|
121
|
+
} = props, svgProps = _objectWithoutProperties(props, _excluded);
|
|
122
|
+
var computedSize = size || conf.size || "1em";
|
|
123
|
+
var className;
|
|
124
|
+
if (conf.className) className = conf.className;
|
|
125
|
+
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
126
|
+
return /* @__PURE__ */ React__default.createElement("svg", _extends({
|
|
127
|
+
stroke: "currentColor",
|
|
128
|
+
fill: "currentColor",
|
|
129
|
+
strokeWidth: "0"
|
|
130
|
+
}, conf.attr, attr, svgProps, {
|
|
131
|
+
className,
|
|
132
|
+
style: _objectSpread(_objectSpread({
|
|
133
|
+
color: props.color || conf.color
|
|
134
|
+
}, conf.style), props.style),
|
|
135
|
+
height: computedSize,
|
|
136
|
+
width: computedSize,
|
|
137
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
138
|
+
}), title && /* @__PURE__ */ React__default.createElement("title", null, title), props.children);
|
|
139
|
+
};
|
|
140
|
+
return IconContext !== void 0 ? /* @__PURE__ */ React__default.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
|
141
|
+
}
|
|
142
|
+
export {
|
|
143
|
+
GenIcon as G,
|
|
144
|
+
getBreakpointValue as a,
|
|
145
|
+
cn as c,
|
|
146
|
+
generateUUID as g
|
|
147
|
+
};
|