one-design-next 0.0.11 → 0.0.13
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/_genui-types.d.ts +45 -10
- package/dist/attachments/index.js +67 -10
- package/dist/attachments/style/index.css +86 -14
- package/dist/collapse/primitive.d.ts +1 -1
- package/dist/composer/chip.d.ts +4 -4
- package/dist/composer/clipboard.d.ts +12 -0
- package/dist/composer/clipboard.js +84 -0
- package/dist/composer/editor.d.ts +9 -1
- package/dist/composer/editor.js +70 -14
- package/dist/composer/hooks/useChipManager.d.ts +6 -1
- package/dist/composer/hooks/useChipManager.js +76 -27
- package/dist/composer/hooks/useChipSelectionMarker.d.ts +7 -0
- package/dist/composer/hooks/useChipSelectionMarker.js +66 -0
- package/dist/composer/index.d.ts +58 -1
- package/dist/composer/index.js +219 -102
- package/dist/composer/inline-ref.d.ts +9 -0
- package/dist/composer/inline-ref.js +21 -0
- package/dist/composer/send-meta.d.ts +6 -0
- package/dist/composer/send-meta.js +67 -0
- package/dist/composer/style/index.css +48 -53
- package/dist/composer/utils.d.ts +9 -0
- package/dist/composer/utils.js +43 -2
- package/dist/fab/index.js +3 -16
- package/dist/fab/style/index.css +1 -3
- package/dist/icon/svg-data.d.ts +4 -0
- package/dist/icon/svg-data.js +1 -1
- package/dist/icon/types.d.ts +1 -1
- package/dist/image/index.d.ts +43 -0
- package/dist/image/index.js +51 -0
- package/dist/image/style/index.css +59 -0
- package/dist/image/style/index.d.ts +2 -0
- package/dist/image/style/index.js +2 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +4 -0
- package/dist/invocation/index.d.ts +17 -0
- package/dist/invocation/index.js +84 -0
- package/dist/invocation/style/index.css +58 -0
- package/dist/invocation/style/index.d.ts +2 -0
- package/dist/invocation/style/index.js +2 -0
- package/dist/mention/index.d.ts +17 -0
- package/dist/mention/index.js +90 -0
- package/dist/mention/style/index.css +58 -0
- package/dist/mention/style/index.d.ts +2 -0
- package/dist/mention/style/index.js +2 -0
- package/dist/message-image/index.d.ts +42 -0
- package/dist/message-image/index.js +46 -0
- package/dist/message-image/style/index.css +60 -0
- package/dist/message-image/style/index.d.ts +2 -0
- package/dist/message-image/style/index.js +2 -0
- package/dist/preview-panel/index.d.ts +5 -1
- package/dist/preview-panel/index.js +27 -2
- package/dist/user-bubble/index.d.ts +11 -1
- package/dist/user-bubble/index.js +30 -5
- package/dist/user-bubble/style/index.css +6 -0
- package/package.json +2 -3
|
@@ -0,0 +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
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
export function chipToInvocationData(chip) {
|
|
11
|
+
var kind = chip.kind === 'skill' || chip.kind === 'invocation' || !chip.kind ? 'skill' : chip.kind;
|
|
12
|
+
return {
|
|
13
|
+
id: chip.id,
|
|
14
|
+
kind: kind,
|
|
15
|
+
refId: chip.skillId,
|
|
16
|
+
label: chip.label,
|
|
17
|
+
icon: chip.icon
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function chipToMentionData(chip) {
|
|
21
|
+
var _chip$kind;
|
|
22
|
+
return {
|
|
23
|
+
id: chip.id,
|
|
24
|
+
kind: (_chip$kind = chip.kind) !== null && _chip$kind !== void 0 ? _chip$kind : 'mention',
|
|
25
|
+
refId: chip.skillId,
|
|
26
|
+
label: chip.label,
|
|
27
|
+
icon: chip.icon
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function chipToLegacyMeta(chip) {
|
|
31
|
+
var kind = chip.kind === 'mention' ? 'mention' : chip.kind === 'invocation' || chip.kind === 'skill' || !chip.kind ? 'skill' : chip.kind;
|
|
32
|
+
return {
|
|
33
|
+
id: chip.id,
|
|
34
|
+
skillId: chip.skillId,
|
|
35
|
+
label: chip.label,
|
|
36
|
+
icon: chip.icon,
|
|
37
|
+
kind: kind
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** 从 editor chip 列表构建 SendMeta(含 invocations / mentions + chips 兼容字段)。 */
|
|
42
|
+
export function buildSendMetaFromChips(chips) {
|
|
43
|
+
var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
44
|
+
var invocations = [];
|
|
45
|
+
var mentions = [];
|
|
46
|
+
var _iterator = _createForOfIteratorHelper(chips),
|
|
47
|
+
_step;
|
|
48
|
+
try {
|
|
49
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
50
|
+
var chip = _step.value;
|
|
51
|
+
if (chip.kind === 'mention') {
|
|
52
|
+
mentions.push(chipToMentionData(chip));
|
|
53
|
+
} else {
|
|
54
|
+
invocations.push(chipToInvocationData(chip));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} catch (err) {
|
|
58
|
+
_iterator.e(err);
|
|
59
|
+
} finally {
|
|
60
|
+
_iterator.f();
|
|
61
|
+
}
|
|
62
|
+
return _objectSpread(_objectSpread({}, base), {}, {
|
|
63
|
+
invocations: invocations.length > 0 ? invocations : undefined,
|
|
64
|
+
mentions: mentions.length > 0 ? mentions : undefined,
|
|
65
|
+
chips: chips.length > 0 ? chips.map(chipToLegacyMeta) : undefined
|
|
66
|
+
});
|
|
67
|
+
}
|
|
@@ -186,6 +186,11 @@
|
|
|
186
186
|
white-space: pre-wrap;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
+
[data-odn-composer] [data-odn-composer-editor][data-odn-composer-editor-disabled] {
|
|
190
|
+
cursor: not-allowed;
|
|
191
|
+
color: var(--odn-color-text-disabled);
|
|
192
|
+
}
|
|
193
|
+
|
|
189
194
|
/* placeholder:editor 完全空时由 ::before 渲染。
|
|
190
195
|
*
|
|
191
196
|
* 关键修复:abs 子元素的 containing block = 最近 positioned 祖先的
|
|
@@ -214,63 +219,18 @@
|
|
|
214
219
|
white-space: nowrap;
|
|
215
220
|
}
|
|
216
221
|
|
|
217
|
-
/*
|
|
222
|
+
/* 内联引用 host:Portal 注入 Invocation / Mention,视觉由组件自带样式承担 */
|
|
218
223
|
[data-odn-composer] [data-odn-composer-chip-host] {
|
|
219
|
-
display: inline
|
|
224
|
+
display: inline;
|
|
220
225
|
vertical-align: baseline;
|
|
221
226
|
}
|
|
222
227
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
height: 22px;
|
|
230
|
-
border-radius: 4px;
|
|
231
|
-
background: color-mix(in srgb, var(--odn-color-cyan-5) 12%, transparent);
|
|
232
|
-
color: var(--odn-color-cyan-5);
|
|
233
|
-
font-size: 13px;
|
|
234
|
-
line-height: 1;
|
|
235
|
-
font-weight: 500;
|
|
236
|
-
cursor: default;
|
|
237
|
-
user-select: none;
|
|
238
|
-
vertical-align: -3px;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
[data-odn-composer] [data-odn-composer-chip-icon],
|
|
242
|
-
[data-odn-composer] [data-odn-composer-chip-remove] {
|
|
243
|
-
display: inline-flex;
|
|
244
|
-
align-items: center;
|
|
245
|
-
justify-content: center;
|
|
246
|
-
width: 14px;
|
|
247
|
-
height: 14px;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
[data-odn-composer] [data-odn-composer-chip-remove] {
|
|
251
|
-
border: none;
|
|
252
|
-
background: transparent;
|
|
253
|
-
color: inherit;
|
|
254
|
-
padding: 0;
|
|
255
|
-
cursor: pointer;
|
|
256
|
-
border-radius: 3px;
|
|
257
|
-
display: none;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
[data-odn-composer] [data-odn-composer-chip-icon] {
|
|
261
|
-
display: inline-flex;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
[data-odn-composer] [data-odn-composer-chip]:hover [data-odn-composer-chip-icon] {
|
|
265
|
-
display: none;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
[data-odn-composer] [data-odn-composer-chip]:hover [data-odn-composer-chip-remove] {
|
|
269
|
-
display: inline-flex;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
[data-odn-composer] [data-odn-composer-chip-remove]:hover {
|
|
273
|
-
background: color-mix(in srgb, var(--odn-color-cyan-5) 18%, transparent);
|
|
228
|
+
/* chip 在 contentEditable=false 下无原生 selection 高亮,自绘选中态 */
|
|
229
|
+
[data-odn-composer] [data-odn-composer-chip-host][data-selected] [data-odn-invocation],
|
|
230
|
+
[data-odn-composer] [data-odn-composer-chip-host][data-selected] [data-odn-mention] {
|
|
231
|
+
background: color-mix(in srgb, var(--odn-color-solid-black-12) 12%, transparent);
|
|
232
|
+
border-radius: 0;
|
|
233
|
+
transition: none;
|
|
274
234
|
}
|
|
275
235
|
|
|
276
236
|
[data-odn-composer-toolbar] {
|
|
@@ -350,6 +310,10 @@
|
|
|
350
310
|
[data-odn-composer-tool-btn][data-odn-composer-tool-active]::before {
|
|
351
311
|
opacity: 1;
|
|
352
312
|
}
|
|
313
|
+
[data-odn-composer-tool-btn][data-odn-composer-tool-disabled], [data-odn-composer-tool-btn]:disabled {
|
|
314
|
+
color: var(--odn-color-text-disabled);
|
|
315
|
+
cursor: not-allowed;
|
|
316
|
+
}
|
|
353
317
|
|
|
354
318
|
[data-odn-composer-skill-clear] {
|
|
355
319
|
display: inline-flex;
|
|
@@ -417,4 +381,35 @@ p[data-odn-composer-hint] {
|
|
|
417
381
|
text-align: center;
|
|
418
382
|
pointer-events: none;
|
|
419
383
|
user-select: none;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/* ------------------------------------------------------------------
|
|
387
|
+
* 待发送区图片缩略
|
|
388
|
+
* 待发送态用模板驱动尺寸(72×72 cover),与 MessageImage 消息态的
|
|
389
|
+
* 数据驱动尺寸(单图 max 280×360 contain)形成对比:
|
|
390
|
+
* - 输入态用户聚焦于"我加了哪些",整齐划一比保留长宽比要紧
|
|
391
|
+
* - 模板尺寸还能让多图横排清爽不参差
|
|
392
|
+
* 通过给 Image leaf 容器套尺寸 + 内部 img 用 cover 实现。
|
|
393
|
+
* ----------------------------------------------------------------- */
|
|
394
|
+
[data-odn-composer-images] {
|
|
395
|
+
display: flex;
|
|
396
|
+
flex-wrap: wrap;
|
|
397
|
+
gap: 6px;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
[data-odn-composer-image-thumb] {
|
|
401
|
+
width: 72px;
|
|
402
|
+
height: 72px;
|
|
403
|
+
border-radius: 6px;
|
|
404
|
+
overflow: hidden;
|
|
405
|
+
}
|
|
406
|
+
[data-odn-composer-image-thumb] [data-odn-image] {
|
|
407
|
+
display: block;
|
|
408
|
+
width: 100%;
|
|
409
|
+
height: 100%;
|
|
410
|
+
}
|
|
411
|
+
[data-odn-composer-image-thumb] [data-odn-image] img {
|
|
412
|
+
width: 100%;
|
|
413
|
+
height: 100%;
|
|
414
|
+
object-fit: cover;
|
|
420
415
|
}
|
package/dist/composer/utils.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
export declare const ZWSP = "\u200B";
|
|
14
14
|
/** Invisible Separator (U+2063):包裹 marker 的 id,业务文本不会出现。 */
|
|
15
15
|
export declare const SEP = "\u2063";
|
|
16
|
+
export declare function stripInvisibleChars(s: string): string;
|
|
16
17
|
/** 把 mention id 包成 marker token,插入 value 的 string 里。 */
|
|
17
18
|
export declare function createMarker(id: string): string;
|
|
18
19
|
/** 单条 marker 的解析结果。 */
|
|
@@ -32,6 +33,14 @@ export interface MarkerMatch {
|
|
|
32
33
|
export declare function parseMarkers(raw: string): MarkerMatch[];
|
|
33
34
|
/** 去掉所有 marker 的纯文本(人看的)。 */
|
|
34
35
|
export declare function stripMarkers(raw: string): string;
|
|
36
|
+
/** 按 marker 切分 raw string,用于粘贴还原 DOM。 */
|
|
37
|
+
export declare function forEachMarkerSegment(raw: string, visit: (segment: {
|
|
38
|
+
type: 'text';
|
|
39
|
+
text: string;
|
|
40
|
+
} | {
|
|
41
|
+
type: 'marker';
|
|
42
|
+
id: string;
|
|
43
|
+
}) => void): void;
|
|
35
44
|
/**
|
|
36
45
|
* 从 contenteditable 里把所有 chip 替换成 marker,得到上层 onChange / onSend
|
|
37
46
|
* 关心的 raw string。
|
package/dist/composer/utils.js
CHANGED
|
@@ -29,6 +29,12 @@ var escapeRe = function escapeRe(s) {
|
|
|
29
29
|
};
|
|
30
30
|
var MARKER_RE = new RegExp("".concat(escapeRe(MARKER_OPEN), "([^").concat(SEP, "]+)").concat(escapeRe(MARKER_CLOSE)), 'g');
|
|
31
31
|
|
|
32
|
+
/** 从用户可见文本中剔除 ZWSP / SEP(粘贴残留、锚点字符)。 */
|
|
33
|
+
var INVISIBLE_RE = new RegExp("[".concat(ZWSP).concat(SEP, "]"), 'g');
|
|
34
|
+
export function stripInvisibleChars(s) {
|
|
35
|
+
return s.replace(INVISIBLE_RE, '');
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
/** 把 mention id 包成 marker token,插入 value 的 string 里。 */
|
|
33
39
|
export function createMarker(id) {
|
|
34
40
|
return "".concat(MARKER_OPEN).concat(id).concat(MARKER_CLOSE);
|
|
@@ -71,6 +77,41 @@ export function stripMarkers(raw) {
|
|
|
71
77
|
return raw.replace(MARKER_RE, '');
|
|
72
78
|
}
|
|
73
79
|
|
|
80
|
+
/** 按 marker 切分 raw string,用于粘贴还原 DOM。 */
|
|
81
|
+
export function forEachMarkerSegment(raw, visit) {
|
|
82
|
+
var lastIdx = 0;
|
|
83
|
+
var re = new RegExp(MARKER_RE.source, 'g');
|
|
84
|
+
var _iterator2 = _createForOfIteratorHelper(raw.matchAll(re)),
|
|
85
|
+
_step2;
|
|
86
|
+
try {
|
|
87
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
88
|
+
var m = _step2.value;
|
|
89
|
+
var index = m.index;
|
|
90
|
+
if (index > lastIdx) {
|
|
91
|
+
visit({
|
|
92
|
+
type: 'text',
|
|
93
|
+
text: raw.slice(lastIdx, index)
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
visit({
|
|
97
|
+
type: 'marker',
|
|
98
|
+
id: m[1]
|
|
99
|
+
});
|
|
100
|
+
lastIdx = index + m[0].length;
|
|
101
|
+
}
|
|
102
|
+
} catch (err) {
|
|
103
|
+
_iterator2.e(err);
|
|
104
|
+
} finally {
|
|
105
|
+
_iterator2.f();
|
|
106
|
+
}
|
|
107
|
+
if (lastIdx < raw.length) {
|
|
108
|
+
visit({
|
|
109
|
+
type: 'text',
|
|
110
|
+
text: raw.slice(lastIdx)
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
74
115
|
/* ────────────────────────────────────────────────────────────────────
|
|
75
116
|
* getPlainText · 从 DOM 提取 marker 化的字符串
|
|
76
117
|
* ──────────────────────────────────────────────────────────────────── */
|
|
@@ -101,7 +142,7 @@ export function getPlainText(editor) {
|
|
|
101
142
|
}
|
|
102
143
|
if (node.nodeType === Node.TEXT_NODE) {
|
|
103
144
|
var _node$textContent;
|
|
104
|
-
out += ((_node$textContent = node.textContent) !== null && _node$textContent !== void 0 ? _node$textContent : '')
|
|
145
|
+
out += stripInvisibleChars((_node$textContent = node.textContent) !== null && _node$textContent !== void 0 ? _node$textContent : '');
|
|
105
146
|
return;
|
|
106
147
|
}
|
|
107
148
|
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
@@ -134,7 +175,7 @@ export function isEditorEmpty(editor) {
|
|
|
134
175
|
var _editor$textContent;
|
|
135
176
|
var chipIdAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'mentionId';
|
|
136
177
|
if (editor.querySelector("[data-".concat(kebab(chipIdAttr), "]"))) return false;
|
|
137
|
-
var text = ((_editor$textContent = editor.textContent) !== null && _editor$textContent !== void 0 ? _editor$textContent : '')
|
|
178
|
+
var text = stripInvisibleChars((_editor$textContent = editor.textContent) !== null && _editor$textContent !== void 0 ? _editor$textContent : '');
|
|
138
179
|
// 仅过滤换行符(contenteditable 默认 <br> 单独存在时 textContent 是 '\n',视觉仍为空)
|
|
139
180
|
return text.replace(/\n/g, '') === '';
|
|
140
181
|
}
|
package/dist/fab/index.js
CHANGED
|
@@ -7,7 +7,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import React, { useState, useEffect, useRef } from 'react';
|
|
8
8
|
import { MeshGradient } from '@paper-design/shaders-react';
|
|
9
9
|
import "./style";
|
|
10
|
-
var BRAND_ICON_PATHS = ['M37.4911 121.803C38.7808 118.657 42.6771 117.561 45.6776 119.159C46.4424 119.566 47.2191 119.953 48.0073 120.32C50.7196 121.583 52.1802 124.712 51.0454 127.48C49.9576 130.134 46.9172 131.395 44.2708 130.289L40.3265 128.642C37.6621 127.529 36.3957 124.474 37.4911 121.803Z', 'M99.5065 121.794C100.608 124.469 99.3411 127.532 96.6715 128.647L92.7363 130.29C90.0906 131.395 87.0509 130.136 85.9612 127.484C84.8231 124.714 86.2839 121.582 88.9978 120.316C89.7828 119.95 90.5564 119.563 91.3181 119.157C94.3174 117.558 98.2123 118.651 99.5065 121.794Z', 'M19.2739 104.82C22.2702 101.797 27.3851 102.607 30.001 105.964C32.1488 108.721 32.21 112.711 29.7514 115.194C27.2761 117.695 23.2367 117.697 20.7586 115.199L19.276 113.704C16.8365 111.245 16.8356 107.28 19.2739 104.82Z', 'M117.721 104.818C120.162 107.279 120.163 111.248 117.723 113.71L116.25 115.196C113.772 117.696 109.731 117.697 107.253 115.198C104.787 112.713 104.843 108.721 106.994 105.959C109.61 102.6 114.722 101.795 117.721 104.818Z', 'M11.3154 81.5483C15.3671 79.8562 19.9061 82.799 20.9247 87.07C21.7135 90.3776 20.191 93.8468 17.0542 95.1594L14.8843 96.0674C11.1043 97.6492 6.75913 95.8518 5.20113 92.0619C3.65613 88.3037 5.43683 84.0033 9.18643 82.4374L11.3154 81.5483Z', 'M127.821 82.4366C131.568 84.0034 133.347 88.3007 131.805 92.0578C130.249 95.8498 125.903 97.6501 122.122 96.0696L119.941 95.1583C116.802 93.8465 115.278 90.3755 116.07 87.0669C117.092 82.7945 121.637 79.8506 125.69 81.5455L127.821 82.4366Z', 'M129.602 58.2774C133.688 58.2774 137 61.5896 137 65.6753C137 69.761 133.688 73.0731 129.602 73.0731H123.403C120.02 73.0731 117.267 70.3183 116.689 66.9847C115.934 62.6302 119.041 58.2774 123.46 58.2774H129.602Z', 'M13.5398 58.2774C17.9593 58.2774 21.0663 62.6302 20.3112 66.9847C19.7332 70.3183 16.98 73.0731 13.5966 73.0731H7.39786C3.31213 73.0731 0 69.761 0 65.6753C0 61.5896 3.31214 58.2774 7.39786 58.2774H13.5398Z', 'M131.807 39.29C133.353 43.0529 131.569 47.3578 127.815 48.9247L118.711 52.7244C115.543 54.0469 111.92 52.5582 110.127 49.6298C107.845 45.9014 109.032 40.7313 113.066 39.0492L122.121 35.2743C125.904 33.6969 130.249 35.4982 131.807 39.29Z', 'M23.9305 39.0492C27.9628 40.7315 29.147 45.8984 26.8641 49.6237C25.0708 52.5502 21.4485 54.0379 18.281 52.716L9.19401 48.9239C5.44023 47.3575 3.65664 43.0531 5.20226 39.2907C6.76 35.4988 11.1054 33.6981 14.8887 35.2766L23.9305 39.0492Z', 'M39.5076 25.9808C42.4931 28.9902 41.719 34.045 38.3912 36.6709C35.6086 38.8665 31.5638 38.915 29.0675 36.3987L20.0223 27.2814C17.17 24.4063 17.17 19.769 20.0223 16.8939C22.9068 13.9863 27.6081 13.9863 30.4926 16.8939L39.5076 25.9808Z', 'M116.976 16.892C119.829 19.7677 119.828 24.4064 116.973 27.2807L107.92 36.3963C105.425 38.9092 101.384 38.8605 98.6025 36.6683C95.2734 34.0444 94.4989 28.99 97.4851 25.9814L106.508 16.8907C109.392 13.9847 114.092 13.9853 116.976 16.892Z', 'M58.9142 18.1863C60.4617 21.9498 58.0298 26.1793 54.1812 27.5009C50.6835 28.7019 46.7164 27.2251 45.3119 23.804L39.706 10.1492C38.1699 6.40742 39.9438 2.12743 43.6765 0.569414C47.4388 -1.00092 51.7606 0.788889 53.311 4.55942L58.9142 18.1863Z', 'M92.9927 0.57847C96.7231 2.13658 98.494 6.41548 96.9559 10.1541L91.3334 23.8209C89.9291 27.2342 85.9703 28.7077 82.4782 27.5127C78.6324 26.1967 76.2033 21.9728 77.7497 18.2137L83.3655 4.56307C84.9153 0.795926 89.2339 -0.991508 92.9927 0.57847Z', 'M62 128.222C62 124.632 64.9101 121.722 68.5 121.722C72.0899 121.722 75 124.632 75 128.222C75 131.812 72.0899 134.722 68.5 134.722C64.9101 134.722 62 131.812 62 128.222Z'];
|
|
11
10
|
var COLOR_TRANSITION_MS = 600;
|
|
12
11
|
var hexToRgb = function hexToRgb(hex) {
|
|
13
12
|
var m = hex.replace('#', '');
|
|
@@ -52,9 +51,9 @@ var Fab = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
52
51
|
className = _ref3.className,
|
|
53
52
|
style = _ref3.style,
|
|
54
53
|
_ref3$colors = _ref3.colors,
|
|
55
|
-
colors = _ref3$colors === void 0 ? ['#
|
|
54
|
+
colors = _ref3$colors === void 0 ? ['#3284FF', '#1894FF', '#2A6BEF'] : _ref3$colors,
|
|
56
55
|
_ref3$hoverColors = _ref3.hoverColors,
|
|
57
|
-
hoverColors = _ref3$hoverColors === void 0 ? ['#
|
|
56
|
+
hoverColors = _ref3$hoverColors === void 0 ? ['#2089FE', '#3276FF', '#47B4FF'] : _ref3$hoverColors,
|
|
58
57
|
_ref3$bgOpacity = _ref3.bgOpacity,
|
|
59
58
|
bgOpacity = _ref3$bgOpacity === void 0 ? 1 : _ref3$bgOpacity,
|
|
60
59
|
_ref3$hoverBgOpacity = _ref3.hoverBgOpacity,
|
|
@@ -140,19 +139,7 @@ var Fab = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
140
139
|
}), /*#__PURE__*/React.createElement("div", {
|
|
141
140
|
className: "odn-fab-glow",
|
|
142
141
|
"aria-hidden": "true"
|
|
143
|
-
}), icon
|
|
144
|
-
width: "22",
|
|
145
|
-
height: "22",
|
|
146
|
-
viewBox: "0 0 137 135",
|
|
147
|
-
fill: "none",
|
|
148
|
-
className: "odn-fab-icon"
|
|
149
|
-
}, BRAND_ICON_PATHS.map(function (d, i) {
|
|
150
|
-
return /*#__PURE__*/React.createElement("path", {
|
|
151
|
-
key: i,
|
|
152
|
-
d: d,
|
|
153
|
-
fill: "currentColor"
|
|
154
|
-
});
|
|
155
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
142
|
+
}), icon, /*#__PURE__*/React.createElement("span", {
|
|
156
143
|
className: "odn-fab-label"
|
|
157
144
|
}, label));
|
|
158
145
|
});
|
package/dist/fab/style/index.css
CHANGED
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: center;
|
|
7
7
|
gap: 8px;
|
|
8
|
-
width: 172px;
|
|
9
|
-
height: 64px;
|
|
10
8
|
padding: 16px;
|
|
11
9
|
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
12
|
-
border-radius:
|
|
10
|
+
border-radius: 16px;
|
|
13
11
|
cursor: pointer;
|
|
14
12
|
user-select: none;
|
|
15
13
|
background: none;
|
package/dist/icon/svg-data.d.ts
CHANGED
|
@@ -194,6 +194,10 @@ export declare const svgData: {
|
|
|
194
194
|
readonly 'down-filled': "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.24074 11.1142C7.63984 11.5798 8.36016 11.5798 8.75926 11.1142L12.585 6.65079C13.141 6.00212 12.6801 5 11.8258 5H4.17422C3.31987 5 2.85896 6.00212 3.41496 6.65079L7.24074 11.1142Z\" fill=\"currentColor\"/>";
|
|
195
195
|
readonly download: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M14 12.5V5C14 4.44772 13.5523 4 13 4H9.09248C8.79409 4 8.50555 3.89326 8.27899 3.69907L7.02051 2.62037C6.92989 2.5427 6.81447 2.5 6.69511 2.5H3C2.44772 2.5 2 2.94772 2 3.5V12.5C2 13.0523 2.44772 13.5 3 13.5H13C13.5523 13.5 14 13.0523 14 12.5ZM3 1.5C1.89543 1.5 1 2.39543 1 3.5V12.5C1 13.6046 1.89543 14.5 3 14.5H13C14.1046 14.5 15 13.6046 15 12.5V5C15 3.89543 14.1046 3 13 3H9.09248C9.0328 3 8.97509 2.97865 8.92978 2.93981L7.6713 1.86112C7.39944 1.62809 7.05318 1.5 6.69511 1.5H3ZM8.58504 10.4141V5.25C8.58504 5.11193 8.47311 5 8.33504 5H7.66504C7.52697 5 7.41504 5.11193 7.41504 5.25V10.4186L5.17401 8.17759C5.07638 8.07996 4.91809 8.07996 4.82046 8.17759L4.3467 8.65135C4.24907 8.74898 4.24907 8.90727 4.3467 9.0049L7.82099 12.4792C7.91862 12.5768 8.07691 12.5768 8.17454 12.4792L11.6488 9.0049C11.7465 8.90727 11.7465 8.74898 11.6488 8.65135L11.1751 8.17759C11.0774 8.07996 10.9191 8.07996 10.8215 8.17759L8.58504 10.4141Z\" fill=\"currentColor\"/>";
|
|
196
196
|
readonly 'download-1': "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8.2505 1.5249C8.38857 1.5249 8.5005 1.63683 8.5005 1.7749L8.5005 10.2587L12.114 6.64526C12.2116 6.54763 12.3699 6.54763 12.4675 6.64526L12.7739 6.95167C12.8716 7.0493 12.8716 7.20759 12.7739 7.30522L8.17776 11.9014C8.08012 11.999 7.92183 11.999 7.8242 11.9014L3.22801 7.30522C3.13038 7.20759 3.13038 7.0493 3.22801 6.95167L3.53442 6.64526C3.63205 6.54763 3.79034 6.54763 3.88797 6.64526L7.5005 10.2578L7.5005 1.7749C7.5005 1.63683 7.61243 1.5249 7.7505 1.5249H8.2505ZM1.5 14.2246C1.5 14.3627 1.61193 14.4746 1.75 14.4746L14.25 14.4746C14.3881 14.4746 14.5 14.3627 14.5 14.2246V10.7246C14.5 10.5865 14.3881 10.4746 14.25 10.4746H12.5C12.3619 10.4746 12.25 10.5865 12.25 10.7246V11.2246C12.25 11.3627 12.3619 11.4746 12.5 11.4746H13.5V13.4746L2.5 13.4746L2.5 11.4746H3.5C3.63807 11.4746 3.75 11.3627 3.75 11.2246V10.7246C3.75 10.5865 3.63807 10.4746 3.5 10.4746H1.75C1.61193 10.4746 1.5 10.5865 1.5 10.7246V14.2246Z\" fill=\"currentColor\"/>";
|
|
197
|
+
readonly 'download-2': {
|
|
198
|
+
readonly viewBox: "0 0 24 24";
|
|
199
|
+
readonly content: "<g fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"> <path d=\"M12 15V3\" /> <path d=\"m7 10 5 5 5-5\" /> <path d=\"M5 21h14\" /> </g>";
|
|
200
|
+
};
|
|
197
201
|
readonly 'download-filled': "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3 1.5C1.89543 1.5 1 2.39543 1 3.5V12.5C1 13.6046 1.89543 14.5 3 14.5H13C14.1046 14.5 15 13.6046 15 12.5V5C15 3.89543 14.1046 3 13 3H9.09248C9.0328 3 8.97509 2.97865 8.92978 2.93981L7.6713 1.86112C7.39944 1.62809 7.05318 1.5 6.69511 1.5H3ZM7.24996 5.25V9.90163L5.2374 7.88907C5.13977 7.79143 4.98148 7.79143 4.88385 7.88907L4.17674 8.59617C4.07911 8.6938 4.07911 8.85209 4.17674 8.94973L7.7677 12.5407C7.86533 12.6383 8.02362 12.6383 8.12125 12.5407L11.7122 8.94973C11.8098 8.85209 11.8098 8.6938 11.7122 8.59617L11.0051 7.88907C10.9075 7.79143 10.7492 7.79143 10.6516 7.88907L8.74996 9.79066V5.25C8.74996 5.11193 8.63803 5 8.49996 5H7.49996C7.36189 5 7.24996 5.11193 7.24996 5.25Z\" fill=\"currentColor\"/>";
|
|
198
202
|
readonly draggable: "<path d=\"M10.2221 11.5551C10.9585 11.5551 11.5554 12.1521 11.5554 12.8885C11.5554 13.6248 10.9585 14.2218 10.2221 14.2218C9.48573 14.2218 8.88878 13.6248 8.88878 12.8885C8.88878 12.1521 9.48573 11.5551 10.2221 11.5551Z\" fill=\"currentColor\"/><path d=\"M10.2221 1.77734C10.9585 1.77734 11.5554 2.3743 11.5554 3.11068C11.5554 3.84706 10.9585 4.44401 10.2221 4.44401C9.48573 4.44401 8.88878 3.84706 8.88878 3.11068C8.88878 2.3743 9.48573 1.77734 10.2221 1.77734Z\" fill=\"currentColor\"/><path d=\"M11.5554 7.99957C11.5554 7.26319 10.9585 6.66623 10.2221 6.66623C9.48573 6.66623 8.88878 7.26319 8.88878 7.99957C8.88878 8.73595 9.48573 9.3329 10.2221 9.3329C10.9585 9.3329 11.5554 8.73595 11.5554 7.99957Z\" fill=\"currentColor\"/><path d=\"M5.77767 4.44401C5.04129 4.44401 4.44434 3.84706 4.44434 3.11068C4.44434 2.3743 5.04129 1.77734 5.77767 1.77734C6.51405 1.77734 7.111 2.3743 7.111 3.11068C7.111 3.84706 6.51405 4.44401 5.77767 4.44401Z\" fill=\"currentColor\"/><path d=\"M4.44434 12.8885C4.44434 13.6248 5.04129 14.2218 5.77767 14.2218C6.51405 14.2218 7.111 13.6248 7.111 12.8885C7.111 12.1521 6.51405 11.5551 5.77767 11.5551C5.04129 11.5551 4.44434 12.1521 4.44434 12.8885Z\" fill=\"currentColor\"/><path d=\"M5.77767 9.3329C5.04129 9.3329 4.44434 8.73595 4.44434 7.99957C4.44434 7.26319 5.04129 6.66623 5.77767 6.66623C6.51405 6.66623 7.111 7.26319 7.111 7.99957C7.111 8.73595 6.51405 9.3329 5.77767 9.3329Z\" fill=\"currentColor\"/><path d=\"M10.2221 11.5551C10.9585 11.5551 11.5554 12.1521 11.5554 12.8885C11.5554 13.6248 10.9585 14.2218 10.2221 14.2218C9.48573 14.2218 8.88878 13.6248 8.88878 12.8885C8.88878 12.1521 9.48573 11.5551 10.2221 11.5551Z\" fill=\"currentColor\"/><path d=\"M10.2221 1.77734C10.9585 1.77734 11.5554 2.3743 11.5554 3.11068C11.5554 3.84706 10.9585 4.44401 10.2221 4.44401C9.48573 4.44401 8.88878 3.84706 8.88878 3.11068C8.88878 2.3743 9.48573 1.77734 10.2221 1.77734Z\" fill=\"currentColor\"/><path d=\"M11.5554 7.99957C11.5554 7.26319 10.9585 6.66623 10.2221 6.66623C9.48573 6.66623 8.88878 7.26319 8.88878 7.99957C8.88878 8.73595 9.48573 9.3329 10.2221 9.3329C10.9585 9.3329 11.5554 8.73595 11.5554 7.99957Z\" fill=\"currentColor\"/><path d=\"M5.77767 4.44401C5.04129 4.44401 4.44434 3.84706 4.44434 3.11068C4.44434 2.3743 5.04129 1.77734 5.77767 1.77734C6.51405 1.77734 7.111 2.3743 7.111 3.11068C7.111 3.84706 6.51405 4.44401 5.77767 4.44401Z\" fill=\"currentColor\"/><path d=\"M4.44434 12.8885C4.44434 13.6248 5.04129 14.2218 5.77767 14.2218C6.51405 14.2218 7.111 13.6248 7.111 12.8885C7.111 12.1521 6.51405 11.5551 5.77767 11.5551C5.04129 11.5551 4.44434 12.1521 4.44434 12.8885Z\" fill=\"currentColor\"/><path d=\"M5.77767 9.3329C5.04129 9.3329 4.44434 8.73595 4.44434 7.99957C4.44434 7.26319 5.04129 6.66623 5.77767 6.66623C6.51405 6.66623 7.111 7.26319 7.111 7.99957C7.111 8.73595 6.51405 9.3329 5.77767 9.3329Z\" fill=\"currentColor\"/>";
|
|
199
203
|
readonly edit: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13 14V6.5C13 6.22386 13.2239 6 13.5 6C13.7761 6 14 6.22386 14 6.5V14C14 14.5523 13.5523 15 13 15H2C1.44772 15 1 14.5523 1 14V2C1 1.44772 1.44772 1 2 1H8.5C8.77614 1 9 1.22386 9 1.5C9 1.77614 8.77614 2 8.5 2H2V14H13ZM14.1317 1.35353C14.327 1.5488 14.327 1.86538 14.1317 2.06064L7.06066 9.13171C6.8654 9.32697 6.54882 9.32697 6.35355 9.13171C6.15829 8.93645 6.15829 8.61986 6.35355 8.4246L13.4246 1.35353C13.6199 1.15827 13.9365 1.15827 14.1317 1.35353Z\" fill=\"currentColor\"/>";
|