@hubstr/kit 0.1.3 → 0.1.5
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/editor/src/codemirror/index.ts +1 -1
- package/editor/src/plugins/code/plugin/index.ts +2 -1
- package/editor/src/plugins/codeblock/plugin/index.ts +2 -1
- package/editor/src/plugins/codemirror-block/plugin/index.ts +2 -1
- package/editor/src/plugins/common/plugin/index.ts +5 -4
- package/editor/src/plugins/common/utils/index.ts +2 -1
- package/editor/src/plugins/file/plugin/index.ts +2 -1
- package/editor/src/plugins/litexml/index.ts +1 -0
- package/editor/src/plugins/litexml/service/litexml-service.ts +11 -1
- package/editor/src/plugins/table/plugin/index.ts +2 -1
- package/icons/es/components/AgentGuideCard/index.js +107 -107
- package/icons/es/components/ColorPreview/index.js +34 -34
- package/icons/es/components/Dashboard/IconItem.js +140 -140
- package/icons/es/components/Dashboard/Text.js +65 -65
- package/icons/es/components/Dashboard/index.js +102 -102
- package/icons/es/components/DownloadButton/index.js +27 -27
- package/icons/es/components/Editor/Color.js +46 -46
- package/icons/es/components/Editor/Mono.js +44 -44
- package/icons/es/components/Editor/Preview.js +53 -53
- package/icons/es/components/Editor/Text.js +44 -44
- package/icons/es/components/Editor/index.js +135 -135
- package/icons/es/components/IconPreview/ColorPreview.js +37 -37
- package/icons/es/components/IconPreview/index.js +66 -66
- package/icons/es/features/index.d.ts +1 -5
- package/icons/es/features/index.js +1 -1
- package/icons/es/features/ui-runtime.js +1 -5
- package/package.json +329 -310
- package/ui/src/Markdown/SyntaxMarkdown/CachedMarkdown.tsx +1 -3
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _templateObject;
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
-
import { Flexbox } from '@hubstr/kit/ui';
|
|
16
|
-
import { StoryBook, useControls, useCreateStore } from '@hubstr/kit/ui/storybook';
|
|
17
|
-
import { createStaticStyles } from 'antd-style';
|
|
18
|
-
import { useEffect, useRef, useState } from 'react';
|
|
19
|
-
import { useSvgo } from "./useSvgo.js";
|
|
20
|
-
import Color from "./Color.js";
|
|
21
|
-
import Mono from "./Mono.js";
|
|
22
|
-
import Preview from "./Preview.js";
|
|
23
|
-
import Text from "./Text.js";
|
|
24
|
-
import { svgIcon } from "./data.js";
|
|
25
|
-
import { defaultPlugins } from "./svgo.js";
|
|
26
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
-
var styles = createStaticStyles(function (_ref) {
|
|
29
|
-
var css = _ref.css,
|
|
30
|
-
cssVar = _ref.cssVar;
|
|
31
|
-
return {
|
|
32
|
-
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n border-radius: ", ";\n "])), cssVar.colorBorder, cssVar.borderRadius)
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
export default (function () {
|
|
36
|
-
var colorRef = useRef(null);
|
|
37
|
-
var monoRef = useRef(null);
|
|
38
|
-
var _useState = useState('0 0 24 24'),
|
|
39
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
-
viewbox = _useState2[0],
|
|
41
|
-
setViewbox = _useState2[1];
|
|
42
|
-
var _useState3 = useState(''),
|
|
43
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
44
|
-
colorSvg = _useState4[0],
|
|
45
|
-
setColorSvg = _useState4[1];
|
|
46
|
-
var _useState5 = useState(''),
|
|
47
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
48
|
-
monoSvg = _useState6[0],
|
|
49
|
-
setMonoSvg = _useState6[1];
|
|
50
|
-
var levaStore = useCreateStore();
|
|
51
|
-
var _useControls = useControls({
|
|
52
|
-
svg: {
|
|
53
|
-
rows: true,
|
|
54
|
-
value: svgIcon
|
|
55
|
-
},
|
|
56
|
-
text: false
|
|
57
|
-
}, {
|
|
58
|
-
store: levaStore
|
|
59
|
-
}),
|
|
60
|
-
svg = _useControls.svg,
|
|
61
|
-
text = _useControls.text;
|
|
62
|
-
var config = useControls('Config', defaultPlugins, {
|
|
63
|
-
collapsed: true
|
|
64
|
-
}, {
|
|
65
|
-
store: levaStore
|
|
66
|
-
});
|
|
67
|
-
var removeColor = {
|
|
68
|
-
addAttributesToSVGElement: {
|
|
69
|
-
attribute: {
|
|
70
|
-
'fill': 'currentColor',
|
|
71
|
-
'fill-rule': 'evenodd'
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
collapseGroups: true,
|
|
75
|
-
removeAttrs: {
|
|
76
|
-
attrs: ['fill', 'color', 'stroke', 'stroke-width', 'fill-rule']
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
var compression = useSvgo(svg, config);
|
|
80
|
-
var mono = useSvgo(svg, _objectSpread(_objectSpread({}, config), removeColor));
|
|
81
|
-
useEffect(function () {
|
|
82
|
-
var _monoRef$current;
|
|
83
|
-
if (mono.isLoading) return setMonoSvg('loading...');
|
|
84
|
-
setMonoSvg((monoRef === null || monoRef === void 0 || (_monoRef$current = monoRef.current) === null || _monoRef$current === void 0 || (_monoRef$current = _monoRef$current.querySelector('svg')) === null || _monoRef$current === void 0 ? void 0 : _monoRef$current.innerHTML) || '');
|
|
85
|
-
}, [mono]);
|
|
86
|
-
useEffect(function () {
|
|
87
|
-
var _colorRef$current, _colorRef$current2;
|
|
88
|
-
if (compression.isLoading) return setColorSvg('loading...');
|
|
89
|
-
setColorSvg((colorRef === null || colorRef === void 0 || (_colorRef$current = colorRef.current) === null || _colorRef$current === void 0 || (_colorRef$current = _colorRef$current.querySelector('svg')) === null || _colorRef$current === void 0 ? void 0 : _colorRef$current.innerHTML) || '');
|
|
90
|
-
var viewBox = colorRef === null || colorRef === void 0 || (_colorRef$current2 = colorRef.current) === null || _colorRef$current2 === void 0 || (_colorRef$current2 = _colorRef$current2.querySelector('svg')) === null || _colorRef$current2 === void 0 ? void 0 : _colorRef$current2.viewBox.baseVal;
|
|
91
|
-
if (viewBox) {
|
|
92
|
-
setViewbox("".concat(viewBox.x, " ").concat(viewBox.y, " ").concat(viewBox.width, " ").concat(viewBox.height));
|
|
93
|
-
}
|
|
94
|
-
}, [compression]);
|
|
95
|
-
return /*#__PURE__*/_jsx(StoryBook, {
|
|
96
|
-
className: styles.container,
|
|
97
|
-
levaStore: levaStore,
|
|
98
|
-
style: {
|
|
99
|
-
position: 'relative'
|
|
100
|
-
},
|
|
101
|
-
children: /*#__PURE__*/_jsxs(Flexbox, {
|
|
102
|
-
gap: 32,
|
|
103
|
-
style: {
|
|
104
|
-
overflow: 'hidden',
|
|
105
|
-
width: '100%'
|
|
106
|
-
},
|
|
107
|
-
children: [/*#__PURE__*/_jsx(Preview, {
|
|
108
|
-
svg: svg,
|
|
109
|
-
title: 'Original'
|
|
110
|
-
}), /*#__PURE__*/_jsx(Preview, {
|
|
111
|
-
precent: compression.precent,
|
|
112
|
-
ref: colorRef,
|
|
113
|
-
svg: compression.svg,
|
|
114
|
-
title: 'Compression'
|
|
115
|
-
}), /*#__PURE__*/_jsx(Preview, {
|
|
116
|
-
precent: mono.precent,
|
|
117
|
-
ref: monoRef,
|
|
118
|
-
svg: mono.svg,
|
|
119
|
-
title: 'Monochrome'
|
|
120
|
-
}), text ? /*#__PURE__*/_jsx(Text, {
|
|
121
|
-
svg: monoSvg,
|
|
122
|
-
title: 'Text',
|
|
123
|
-
viewbox: viewbox
|
|
124
|
-
}) : /*#__PURE__*/_jsx(Mono, {
|
|
125
|
-
svg: monoSvg,
|
|
126
|
-
title: 'Mono',
|
|
127
|
-
viewbox: viewbox
|
|
128
|
-
}), /*#__PURE__*/_jsx(Color, {
|
|
129
|
-
svg: colorSvg,
|
|
130
|
-
textMode: text,
|
|
131
|
-
title: 'Color',
|
|
132
|
-
viewbox: viewbox
|
|
133
|
-
})]
|
|
134
|
-
})
|
|
135
|
-
});
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _templateObject;
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
import { Flexbox } from '@hubstr/kit/ui';
|
|
16
|
+
import { StoryBook, useControls, useCreateStore } from '@hubstr/kit/ui/storybook';
|
|
17
|
+
import { createStaticStyles } from 'antd-style';
|
|
18
|
+
import { useEffect, useRef, useState } from 'react';
|
|
19
|
+
import { useSvgo } from "./useSvgo.js";
|
|
20
|
+
import Color from "./Color.js";
|
|
21
|
+
import Mono from "./Mono.js";
|
|
22
|
+
import Preview from "./Preview.js";
|
|
23
|
+
import Text from "./Text.js";
|
|
24
|
+
import { svgIcon } from "./data.js";
|
|
25
|
+
import { defaultPlugins } from "./svgo.js";
|
|
26
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
var styles = createStaticStyles(function (_ref) {
|
|
29
|
+
var css = _ref.css,
|
|
30
|
+
cssVar = _ref.cssVar;
|
|
31
|
+
return {
|
|
32
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n border-radius: ", ";\n "])), cssVar.colorBorder, cssVar.borderRadius)
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
export default (function () {
|
|
36
|
+
var colorRef = useRef(null);
|
|
37
|
+
var monoRef = useRef(null);
|
|
38
|
+
var _useState = useState('0 0 24 24'),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
viewbox = _useState2[0],
|
|
41
|
+
setViewbox = _useState2[1];
|
|
42
|
+
var _useState3 = useState(''),
|
|
43
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
44
|
+
colorSvg = _useState4[0],
|
|
45
|
+
setColorSvg = _useState4[1];
|
|
46
|
+
var _useState5 = useState(''),
|
|
47
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
48
|
+
monoSvg = _useState6[0],
|
|
49
|
+
setMonoSvg = _useState6[1];
|
|
50
|
+
var levaStore = useCreateStore();
|
|
51
|
+
var _useControls = useControls({
|
|
52
|
+
svg: {
|
|
53
|
+
rows: true,
|
|
54
|
+
value: svgIcon
|
|
55
|
+
},
|
|
56
|
+
text: false
|
|
57
|
+
}, {
|
|
58
|
+
store: levaStore
|
|
59
|
+
}),
|
|
60
|
+
svg = _useControls.svg,
|
|
61
|
+
text = _useControls.text;
|
|
62
|
+
var config = useControls('Config', defaultPlugins, {
|
|
63
|
+
collapsed: true
|
|
64
|
+
}, {
|
|
65
|
+
store: levaStore
|
|
66
|
+
});
|
|
67
|
+
var removeColor = {
|
|
68
|
+
addAttributesToSVGElement: {
|
|
69
|
+
attribute: {
|
|
70
|
+
'fill': 'currentColor',
|
|
71
|
+
'fill-rule': 'evenodd'
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
collapseGroups: true,
|
|
75
|
+
removeAttrs: {
|
|
76
|
+
attrs: ['fill', 'color', 'stroke', 'stroke-width', 'fill-rule']
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
var compression = useSvgo(svg, config);
|
|
80
|
+
var mono = useSvgo(svg, _objectSpread(_objectSpread({}, config), removeColor));
|
|
81
|
+
useEffect(function () {
|
|
82
|
+
var _monoRef$current;
|
|
83
|
+
if (mono.isLoading) return setMonoSvg('loading...');
|
|
84
|
+
setMonoSvg((monoRef === null || monoRef === void 0 || (_monoRef$current = monoRef.current) === null || _monoRef$current === void 0 || (_monoRef$current = _monoRef$current.querySelector('svg')) === null || _monoRef$current === void 0 ? void 0 : _monoRef$current.innerHTML) || '');
|
|
85
|
+
}, [mono]);
|
|
86
|
+
useEffect(function () {
|
|
87
|
+
var _colorRef$current, _colorRef$current2;
|
|
88
|
+
if (compression.isLoading) return setColorSvg('loading...');
|
|
89
|
+
setColorSvg((colorRef === null || colorRef === void 0 || (_colorRef$current = colorRef.current) === null || _colorRef$current === void 0 || (_colorRef$current = _colorRef$current.querySelector('svg')) === null || _colorRef$current === void 0 ? void 0 : _colorRef$current.innerHTML) || '');
|
|
90
|
+
var viewBox = colorRef === null || colorRef === void 0 || (_colorRef$current2 = colorRef.current) === null || _colorRef$current2 === void 0 || (_colorRef$current2 = _colorRef$current2.querySelector('svg')) === null || _colorRef$current2 === void 0 ? void 0 : _colorRef$current2.viewBox.baseVal;
|
|
91
|
+
if (viewBox) {
|
|
92
|
+
setViewbox("".concat(viewBox.x, " ").concat(viewBox.y, " ").concat(viewBox.width, " ").concat(viewBox.height));
|
|
93
|
+
}
|
|
94
|
+
}, [compression]);
|
|
95
|
+
return /*#__PURE__*/_jsx(StoryBook, {
|
|
96
|
+
className: styles.container,
|
|
97
|
+
levaStore: levaStore,
|
|
98
|
+
style: {
|
|
99
|
+
position: 'relative'
|
|
100
|
+
},
|
|
101
|
+
children: /*#__PURE__*/_jsxs(Flexbox, {
|
|
102
|
+
gap: 32,
|
|
103
|
+
style: {
|
|
104
|
+
overflow: 'hidden',
|
|
105
|
+
width: '100%'
|
|
106
|
+
},
|
|
107
|
+
children: [/*#__PURE__*/_jsx(Preview, {
|
|
108
|
+
svg: svg,
|
|
109
|
+
title: 'Original'
|
|
110
|
+
}), /*#__PURE__*/_jsx(Preview, {
|
|
111
|
+
precent: compression.precent,
|
|
112
|
+
ref: colorRef,
|
|
113
|
+
svg: compression.svg,
|
|
114
|
+
title: 'Compression'
|
|
115
|
+
}), /*#__PURE__*/_jsx(Preview, {
|
|
116
|
+
precent: mono.precent,
|
|
117
|
+
ref: monoRef,
|
|
118
|
+
svg: mono.svg,
|
|
119
|
+
title: 'Monochrome'
|
|
120
|
+
}), text ? /*#__PURE__*/_jsx(Text, {
|
|
121
|
+
svg: monoSvg,
|
|
122
|
+
title: 'Text',
|
|
123
|
+
viewbox: viewbox
|
|
124
|
+
}) : /*#__PURE__*/_jsx(Mono, {
|
|
125
|
+
svg: monoSvg,
|
|
126
|
+
title: 'Mono',
|
|
127
|
+
viewbox: viewbox
|
|
128
|
+
}), /*#__PURE__*/_jsx(Color, {
|
|
129
|
+
svg: colorSvg,
|
|
130
|
+
textMode: text,
|
|
131
|
+
title: 'Color',
|
|
132
|
+
viewbox: viewbox
|
|
133
|
+
})]
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
136
|
});
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
var _templateObject, _templateObject2;
|
|
4
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
5
|
-
import { CopyButton, Flexbox } from '@hubstr/kit/ui';
|
|
6
|
-
import { createStaticStyles, cx } from 'antd-style';
|
|
7
|
-
import { memo } from 'react';
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
var styles = createStaticStyles(function (_ref) {
|
|
11
|
-
var css = _ref.css,
|
|
12
|
-
cssVar = _ref.cssVar;
|
|
13
|
-
return {
|
|
14
|
-
btn: cx('copy-button', css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n inset-block-start: 4px;\n inset-inline-end: 4px;\n opacity: 0;\n "])))),
|
|
15
|
-
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n flex: none;\n\n width: 98px;\n height: 98px;\n border: 1px solid ", ";\n border-radius: ", ";\n\n font-family: ", ";\n line-height: 1;\n\n background: ", ";\n\n &:hover {\n .copy-button {\n opacity: 1;\n }\n }\n "])), cssVar.colorBorder, cssVar.borderRadius, cssVar.fontFamilyCode, cssVar.colorBgContainer)
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
var IconPreview = /*#__PURE__*/memo(function (_ref2) {
|
|
19
|
-
var color = _ref2.color;
|
|
20
|
-
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
21
|
-
align: 'center',
|
|
22
|
-
className: styles.container,
|
|
23
|
-
justify: 'center',
|
|
24
|
-
style: {
|
|
25
|
-
background: color
|
|
26
|
-
},
|
|
27
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
28
|
-
style: {
|
|
29
|
-
color: '#fff'
|
|
30
|
-
},
|
|
31
|
-
children: color
|
|
32
|
-
}), /*#__PURE__*/_jsx(CopyButton, {
|
|
33
|
-
className: styles.btn,
|
|
34
|
-
content: color
|
|
35
|
-
})]
|
|
36
|
-
});
|
|
37
|
-
});
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
5
|
+
import { CopyButton, Flexbox } from '@hubstr/kit/ui';
|
|
6
|
+
import { createStaticStyles, cx } from 'antd-style';
|
|
7
|
+
import { memo } from 'react';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
var styles = createStaticStyles(function (_ref) {
|
|
11
|
+
var css = _ref.css,
|
|
12
|
+
cssVar = _ref.cssVar;
|
|
13
|
+
return {
|
|
14
|
+
btn: cx('copy-button', css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n inset-block-start: 4px;\n inset-inline-end: 4px;\n opacity: 0;\n "])))),
|
|
15
|
+
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n flex: none;\n\n width: 98px;\n height: 98px;\n border: 1px solid ", ";\n border-radius: ", ";\n\n font-family: ", ";\n line-height: 1;\n\n background: ", ";\n\n &:hover {\n .copy-button {\n opacity: 1;\n }\n }\n "])), cssVar.colorBorder, cssVar.borderRadius, cssVar.fontFamilyCode, cssVar.colorBgContainer)
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
var IconPreview = /*#__PURE__*/memo(function (_ref2) {
|
|
19
|
+
var color = _ref2.color;
|
|
20
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
21
|
+
align: 'center',
|
|
22
|
+
className: styles.container,
|
|
23
|
+
justify: 'center',
|
|
24
|
+
style: {
|
|
25
|
+
background: color
|
|
26
|
+
},
|
|
27
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
28
|
+
style: {
|
|
29
|
+
color: '#fff'
|
|
30
|
+
},
|
|
31
|
+
children: color
|
|
32
|
+
}), /*#__PURE__*/_jsx(CopyButton, {
|
|
33
|
+
className: styles.btn,
|
|
34
|
+
content: color
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
38
|
export default IconPreview;
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["className", "children"];
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
4
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
|
-
import { Flexbox } from '@hubstr/kit/ui';
|
|
13
|
-
import { createStaticStyles, cx } from 'antd-style';
|
|
14
|
-
import { memo, useRef } from 'react';
|
|
15
|
-
import DownloadButton from "../DownloadButton/index.js";
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
-
var styles = createStaticStyles(function (_ref) {
|
|
19
|
-
var css = _ref.css,
|
|
20
|
-
cssVar = _ref.cssVar;
|
|
21
|
-
return {
|
|
22
|
-
btn: cx('copy-button', css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n inset-block-start: 4px;\n inset-inline-end: 4px;\n opacity: 0;\n "])))),
|
|
23
|
-
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n flex: none;\n\n padding: 12px;\n border: 1px solid ", ";\n border-radius: ", ";\n\n line-height: 1;\n\n background: ", ";\n\n &:hover {\n .copy-button {\n opacity: 1;\n }\n }\n "])), cssVar.colorBorder, cssVar.borderRadius, cssVar.colorBgContainer),
|
|
24
|
-
inner: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n width: auto;\n min-width: 72px;\n height: 72px;\n\n font-size: 72px;\n line-height: 1;\n "])))
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
var IconPreview = /*#__PURE__*/memo(function (_ref2) {
|
|
28
|
-
var className = _ref2.className,
|
|
29
|
-
children = _ref2.children,
|
|
30
|
-
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
31
|
-
var ref = useRef(null);
|
|
32
|
-
var isString = typeof children === 'string';
|
|
33
|
-
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
34
|
-
align: 'center',
|
|
35
|
-
className: cx(styles.container, className),
|
|
36
|
-
flex: 'none',
|
|
37
|
-
justify: 'center'
|
|
38
|
-
}, rest), {}, {
|
|
39
|
-
children: [isString ? /*#__PURE__*/_jsx("div", {
|
|
40
|
-
className: styles.inner,
|
|
41
|
-
dangerouslySetInnerHTML: {
|
|
42
|
-
__html: children
|
|
43
|
-
}
|
|
44
|
-
}) : /*#__PURE__*/_jsx("div", {
|
|
45
|
-
className: styles.inner,
|
|
46
|
-
children: children
|
|
47
|
-
}), /*#__PURE__*/_jsx(DownloadButton, {
|
|
48
|
-
className: styles.btn,
|
|
49
|
-
onClick: function onClick() {
|
|
50
|
-
var _ref$current;
|
|
51
|
-
var svgString = String(ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 || (_ref$current = _ref$current.querySelector('svg')) === null || _ref$current === void 0 ? void 0 : _ref$current.outerHTML);
|
|
52
|
-
var blob = new Blob([svgString], {
|
|
53
|
-
type: 'image/svg+xml;charset=utf-8'
|
|
54
|
-
});
|
|
55
|
-
var url = URL.createObjectURL(blob);
|
|
56
|
-
var downloadLink = document.createElement('a');
|
|
57
|
-
downloadLink.href = url;
|
|
58
|
-
downloadLink.download = 'icon.svg';
|
|
59
|
-
document.body.append(downloadLink);
|
|
60
|
-
downloadLink.click();
|
|
61
|
-
downloadLink.remove();
|
|
62
|
-
URL.revokeObjectURL(url);
|
|
63
|
-
}
|
|
64
|
-
})]
|
|
65
|
-
}));
|
|
66
|
-
});
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["className", "children"];
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
|
+
import { Flexbox } from '@hubstr/kit/ui';
|
|
13
|
+
import { createStaticStyles, cx } from 'antd-style';
|
|
14
|
+
import { memo, useRef } from 'react';
|
|
15
|
+
import DownloadButton from "../DownloadButton/index.js";
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
var styles = createStaticStyles(function (_ref) {
|
|
19
|
+
var css = _ref.css,
|
|
20
|
+
cssVar = _ref.cssVar;
|
|
21
|
+
return {
|
|
22
|
+
btn: cx('copy-button', css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n inset-block-start: 4px;\n inset-inline-end: 4px;\n opacity: 0;\n "])))),
|
|
23
|
+
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n flex: none;\n\n padding: 12px;\n border: 1px solid ", ";\n border-radius: ", ";\n\n line-height: 1;\n\n background: ", ";\n\n &:hover {\n .copy-button {\n opacity: 1;\n }\n }\n "])), cssVar.colorBorder, cssVar.borderRadius, cssVar.colorBgContainer),
|
|
24
|
+
inner: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n width: auto;\n min-width: 72px;\n height: 72px;\n\n font-size: 72px;\n line-height: 1;\n "])))
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
var IconPreview = /*#__PURE__*/memo(function (_ref2) {
|
|
28
|
+
var className = _ref2.className,
|
|
29
|
+
children = _ref2.children,
|
|
30
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
31
|
+
var ref = useRef(null);
|
|
32
|
+
var isString = typeof children === 'string';
|
|
33
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
34
|
+
align: 'center',
|
|
35
|
+
className: cx(styles.container, className),
|
|
36
|
+
flex: 'none',
|
|
37
|
+
justify: 'center'
|
|
38
|
+
}, rest), {}, {
|
|
39
|
+
children: [isString ? /*#__PURE__*/_jsx("div", {
|
|
40
|
+
className: styles.inner,
|
|
41
|
+
dangerouslySetInnerHTML: {
|
|
42
|
+
__html: children
|
|
43
|
+
}
|
|
44
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
45
|
+
className: styles.inner,
|
|
46
|
+
children: children
|
|
47
|
+
}), /*#__PURE__*/_jsx(DownloadButton, {
|
|
48
|
+
className: styles.btn,
|
|
49
|
+
onClick: function onClick() {
|
|
50
|
+
var _ref$current;
|
|
51
|
+
var svgString = String(ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 || (_ref$current = _ref$current.querySelector('svg')) === null || _ref$current === void 0 ? void 0 : _ref$current.outerHTML);
|
|
52
|
+
var blob = new Blob([svgString], {
|
|
53
|
+
type: 'image/svg+xml;charset=utf-8'
|
|
54
|
+
});
|
|
55
|
+
var url = URL.createObjectURL(blob);
|
|
56
|
+
var downloadLink = document.createElement('a');
|
|
57
|
+
downloadLink.href = url;
|
|
58
|
+
downloadLink.download = 'icon.svg';
|
|
59
|
+
document.body.append(downloadLink);
|
|
60
|
+
downloadLink.click();
|
|
61
|
+
downloadLink.remove();
|
|
62
|
+
URL.revokeObjectURL(url);
|
|
63
|
+
}
|
|
64
|
+
})]
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
67
67
|
export default IconPreview;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
export { agentMappings } from './agentConfig';
|
|
2
2
|
export { default as AgentIcon, type AgentIconProps } from './AgentIcon';
|
|
3
|
-
export {
|
|
4
|
-
getHubstrIconCDN,
|
|
5
|
-
getHubstrIconCDN as getLobeIconCDN,
|
|
6
|
-
type HubstrIconCdnConfig,
|
|
7
|
-
} from './getHubstrIconCDN';
|
|
3
|
+
export { getHubstrIconCDN, type HubstrIconCdnConfig } from './getHubstrIconCDN';
|
|
8
4
|
export { default as IconAvatar, type IconAvatarProps } from './IconAvatar';
|
|
9
5
|
export { default as IconCombine, type IconCombineProps } from './IconCombine';
|
|
10
6
|
export { modelMappings } from './modelConfig';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { agentMappings } from "./agentConfig.js";
|
|
2
2
|
export { default as AgentIcon } from "./AgentIcon/index.js";
|
|
3
|
-
export { getHubstrIconCDN
|
|
3
|
+
export { getHubstrIconCDN } from "./getHubstrIconCDN/index.js";
|
|
4
4
|
export { default as IconAvatar } from "./IconAvatar/index.js";
|
|
5
5
|
export { default as IconCombine } from "./IconCombine/index.js";
|
|
6
6
|
export { modelMappings } from "./modelConfig.js";
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { createElement, memo } from 'react';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Plain JS stand-ins for the @hubstr/kit/ui bits that published icons/es/features
|
|
5
|
-
* used to import. Those imports pulled TypeScript UI source, which Node/Vitest
|
|
6
|
-
* cannot load from node_modules (`Stripping types is currently unsupported`).
|
|
7
|
-
*/
|
|
3
|
+
/** Node/Vitest stand-in so published icons/es/features do not load TypeScript UI source. */
|
|
8
4
|
export const Center = memo(function Center({ children, flex, style, ...rest }) {
|
|
9
5
|
return createElement(
|
|
10
6
|
'div',
|