@ynput/ayon-frontend-shared 0.7.3 → 0.7.4
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/LICENSE +105 -0
- package/dist/DetailsPanel.es.js +1088 -969
- package/dist/ListTable.es.js +70 -67
- package/dist/NewEntity.es.js +8 -5
- package/dist/ProjectTreeTable.es.js +4134 -3825
- package/dist/ProjectsTable.es.js +526 -0
- package/dist/Slicer.es.js +75 -73
- package/dist/Views.es.js +86 -84
- package/dist/chunks/Actions.es.js +4 -2
- package/dist/chunks/ColumnDropIndicator.es.js +21 -18
- package/dist/chunks/ColumnDropIndicator.styled.es.js +14 -13
- package/dist/chunks/ColumnHeaderMenuUI.es.js +9 -7
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +12 -11
- package/dist/chunks/EmptyPlaceholder.es.js +9 -8
- package/dist/chunks/EntityPath.es.js +15 -14
- package/dist/chunks/EntityPickerDialog.es.js +5 -3
- package/dist/chunks/EntityTooltip.es.js +10 -8
- package/dist/chunks/EntityUpdatesContext.es.js +13 -12
- package/dist/chunks/Feed.es.js +12 -11
- package/dist/chunks/FilterErrorActions.es.js +6 -4
- package/dist/chunks/GroupSettingsFallback.es.js +75 -0
- package/dist/chunks/JsonViewer.es.js +3 -2
- package/dist/chunks/Menu.es.js +105 -103
- package/dist/chunks/MetaWidget.es.js +278 -275
- package/dist/chunks/PlayableIcon.es.js +868 -862
- package/dist/chunks/ProjectContext.es.js +5 -4
- package/dist/chunks/RepresentationsList.es.js +3 -2
- package/dist/chunks/ReviewablesSelector.es.js +3471 -2067
- package/dist/chunks/SimpleTable.es.js +492 -402
- package/dist/chunks/Slicer.es.js +936 -896
- package/dist/chunks/TableExportContextInstance.es.js +437 -339
- package/dist/chunks/TableSettingsFallback.es.js +5 -3
- package/dist/chunks/ThumbnailSimple.es.js +15 -13
- package/dist/chunks/VideoPlayer.es.js +14 -12
- package/dist/chunks/Watchers.es.js +97 -95
- package/dist/chunks/getProjectDisplayName.es.js +4 -0
- package/dist/chunks/getUris.es.js +375 -374
- package/dist/chunks/useHierarchySelection.es.js +5 -3
- package/dist/chunks/useLoadModule.es.js +10 -8
- package/dist/chunks/viewUpdateHelper.es.js +12 -10
- package/dist/components.es.js +1488 -1186
- package/dist/context.es.js +589 -539
- package/dist/hooks.es.js +169 -212
- package/dist/index.es.js +17 -12
- package/dist/types/Actions.d.ts +17 -14
- package/dist/types/ContextMenu.d.ts +17 -14
- package/dist/types/DetailsPanel.d.ts +17 -14
- package/dist/types/EntityPickerDialog.d.ts +17 -14
- package/dist/types/Feed.d.ts +17 -14
- package/dist/types/ListTable.d.ts +17 -14
- package/dist/types/NewEntity.d.ts +17 -14
- package/dist/types/ProjectTreeTable.d.ts +749 -15
- package/dist/types/ProjectsTable.d.ts +228 -0
- package/dist/types/RepresentationsList.d.ts +17 -14
- package/dist/types/SimpleTable.d.ts +31 -14
- package/dist/types/Slicer.d.ts +18 -14
- package/dist/types/Views.d.ts +17 -14
- package/dist/types/api.d.ts +17 -14
- package/dist/types/components.d.ts +822 -25
- package/dist/types/context.d.ts +53 -15
- package/dist/types/hooks.d.ts +17 -14
- package/dist/types/index.d.ts +17 -14
- package/dist/types/util.d.ts +21 -14
- package/dist/util.es.js +152 -144
- package/package.json +15 -7
- /package/dist/{ContextMenuContextInstance.css → style.css} +0 -0
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { format as Bn, isValid as Ie, isSameMinute as Yt, isBefore as zn, formatDistanceToNow as Fn, subYears as Kn, endOfYear as kt, startOfYear as wt, subMonths as Un, endOfMonth as Ue, startOfMonth as He, addMonths as Hn, subWeeks as jn, endOfWeek as je, startOfWeek as Ge, addWeeks as Gn, setHours as _t, subDays as Wn, endOfDay as Et, startOfDay as Ct, parseISO as B, isSameDay as K } from "date-fns";
|
|
2
2
|
import { matchSorter as Yn } from "match-sorter";
|
|
3
|
-
import {
|
|
3
|
+
import { bc as qn, bF as Qn } from "./searchTerms.es.js";
|
|
4
|
+
import { isArray as Vn } from "lodash";
|
|
4
5
|
import "primereact/confirmdialog";
|
|
5
6
|
import "react-toastify";
|
|
6
7
|
import { g as it } from "./getEntityTypeIcon.es.js";
|
|
7
8
|
import "uuid";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
9
|
+
import qt, { useRef as O, useState as U, useLayoutEffect as oe, useCallback as H, useMemo as _e, useEffect as R, Fragment as Jn, useImperativeHandle as Xn, forwardRef as Qt, useContext as Zn } from "react";
|
|
10
|
+
import "axios";
|
|
10
11
|
import { jsx as l, jsxs as S, Fragment as me } from "react/jsx-runtime";
|
|
11
12
|
import P from "clsx";
|
|
12
|
-
import
|
|
13
|
-
import { UserImage as Tt, Icon as J, Button as te, Dropdown as
|
|
14
|
-
import { TextNode as st, $applyNodeReplacement as at, createCommand as ge, LineBreakNode as
|
|
15
|
-
import { LexicalExtensionComposer as
|
|
13
|
+
import w, { css as Ee } from "styled-components";
|
|
14
|
+
import { UserImage as Tt, Icon as J, Button as te, Dropdown as eo, InputText as to, getTextColor as no, theme as Oe } from "@ynput/ayon-react-components";
|
|
15
|
+
import { TextNode as st, $applyNodeReplacement as at, createCommand as ge, LineBreakNode as oo, $isLineBreakNode as Vt, $createTextNode as Ce, $getEditor as ro, $getRoot as ie, $createParagraphNode as he, $getSelection as M, $isParagraphNode as Y, $isTextNode as X, $isRangeSelection as $, COMMAND_PRIORITY_EDITOR as Jt, COMMAND_PRIORITY_NORMAL as Z, $isRootOrShadowRoot as io, SELECTION_CHANGE_COMMAND as lt, COMMAND_PRIORITY_CRITICAL as Qe, BLUR_COMMAND as ct, COMMAND_PRIORITY_LOW as D, FORMAT_TEXT_COMMAND as dt, KEY_DOWN_COMMAND as Xt, KEY_ARROW_RIGHT_COMMAND as Zt, KEY_ARROW_LEFT_COMMAND as so, KEY_ARROW_DOWN_COMMAND as ao, KEY_ENTER_COMMAND as Ve, COMMAND_PRIORITY_HIGH as lo, INSERT_PARAGRAPH_COMMAND as en, KEY_ESCAPE_COMMAND as tn, COMMAND_PRIORITY_BEFORE_EDITOR as co, $isRootNode as ut, $getNearestNodeFromDOMNode as nn, PASTE_COMMAND as mt, $setSelection as We, $getNodeByKey as se, KEY_TAB_COMMAND as uo, COPY_COMMAND as mo, CUT_COMMAND as po, CLEAR_HISTORY_COMMAND as go, defineExtension as ho } from "lexical";
|
|
16
|
+
import { LexicalExtensionComposer as fo } from "@lexical/react/LexicalExtensionComposer";
|
|
16
17
|
import { useLexicalComposerContext as A } from "@lexical/react/LexicalComposerContext";
|
|
17
|
-
import { ContentEditable as
|
|
18
|
-
import { HistoryPlugin as
|
|
19
|
-
import { ListPlugin as
|
|
20
|
-
import { CheckListPlugin as
|
|
21
|
-
import { LinkPlugin as
|
|
22
|
-
import { createLinkMatcherWithRegExp as Lt, AutoLinkPlugin as
|
|
23
|
-
import { MarkdownShortcutPlugin as
|
|
24
|
-
import { TabIndentationPlugin as
|
|
25
|
-
import { AutoFocusPlugin as
|
|
26
|
-
import { $isHeadingNode as
|
|
27
|
-
import { $isListNode as sn, ListNode as an, REMOVE_LIST_COMMAND as
|
|
28
|
-
import { $isLinkNode as ne, $isAutoLinkNode as Je, $createLinkNode as cn, TOGGLE_LINK_COMMAND as
|
|
29
|
-
import { $isCodeNode as ee, $createCodeNode as Mt, CodeNode as
|
|
18
|
+
import { ContentEditable as bo } from "@lexical/react/LexicalContentEditable";
|
|
19
|
+
import { HistoryPlugin as yo } from "@lexical/react/LexicalHistoryPlugin";
|
|
20
|
+
import { ListPlugin as vo } from "@lexical/react/LexicalListPlugin";
|
|
21
|
+
import { CheckListPlugin as xo } from "@lexical/react/LexicalCheckListPlugin";
|
|
22
|
+
import { LinkPlugin as ko } from "@lexical/react/LexicalLinkPlugin";
|
|
23
|
+
import { createLinkMatcherWithRegExp as Lt, AutoLinkPlugin as wo } from "@lexical/react/LexicalAutoLinkPlugin";
|
|
24
|
+
import { MarkdownShortcutPlugin as _o } from "@lexical/react/LexicalMarkdownShortcutPlugin";
|
|
25
|
+
import { TabIndentationPlugin as Eo } from "@lexical/react/LexicalTabIndentationPlugin";
|
|
26
|
+
import { AutoFocusPlugin as Co } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
27
|
+
import { $isHeadingNode as To, $isQuoteNode as on, $createHeadingNode as Lo, $createQuoteNode as Mo, DRAG_DROP_PASTE as rn, RichTextExtension as $o, HeadingNode as No, QuoteNode as So } from "@lexical/rich-text";
|
|
28
|
+
import { $isListNode as sn, ListNode as an, REMOVE_LIST_COMMAND as Oo, INSERT_CHECK_LIST_COMMAND as Ro, INSERT_ORDERED_LIST_COMMAND as Io, INSERT_UNORDERED_LIST_COMMAND as Ao, $isListItemNode as ln, $createListNode as Do, ListItemNode as Po } from "@lexical/list";
|
|
29
|
+
import { $isLinkNode as ne, $isAutoLinkNode as Je, $createLinkNode as cn, TOGGLE_LINK_COMMAND as Bo, LinkNode as dn, AutoLinkNode as un } from "@lexical/link";
|
|
30
|
+
import { $isCodeNode as ee, $createCodeNode as Mt, CodeNode as zo, CodeHighlightNode as Fo } from "@lexical/code";
|
|
30
31
|
import mn from "prismjs";
|
|
31
32
|
import "prismjs/components/prism-clike";
|
|
32
33
|
import "prismjs/components/prism-c";
|
|
@@ -54,23 +55,24 @@ import "prismjs/components/prism-markdown";
|
|
|
54
55
|
import "prismjs/components/prism-powershell";
|
|
55
56
|
import { BlockWithAlignableContents as pn } from "@lexical/react/LexicalBlockWithAlignableContents";
|
|
56
57
|
import { DecoratorBlockNode as gn } from "@lexical/react/LexicalDecoratorBlockNode";
|
|
57
|
-
import { HEADING as
|
|
58
|
-
import
|
|
58
|
+
import { HEADING as Ko, QUOTE as Uo, CHECK_LIST as Ho, UNORDERED_LIST as jo, ORDERED_LIST as Go, CODE as Wo, INLINE_CODE as Yo, BOLD_ITALIC_STAR as qo, BOLD_ITALIC_UNDERSCORE as Qo, BOLD_STAR as Vo, BOLD_UNDERSCORE as Jo, ITALIC_STAR as Xo, ITALIC_UNDERSCORE as Zo, STRIKETHROUGH as er, LINK as tr, $generateNodesFromMarkdownString as nr, $convertToMarkdownString as or, $convertSelectionToMarkdownString as rr } from "@lexical/markdown";
|
|
59
|
+
import ir from "emojilib/emojis.json";
|
|
59
60
|
import $t from "emojilib/ordered.json";
|
|
60
61
|
import { LexicalTypeaheadMenuPlugin as pt, MenuOption as gt } from "@lexical/react/LexicalTypeaheadMenuPlugin";
|
|
61
|
-
import { $findMatchingParent as W, mergeRegister as q, $getNearestNodeOfType as
|
|
62
|
+
import { $findMatchingParent as W, mergeRegister as q, $getNearestNodeOfType as sr, $unwrapNode as ar } from "@lexical/utils";
|
|
62
63
|
import { createPortal as fe } from "react-dom";
|
|
63
|
-
import { bj as
|
|
64
|
+
import { bj as lr } from "./getUris.es.js";
|
|
64
65
|
import "@module-federation/enhanced/runtime";
|
|
65
|
-
import
|
|
66
|
+
import "@ynput/ayon-addon/host";
|
|
67
|
+
import { d as cr, L as dr } from "./TableExportContextInstance.es.js";
|
|
66
68
|
import "semver";
|
|
67
69
|
import "./ContextMenuContextInstance.es.js";
|
|
68
70
|
import "react-redux";
|
|
69
71
|
import "react-router-dom";
|
|
70
72
|
import { $setBlocksType as Me } from "@lexical/selection";
|
|
71
|
-
import { PrismTokenizer as
|
|
72
|
-
import { $getClipboardDataFromSelection as
|
|
73
|
-
const
|
|
73
|
+
import { PrismTokenizer as ur, registerCodeHighlighting as mr } from "@lexical/code-prism";
|
|
74
|
+
import { $getClipboardDataFromSelection as pr, copyToClipboard as gr } from "@lexical/clipboard";
|
|
75
|
+
const hr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */ l(
|
|
74
76
|
Tt,
|
|
75
77
|
{
|
|
76
78
|
name: t,
|
|
@@ -78,16 +80,16 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
|
|
|
78
80
|
src: `/api/users/${t}/avatar?key=${n || ""}`,
|
|
79
81
|
...o
|
|
80
82
|
}
|
|
81
|
-
) : /* @__PURE__ */ l(Tt, { name: "", className: P(o.className, "loading"), ...o }),
|
|
83
|
+
) : /* @__PURE__ */ l(Tt, { name: "", className: P(o.className, "loading"), ...o }), zl = (t, e) => {
|
|
82
84
|
const n = new Date(t.getTime() + t.getTimezoneOffset() * 6e4);
|
|
83
85
|
return Bn(n, e);
|
|
84
|
-
}, ae = "block-dialog-close",
|
|
86
|
+
}, ae = "block-dialog-close", fr = w.div`
|
|
85
87
|
position: fixed;
|
|
86
88
|
z-index: 310;
|
|
87
89
|
overflow: hidden;
|
|
88
90
|
display: flex;
|
|
89
91
|
flex-direction: column;
|
|
90
|
-
`,
|
|
92
|
+
`, Fl = ({
|
|
91
93
|
isEditing: t,
|
|
92
94
|
anchorId: e,
|
|
93
95
|
containerClassName: n = "table-container",
|
|
@@ -95,31 +97,31 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
|
|
|
95
97
|
children: r,
|
|
96
98
|
matchAnchorWidth: i
|
|
97
99
|
}) => {
|
|
98
|
-
const s = O(null), [a,
|
|
100
|
+
const s = O(null), [a, u] = U(null), [d, v] = U(void 0), [x, g] = U(void 0), h = document.getElementById(e), f = h?.closest(`.${n}`), c = () => {
|
|
99
101
|
if (!t) return;
|
|
100
|
-
if (!
|
|
101
|
-
|
|
102
|
+
if (!h || !f) {
|
|
103
|
+
u({
|
|
102
104
|
top: window.innerHeight / 2,
|
|
103
105
|
left: window.innerWidth / 2,
|
|
104
106
|
showAbove: !1
|
|
105
|
-
}),
|
|
107
|
+
}), v(void 0), g(void 0);
|
|
106
108
|
return;
|
|
107
109
|
}
|
|
108
|
-
const
|
|
110
|
+
const _ = h.getBoundingClientRect(), T = f.getBoundingClientRect(), E = T.right, p = window.innerWidth - T.right, y = 24, k = 250, C = 400, b = 600, L = window.innerWidth, I = window.innerHeight, F = E - _.left;
|
|
109
111
|
let N = {}, G = C;
|
|
110
|
-
i ? (N.left =
|
|
111
|
-
L -
|
|
112
|
-
|
|
113
|
-
) : (N.left =
|
|
112
|
+
i ? (N.left = _.left, G = Math.max(C, _.width)) : F < C ? _.right - y >= C ? N.right = Math.max(
|
|
113
|
+
L - _.right,
|
|
114
|
+
y + p
|
|
115
|
+
) : (N.left = y, G = L - 2 * y) : (N.left = _.left, G = Math.max(C, F));
|
|
114
116
|
const ce = T.left, xe = T.right;
|
|
115
117
|
if (N.left !== void 0 && (N.left + G > xe && (N.left = Math.max(ce, xe - G)), N.left = Math.max(ce, N.left)), N.right !== void 0) {
|
|
116
118
|
const Ke = L - xe;
|
|
117
119
|
N.right + G > L - ce && (N.right = Math.max(Ke, L - ce - G)), N.right = Math.max(Ke, N.right);
|
|
118
120
|
}
|
|
119
|
-
|
|
120
|
-
const ke = I -
|
|
121
|
+
v(G);
|
|
122
|
+
const ke = I - _.bottom - y, Te = _.top - y;
|
|
121
123
|
let we, Le = !1, Fe;
|
|
122
|
-
ke <
|
|
124
|
+
ke < k && Te > ke ? (Le = !0, we = _.top - 4, Fe = Te - 4) : (we = _.bottom + 4, Fe = ke - 4), g(Math.min(Math.max(200, Fe), b)), u({
|
|
123
125
|
top: we,
|
|
124
126
|
...N,
|
|
125
127
|
showAbove: Le
|
|
@@ -127,33 +129,33 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
|
|
|
127
129
|
};
|
|
128
130
|
oe(() => {
|
|
129
131
|
c();
|
|
130
|
-
}, [t,
|
|
131
|
-
if (
|
|
132
|
-
const
|
|
132
|
+
}, [t, h, i]), oe(() => {
|
|
133
|
+
if (f) {
|
|
134
|
+
const _ = new ResizeObserver(() => {
|
|
133
135
|
c();
|
|
134
136
|
});
|
|
135
|
-
return
|
|
137
|
+
return _.observe(f), () => _.disconnect();
|
|
136
138
|
}
|
|
137
|
-
}, [
|
|
138
|
-
const
|
|
139
|
+
}, [f, h]), oe(() => {
|
|
140
|
+
const _ = (T) => {
|
|
139
141
|
const E = T.target;
|
|
140
|
-
E.isConnected && s.current && !s.current.contains(E) &&
|
|
142
|
+
E.isConnected && s.current && !s.current.contains(E) && h && !h.contains(E) && // check we are not clicking inside the EntityPickerDialog
|
|
141
143
|
!E.closest(".entity-picker-dialog") && // check we are not clicking on the dialog backdrop
|
|
142
144
|
!E.querySelector(".entity-picker-dialog") && // check we are not clicking inside another dialog
|
|
143
145
|
!E.closest("dialog") && // check we are not clicking inside a dropdown
|
|
144
146
|
!E.closest(".dropdown") && !E.closest(".p-dialog-mask") && !E.closest(".p-datepicker") && !E.closest("." + ae) && (document.activeElement instanceof HTMLElement && document.activeElement.blur(), o?.());
|
|
145
147
|
};
|
|
146
|
-
return document.addEventListener("mousedown",
|
|
147
|
-
document.removeEventListener("mousedown",
|
|
148
|
+
return document.addEventListener("mousedown", _), () => {
|
|
149
|
+
document.removeEventListener("mousedown", _);
|
|
148
150
|
};
|
|
149
|
-
}, [o,
|
|
150
|
-
const
|
|
151
|
-
const T =
|
|
152
|
-
T.tagName === "INPUT" || T.tagName === "TEXTAREA" || T.isContentEditable ||
|
|
151
|
+
}, [o, h]);
|
|
152
|
+
const m = (_) => {
|
|
153
|
+
const T = _.target;
|
|
154
|
+
T.tagName === "INPUT" || T.tagName === "TEXTAREA" || T.isContentEditable || _.key === "Escape" && (_.stopPropagation(), o?.());
|
|
153
155
|
};
|
|
154
156
|
return t ? fe(
|
|
155
157
|
/* @__PURE__ */ l(
|
|
156
|
-
|
|
158
|
+
fr,
|
|
157
159
|
{
|
|
158
160
|
ref: s,
|
|
159
161
|
style: {
|
|
@@ -164,10 +166,10 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
|
|
|
164
166
|
visibility: a ? "visible" : "hidden",
|
|
165
167
|
...i && d ? { width: `${d}px` } : {},
|
|
166
168
|
maxWidth: d ? `${d}px` : "none",
|
|
167
|
-
maxHeight:
|
|
169
|
+
maxHeight: x ? `${x}px` : "none"
|
|
168
170
|
},
|
|
169
171
|
className: "links-widget-popup block-shortcuts",
|
|
170
|
-
onKeyDown:
|
|
172
|
+
onKeyDown: m,
|
|
171
173
|
children: r
|
|
172
174
|
}
|
|
173
175
|
),
|
|
@@ -201,14 +203,14 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
|
|
|
201
203
|
{ value: "vex", label: "VEX" },
|
|
202
204
|
{ value: "xml", label: "XML" },
|
|
203
205
|
{ value: "yaml", label: "YAML" }
|
|
204
|
-
],
|
|
206
|
+
], br = (t) => Re.find((e) => e.value === (t || ""))?.label || t || "", yr = (t) => {
|
|
205
207
|
if (!t) return;
|
|
206
208
|
const e = mn.languages[t.toLowerCase()];
|
|
207
209
|
return typeof e == "object" ? e : void 0;
|
|
208
|
-
},
|
|
209
|
-
const n =
|
|
210
|
+
}, vr = (t, e) => {
|
|
211
|
+
const n = yr(e);
|
|
210
212
|
return !n || !e ? null : mn.highlight(t, n, e.toLowerCase());
|
|
211
|
-
},
|
|
213
|
+
}, xr = [
|
|
212
214
|
"atrule",
|
|
213
215
|
"attr",
|
|
214
216
|
"attr-name",
|
|
@@ -241,9 +243,9 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
|
|
|
241
243
|
"tag",
|
|
242
244
|
"url",
|
|
243
245
|
"variable"
|
|
244
|
-
],
|
|
245
|
-
|
|
246
|
-
),
|
|
246
|
+
], kr = Object.fromEntries(
|
|
247
|
+
xr.map((t) => [t, `token ${t}`])
|
|
248
|
+
), wr = {
|
|
247
249
|
paragraph: "md-paragraph",
|
|
248
250
|
heading: {
|
|
249
251
|
h1: "md-heading md-h1",
|
|
@@ -259,7 +261,7 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
|
|
|
259
261
|
link: "md-link",
|
|
260
262
|
code: "md-code-block",
|
|
261
263
|
// prism token types -> `token <type>` classes, coloured by codeTokenStyles
|
|
262
|
-
codeHighlight:
|
|
264
|
+
codeHighlight: kr,
|
|
263
265
|
list: {
|
|
264
266
|
ul: "md-list md-list-ul",
|
|
265
267
|
ol: "md-list md-list-ol",
|
|
@@ -287,12 +289,12 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
|
|
|
287
289
|
"representation",
|
|
288
290
|
"workfile",
|
|
289
291
|
"product"
|
|
290
|
-
],
|
|
292
|
+
], _r = {
|
|
291
293
|
user: "@",
|
|
292
294
|
team: "@",
|
|
293
295
|
version: "@@",
|
|
294
296
|
task: "@@@"
|
|
295
|
-
},
|
|
297
|
+
}, Er = (t) => _r[t] ?? "@", Cr = [
|
|
296
298
|
"bold",
|
|
297
299
|
"italic",
|
|
298
300
|
"strikethrough",
|
|
@@ -303,7 +305,7 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
|
|
|
303
305
|
"numberList",
|
|
304
306
|
"bulletList",
|
|
305
307
|
"checkList"
|
|
306
|
-
],
|
|
308
|
+
], Kl = [
|
|
307
309
|
"h1",
|
|
308
310
|
"h2",
|
|
309
311
|
"h3",
|
|
@@ -318,7 +320,7 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
|
|
|
318
320
|
"|",
|
|
319
321
|
"numberList",
|
|
320
322
|
"bulletList"
|
|
321
|
-
],
|
|
323
|
+
], Tr = [
|
|
322
324
|
"bold",
|
|
323
325
|
"italic",
|
|
324
326
|
"strikethrough",
|
|
@@ -337,7 +339,7 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
|
|
|
337
339
|
} catch {
|
|
338
340
|
}
|
|
339
341
|
return { type: o, id: r };
|
|
340
|
-
},
|
|
342
|
+
}, Lr = (t) => {
|
|
341
343
|
const e = t.getAttribute("data-mention-value") || t.getAttribute("data-value") || t.getAttribute("href"), n = ft(e);
|
|
342
344
|
if (!n) return null;
|
|
343
345
|
const o = ue(
|
|
@@ -395,7 +397,7 @@ class be extends st {
|
|
|
395
397
|
static importDOM() {
|
|
396
398
|
const e = (o) => !!ft(
|
|
397
399
|
o.getAttribute("data-mention-value") || o.getAttribute("data-value") || o.getAttribute("href")
|
|
398
|
-
), n = (o) => e(o) ? { conversion:
|
|
400
|
+
), n = (o) => e(o) ? { conversion: Lr, priority: 2 } : null;
|
|
399
401
|
return {
|
|
400
402
|
a: n,
|
|
401
403
|
span: n,
|
|
@@ -414,9 +416,9 @@ class be extends st {
|
|
|
414
416
|
}
|
|
415
417
|
}
|
|
416
418
|
const De = (t, e, n) => {
|
|
417
|
-
const o = new be(t, e,
|
|
419
|
+
const o = new be(t, e, Er(t) + ue(n));
|
|
418
420
|
return o.setMode("token").toggleDirectionless(), at(o);
|
|
419
|
-
}, hn = (t) => t instanceof be,
|
|
421
|
+
}, hn = (t) => t instanceof be, Mr = /^[\w-]{11}$/, $r = (t) => {
|
|
420
422
|
if (!t) return;
|
|
421
423
|
if (/^\d+$/.test(t)) return Number(t);
|
|
422
424
|
const e = t.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);
|
|
@@ -441,10 +443,10 @@ const De = (t, e, n) => {
|
|
|
441
443
|
const [, i, s] = e.pathname.split("/");
|
|
442
444
|
["shorts", "embed", "live", "v"].includes(i) && (o = s);
|
|
443
445
|
}
|
|
444
|
-
if (!o || !
|
|
445
|
-
const r =
|
|
446
|
+
if (!o || !Mr.test(o)) return null;
|
|
447
|
+
const r = $r(e.searchParams.get("t") ?? e.searchParams.get("start"));
|
|
446
448
|
return r ? { id: o, start: r } : { id: o };
|
|
447
|
-
}, fn = ({ id: t, start: e }) => `https://www.youtube-nocookie.com/embed/${t}${e ? `?start=${e}` : ""}`,
|
|
449
|
+
}, fn = ({ id: t, start: e }) => `https://www.youtube-nocookie.com/embed/${t}${e ? `?start=${e}` : ""}`, Nr = w.div`
|
|
448
450
|
width: 100%;
|
|
449
451
|
max-width: 560px;
|
|
450
452
|
aspect-ratio: 16 / 9;
|
|
@@ -458,7 +460,7 @@ const De = (t, e, n) => {
|
|
|
458
460
|
height: 100%;
|
|
459
461
|
border: none;
|
|
460
462
|
}
|
|
461
|
-
`,
|
|
463
|
+
`, Sr = ({ video: t, className: e }) => /* @__PURE__ */ l(Nr, { className: e ? `youtube-embed ${e}` : "youtube-embed", children: /* @__PURE__ */ l(
|
|
462
464
|
"iframe",
|
|
463
465
|
{
|
|
464
466
|
src: fn(t),
|
|
@@ -518,26 +520,26 @@ class ye extends gn {
|
|
|
518
520
|
className: { base: r.base || "", focus: r.focus || "" },
|
|
519
521
|
format: this.__format,
|
|
520
522
|
nodeKey: this.getKey(),
|
|
521
|
-
children: o ? /* @__PURE__ */ l(
|
|
523
|
+
children: o ? /* @__PURE__ */ l(Sr, { video: o }) : /* @__PURE__ */ l("span", { children: this.__url })
|
|
522
524
|
}
|
|
523
525
|
);
|
|
524
526
|
}
|
|
525
527
|
}
|
|
526
|
-
const pe = (t) => at(new ye(t.trim())),
|
|
528
|
+
const pe = (t) => at(new ye(t.trim())), Or = (t) => t instanceof ye, bn = ["mp4", "mov", "webm", "mkv", "m4v", "ogv", "avi"], Rr = ["png", "jpg", "jpeg", "gif", "webp", "svg", "avif", "bmp"], yn = (t) => t?.split(/[?#]/)[0].split(".").pop()?.toLowerCase() || "", vn = (t, ...e) => t?.startsWith("video/") ? "video" : t?.startsWith("image/") ? "image" : e.some((n) => bn.includes(yn(n))) ? "video" : "image", Ir = (t) => t.type.startsWith("image/") || t.type.startsWith("video/") || [...Rr, ...bn].includes(yn(t.name)), Ar = /\/api\/projects\/[^/]+\/files\/([\w-]+)/, bt = (t) => t?.match(Ar)?.[1] ?? null, Dr = /^\s*!\[[^\]]*\]\(<?([^\s)>]+)>?(?:\s+"[^"]*")?\)\s*$/, Pr = /^\s*(```|~~~)/, Ul = (t) => {
|
|
527
529
|
const e = /* @__PURE__ */ new Set();
|
|
528
530
|
let n = !1;
|
|
529
531
|
for (const o of String(t || "").split(`
|
|
530
532
|
`)) {
|
|
531
|
-
if (
|
|
533
|
+
if (Pr.test(o)) {
|
|
532
534
|
n = !n;
|
|
533
535
|
continue;
|
|
534
536
|
}
|
|
535
537
|
if (n) continue;
|
|
536
|
-
const r = bt(o.match(
|
|
538
|
+
const r = bt(o.match(Dr)?.[1]);
|
|
537
539
|
r && e.add(r);
|
|
538
540
|
}
|
|
539
541
|
return e;
|
|
540
|
-
},
|
|
542
|
+
}, Br = w.div`
|
|
541
543
|
position: relative;
|
|
542
544
|
display: inline-flex;
|
|
543
545
|
max-width: 100%;
|
|
@@ -622,10 +624,10 @@ const pe = (t) => at(new ye(t.trim())), Sr = (t) => t instanceof ye, bn = ["mp4"
|
|
|
622
624
|
transform: rotate(360deg);
|
|
623
625
|
}
|
|
624
626
|
}
|
|
625
|
-
`,
|
|
627
|
+
`, zr = ({ src: t, alt: e, mime: n, uploading: o, onOpen: r, className: i }) => {
|
|
626
628
|
const s = vn(n, e, t), a = s === "video" && bt(t) ? `${t}/thumbnail` : void 0;
|
|
627
629
|
return /* @__PURE__ */ S(
|
|
628
|
-
|
|
630
|
+
Br,
|
|
629
631
|
{
|
|
630
632
|
className: P("md-media", `md-media-${s}`, i, { clickable: !!r }),
|
|
631
633
|
children: [
|
|
@@ -723,7 +725,7 @@ class ve extends gn {
|
|
|
723
725
|
format: this.__format,
|
|
724
726
|
nodeKey: this.getKey(),
|
|
725
727
|
children: /* @__PURE__ */ l(
|
|
726
|
-
|
|
728
|
+
zr,
|
|
727
729
|
{
|
|
728
730
|
src: this.__src,
|
|
729
731
|
alt: this.__alt,
|
|
@@ -735,13 +737,13 @@ class ve extends gn {
|
|
|
735
737
|
);
|
|
736
738
|
}
|
|
737
739
|
}
|
|
738
|
-
const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USED_COMMAND"), xn =
|
|
740
|
+
const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USED_COMMAND"), xn = ir, Fr = [
|
|
739
741
|
...$t,
|
|
740
742
|
...Object.keys(xn).filter((t) => !$t.includes(t))
|
|
741
|
-
], kn =
|
|
743
|
+
], kn = Fr.flatMap((t) => {
|
|
742
744
|
const e = xn[t];
|
|
743
745
|
return e?.char ? [{ name: t, char: e.char, keywords: e.keywords }] : [];
|
|
744
|
-
}),
|
|
746
|
+
}), Kr = new Map(kn.map((t) => [t.name, t])), wn = (t) => Kr.get(t.toLowerCase()), Ur = (t, e) => {
|
|
745
747
|
const { name: n, keywords: o } = t;
|
|
746
748
|
if (n === e) return { score: 0 };
|
|
747
749
|
if (n.startsWith(e)) return { score: 1 };
|
|
@@ -750,10 +752,10 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
750
752
|
if (n.includes(`_${e}`)) return { score: 3 };
|
|
751
753
|
const i = o.find((s) => s.toLowerCase().startsWith(e));
|
|
752
754
|
return i ? { score: 4, keyword: i } : n.includes(e) ? { score: 5 } : null;
|
|
753
|
-
},
|
|
755
|
+
}, Hr = (t, e = 8, n = {}) => {
|
|
754
756
|
const o = t.toLowerCase(), r = [];
|
|
755
757
|
return kn.forEach((i, s) => {
|
|
756
|
-
const a =
|
|
758
|
+
const a = Ur(i, o);
|
|
757
759
|
a && r.push({
|
|
758
760
|
emoji: { ...i, matchedKeyword: a.keyword },
|
|
759
761
|
score: a.score,
|
|
@@ -762,7 +764,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
762
764
|
}), r.sort(
|
|
763
765
|
(i, s) => i.score - s.score || (n[s.emoji.name] ?? 0) - (n[i.emoji.name] ?? 0) || i.index - s.index
|
|
764
766
|
).slice(0, e).map(({ emoji: i }) => i);
|
|
765
|
-
},
|
|
767
|
+
}, jr = [
|
|
766
768
|
"+1",
|
|
767
769
|
"heart",
|
|
768
770
|
"joy",
|
|
@@ -779,32 +781,32 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
779
781
|
"sweat_smile",
|
|
780
782
|
"100",
|
|
781
783
|
"x"
|
|
782
|
-
],
|
|
784
|
+
], Gr = (t) => (e, n) => (t[n] ?? 0) - (t[e] ?? 0), Wr = (t, e = {}, n = 8) => {
|
|
783
785
|
if (!t) {
|
|
784
|
-
const o = Object.keys(e).filter((i) => e[i] > 0).sort(
|
|
785
|
-
return [.../* @__PURE__ */ new Set([...o, ...
|
|
786
|
+
const o = Object.keys(e).filter((i) => e[i] > 0).sort(Gr(e));
|
|
787
|
+
return [.../* @__PURE__ */ new Set([...o, ...jr])].flatMap((i) => wn(i) ?? []).slice(0, n);
|
|
786
788
|
}
|
|
787
|
-
return
|
|
788
|
-
},
|
|
789
|
+
return Hr(t, n, e);
|
|
790
|
+
}, Yr = (t) => t.replaceAll(" ", "%20"), qr = (t) => {
|
|
789
791
|
try {
|
|
790
792
|
return decodeURIComponent(t);
|
|
791
793
|
} catch {
|
|
792
794
|
return t;
|
|
793
795
|
}
|
|
794
|
-
},
|
|
796
|
+
}, Qr = (t) => t.replace(/[[\]]/g, ""), Vr = ht.join("|"), Nt = `\\[([^\\]\\n]+)\\]\\(@?(${Vr}):([^)\\s]+)\\)`, Jr = {
|
|
795
797
|
dependencies: [be],
|
|
796
|
-
export: (t) => hn(t) ? `[${
|
|
798
|
+
export: (t) => hn(t) ? `[${Qr(t.getLabel())}](${t.getMentionType()}:${Yr(t.getMentionId())})` : null,
|
|
797
799
|
importRegExp: new RegExp(Nt),
|
|
798
800
|
regExp: new RegExp(Nt + "$"),
|
|
799
801
|
replace: (t, e) => {
|
|
800
|
-
const [, n, o, r] = e, i = De(o,
|
|
802
|
+
const [, n, o, r] = e, i = De(o, qr(r), n.replace(/^@+/, ""));
|
|
801
803
|
return t.replace(i), i;
|
|
802
804
|
},
|
|
803
805
|
trigger: ")",
|
|
804
806
|
type: "text-match"
|
|
805
|
-
},
|
|
806
|
-
dependencies: [
|
|
807
|
-
export: (t) =>
|
|
807
|
+
}, Xr = {
|
|
808
|
+
dependencies: [oo],
|
|
809
|
+
export: (t) => Vt(t) ? `\\
|
|
808
810
|
` : null,
|
|
809
811
|
// never matches, line breaks are imported by the paragraph importer
|
|
810
812
|
importRegExp: /(?!)/,
|
|
@@ -812,7 +814,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
812
814
|
replace: () => {
|
|
813
815
|
},
|
|
814
816
|
type: "text-match"
|
|
815
|
-
},
|
|
817
|
+
}, Zr = {
|
|
816
818
|
dependencies: [st],
|
|
817
819
|
export: () => null,
|
|
818
820
|
importRegExp: /(?!)/,
|
|
@@ -822,20 +824,20 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
822
824
|
const n = wn(e[1]);
|
|
823
825
|
if (!n) return;
|
|
824
826
|
const o = Ce(n.char).setFormat(t.getFormat());
|
|
825
|
-
return t.replace(o),
|
|
827
|
+
return t.replace(o), ro().dispatchCommand(Ze, n.name), o;
|
|
826
828
|
},
|
|
827
829
|
trigger: ":",
|
|
828
830
|
type: "text-match"
|
|
829
|
-
},
|
|
831
|
+
}, ei = {
|
|
830
832
|
dependencies: [ye],
|
|
831
|
-
export: (t) =>
|
|
833
|
+
export: (t) => Or(t) ? t.getUrl() : null,
|
|
832
834
|
regExp: /^\s*(https?:\/\/\S+)\s*$/,
|
|
833
835
|
replace: (t, e, n, o) => {
|
|
834
836
|
if (!o || !re(n[1])) return !1;
|
|
835
837
|
t.replace(pe(n[1]));
|
|
836
838
|
},
|
|
837
839
|
type: "element"
|
|
838
|
-
},
|
|
840
|
+
}, ti = {
|
|
839
841
|
dependencies: [ve],
|
|
840
842
|
export: (t) => {
|
|
841
843
|
if (!Xe(t)) return null;
|
|
@@ -851,9 +853,8 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
851
853
|
},
|
|
852
854
|
type: "element"
|
|
853
855
|
}, Pe = [
|
|
854
|
-
Zr,
|
|
855
856
|
ei,
|
|
856
|
-
|
|
857
|
+
ti,
|
|
857
858
|
Ko,
|
|
858
859
|
Uo,
|
|
859
860
|
Ho,
|
|
@@ -862,22 +863,23 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
862
863
|
Wo,
|
|
863
864
|
Yo,
|
|
864
865
|
qo,
|
|
865
|
-
Vo,
|
|
866
866
|
Qo,
|
|
867
|
+
Vo,
|
|
867
868
|
Jo,
|
|
868
869
|
Xo,
|
|
869
870
|
Zo,
|
|
870
|
-
|
|
871
|
+
er,
|
|
871
872
|
Jr,
|
|
872
873
|
Xr,
|
|
873
|
-
|
|
874
|
-
|
|
874
|
+
Zr,
|
|
875
|
+
tr
|
|
876
|
+
], ni = /^\s*(`{3,}|~{3,})/, _n = (t) => {
|
|
875
877
|
let e = null;
|
|
876
878
|
return t.map((n) => {
|
|
877
|
-
const o = n.match(
|
|
879
|
+
const o = n.match(ni);
|
|
878
880
|
return e ? (o && o[1][0] === e[0] && o[1].length >= e.length && (e = null), !0) : (o && (e = o[1]), !!o);
|
|
879
881
|
});
|
|
880
|
-
},
|
|
882
|
+
}, oi = (t, e) => {
|
|
881
883
|
const n = t.split(`
|
|
882
884
|
`), o = _n(n), r = [];
|
|
883
885
|
return n.forEach((i, s) => {
|
|
@@ -895,17 +897,17 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
895
897
|
r && o.push(r), r = null, i++;
|
|
896
898
|
return;
|
|
897
899
|
}
|
|
898
|
-
const
|
|
899
|
-
r && (
|
|
900
|
+
const u = n[a] && (a === 0 || !n[a - 1]);
|
|
901
|
+
r && (u || r.isCode && !n[a]) && (o.push(r), r = null), r || (r = { lines: [], blanksBefore: i, isCode: n[a] }, i = 0), r.lines.push(s);
|
|
900
902
|
}), r && o.push(r), o;
|
|
901
|
-
},
|
|
903
|
+
}, ri = /^\s*([-*+]\s|\d+[.)]\s|#{1,6}\s|>|\||:::|<\/?[a-z])/i, St = (t) => !t.isCode && !ri.test(t.lines[0]), ii = (t) => (t.match(/\\+$/)?.[0].length ?? 0) % 2 === 1, si = (t) => {
|
|
902
904
|
if (t.isCode) return t.lines.join(`
|
|
903
905
|
`);
|
|
904
906
|
const e = [...t.lines], n = e.length - 1;
|
|
905
|
-
return
|
|
907
|
+
return ii(e[n]) && (e[n] = e[n].slice(0, -1).trimEnd()), e.map((o) => o.replace(ai, "$1* $2")).join(`
|
|
906
908
|
`);
|
|
907
|
-
},
|
|
908
|
-
const e =
|
|
909
|
+
}, ai = /^(\s*)[-+] (\[[ xX]\]\s)/, Ot = (t) => /^\s*( |<br\s*\/?>)\s*$/i.test(t), li = (t) => {
|
|
910
|
+
const e = oi(
|
|
909
911
|
t.replace(/\r\n?/g, `
|
|
910
912
|
`),
|
|
911
913
|
(a) => a.replace(/<\/?u>/gi, "")
|
|
@@ -913,28 +915,28 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
913
915
|
if (!n.some((a) => !a.isCode && a.lines.some(Ot))) return e;
|
|
914
916
|
let r = "", i = null, s = !1;
|
|
915
917
|
for (const a of n) {
|
|
916
|
-
const
|
|
917
|
-
if (!
|
|
918
|
+
const u = a.isCode ? a.lines : a.lines.filter((x) => !Ot(x));
|
|
919
|
+
if (!u.length) {
|
|
918
920
|
s = !0;
|
|
919
921
|
continue;
|
|
920
922
|
}
|
|
921
|
-
const d = { ...a, lines:
|
|
923
|
+
const d = { ...a, lines: u }, v = u.join(`
|
|
922
924
|
`);
|
|
923
925
|
i ? !s && St(i) && St(d) ? r += `\\
|
|
924
|
-
` +
|
|
926
|
+
` + v : r += `
|
|
925
927
|
|
|
926
|
-
` +
|
|
928
|
+
` + v : r = v, i = d, s = !1;
|
|
927
929
|
}
|
|
928
930
|
return r;
|
|
929
|
-
},
|
|
931
|
+
}, ci = (t) => {
|
|
930
932
|
if (!Y(t)) return !1;
|
|
931
933
|
const e = t.getFirstChild();
|
|
932
934
|
return e === null || t.getChildrenSize() === 1 && X(e) && /^\s{0,3}$/.test(e.getTextContent());
|
|
933
|
-
},
|
|
935
|
+
}, di = (t, e) => {
|
|
934
936
|
const n = En(t), o = [];
|
|
935
937
|
let r = !1;
|
|
936
938
|
for (const s of e.getChildren()) {
|
|
937
|
-
if (
|
|
939
|
+
if (ci(s)) {
|
|
938
940
|
r = !0;
|
|
939
941
|
continue;
|
|
940
942
|
}
|
|
@@ -942,32 +944,32 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
942
944
|
}
|
|
943
945
|
const i = o.length === n.length;
|
|
944
946
|
return n.map((s, a) => {
|
|
945
|
-
const
|
|
946
|
-
return a === 0 ?
|
|
947
|
+
const u = si(s);
|
|
948
|
+
return a === 0 ? u : ((i ? !o[a].hasGapBefore && o[a].isParagraph && o[a - 1].isParagraph : !1) ? `\\
|
|
947
949
|
` : `
|
|
948
950
|
|
|
949
|
-
`) +
|
|
951
|
+
`) + u;
|
|
950
952
|
}).join("").trim();
|
|
951
|
-
},
|
|
953
|
+
}, ui = (t) => {
|
|
952
954
|
const e = [t];
|
|
953
955
|
let n = t;
|
|
954
956
|
for (const o of t.getChildren())
|
|
955
|
-
|
|
957
|
+
Vt(o) ? (n = he().setFormat(t.getFormatType()), e.push(n), o.remove()) : n !== t && n.append(o);
|
|
956
958
|
return e;
|
|
957
|
-
},
|
|
959
|
+
}, mi = (t) => {
|
|
958
960
|
const e = [];
|
|
959
961
|
return t.forEach((n, o) => {
|
|
960
962
|
if (!Y(n)) {
|
|
961
963
|
e.push(n);
|
|
962
964
|
return;
|
|
963
965
|
}
|
|
964
|
-
o > 0 && Y(t[o - 1]) && e.push(he()), e.push(...
|
|
966
|
+
o > 0 && Y(t[o - 1]) && e.push(he()), e.push(...ui(n));
|
|
965
967
|
}), e;
|
|
966
968
|
}, Cn = (t) => (
|
|
967
969
|
// shouldMergeAdjacentLines: a soft line break renders as a space, so show it as one
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
970
|
+
mi(
|
|
971
|
+
nr(
|
|
972
|
+
li(t || ""),
|
|
971
973
|
Pe,
|
|
972
974
|
!1,
|
|
973
975
|
!0
|
|
@@ -976,7 +978,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
976
978
|
), et = (t) => {
|
|
977
979
|
const e = ie(), n = Cn(t);
|
|
978
980
|
e.clear(), e.append(...n.length ? n : [he()]), M() !== null && e.selectStart();
|
|
979
|
-
}, Rt = (t = ie()) =>
|
|
981
|
+
}, Rt = (t = ie()) => di(or(Pe, t, !1), t), pi = () => {
|
|
980
982
|
const e = ie().getChildren();
|
|
981
983
|
if (e.length === 0) return !0;
|
|
982
984
|
if (e.length > 1) return !1;
|
|
@@ -1032,7 +1034,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1032
1034
|
.token.builtin {
|
|
1033
1035
|
color: #56b6c2;
|
|
1034
1036
|
}
|
|
1035
|
-
`,
|
|
1037
|
+
`, gi = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='20' viewBox='0 -960 960 960' width='20' fill='%2323E0A9'%3E%3Cpath d='m427.462-343.692 233.846-232.846L620-617.846 427.462-426.308l-87-86L299.154-471l128.308 127.308ZM480.134-104q-77.313 0-145.89-29.359-68.577-29.36-120.025-80.762-51.447-51.402-80.833-119.917Q104-402.554 104-479.866q0-78.569 29.418-146.871 29.419-68.303 80.922-119.917 51.503-51.614 119.916-80.48Q402.67-856 479.866-856q78.559 0 146.853 28.839 68.294 28.84 119.922 80.422 51.627 51.582 80.493 119.841Q856-558.639 856-480.05q0 77.589-28.839 145.826-28.84 68.237-80.408 119.786-51.569 51.548-119.81 80.993Q558.702-104 480.134-104Z'/%3E%3C/svg%3E")`, hi = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='20' viewBox='0 -960 960 960' width='20' fill='%23C4C7C5'%3E%3Cpath d='M480.409-104q-77.588 0-146.165-29.359-68.577-29.360-120.025-80.762-51.447-51.402-80.833-119.876Q104-402.471 104-480.325q0-78.110 29.418-146.412 29.419-68.303 80.922-119.917 51.503-51.614 119.875-80.480Q402.587-856 480.325-856q78.100 0 146.394 28.839 68.294 28.840 119.922 80.422 51.627 51.582 80.493 120.065Q856-558.191 856-480.326q0 77.865-28.839 146.102-28.840 68.237-80.408 119.786-51.569 51.548-120.034 80.993Q558.253-104 480.409-104ZM480-162q132.513 0 225.256-92.744Q798-347.487 798-480t-92.744-225.256Q612.513-798 480-798t-225.256 92.744Q162-612.513 162-480t92.744 225.256Q347.487-162 480-162Zm0-318Z'/%3E%3C/svg%3E")`, fi = w.div`
|
|
1036
1038
|
position: relative;
|
|
1037
1039
|
display: flex;
|
|
1038
1040
|
flex-direction: column;
|
|
@@ -1047,7 +1049,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1047
1049
|
border-color: var(--md-sys-color-primary);
|
|
1048
1050
|
}
|
|
1049
1051
|
}
|
|
1050
|
-
`,
|
|
1052
|
+
`, bi = w.div`
|
|
1051
1053
|
position: relative;
|
|
1052
1054
|
display: flex;
|
|
1053
1055
|
align-items: center;
|
|
@@ -1093,7 +1095,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1093
1095
|
display: none;
|
|
1094
1096
|
}
|
|
1095
1097
|
}
|
|
1096
|
-
`,
|
|
1098
|
+
`, yi = w.div`
|
|
1097
1099
|
display: flex;
|
|
1098
1100
|
align-items: center;
|
|
1099
1101
|
gap: 2px;
|
|
@@ -1101,12 +1103,12 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1101
1103
|
min-width: 0;
|
|
1102
1104
|
overflow: hidden;
|
|
1103
1105
|
justify-content: flex-end;
|
|
1104
|
-
`,
|
|
1106
|
+
`, vi = w.span`
|
|
1105
1107
|
width: 1px;
|
|
1106
1108
|
height: 18px;
|
|
1107
1109
|
margin: 0 4px;
|
|
1108
1110
|
background-color: var(--md-sys-color-outline-variant);
|
|
1109
|
-
`,
|
|
1111
|
+
`, xi = w.div`
|
|
1110
1112
|
position: fixed;
|
|
1111
1113
|
z-index: 1100;
|
|
1112
1114
|
display: flex;
|
|
@@ -1139,7 +1141,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1139
1141
|
padding: 4px;
|
|
1140
1142
|
min-height: 0;
|
|
1141
1143
|
}
|
|
1142
|
-
`,
|
|
1144
|
+
`, ki = w.button`
|
|
1143
1145
|
all: unset;
|
|
1144
1146
|
position: fixed;
|
|
1145
1147
|
z-index: 1100;
|
|
@@ -1171,7 +1173,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1171
1173
|
&:hover {
|
|
1172
1174
|
background-color: var(--md-sys-color-surface-container-high-hover);
|
|
1173
1175
|
}
|
|
1174
|
-
`,
|
|
1176
|
+
`, wi = w.div`
|
|
1175
1177
|
position: fixed;
|
|
1176
1178
|
z-index: 1000;
|
|
1177
1179
|
transform: translateX(-100%);
|
|
@@ -1187,7 +1189,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1187
1189
|
display: none;
|
|
1188
1190
|
}
|
|
1189
1191
|
}
|
|
1190
|
-
`,
|
|
1192
|
+
`, _i = w.span`
|
|
1191
1193
|
display: flex;
|
|
1192
1194
|
align-items: center;
|
|
1193
1195
|
gap: 2px;
|
|
@@ -1208,7 +1210,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1208
1210
|
&:hover {
|
|
1209
1211
|
color: var(--md-sys-color-on-surface);
|
|
1210
1212
|
}
|
|
1211
|
-
`,
|
|
1213
|
+
`, Ei = w.div`
|
|
1212
1214
|
display: flex;
|
|
1213
1215
|
align-items: flex-end;
|
|
1214
1216
|
min-width: 0;
|
|
@@ -1219,7 +1221,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1219
1221
|
gap: 2px;
|
|
1220
1222
|
padding: 4px;
|
|
1221
1223
|
}
|
|
1222
|
-
`,
|
|
1224
|
+
`, Ci = w.div`
|
|
1223
1225
|
position: fixed;
|
|
1224
1226
|
z-index: 1100;
|
|
1225
1227
|
transform: translate(-50%, calc(-100% - 8px));
|
|
@@ -1243,12 +1245,12 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1243
1245
|
color: var(--md-sys-color-on-primary-container);
|
|
1244
1246
|
}
|
|
1245
1247
|
}
|
|
1246
|
-
`,
|
|
1248
|
+
`, Ti = w.div`
|
|
1247
1249
|
position: relative;
|
|
1248
1250
|
overflow-y: auto;
|
|
1249
1251
|
flex: 1;
|
|
1250
1252
|
min-width: 0;
|
|
1251
|
-
`,
|
|
1253
|
+
`, Li = w.div`
|
|
1252
1254
|
position: absolute;
|
|
1253
1255
|
top: 8px;
|
|
1254
1256
|
left: 10px;
|
|
@@ -1259,7 +1261,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1259
1261
|
overflow: hidden;
|
|
1260
1262
|
text-overflow: ellipsis;
|
|
1261
1263
|
white-space: nowrap;
|
|
1262
|
-
`,
|
|
1264
|
+
`, Mi = w.div`
|
|
1263
1265
|
.md-content {
|
|
1264
1266
|
outline: none;
|
|
1265
1267
|
padding: 8px 10px;
|
|
@@ -1434,12 +1436,12 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1434
1436
|
}
|
|
1435
1437
|
}
|
|
1436
1438
|
.md-list-item-unchecked::before {
|
|
1437
|
-
background-image: ${
|
|
1439
|
+
background-image: ${hi};
|
|
1438
1440
|
}
|
|
1439
1441
|
.md-list-item-checked {
|
|
1440
1442
|
color: var(--md-sys-color-outline);
|
|
1441
1443
|
&::before {
|
|
1442
|
-
background-image: ${
|
|
1444
|
+
background-image: ${gi};
|
|
1443
1445
|
}
|
|
1444
1446
|
}
|
|
1445
1447
|
|
|
@@ -1481,7 +1483,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1481
1483
|
.md-activity-link {
|
|
1482
1484
|
text-decoration: none;
|
|
1483
1485
|
}
|
|
1484
|
-
`,
|
|
1486
|
+
`, $i = w.div`
|
|
1485
1487
|
position: absolute;
|
|
1486
1488
|
top: 4px;
|
|
1487
1489
|
left: 0;
|
|
@@ -1522,12 +1524,12 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1522
1524
|
padding-top: 4px;
|
|
1523
1525
|
}
|
|
1524
1526
|
}
|
|
1525
|
-
`,
|
|
1527
|
+
`, Ni = w.li`
|
|
1526
1528
|
list-style: none;
|
|
1527
1529
|
height: 1px;
|
|
1528
1530
|
margin: 4px 4px;
|
|
1529
1531
|
background-color: var(--md-sys-color-outline-variant);
|
|
1530
|
-
`,
|
|
1532
|
+
`, Si = w.div`
|
|
1531
1533
|
display: flex;
|
|
1532
1534
|
align-items: center;
|
|
1533
1535
|
justify-content: space-between;
|
|
@@ -1535,10 +1537,10 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1535
1537
|
margin-bottom: 4px;
|
|
1536
1538
|
background-color: var(--md-sys-color-surface-container-lowest);
|
|
1537
1539
|
color: var(--md-sys-color-outline);
|
|
1538
|
-
`,
|
|
1540
|
+
`, Oi = w.span`
|
|
1539
1541
|
display: flex;
|
|
1540
1542
|
gap: 2px;
|
|
1541
|
-
`,
|
|
1543
|
+
`, Ri = w.button`
|
|
1542
1544
|
all: unset;
|
|
1543
1545
|
display: flex;
|
|
1544
1546
|
align-items: center;
|
|
@@ -1562,7 +1564,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1562
1564
|
background-color: var(--md-sys-color-primary-container);
|
|
1563
1565
|
color: var(--md-sys-color-on-primary-container);
|
|
1564
1566
|
}
|
|
1565
|
-
`, It =
|
|
1567
|
+
`, It = w.li`
|
|
1566
1568
|
list-style: none;
|
|
1567
1569
|
margin: 0;
|
|
1568
1570
|
padding: 6px 8px;
|
|
@@ -1610,7 +1612,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1610
1612
|
font-family: monospace;
|
|
1611
1613
|
font-size: 11px;
|
|
1612
1614
|
}
|
|
1613
|
-
`,
|
|
1615
|
+
`, Ii = 4, Ai = 26, yt = ({
|
|
1614
1616
|
editor: t,
|
|
1615
1617
|
anchor: e,
|
|
1616
1618
|
placement: n,
|
|
@@ -1619,66 +1621,66 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1619
1621
|
options: i,
|
|
1620
1622
|
selectedIndex: s,
|
|
1621
1623
|
onSelect: a,
|
|
1622
|
-
onHighlight:
|
|
1624
|
+
onHighlight: u,
|
|
1623
1625
|
renderOption: d,
|
|
1624
|
-
optionClassName:
|
|
1625
|
-
emptyMessage:
|
|
1626
|
+
optionClassName: v,
|
|
1627
|
+
emptyMessage: x,
|
|
1626
1628
|
className: g,
|
|
1627
|
-
getGroup:
|
|
1629
|
+
getGroup: h
|
|
1628
1630
|
}) => {
|
|
1629
|
-
const
|
|
1631
|
+
const f = O(null), c = O(null), [m, _] = U(!1);
|
|
1630
1632
|
oe(() => {
|
|
1631
|
-
const
|
|
1632
|
-
if (!
|
|
1633
|
-
const
|
|
1634
|
-
|
|
1633
|
+
const k = f.current, C = k?.querySelector('[aria-selected="true"]');
|
|
1634
|
+
if (!k || !C) return;
|
|
1635
|
+
const b = C.offsetTop, L = b + C.offsetHeight;
|
|
1636
|
+
b < k.scrollTop ? k.scrollTop = b - 4 : L > k.scrollTop + k.clientHeight && (k.scrollTop = L - k.clientHeight + 4);
|
|
1635
1637
|
}, [s]);
|
|
1636
|
-
const T = n === "top", E = t.getRootElement(), p = E?.closest(".md-mention-anchor") || E?.closest(".md-editor"),
|
|
1638
|
+
const T = n === "top", E = t.getRootElement(), p = E?.closest(".md-mention-anchor") || E?.closest(".md-editor"), y = T && p ? p : e;
|
|
1637
1639
|
return oe(() => {
|
|
1638
|
-
const
|
|
1639
|
-
if (T || !
|
|
1640
|
-
const C = e.getBoundingClientRect(),
|
|
1641
|
-
|
|
1642
|
-
}, [T, e, i.length, o,
|
|
1640
|
+
const k = c.current;
|
|
1641
|
+
if (T || !k) return;
|
|
1642
|
+
const C = e.getBoundingClientRect(), b = k.offsetHeight, L = window.innerHeight - C.top - Ii, I = C.top - Ai;
|
|
1643
|
+
_(b > L && I > L);
|
|
1644
|
+
}, [T, e, i.length, o, x]), fe(
|
|
1643
1645
|
/* @__PURE__ */ S(
|
|
1644
|
-
|
|
1646
|
+
$i,
|
|
1645
1647
|
{
|
|
1646
1648
|
ref: c,
|
|
1647
1649
|
className: P("mention-menu md-popover", ae, g, {
|
|
1648
|
-
above:
|
|
1650
|
+
above: m,
|
|
1649
1651
|
top: T
|
|
1650
1652
|
}),
|
|
1651
|
-
onMouseDown: (
|
|
1653
|
+
onMouseDown: (k) => k.preventDefault(),
|
|
1652
1654
|
children: [
|
|
1653
|
-
(o || r) && /* @__PURE__ */ S(
|
|
1655
|
+
(o || r) && /* @__PURE__ */ S(Si, { children: [
|
|
1654
1656
|
/* @__PURE__ */ l("span", { children: o }),
|
|
1655
1657
|
r
|
|
1656
1658
|
] }),
|
|
1657
|
-
/* @__PURE__ */ S("ul", { ref:
|
|
1658
|
-
i.map((
|
|
1659
|
-
C > 0 &&
|
|
1659
|
+
/* @__PURE__ */ S("ul", { ref: f, role: "listbox", className: P({ untitled: !o && !r }), children: [
|
|
1660
|
+
i.map((k, C) => [
|
|
1661
|
+
C > 0 && h && h(k) !== h(i[C - 1]) && /* @__PURE__ */ l(Ni, { role: "separator" }, `divider-${k.key}`),
|
|
1660
1662
|
/* @__PURE__ */ l(
|
|
1661
1663
|
It,
|
|
1662
1664
|
{
|
|
1663
|
-
ref: (
|
|
1665
|
+
ref: (b) => k.setRefElement(b),
|
|
1664
1666
|
role: "option",
|
|
1665
1667
|
"aria-selected": s === C,
|
|
1666
|
-
className: P(
|
|
1667
|
-
onMouseEnter: () =>
|
|
1668
|
+
className: P(v?.(k), { selected: s === C }),
|
|
1669
|
+
onMouseEnter: () => u(C),
|
|
1668
1670
|
onClick: () => {
|
|
1669
|
-
|
|
1671
|
+
u(C), a(k);
|
|
1670
1672
|
},
|
|
1671
|
-
children: d(
|
|
1673
|
+
children: d(k)
|
|
1672
1674
|
},
|
|
1673
|
-
|
|
1675
|
+
k.key
|
|
1674
1676
|
)
|
|
1675
1677
|
]),
|
|
1676
|
-
!i.length &&
|
|
1678
|
+
!i.length && x && /* @__PURE__ */ l(It, { className: "empty", children: x })
|
|
1677
1679
|
] })
|
|
1678
1680
|
]
|
|
1679
1681
|
}
|
|
1680
1682
|
),
|
|
1681
|
-
|
|
1683
|
+
y
|
|
1682
1684
|
);
|
|
1683
1685
|
}, Be = () => {
|
|
1684
1686
|
const t = M();
|
|
@@ -1688,7 +1690,7 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1688
1690
|
return X(e) && e.hasFormat("code") ? !0 : !!W(e, ee);
|
|
1689
1691
|
}, vt = ge(
|
|
1690
1692
|
"INSERT_MENTION_TRIGGER_COMMAND"
|
|
1691
|
-
),
|
|
1693
|
+
), Di = ["@", "@@", "@@@"], Pi = {
|
|
1692
1694
|
"@": {
|
|
1693
1695
|
title: "@ Users & Teams",
|
|
1694
1696
|
noun: "user",
|
|
@@ -1701,36 +1703,36 @@ const Ae = (t) => at(new ve(t)), Xe = (t) => t instanceof ve, Ze = ge("EMOJI_USE
|
|
|
1701
1703
|
"@@": { title: "@@ Versions", noun: "version" },
|
|
1702
1704
|
"@@@": { title: "@@@ Tasks", noun: "task" }
|
|
1703
1705
|
}, At = /(^|[\s([{"'])(@{1,3})([^\s@]{0,75})$/;
|
|
1704
|
-
class
|
|
1706
|
+
class Bi extends gt {
|
|
1705
1707
|
item;
|
|
1706
1708
|
constructor(e, n) {
|
|
1707
1709
|
super(`${e.type}:${e.id}:${n}`), this.item = e;
|
|
1708
1710
|
}
|
|
1709
1711
|
}
|
|
1710
|
-
const
|
|
1711
|
-
const [o] = A(), [r, i] = U(null), [s, a] = U(null),
|
|
1712
|
+
const zi = ({ source: t, menuParent: e, placement: n = "inline" }) => {
|
|
1713
|
+
const [o] = A(), [r, i] = U(null), [s, a] = U(null), u = O("@"), [d, v] = U("@"), x = t.triggers ?? Di, g = t.limit ?? (n === "top" ? 8 : 5), h = H(
|
|
1712
1714
|
(E) => {
|
|
1713
1715
|
if (Be()) return null;
|
|
1714
1716
|
const p = At.exec(E);
|
|
1715
1717
|
if (!p) return null;
|
|
1716
|
-
const
|
|
1717
|
-
return
|
|
1718
|
+
const y = p[2];
|
|
1719
|
+
return x.includes(y) ? (u.current = y, {
|
|
1718
1720
|
leadOffset: p.index + p[1].length,
|
|
1719
1721
|
matchingString: p[3],
|
|
1720
1722
|
replaceableString: p[2] + p[3]
|
|
1721
1723
|
}) : null;
|
|
1722
1724
|
},
|
|
1723
|
-
[
|
|
1724
|
-
),
|
|
1725
|
+
[x.join()]
|
|
1726
|
+
), f = H((E) => {
|
|
1725
1727
|
if (i(E), E === null) {
|
|
1726
1728
|
a(null);
|
|
1727
1729
|
return;
|
|
1728
1730
|
}
|
|
1729
|
-
|
|
1730
|
-
}, []), c = { ...
|
|
1731
|
-
(E, p,
|
|
1731
|
+
v((p) => (p !== u.current && a(null), u.current));
|
|
1732
|
+
}, []), c = { ...Pi[d], ...t.config?.[d] }, m = r !== null ? t.getError?.(d) : null, _ = _e(() => r === null || m ? [] : t.getOptions({ trigger: d, search: r.toLowerCase(), filter: s }).slice(0, g).map((E, p) => new Bi(E, p)), [r, d, s, t, g, m]), T = H(
|
|
1733
|
+
(E, p, y) => {
|
|
1732
1734
|
o.update(() => {
|
|
1733
|
-
const { type:
|
|
1735
|
+
const { type: k, id: C, label: b } = E.item, L = De(k, C, b);
|
|
1734
1736
|
if (p)
|
|
1735
1737
|
p.replace(L);
|
|
1736
1738
|
else {
|
|
@@ -1744,7 +1746,7 @@ const Bi = ({ source: t, menuParent: e, placement: n = "inline" }) => {
|
|
|
1744
1746
|
const F = Ce(" ");
|
|
1745
1747
|
L.insertAfter(F), F.select(1, 1);
|
|
1746
1748
|
}
|
|
1747
|
-
|
|
1749
|
+
y();
|
|
1748
1750
|
});
|
|
1749
1751
|
},
|
|
1750
1752
|
[o]
|
|
@@ -1766,10 +1768,10 @@ const Bi = ({ source: t, menuParent: e, placement: n = "inline" }) => {
|
|
|
1766
1768
|
}
|
|
1767
1769
|
}
|
|
1768
1770
|
}
|
|
1769
|
-
const
|
|
1770
|
-
if (!$(
|
|
1771
|
-
const
|
|
1772
|
-
return
|
|
1771
|
+
const y = M();
|
|
1772
|
+
if (!$(y)) return !1;
|
|
1773
|
+
const k = y.anchor, C = k.type === "text" ? k.getNode().getTextContent().slice(0, k.offset) : "", b = C.length > 0 && !/\s$/.test(C);
|
|
1774
|
+
return y.insertText((b ? " " : "") + E), !0;
|
|
1773
1775
|
},
|
|
1774
1776
|
Jt
|
|
1775
1777
|
)
|
|
@@ -1778,62 +1780,62 @@ const Bi = ({ source: t, menuParent: e, placement: n = "inline" }) => {
|
|
|
1778
1780
|
), /* @__PURE__ */ l(
|
|
1779
1781
|
pt,
|
|
1780
1782
|
{
|
|
1781
|
-
onQueryChange:
|
|
1783
|
+
onQueryChange: f,
|
|
1782
1784
|
onSelectOption: T,
|
|
1783
|
-
triggerFn:
|
|
1784
|
-
options:
|
|
1785
|
+
triggerFn: h,
|
|
1786
|
+
options: _,
|
|
1785
1787
|
parent: e,
|
|
1786
1788
|
commandPriority: Z,
|
|
1787
|
-
menuRenderFn: (E, { selectedIndex: p, selectOptionAndCleanUp:
|
|
1789
|
+
menuRenderFn: (E, { selectedIndex: p, selectOptionAndCleanUp: y, setHighlightedIndex: k }) => {
|
|
1788
1790
|
const C = E.current;
|
|
1789
|
-
return !C || !
|
|
1791
|
+
return !C || !_.length && !m && (r || s) ? null : /* @__PURE__ */ l(
|
|
1790
1792
|
yt,
|
|
1791
1793
|
{
|
|
1792
1794
|
editor: o,
|
|
1793
1795
|
anchor: C,
|
|
1794
1796
|
placement: n,
|
|
1795
1797
|
title: c.title,
|
|
1796
|
-
titleActions: !!c.filters?.length && /* @__PURE__ */ l(
|
|
1797
|
-
|
|
1798
|
+
titleActions: !!c.filters?.length && /* @__PURE__ */ l(Oi, { children: c.filters.map((b) => /* @__PURE__ */ l(
|
|
1799
|
+
Ri,
|
|
1798
1800
|
{
|
|
1799
|
-
className: P({ active: s ===
|
|
1800
|
-
onClick: () => a((L) => L ===
|
|
1801
|
-
"data-tooltip":
|
|
1802
|
-
"aria-label":
|
|
1801
|
+
className: P({ active: s === b.id }),
|
|
1802
|
+
onClick: () => a((L) => L === b.id ? null : b.id),
|
|
1803
|
+
"data-tooltip": b.tooltip,
|
|
1804
|
+
"aria-label": b.tooltip,
|
|
1803
1805
|
"data-tooltip-delay": 0,
|
|
1804
1806
|
type: "button",
|
|
1805
|
-
children: /* @__PURE__ */ l(J, { icon:
|
|
1807
|
+
children: /* @__PURE__ */ l(J, { icon: b.icon })
|
|
1806
1808
|
},
|
|
1807
|
-
|
|
1809
|
+
b.id
|
|
1808
1810
|
)) }),
|
|
1809
|
-
options:
|
|
1811
|
+
options: _,
|
|
1810
1812
|
selectedIndex: p,
|
|
1811
|
-
onSelect:
|
|
1812
|
-
onHighlight:
|
|
1813
|
+
onSelect: y,
|
|
1814
|
+
onHighlight: k,
|
|
1813
1815
|
optionClassName: () => c.isCircle ? void 0 : "square",
|
|
1814
|
-
emptyMessage:
|
|
1815
|
-
renderOption: ({ item:
|
|
1816
|
-
t.renderOptionImage ? t.renderOptionImage(
|
|
1817
|
-
|
|
1818
|
-
|
|
1816
|
+
emptyMessage: m || `No ${c.noun}s found`,
|
|
1817
|
+
renderOption: ({ item: b }) => /* @__PURE__ */ S(me, { children: [
|
|
1818
|
+
t.renderOptionImage ? t.renderOptionImage(b) : b.type === "user" ? /* @__PURE__ */ l(hr, { size: 20, name: b.id, className: "image" }) : b.icon && /* @__PURE__ */ l(J, { icon: b.icon, className: "image", style: { color: b.color } }),
|
|
1819
|
+
b.context && /* @__PURE__ */ S("span", { className: "context", children: [
|
|
1820
|
+
b.context,
|
|
1819
1821
|
" - "
|
|
1820
1822
|
] }),
|
|
1821
|
-
/* @__PURE__ */ l("span", { className: "label", children:
|
|
1822
|
-
|
|
1823
|
+
/* @__PURE__ */ l("span", { className: "label", children: b.label }),
|
|
1824
|
+
b.suffix && /* @__PURE__ */ l("span", { className: "suffix", children: b.suffix })
|
|
1823
1825
|
] })
|
|
1824
1826
|
}
|
|
1825
1827
|
);
|
|
1826
1828
|
}
|
|
1827
1829
|
}
|
|
1828
1830
|
);
|
|
1829
|
-
}, Dt = "emojiUsage",
|
|
1830
|
-
const { user: t } =
|
|
1831
|
+
}, Dt = "emojiUsage", Fi = 40, Ki = () => {
|
|
1832
|
+
const { user: t } = cr(), e = t?.data?.frontendPreferences?.[Dt] ?? {}, n = O(e);
|
|
1831
1833
|
n.current = e;
|
|
1832
|
-
const [o] =
|
|
1834
|
+
const [o] = qn(), r = H(
|
|
1833
1835
|
(i) => {
|
|
1834
1836
|
if (!t?.name) return;
|
|
1835
1837
|
const s = { ...n.current, [i]: (n.current[i] ?? 0) + 1 }, a = Object.fromEntries(
|
|
1836
|
-
Object.entries(s).sort(([,
|
|
1838
|
+
Object.entries(s).sort(([, u], [, d]) => d - u).slice(0, Fi)
|
|
1837
1839
|
);
|
|
1838
1840
|
n.current = a, o({
|
|
1839
1841
|
userName: t.name,
|
|
@@ -1846,49 +1848,49 @@ const Bi = ({ source: t, menuParent: e, placement: n = "inline" }) => {
|
|
|
1846
1848
|
[t?.name, o]
|
|
1847
1849
|
);
|
|
1848
1850
|
return { usage: e, recordUse: r };
|
|
1849
|
-
},
|
|
1850
|
-
class
|
|
1851
|
+
}, Ui = /(^|[\s([{"'])(:)([a-z0-9_+-]{0,40})$/i;
|
|
1852
|
+
class Hi extends gt {
|
|
1851
1853
|
emoji;
|
|
1852
1854
|
constructor(e) {
|
|
1853
1855
|
super(e.name), this.emoji = e;
|
|
1854
1856
|
}
|
|
1855
1857
|
}
|
|
1856
|
-
const
|
|
1857
|
-
const [n] = A(), [o, r] = U(null), i = t === "top" ? 8 : 5, { usage: s, recordUse: a } =
|
|
1858
|
-
() => o === null ? [] :
|
|
1858
|
+
const ji = ({ placement: t = "inline", menuParent: e }) => {
|
|
1859
|
+
const [n] = A(), [o, r] = U(null), i = t === "top" ? 8 : 5, { usage: s, recordUse: a } = Ki(), u = _e(
|
|
1860
|
+
() => o === null ? [] : Wr(o, s, i).map((x) => new Hi(x)),
|
|
1859
1861
|
[o, i, s]
|
|
1860
1862
|
);
|
|
1861
1863
|
R(
|
|
1862
1864
|
() => n.registerCommand(
|
|
1863
1865
|
Ze,
|
|
1864
|
-
(
|
|
1866
|
+
(x) => (a(x), !1),
|
|
1865
1867
|
Jt
|
|
1866
1868
|
),
|
|
1867
1869
|
[n, a]
|
|
1868
1870
|
);
|
|
1869
|
-
const d = H((
|
|
1871
|
+
const d = H((x) => {
|
|
1870
1872
|
if (Be()) return null;
|
|
1871
|
-
const g =
|
|
1873
|
+
const g = Ui.exec(x);
|
|
1872
1874
|
return g ? {
|
|
1873
1875
|
leadOffset: g.index + g[1].length,
|
|
1874
1876
|
matchingString: g[3],
|
|
1875
1877
|
replaceableString: g[2] + g[3]
|
|
1876
1878
|
} : null;
|
|
1877
|
-
}, []),
|
|
1878
|
-
(
|
|
1879
|
+
}, []), v = H(
|
|
1880
|
+
(x, g, h) => {
|
|
1879
1881
|
n.update(() => {
|
|
1880
1882
|
if (!g) return;
|
|
1881
|
-
const
|
|
1882
|
-
g.replace(
|
|
1883
|
-
const c =
|
|
1883
|
+
const f = Ce(x.emoji.char).setFormat(g.getFormat());
|
|
1884
|
+
g.replace(f);
|
|
1885
|
+
const c = f.getNextSibling();
|
|
1884
1886
|
if (X(c) && c.getTextContent().startsWith(" "))
|
|
1885
1887
|
c.select(1, 1);
|
|
1886
1888
|
else {
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1889
|
+
const m = Ce(" ");
|
|
1890
|
+
f.insertAfter(m), m.select(1, 1);
|
|
1889
1891
|
}
|
|
1890
|
-
|
|
1891
|
-
}), n.dispatchCommand(Ze,
|
|
1892
|
+
h();
|
|
1893
|
+
}), n.dispatchCommand(Ze, x.emoji.name);
|
|
1892
1894
|
},
|
|
1893
1895
|
[n]
|
|
1894
1896
|
);
|
|
@@ -1896,15 +1898,15 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
1896
1898
|
pt,
|
|
1897
1899
|
{
|
|
1898
1900
|
onQueryChange: r,
|
|
1899
|
-
onSelectOption:
|
|
1901
|
+
onSelectOption: v,
|
|
1900
1902
|
triggerFn: d,
|
|
1901
|
-
options:
|
|
1903
|
+
options: u,
|
|
1902
1904
|
parent: e,
|
|
1903
1905
|
commandPriority: Z,
|
|
1904
1906
|
preselectFirstItem: !!o,
|
|
1905
|
-
menuRenderFn: (
|
|
1906
|
-
const c =
|
|
1907
|
-
return !c || !
|
|
1907
|
+
menuRenderFn: (x, { selectedIndex: g, selectOptionAndCleanUp: h, setHighlightedIndex: f }) => {
|
|
1908
|
+
const c = x.current;
|
|
1909
|
+
return !c || !u.length ? null : /* @__PURE__ */ l(
|
|
1908
1910
|
yt,
|
|
1909
1911
|
{
|
|
1910
1912
|
editor: n,
|
|
@@ -1912,18 +1914,18 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
1912
1914
|
placement: t,
|
|
1913
1915
|
className: "emoji-menu",
|
|
1914
1916
|
title: o ? `Emoji matching :${o}` : Object.keys(s).length ? "Frequently used" : "Popular emoji",
|
|
1915
|
-
options:
|
|
1917
|
+
options: u,
|
|
1916
1918
|
selectedIndex: g,
|
|
1917
|
-
onSelect:
|
|
1918
|
-
onHighlight:
|
|
1919
|
-
renderOption: ({ emoji:
|
|
1920
|
-
/* @__PURE__ */ l("span", { className: "image emoji", "aria-hidden": !0, children:
|
|
1919
|
+
onSelect: h,
|
|
1920
|
+
onHighlight: f,
|
|
1921
|
+
renderOption: ({ emoji: m }) => /* @__PURE__ */ S(me, { children: [
|
|
1922
|
+
/* @__PURE__ */ l("span", { className: "image emoji", "aria-hidden": !0, children: m.char }),
|
|
1921
1923
|
/* @__PURE__ */ S("span", { className: "label", children: [
|
|
1922
1924
|
":",
|
|
1923
|
-
|
|
1925
|
+
m.name,
|
|
1924
1926
|
":"
|
|
1925
1927
|
] }),
|
|
1926
|
-
|
|
1928
|
+
m.matchedKeyword && /* @__PURE__ */ l("span", { className: "suffix", children: m.matchedKeyword })
|
|
1927
1929
|
] })
|
|
1928
1930
|
}
|
|
1929
1931
|
);
|
|
@@ -1937,19 +1939,19 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
1937
1939
|
if (!e) return null;
|
|
1938
1940
|
const n = ft(e.getAttribute("data-mention-value"));
|
|
1939
1941
|
return n ? { target: e, mention: { ...n, label: e.getAttribute("data-mention-label") || "" } } : null;
|
|
1940
|
-
},
|
|
1942
|
+
}, Gi = ({ onMentionClick: t, onMentionHover: e }) => {
|
|
1941
1943
|
const [n] = A(), o = O({ onMentionClick: t, onMentionHover: e });
|
|
1942
1944
|
return o.current = { onMentionClick: t, onMentionHover: e }, R(() => {
|
|
1943
|
-
const r = (
|
|
1944
|
-
const d = Pt(
|
|
1945
|
-
d && o.current.onMentionClick?.(d.mention,
|
|
1946
|
-
}, i = (
|
|
1947
|
-
const d = Pt(
|
|
1948
|
-
!d || d.target.contains(
|
|
1945
|
+
const r = (u) => {
|
|
1946
|
+
const d = Pt(u);
|
|
1947
|
+
d && o.current.onMentionClick?.(d.mention, u);
|
|
1948
|
+
}, i = (u) => {
|
|
1949
|
+
const d = Pt(u);
|
|
1950
|
+
!d || d.target.contains(u.relatedTarget) || o.current.onMentionHover?.(d.mention, d.target);
|
|
1949
1951
|
};
|
|
1950
1952
|
let s = null;
|
|
1951
|
-
const a = n.registerRootListener((
|
|
1952
|
-
d?.removeEventListener("click", r), d?.removeEventListener("mouseover", i),
|
|
1953
|
+
const a = n.registerRootListener((u, d) => {
|
|
1954
|
+
d?.removeEventListener("click", r), d?.removeEventListener("mouseover", i), u?.addEventListener("click", r), u?.addEventListener("mouseover", i), s = u;
|
|
1953
1955
|
});
|
|
1954
1956
|
return () => {
|
|
1955
1957
|
a(), s?.removeEventListener("click", r), s?.removeEventListener("mouseover", i);
|
|
@@ -1958,19 +1960,19 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
1958
1960
|
}, tt = (t) => {
|
|
1959
1961
|
let e = t.getKey() === "root" ? t : W(t, (n) => {
|
|
1960
1962
|
const o = n.getParent();
|
|
1961
|
-
return o !== null &&
|
|
1963
|
+
return o !== null && io(o);
|
|
1962
1964
|
});
|
|
1963
1965
|
if (e === null && (e = t.getTopLevelElementOrThrow()), sn(e))
|
|
1964
|
-
return (
|
|
1965
|
-
if (
|
|
1966
|
+
return (sr(t, an) ?? e).getListType();
|
|
1967
|
+
if (To(e)) {
|
|
1966
1968
|
const n = e.getTag();
|
|
1967
1969
|
return n === "h1" || n === "h2" || n === "h3" ? n : "heading";
|
|
1968
1970
|
}
|
|
1969
1971
|
return on(e) ? "quote" : ee(e) ? "code" : "paragraph";
|
|
1970
|
-
},
|
|
1971
|
-
bullet:
|
|
1972
|
-
number:
|
|
1973
|
-
check:
|
|
1972
|
+
}, Wi = {
|
|
1973
|
+
bullet: Ao,
|
|
1974
|
+
number: Io,
|
|
1975
|
+
check: Ro
|
|
1974
1976
|
}, j = (t, e, n = "toggle") => {
|
|
1975
1977
|
const o = t.getEditorState().read(() => {
|
|
1976
1978
|
const r = M();
|
|
@@ -1978,7 +1980,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
1978
1980
|
});
|
|
1979
1981
|
if (o !== null && !(n === "set" && o === e)) {
|
|
1980
1982
|
if (e === "bullet" || e === "number" || e === "check") {
|
|
1981
|
-
o === e ? t.dispatchCommand(
|
|
1983
|
+
o === e ? t.dispatchCommand(Oo, void 0) : t.dispatchCommand(Wi[e], void 0);
|
|
1982
1984
|
return;
|
|
1983
1985
|
}
|
|
1984
1986
|
t.update(() => {
|
|
@@ -1989,8 +1991,8 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
1989
1991
|
return;
|
|
1990
1992
|
}
|
|
1991
1993
|
if (e === "h1" || e === "h2" || e === "h3")
|
|
1992
|
-
Me(r, () =>
|
|
1993
|
-
else if (e === "quote") Me(r, () =>
|
|
1994
|
+
Me(r, () => Lo(e));
|
|
1995
|
+
else if (e === "quote") Me(r, () => Mo());
|
|
1994
1996
|
else if (r.isCollapsed()) Me(r, () => Mt());
|
|
1995
1997
|
else {
|
|
1996
1998
|
const i = r.getTextContent(), s = Mt();
|
|
@@ -2008,11 +2010,11 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2008
2010
|
), Bt = (t) => {
|
|
2009
2011
|
const e = t.trim();
|
|
2010
2012
|
return e ? /^(https?:|mailto:|\/|#)/i.test(e) ? e : `https://${e}` : "";
|
|
2011
|
-
},
|
|
2013
|
+
}, Yi = {
|
|
2012
2014
|
blockType: "paragraph",
|
|
2013
2015
|
formats: {},
|
|
2014
2016
|
isLink: !1
|
|
2015
|
-
},
|
|
2017
|
+
}, qi = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform), $e = qi ? "⌘" : "Ctrl+", Ye = {
|
|
2016
2018
|
h1: { icon: "format_h1", tooltip: "Heading 1", shortcut: "#" },
|
|
2017
2019
|
h2: { icon: "format_h2", tooltip: "Heading 2", shortcut: "##" },
|
|
2018
2020
|
h3: { icon: "format_h3", tooltip: "Heading 3", shortcut: "###" },
|
|
@@ -2026,52 +2028,52 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2026
2028
|
numberList: { icon: "format_list_numbered", tooltip: "Numbered list", shortcut: "1." },
|
|
2027
2029
|
bulletList: { icon: "format_list_bulleted", tooltip: "Bullet list", shortcut: "-" },
|
|
2028
2030
|
checkList: { icon: "check_circle", tooltip: "Checklist", shortcut: "[]" }
|
|
2029
|
-
}, zt = ({ layout: t =
|
|
2030
|
-
const [r] = A(), [i, s] = U(
|
|
2031
|
-
const c = r.getRootElement(),
|
|
2032
|
-
if (!c || !
|
|
2033
|
-
|
|
2031
|
+
}, zt = ({ layout: t = Cr, start: e, end: n, floating: o }) => {
|
|
2032
|
+
const [r] = A(), [i, s] = U(Yi), [a, u] = U(null), d = H(() => {
|
|
2033
|
+
const c = r.getRootElement(), m = window.getSelection();
|
|
2034
|
+
if (!c || !m || m.isCollapsed || !m.rangeCount) {
|
|
2035
|
+
u(null);
|
|
2034
2036
|
return;
|
|
2035
2037
|
}
|
|
2036
|
-
if (!c.contains(
|
|
2037
|
-
const
|
|
2038
|
-
|
|
2039
|
-
}, [r]),
|
|
2038
|
+
if (!c.contains(m.anchorNode)) return;
|
|
2039
|
+
const _ = m.getRangeAt(0).getBoundingClientRect();
|
|
2040
|
+
u({ top: _.top, left: _.left + _.width / 2 });
|
|
2041
|
+
}, [r]), v = H(() => {
|
|
2040
2042
|
const c = M();
|
|
2041
2043
|
if (!$(c)) return;
|
|
2042
|
-
const
|
|
2044
|
+
const m = c.anchor.getNode(), _ = {};
|
|
2043
2045
|
for (const T of ["bold", "italic", "strikethrough", "code"])
|
|
2044
|
-
|
|
2045
|
-
o && (c.isCollapsed() || tt(
|
|
2046
|
-
blockType: tt(
|
|
2047
|
-
formats:
|
|
2048
|
-
isLink: !!W(
|
|
2046
|
+
_[T] = c.hasFormat(T);
|
|
2047
|
+
o && (c.isCollapsed() || tt(m) === "code" ? u(null) : requestAnimationFrame(() => d())), s({
|
|
2048
|
+
blockType: tt(m),
|
|
2049
|
+
formats: _,
|
|
2050
|
+
isLink: !!W(m, ne)
|
|
2049
2051
|
});
|
|
2050
2052
|
}, [o, d]);
|
|
2051
2053
|
R(
|
|
2052
2054
|
() => q(
|
|
2053
2055
|
r.registerUpdateListener(({ editorState: c }) => {
|
|
2054
|
-
c.read(
|
|
2056
|
+
c.read(v);
|
|
2055
2057
|
}),
|
|
2056
2058
|
r.registerCommand(
|
|
2057
2059
|
lt,
|
|
2058
|
-
() => (
|
|
2059
|
-
|
|
2060
|
+
() => (v(), !1),
|
|
2061
|
+
Qe
|
|
2060
2062
|
),
|
|
2061
2063
|
r.registerCommand(
|
|
2062
2064
|
ct,
|
|
2063
|
-
() => (
|
|
2065
|
+
() => (u(null), !1),
|
|
2064
2066
|
D
|
|
2065
2067
|
)
|
|
2066
2068
|
),
|
|
2067
|
-
[r,
|
|
2069
|
+
[r, v]
|
|
2068
2070
|
), R(() => {
|
|
2069
2071
|
if (!(!o || !a))
|
|
2070
2072
|
return window.addEventListener("scroll", d, !0), window.addEventListener("resize", d), () => {
|
|
2071
2073
|
window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
|
|
2072
2074
|
};
|
|
2073
2075
|
}, [o, !!a, d]);
|
|
2074
|
-
const
|
|
2076
|
+
const x = (c) => {
|
|
2075
2077
|
switch (c) {
|
|
2076
2078
|
case "bold":
|
|
2077
2079
|
case "italic":
|
|
@@ -2091,7 +2093,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2091
2093
|
j(r, "code");
|
|
2092
2094
|
break;
|
|
2093
2095
|
case "link":
|
|
2094
|
-
|
|
2096
|
+
u(null), r.dispatchCommand(Ln, void 0);
|
|
2095
2097
|
break;
|
|
2096
2098
|
case "bulletList":
|
|
2097
2099
|
j(r, "bullet");
|
|
@@ -2127,8 +2129,8 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2127
2129
|
case "checkList":
|
|
2128
2130
|
return i.blockType === "check";
|
|
2129
2131
|
}
|
|
2130
|
-
},
|
|
2131
|
-
(c,
|
|
2132
|
+
}, h = (c) => i.blockType === "code" && ["bold", "italic", "strikethrough", "code", "link"].includes(c), f = /* @__PURE__ */ l(yi, { children: t.map(
|
|
2133
|
+
(c, m) => c === "|" ? /* @__PURE__ */ l(vi, { className: "md-toolbar-divider" }, `divider-${m}`) : /* @__PURE__ */ l(Jn, { children: /* @__PURE__ */ l(
|
|
2132
2134
|
te,
|
|
2133
2135
|
{
|
|
2134
2136
|
icon: Ye[c].icon,
|
|
@@ -2136,38 +2138,38 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2136
2138
|
className: P("md-toolbar-button", `md-toolbar-item-${c}`, {
|
|
2137
2139
|
active: g(c)
|
|
2138
2140
|
}),
|
|
2139
|
-
disabled:
|
|
2141
|
+
disabled: h(c),
|
|
2140
2142
|
"data-tooltip": Ye[c].tooltip,
|
|
2141
2143
|
"data-shortcut": Ye[c].shortcut,
|
|
2142
2144
|
"aria-pressed": g(c),
|
|
2143
|
-
onMouseDown: (
|
|
2144
|
-
onClick: () =>
|
|
2145
|
+
onMouseDown: (_) => _.preventDefault(),
|
|
2146
|
+
onClick: () => x(c),
|
|
2145
2147
|
type: "button"
|
|
2146
2148
|
}
|
|
2147
2149
|
) }, c)
|
|
2148
2150
|
) });
|
|
2149
2151
|
return o ? a ? fe(
|
|
2150
2152
|
/* @__PURE__ */ l(
|
|
2151
|
-
|
|
2153
|
+
Ci,
|
|
2152
2154
|
{
|
|
2153
2155
|
className: P("md-toolbar md-floating-toolbar md-popover", ae),
|
|
2154
2156
|
style: { top: a.top, left: a.left },
|
|
2155
|
-
children:
|
|
2157
|
+
children: f
|
|
2156
2158
|
}
|
|
2157
2159
|
),
|
|
2158
2160
|
document.body
|
|
2159
|
-
) : null : /* @__PURE__ */ S(
|
|
2161
|
+
) : null : /* @__PURE__ */ S(bi, { className: "md-toolbar", children: [
|
|
2160
2162
|
e,
|
|
2161
|
-
|
|
2163
|
+
f,
|
|
2162
2164
|
n
|
|
2163
2165
|
] });
|
|
2164
|
-
},
|
|
2166
|
+
}, Qi = (t) => t.metaKey || t.ctrlKey, Vi = () => {
|
|
2165
2167
|
const [t] = A();
|
|
2166
2168
|
return R(
|
|
2167
2169
|
() => q(
|
|
2168
2170
|
t.registerCommand(
|
|
2169
2171
|
Xt,
|
|
2170
|
-
(e) =>
|
|
2172
|
+
(e) => Qi(e) && !e.shiftKey && !e.altKey && e.key.toLowerCase() === "e" ? (e.preventDefault(), t.dispatchCommand(dt, "code"), !0) : !1,
|
|
2171
2173
|
D
|
|
2172
2174
|
),
|
|
2173
2175
|
t.registerCommand(
|
|
@@ -2185,7 +2187,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2185
2187
|
D
|
|
2186
2188
|
),
|
|
2187
2189
|
t.registerCommand(
|
|
2188
|
-
|
|
2190
|
+
so,
|
|
2189
2191
|
(e) => {
|
|
2190
2192
|
if (e?.shiftKey) return !1;
|
|
2191
2193
|
const n = M();
|
|
@@ -2206,7 +2208,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2206
2208
|
),
|
|
2207
2209
|
[t]
|
|
2208
2210
|
), null;
|
|
2209
|
-
},
|
|
2211
|
+
}, Ji = () => {
|
|
2210
2212
|
const [t] = A();
|
|
2211
2213
|
return R(() => {
|
|
2212
2214
|
const e = (n) => {
|
|
@@ -2224,16 +2226,16 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2224
2226
|
return r.insertAfter(d), d.select(), !0;
|
|
2225
2227
|
};
|
|
2226
2228
|
return q(
|
|
2227
|
-
t.registerCommand(
|
|
2229
|
+
t.registerCommand(ao, e, D),
|
|
2228
2230
|
t.registerCommand(Zt, e, D)
|
|
2229
2231
|
);
|
|
2230
2232
|
}, [t]), null;
|
|
2231
|
-
},
|
|
2233
|
+
}, Xi = /^\[([ xX]?)\]\s/, Zi = () => {
|
|
2232
2234
|
const [t] = A();
|
|
2233
2235
|
return R(
|
|
2234
2236
|
() => t.registerNodeTransform(st, (e) => {
|
|
2235
2237
|
if (!e.isSimpleText()) return;
|
|
2236
|
-
const n = e.getTextContent().match(
|
|
2238
|
+
const n = e.getTextContent().match(Xi);
|
|
2237
2239
|
if (!n) return;
|
|
2238
2240
|
const o = e.getParent();
|
|
2239
2241
|
if (!ln(o) || !e.is(o.getFirstChild())) return;
|
|
@@ -2242,7 +2244,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2242
2244
|
if (r.getChildrenSize() === 1)
|
|
2243
2245
|
r.setListType("check");
|
|
2244
2246
|
else if (o.is(r.getLastChild())) {
|
|
2245
|
-
const s =
|
|
2247
|
+
const s = Do("check");
|
|
2246
2248
|
r.insertAfter(s), s.append(o);
|
|
2247
2249
|
} else
|
|
2248
2250
|
return;
|
|
@@ -2251,7 +2253,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2251
2253
|
}),
|
|
2252
2254
|
[t]
|
|
2253
2255
|
), null;
|
|
2254
|
-
},
|
|
2256
|
+
}, es = ({ onSubmit: t, onEscape: e, submitOnEnter: n }) => {
|
|
2255
2257
|
const [o] = A(), r = O({ onSubmit: t, onEscape: e, submitOnEnter: n });
|
|
2256
2258
|
return r.current = { onSubmit: t, onEscape: e, submitOnEnter: n }, R(() => {
|
|
2257
2259
|
const i = () => {
|
|
@@ -2263,27 +2265,27 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2263
2265
|
isInCode: !!W(a, ee),
|
|
2264
2266
|
isInParagraph: !!W(
|
|
2265
2267
|
a,
|
|
2266
|
-
(
|
|
2268
|
+
(u) => Y(u) && ut(u.getParent())
|
|
2267
2269
|
)
|
|
2268
2270
|
};
|
|
2269
2271
|
};
|
|
2270
2272
|
return q(
|
|
2271
2273
|
o.registerCommand(
|
|
2272
|
-
|
|
2274
|
+
Ve,
|
|
2273
2275
|
(s) => !s || !(s.metaKey || s.ctrlKey) || !r.current.onSubmit ? !1 : (s.preventDefault(), r.current.onSubmit(), !0),
|
|
2274
|
-
|
|
2276
|
+
lo
|
|
2275
2277
|
),
|
|
2276
2278
|
// below the mention menu (which selects an option on enter), above the rich text plugin
|
|
2277
2279
|
o.registerCommand(
|
|
2278
|
-
|
|
2280
|
+
Ve,
|
|
2279
2281
|
(s) => {
|
|
2280
2282
|
if (!s || s.isComposing || s.metaKey || s.ctrlKey || s.altKey) return !1;
|
|
2281
2283
|
const a = i();
|
|
2282
2284
|
if (!a) return !1;
|
|
2283
2285
|
if (s.shiftKey)
|
|
2284
2286
|
return a.isInParagraph ? (s.preventDefault(), o.dispatchCommand(en, void 0)) : !1;
|
|
2285
|
-
const { submitOnEnter:
|
|
2286
|
-
return !
|
|
2287
|
+
const { submitOnEnter: u, onSubmit: d } = r.current;
|
|
2288
|
+
return !u || !d || a.isInList || a.isInCode ? !1 : (s.preventDefault(), d(), !0);
|
|
2287
2289
|
},
|
|
2288
2290
|
D
|
|
2289
2291
|
),
|
|
@@ -2292,11 +2294,11 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2292
2294
|
o.registerCommand(
|
|
2293
2295
|
tn,
|
|
2294
2296
|
() => r.current.onEscape ? (r.current.onEscape(), !0) : !1,
|
|
2295
|
-
|
|
2297
|
+
co
|
|
2296
2298
|
)
|
|
2297
2299
|
);
|
|
2298
2300
|
}, [o]), null;
|
|
2299
|
-
}, qe = (t) => Y(t) && t.getChildrenSize() === 0,
|
|
2301
|
+
}, qe = (t) => Y(t) && t.getChildrenSize() === 0, ts = () => {
|
|
2300
2302
|
const [t] = A();
|
|
2301
2303
|
return R(
|
|
2302
2304
|
() => t.registerCommand(
|
|
@@ -2313,14 +2315,14 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2313
2315
|
),
|
|
2314
2316
|
[t]
|
|
2315
2317
|
), null;
|
|
2316
|
-
}, Ft = /^[0-9a-f]{32}$/,
|
|
2318
|
+
}, Ft = /^[0-9a-f]{32}$/, Hl = (t, e) => `source:${t}` + (e ? `?${new URLSearchParams({ type: e.type, id: e.id })}` : ""), ze = (t) => {
|
|
2317
2319
|
if (!t) return null;
|
|
2318
2320
|
const e = t.match(/^source:([0-9a-f]{32})(?:\?(.*))?$/);
|
|
2319
2321
|
if (e) {
|
|
2320
|
-
const s = new URLSearchParams(e[2] ?? ""), a = s.get("id"),
|
|
2322
|
+
const s = new URLSearchParams(e[2] ?? ""), a = s.get("id"), u = s.get("type");
|
|
2321
2323
|
return {
|
|
2322
2324
|
activityId: e[1],
|
|
2323
|
-
entity: a &&
|
|
2325
|
+
entity: a && u && Ft.test(a) ? { id: a, type: u } : null,
|
|
2324
2326
|
isSource: !0
|
|
2325
2327
|
};
|
|
2326
2328
|
}
|
|
@@ -2345,7 +2347,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2345
2347
|
} catch {
|
|
2346
2348
|
return { projectName: o, ...i };
|
|
2347
2349
|
}
|
|
2348
|
-
}, $n = "Comment",
|
|
2350
|
+
}, $n = "Comment", ns = () => {
|
|
2349
2351
|
const [t] = A();
|
|
2350
2352
|
return R(() => {
|
|
2351
2353
|
const e = (r) => {
|
|
@@ -2357,8 +2359,8 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2357
2359
|
const a = t.read(() => {
|
|
2358
2360
|
const d = nn(i);
|
|
2359
2361
|
return ne(d) ? d.getURL() : null;
|
|
2360
|
-
}),
|
|
2361
|
-
|
|
2362
|
+
}), u = ze(a ?? i.getAttribute("href"));
|
|
2363
|
+
u?.isSource || window.open(u?.url ?? i.href, "_blank", "noopener,noreferrer");
|
|
2362
2364
|
};
|
|
2363
2365
|
let n = null;
|
|
2364
2366
|
const o = t.registerRootListener((r, i) => {
|
|
@@ -2391,7 +2393,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2391
2393
|
}
|
|
2392
2394
|
const n = M(), o = $(n) ? n.anchor.getNode().getTopLevelElement() : ie().getLastChild();
|
|
2393
2395
|
o ? o.insertAfter(t) : ie().append(t), Nn(t);
|
|
2394
|
-
},
|
|
2396
|
+
}, os = (t) => Sn(pe(t)), rs = () => {
|
|
2395
2397
|
const [t] = A();
|
|
2396
2398
|
return R(
|
|
2397
2399
|
() => q(
|
|
@@ -2408,7 +2410,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2408
2410
|
Z
|
|
2409
2411
|
),
|
|
2410
2412
|
t.registerCommand(
|
|
2411
|
-
|
|
2413
|
+
Ve,
|
|
2412
2414
|
(e) => {
|
|
2413
2415
|
if (e?.shiftKey || e?.metaKey || e?.ctrlKey) return !1;
|
|
2414
2416
|
const n = nt();
|
|
@@ -2433,67 +2435,67 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2433
2435
|
if (!e || Je(e) && e.getIsUnlinked()) return null;
|
|
2434
2436
|
const n = W(t.focus.getNode(), ne);
|
|
2435
2437
|
return n && n.is(e) ? e : null;
|
|
2436
|
-
},
|
|
2437
|
-
const [t] = A(), [e, n] = U(null), [o, r] = U(""), [i, s] = U(!1), a = O(null),
|
|
2438
|
-
|
|
2439
|
-
const
|
|
2438
|
+
}, is = () => {
|
|
2439
|
+
const [t] = A(), [e, n] = U(null), [o, r] = U(""), [i, s] = U(!1), a = O(null), u = O(null), d = O(null), v = O(e);
|
|
2440
|
+
v.current = e;
|
|
2441
|
+
const x = () => !!u.current && document.activeElement === u.current, g = H(
|
|
2440
2442
|
(p = !1) => {
|
|
2441
2443
|
n(null), d.current = null, p && t.focus();
|
|
2442
2444
|
},
|
|
2443
2445
|
[t]
|
|
2444
|
-
),
|
|
2445
|
-
if (
|
|
2446
|
+
), h = H(() => {
|
|
2447
|
+
if (x()) return;
|
|
2446
2448
|
const p = Ut();
|
|
2447
2449
|
if (!p) {
|
|
2448
|
-
|
|
2450
|
+
v.current?.mode === "link" && n(null);
|
|
2449
2451
|
return;
|
|
2450
2452
|
}
|
|
2451
|
-
const
|
|
2452
|
-
if (!
|
|
2453
|
-
const
|
|
2453
|
+
const y = t.getElementByKey(p.getKey());
|
|
2454
|
+
if (!y) return;
|
|
2455
|
+
const k = p.getURL();
|
|
2454
2456
|
n({
|
|
2455
2457
|
mode: "link",
|
|
2456
2458
|
key: p.getKey(),
|
|
2457
|
-
url:
|
|
2458
|
-
rect: Ne(
|
|
2459
|
-
}), r(
|
|
2460
|
-
}, [t]),
|
|
2461
|
-
|
|
2459
|
+
url: k,
|
|
2460
|
+
rect: Ne(y.getBoundingClientRect())
|
|
2461
|
+
}), r(k);
|
|
2462
|
+
}, [t]), f = () => requestAnimationFrame(() => {
|
|
2463
|
+
u.current?.focus(), u.current?.select();
|
|
2462
2464
|
}), c = H(
|
|
2463
2465
|
(p = "link") => {
|
|
2464
|
-
let
|
|
2466
|
+
let y = !1;
|
|
2465
2467
|
return s(!1), t.getEditorState().read(() => {
|
|
2466
|
-
const
|
|
2467
|
-
if (
|
|
2468
|
-
const F = t.getElementByKey(
|
|
2468
|
+
const k = p === "link" ? Ut() : null;
|
|
2469
|
+
if (k) {
|
|
2470
|
+
const F = t.getElementByKey(k.getKey());
|
|
2469
2471
|
if (!F) return;
|
|
2470
|
-
const N =
|
|
2472
|
+
const N = k.getURL();
|
|
2471
2473
|
n({
|
|
2472
2474
|
mode: "link",
|
|
2473
|
-
key:
|
|
2475
|
+
key: k.getKey(),
|
|
2474
2476
|
url: N,
|
|
2475
2477
|
rect: Ne(F.getBoundingClientRect())
|
|
2476
|
-
}), r(N),
|
|
2478
|
+
}), r(N), y = !0;
|
|
2477
2479
|
return;
|
|
2478
2480
|
}
|
|
2479
2481
|
const C = M();
|
|
2480
2482
|
if (!$(C)) return;
|
|
2481
2483
|
d.current = C.clone();
|
|
2482
|
-
const
|
|
2483
|
-
let I = (
|
|
2484
|
-
(!I || !I.width && !I.height) && (I = t.getElementByKey(C.anchor.key)?.getBoundingClientRect()), I && (n({ mode: p === "video" ? "video" : "create", url: "", rect: Ne(I) }), r(""),
|
|
2485
|
-
}),
|
|
2484
|
+
const b = window.getSelection();
|
|
2485
|
+
let I = (b?.rangeCount ? b.getRangeAt(0) : null)?.getBoundingClientRect();
|
|
2486
|
+
(!I || !I.width && !I.height) && (I = t.getElementByKey(C.anchor.key)?.getBoundingClientRect()), I && (n({ mode: p === "video" ? "video" : "create", url: "", rect: Ne(I) }), r(""), y = !0);
|
|
2487
|
+
}), y && f(), y;
|
|
2486
2488
|
},
|
|
2487
2489
|
[t]
|
|
2488
2490
|
);
|
|
2489
2491
|
R(
|
|
2490
2492
|
() => q(
|
|
2491
2493
|
t.registerUpdateListener(({ editorState: p }) => {
|
|
2492
|
-
p.read(
|
|
2494
|
+
p.read(h);
|
|
2493
2495
|
}),
|
|
2494
2496
|
t.registerCommand(
|
|
2495
2497
|
lt,
|
|
2496
|
-
() => (
|
|
2498
|
+
() => (h(), !1),
|
|
2497
2499
|
D
|
|
2498
2500
|
),
|
|
2499
2501
|
t.registerCommand(
|
|
@@ -2515,46 +2517,46 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2515
2517
|
t.registerCommand(
|
|
2516
2518
|
ct,
|
|
2517
2519
|
(p) => {
|
|
2518
|
-
const
|
|
2519
|
-
return
|
|
2520
|
+
const y = p.relatedTarget;
|
|
2521
|
+
return y && a.current?.contains(y) || n(null), !1;
|
|
2520
2522
|
},
|
|
2521
2523
|
D
|
|
2522
2524
|
)
|
|
2523
2525
|
),
|
|
2524
|
-
[t,
|
|
2526
|
+
[t, h, c]
|
|
2525
2527
|
), oe(() => {
|
|
2526
2528
|
if (!e) return;
|
|
2527
2529
|
const p = () => {
|
|
2528
|
-
const
|
|
2529
|
-
if (
|
|
2530
|
-
const
|
|
2531
|
-
|
|
2530
|
+
const y = v.current;
|
|
2531
|
+
if (y?.mode !== "link") return;
|
|
2532
|
+
const k = t.getElementByKey(y.key);
|
|
2533
|
+
k && n({ ...y, rect: Ne(k.getBoundingClientRect()) });
|
|
2532
2534
|
};
|
|
2533
2535
|
return window.addEventListener("scroll", p, !0), window.addEventListener("resize", p), () => {
|
|
2534
2536
|
window.removeEventListener("scroll", p, !0), window.removeEventListener("resize", p);
|
|
2535
2537
|
};
|
|
2536
2538
|
}, [t, !!e]);
|
|
2537
|
-
const
|
|
2538
|
-
const p =
|
|
2539
|
+
const m = () => {
|
|
2540
|
+
const p = v.current;
|
|
2539
2541
|
p?.mode === "link" && (t.update(() => {
|
|
2540
|
-
const
|
|
2541
|
-
Je(
|
|
2542
|
+
const y = se(p.key);
|
|
2543
|
+
Je(y) ? (y.setIsUnlinked(!0), y.markDirty()) : ne(y) && ar(y);
|
|
2542
2544
|
}), g(!0));
|
|
2543
|
-
},
|
|
2544
|
-
const p =
|
|
2545
|
+
}, _ = () => {
|
|
2546
|
+
const p = v.current;
|
|
2545
2547
|
if (!p) return;
|
|
2546
|
-
const
|
|
2548
|
+
const y = Bt(o);
|
|
2547
2549
|
if (p.mode === "link") {
|
|
2548
|
-
if (!
|
|
2549
|
-
|
|
2550
|
+
if (!y) {
|
|
2551
|
+
m();
|
|
2550
2552
|
return;
|
|
2551
2553
|
}
|
|
2552
2554
|
t.update(() => {
|
|
2553
|
-
const
|
|
2554
|
-
if (Je(
|
|
2555
|
-
const C = cn(
|
|
2556
|
-
C.append(...
|
|
2557
|
-
} else ne(
|
|
2555
|
+
const k = se(p.key);
|
|
2556
|
+
if (Je(k)) {
|
|
2557
|
+
const C = cn(y);
|
|
2558
|
+
C.append(...k.getChildren()), k.replace(C);
|
|
2559
|
+
} else ne(k) && k.setURL(y);
|
|
2558
2560
|
}), g(!0);
|
|
2559
2561
|
return;
|
|
2560
2562
|
}
|
|
@@ -2563,36 +2565,36 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2563
2565
|
g(!0);
|
|
2564
2566
|
return;
|
|
2565
2567
|
}
|
|
2566
|
-
if (!re(
|
|
2568
|
+
if (!re(y)) {
|
|
2567
2569
|
s(!0);
|
|
2568
2570
|
return;
|
|
2569
2571
|
}
|
|
2570
2572
|
t.update(() => {
|
|
2571
|
-
d.current && We(d.current.clone()),
|
|
2573
|
+
d.current && We(d.current.clone()), os(y);
|
|
2572
2574
|
}), g(!0);
|
|
2573
2575
|
return;
|
|
2574
2576
|
}
|
|
2575
|
-
if (!
|
|
2577
|
+
if (!y) {
|
|
2576
2578
|
g(!0);
|
|
2577
2579
|
return;
|
|
2578
2580
|
}
|
|
2579
2581
|
t.update(() => {
|
|
2580
2582
|
d.current && We(d.current.clone());
|
|
2581
|
-
const
|
|
2582
|
-
if (!$(
|
|
2583
|
-
if (
|
|
2584
|
-
|
|
2585
|
-
const
|
|
2586
|
-
if ($(
|
|
2587
|
-
const L =
|
|
2588
|
-
|
|
2583
|
+
const k = M();
|
|
2584
|
+
if (!$(k)) return;
|
|
2585
|
+
if (k.isCollapsed()) {
|
|
2586
|
+
k.insertText(y);
|
|
2587
|
+
const b = M();
|
|
2588
|
+
if ($(b)) {
|
|
2589
|
+
const L = b.focus;
|
|
2590
|
+
b.anchor.set(L.key, L.offset - y.length, "text");
|
|
2589
2591
|
}
|
|
2590
2592
|
}
|
|
2591
|
-
t.dispatchCommand(
|
|
2593
|
+
t.dispatchCommand(Bo, y);
|
|
2592
2594
|
const C = M();
|
|
2593
2595
|
if ($(C)) {
|
|
2594
|
-
const
|
|
2595
|
-
C.anchor.set(
|
|
2596
|
+
const b = C.isBackward() ? C.anchor : C.focus;
|
|
2597
|
+
C.anchor.set(b.key, b.offset, b.type), C.focus.set(b.key, b.offset, b.type);
|
|
2596
2598
|
}
|
|
2597
2599
|
}), g(!0);
|
|
2598
2600
|
};
|
|
@@ -2600,20 +2602,20 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2600
2602
|
const T = Math.max(8, Math.min(e.rect.left, window.innerWidth - Kt - 8)), E = Bt(o) !== e.url;
|
|
2601
2603
|
return fe(
|
|
2602
2604
|
/* @__PURE__ */ S(
|
|
2603
|
-
|
|
2605
|
+
xi,
|
|
2604
2606
|
{
|
|
2605
2607
|
ref: a,
|
|
2606
2608
|
className: P("md-popover md-link-popover", ae),
|
|
2607
2609
|
style: { top: e.rect.bottom + 6, left: T, width: Kt },
|
|
2608
2610
|
onMouseDown: (p) => {
|
|
2609
|
-
p.target !==
|
|
2611
|
+
p.target !== u.current && p.preventDefault();
|
|
2610
2612
|
},
|
|
2611
2613
|
children: [
|
|
2612
2614
|
/* @__PURE__ */ l(J, { icon: e.mode === "video" ? "smart_display" : "link" }),
|
|
2613
2615
|
/* @__PURE__ */ l(
|
|
2614
2616
|
"input",
|
|
2615
2617
|
{
|
|
2616
|
-
ref:
|
|
2618
|
+
ref: u,
|
|
2617
2619
|
value: o,
|
|
2618
2620
|
placeholder: e.mode === "video" ? "Paste a YouTube link" : "Paste or type a link",
|
|
2619
2621
|
className: P({ invalid: i }),
|
|
@@ -2623,17 +2625,17 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2623
2625
|
},
|
|
2624
2626
|
onFocus: (p) => p.target.select(),
|
|
2625
2627
|
onKeyDown: (p) => {
|
|
2626
|
-
if (p.stopPropagation(), p.key === "Enter" && (p.preventDefault(),
|
|
2628
|
+
if (p.stopPropagation(), p.key === "Enter" && (p.preventDefault(), _()), p.key === "Escape") {
|
|
2627
2629
|
if (p.preventDefault(), d.current) {
|
|
2628
|
-
const
|
|
2629
|
-
t.update(() => We(
|
|
2630
|
+
const y = d.current.clone();
|
|
2631
|
+
t.update(() => We(y));
|
|
2630
2632
|
}
|
|
2631
2633
|
g(!0);
|
|
2632
2634
|
}
|
|
2633
2635
|
},
|
|
2634
2636
|
onBlur: (p) => {
|
|
2635
|
-
const
|
|
2636
|
-
|
|
2637
|
+
const y = p.relatedTarget, k = t.getRootElement();
|
|
2638
|
+
y && (a.current?.contains(y) || k?.contains(y)) || g();
|
|
2637
2639
|
},
|
|
2638
2640
|
spellCheck: !1
|
|
2639
2641
|
}
|
|
@@ -2643,7 +2645,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2643
2645
|
{
|
|
2644
2646
|
icon: "check",
|
|
2645
2647
|
variant: "text",
|
|
2646
|
-
onClick:
|
|
2648
|
+
onClick: _,
|
|
2647
2649
|
"data-tooltip": e.mode === "video" ? "Embed video" : e.mode === "create" ? "Add link" : "Update link",
|
|
2648
2650
|
type: "button"
|
|
2649
2651
|
}
|
|
@@ -2664,7 +2666,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2664
2666
|
{
|
|
2665
2667
|
icon: "link_off",
|
|
2666
2668
|
variant: "text",
|
|
2667
|
-
onClick:
|
|
2669
|
+
onClick: m,
|
|
2668
2670
|
"data-tooltip": "Remove link",
|
|
2669
2671
|
type: "button"
|
|
2670
2672
|
}
|
|
@@ -2675,7 +2677,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2675
2677
|
),
|
|
2676
2678
|
document.body
|
|
2677
2679
|
);
|
|
2678
|
-
},
|
|
2680
|
+
}, ss = () => {
|
|
2679
2681
|
const [t] = A(), [e, n] = U(null), o = O(null), r = O(null), i = O(!1), s = H(() => {
|
|
2680
2682
|
i.current || t.getEditorState().read(() => {
|
|
2681
2683
|
let d = null;
|
|
@@ -2687,38 +2689,38 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2687
2689
|
const g = M();
|
|
2688
2690
|
$(g) && (d = W(g.anchor.getNode(), ee));
|
|
2689
2691
|
}
|
|
2690
|
-
const
|
|
2691
|
-
if (!d || !
|
|
2692
|
+
const v = d && t.getElementByKey(d.getKey());
|
|
2693
|
+
if (!d || !v) {
|
|
2692
2694
|
n(null);
|
|
2693
2695
|
return;
|
|
2694
2696
|
}
|
|
2695
|
-
const
|
|
2697
|
+
const x = v.getBoundingClientRect();
|
|
2696
2698
|
n({
|
|
2697
2699
|
key: d.getKey(),
|
|
2698
2700
|
language: d.getLanguage() || "",
|
|
2699
|
-
rect: { top:
|
|
2701
|
+
rect: { top: x.top, right: x.right }
|
|
2700
2702
|
});
|
|
2701
2703
|
});
|
|
2702
2704
|
}, [t]);
|
|
2703
2705
|
R(() => {
|
|
2704
2706
|
const d = (g) => {
|
|
2705
|
-
const
|
|
2706
|
-
let
|
|
2707
|
-
|
|
2708
|
-
const c = nn(
|
|
2709
|
-
|
|
2710
|
-
}),
|
|
2711
|
-
},
|
|
2707
|
+
const h = g.target?.closest?.("code");
|
|
2708
|
+
let f = null;
|
|
2709
|
+
h && t.getEditorState().read(() => {
|
|
2710
|
+
const c = nn(h), m = c && W(c, ee);
|
|
2711
|
+
f = m ? m.getKey() : null;
|
|
2712
|
+
}), f !== o.current && (o.current = f, s());
|
|
2713
|
+
}, v = (g) => {
|
|
2712
2714
|
i.current || r.current?.contains(g.relatedTarget) || (o.current = null, s());
|
|
2713
2715
|
};
|
|
2714
|
-
let
|
|
2716
|
+
let x = null;
|
|
2715
2717
|
return q(
|
|
2716
|
-
t.registerRootListener((g,
|
|
2717
|
-
|
|
2718
|
+
t.registerRootListener((g, h) => {
|
|
2719
|
+
h?.removeEventListener("mousemove", d), h?.removeEventListener("mouseleave", v), g?.addEventListener("mousemove", d), g?.addEventListener("mouseleave", v), x = g;
|
|
2718
2720
|
}),
|
|
2719
2721
|
t.registerUpdateListener(() => s()),
|
|
2720
2722
|
() => {
|
|
2721
|
-
|
|
2723
|
+
x?.removeEventListener("mousemove", d), x?.removeEventListener("mouseleave", v);
|
|
2722
2724
|
}
|
|
2723
2725
|
);
|
|
2724
2726
|
}, [t, s]), R(() => {
|
|
@@ -2728,17 +2730,17 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2728
2730
|
};
|
|
2729
2731
|
}, [!!e, s]);
|
|
2730
2732
|
const a = (d) => {
|
|
2731
|
-
const
|
|
2732
|
-
|
|
2733
|
-
const
|
|
2734
|
-
ee(
|
|
2733
|
+
const v = e;
|
|
2734
|
+
v && (t.update(() => {
|
|
2735
|
+
const x = se(v.key);
|
|
2736
|
+
ee(x) && (x.setLanguage(d || null), x.selectEnd());
|
|
2735
2737
|
}), t.focus());
|
|
2736
2738
|
};
|
|
2737
2739
|
if (!e) return null;
|
|
2738
|
-
const
|
|
2740
|
+
const u = Re.some((d) => d.value === e.language) ? Re : [...Re, { value: e.language, label: e.language }];
|
|
2739
2741
|
return fe(
|
|
2740
2742
|
/* @__PURE__ */ l(
|
|
2741
|
-
|
|
2743
|
+
wi,
|
|
2742
2744
|
{
|
|
2743
2745
|
ref: r,
|
|
2744
2746
|
className: P("md-popover md-code-language", ae),
|
|
@@ -2747,9 +2749,9 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2747
2749
|
i.current || t.getRootElement()?.contains(d.relatedTarget) || (o.current = null, s());
|
|
2748
2750
|
},
|
|
2749
2751
|
children: /* @__PURE__ */ l(
|
|
2750
|
-
|
|
2752
|
+
eo,
|
|
2751
2753
|
{
|
|
2752
|
-
options:
|
|
2754
|
+
options: u,
|
|
2753
2755
|
value: [e.language],
|
|
2754
2756
|
dataKey: "value",
|
|
2755
2757
|
labelKey: "label",
|
|
@@ -2767,8 +2769,8 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2767
2769
|
i.current = !1, a(d[0] ?? "");
|
|
2768
2770
|
},
|
|
2769
2771
|
listClassName: P("md-code-language-list", ae),
|
|
2770
|
-
valueTemplate: () => /* @__PURE__ */ S(
|
|
2771
|
-
/* @__PURE__ */ l("span", { children:
|
|
2772
|
+
valueTemplate: () => /* @__PURE__ */ S(_i, { className: "md-code-language-button", children: [
|
|
2773
|
+
/* @__PURE__ */ l("span", { children: br(e.language) || "Plain text" }),
|
|
2772
2774
|
/* @__PURE__ */ l(J, { icon: "expand_more" })
|
|
2773
2775
|
] })
|
|
2774
2776
|
}
|
|
@@ -2777,21 +2779,21 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
|
|
|
2777
2779
|
),
|
|
2778
2780
|
document.body
|
|
2779
2781
|
);
|
|
2780
|
-
},
|
|
2782
|
+
}, as = { ...ur, defaultLanguage: null }, ls = () => {
|
|
2781
2783
|
const [t] = A();
|
|
2782
|
-
return R(() =>
|
|
2784
|
+
return R(() => mr(t, as), [t]), null;
|
|
2783
2785
|
}, Ht = ge(
|
|
2784
2786
|
"INSERT_MEDIA_FILES_COMMAND"
|
|
2785
2787
|
), On = ge(
|
|
2786
2788
|
"OPEN_MEDIA_PICKER_COMMAND"
|
|
2787
|
-
),
|
|
2788
|
-
class
|
|
2789
|
+
), cs = /(^|\s)(\/)([\w-]{0,30})$/;
|
|
2790
|
+
class ds extends gt {
|
|
2789
2791
|
command;
|
|
2790
2792
|
constructor(e) {
|
|
2791
2793
|
super(e.id), this.command = e;
|
|
2792
2794
|
}
|
|
2793
2795
|
}
|
|
2794
|
-
const
|
|
2796
|
+
const us = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform), ms = us ? "⌘" : "Ctrl+", ps = ({
|
|
2795
2797
|
placement: t = "inline",
|
|
2796
2798
|
menuParent: e,
|
|
2797
2799
|
mentionTriggers: n = [],
|
|
@@ -2799,13 +2801,13 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2799
2801
|
canInsertMedia: r,
|
|
2800
2802
|
customCommands: i = []
|
|
2801
2803
|
}) => {
|
|
2802
|
-
const [s] = A(), [a,
|
|
2803
|
-
const
|
|
2804
|
-
...i.map(({ icon:
|
|
2804
|
+
const [s] = A(), [a, u] = U(null), d = O(null), v = _e(() => {
|
|
2805
|
+
const f = [
|
|
2806
|
+
...i.map(({ icon: m, keywords: _ = [], run: T, ...E }) => ({
|
|
2805
2807
|
...E,
|
|
2806
|
-
icon:
|
|
2808
|
+
icon: m,
|
|
2807
2809
|
group: "custom",
|
|
2808
|
-
keywords:
|
|
2810
|
+
keywords: _,
|
|
2809
2811
|
run: () => T()
|
|
2810
2812
|
})),
|
|
2811
2813
|
{
|
|
@@ -2815,7 +2817,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2815
2817
|
group: "headings",
|
|
2816
2818
|
keywords: ["h1", "title", "heading"],
|
|
2817
2819
|
hint: "#",
|
|
2818
|
-
run: (
|
|
2820
|
+
run: (m) => j(m, "h1", "set")
|
|
2819
2821
|
},
|
|
2820
2822
|
{
|
|
2821
2823
|
id: "h2",
|
|
@@ -2824,7 +2826,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2824
2826
|
group: "headings",
|
|
2825
2827
|
keywords: ["h2", "heading", "subtitle"],
|
|
2826
2828
|
hint: "##",
|
|
2827
|
-
run: (
|
|
2829
|
+
run: (m) => j(m, "h2", "set")
|
|
2828
2830
|
},
|
|
2829
2831
|
{
|
|
2830
2832
|
id: "h3",
|
|
@@ -2833,7 +2835,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2833
2835
|
group: "headings",
|
|
2834
2836
|
keywords: ["h3", "heading"],
|
|
2835
2837
|
hint: "###",
|
|
2836
|
-
run: (
|
|
2838
|
+
run: (m) => j(m, "h3", "set")
|
|
2837
2839
|
},
|
|
2838
2840
|
{
|
|
2839
2841
|
id: "bullet",
|
|
@@ -2842,7 +2844,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2842
2844
|
group: "lists",
|
|
2843
2845
|
keywords: ["list", "bullet", "unordered", "ul"],
|
|
2844
2846
|
hint: "-",
|
|
2845
|
-
run: (
|
|
2847
|
+
run: (m) => j(m, "bullet", "set")
|
|
2846
2848
|
},
|
|
2847
2849
|
{
|
|
2848
2850
|
id: "number",
|
|
@@ -2851,7 +2853,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2851
2853
|
group: "lists",
|
|
2852
2854
|
keywords: ["list", "numbered", "ordered", "ol"],
|
|
2853
2855
|
hint: "1.",
|
|
2854
|
-
run: (
|
|
2856
|
+
run: (m) => j(m, "number", "set")
|
|
2855
2857
|
},
|
|
2856
2858
|
{
|
|
2857
2859
|
id: "check",
|
|
@@ -2860,7 +2862,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2860
2862
|
group: "lists",
|
|
2861
2863
|
keywords: ["list", "check", "task", "todo"],
|
|
2862
2864
|
hint: "[]",
|
|
2863
|
-
run: (
|
|
2865
|
+
run: (m) => j(m, "check", "set")
|
|
2864
2866
|
},
|
|
2865
2867
|
{
|
|
2866
2868
|
id: "quote",
|
|
@@ -2869,7 +2871,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2869
2871
|
group: "blocks",
|
|
2870
2872
|
keywords: ["quote", "blockquote"],
|
|
2871
2873
|
hint: ">",
|
|
2872
|
-
run: (
|
|
2874
|
+
run: (m) => j(m, "quote", "set")
|
|
2873
2875
|
},
|
|
2874
2876
|
{
|
|
2875
2877
|
id: "codeBlock",
|
|
@@ -2878,7 +2880,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2878
2880
|
group: "blocks",
|
|
2879
2881
|
keywords: ["code", "block", "snippet", "pre"],
|
|
2880
2882
|
hint: "```",
|
|
2881
|
-
run: (
|
|
2883
|
+
run: (m) => j(m, "code", "set")
|
|
2882
2884
|
},
|
|
2883
2885
|
{
|
|
2884
2886
|
id: "code",
|
|
@@ -2886,8 +2888,8 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2886
2888
|
icon: "code",
|
|
2887
2889
|
group: "blocks",
|
|
2888
2890
|
keywords: ["code", "inline", "monospace"],
|
|
2889
|
-
hint: `${
|
|
2890
|
-
run: (
|
|
2891
|
+
hint: `${ms}E`,
|
|
2892
|
+
run: (m) => m.dispatchCommand(dt, "code")
|
|
2891
2893
|
},
|
|
2892
2894
|
{
|
|
2893
2895
|
id: "youtube",
|
|
@@ -2895,17 +2897,17 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2895
2897
|
icon: "smart_display",
|
|
2896
2898
|
group: "insert",
|
|
2897
2899
|
keywords: ["youtube", "video", "embed"],
|
|
2898
|
-
run: (
|
|
2900
|
+
run: (m) => m.dispatchCommand(Mn, void 0)
|
|
2899
2901
|
}
|
|
2900
2902
|
];
|
|
2901
|
-
return r &&
|
|
2903
|
+
return r && f.push({
|
|
2902
2904
|
id: "media",
|
|
2903
2905
|
label: "Image or video",
|
|
2904
2906
|
icon: "image",
|
|
2905
2907
|
group: "insert",
|
|
2906
2908
|
keywords: ["image", "picture", "photo", "video", "movie", "media", "screenshot"],
|
|
2907
|
-
run: (
|
|
2908
|
-
}), o &&
|
|
2909
|
+
run: (m) => m.dispatchCommand(On, void 0)
|
|
2910
|
+
}), o && f.push({
|
|
2909
2911
|
id: "attachment",
|
|
2910
2912
|
label: "Attachment",
|
|
2911
2913
|
icon: "attach_file",
|
|
@@ -2916,40 +2918,40 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2916
2918
|
{ trigger: "@", label: "Mention user", icon: "person", words: ["user", "team", "person"] },
|
|
2917
2919
|
{ trigger: "@@", label: "Mention version", icon: "layers", words: ["version"] },
|
|
2918
2920
|
{ trigger: "@@@", label: "Mention task", icon: "check_circle", words: ["task"] }
|
|
2919
|
-
].filter(({ trigger:
|
|
2920
|
-
({ trigger:
|
|
2921
|
-
id: `mention-${
|
|
2922
|
-
label:
|
|
2921
|
+
].filter(({ trigger: m }) => n.includes(m)).forEach(
|
|
2922
|
+
({ trigger: m, label: _, icon: T, words: E }) => f.push({
|
|
2923
|
+
id: `mention-${m}`,
|
|
2924
|
+
label: _,
|
|
2923
2925
|
icon: T,
|
|
2924
2926
|
group: "mentions",
|
|
2925
2927
|
keywords: ["mention", ...E],
|
|
2926
|
-
hint:
|
|
2927
|
-
run: (p) => p.dispatchCommand(vt,
|
|
2928
|
+
hint: m,
|
|
2929
|
+
run: (p) => p.dispatchCommand(vt, m)
|
|
2928
2930
|
})
|
|
2929
|
-
),
|
|
2930
|
-
}, [n.join(), !!o, r, i]),
|
|
2931
|
+
), f;
|
|
2932
|
+
}, [n.join(), !!o, r, i]), x = _e(() => {
|
|
2931
2933
|
if (a === null) return [];
|
|
2932
|
-
const
|
|
2933
|
-
return
|
|
2934
|
-
(c) => !
|
|
2935
|
-
(
|
|
2934
|
+
const f = a.toLowerCase();
|
|
2935
|
+
return v.filter(
|
|
2936
|
+
(c) => !f || c.label.toLowerCase().startsWith(f) || [...c.label.toLowerCase().split(/\s+/), ...c.keywords].some(
|
|
2937
|
+
(m) => m.startsWith(f)
|
|
2936
2938
|
)
|
|
2937
|
-
).map((c) => new
|
|
2938
|
-
}, [
|
|
2939
|
+
).map((c) => new ds(c));
|
|
2940
|
+
}, [v, a]), g = H((f) => {
|
|
2939
2941
|
if (Be()) return null;
|
|
2940
|
-
const c =
|
|
2942
|
+
const c = cs.exec(f);
|
|
2941
2943
|
return c ? {
|
|
2942
2944
|
leadOffset: c.index + c[1].length,
|
|
2943
2945
|
matchingString: c[3],
|
|
2944
2946
|
replaceableString: c[2] + c[3]
|
|
2945
2947
|
} : null;
|
|
2946
|
-
}, []),
|
|
2947
|
-
(
|
|
2948
|
-
|
|
2948
|
+
}, []), h = H(
|
|
2949
|
+
(f, c, m) => {
|
|
2950
|
+
m(), s.update(
|
|
2949
2951
|
() => {
|
|
2950
2952
|
c?.remove();
|
|
2951
2953
|
},
|
|
2952
|
-
{ onUpdate: () =>
|
|
2954
|
+
{ onUpdate: () => f.command.run(s) }
|
|
2953
2955
|
);
|
|
2954
2956
|
},
|
|
2955
2957
|
[s]
|
|
@@ -2958,26 +2960,26 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2958
2960
|
/* @__PURE__ */ l(
|
|
2959
2961
|
pt,
|
|
2960
2962
|
{
|
|
2961
|
-
onQueryChange:
|
|
2962
|
-
onSelectOption:
|
|
2963
|
+
onQueryChange: u,
|
|
2964
|
+
onSelectOption: h,
|
|
2963
2965
|
triggerFn: g,
|
|
2964
|
-
options:
|
|
2966
|
+
options: x,
|
|
2965
2967
|
parent: e,
|
|
2966
2968
|
commandPriority: Z,
|
|
2967
2969
|
preselectFirstItem: !!a,
|
|
2968
|
-
menuRenderFn: (
|
|
2969
|
-
const T =
|
|
2970
|
-
return !T || !
|
|
2970
|
+
menuRenderFn: (f, { selectedIndex: c, selectOptionAndCleanUp: m, setHighlightedIndex: _ }) => {
|
|
2971
|
+
const T = f.current;
|
|
2972
|
+
return !T || !x.length ? null : /* @__PURE__ */ l(
|
|
2971
2973
|
yt,
|
|
2972
2974
|
{
|
|
2973
2975
|
editor: s,
|
|
2974
2976
|
anchor: T,
|
|
2975
2977
|
placement: t,
|
|
2976
2978
|
className: "slash-menu",
|
|
2977
|
-
options:
|
|
2979
|
+
options: x,
|
|
2978
2980
|
selectedIndex: c,
|
|
2979
|
-
onSelect:
|
|
2980
|
-
onHighlight:
|
|
2981
|
+
onSelect: m,
|
|
2982
|
+
onHighlight: _,
|
|
2981
2983
|
getGroup: (E) => E.command.group,
|
|
2982
2984
|
renderOption: ({ command: E }) => /* @__PURE__ */ S(me, { children: [
|
|
2983
2985
|
/* @__PURE__ */ l(J, { icon: E.icon, className: "image" }),
|
|
@@ -2996,26 +2998,26 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
2996
2998
|
type: "file",
|
|
2997
2999
|
multiple: !0,
|
|
2998
3000
|
hidden: !0,
|
|
2999
|
-
onChange: (
|
|
3000
|
-
const c = Array.from(
|
|
3001
|
-
c.length && o(c),
|
|
3001
|
+
onChange: (f) => {
|
|
3002
|
+
const c = Array.from(f.target.files || []);
|
|
3003
|
+
c.length && o(c), f.target.value = "";
|
|
3002
3004
|
}
|
|
3003
3005
|
}
|
|
3004
3006
|
)
|
|
3005
3007
|
] });
|
|
3006
|
-
},
|
|
3008
|
+
}, V = (t) => {
|
|
3007
3009
|
try {
|
|
3008
3010
|
return decodeURIComponent(t.replace(/\+/g, " "));
|
|
3009
3011
|
} catch {
|
|
3010
3012
|
return t;
|
|
3011
3013
|
}
|
|
3012
3014
|
}, le = (t) => {
|
|
3013
|
-
const e =
|
|
3015
|
+
const e = V(t || "").replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
|
|
3014
3016
|
return e ? e.charAt(0).toUpperCase() + e.slice(1) : "";
|
|
3015
3017
|
}, xt = (t) => t.slice(0, 7), Rn = (t) => {
|
|
3016
3018
|
const e = t.match(/^#L(\d+)(?:C\d+)?(?:-L(\d+))?/);
|
|
3017
3019
|
return e ? e[2] ? `:${e[1]}-${e[2]}` : `:${e[1]}` : "";
|
|
3018
|
-
}, In = (t) =>
|
|
3020
|
+
}, In = (t) => V(t[t.length - 1] || ""), gs = /* @__PURE__ */ new Set([
|
|
3019
3021
|
"about",
|
|
3020
3022
|
"apps",
|
|
3021
3023
|
"collections",
|
|
@@ -3036,9 +3038,9 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3036
3038
|
"sponsors",
|
|
3037
3039
|
"topics",
|
|
3038
3040
|
"trending"
|
|
3039
|
-
]),
|
|
3041
|
+
]), hs = (t, e) => {
|
|
3040
3042
|
const [n, o, r, ...i] = e;
|
|
3041
|
-
if (!n ||
|
|
3043
|
+
if (!n || gs.has(n)) return null;
|
|
3042
3044
|
if (!o) return n;
|
|
3043
3045
|
switch (r) {
|
|
3044
3046
|
case void 0:
|
|
@@ -3050,13 +3052,13 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3050
3052
|
case "commit":
|
|
3051
3053
|
return i[0] ? `${o}@${xt(i[0])}` : null;
|
|
3052
3054
|
case "compare":
|
|
3053
|
-
return i.length ? `${o} ${
|
|
3055
|
+
return i.length ? `${o} ${V(i.join("/"))}` : null;
|
|
3054
3056
|
case "releases":
|
|
3055
|
-
return i[0] === "tag" && i[1] ? `${o} ${
|
|
3057
|
+
return i[0] === "tag" && i[1] ? `${o} ${V(i[1])}` : `${o} releases`;
|
|
3056
3058
|
case "tree":
|
|
3057
3059
|
case "blob": {
|
|
3058
3060
|
const s = i.slice(1);
|
|
3059
|
-
return s.length ? `${o}/${In(s)}${Rn(t.hash)}` : i[0] ? `${o}@${
|
|
3061
|
+
return s.length ? `${o}/${In(s)}${Rn(t.hash)}` : i[0] ? `${o}@${V(i[0])}` : null;
|
|
3060
3062
|
}
|
|
3061
3063
|
case "actions":
|
|
3062
3064
|
return i[0] === "runs" && i[1] ? `${o} run ${i[1]}` : `${o} actions`;
|
|
@@ -3065,7 +3067,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3065
3067
|
default:
|
|
3066
3068
|
return null;
|
|
3067
3069
|
}
|
|
3068
|
-
},
|
|
3070
|
+
}, fs = (t, e) => {
|
|
3069
3071
|
const n = e.indexOf("-");
|
|
3070
3072
|
if (n < 2) return e.length >= 2 ? e[e.length - 1] : null;
|
|
3071
3073
|
const o = e[n - 1], [r, i, ...s] = e.slice(n + 1);
|
|
@@ -3078,7 +3080,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3078
3080
|
return i ? `${o}@${xt(i)}` : null;
|
|
3079
3081
|
case "tags":
|
|
3080
3082
|
case "releases":
|
|
3081
|
-
return i ? `${o} ${
|
|
3083
|
+
return i ? `${o} ${V(i)}` : null;
|
|
3082
3084
|
case "blob":
|
|
3083
3085
|
case "tree":
|
|
3084
3086
|
return s.length ? `${o}/${In(s)}${Rn(t.hash)}` : null;
|
|
@@ -3087,60 +3089,60 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3087
3089
|
default:
|
|
3088
3090
|
return null;
|
|
3089
3091
|
}
|
|
3090
|
-
},
|
|
3092
|
+
}, bs = (t, e) => {
|
|
3091
3093
|
const [, n, o, r] = e;
|
|
3092
3094
|
return n ? o === "pull-requests" && r ? `${n} #${r}` : o === "issues" && r ? `${n} #${r}` : o === "commits" && r ? `${n}@${xt(r)}` : o ? null : n : null;
|
|
3093
|
-
}, jt = /^[A-Z][A-Z0-9_]+-\d+$/,
|
|
3095
|
+
}, jt = /^[A-Z][A-Z0-9_]+-\d+$/, ys = (t, e) => {
|
|
3094
3096
|
const n = e.find((o) => jt.test(o)) || t.searchParams.get("selectedIssue");
|
|
3095
3097
|
if (n && jt.test(n)) return n;
|
|
3096
3098
|
if (e[0] === "wiki") {
|
|
3097
3099
|
const o = e.indexOf("pages"), r = o >= 0 ? e[o + 2] : void 0;
|
|
3098
|
-
if (r) return
|
|
3100
|
+
if (r) return V(r);
|
|
3099
3101
|
if (e[1] === "spaces" && e[2]) return `${e[2]} space`;
|
|
3100
3102
|
}
|
|
3101
3103
|
return null;
|
|
3102
|
-
},
|
|
3104
|
+
}, vs = (t, e) => {
|
|
3103
3105
|
const [, n, o, r] = e;
|
|
3104
3106
|
return n === "issue" && o ? r ? `${o} ${le(r)}` : o : n === "project" && o ? le(o.replace(/-[0-9a-f]{8,}$/, "")) : null;
|
|
3105
|
-
},
|
|
3107
|
+
}, xs = (t, e) => {
|
|
3106
3108
|
const o = e[e.length - 1]?.replace(/-?[0-9a-f]{32}$/i, "");
|
|
3107
3109
|
return o ? le(o) : null;
|
|
3108
|
-
}, xs = (t, e) => {
|
|
3109
|
-
const [n, , o] = e;
|
|
3110
|
-
return ["file", "design", "proto", "board", "slides"].includes(n || "") && o ? `${Q(o).replace(/-/g, " ")} (Figma)` : null;
|
|
3111
3110
|
}, ks = (t, e) => {
|
|
3112
3111
|
const [n, , o] = e;
|
|
3113
|
-
return
|
|
3112
|
+
return ["file", "design", "proto", "board", "slides"].includes(n || "") && o ? `${V(o).replace(/-/g, " ")} (Figma)` : null;
|
|
3114
3113
|
}, ws = (t, e) => {
|
|
3114
|
+
const [n, , o] = e;
|
|
3115
|
+
return !o || !["c", "b"].includes(n || "") ? null : le(n === "c" ? o.replace(/^\d+-/, "") : o);
|
|
3116
|
+
}, _s = (t, e) => {
|
|
3115
3117
|
const n = e.indexOf("detail");
|
|
3116
3118
|
if (n >= 0 && e[n + 1] && /^\d+$/.test(e[n + 2] || ""))
|
|
3117
|
-
return `${
|
|
3119
|
+
return `${V(e[n + 1]).replace(/_/g, " ")} ${e[n + 2]}`;
|
|
3118
3120
|
const o = t.hash.match(/^#([A-Za-z]+(?:_[A-Za-z]+)*)_(\d+)/);
|
|
3119
3121
|
return o ? `${o[1].replace(/_/g, " ")} ${o[2]}` : null;
|
|
3120
|
-
},
|
|
3122
|
+
}, Es = (t, e) => e[0] === "questions" && e[2] ? le(e[2]) : null, Cs = (t, e) => e[0] === "t" && e[1] && !/^\d+$/.test(e[1]) ? le(e[1]) : null, Ts = {
|
|
3121
3123
|
document: "Google Doc",
|
|
3122
3124
|
spreadsheets: "Google Sheet",
|
|
3123
3125
|
presentation: "Google Slides",
|
|
3124
3126
|
forms: "Google Form",
|
|
3125
3127
|
drawings: "Google Drawing"
|
|
3126
|
-
},
|
|
3128
|
+
}, Ls = (t, e) => t.hostname === "docs.google.com" ? Ts[e[0]] ?? null : e.includes("folders") ? "Google Drive folder" : e[0] === "file" ? "Google Drive file" : null, Ms = (t, e) => {
|
|
3127
3129
|
const n = e[e.length - 1];
|
|
3128
|
-
return e.length >= 3 && n?.includes(".") ?
|
|
3129
|
-
},
|
|
3130
|
-
[/^(www\.)?github\.com$/,
|
|
3131
|
-
[/^(www\.)?gitlab\.com$|^gitlab\./,
|
|
3132
|
-
[/^(www\.)?bitbucket\.org$/,
|
|
3133
|
-
[/\.atlassian\.net$/,
|
|
3134
|
-
[/^(www\.)?linear\.app$/,
|
|
3135
|
-
[/^(www\.)?notion\.so$|\.notion\.site$/,
|
|
3136
|
-
[/^(www\.)?figma\.com$/,
|
|
3137
|
-
[/^(www\.)?trello\.com$/,
|
|
3138
|
-
[/\.shotgrid\.autodesk\.com$|\.shotgunstudio\.com$/,
|
|
3139
|
-
[/^(www\.)?stackoverflow\.com$/,
|
|
3140
|
-
[/^community\.ynput\.io$|^(forum|forums|community|discourse)\./,
|
|
3141
|
-
[/^(docs|drive)\.google\.com$/,
|
|
3142
|
-
[/^(www\.)?dropbox\.com$/,
|
|
3143
|
-
],
|
|
3130
|
+
return e.length >= 3 && n?.includes(".") ? V(n) : null;
|
|
3131
|
+
}, $s = [
|
|
3132
|
+
[/^(www\.)?github\.com$/, hs],
|
|
3133
|
+
[/^(www\.)?gitlab\.com$|^gitlab\./, fs],
|
|
3134
|
+
[/^(www\.)?bitbucket\.org$/, bs],
|
|
3135
|
+
[/\.atlassian\.net$/, ys],
|
|
3136
|
+
[/^(www\.)?linear\.app$/, vs],
|
|
3137
|
+
[/^(www\.)?notion\.so$|\.notion\.site$/, xs],
|
|
3138
|
+
[/^(www\.)?figma\.com$/, ks],
|
|
3139
|
+
[/^(www\.)?trello\.com$/, ws],
|
|
3140
|
+
[/\.shotgrid\.autodesk\.com$|\.shotgunstudio\.com$/, _s],
|
|
3141
|
+
[/^(www\.)?stackoverflow\.com$/, Es],
|
|
3142
|
+
[/^community\.ynput\.io$|^(forum|forums|community|discourse)\./, Cs],
|
|
3143
|
+
[/^(docs|drive)\.google\.com$/, Ls],
|
|
3144
|
+
[/^(www\.)?dropbox\.com$/, Ms]
|
|
3145
|
+
], Ns = (t) => {
|
|
3144
3146
|
if (ze(t)) return $n;
|
|
3145
3147
|
let e;
|
|
3146
3148
|
try {
|
|
@@ -3149,11 +3151,11 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3149
3151
|
return null;
|
|
3150
3152
|
}
|
|
3151
3153
|
if (e.protocol !== "https:" && e.protocol !== "http:") return null;
|
|
3152
|
-
const n = e.hostname.toLowerCase(), o =
|
|
3154
|
+
const n = e.hostname.toLowerCase(), o = $s.find(([s]) => s.test(n))?.[1];
|
|
3153
3155
|
if (!o) return null;
|
|
3154
3156
|
const r = e.pathname.split("/").filter(Boolean);
|
|
3155
3157
|
return o(e, r)?.replace(/[[\]]/g, "").trim() || null;
|
|
3156
|
-
},
|
|
3158
|
+
}, Ss = () => {
|
|
3157
3159
|
const [t] = A();
|
|
3158
3160
|
return R(
|
|
3159
3161
|
() => t.registerCommand(
|
|
@@ -3162,7 +3164,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3162
3164
|
if (!(e instanceof ClipboardEvent) || !e.clipboardData) return !1;
|
|
3163
3165
|
const n = e.clipboardData.getData("text/plain").trim();
|
|
3164
3166
|
if (!n || /\s/.test(n)) return !1;
|
|
3165
|
-
const o =
|
|
3167
|
+
const o = Ns(n);
|
|
3166
3168
|
if (!o) return !1;
|
|
3167
3169
|
const r = M();
|
|
3168
3170
|
return !$(r) || !r.isCollapsed() || Be() || W(r.anchor.getNode(), ne) ? !1 : (e.preventDefault(), r.insertNodes([cn(n).append(Ce(o))]), !0);
|
|
@@ -3172,7 +3174,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3172
3174
|
),
|
|
3173
3175
|
[t]
|
|
3174
3176
|
), null;
|
|
3175
|
-
},
|
|
3177
|
+
}, Os = () => {
|
|
3176
3178
|
const [t] = A();
|
|
3177
3179
|
return R(() => {
|
|
3178
3180
|
const e = (n) => {
|
|
@@ -3191,7 +3193,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3191
3193
|
t.registerMutationListener(un, e, { skipInitialization: !1 })
|
|
3192
3194
|
);
|
|
3193
3195
|
}, [t]), null;
|
|
3194
|
-
},
|
|
3196
|
+
}, Rs = (t) => {
|
|
3195
3197
|
const e = window.getSelection(), n = e?.rangeCount ? e.getRangeAt(0) : null;
|
|
3196
3198
|
let o = n?.getBoundingClientRect();
|
|
3197
3199
|
if (!o || !o.width && !o.height) {
|
|
@@ -3199,48 +3201,48 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3199
3201
|
o = (i && t?.contains(i) ? i : t)?.getBoundingClientRect();
|
|
3200
3202
|
}
|
|
3201
3203
|
return o ? { top: o.bottom + 6, left: o.left } : null;
|
|
3202
|
-
},
|
|
3204
|
+
}, Is = ({ onUploadMedia: t, onFiles: e }) => {
|
|
3203
3205
|
const [n] = A(), o = O(null), r = O({ onUploadMedia: t, onFiles: e });
|
|
3204
3206
|
r.current = { onUploadMedia: t, onFiles: e };
|
|
3205
3207
|
const [i, s] = U(null), a = O(i);
|
|
3206
3208
|
a.current = i;
|
|
3207
|
-
const
|
|
3209
|
+
const u = H(
|
|
3208
3210
|
(g) => {
|
|
3209
|
-
for (const
|
|
3210
|
-
const
|
|
3211
|
+
for (const h of g) {
|
|
3212
|
+
const f = URL.createObjectURL(h);
|
|
3211
3213
|
let c = null;
|
|
3212
3214
|
n.update(() => {
|
|
3213
|
-
const
|
|
3214
|
-
src:
|
|
3215
|
-
alt:
|
|
3216
|
-
mime:
|
|
3215
|
+
const m = Ae({
|
|
3216
|
+
src: f,
|
|
3217
|
+
alt: h.name,
|
|
3218
|
+
mime: h.type || null,
|
|
3217
3219
|
uploading: !0
|
|
3218
3220
|
});
|
|
3219
|
-
Sn(
|
|
3220
|
-
}), r.current.onUploadMedia(
|
|
3221
|
+
Sn(m), c = m.getKey();
|
|
3222
|
+
}), r.current.onUploadMedia(h).then(({ src: m, name: _, mime: T }) => {
|
|
3221
3223
|
n.update(() => {
|
|
3222
3224
|
const E = c ? se(c) : null;
|
|
3223
|
-
Xe(E) && E.setUploaded(
|
|
3225
|
+
Xe(E) && E.setUploaded(m, { alt: _, mime: T });
|
|
3224
3226
|
});
|
|
3225
|
-
}).catch((
|
|
3226
|
-
console.warn("Media upload failed",
|
|
3227
|
-
const
|
|
3228
|
-
Xe(
|
|
3227
|
+
}).catch((m) => {
|
|
3228
|
+
console.warn("Media upload failed", m), n.update(() => {
|
|
3229
|
+
const _ = c ? se(c) : null;
|
|
3230
|
+
Xe(_) && _.remove();
|
|
3229
3231
|
});
|
|
3230
|
-
}).finally(() => URL.revokeObjectURL(
|
|
3232
|
+
}).finally(() => URL.revokeObjectURL(f));
|
|
3231
3233
|
}
|
|
3232
3234
|
},
|
|
3233
3235
|
[n]
|
|
3234
3236
|
), d = H(() => {
|
|
3235
3237
|
const g = a.current;
|
|
3236
|
-
g && (s(null),
|
|
3237
|
-
}, [n,
|
|
3238
|
+
g && (s(null), u(g.files), n.focus());
|
|
3239
|
+
}, [n, u]);
|
|
3238
3240
|
R(() => {
|
|
3239
3241
|
const g = () => (a.current && s(null), !1);
|
|
3240
3242
|
return q(
|
|
3241
3243
|
n.registerCommand(
|
|
3242
3244
|
Ht,
|
|
3243
|
-
(
|
|
3245
|
+
(h) => (u(h), !0),
|
|
3244
3246
|
Z
|
|
3245
3247
|
),
|
|
3246
3248
|
n.registerCommand(
|
|
@@ -3251,36 +3253,36 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3251
3253
|
// before the attachments handler: everything stays an attachment, media gets the prompt
|
|
3252
3254
|
n.registerCommand(
|
|
3253
3255
|
rn,
|
|
3254
|
-
(
|
|
3255
|
-
const
|
|
3256
|
-
if (!
|
|
3257
|
-
r.current.onFiles(
|
|
3258
|
-
const c =
|
|
3259
|
-
return c && s({ files:
|
|
3256
|
+
(h) => {
|
|
3257
|
+
const f = h.filter(Ir);
|
|
3258
|
+
if (!f.length || !r.current.onFiles) return !1;
|
|
3259
|
+
r.current.onFiles(h);
|
|
3260
|
+
const c = Rs(n.getRootElement());
|
|
3261
|
+
return c && s({ files: f, rect: c }), !0;
|
|
3260
3262
|
},
|
|
3261
3263
|
Z
|
|
3262
3264
|
),
|
|
3263
3265
|
// tab switches the pasted media to inline (before list indenting and menus)
|
|
3264
3266
|
n.registerCommand(
|
|
3265
|
-
|
|
3266
|
-
(
|
|
3267
|
-
|
|
3267
|
+
uo,
|
|
3268
|
+
(h) => !a.current || h.shiftKey ? !1 : (h.preventDefault(), d(), !0),
|
|
3269
|
+
Qe
|
|
3268
3270
|
),
|
|
3269
3271
|
n.registerCommand(
|
|
3270
3272
|
tn,
|
|
3271
3273
|
() => a.current ? (s(null), !0) : !1,
|
|
3272
|
-
|
|
3274
|
+
Qe
|
|
3273
3275
|
),
|
|
3274
3276
|
n.registerTextContentListener(g),
|
|
3275
3277
|
n.registerCommand(lt, g, D),
|
|
3276
3278
|
n.registerCommand(ct, g, D)
|
|
3277
3279
|
);
|
|
3278
|
-
}, [n,
|
|
3279
|
-
const
|
|
3280
|
+
}, [n, u, d]);
|
|
3281
|
+
const v = i?.files.length ?? 0, x = !!i?.files.every((g) => g.type.startsWith("video/"));
|
|
3280
3282
|
return /* @__PURE__ */ S(me, { children: [
|
|
3281
3283
|
i && fe(
|
|
3282
3284
|
/* @__PURE__ */ S(
|
|
3283
|
-
|
|
3285
|
+
ki,
|
|
3284
3286
|
{
|
|
3285
3287
|
className: P("md-popover md-inline-prompt", ae),
|
|
3286
3288
|
style: { top: i.rect.top, left: i.rect.left },
|
|
@@ -3288,10 +3290,10 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3288
3290
|
onMouseDown: (g) => g.preventDefault(),
|
|
3289
3291
|
onClick: d,
|
|
3290
3292
|
children: [
|
|
3291
|
-
/* @__PURE__ */ l(J, { icon:
|
|
3293
|
+
/* @__PURE__ */ l(J, { icon: x ? "movie" : "image" }),
|
|
3292
3294
|
/* @__PURE__ */ S("span", { children: [
|
|
3293
3295
|
"Show ",
|
|
3294
|
-
|
|
3296
|
+
v > 1 ? `${v} files` : x ? "video" : "image",
|
|
3295
3297
|
" inline"
|
|
3296
3298
|
] }),
|
|
3297
3299
|
/* @__PURE__ */ l("kbd", { children: "Tab" })
|
|
@@ -3309,28 +3311,28 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3309
3311
|
multiple: !0,
|
|
3310
3312
|
hidden: !0,
|
|
3311
3313
|
onChange: (g) => {
|
|
3312
|
-
const
|
|
3313
|
-
|
|
3314
|
+
const h = Array.from(g.target.files || []);
|
|
3315
|
+
h.length && n.dispatchCommand(Ht, h), g.target.value = "";
|
|
3314
3316
|
}
|
|
3315
3317
|
}
|
|
3316
3318
|
)
|
|
3317
3319
|
] });
|
|
3318
|
-
},
|
|
3320
|
+
}, As = new RegExp(
|
|
3319
3321
|
`\\[[^\\]\\n]+\\]\\(@?(${ht.join("|")}):[^)\\s]+\\)`
|
|
3320
|
-
),
|
|
3322
|
+
), Ds = ({ onFiles: t }) => {
|
|
3321
3323
|
const [e] = A(), n = O(t);
|
|
3322
3324
|
return n.current = t, R(() => {
|
|
3323
3325
|
const o = (r) => {
|
|
3324
3326
|
if (!(r instanceof ClipboardEvent)) return !1;
|
|
3325
3327
|
const i = M();
|
|
3326
3328
|
if (!$(i) || i.isCollapsed() || !i.getNodes().some(hn)) return !1;
|
|
3327
|
-
const s =
|
|
3328
|
-
return s["text/plain"] =
|
|
3329
|
+
const s = pr(i);
|
|
3330
|
+
return s["text/plain"] = rr(Pe, i), gr(e, r, s), !0;
|
|
3329
3331
|
};
|
|
3330
3332
|
return q(
|
|
3331
|
-
e.registerCommand(
|
|
3333
|
+
e.registerCommand(mo, o, D),
|
|
3332
3334
|
e.registerCommand(
|
|
3333
|
-
|
|
3335
|
+
po,
|
|
3334
3336
|
(r) => {
|
|
3335
3337
|
if (!o(r)) return !1;
|
|
3336
3338
|
const i = M();
|
|
@@ -3345,11 +3347,11 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3345
3347
|
const { clipboardData: i } = r;
|
|
3346
3348
|
if (i.types.includes("application/x-lexical-editor") || i.types.includes("text/html")) return !1;
|
|
3347
3349
|
const s = i.getData("text/plain");
|
|
3348
|
-
if (!s || !
|
|
3350
|
+
if (!s || !As.test(s)) return !1;
|
|
3349
3351
|
const a = M();
|
|
3350
3352
|
if (!$(a)) return !1;
|
|
3351
3353
|
r.preventDefault();
|
|
3352
|
-
const
|
|
3354
|
+
const u = Cn(s), d = u.length === 1 && Y(u[0]) ? u[0].getChildren() : u;
|
|
3353
3355
|
return a.insertNodes(d), !0;
|
|
3354
3356
|
},
|
|
3355
3357
|
D
|
|
@@ -3361,18 +3363,18 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3361
3363
|
)
|
|
3362
3364
|
);
|
|
3363
3365
|
}, [e]), null;
|
|
3364
|
-
},
|
|
3366
|
+
}, Ps = ({ value: t, onChange: e, handleRef: n }) => {
|
|
3365
3367
|
const [o] = A(), r = O(t), i = O(e);
|
|
3366
3368
|
return i.current = e, R(
|
|
3367
|
-
() => o.registerUpdateListener(({ editorState: s, dirtyElements: a, dirtyLeaves:
|
|
3368
|
-
if (d.has("markdown-value") || a.size === 0 &&
|
|
3369
|
-
const
|
|
3370
|
-
|
|
3369
|
+
() => o.registerUpdateListener(({ editorState: s, dirtyElements: a, dirtyLeaves: u, tags: d }) => {
|
|
3370
|
+
if (d.has("markdown-value") || a.size === 0 && u.size === 0) return;
|
|
3371
|
+
const v = s.read(() => Rt());
|
|
3372
|
+
v !== r.current && (r.current = v, i.current?.(v));
|
|
3371
3373
|
}),
|
|
3372
3374
|
[o]
|
|
3373
3375
|
), R(() => {
|
|
3374
|
-
t === void 0 || t === r.current || (r.current = t, o.update(() => et(t), { tag: "markdown-value" }), o.dispatchCommand(
|
|
3375
|
-
}, [o, t]),
|
|
3376
|
+
t === void 0 || t === r.current || (r.current = t, o.update(() => et(t), { tag: "markdown-value" }), o.dispatchCommand(go, void 0));
|
|
3377
|
+
}, [o, t]), Xn(
|
|
3376
3378
|
n,
|
|
3377
3379
|
() => ({
|
|
3378
3380
|
getEditor: () => o,
|
|
@@ -3385,32 +3387,32 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3385
3387
|
clear: () => {
|
|
3386
3388
|
o.update(() => ie().clear());
|
|
3387
3389
|
},
|
|
3388
|
-
isEmpty: () => o.getEditorState().read(() =>
|
|
3390
|
+
isEmpty: () => o.getEditorState().read(() => pi()),
|
|
3389
3391
|
insertMentionTrigger: (s) => {
|
|
3390
3392
|
o.focus(() => o.dispatchCommand(vt, s));
|
|
3391
3393
|
}
|
|
3392
3394
|
}),
|
|
3393
3395
|
[o]
|
|
3394
3396
|
), null;
|
|
3395
|
-
},
|
|
3397
|
+
}, Bs = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/, zs = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/, Fs = [
|
|
3396
3398
|
Lt(
|
|
3397
|
-
|
|
3399
|
+
Bs,
|
|
3398
3400
|
(t) => t.startsWith("http") ? t : `https://${t}`
|
|
3399
3401
|
),
|
|
3400
|
-
Lt(
|
|
3401
|
-
],
|
|
3402
|
-
$o,
|
|
3402
|
+
Lt(zs, (t) => `mailto:${t}`)
|
|
3403
|
+
], Ks = (t) => /^(https?:|mailto:|\/|#)/i.test(t), Us = [
|
|
3403
3404
|
No,
|
|
3405
|
+
So,
|
|
3404
3406
|
an,
|
|
3405
|
-
|
|
3407
|
+
Po,
|
|
3406
3408
|
dn,
|
|
3407
3409
|
un,
|
|
3408
|
-
Bo,
|
|
3409
3410
|
zo,
|
|
3411
|
+
Fo,
|
|
3410
3412
|
be,
|
|
3411
3413
|
ye,
|
|
3412
3414
|
ve
|
|
3413
|
-
],
|
|
3415
|
+
], Hs = ({ editable: t }) => {
|
|
3414
3416
|
const [e] = A();
|
|
3415
3417
|
return R(() => e.setEditable(t), [e, t]), null;
|
|
3416
3418
|
}, de = {
|
|
@@ -3433,7 +3435,7 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3433
3435
|
minHeight: 20,
|
|
3434
3436
|
maxHeight: 400
|
|
3435
3437
|
}
|
|
3436
|
-
},
|
|
3438
|
+
}, js = Qt(
|
|
3437
3439
|
({
|
|
3438
3440
|
variant: t = "document",
|
|
3439
3441
|
value: e,
|
|
@@ -3443,23 +3445,23 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3443
3445
|
submitOnEnter: i = de[t].submitOnEnter,
|
|
3444
3446
|
onEscape: s,
|
|
3445
3447
|
onFiles: a,
|
|
3446
|
-
onUploadMedia:
|
|
3448
|
+
onUploadMedia: u,
|
|
3447
3449
|
mentions: d,
|
|
3448
|
-
mentionMenuParent:
|
|
3449
|
-
mentionPlacement:
|
|
3450
|
+
mentionMenuParent: v,
|
|
3451
|
+
mentionPlacement: x = de[t].mentionPlacement,
|
|
3450
3452
|
emoji: g = !0,
|
|
3451
|
-
slashCommands:
|
|
3452
|
-
commands:
|
|
3453
|
+
slashCommands: h = !0,
|
|
3454
|
+
commands: f,
|
|
3453
3455
|
onMentionClick: c,
|
|
3454
|
-
onMentionHover:
|
|
3455
|
-
toolbar:
|
|
3456
|
+
onMentionHover: m,
|
|
3457
|
+
toolbar: _ = de[t].toolbar,
|
|
3456
3458
|
floatingToolbar: T = de[t].floatingToolbar,
|
|
3457
3459
|
toolbarStart: E,
|
|
3458
3460
|
toolbarEnd: p,
|
|
3459
|
-
footer:
|
|
3460
|
-
actions:
|
|
3461
|
+
footer: y,
|
|
3462
|
+
actions: k,
|
|
3461
3463
|
autoFocus: C,
|
|
3462
|
-
readOnly:
|
|
3464
|
+
readOnly: b,
|
|
3463
3465
|
bordered: L = !0,
|
|
3464
3466
|
minHeight: I = de[t].minHeight,
|
|
3465
3467
|
maxHeight: F = de[t].maxHeight,
|
|
@@ -3470,15 +3472,15 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3470
3472
|
children: ke
|
|
3471
3473
|
}, Te) => {
|
|
3472
3474
|
const we = _e(
|
|
3473
|
-
() =>
|
|
3475
|
+
() => ho({
|
|
3474
3476
|
name: N,
|
|
3475
3477
|
namespace: N,
|
|
3476
|
-
theme:
|
|
3477
|
-
nodes:
|
|
3478
|
-
editable: !
|
|
3478
|
+
theme: wr,
|
|
3479
|
+
nodes: Us,
|
|
3480
|
+
editable: !b,
|
|
3479
3481
|
$initialEditorState: () => et(e || ""),
|
|
3480
3482
|
// the react extension renders the decorator nodes (media, youtube)
|
|
3481
|
-
dependencies: [
|
|
3483
|
+
dependencies: [$o],
|
|
3482
3484
|
onError: (Le) => {
|
|
3483
3485
|
console.error("[MarkdownEditor]", Le);
|
|
3484
3486
|
}
|
|
@@ -3488,104 +3490,104 @@ const ds = typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform),
|
|
|
3488
3490
|
);
|
|
3489
3491
|
return (
|
|
3490
3492
|
// the content editable is rendered below, inside the editor layout
|
|
3491
|
-
/* @__PURE__ */ S(
|
|
3493
|
+
/* @__PURE__ */ S(fo, { extension: we, contentEditable: null, children: [
|
|
3492
3494
|
/* @__PURE__ */ S(
|
|
3493
|
-
|
|
3495
|
+
fi,
|
|
3494
3496
|
{
|
|
3495
3497
|
className: P("md-editor", "block-shortcuts", `md-editor-${t}`, G, {
|
|
3496
3498
|
bordered: L,
|
|
3497
|
-
readOnly:
|
|
3499
|
+
readOnly: b
|
|
3498
3500
|
}),
|
|
3499
3501
|
style: ce,
|
|
3500
3502
|
children: [
|
|
3501
|
-
|
|
3503
|
+
_ && !b && /* @__PURE__ */ l(
|
|
3502
3504
|
zt,
|
|
3503
3505
|
{
|
|
3504
|
-
layout: Array.isArray(
|
|
3506
|
+
layout: Array.isArray(_) ? _ : void 0,
|
|
3505
3507
|
start: E,
|
|
3506
3508
|
end: p
|
|
3507
3509
|
}
|
|
3508
3510
|
),
|
|
3509
|
-
/* @__PURE__ */ S(
|
|
3510
|
-
/* @__PURE__ */ l(
|
|
3511
|
-
|
|
3511
|
+
/* @__PURE__ */ S(Ei, { children: [
|
|
3512
|
+
/* @__PURE__ */ l(Ti, { style: { minHeight: I, maxHeight: F }, children: /* @__PURE__ */ l(Mi, { children: /* @__PURE__ */ l(
|
|
3513
|
+
bo,
|
|
3512
3514
|
{
|
|
3513
3515
|
className: P("md-content", xe),
|
|
3514
3516
|
style: { minHeight: I },
|
|
3515
3517
|
"aria-placeholder": o,
|
|
3516
|
-
placeholder: /* @__PURE__ */ l(
|
|
3518
|
+
placeholder: /* @__PURE__ */ l(Li, { className: "md-placeholder", children: o })
|
|
3517
3519
|
}
|
|
3518
3520
|
) }) }),
|
|
3519
|
-
|
|
3521
|
+
k && /* @__PURE__ */ l("div", { className: "md-actions", children: k })
|
|
3520
3522
|
] }),
|
|
3521
|
-
|
|
3523
|
+
y
|
|
3522
3524
|
]
|
|
3523
3525
|
}
|
|
3524
3526
|
),
|
|
3525
|
-
/* @__PURE__ */ l(
|
|
3526
|
-
/* @__PURE__ */ l(bo, {}),
|
|
3527
|
+
/* @__PURE__ */ l(Hs, { editable: !b }),
|
|
3527
3528
|
/* @__PURE__ */ l(yo, {}),
|
|
3528
3529
|
/* @__PURE__ */ l(vo, {}),
|
|
3529
|
-
/* @__PURE__ */ l(
|
|
3530
|
-
/* @__PURE__ */ l(
|
|
3531
|
-
/* @__PURE__ */ l(ko, {
|
|
3532
|
-
/* @__PURE__ */ l(
|
|
3533
|
-
/* @__PURE__ */ l(
|
|
3534
|
-
|
|
3535
|
-
!
|
|
3536
|
-
/* @__PURE__ */ l(
|
|
3537
|
-
|
|
3538
|
-
!
|
|
3539
|
-
|
|
3540
|
-
/* @__PURE__ */ l(
|
|
3541
|
-
/* @__PURE__ */ l(
|
|
3530
|
+
/* @__PURE__ */ l(xo, {}),
|
|
3531
|
+
/* @__PURE__ */ l(Eo, { maxIndent: 5 }),
|
|
3532
|
+
/* @__PURE__ */ l(ko, { validateUrl: Ks }),
|
|
3533
|
+
/* @__PURE__ */ l(wo, { matchers: Fs }),
|
|
3534
|
+
/* @__PURE__ */ l(ns, {}),
|
|
3535
|
+
/* @__PURE__ */ l(Os, {}),
|
|
3536
|
+
!b && /* @__PURE__ */ l(is, {}),
|
|
3537
|
+
!b && /* @__PURE__ */ l(ss, {}),
|
|
3538
|
+
/* @__PURE__ */ l(ls, {}),
|
|
3539
|
+
!b && /* @__PURE__ */ l(rs, {}),
|
|
3540
|
+
!b && /* @__PURE__ */ l(Ss, {}),
|
|
3541
|
+
u && !b && /* @__PURE__ */ l(Is, { onUploadMedia: u, onFiles: a }),
|
|
3542
|
+
/* @__PURE__ */ l(_o, { transformers: Pe }),
|
|
3543
|
+
/* @__PURE__ */ l(Zi, {}),
|
|
3542
3544
|
/* @__PURE__ */ l(Vi, {}),
|
|
3543
|
-
/* @__PURE__ */ l(
|
|
3544
|
-
/* @__PURE__ */ l(
|
|
3545
|
-
/* @__PURE__ */ l(
|
|
3546
|
-
T && !
|
|
3545
|
+
/* @__PURE__ */ l(Ji, {}),
|
|
3546
|
+
/* @__PURE__ */ l(ts, {}),
|
|
3547
|
+
/* @__PURE__ */ l(es, { onSubmit: r, onEscape: s, submitOnEnter: i }),
|
|
3548
|
+
T && !b && /* @__PURE__ */ l(
|
|
3547
3549
|
zt,
|
|
3548
3550
|
{
|
|
3549
3551
|
floating: !0,
|
|
3550
|
-
layout: Array.isArray(T) ? T :
|
|
3552
|
+
layout: Array.isArray(T) ? T : Tr
|
|
3551
3553
|
}
|
|
3552
3554
|
),
|
|
3553
|
-
/* @__PURE__ */ l(
|
|
3554
|
-
/* @__PURE__ */ l(
|
|
3555
|
-
|
|
3556
|
-
|
|
3555
|
+
/* @__PURE__ */ l(Ds, { onFiles: a }),
|
|
3556
|
+
/* @__PURE__ */ l(Ps, { value: e, onChange: n, handleRef: Te }),
|
|
3557
|
+
h && !b && /* @__PURE__ */ l(
|
|
3558
|
+
ps,
|
|
3557
3559
|
{
|
|
3558
|
-
placement:
|
|
3559
|
-
menuParent:
|
|
3560
|
+
placement: x,
|
|
3561
|
+
menuParent: v,
|
|
3560
3562
|
mentionTriggers: d ? d.triggers ?? ["@", "@@", "@@@"] : [],
|
|
3561
3563
|
onFiles: a,
|
|
3562
|
-
canInsertMedia: !!
|
|
3563
|
-
customCommands:
|
|
3564
|
+
canInsertMedia: !!u,
|
|
3565
|
+
customCommands: f
|
|
3564
3566
|
}
|
|
3565
3567
|
),
|
|
3566
|
-
g && !
|
|
3568
|
+
g && !b && /* @__PURE__ */ l(ji, { placement: x, menuParent: v }),
|
|
3567
3569
|
d && /* @__PURE__ */ l(
|
|
3568
|
-
|
|
3570
|
+
zi,
|
|
3569
3571
|
{
|
|
3570
3572
|
source: d,
|
|
3571
|
-
menuParent:
|
|
3572
|
-
placement:
|
|
3573
|
+
menuParent: v,
|
|
3574
|
+
placement: x
|
|
3573
3575
|
}
|
|
3574
3576
|
),
|
|
3575
|
-
(c ||
|
|
3576
|
-
C && /* @__PURE__ */ l(
|
|
3577
|
+
(c || m) && /* @__PURE__ */ l(Gi, { onMentionClick: c, onMentionHover: m }),
|
|
3578
|
+
C && /* @__PURE__ */ l(Co, { defaultSelection: "rootEnd" }),
|
|
3577
3579
|
ke
|
|
3578
3580
|
] })
|
|
3579
3581
|
);
|
|
3580
3582
|
}
|
|
3581
3583
|
);
|
|
3582
|
-
|
|
3583
|
-
const
|
|
3584
|
+
js.displayName = "MarkdownEditor";
|
|
3585
|
+
const Gs = (t, e) => {
|
|
3584
3586
|
const n = t.item || t, o = e.item || e, r = new Date(n.createdAt), i = new Date(o.createdAt), s = Ie(r) && Ie(i), a = s && Yt(r, i);
|
|
3585
3587
|
return !s || a ? n.relevance > o.relevance ? -1 : n.relevance < o.relevance ? 1 : String(o.label).localeCompare(String(n.label)) : zn(i, r) ? -1 : 1;
|
|
3586
|
-
},
|
|
3588
|
+
}, Ws = (t, e) => t.relevance > e.relevance ? -1 : t.relevance < e.relevance ? 1 : t.label?.localeCompare(e.label), Ys = ["team:", "user:"], qs = (t) => {
|
|
3587
3589
|
if (!t) return { typeFilter: null, search: void 0 };
|
|
3588
|
-
for (const e of
|
|
3590
|
+
for (const e of Ys)
|
|
3589
3591
|
if (t.startsWith(e))
|
|
3590
3592
|
return {
|
|
3591
3593
|
typeFilter: e.slice(0, -1),
|
|
@@ -3593,16 +3595,20 @@ const js = (t, e) => {
|
|
|
3593
3595
|
search: t.slice(e.length) || void 0
|
|
3594
3596
|
};
|
|
3595
3597
|
return { typeFilter: null, search: t };
|
|
3596
|
-
},
|
|
3598
|
+
}, Qs = (t, e = {}, n) => {
|
|
3597
3599
|
if (!(t in e)) return [];
|
|
3598
3600
|
const o = e[t]() || [];
|
|
3599
|
-
let r =
|
|
3600
|
-
t === "@@" && (r =
|
|
3601
|
-
const { typeFilter: i, search: s } =
|
|
3602
|
-
|
|
3601
|
+
let r = Ws;
|
|
3602
|
+
t === "@@" && (r = Gs);
|
|
3603
|
+
const { typeFilter: i, search: s } = qs(n), a = i ? o.filter((h) => h.type === i) : o, u = Qn(s || "");
|
|
3604
|
+
if (!u.length) return a.sort(r);
|
|
3605
|
+
const d = (h, f) => Yn(h, f, {
|
|
3603
3606
|
keys: ["label", "context", "keywords"],
|
|
3604
3607
|
baseSort: r
|
|
3605
|
-
})
|
|
3608
|
+
}), v = u.map((h) => h.reduce(d, a)), x = /* @__PURE__ */ new Set(), g = Math.max(...v.map((h) => h.length));
|
|
3609
|
+
for (let h = 0; h < g; h++)
|
|
3610
|
+
v.forEach((f) => f[h] && x.add(f[h]));
|
|
3611
|
+
return [...x];
|
|
3606
3612
|
}, Vs = (t = [], e = []) => {
|
|
3607
3613
|
const n = t.map((r) => ({
|
|
3608
3614
|
type: "user",
|
|
@@ -3620,8 +3626,8 @@ const js = (t, e) => {
|
|
|
3620
3626
|
suffix: "Team"
|
|
3621
3627
|
}));
|
|
3622
3628
|
return [...n, ...o];
|
|
3623
|
-
},
|
|
3624
|
-
const o = e.find((
|
|
3629
|
+
}, Js = (t = [], e = []) => t.map((n) => {
|
|
3630
|
+
const o = e.find((x) => x.name === n.taskType), r = o?.icon || it("task"), i = o?.color, s = n.label || n.name, a = n.parent?.name, d = `${a} ${s} ${n.taskType}`, v = [n.name, n.taskType, n.label, n.parent?.name, d];
|
|
3625
3631
|
return {
|
|
3626
3632
|
type: "task",
|
|
3627
3633
|
id: n.id,
|
|
@@ -3629,16 +3635,16 @@ const js = (t, e) => {
|
|
|
3629
3635
|
context: a,
|
|
3630
3636
|
icon: r,
|
|
3631
3637
|
color: i,
|
|
3632
|
-
keywords:
|
|
3638
|
+
keywords: v,
|
|
3633
3639
|
relevance: n.relevance
|
|
3634
3640
|
};
|
|
3635
|
-
}),
|
|
3641
|
+
}), Xs = (t) => {
|
|
3636
3642
|
let e = Fn(t, { addSuffix: !0 });
|
|
3637
3643
|
return e = e.replace("about", ""), e = e.replace("minutes", "mins"), e = e.replace("minute", "min"), e = e.replace(" ago", ""), Yt(t, /* @__PURE__ */ new Date()) && (e = "Just now"), e;
|
|
3638
|
-
},
|
|
3644
|
+
}, Zs = (t = [], e) => t?.map((n) => {
|
|
3639
3645
|
if (!n.parent)
|
|
3640
3646
|
return null;
|
|
3641
|
-
const r = e.productTypes?.find((
|
|
3647
|
+
const r = e.productTypes?.find((v) => v.name === n.parent?.productType)?.icon || it("version"), i = n.parent?.name, s = n.name || n.version, a = n.createdAt && Xs(new Date(n.createdAt)), u = `${i} ${s} ${a}`, d = [n.name, n.version, n.parent?.name, u];
|
|
3642
3648
|
return {
|
|
3643
3649
|
type: "version",
|
|
3644
3650
|
id: n.id,
|
|
@@ -3650,25 +3656,25 @@ const js = (t, e) => {
|
|
|
3650
3656
|
keywords: d,
|
|
3651
3657
|
relevance: n.relevance
|
|
3652
3658
|
};
|
|
3653
|
-
}),
|
|
3659
|
+
}), jl = ({
|
|
3654
3660
|
suggestions: t = {},
|
|
3655
3661
|
// version options read the product types
|
|
3656
3662
|
project: e = { productTypes: [] },
|
|
3657
3663
|
taskTypes: n = [],
|
|
3658
3664
|
entityType: o
|
|
3659
3665
|
}) => ({
|
|
3660
|
-
getOptions: ({ trigger: r, search: i, filter: s }) =>
|
|
3666
|
+
getOptions: ({ trigger: r, search: i, filter: s }) => Qs(
|
|
3661
3667
|
r,
|
|
3662
3668
|
{
|
|
3663
3669
|
"@": () => Vs(t.users, t.teams),
|
|
3664
|
-
"@@": () =>
|
|
3665
|
-
"@@@": () =>
|
|
3670
|
+
"@@": () => Zs(t.versions, e),
|
|
3671
|
+
"@@@": () => Js(t.tasks, n)
|
|
3666
3672
|
},
|
|
3667
3673
|
// the helper understands `team:` / `user:` prefixes
|
|
3668
3674
|
(s ? `${s}:` : "") + i || void 0
|
|
3669
|
-
).filter((
|
|
3675
|
+
).filter((u) => !!u),
|
|
3670
3676
|
getError: (r) => r === "@@" && o === "folder" ? "Version mentions are disabled for folders" : null
|
|
3671
|
-
}),
|
|
3677
|
+
}), ea = w.span`
|
|
3672
3678
|
gap: 2px;
|
|
3673
3679
|
display: inline-flex;
|
|
3674
3680
|
border-radius: var(--border-radius-m);
|
|
@@ -3734,34 +3740,34 @@ const js = (t, e) => {
|
|
|
3734
3740
|
disabled: i,
|
|
3735
3741
|
onMouseEnter: s,
|
|
3736
3742
|
categoryPrimary: a,
|
|
3737
|
-
categorySecondary:
|
|
3743
|
+
categorySecondary: u,
|
|
3738
3744
|
children: d,
|
|
3739
|
-
...
|
|
3745
|
+
...v
|
|
3740
3746
|
}) => {
|
|
3741
|
-
const
|
|
3747
|
+
const x = r || (e === "user" ? "alternate_email" : e === "team" ? "group" : it(e, "link")), g = O(null);
|
|
3742
3748
|
return /* @__PURE__ */ S(
|
|
3743
|
-
|
|
3749
|
+
ea,
|
|
3744
3750
|
{
|
|
3745
|
-
...
|
|
3751
|
+
...v,
|
|
3746
3752
|
$variant: n,
|
|
3747
3753
|
$categoryPrimary: a,
|
|
3748
|
-
$categorySecondary:
|
|
3754
|
+
$categorySecondary: u,
|
|
3749
3755
|
ref: g,
|
|
3750
|
-
onMouseEnter: (
|
|
3756
|
+
onMouseEnter: (f) => {
|
|
3751
3757
|
const c = g.current?.getBoundingClientRect();
|
|
3752
3758
|
if (!c) return;
|
|
3753
|
-
const
|
|
3754
|
-
s?.(
|
|
3759
|
+
const m = { left: c.x + c.width / 2, top: c.y };
|
|
3760
|
+
s?.(f, m);
|
|
3755
3761
|
},
|
|
3756
3762
|
className: P({ disabled: i, isEntity: o }, "reference"),
|
|
3757
3763
|
id: `ref-${t}`,
|
|
3758
3764
|
children: [
|
|
3759
|
-
/* @__PURE__ */ l(J, { icon:
|
|
3765
|
+
/* @__PURE__ */ l(J, { icon: x }),
|
|
3760
3766
|
d
|
|
3761
3767
|
]
|
|
3762
3768
|
}
|
|
3763
3769
|
);
|
|
3764
|
-
},
|
|
3770
|
+
}, ta = w(J)`
|
|
3765
3771
|
cursor: pointer;
|
|
3766
3772
|
user-select: none;
|
|
3767
3773
|
font-size: 24px;
|
|
@@ -3779,24 +3785,24 @@ const js = (t, e) => {
|
|
|
3779
3785
|
&.readOnly {
|
|
3780
3786
|
cursor: default;
|
|
3781
3787
|
}
|
|
3782
|
-
`,
|
|
3783
|
-
|
|
3788
|
+
`, na = ({ checked: t, isReadOnly: e, ...n }) => /* @__PURE__ */ l(
|
|
3789
|
+
ta,
|
|
3784
3790
|
{
|
|
3785
3791
|
...n,
|
|
3786
3792
|
icon: t ? "check_circle" : "radio_button_unchecked",
|
|
3787
3793
|
className: P(n.className, { checked: t, readOnly: e })
|
|
3788
3794
|
}
|
|
3789
|
-
), Se = "no-date",
|
|
3795
|
+
), Se = "no-date", Q = (t, e, n, o) => [
|
|
3790
3796
|
{ label: n, id: t.toISOString() },
|
|
3791
3797
|
{ label: o, id: e.toISOString() }
|
|
3792
3798
|
], z = {
|
|
3793
3799
|
today: () => {
|
|
3794
3800
|
const t = /* @__PURE__ */ new Date();
|
|
3795
|
-
return
|
|
3801
|
+
return Q(Ct(t), Et(t), "Start of day", "End of day");
|
|
3796
3802
|
},
|
|
3797
3803
|
yesterday: () => {
|
|
3798
3804
|
const t = Wn(/* @__PURE__ */ new Date(), 1);
|
|
3799
|
-
return
|
|
3805
|
+
return Q(
|
|
3800
3806
|
Ct(t),
|
|
3801
3807
|
Et(t),
|
|
3802
3808
|
"Start of yesterday",
|
|
@@ -3813,7 +3819,7 @@ const js = (t, e) => {
|
|
|
3813
3819
|
],
|
|
3814
3820
|
"this-week": () => {
|
|
3815
3821
|
const t = /* @__PURE__ */ new Date();
|
|
3816
|
-
return
|
|
3822
|
+
return Q(
|
|
3817
3823
|
Ge(t, { weekStartsOn: 0 }),
|
|
3818
3824
|
je(t, { weekStartsOn: 0 }),
|
|
3819
3825
|
"Start of week",
|
|
@@ -3822,7 +3828,7 @@ const js = (t, e) => {
|
|
|
3822
3828
|
},
|
|
3823
3829
|
"next-week": () => {
|
|
3824
3830
|
const t = Gn(/* @__PURE__ */ new Date(), 1);
|
|
3825
|
-
return
|
|
3831
|
+
return Q(
|
|
3826
3832
|
Ge(t, { weekStartsOn: 0 }),
|
|
3827
3833
|
je(t, { weekStartsOn: 0 }),
|
|
3828
3834
|
"Start of next week",
|
|
@@ -3831,7 +3837,7 @@ const js = (t, e) => {
|
|
|
3831
3837
|
},
|
|
3832
3838
|
"last-week": () => {
|
|
3833
3839
|
const t = jn(/* @__PURE__ */ new Date(), 1);
|
|
3834
|
-
return
|
|
3840
|
+
return Q(
|
|
3835
3841
|
Ge(t, { weekStartsOn: 0 }),
|
|
3836
3842
|
je(t, { weekStartsOn: 0 }),
|
|
3837
3843
|
"Start of last week",
|
|
@@ -3840,11 +3846,11 @@ const js = (t, e) => {
|
|
|
3840
3846
|
},
|
|
3841
3847
|
"this-month": () => {
|
|
3842
3848
|
const t = /* @__PURE__ */ new Date();
|
|
3843
|
-
return
|
|
3849
|
+
return Q(He(t), Ue(t), "Start of month", "End of month");
|
|
3844
3850
|
},
|
|
3845
3851
|
"next-month": () => {
|
|
3846
3852
|
const t = Hn(/* @__PURE__ */ new Date(), 1);
|
|
3847
|
-
return
|
|
3853
|
+
return Q(
|
|
3848
3854
|
He(t),
|
|
3849
3855
|
Ue(t),
|
|
3850
3856
|
"Start of next month",
|
|
@@ -3853,7 +3859,7 @@ const js = (t, e) => {
|
|
|
3853
3859
|
},
|
|
3854
3860
|
"last-month": () => {
|
|
3855
3861
|
const t = Un(/* @__PURE__ */ new Date(), 1);
|
|
3856
|
-
return
|
|
3862
|
+
return Q(
|
|
3857
3863
|
He(t),
|
|
3858
3864
|
Ue(t),
|
|
3859
3865
|
"Start of last month",
|
|
@@ -3862,22 +3868,22 @@ const js = (t, e) => {
|
|
|
3862
3868
|
},
|
|
3863
3869
|
"this-year": () => {
|
|
3864
3870
|
const t = /* @__PURE__ */ new Date();
|
|
3865
|
-
return
|
|
3871
|
+
return Q(wt(t), kt(t), "Start of year", "End of year");
|
|
3866
3872
|
},
|
|
3867
3873
|
"last-year": () => {
|
|
3868
3874
|
const t = Kn(/* @__PURE__ */ new Date(), 1);
|
|
3869
|
-
return
|
|
3875
|
+
return Q(
|
|
3870
3876
|
wt(t),
|
|
3871
3877
|
kt(t),
|
|
3872
3878
|
"Start of last year",
|
|
3873
3879
|
"End of last year"
|
|
3874
3880
|
);
|
|
3875
3881
|
}
|
|
3876
|
-
},
|
|
3877
|
-
id:
|
|
3882
|
+
}, oa = "custom-range", ra = "tune", ia = {
|
|
3883
|
+
id: oa,
|
|
3878
3884
|
label: "Custom range...",
|
|
3879
3885
|
values: [],
|
|
3880
|
-
icon:
|
|
3886
|
+
icon: ra
|
|
3881
3887
|
}, An = () => [
|
|
3882
3888
|
{
|
|
3883
3889
|
id: "today",
|
|
@@ -3939,10 +3945,10 @@ const js = (t, e) => {
|
|
|
3939
3945
|
values: z["last-year"](),
|
|
3940
3946
|
icon: "calendar_month"
|
|
3941
3947
|
}
|
|
3942
|
-
],
|
|
3943
|
-
|
|
3948
|
+
], Gl = An(), sa = () => [
|
|
3949
|
+
ia,
|
|
3944
3950
|
...An()
|
|
3945
|
-
],
|
|
3951
|
+
], Wl = sa(), Yl = (t, e) => {
|
|
3946
3952
|
if (!t || !e) return null;
|
|
3947
3953
|
try {
|
|
3948
3954
|
const n = B(t), o = B(e);
|
|
@@ -4020,7 +4026,7 @@ const js = (t, e) => {
|
|
|
4020
4026
|
} catch {
|
|
4021
4027
|
return null;
|
|
4022
4028
|
}
|
|
4023
|
-
},
|
|
4029
|
+
}, aa = w.label`
|
|
4024
4030
|
cursor: pointer;
|
|
4025
4031
|
position: relative;
|
|
4026
4032
|
right: 2rem;
|
|
@@ -4047,10 +4053,10 @@ const js = (t, e) => {
|
|
|
4047
4053
|
font-variation-settings: 'FILL' 1;
|
|
4048
4054
|
}
|
|
4049
4055
|
}
|
|
4050
|
-
`,
|
|
4056
|
+
`, la = ({ checked: t, onChange: e }) => /* @__PURE__ */ S(aa, { className: P({ checked: t }), children: [
|
|
4051
4057
|
/* @__PURE__ */ l("input", { checked: t, disabled: !1, onChange: e, type: "checkbox" }),
|
|
4052
|
-
/* @__PURE__ */ l(
|
|
4053
|
-
] }),
|
|
4058
|
+
/* @__PURE__ */ l(na, { checked: t })
|
|
4059
|
+
] }), ca = ({
|
|
4054
4060
|
projectName: t,
|
|
4055
4061
|
activityId: e,
|
|
4056
4062
|
entityId: n,
|
|
@@ -4058,12 +4064,12 @@ const js = (t, e) => {
|
|
|
4058
4064
|
categoryPrimary: r,
|
|
4059
4065
|
categorySecondary: i
|
|
4060
4066
|
}) => {
|
|
4061
|
-
const { data: s, isError: a } =
|
|
4067
|
+
const { data: s, isError: a } = lr({
|
|
4062
4068
|
projectName: t,
|
|
4063
4069
|
entityIds: [n],
|
|
4064
4070
|
activityIds: [e]
|
|
4065
4071
|
});
|
|
4066
|
-
return a || !s?.activities.some((
|
|
4072
|
+
return a || !s?.activities.some((u) => u.activityId === e) ? null : /* @__PURE__ */ l(
|
|
4067
4073
|
rt,
|
|
4068
4074
|
{
|
|
4069
4075
|
type: "activity",
|
|
@@ -4076,22 +4082,22 @@ const js = (t, e) => {
|
|
|
4076
4082
|
children: "Source"
|
|
4077
4083
|
}
|
|
4078
4084
|
);
|
|
4079
|
-
},
|
|
4085
|
+
}, da = ({ to: t, useNavigate: e, children: n }) => {
|
|
4080
4086
|
const o = e();
|
|
4081
4087
|
return /* @__PURE__ */ l("a", { href: t, onClick: (i) => {
|
|
4082
4088
|
i.button !== 0 || i.metaKey || i.ctrlKey || i.shiftKey || i.altKey || (i.preventDefault(), o(t));
|
|
4083
4089
|
}, children: n });
|
|
4084
|
-
},
|
|
4085
|
-
const n =
|
|
4086
|
-
return n ? /* @__PURE__ */ l(
|
|
4087
|
-
},
|
|
4090
|
+
}, ua = ({ to: t, children: e }) => {
|
|
4091
|
+
const n = Zn(dr)?.useNavigate;
|
|
4092
|
+
return n ? /* @__PURE__ */ l(da, { to: t, useNavigate: n, children: e }) : /* @__PURE__ */ l("a", { href: t, children: e });
|
|
4093
|
+
}, ma = (t, e, n) => {
|
|
4088
4094
|
const o = new URLSearchParams(window.location.search);
|
|
4089
4095
|
n && (o.set("project", t), o.set("type", n.type), o.set("id", n.id));
|
|
4090
4096
|
const r = o.get("type") === "version" ? "products" : "overview";
|
|
4091
4097
|
o.set("activity", e);
|
|
4092
4098
|
const i = new URL(`${window.location.origin}/projects/${t}/${r}`);
|
|
4093
4099
|
return i.search = o.toString(), i.toString();
|
|
4094
|
-
},
|
|
4100
|
+
}, ql = w.div`
|
|
4095
4101
|
/* use grid tick for auto height transition */
|
|
4096
4102
|
display: grid;
|
|
4097
4103
|
height: 100%;
|
|
@@ -4117,9 +4123,9 @@ const js = (t, e) => {
|
|
|
4117
4123
|
--background-color: ${n};
|
|
4118
4124
|
--button-color: ${t};
|
|
4119
4125
|
--button-color-secondary: ${e};
|
|
4120
|
-
--button-text-color: ${
|
|
4126
|
+
--button-text-color: ${no(t)};
|
|
4121
4127
|
--border-color: ${t};
|
|
4122
|
-
`,
|
|
4128
|
+
`, Ql = w.div`
|
|
4123
4129
|
/* VARS */
|
|
4124
4130
|
--background-color: var(--md-sys-color-surface-container);
|
|
4125
4131
|
--button-color: var(--md-sys-color-primary);
|
|
@@ -4217,14 +4223,14 @@ const js = (t, e) => {
|
|
|
4217
4223
|
/* remove outline */
|
|
4218
4224
|
outline: none;
|
|
4219
4225
|
}
|
|
4220
|
-
`,
|
|
4226
|
+
`, Vl = w.div`
|
|
4221
4227
|
padding: 4px 4px 0;
|
|
4222
|
-
`,
|
|
4228
|
+
`, Jl = w.span`
|
|
4223
4229
|
width: 1px;
|
|
4224
4230
|
height: 18px;
|
|
4225
4231
|
margin: 0 4px;
|
|
4226
4232
|
background-color: var(--md-sys-color-surface-container-hover);
|
|
4227
|
-
`,
|
|
4233
|
+
`, Xl = w.footer`
|
|
4228
4234
|
display: flex;
|
|
4229
4235
|
justify-content: space-between;
|
|
4230
4236
|
padding: var(--padding-m);
|
|
@@ -4250,7 +4256,7 @@ const js = (t, e) => {
|
|
|
4250
4256
|
background-color: var(--button-color);
|
|
4251
4257
|
color: var(--button-text-color);
|
|
4252
4258
|
}
|
|
4253
|
-
`,
|
|
4259
|
+
`, pa = w.div`
|
|
4254
4260
|
display: flex;
|
|
4255
4261
|
gap: var(--base-gap-small);
|
|
4256
4262
|
|
|
@@ -4265,7 +4271,7 @@ const js = (t, e) => {
|
|
|
4265
4271
|
}
|
|
4266
4272
|
}
|
|
4267
4273
|
}
|
|
4268
|
-
`,
|
|
4274
|
+
`, Zl = w.div`
|
|
4269
4275
|
display: inline-flex;
|
|
4270
4276
|
align-items: center;
|
|
4271
4277
|
border-radius: var(--border-radius-m);
|
|
@@ -4279,14 +4285,14 @@ const js = (t, e) => {
|
|
|
4279
4285
|
background-color: var(--md-sys-color-primary-container-hover);
|
|
4280
4286
|
}
|
|
4281
4287
|
}
|
|
4282
|
-
`,
|
|
4288
|
+
`, ec = w(te)`
|
|
4283
4289
|
color: inherit;
|
|
4284
4290
|
background: transparent;
|
|
4285
4291
|
|
|
4286
4292
|
&:hover {
|
|
4287
4293
|
background-color: var(--md-sys-color-primary-container-hover) !important;
|
|
4288
4294
|
}
|
|
4289
|
-
`,
|
|
4295
|
+
`, tc = w(te)`
|
|
4290
4296
|
width: 100%;
|
|
4291
4297
|
padding: 4px 6px;
|
|
4292
4298
|
white-space: nowrap;
|
|
@@ -4296,14 +4302,14 @@ const js = (t, e) => {
|
|
|
4296
4302
|
&:hover {
|
|
4297
4303
|
background-color: var(--md-sys-color-surface-container-low) !important;
|
|
4298
4304
|
}
|
|
4299
|
-
`,
|
|
4305
|
+
`, nc = w(to)`
|
|
4300
4306
|
min-width: 0;
|
|
4301
4307
|
padding: 4px 8px;
|
|
4302
|
-
`,
|
|
4308
|
+
`, oc = w(pa)`
|
|
4303
4309
|
margin-left: auto;
|
|
4304
4310
|
flex-shrink: 1;
|
|
4305
4311
|
overflow: hidden;
|
|
4306
|
-
`,
|
|
4312
|
+
`, rc = w.div`
|
|
4307
4313
|
position: absolute;
|
|
4308
4314
|
inset: 0;
|
|
4309
4315
|
user-select: none;
|
|
@@ -4327,18 +4333,18 @@ const js = (t, e) => {
|
|
|
4327
4333
|
.icon {
|
|
4328
4334
|
font-size: 40px;
|
|
4329
4335
|
}
|
|
4330
|
-
`,
|
|
4336
|
+
`, ic = w.span`
|
|
4331
4337
|
padding: 12px 15px;
|
|
4332
4338
|
/* italic */
|
|
4333
4339
|
font-style: italic;
|
|
4334
4340
|
opacity: 0.4;
|
|
4335
|
-
`,
|
|
4341
|
+
`, sc = w.div`
|
|
4336
4342
|
display: grid;
|
|
4337
4343
|
gap: var(--base-gap-medium);
|
|
4338
4344
|
grid-template-columns: 1fr 1fr;
|
|
4339
|
-
`,
|
|
4345
|
+
`, ac = w.div`
|
|
4340
4346
|
margin-top: var(--padding-m);
|
|
4341
|
-
`,
|
|
4347
|
+
`, lc = w(te)`
|
|
4342
4348
|
background: transparent;
|
|
4343
4349
|
border: solid 1px currentColor;
|
|
4344
4350
|
flex-grow: 1;
|
|
@@ -4373,7 +4379,7 @@ const js = (t, e) => {
|
|
|
4373
4379
|
pointer-events: none;
|
|
4374
4380
|
}
|
|
4375
4381
|
}
|
|
4376
|
-
`,
|
|
4382
|
+
`, cc = w.div`
|
|
4377
4383
|
border-radius: var(--border-radius-l);
|
|
4378
4384
|
margin-bottom: var(--padding-m);
|
|
4379
4385
|
user-select: none;
|
|
@@ -4398,10 +4404,10 @@ const js = (t, e) => {
|
|
|
4398
4404
|
color: var(--md-sys-color-on-error);
|
|
4399
4405
|
}
|
|
4400
4406
|
`;
|
|
4401
|
-
|
|
4407
|
+
w.div`
|
|
4402
4408
|
border-radius: var(--border-radius-m);
|
|
4403
4409
|
`;
|
|
4404
|
-
const
|
|
4410
|
+
const dc = w.li`
|
|
4405
4411
|
/* VARS */
|
|
4406
4412
|
--background-color: var(--md-sys-color-surface-container);
|
|
4407
4413
|
--button-color-secondary: var(--md-sys-color-surface-container-high);
|
|
@@ -4451,7 +4457,7 @@ const ac = x.li`
|
|
|
4451
4457
|
&.isHighlighted {
|
|
4452
4458
|
background-color: var(--md-sys-color-secondary-container);
|
|
4453
4459
|
}
|
|
4454
|
-
`,
|
|
4460
|
+
`, uc = w.div`
|
|
4455
4461
|
background-color: var(--background-color);
|
|
4456
4462
|
border-radius: var(--border-radius-m);
|
|
4457
4463
|
padding: var(--padding-m);
|
|
@@ -4589,7 +4595,7 @@ const ac = x.li`
|
|
|
4589
4595
|
padding: 0;
|
|
4590
4596
|
border-radius: var(--border-radius-l);
|
|
4591
4597
|
}
|
|
4592
|
-
`, Gt =
|
|
4598
|
+
`, Gt = w.p`
|
|
4593
4599
|
margin: 0;
|
|
4594
4600
|
|
|
4595
4601
|
&:first-child {
|
|
@@ -4600,7 +4606,7 @@ const ac = x.li`
|
|
|
4600
4606
|
margin-bottom: 14px;
|
|
4601
4607
|
}
|
|
4602
4608
|
`;
|
|
4603
|
-
|
|
4609
|
+
w.div`
|
|
4604
4610
|
display: flex;
|
|
4605
4611
|
flex-wrap: wrap;
|
|
4606
4612
|
gap: var(--base-gap-large);
|
|
@@ -4624,10 +4630,10 @@ const Pn = Ee`
|
|
|
4624
4630
|
background-color: var(--md-sys-color-surface-container-high-active);
|
|
4625
4631
|
}
|
|
4626
4632
|
`;
|
|
4627
|
-
|
|
4633
|
+
w.img`
|
|
4628
4634
|
${Pn}
|
|
4629
4635
|
`;
|
|
4630
|
-
|
|
4636
|
+
w.a`
|
|
4631
4637
|
${Pn}
|
|
4632
4638
|
|
|
4633
4639
|
display: flex;
|
|
@@ -4640,7 +4646,7 @@ x.a`
|
|
|
4640
4646
|
color: var(--md-sys-color-outline);
|
|
4641
4647
|
}
|
|
4642
4648
|
`;
|
|
4643
|
-
|
|
4649
|
+
w.span`
|
|
4644
4650
|
position: absolute;
|
|
4645
4651
|
bottom: 4px;
|
|
4646
4652
|
left: 0;
|
|
@@ -4650,7 +4656,7 @@ x.span`
|
|
|
4650
4656
|
overflow-wrap: break-word;
|
|
4651
4657
|
color: var(--md-sys-color-outline);
|
|
4652
4658
|
`;
|
|
4653
|
-
const Wt =
|
|
4659
|
+
const Wt = w.pre`
|
|
4654
4660
|
margin: 0;
|
|
4655
4661
|
padding: 8px 10px;
|
|
4656
4662
|
border-radius: var(--border-radius-m);
|
|
@@ -4674,7 +4680,7 @@ const Wt = x.pre`
|
|
|
4674
4680
|
|
|
4675
4681
|
/* syntax highlighting, same colours as the editor */
|
|
4676
4682
|
${Tn}
|
|
4677
|
-
`,
|
|
4683
|
+
`, ga = w.code`
|
|
4678
4684
|
font-family: monospace;
|
|
4679
4685
|
font-size: 0.9em;
|
|
4680
4686
|
padding: 1px 4px;
|
|
@@ -4683,7 +4689,7 @@ const Wt = x.pre`
|
|
|
4683
4689
|
color: var(--md-sys-color-tertiary);
|
|
4684
4690
|
white-space: pre-wrap;
|
|
4685
4691
|
word-break: break-word;
|
|
4686
|
-
`,
|
|
4692
|
+
`, mc = w.div`
|
|
4687
4693
|
display: flex;
|
|
4688
4694
|
position: absolute;
|
|
4689
4695
|
right: 4px;
|
|
@@ -4696,7 +4702,7 @@ const Wt = x.pre`
|
|
|
4696
4702
|
|
|
4697
4703
|
/* by default hidden */
|
|
4698
4704
|
opacity: 0;
|
|
4699
|
-
`,
|
|
4705
|
+
`, pc = w(te)`
|
|
4700
4706
|
&.hasIcon {
|
|
4701
4707
|
padding: 4px;
|
|
4702
4708
|
}
|
|
@@ -4711,7 +4717,7 @@ const Wt = x.pre`
|
|
|
4711
4717
|
position: relative;
|
|
4712
4718
|
top: -1px;
|
|
4713
4719
|
}
|
|
4714
|
-
`,
|
|
4720
|
+
`, gc = w.span`
|
|
4715
4721
|
background-color: var(--md-sys-color-secondary-container);
|
|
4716
4722
|
display: flex;
|
|
4717
4723
|
align-items: center;
|
|
@@ -4732,14 +4738,14 @@ const Wt = x.pre`
|
|
|
4732
4738
|
.icon {
|
|
4733
4739
|
font-size: 24px;
|
|
4734
4740
|
}
|
|
4735
|
-
`,
|
|
4741
|
+
`, hc = w.div`
|
|
4736
4742
|
display: flex;
|
|
4737
4743
|
align-items: center;
|
|
4738
4744
|
gap: var(--base-gap-small);
|
|
4739
4745
|
min-width: 0;
|
|
4740
4746
|
overflow-x: auto;
|
|
4741
4747
|
padding-bottom: 4px;
|
|
4742
|
-
`,
|
|
4748
|
+
`, fc = w.button`
|
|
4743
4749
|
display: inline-flex;
|
|
4744
4750
|
align-items: center;
|
|
4745
4751
|
gap: var(--base-gap-small);
|
|
@@ -4769,7 +4775,7 @@ const Wt = x.pre`
|
|
|
4769
4775
|
&:disabled {
|
|
4770
4776
|
cursor: default;
|
|
4771
4777
|
}
|
|
4772
|
-
`,
|
|
4778
|
+
`, ha = [
|
|
4773
4779
|
"user",
|
|
4774
4780
|
"team",
|
|
4775
4781
|
"task",
|
|
@@ -4778,12 +4784,12 @@ const Wt = x.pre`
|
|
|
4778
4784
|
"representation",
|
|
4779
4785
|
"workfile",
|
|
4780
4786
|
"product"
|
|
4781
|
-
],
|
|
4787
|
+
], fa = (t = "") => {
|
|
4782
4788
|
if (t.startsWith("https://")) return { url: t, type: "url" };
|
|
4783
4789
|
if (t.startsWith("/")) return { url: t, type: "relative" };
|
|
4784
4790
|
if (t.includes(":")) {
|
|
4785
4791
|
const e = t.split(":"), [n, o] = e;
|
|
4786
|
-
if (
|
|
4792
|
+
if (ha.includes(n) && o && e.length === 2) {
|
|
4787
4793
|
const r = (() => {
|
|
4788
4794
|
try {
|
|
4789
4795
|
return decodeURIComponent(o);
|
|
@@ -4795,58 +4801,58 @@ const Wt = x.pre`
|
|
|
4795
4801
|
}
|
|
4796
4802
|
}
|
|
4797
4803
|
return {};
|
|
4798
|
-
},
|
|
4804
|
+
}, ba = (t) => qt.Children.toArray(t).map((e) => typeof e == "string" || typeof e == "number" ? String(e) : "").join(""), bc = ({ children: t, href: e }, {
|
|
4799
4805
|
entityId: n,
|
|
4800
4806
|
entityType: o,
|
|
4801
4807
|
userName: r,
|
|
4802
4808
|
userTeamNames: i,
|
|
4803
4809
|
projectName: s,
|
|
4804
4810
|
onReferenceClick: a,
|
|
4805
|
-
activityId:
|
|
4811
|
+
activityId: u,
|
|
4806
4812
|
onReferenceTooltip: d,
|
|
4807
|
-
categoryPrimary:
|
|
4808
|
-
categorySecondary:
|
|
4813
|
+
categoryPrimary: v,
|
|
4814
|
+
categorySecondary: x,
|
|
4809
4815
|
onActivityLinkClick: g
|
|
4810
4816
|
}) => {
|
|
4811
|
-
const
|
|
4812
|
-
if (
|
|
4813
|
-
if (
|
|
4814
|
-
const C =
|
|
4817
|
+
const h = ze(e);
|
|
4818
|
+
if (h) {
|
|
4819
|
+
if (h.isSource) {
|
|
4820
|
+
const C = h.entity ?? (n && o ? { id: n, type: o } : null);
|
|
4815
4821
|
if (!s || !C) return null;
|
|
4816
|
-
const
|
|
4822
|
+
const b = ma(s, h.activityId, C);
|
|
4817
4823
|
return /* @__PURE__ */ l(
|
|
4818
|
-
|
|
4824
|
+
ca,
|
|
4819
4825
|
{
|
|
4820
4826
|
projectName: s,
|
|
4821
|
-
activityId:
|
|
4827
|
+
activityId: h.activityId,
|
|
4822
4828
|
entityId: C.id,
|
|
4823
|
-
onClick: () => g ? g({ activityId:
|
|
4824
|
-
categoryPrimary:
|
|
4825
|
-
categorySecondary:
|
|
4829
|
+
onClick: () => g ? g({ activityId: h.activityId, projectName: s, url: b }) : window.open(b, "_blank", "noreferrer"),
|
|
4830
|
+
categoryPrimary: v,
|
|
4831
|
+
categorySecondary: x
|
|
4826
4832
|
}
|
|
4827
4833
|
);
|
|
4828
4834
|
}
|
|
4829
|
-
const p =
|
|
4835
|
+
const p = ba(t).trim(), y = !p || /^https?:\/\//.test(p) ? $n : p, k = h;
|
|
4830
4836
|
return /* @__PURE__ */ l(
|
|
4831
4837
|
rt,
|
|
4832
4838
|
{
|
|
4833
4839
|
type: "activity",
|
|
4834
|
-
id: `activity-${
|
|
4840
|
+
id: `activity-${h.activityId}`,
|
|
4835
4841
|
icon: "chat",
|
|
4836
|
-
onClick: () => g ? g(
|
|
4837
|
-
categoryPrimary:
|
|
4838
|
-
categorySecondary:
|
|
4842
|
+
onClick: () => g ? g(k) : window.open(e, "_blank", "noreferrer"),
|
|
4843
|
+
categoryPrimary: v,
|
|
4844
|
+
categorySecondary: x,
|
|
4839
4845
|
"data-tooltip": "Go to comment",
|
|
4840
|
-
children:
|
|
4846
|
+
children: y
|
|
4841
4847
|
}
|
|
4842
4848
|
);
|
|
4843
4849
|
}
|
|
4844
|
-
const { url:
|
|
4845
|
-
if (!
|
|
4850
|
+
const { url: f, type: c, id: m } = fa(e);
|
|
4851
|
+
if (!f && !c && !m)
|
|
4846
4852
|
return t;
|
|
4847
|
-
if (
|
|
4848
|
-
return c === "relative" &&
|
|
4849
|
-
const
|
|
4853
|
+
if (f || !c || !m)
|
|
4854
|
+
return c === "relative" && f ? /* @__PURE__ */ l(ua, { to: f, children: t }) : /* @__PURE__ */ l("a", { href: f, target: "_blank", rel: "noreferrer", children: t });
|
|
4855
|
+
const _ = t && t.toString().replace("@", "") || "", T = m === n || c === "user" && m === r || c === "team" && !!i?.includes(m), E = m.replaceAll(".", "-").replaceAll(" ", "-");
|
|
4850
4856
|
return /* @__PURE__ */ l(
|
|
4851
4857
|
rt,
|
|
4852
4858
|
{
|
|
@@ -4854,27 +4860,27 @@ const Wt = x.pre`
|
|
|
4854
4860
|
id: E,
|
|
4855
4861
|
variant: T ? "filled" : "surface",
|
|
4856
4862
|
onClick: () => {
|
|
4857
|
-
c !== "user" && c !== "team" && a({ entityId:
|
|
4863
|
+
c !== "user" && c !== "team" && a({ entityId: m, entityType: c, projectName: s, activityId: u });
|
|
4858
4864
|
},
|
|
4859
|
-
onMouseEnter: (p,
|
|
4860
|
-
categoryPrimary:
|
|
4861
|
-
categorySecondary:
|
|
4862
|
-
"data-mention-value": `${c}:${
|
|
4863
|
-
"data-mention-label":
|
|
4864
|
-
children:
|
|
4865
|
+
onMouseEnter: (p, y) => d({ type: c, id: E, label: _, name: m, pos: y }),
|
|
4866
|
+
categoryPrimary: v,
|
|
4867
|
+
categorySecondary: x,
|
|
4868
|
+
"data-mention-value": `${c}:${m}`,
|
|
4869
|
+
"data-mention-label": _,
|
|
4870
|
+
children: _
|
|
4865
4871
|
}
|
|
4866
4872
|
);
|
|
4867
|
-
},
|
|
4868
|
-
|
|
4873
|
+
}, yc = ({ type: t, checked: e, ...n }, { activity: o, onCheckChange: r }) => t === "checkbox" ? /* @__PURE__ */ l(
|
|
4874
|
+
la,
|
|
4869
4875
|
{
|
|
4870
4876
|
checked: !!e,
|
|
4871
4877
|
onChange: (i) => r && r(i, o)
|
|
4872
4878
|
}
|
|
4873
|
-
) : /* @__PURE__ */ l("input", { type: t, disabled: !0, ...n }),
|
|
4874
|
-
if (!(!!e?.startsWith("language-") || t?.position && t.position.start.line !== t.position.end.line)) return /* @__PURE__ */ l(
|
|
4875
|
-
const r = e?.replace(/^language-/, ""), i = typeof n == "string" ? n.replace(/\n$/, "") : null, s = i !== null ?
|
|
4879
|
+
) : /* @__PURE__ */ l("input", { type: t, disabled: !0, ...n }), vc = ({ node: t, className: e, children: n }) => {
|
|
4880
|
+
if (!(!!e?.startsWith("language-") || t?.position && t.position.start.line !== t.position.end.line)) return /* @__PURE__ */ l(ga, { children: n });
|
|
4881
|
+
const r = e?.replace(/^language-/, ""), i = typeof n == "string" ? n.replace(/\n$/, "") : null, s = i !== null ? vr(i, r) : null;
|
|
4876
4882
|
return s !== null ? /* @__PURE__ */ l(Wt, { children: /* @__PURE__ */ l("code", { className: e, dangerouslySetInnerHTML: { __html: s } }) }) : /* @__PURE__ */ l(Wt, { children: n });
|
|
4877
|
-
},
|
|
4883
|
+
}, xc = ({ children: t }) => {
|
|
4878
4884
|
const e = qt.Children.toArray(t).find((o) => !!o?.props)?.props?.children;
|
|
4879
4885
|
if (!e) return /* @__PURE__ */ l("blockquote", { children: t });
|
|
4880
4886
|
const n = [];
|
|
@@ -4883,7 +4889,7 @@ const Wt = x.pre`
|
|
|
4883
4889
|
`).forEach((r, i) => {
|
|
4884
4890
|
n.push(/* @__PURE__ */ l(Gt, { children: r }, i));
|
|
4885
4891
|
});
|
|
4886
|
-
else if (
|
|
4892
|
+
else if (Vn(e)) {
|
|
4887
4893
|
const o = [];
|
|
4888
4894
|
let r = 0;
|
|
4889
4895
|
e.forEach((i) => {
|
|
@@ -4896,7 +4902,7 @@ const Wt = x.pre`
|
|
|
4896
4902
|
});
|
|
4897
4903
|
}
|
|
4898
4904
|
return /* @__PURE__ */ l("blockquote", { children: n });
|
|
4899
|
-
},
|
|
4905
|
+
}, ya = w.span`
|
|
4900
4906
|
position: absolute;
|
|
4901
4907
|
top: 3px;
|
|
4902
4908
|
right: 3px;
|
|
@@ -4924,91 +4930,91 @@ const Wt = x.pre`
|
|
|
4924
4930
|
z-index: 0;
|
|
4925
4931
|
border-radius: 100%;
|
|
4926
4932
|
}
|
|
4927
|
-
`,
|
|
4928
|
-
({ className: t, ...e }, n) => /* @__PURE__ */ l(
|
|
4933
|
+
`, kc = Qt(
|
|
4934
|
+
({ className: t, ...e }, n) => /* @__PURE__ */ l(ya, { className: P("playable", t), ...e, ref: n, children: /* @__PURE__ */ l(J, { icon: "play_circle" }) })
|
|
4929
4935
|
);
|
|
4930
4936
|
export {
|
|
4931
4937
|
Ae as $,
|
|
4932
4938
|
$n as A,
|
|
4933
4939
|
ae as B,
|
|
4934
|
-
|
|
4935
|
-
|
|
4940
|
+
ra as C,
|
|
4941
|
+
Cr as D,
|
|
4936
4942
|
be as E,
|
|
4937
|
-
|
|
4943
|
+
Tr as F,
|
|
4938
4944
|
ye as G,
|
|
4939
|
-
|
|
4945
|
+
jl as H,
|
|
4940
4946
|
vt as I,
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4947
|
+
Wl as J,
|
|
4948
|
+
Gl as K,
|
|
4949
|
+
sa as L,
|
|
4950
|
+
zr as M,
|
|
4945
4951
|
Se as N,
|
|
4946
|
-
|
|
4947
|
-
|
|
4952
|
+
Ul as O,
|
|
4953
|
+
Ns as P,
|
|
4948
4954
|
vn as Q,
|
|
4949
|
-
|
|
4955
|
+
Er as R,
|
|
4950
4956
|
bt as S,
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4957
|
+
Hl as T,
|
|
4958
|
+
hr as U,
|
|
4959
|
+
Ir as V,
|
|
4960
|
+
li as W,
|
|
4955
4961
|
ze as X,
|
|
4956
|
-
|
|
4962
|
+
Sr as Y,
|
|
4957
4963
|
j as Z,
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4964
|
+
kc as _,
|
|
4965
|
+
oa as a,
|
|
4966
|
+
ha as a0,
|
|
4967
|
+
Xs as a1,
|
|
4968
|
+
cc as a2,
|
|
4969
|
+
sc as a3,
|
|
4970
|
+
lc as a4,
|
|
4971
|
+
ql as a5,
|
|
4972
|
+
Ql as a6,
|
|
4973
|
+
Vl as a7,
|
|
4974
|
+
Jl as a8,
|
|
4975
|
+
ic as a9,
|
|
4976
|
+
Xl as aa,
|
|
4977
|
+
pa as ab,
|
|
4978
|
+
Zl as ac,
|
|
4979
|
+
ec as ad,
|
|
4980
|
+
nc as ae,
|
|
4981
|
+
tc as af,
|
|
4982
|
+
oc as ag,
|
|
4983
|
+
rc as ah,
|
|
4984
|
+
ac as ai,
|
|
4979
4985
|
rt as aj,
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4986
|
+
hc as ak,
|
|
4987
|
+
fc as al,
|
|
4988
|
+
ma as am,
|
|
4989
|
+
dc as an,
|
|
4990
|
+
uc as ao,
|
|
4991
|
+
mc as ap,
|
|
4992
|
+
pc as aq,
|
|
4993
|
+
gc as ar,
|
|
4994
|
+
bc as as,
|
|
4995
|
+
xc as b,
|
|
4996
|
+
vc as c,
|
|
4997
|
+
Yl as d,
|
|
4998
|
+
zl as e,
|
|
4993
4999
|
z as f,
|
|
4994
|
-
|
|
5000
|
+
ia as g,
|
|
4995
5001
|
An as h,
|
|
4996
|
-
|
|
5002
|
+
yc as i,
|
|
4997
5003
|
De as j,
|
|
4998
5004
|
pe as k,
|
|
4999
5005
|
Rt as l,
|
|
5000
5006
|
Xe as m,
|
|
5001
5007
|
hn as n,
|
|
5002
|
-
|
|
5008
|
+
Or as o,
|
|
5003
5009
|
re as p,
|
|
5004
5010
|
et as q,
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5011
|
+
Fl as r,
|
|
5012
|
+
Kl as s,
|
|
5013
|
+
na as t,
|
|
5008
5014
|
Pe as u,
|
|
5009
|
-
|
|
5015
|
+
Jr as v,
|
|
5010
5016
|
ht as w,
|
|
5011
|
-
|
|
5012
|
-
|
|
5017
|
+
_r as x,
|
|
5018
|
+
js as y,
|
|
5013
5019
|
ve as z
|
|
5014
5020
|
};
|