@kition/kit-editor 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { KitRpcError as he, isHello as co, KIT_UI_PROTOCOL as Bt, isHandshake as uo, KitPeer as ho, parseCommentAnchor as zn, HOST_SERVICE_CAPABILITY_PREFIX as Bn, parseKitView as _n, parseWatermark as fo, parseDocumentPermissions as mo, matchesShortcut as Hr, INVALID_PARAMS_REASON as At, LEASE_HELD_REASON as fn, ORIGIN_LABEL as po, HOST_ORIGIN_LABEL as go, parsePeers as
|
|
1
|
+
import { KitRpcError as he, isHello as co, KIT_UI_PROTOCOL as Bt, isHandshake as uo, KitPeer as ho, parseCommentAnchor as zn, HOST_SERVICE_CAPABILITY_PREFIX as Bn, parseKitView as _n, parseWatermark as fo, parseDocumentPermissions as mo, matchesShortcut as Hr, INVALID_PARAMS_REASON as At, LEASE_HELD_REASON as fn, ORIGIN_LABEL as po, HOST_ORIGIN_LABEL as go, parsePeers as bo, parsePresence as wo } from "@kition/kit-ui-protocol";
|
|
2
2
|
import { fileErrorReason as th, isOpenableUrl as nh, openErrorReason as rh } from "@kition/kit-ui-protocol";
|
|
3
|
-
import { brandTokens as yo, validBrand as vo, Dialog as st, Button as me, ElementsProvider as ko, MenuItem as le, RibbonButton as
|
|
4
|
-
import { Badge as oh, BarChart as ah, BarSeparator as sh, Button as lh, Card as ch, CardContent as dh, CardHeader as uh, Checkbox as hh, Choice as fh, ColorGrid as mh, ColorPicker as ph, ColorWheel as gh, Command as
|
|
3
|
+
import { brandTokens as yo, validBrand as vo, Dialog as st, Button as me, ElementsProvider as ko, MenuItem as le, RibbonButton as be, ICON_STROKE as $e, RibbonGroup as Me, StringsProvider as So, RibbonPresentationContext as vt, RibbonFitContext as Yt, lineSize as Co, MenuButton as lt, FULL_RIBBON_FIT as mn, menuKeyDown as xo, toast as pt, IconButton as De, OverflowStrip as Et, StatusBar as $o, StatusSpacer as Io, ZoomControl as Mo, Toaster as To, RibbonStack as Fe, ColorGrid as Vt, MenuSeparator as Ae, Choice as gt, Checkbox as Xt, LineMoreLabelContext as Ao, DropPanel as Eo } from "@kition/tessera-ui";
|
|
4
|
+
import { Badge as oh, BarChart as ah, BarSeparator as sh, Button as lh, Card as ch, CardContent as dh, CardHeader as uh, Checkbox as hh, Choice as fh, ColorGrid as mh, ColorPicker as ph, ColorWheel as gh, Command as bh, CommandEmpty as wh, CommandGroup as yh, CommandInput as vh, CommandList as kh, CommandItem as Sh, CommandSeparator as Ch, CommandShortcut as xh, ConfirmProvider as $h, ContextMenu as Ih, CurveEditor as Mh, Dialog as Th, Disclosure as Ah, DockArea as Eh, EyeButton as Oh, Field as Rh, FloatingPanels as Dh, GradientSlider as Lh, Hint as Nh, Histogram as Ph, ICON_STROKE as Fh, IconButton as Wh, KeyframeLane as zh, LevelMeter as Bh, LineChart as _h, LineMoreLabelContext as Kh, MenuButton as Hh, MenuItem as qh, MenuSeparator as Uh, Modal as jh, ModalBody as Gh, ModalClose as Yh, ModalCloseButton as Vh, ModalContent as Xh, ModalDescription as Jh, ModalFooter as Zh, ModalHeader as Qh, ModalTitle as ef, ModalTrigger as tf, NumberField as nf, OverflowStrip as rf, PALETTE_COLORS as of, Panel as af, PanelFooter as sf, PasswordInput as lf, PieChart as cf, Popover as df, PopoverAnchor as uf, PopoverClose as hf, PopoverContent as ff, PopoverTrigger as mf, PreviewDialog as pf, RGB_IDENTITY as gf, RenameField as bf, RibbonButton as wf, RibbonGroup as yf, RibbonItem as vf, RibbonPresentationContext as kf, RibbonRow as Sf, RibbonStack as Cf, SLIDER_GRADIENTS as xf, STANDARD_COLORS as $f, Segmented as If, Select as Mf, Sheet as Tf, Spinner as Af, StatusBar as Ef, StatusSpacer as Of, Switch as Rf, TableSizePicker as Df, TextInput as Lf, Textarea as Nf, Thumbnail as Pf, TimecodeField as Ff, Toaster as Wf, Tooltip as zf, TooltipContent as Bf, TooltipProvider as _f, TooltipTrigger as Kf, TransportBar as Hf, WORKSPACE_ACTIONS as qf, WorkspaceLayout as Uf, ZoomControl as jf, addCurvePoint as Gf, automaticFloatingPosition as Yf, brandTokens as Vf, clampFloatingRect as Xf, contrast as Jf, deviceScale as Zf, dockHeights as Qf, formatTimecode as em, hitCurvePoint as tm, kitStoreKey as nm, lightnessAt as rm, lineSize as im, menuKeyDown as om, meterFraction as am, meterLayout as sm, moveCurvePoint as lm, overflowOf as cm, parseHex as dm, parseTimecode as um, rankScale as hm, readKitStore as fm, removeCurvePoint as mm, removeKitStore as pm, resizeFloatingRect as gm, rgbToHex as bm, sampleCurve as wm, sliderFraction as ym, sliderValueAt as vm, smoothHistogram as km, sortCurve as Sm, storedBytes as Cm, toast as xm, useAutoSize as $m, useConfirm as Im, useDialogFocus as Mm, useDismissableLayer as Tm, useKitStore as Am, useMediaQuery as Em, useWorkspaces as Om, wheelRadius as Rm, wheelValueAt as Dm, workspaceSlug as Lm, writeKitStore as Nm } from "@kition/tessera-ui";
|
|
5
5
|
import { useRef as R, useState as B, useCallback as H, useEffect as J, useMemo as pe, useImperativeHandle as Oo, createContext as Ot, useContext as Le, useSyncExternalStore as He, useLayoutEffect as Te, Fragment as Ro } from "react";
|
|
6
6
|
import { jsx as u, jsxs as M, Fragment as Ce } from "react/jsx-runtime";
|
|
7
|
-
import { CommandGenericIcon as Do, HeadingIcon as qr, ListTreeIcon as Lo, CodeIcon as
|
|
7
|
+
import { CommandGenericIcon as Do, HeadingIcon as qr, ListTreeIcon as Lo, CodeIcon as No, ArrowRightLeftIcon as Po, WaypointsIcon as Ur, GaugeIcon as Fo, SlidersHorizontalIcon as _t, ClipboardIcon as Wo, DatabaseIcon as Kn, HashIcon as pn, ArrowDownToLineIcon as zo, ZapIcon as Bo, PaintbrushIcon as _o, TextCursorInputIcon as Ko, ListOrderedIcon as Hn, NetworkIcon as Ho, MousePointerClickIcon as jr, PenToolIcon as Gr, PencilIcon as tt, HighlighterIcon as Yr, WholeWordIcon as qo, TextCursorIcon as Uo, RulerIcon as Ve, ClapperboardIcon as Vr, BrushIcon as Xr, BlendIcon as Qe, PaletteIcon as Rt, TypeIcon as Ue, PilcrowIcon as jo, SwatchBookIcon as Go, LayersIcon as kt, SplineIcon as gn, CameraIcon as Yo, Rows3Icon as Jr, FilmIcon as qn, BookmarkIcon as Zr, DiamondIcon as Qr, BoxIcon as ei, Grid3x3Icon as St, FrameIcon as Jt, FolderIcon as Un, ClockIcon as Vo, Volume2Icon as Xo, VideoIcon as ti, SettingsIcon as bn, ShapesIcon as _e, LightbulbIcon as Jo, SquareIcon as ct, CrosshairIcon as Zo, Grid2x2Icon as Qo, MoveUpRightIcon as ea, MessageSquareIcon as Dt, FileIcon as wn, TableIcon as yn, SquareFunctionIcon as ni, ComponentIcon as ta, WandSparklesIcon as vn, MousePointer2Icon as nt, BoldIcon as na, ItalicIcon as ri, UnderlineIcon as ra, StrikethroughIcon as ia, SubscriptIcon as oa, SuperscriptIcon as aa, SquareDashedIcon as jn, ContrastIcon as sa, HandIcon as ii, ChevronsDownUpIcon as la, ChevronsUpDownIcon as ca, LinkIcon as Ct, ShieldCheckIcon as da, LifeBuoyIcon as ua, TrashIcon as rt, BookOpenIcon as ha, ArrowLeftIcon as fa, ArrowRightIcon as Gn, ArrowUpIcon as Yn, ArrowDownIcon as Vn, ArrowLeftToLineIcon as ma, ArrowRightToLineIcon as pa, ClipLiftIcon as ga, ClipExtractIcon as ba, FastForwardIcon as wa, StepForwardIcon as Xn, EyeOffIcon as Jn, Undo2Icon as kn, Redo2Icon as oi, SaveIcon as ai, FileOutputIcon as ya, FileInputIcon as va, FolderOpenIcon as ka, XIcon as Zt, PrinterIcon as Sn, CopyIcon as Cn, ScissorsIcon as xn, ClipboardPasteIcon as si, PencilLineIcon as Sa, SearchIcon as li, ReplaceIcon as ci, AlignCenterHorizontalIcon as Ca, RotateCwIcon as $n, FlipHorizontalIcon as xa, MoveIcon as di, ScalingIcon as ui, MergeIcon as $a, SplitIcon as Ia, GroupIcon as In, UngroupIcon as Mn, LockIcon as Tn, LockOpenIcon as Ma, EyeIcon as An, ZoomInIcon as hi, PlayIcon as Ta, PauseIcon as Aa, DiscIcon as Ea, RotateCcwIcon as fi, CheckIcon as En, ToggleLeftIcon as Oa, ChevronRightIcon as On, ChevronLeftIcon as Ra, CropIcon as mi, PlusIcon as pi, ListIcon as Da, RepeatIcon as La, ArrowUpDownIcon as gi, FunnelIcon as bi, UnlinkIcon as Na, RefreshCwIcon as wi, BringToFrontIcon as Qt, MagnetIcon as Pa, PenLineIcon as it, PaintBucketIcon as xt, TablePropertiesIcon as Fa, ActivityIcon as Wa, ChartColumnIcon as je, ImageIcon as za, StickerIcon as Ba, PanelTopIcon as yi, PanelBottomIcon as _a, SigmaIcon as Ka, OmegaIcon as Ha, SquareCheckBigIcon as qa, SignatureIcon as Ua, CalendarIcon as ja, MusicIcon as Ga, QrCodeIcon as Ya, LayoutTemplateIcon as Va, FilePlusIcon as Xa, Columns2Icon as vi, SpellCheckIcon as Ja, LanguagesIcon as Za, TagIcon as ki, RulerDimensionLineIcon as Qa, RadiusIcon as es, DiameterIcon as ts, PackageIcon as ns, StickyNoteIcon as rs, MousePointerIcon as is, LassoIcon as os, MinusIcon as Si, RainbowIcon as as, ShellIcon as ss, CircleIcon as Ci, EraserIcon as xi, VectorPolygonIcon as ls, VectorSquareIcon as cs, WavesHorizontalIcon as ds, Move3dIcon as us, PipetteIcon as hs, CopyPlusIcon as fs, MoveHorizontalIcon as ms, CornerDownRightIcon as ps, UploadIcon as gs, StarIcon as $i, Share2Icon as bs, SendIcon as ws, MailIcon as ys, InfoIcon as vs, CircleQuestionMarkIcon as ks, FlagIcon as Ss, DownloadIcon as Cs, BellIcon as xs, ChevronDownIcon as Ii, ChevronsLeftIcon as $s, ChevronsRightIcon as Is, SparklesIcon as Lt, EllipsisIcon as Ms, RectangleHorizontalIcon as Mi, TriangleIcon as Ts, MoveRightIcon as As, SendToBackIcon as Es, CableIcon as Os, PenIcon as Ti, ChartColumnStackedIcon as Rs, ChartLineIcon as Zn, ChartAreaIcon as Ds, ChartPieIcon as Qn, ChartScatterIcon as Ls, RadarIcon as Ns, LayoutGridIcon as Ps, TrendingUpIcon as Fs, Table2Icon as Ws, Minimize2Icon as zs, FocusIcon as Ai, MenuIcon as Bs } from "@kition/tessera-icons/react";
|
|
8
8
|
import * as lu from "@kition/tessera-icons/react";
|
|
9
9
|
import { w as Fm } from "./chunks/workspaceTree-CpJ2i9hy.js";
|
|
10
10
|
const en = ["menus", "line", "classic", "focus"], _s = ["menus", "line", "classic"], Ks = 720;
|
|
@@ -192,7 +192,7 @@ function al(e, t) {
|
|
|
192
192
|
return r.hostHidden ? [] : [r.hostDisabled ? { ...n, enabled: !1 } : n];
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function Ni(e, t, n) {
|
|
196
196
|
let r = e, i = null;
|
|
197
197
|
const o = /* @__PURE__ */ new Set(), a = (s) => {
|
|
198
198
|
r = i ? { ...s, personal: i } : s;
|
|
@@ -224,7 +224,7 @@ function nr(e, t = null, n = document.documentElement) {
|
|
|
224
224
|
if (r) for (const [i, o] of Object.entries(yo(t, e.colorScheme))) n.style.setProperty(i, o);
|
|
225
225
|
n.dataset.brand = r ? "kit" : "host", n.style.colorScheme = e.colorScheme, n.dataset.colorScheme = e.colorScheme;
|
|
226
226
|
}
|
|
227
|
-
const
|
|
227
|
+
const Nt = () => typeof navigator < "u" && /Mac|iPhone|iPad/i.test(navigator.platform);
|
|
228
228
|
function cu(e) {
|
|
229
229
|
return new Promise((t) => {
|
|
230
230
|
const n = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, r = () => window.parent.postMessage({ kitionKitUi: 1, ready: Bt, id: n }, "*"), i = (o) => {
|
|
@@ -251,8 +251,8 @@ function cu(e) {
|
|
|
251
251
|
},
|
|
252
252
|
stamp: async (m) => (await a.request("host/stamp", { path: m })).version,
|
|
253
253
|
write: async (m, y, I) => {
|
|
254
|
-
const
|
|
255
|
-
return (await a.request("host/write", { path: m, bytes:
|
|
254
|
+
const N = y.buffer.slice(y.byteOffset, y.byteOffset + y.byteLength);
|
|
255
|
+
return (await a.request("host/write", { path: m, bytes: N, mode: "save", ...I === void 0 ? {} : { expected: I } }, { transfer: !0 })).version || null;
|
|
256
256
|
},
|
|
257
257
|
lend: () => s.document.lend ?? null
|
|
258
258
|
};
|
|
@@ -264,16 +264,16 @@ function cu(e) {
|
|
|
264
264
|
});
|
|
265
265
|
const f = vo(e.brand);
|
|
266
266
|
nr(s.theme, f);
|
|
267
|
-
const g =
|
|
267
|
+
const g = Ni(
|
|
268
268
|
tr(s.ui),
|
|
269
269
|
s.capabilities.includes("customize") ? async (m) => void await a.request("host/customize", { personal: { hide: m } }) : null,
|
|
270
270
|
(m) => a.notify("ui/action", m)
|
|
271
271
|
);
|
|
272
272
|
a.on("ui/configure", (m) => g.replace(tr(m?.ui))), document.documentElement.lang = s.locale;
|
|
273
|
-
const
|
|
274
|
-
|
|
273
|
+
const b = s.shortcuts, w = (m) => {
|
|
274
|
+
b.some((y) => Hr(y, m, Nt())) && (m.preventDefault(), m.stopPropagation(), a.notify("host/shortcut", { key: m.key, code: m.code, meta: m.metaKey, ctrl: m.ctrlKey, shift: m.shiftKey, alt: m.altKey }));
|
|
275
275
|
};
|
|
276
|
-
window.addEventListener("keydown",
|
|
276
|
+
window.addEventListener("keydown", w, !0), a.on("ui/theme", ({ theme: m }) => nr(m, f)), a.on("ui/locale", ({ locale: m }) => {
|
|
277
277
|
document.documentElement.lang = m;
|
|
278
278
|
}), t({
|
|
279
279
|
peer: a,
|
|
@@ -320,20 +320,20 @@ function cu(e) {
|
|
|
320
320
|
onComments: (m) => a.on("comments/show", (y) => {
|
|
321
321
|
const I = Array.isArray(y?.threads) ? y.threads : [];
|
|
322
322
|
m(
|
|
323
|
-
I.flatMap((
|
|
324
|
-
const E = zn(
|
|
325
|
-
return E && typeof
|
|
323
|
+
I.flatMap((N) => {
|
|
324
|
+
const E = zn(N?.anchor);
|
|
325
|
+
return E && typeof N?.id == "string" ? [{ id: N.id, anchor: E, resolved: N.resolved === !0, count: Number.isSafeInteger(N.count) ? N.count : 0 }] : [];
|
|
326
326
|
})
|
|
327
327
|
);
|
|
328
328
|
}),
|
|
329
329
|
activateComment: (m) => a.notify("comments/activated", { id: m }),
|
|
330
330
|
locateComments: (m) => a.handle("comments/locate", async (y) => {
|
|
331
|
-
const
|
|
331
|
+
const N = (Array.isArray(y?.anchors) ? y.anchors : []).map((q) => zn(q)), E = await m(N.filter((q) => q !== null));
|
|
332
332
|
let Y = 0;
|
|
333
|
-
return { found:
|
|
333
|
+
return { found: N.map((q) => q ? E[Y++] === !0 : !1) };
|
|
334
334
|
}),
|
|
335
335
|
close: () => {
|
|
336
|
-
window.removeEventListener("keydown",
|
|
336
|
+
window.removeEventListener("keydown", w, !0), a.close();
|
|
337
337
|
}
|
|
338
338
|
});
|
|
339
339
|
})
|
|
@@ -347,7 +347,7 @@ class Je extends Error {
|
|
|
347
347
|
super(t.message), this.data = t, this.name = "KitModelError";
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
const ll = /* @__PURE__ */ new Set(["edit.undo", "undo"]), cl = /* @__PURE__ */ new Set(["edit.redo", "redo"]), Oe = "read-only",
|
|
350
|
+
const ll = /* @__PURE__ */ new Set(["edit.undo", "undo"]), cl = /* @__PURE__ */ new Set(["edit.redo", "redo"]), Oe = "read-only", Pe = Object.freeze({
|
|
351
351
|
/**
|
|
352
352
|
* Families whose commands only change what the person sees (zoom, selection, the playhead,
|
|
353
353
|
* playback): they run even when their kit flags them `mutates`.
|
|
@@ -431,16 +431,16 @@ const ll = /* @__PURE__ */ new Set(["edit.undo", "undo"]), cl = /* @__PURE__ */
|
|
|
431
431
|
});
|
|
432
432
|
function dl(e) {
|
|
433
433
|
const { id: t } = e, n = t.split(".")[0] ?? "";
|
|
434
|
-
return
|
|
434
|
+
return Pe.editingCommands.includes(t) || Pe.documentSettings.includes(t) ? !0 : Pe.editingGroups.includes(n) ? !Pe.fileOutputs.test(t) : Pe.viewingCommands.includes(t) || Pe.viewingGroups.includes(n) ? !1 : e.mutates === !0;
|
|
435
435
|
}
|
|
436
436
|
function ul(e, t) {
|
|
437
|
-
return !t || !e ? /* @__PURE__ */ new Set() : new Set(e.filter((n) => typeof n == "string" && !
|
|
437
|
+
return !t || !e ? /* @__PURE__ */ new Set() : new Set(e.filter((n) => typeof n == "string" && !Pe.editingCommands.includes(n) && !Pe.editingGroups.includes(n.split(".")[0] ?? "")));
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function Pi(e, t) {
|
|
440
440
|
return t.size === 0 ? null : ll.has(e) ? "undo" : cl.has(e) ? "redo" : null;
|
|
441
441
|
}
|
|
442
442
|
function It(e, t) {
|
|
443
|
-
return dl(e) && !t.has(e.id) &&
|
|
443
|
+
return dl(e) && !t.has(e.id) && Pi(e.id, t) === null;
|
|
444
444
|
}
|
|
445
445
|
function hl(e, t) {
|
|
446
446
|
return t.size > 0 && It(e, t);
|
|
@@ -487,7 +487,7 @@ class ot {
|
|
|
487
487
|
static async open(t, n, r, i = null, o = null, a = !1, s = !1) {
|
|
488
488
|
const d = new Worker(new URL(
|
|
489
489
|
/* @vite-ignore */
|
|
490
|
-
"" + new URL("assets/kitEngine.worker-
|
|
490
|
+
"" + new URL("assets/kitEngine.worker-Bb4qhbsX.js", import.meta.url).href,
|
|
491
491
|
import.meta.url
|
|
492
492
|
), { type: "module" }), c = new ot(d, qt);
|
|
493
493
|
d.onmessage = (l) => c.settle(l.data), d.onerror = (l) => c.fail(new Error(l.message || "the kit engine stopped"));
|
|
@@ -505,7 +505,7 @@ class ot {
|
|
|
505
505
|
static async create(t, n, r, i, o = null, a = !1) {
|
|
506
506
|
const s = new Worker(new URL(
|
|
507
507
|
/* @vite-ignore */
|
|
508
|
-
"" + new URL("assets/kitEngine.worker-
|
|
508
|
+
"" + new URL("assets/kitEngine.worker-Bb4qhbsX.js", import.meta.url).href,
|
|
509
509
|
import.meta.url
|
|
510
510
|
), { type: "module" }), d = new ot(s, qt);
|
|
511
511
|
s.onmessage = (c) => d.settle(c.data), s.onerror = (c) => d.fail(new Error(c.message || "the kit engine stopped"));
|
|
@@ -741,14 +741,14 @@ function gl() {
|
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
743
|
const on = /* @__PURE__ */ new WeakMap();
|
|
744
|
-
function
|
|
744
|
+
function bl(e, t) {
|
|
745
745
|
const n = on.get(e);
|
|
746
746
|
return n ? (n.current = t, () => {
|
|
747
747
|
n.current === t && (n.current = null);
|
|
748
748
|
}) : () => {
|
|
749
749
|
};
|
|
750
750
|
}
|
|
751
|
-
class
|
|
751
|
+
class wl extends Error {
|
|
752
752
|
constructor(t) {
|
|
753
753
|
super(`${t} changed on disk since it was opened; merge the change or keep yours before saving`), this.name = "FileChangedError";
|
|
754
754
|
}
|
|
@@ -765,7 +765,7 @@ function kl(e, t, n, r, i, o = {}) {
|
|
|
765
765
|
c.current = o.followFile;
|
|
766
766
|
const l = R(null), p = R(i);
|
|
767
767
|
p.current = i;
|
|
768
|
-
const h = R(null), f = R(!1), [g,
|
|
768
|
+
const h = R(null), f = R(!1), [g, b] = B(null), [w, m] = B(null), [y, I] = B(null), [N, E] = B({ revision: 0, damage: null }), [Y, q] = B(!1), [V, j] = B(null), [D, Z] = B(null), [Q, fe] = B(!1), [ce, k] = B(!1), [O, U] = B(0), x = R(null);
|
|
769
769
|
x.current ??= gl();
|
|
770
770
|
const C = x.current, W = H((S = null) => {
|
|
771
771
|
const $ = l.current;
|
|
@@ -783,7 +783,7 @@ function kl(e, t, n, r, i, o = {}) {
|
|
|
783
783
|
return;
|
|
784
784
|
}
|
|
785
785
|
const ke = l.current;
|
|
786
|
-
l.current = oe, h.current = F,
|
|
786
|
+
l.current = oe, h.current = F, b(oe), k(!1), j(null), W(), ke?.dispose();
|
|
787
787
|
} finally {
|
|
788
788
|
f.current = !1;
|
|
789
789
|
}
|
|
@@ -804,7 +804,7 @@ function kl(e, t, n, r, i, o = {}) {
|
|
|
804
804
|
return S.then($, $), S;
|
|
805
805
|
}, []), ne = H(async () => {
|
|
806
806
|
for (; T.current.size; ) await Promise.allSettled([...T.current]);
|
|
807
|
-
}, []),
|
|
807
|
+
}, []), P = H(
|
|
808
808
|
async (S = () => !0) => {
|
|
809
809
|
const $ = l.current;
|
|
810
810
|
if (!(!$ || f.current || !h.current))
|
|
@@ -840,11 +840,11 @@ function kl(e, t, n, r, i, o = {}) {
|
|
|
840
840
|
);
|
|
841
841
|
J(() => {
|
|
842
842
|
let S = !0;
|
|
843
|
-
const $ = window.setInterval(() => void
|
|
843
|
+
const $ = window.setInterval(() => void P(() => S), yl);
|
|
844
844
|
return () => {
|
|
845
845
|
S = !1, window.clearInterval($);
|
|
846
846
|
};
|
|
847
|
-
}, [r,
|
|
847
|
+
}, [r, P]);
|
|
848
848
|
const G = R(null), ue = H((S) => G.current ? G.current(S) : S(), []), ye = H(
|
|
849
849
|
async (S, $, F, X) => {
|
|
850
850
|
const ee = l.current;
|
|
@@ -852,7 +852,7 @@ function kl(e, t, n, r, i, o = {}) {
|
|
|
852
852
|
const de = X.skipUnchangedPaint ? { revision: ee.info.revision, inspected: JSON.stringify(ee.info.inspected) } : null, oe = await ee.execute(S, $, X.origin, X.agent);
|
|
853
853
|
if (l.current === ee) {
|
|
854
854
|
if (ee.closed)
|
|
855
|
-
return ee.dispose(), l.current = null,
|
|
855
|
+
return ee.dispose(), l.current = null, b(null), m(null), I(null), q(!1), k(!1), oe;
|
|
856
856
|
const ke = X.refresh ?? "all", dt = de != null && ee.info.revision === de.revision && JSON.stringify(ee.info.inspected) === de.inspected;
|
|
857
857
|
ke === "all" ? W(dt ? rr : F) : ke === "repaint" && C.bump(F);
|
|
858
858
|
}
|
|
@@ -862,13 +862,13 @@ function kl(e, t, n, r, i, o = {}) {
|
|
|
862
862
|
), Ie = H(
|
|
863
863
|
async (S, $ = {}, F = null, X = {}) => l.current ? K(ue(() => ye(S, $, F, X))) : null,
|
|
864
864
|
[ue, ye, K]
|
|
865
|
-
),
|
|
865
|
+
), Ne = H(async (S, $ = [], F = !1) => {
|
|
866
866
|
const X = l.current;
|
|
867
867
|
if (!X) return null;
|
|
868
868
|
const ee = X.info.revision, { value: de, changed: oe } = await K(X.tool(S, $, F));
|
|
869
869
|
return l.current === X && oe && W(X.info.revision === ee ? rr : pl(de)), de;
|
|
870
870
|
}, [W, K]);
|
|
871
|
-
on.has(
|
|
871
|
+
on.has(Ne) || on.set(Ne, G);
|
|
872
872
|
const We = H(async () => l.current ? l.current.commands() : [], []), A = H(async () => ue(async () => l.current ? l.current.disabledCommands() : []), [ue]), L = H(async () => {
|
|
873
873
|
const S = l.current;
|
|
874
874
|
if (S) {
|
|
@@ -877,7 +877,7 @@ function kl(e, t, n, r, i, o = {}) {
|
|
|
877
877
|
try {
|
|
878
878
|
const $ = h.current, F = $ ? await e.stamp(n).catch(() => null) : null;
|
|
879
879
|
if ($ && F && F !== $)
|
|
880
|
-
throw k(!0), new
|
|
880
|
+
throw k(!0), new wl(n);
|
|
881
881
|
const { bytes: X, replica: ee, revision: de } = await ue(async () => e.replicaWrite ? S.saveWithReplica() : { ...await S.serialize(), replica: null });
|
|
882
882
|
h.current = await ml(e, n, X, ee, $), l.current === S && await S.markSaved(de), k(!1), W();
|
|
883
883
|
} finally {
|
|
@@ -953,7 +953,7 @@ function kl(e, t, n, r, i, o = {}) {
|
|
|
953
953
|
const S = await e.stamp(n).catch(() => null);
|
|
954
954
|
S && (h.current = S);
|
|
955
955
|
}, [e, n]), z = pe(() => ({ get: C.get, subscribe: C.subscribe }), [C]);
|
|
956
|
-
return { path: n, manifest: t, doc: g, info:
|
|
956
|
+
return { path: n, manifest: t, doc: g, info: w, state: y, change: N, repaints: z, dirty: Y, failure: V, openMs: D, saving: Q, conflict: ce, run: Ie, tool: Ne, commands: We, disabledCommands: A, save: L, replica: re, model: ie, draft: ae, reopen: se, keepMine: v, checkFile: P, holdFile: ge };
|
|
957
957
|
}
|
|
958
958
|
async function an(e, t) {
|
|
959
959
|
const n = Math.min(1, t / Math.max(1, e.width, e.height)), r = Math.max(1, Math.round(e.width * n)), i = Math.max(1, Math.round(e.height * n)), o = await e.render(0, 0, n, r, i), a = document.createElement("canvas");
|
|
@@ -1063,7 +1063,7 @@ class Cl {
|
|
|
1063
1063
|
}
|
|
1064
1064
|
const xl = [
|
|
1065
1065
|
[/^tool-selection$/, nt],
|
|
1066
|
-
[/^tool-page$/,
|
|
1066
|
+
[/^tool-page$/, wn],
|
|
1067
1067
|
[/^tool-gap$/, vi],
|
|
1068
1068
|
[/^tool-(collector|placer)/, ns],
|
|
1069
1069
|
[/^tool-(rect-frame|ellipse-frame|polygon-frame)/, Jt],
|
|
@@ -1148,7 +1148,7 @@ const Il = [
|
|
|
1148
1148
|
[/page|section|break|sheet|slide/, Xa],
|
|
1149
1149
|
[/rows?\b/, Jr],
|
|
1150
1150
|
[/columns?\b/, vi],
|
|
1151
|
-
[/filter/,
|
|
1151
|
+
[/filter/, bi],
|
|
1152
1152
|
[/sort/, gi],
|
|
1153
1153
|
[/ungroup/, Mn],
|
|
1154
1154
|
[/group/, In],
|
|
@@ -1161,12 +1161,12 @@ const Il = [
|
|
|
1161
1161
|
[/copy|duplicate/, Cn],
|
|
1162
1162
|
[/cut\b/, xn],
|
|
1163
1163
|
[/delete|remove|clear/, rt],
|
|
1164
|
-
[/refresh|recalc/,
|
|
1164
|
+
[/refresh|recalc/, wi],
|
|
1165
1165
|
[/protect|lock/, Tn],
|
|
1166
1166
|
[/name|label|tag/, ki],
|
|
1167
1167
|
[/show|hide|view/, An],
|
|
1168
|
-
[/option|setting|propert/,
|
|
1169
|
-
[/\bfile\b|document/,
|
|
1168
|
+
[/option|setting|propert/, bn],
|
|
1169
|
+
[/\bfile\b|document/, wn]
|
|
1170
1170
|
], Ml = [
|
|
1171
1171
|
[/^(?:bold)$/, na],
|
|
1172
1172
|
[/^(?:italic)$/, ri],
|
|
@@ -1193,8 +1193,8 @@ const Il = [
|
|
|
1193
1193
|
[/^(?:home|start)$/, ma],
|
|
1194
1194
|
[/^(?:end)$/, pa],
|
|
1195
1195
|
[/^(?:lift)$/, ga],
|
|
1196
|
-
[/^(?:extract)$/,
|
|
1197
|
-
[/^(?:shuttle)$/,
|
|
1196
|
+
[/^(?:extract)$/, ba],
|
|
1197
|
+
[/^(?:shuttle)$/, wa],
|
|
1198
1198
|
[/^(?:tick|advance)$/, Xn],
|
|
1199
1199
|
[/^(?:batch)$/, kt],
|
|
1200
1200
|
[/^(?:redact)$/, Jn],
|
|
@@ -1248,15 +1248,15 @@ const Il = [
|
|
|
1248
1248
|
[/^(?:list|inspect|info|get|query|state)$/, Da],
|
|
1249
1249
|
[/^(?:convert|change)$/, La],
|
|
1250
1250
|
[/^(?:sort)$/, gi],
|
|
1251
|
-
[/^(?:filter)$/,
|
|
1251
|
+
[/^(?:filter)$/, bi],
|
|
1252
1252
|
[/^(?:link)$/, Ct],
|
|
1253
|
-
[/^(?:unlink)$/,
|
|
1253
|
+
[/^(?:unlink)$/, Na],
|
|
1254
1254
|
[/^(?:increase|grow|raise)$/, Yn],
|
|
1255
1255
|
[/^(?:decrease|shrink|lower)$/, Vn],
|
|
1256
|
-
[/^(?:refresh|reload|update|sync)$/,
|
|
1256
|
+
[/^(?:refresh|reload|update|sync)$/, wi],
|
|
1257
1257
|
[/^(?:define|edit|modify|configure)$/, tt],
|
|
1258
1258
|
[/^(?:arrange|order|bring|send)$/, Qt],
|
|
1259
|
-
[/^(?:snap)$/,
|
|
1259
|
+
[/^(?:snap)$/, Pa],
|
|
1260
1260
|
[/^(?:smooth|simplify)$/, gn],
|
|
1261
1261
|
[/^(?:stroke|outline)$/, it],
|
|
1262
1262
|
[/^(?:fill)$/, xt],
|
|
@@ -1264,8 +1264,8 @@ const Il = [
|
|
|
1264
1264
|
], or = [
|
|
1265
1265
|
[/\b(?:heading|title)\b/, qr],
|
|
1266
1266
|
[/\b(?:level|outline|tree)\b/, Lo],
|
|
1267
|
-
[/\b(?:code)\b/,
|
|
1268
|
-
[/\b(?:direction)\b/,
|
|
1267
|
+
[/\b(?:code)\b/, No],
|
|
1268
|
+
[/\b(?:direction)\b/, Po],
|
|
1269
1269
|
[/\b(?:waypoints?|bends?)\b/, Ur],
|
|
1270
1270
|
[/\b(?:stats|statistics|performance)\b/, Fo],
|
|
1271
1271
|
[/\b(?:mixer)\b/, _t],
|
|
@@ -1311,7 +1311,7 @@ const Il = [
|
|
|
1311
1311
|
[/\b(?:playhead|time|duration)\b/, Vo],
|
|
1312
1312
|
[/\b(?:audio|sound|volume)\b/, Xo],
|
|
1313
1313
|
[/\b(?:video)\b/, ti],
|
|
1314
|
-
[/\b(?:preferences|settings|options)\b/,
|
|
1314
|
+
[/\b(?:preferences|settings|options)\b/, bn],
|
|
1315
1315
|
[/\b(?:shape|rectangle|ellipse|polygon)\b/, _e],
|
|
1316
1316
|
[/\b(?:light|lamp)\b/, Jo],
|
|
1317
1317
|
[/\b(?:solid)\b/, ct],
|
|
@@ -1323,7 +1323,7 @@ const Il = [
|
|
|
1323
1323
|
[/\b(?:gradient mesh|mesh)\b/, St],
|
|
1324
1324
|
[/\b(?:line|arrow)\b/, ea],
|
|
1325
1325
|
[/\b(?:comment|note)\b/, Dt],
|
|
1326
|
-
[/\b(?:page)\b/,
|
|
1326
|
+
[/\b(?:page)\b/, wn],
|
|
1327
1327
|
[/\b(?:cell|row|column)\b/, yn],
|
|
1328
1328
|
[/\b(?:formula|function)\b/, ni],
|
|
1329
1329
|
[/\b(?:symbol)\b/, ta],
|
|
@@ -1344,7 +1344,7 @@ function Ge(e) {
|
|
|
1344
1344
|
const a = Ml.find(([s]) => s.test(r) || s.test(i))?.[1];
|
|
1345
1345
|
return a || (or.find(([s]) => s.test(o))?.[1] ?? Il.find(([s]) => s.test(o))?.[1] ?? at);
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function Pt(e) {
|
|
1348
1348
|
return Object.values(e.schema ?? {}).some((t) => t.required);
|
|
1349
1349
|
}
|
|
1350
1350
|
const Tl = 6, sr = (e) => typeof e == "string" ? e : JSON.stringify(e);
|
|
@@ -1378,19 +1378,19 @@ function Ol({
|
|
|
1378
1378
|
title: o
|
|
1379
1379
|
}) {
|
|
1380
1380
|
const a = e.schema ?? {}, [s, d] = B(() => Object.fromEntries(Object.entries(a).map(([m, y]) => [m, Al(y, i[m])]))), c = Object.entries(a), l = c.length > Tl, p = ([m, y]) => !l || y.required || i[m] !== void 0, h = c.filter(p), f = c.filter((m) => !p(m)), g = ([m, y]) => {
|
|
1381
|
-
const I = (E) => d((Y) => ({ ...Y, [m]: E })),
|
|
1381
|
+
const I = (E) => d((Y) => ({ ...Y, [m]: E })), N = `param-${m}`;
|
|
1382
1382
|
return [
|
|
1383
|
-
/* @__PURE__ */ M("label", { htmlFor:
|
|
1383
|
+
/* @__PURE__ */ M("label", { htmlFor: N, title: y.description, children: [
|
|
1384
1384
|
m,
|
|
1385
1385
|
y.required ? /* @__PURE__ */ u("span", { title: r.required, children: " *" }) : null
|
|
1386
1386
|
] }, `${m}-label`),
|
|
1387
|
-
y.enum?.length ? /* @__PURE__ */ M("select", { id:
|
|
1387
|
+
y.enum?.length ? /* @__PURE__ */ M("select", { id: N, className: "kui-field", value: s[m], onChange: (E) => I(E.target.value), children: [
|
|
1388
1388
|
y.required ? null : /* @__PURE__ */ u("option", { value: "" }),
|
|
1389
1389
|
y.enum.map((E) => /* @__PURE__ */ u("option", { value: String(E), children: String(E) }, String(E)))
|
|
1390
|
-
] }, m) : y.type === "boolean" ? /* @__PURE__ */ u("input", { id:
|
|
1390
|
+
] }, m) : y.type === "boolean" ? /* @__PURE__ */ u("input", { id: N, type: "checkbox", checked: s[m] === "true", onChange: (E) => I(String(E.target.checked)) }, m) : /* @__PURE__ */ u(
|
|
1391
1391
|
"input",
|
|
1392
1392
|
{
|
|
1393
|
-
id:
|
|
1393
|
+
id: N,
|
|
1394
1394
|
className: "kui-field",
|
|
1395
1395
|
type: y.type === "number" || y.type === "integer" ? "number" : "text",
|
|
1396
1396
|
value: s[m],
|
|
@@ -1400,11 +1400,11 @@ function Ol({
|
|
|
1400
1400
|
m
|
|
1401
1401
|
)
|
|
1402
1402
|
];
|
|
1403
|
-
},
|
|
1403
|
+
}, b = Object.entries(a).some(([m, y]) => y.required && (s[m] ?? "").trim() === ""), w = () => {
|
|
1404
1404
|
const m = {};
|
|
1405
1405
|
for (const [y, I] of Object.entries(a)) {
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1406
|
+
const N = El(I, s[y] ?? "");
|
|
1407
|
+
N !== void 0 && (m[y] = N);
|
|
1408
1408
|
}
|
|
1409
1409
|
t(m);
|
|
1410
1410
|
};
|
|
@@ -1415,13 +1415,13 @@ function Ol({
|
|
|
1415
1415
|
onClose: n,
|
|
1416
1416
|
actions: /* @__PURE__ */ M(Ce, { children: [
|
|
1417
1417
|
/* @__PURE__ */ u(me, { onClick: n, children: r.cancel }),
|
|
1418
|
-
/* @__PURE__ */ u(me, { variant: "primary", disabled:
|
|
1418
|
+
/* @__PURE__ */ u(me, { variant: "primary", disabled: b, onClick: w, "data-testid": "command-dialog-run", children: r.run })
|
|
1419
1419
|
] }),
|
|
1420
1420
|
children: /* @__PURE__ */ M(
|
|
1421
1421
|
"form",
|
|
1422
1422
|
{
|
|
1423
1423
|
onSubmit: (m) => {
|
|
1424
|
-
m.preventDefault(),
|
|
1424
|
+
m.preventDefault(), b || w();
|
|
1425
1425
|
},
|
|
1426
1426
|
children: [
|
|
1427
1427
|
/* @__PURE__ */ u("div", { className: "kui-param-grid", children: h.map(g) }),
|
|
@@ -1500,7 +1500,7 @@ function _i(e, t) {
|
|
|
1500
1500
|
return i ? o.replace(/\{(\w+)\}/g, (a, s) => s in i ? String(i[s]) : a) : o;
|
|
1501
1501
|
};
|
|
1502
1502
|
}
|
|
1503
|
-
const Ll = /* @__PURE__ */ new Set(["Cmd+N", "Cmd+W", "Cmd+O", "Cmd+P", "Cmd+Q", "Cmd+,", "Cmd+S", "Cmd+Shift+S", "Cmd+T", "Cmd+."]),
|
|
1503
|
+
const Ll = /* @__PURE__ */ new Set(["Cmd+N", "Cmd+W", "Cmd+O", "Cmd+P", "Cmd+Q", "Cmd+,", "Cmd+S", "Cmd+Shift+S", "Cmd+T", "Cmd+."]), Nl = Ll, lr = {
|
|
1504
1504
|
"[": "BracketLeft",
|
|
1505
1505
|
"]": "BracketRight",
|
|
1506
1506
|
",": "Comma",
|
|
@@ -1520,11 +1520,11 @@ function cr(e, t, n = Ki(), r = !1) {
|
|
|
1520
1520
|
const i = e.split("+"), o = i.length > 1 && i[i.length - 1] === "" ? "+" : i.pop() ?? "", a = new Set(i.filter(Boolean)), s = a.has("Cmd"), d = n ? t.metaKey : t.ctrlKey, c = n ? t.ctrlKey : !1;
|
|
1521
1521
|
return s !== d || a.has("Ctrl") !== c || a.has("Shift") !== t.shiftKey || a.has("Alt") !== t.altKey ? !1 : /^[A-Za-z]$/.test(o) ? t.code === `Key${o.toUpperCase()}` : /^[0-9]$/.test(o) ? t.code === `Digit${o}` : lr[o] ? t.code === lr[o] : o === "Delete" ? t.key === "Delete" || !r && t.key === "Backspace" : t.key === o;
|
|
1522
1522
|
}
|
|
1523
|
-
function
|
|
1524
|
-
return !e ||
|
|
1523
|
+
function Pl(e) {
|
|
1524
|
+
return !e || Nl.has(e) ? !1 : e.includes("+") || /^(Delete|Backspace|PageUp|PageDown|F[0-9]{1,2})$/.test(e);
|
|
1525
1525
|
}
|
|
1526
1526
|
function Fl(e, t, n = Ki()) {
|
|
1527
|
-
const r = e.filter((i) =>
|
|
1527
|
+
const r = e.filter((i) => Pl(i.shortcut));
|
|
1528
1528
|
return r.find((i) => cr(i.shortcut, t, n, !0)) ?? r.find((i) => cr(i.shortcut, t, n));
|
|
1529
1529
|
}
|
|
1530
1530
|
const Wl = 4, Re = {
|
|
@@ -1805,25 +1805,25 @@ class ql {
|
|
|
1805
1805
|
}
|
|
1806
1806
|
/** Renders the document area a pane shows, at the zoom; null when it shows none of it. */
|
|
1807
1807
|
async renderPane(t, n) {
|
|
1808
|
-
const r = this.view.zoom * n, i = (
|
|
1809
|
-
const
|
|
1808
|
+
const r = this.view.zoom * n, i = (b) => {
|
|
1809
|
+
const w = t.pinX ? 0 : (t.area.x1 - t.area.x0) * b, m = t.pinY ? 0 : (t.area.y1 - t.area.y0) * b;
|
|
1810
1810
|
return {
|
|
1811
|
-
x0: Math.max(0, Math.floor(t.area.x0 -
|
|
1811
|
+
x0: Math.max(0, Math.floor(t.area.x0 - w)),
|
|
1812
1812
|
y0: Math.max(0, Math.floor(t.area.y0 - m)),
|
|
1813
|
-
x1: Math.min(this.doc.width, Math.ceil(t.area.x1 +
|
|
1813
|
+
x1: Math.min(this.doc.width, Math.ceil(t.area.x1 + w)),
|
|
1814
1814
|
y1: Math.min(this.doc.height, Math.ceil(t.area.y1 + m))
|
|
1815
1815
|
};
|
|
1816
|
-
}, o = (
|
|
1816
|
+
}, o = (b) => (b.x1 - b.x0) * (b.y1 - b.y0) * Math.min(1, r) ** 2 * Math.max(1, r) ** 2 <= Ut, { x0: a, y0: s, x1: d, y1: c } = Bl.map(i).find((b) => o(b)) ?? i(0);
|
|
1817
1817
|
if (d <= a || c <= s) return null;
|
|
1818
1818
|
let l, p, h, f;
|
|
1819
1819
|
if (r < 1) {
|
|
1820
|
-
let
|
|
1821
|
-
for (; (d - a) /
|
|
1822
|
-
h = Math.ceil((d - a) /
|
|
1820
|
+
let b = Math.max(1, Math.floor(1 / r));
|
|
1821
|
+
for (; (d - a) / b * ((c - s) / b) > Ut; ) b += 1;
|
|
1822
|
+
h = Math.ceil((d - a) / b), f = Math.ceil((c - s) / b), p = await this.doc.renderArea(a, s, a + h * b, s + f * b, h, f), l = { x: a, y: s, width: h * b, height: f * b, scale: 1 / b };
|
|
1823
1823
|
} else {
|
|
1824
|
-
let
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1824
|
+
let b = r;
|
|
1825
|
+
const w = (d - a) * (c - s) * b * b, m = i(0), y = Math.max(Ut, Math.min(zl, (m.x1 - m.x0) * (m.y1 - m.y0) * r * r));
|
|
1826
|
+
w > y && (b = Math.max(1, b * Math.sqrt(y / w))), b = Math.max(1, Math.min(b, dr / (d - a), dr / (c - s))), h = Math.max(1, Math.ceil((d - a) * b)), f = Math.max(1, Math.ceil((c - s) * b)), p = await this.doc.render(a, s, b, h, f), l = { x: a, y: s, width: h / b, height: f / b, scale: b };
|
|
1827
1827
|
}
|
|
1828
1828
|
const g = document.createElement("canvas");
|
|
1829
1829
|
return g.width = h, g.height = f, g.getContext("2d")?.putImageData(fr(p, h, f), 0, 0), { bitmap: g, ...l, pinX: t.pinX, pinY: t.pinY };
|
|
@@ -1838,15 +1838,15 @@ class ql {
|
|
|
1838
1838
|
if (!n.length || this.rendering || this.failed)
|
|
1839
1839
|
return this.render();
|
|
1840
1840
|
const r = n.flatMap((c) => {
|
|
1841
|
-
const l = c.bitmap.width / c.width, p = c.bitmap.height / c.height, h = ft(Math.floor((t.x0 - c.x) * l), 0, c.bitmap.width), f = ft(Math.floor((t.y0 - c.y) * p), 0, c.bitmap.height), g = ft(Math.ceil((t.x1 - c.x) * l), 0, c.bitmap.width),
|
|
1842
|
-
return g > h &&
|
|
1841
|
+
const l = c.bitmap.width / c.width, p = c.bitmap.height / c.height, h = ft(Math.floor((t.x0 - c.x) * l), 0, c.bitmap.width), f = ft(Math.floor((t.y0 - c.y) * p), 0, c.bitmap.height), g = ft(Math.ceil((t.x1 - c.x) * l), 0, c.bitmap.width), b = ft(Math.ceil((t.y1 - c.y) * p), 0, c.bitmap.height);
|
|
1842
|
+
return g > h && b > f ? [{ frame: c, sx: l, sy: p, px0: h, py0: f, width: g - h, height: b - f }] : [];
|
|
1843
1843
|
});
|
|
1844
1844
|
if (!r.length) return !1;
|
|
1845
1845
|
const i = performance.now(), o = this.generation, a = [];
|
|
1846
1846
|
try {
|
|
1847
|
-
for (const { frame: c, sx: l, sy: p, px0: h, py0: f, width: g, height:
|
|
1848
|
-
const
|
|
1849
|
-
a.push(c.scale < 1 ? await this.doc.renderArea(c.x + h *
|
|
1847
|
+
for (const { frame: c, sx: l, sy: p, px0: h, py0: f, width: g, height: b } of r) {
|
|
1848
|
+
const w = Math.round(1 / c.scale);
|
|
1849
|
+
a.push(c.scale < 1 ? await this.doc.renderArea(c.x + h * w, c.y + f * w, c.x + (h + g) * w, c.y + (f + b) * w, g, b) : await this.doc.render(c.x + h / l, c.y + f / p, c.scale, g, b));
|
|
1850
1850
|
}
|
|
1851
1851
|
} catch (c) {
|
|
1852
1852
|
return !this.disposed && o === this.generation && this.frames === n && (this.failed = !0, this.onRender(c)), !1;
|
|
@@ -1875,7 +1875,7 @@ class ql {
|
|
|
1875
1875
|
const c = jt(s, this.pins, t, n);
|
|
1876
1876
|
for (const l of c) {
|
|
1877
1877
|
a.save(), c.length > 1 && (a.beginPath(), a.rect(l.clip.x0, l.clip.y0, l.clip.x1 - l.clip.x0, l.clip.y1 - l.clip.y0), a.clip());
|
|
1878
|
-
const p = (g,
|
|
1878
|
+
const p = (g, b) => ({ x: (g - l.offX) * d, y: (b - l.offY) * d }), h = p(0, 0);
|
|
1879
1879
|
this.framed && (a.shadowColor = "rgba(15, 15, 30, 0.12)", a.shadowBlur = 12, this.pattern ??= Hl(a), a.fillStyle = this.pattern ?? "#ffffff", a.fillRect(h.x, h.y, this.doc.width * d, this.doc.height * d), a.shadowBlur = 0);
|
|
1880
1880
|
const f = this.frames.find((g) => g.pinX === l.pinX && g.pinY === l.pinY);
|
|
1881
1881
|
if (f) {
|
|
@@ -1936,11 +1936,11 @@ function Vl(e, t) {
|
|
|
1936
1936
|
};
|
|
1937
1937
|
}
|
|
1938
1938
|
function Xl({ doc: e, change: t, repaint: n, tool: r, onView: i, onRender: o, viewMemory: a, initialArea: s = null, panBounds: d = null, decorate: c = null, animated: l = !1, spacePans: p = !0, framed: h = !0, children: f, ref: g }) {
|
|
1939
|
-
const
|
|
1939
|
+
const b = R(null), w = R(null), m = R(null), y = R(null), [I, N] = B(!1), E = R({ doc: e, onView: i, onRender: o, initialArea: s, panBounds: d });
|
|
1940
1940
|
E.current = { doc: e, onView: i, onRender: o, initialArea: s, panBounds: d };
|
|
1941
|
-
const Y = Vl(
|
|
1941
|
+
const Y = Vl(w, m);
|
|
1942
1942
|
J(() => {
|
|
1943
|
-
const k =
|
|
1943
|
+
const k = b.current;
|
|
1944
1944
|
if (!k) return;
|
|
1945
1945
|
let O = a.current != null;
|
|
1946
1946
|
const U = new ql(k, e, pr(), (_, T) => {
|
|
@@ -1984,16 +1984,16 @@ function Xl({ doc: e, change: t, repaint: n, tool: r, onView: i, onRender: o, vi
|
|
|
1984
1984
|
}, [l, c, e]), J(() => {
|
|
1985
1985
|
if (!p) return;
|
|
1986
1986
|
const k = (x) => x instanceof HTMLInputElement || x instanceof HTMLTextAreaElement, O = (x) => {
|
|
1987
|
-
x.code === "Space" && !k(x.target) &&
|
|
1987
|
+
x.code === "Space" && !k(x.target) && N(!0);
|
|
1988
1988
|
}, U = (x) => {
|
|
1989
|
-
x.code === "Space" &&
|
|
1989
|
+
x.code === "Space" && N(!1);
|
|
1990
1990
|
};
|
|
1991
1991
|
return window.addEventListener("keydown", O), window.addEventListener("keyup", U), () => {
|
|
1992
1992
|
window.removeEventListener("keydown", O), window.removeEventListener("keyup", U);
|
|
1993
1993
|
};
|
|
1994
1994
|
}, [p]), Oo(g, () => ({
|
|
1995
1995
|
view: () => {
|
|
1996
|
-
const k = m.current, O =
|
|
1996
|
+
const k = m.current, O = b.current;
|
|
1997
1997
|
return k && O ? { ...k.view, width: O.clientWidth, height: O.clientHeight } : null;
|
|
1998
1998
|
},
|
|
1999
1999
|
fit: () => m.current?.fit(),
|
|
@@ -2047,7 +2047,7 @@ function Xl({ doc: e, change: t, repaint: n, tool: r, onView: i, onRender: o, vi
|
|
|
2047
2047
|
/* @__PURE__ */ u(
|
|
2048
2048
|
"canvas",
|
|
2049
2049
|
{
|
|
2050
|
-
ref:
|
|
2050
|
+
ref: b,
|
|
2051
2051
|
className: "kui-canvas-surface",
|
|
2052
2052
|
style: { cursor: I ? Re.cursor : r.cursor },
|
|
2053
2053
|
onPointerDown: D,
|
|
@@ -2067,14 +2067,14 @@ function Xl({ doc: e, change: t, repaint: n, tool: r, onView: i, onRender: o, vi
|
|
|
2067
2067
|
"data-testid": "kit-canvas-surface"
|
|
2068
2068
|
}
|
|
2069
2069
|
),
|
|
2070
|
-
/* @__PURE__ */ u("canvas", { ref:
|
|
2070
|
+
/* @__PURE__ */ u("canvas", { ref: w, className: "kui-canvas-overlay", "aria-hidden": "true" }),
|
|
2071
2071
|
f
|
|
2072
2072
|
] });
|
|
2073
2073
|
}
|
|
2074
|
-
const
|
|
2074
|
+
const bt = /* @__PURE__ */ new Set();
|
|
2075
2075
|
function Jl(e) {
|
|
2076
2076
|
const t = (n, r, i) => {
|
|
2077
|
-
|
|
2077
|
+
bt.has(t) || e(n, r, i);
|
|
2078
2078
|
};
|
|
2079
2079
|
return t;
|
|
2080
2080
|
}
|
|
@@ -2091,14 +2091,14 @@ function gr(e, t) {
|
|
|
2091
2091
|
} finally {
|
|
2092
2092
|
r.restore();
|
|
2093
2093
|
}
|
|
2094
|
-
const a = qi(e).filter((s) => !
|
|
2095
|
-
for (const s of a)
|
|
2094
|
+
const a = qi(e).filter((s) => !bt.has(s));
|
|
2095
|
+
for (const s of a) bt.add(s);
|
|
2096
2096
|
r.save();
|
|
2097
2097
|
try {
|
|
2098
2098
|
t(r, i, o);
|
|
2099
2099
|
} finally {
|
|
2100
2100
|
r.restore();
|
|
2101
|
-
for (const s of a)
|
|
2101
|
+
for (const s of a) bt.delete(s);
|
|
2102
2102
|
}
|
|
2103
2103
|
};
|
|
2104
2104
|
return Hi.set(n, [e, t]), n;
|
|
@@ -2140,8 +2140,8 @@ function Gi({ commands: e, declaration: t, engineTools: n, agent: r, t: i, phras
|
|
|
2140
2140
|
const s = [], d = /* @__PURE__ */ new Set(), c = (l, p, h, f, g = []) => {
|
|
2141
2141
|
if (d.has(l)) return;
|
|
2142
2142
|
d.add(l);
|
|
2143
|
-
const
|
|
2144
|
-
s.push({ id: l, kind: p, label: h, parent: f, hidden:
|
|
2143
|
+
const b = Se(a, l, g);
|
|
2144
|
+
s.push({ id: l, kind: p, label: h, parent: f, hidden: b.hidden, disabled: b.disabled });
|
|
2145
2145
|
};
|
|
2146
2146
|
for (const l of Ui(t?.menus ?? [])) c(l.id, l.kind, o(l.label), l.parent, l.menu);
|
|
2147
2147
|
for (const l of e) {
|
|
@@ -2157,9 +2157,9 @@ function Gi({ commands: e, declaration: t, engineTools: n, agent: r, t: i, phras
|
|
|
2157
2157
|
for (const l of ji) (r || l.id !== "action:agent") && c(l.id, "action", i(l.label), null);
|
|
2158
2158
|
return s;
|
|
2159
2159
|
}
|
|
2160
|
-
const Ql = () => !1, Wt = Ot(null), ec =
|
|
2160
|
+
const Ql = () => !1, Wt = Ot(null), ec = Ni(nn, null, () => {
|
|
2161
2161
|
});
|
|
2162
|
-
function
|
|
2162
|
+
function we() {
|
|
2163
2163
|
const e = Le(Wt), t = e?.store ?? ec, n = He(t.subscribe, t.get);
|
|
2164
2164
|
return {
|
|
2165
2165
|
config: n,
|
|
@@ -2184,7 +2184,7 @@ function Yi({ value: e, children: t }) {
|
|
|
2184
2184
|
return /* @__PURE__ */ u(Wt.Provider, { value: e, children: /* @__PURE__ */ u(tc, { children: t }) });
|
|
2185
2185
|
}
|
|
2186
2186
|
function tc({ children: e }) {
|
|
2187
|
-
const t = Le(Wt), n =
|
|
2187
|
+
const t = Le(Wt), n = we(), { config: r } = n, i = pe(
|
|
2188
2188
|
() => ({
|
|
2189
2189
|
state: (o) => n.state(o),
|
|
2190
2190
|
renderExtras: (o, a) => n.renderButtons(o, a),
|
|
@@ -2198,12 +2198,12 @@ function tc({ children: e }) {
|
|
|
2198
2198
|
return /* @__PURE__ */ u(ko, { elements: i, children: e });
|
|
2199
2199
|
}
|
|
2200
2200
|
function pu({ id: e, children: t }) {
|
|
2201
|
-
const n =
|
|
2201
|
+
const n = we();
|
|
2202
2202
|
n.declared;
|
|
2203
2203
|
const r = n.state(e);
|
|
2204
2204
|
return r.hidden ? null : /* @__PURE__ */ u("fieldset", { className: "kui-element", "data-kit-ui-id": e, disabled: r.disabled, role: "presentation", children: t });
|
|
2205
2205
|
}
|
|
2206
|
-
const
|
|
2206
|
+
const br = {
|
|
2207
2207
|
bell: xs,
|
|
2208
2208
|
check: En,
|
|
2209
2209
|
download: Cs,
|
|
@@ -2217,16 +2217,16 @@ const wr = {
|
|
|
2217
2217
|
message: Dt,
|
|
2218
2218
|
plus: pi,
|
|
2219
2219
|
printer: Sn,
|
|
2220
|
-
send:
|
|
2221
|
-
settings:
|
|
2222
|
-
share:
|
|
2220
|
+
send: ws,
|
|
2221
|
+
settings: bn,
|
|
2222
|
+
share: bs,
|
|
2223
2223
|
star: $i,
|
|
2224
2224
|
upload: gs,
|
|
2225
2225
|
x: Zt
|
|
2226
2226
|
}, ze = /* @__PURE__ */ new Map(), nc = 32;
|
|
2227
2227
|
function rc(e) {
|
|
2228
2228
|
if (!e) return;
|
|
2229
|
-
if (!e.startsWith("data:image/")) return Object.hasOwn(
|
|
2229
|
+
if (!e.startsWith("data:image/")) return Object.hasOwn(br, e) ? br[e] : ct;
|
|
2230
2230
|
const t = ze.get(e);
|
|
2231
2231
|
if (t)
|
|
2232
2232
|
return ze.delete(e), ze.set(e, t), t;
|
|
@@ -2238,25 +2238,25 @@ function rc(e) {
|
|
|
2238
2238
|
return ze.set(e, n), n;
|
|
2239
2239
|
}
|
|
2240
2240
|
function zt({ place: e, as: t }) {
|
|
2241
|
-
const n =
|
|
2241
|
+
const n = we();
|
|
2242
2242
|
return /* @__PURE__ */ u(Ce, { children: n.buttons(e).map((r) => {
|
|
2243
2243
|
const i = il(r, n.locale), o = rc(r.icon), a = `host:${r.id}`;
|
|
2244
|
-
return t === "menu" ? /* @__PURE__ */ u(le, { icon: o, label: i, shortcut: r.shortcut, disabled: r.disabled, onSelect: () => n.press(r.id), uiId: a }, r.id) : t === "ribbon" ? /* @__PURE__ */ u(
|
|
2244
|
+
return t === "menu" ? /* @__PURE__ */ u(le, { icon: o, label: i, shortcut: r.shortcut, disabled: r.disabled, onSelect: () => n.press(r.id), uiId: a }, r.id) : t === "ribbon" ? /* @__PURE__ */ u(be, { icon: o, label: i, pressed: r.pressed, disabled: r.disabled, onClick: () => n.press(r.id), "data-kit-ui-id": a }, r.id) : /* @__PURE__ */ M(me, { variant: "ghost", "aria-pressed": r.pressed, disabled: r.disabled, onClick: () => n.press(r.id), "data-kit-ui-id": a, children: [
|
|
2245
2245
|
o ? /* @__PURE__ */ u(o, { size: 15, strokeWidth: $e, "aria-hidden": "true" }) : null,
|
|
2246
2246
|
i
|
|
2247
2247
|
] }, r.id);
|
|
2248
2248
|
}) });
|
|
2249
2249
|
}
|
|
2250
|
-
const
|
|
2250
|
+
const wr = /* @__PURE__ */ new Set();
|
|
2251
2251
|
function ic(e, t) {
|
|
2252
2252
|
const n = new Map(e.map((h) => [h.id, h])), r = (h) => {
|
|
2253
2253
|
const f = /* @__PURE__ */ new Set();
|
|
2254
2254
|
for (let g = h.parent; g !== null && !f.has(g); ) {
|
|
2255
2255
|
f.add(g);
|
|
2256
|
-
const
|
|
2257
|
-
if (!
|
|
2258
|
-
if (
|
|
2259
|
-
g =
|
|
2256
|
+
const b = n.get(g);
|
|
2257
|
+
if (!b) return !1;
|
|
2258
|
+
if (b.hidden) return !0;
|
|
2259
|
+
g = b.parent;
|
|
2260
2260
|
}
|
|
2261
2261
|
return !1;
|
|
2262
2262
|
}, i = e.filter((h) => !h.hidden && h.id !== Di && !(h.kind === "command" && h.parent === null) && !r(h)), o = new Map(i.map((h) => [h.id, h])), a = /* @__PURE__ */ new Map();
|
|
@@ -2268,29 +2268,29 @@ function ic(e, t) {
|
|
|
2268
2268
|
const s = (h, f) => {
|
|
2269
2269
|
const g = new Set(f);
|
|
2270
2270
|
g.add(h.id);
|
|
2271
|
-
const
|
|
2272
|
-
return { element: h, children:
|
|
2271
|
+
const b = (a.get(h.id) ?? []).filter((w) => g.has(w.id) ? (wr.has(w.id) || (wr.add(w.id), console.warn(`[kit-editor] ${w.id} is its own ancestor in the declared elements`)), !1) : !0).map((w) => s(w, g));
|
|
2272
|
+
return { element: h, children: b };
|
|
2273
2273
|
}, d = [], c = /* @__PURE__ */ new Set();
|
|
2274
2274
|
for (const h of i) {
|
|
2275
2275
|
if (c.has(h.id)) continue;
|
|
2276
2276
|
const f = [];
|
|
2277
2277
|
let g = h;
|
|
2278
2278
|
for (; g !== void 0; ) {
|
|
2279
|
-
const
|
|
2280
|
-
if (c.has(
|
|
2279
|
+
const b = g;
|
|
2280
|
+
if (c.has(b.id)) {
|
|
2281
2281
|
for (const y of f) c.add(y);
|
|
2282
2282
|
break;
|
|
2283
2283
|
}
|
|
2284
|
-
const
|
|
2285
|
-
if (
|
|
2286
|
-
d.push(o.get(f[
|
|
2284
|
+
const w = f.indexOf(b.id);
|
|
2285
|
+
if (w !== -1) {
|
|
2286
|
+
d.push(o.get(f[w]));
|
|
2287
2287
|
for (const y of f) c.add(y);
|
|
2288
2288
|
break;
|
|
2289
2289
|
}
|
|
2290
|
-
f.push(
|
|
2291
|
-
const m =
|
|
2290
|
+
f.push(b.id);
|
|
2291
|
+
const m = b.parent !== null ? o.get(b.parent) : void 0;
|
|
2292
2292
|
if (m === void 0) {
|
|
2293
|
-
d.push(
|
|
2293
|
+
d.push(b);
|
|
2294
2294
|
for (const y of f) c.add(y);
|
|
2295
2295
|
break;
|
|
2296
2296
|
}
|
|
@@ -2311,7 +2311,7 @@ function oc({ catalog: e, personal: t, labels: n, onSave: r, onClose: i }) {
|
|
|
2311
2311
|
/* @__PURE__ */ u("input", { type: "checkbox", checked: !g, disabled: f, onChange: () => l(h.element.id), "data-element": h.element.id }),
|
|
2312
2312
|
/* @__PURE__ */ u("span", { children: h.element.label })
|
|
2313
2313
|
] }),
|
|
2314
|
-
h.children.length ? /* @__PURE__ */ u("ul", { children: h.children.map((
|
|
2314
|
+
h.children.length ? /* @__PURE__ */ u("ul", { children: h.children.map((b) => p(b, f || g)) }) : null
|
|
2315
2315
|
] }, h.element.id);
|
|
2316
2316
|
};
|
|
2317
2317
|
return /* @__PURE__ */ M(
|
|
@@ -2843,17 +2843,17 @@ function ln(e, t, n) {
|
|
|
2843
2843
|
e.report ? e.report(t, n) : pt("error", t, Dn(n));
|
|
2844
2844
|
}
|
|
2845
2845
|
const yr = { "edit.undo": "undo", "edit.redo": "redo" };
|
|
2846
|
-
function
|
|
2846
|
+
function bu(e, t, n, r, i = (s) => s, o, a = {}) {
|
|
2847
2847
|
const s = R(a.report);
|
|
2848
2848
|
s.current = a.report;
|
|
2849
|
-
const d = H((T, K) => s.current ? s.current(T, K) : pt("error", T, Dn(K)), []), { doc: c, change: l } = e, [p, h] = B([]), [f, g] = B(/* @__PURE__ */ new Set()), [
|
|
2849
|
+
const d = H((T, K) => s.current ? s.current(T, K) : pt("error", T, Dn(K)), []), { doc: c, change: l } = e, [p, h] = B([]), [f, g] = B(/* @__PURE__ */ new Set()), [b, w] = B(null), m = R(o);
|
|
2850
2850
|
m.current = o;
|
|
2851
2851
|
const y = H(
|
|
2852
|
-
(T, K = {}) =>
|
|
2852
|
+
(T, K = {}) => w(T ? { command: T, values: { ...m.current?.(T), ...K } } : null),
|
|
2853
2853
|
[]
|
|
2854
2854
|
), I = R(e);
|
|
2855
2855
|
I.current = e;
|
|
2856
|
-
const
|
|
2856
|
+
const N = He(t.ui.subscribe, t.ui.get), E = a.history ?? null, [, Y] = B(0);
|
|
2857
2857
|
J(() => E?.subscribe(() => Y((T) => T + 1)), [E]);
|
|
2858
2858
|
const q = R(E);
|
|
2859
2859
|
q.current = E;
|
|
@@ -2872,8 +2872,8 @@ function wu(e, t, n, r, i = (s) => s, o, a = {}) {
|
|
|
2872
2872
|
const Z = H(async (T, K = {}) => {
|
|
2873
2873
|
const ne = I.current.doc;
|
|
2874
2874
|
if (!ne) return null;
|
|
2875
|
-
const
|
|
2876
|
-
if (
|
|
2875
|
+
const P = fe.current.get(T);
|
|
2876
|
+
if (P?.mutates && Se(t.ui.get(), `command:${T}`, P.menu).denied || P && D(P)) return null;
|
|
2877
2877
|
try {
|
|
2878
2878
|
return JSON.parse(await ne.execute(T, K));
|
|
2879
2879
|
} catch {
|
|
@@ -2883,16 +2883,16 @@ function wu(e, t, n, r, i = (s) => s, o, a = {}) {
|
|
|
2883
2883
|
fe.current = Q;
|
|
2884
2884
|
const ce = H(
|
|
2885
2885
|
async (T, K) => {
|
|
2886
|
-
const ne = Q.get(T),
|
|
2887
|
-
if (
|
|
2886
|
+
const ne = Q.get(T), P = q.current, G = P ? yr[T] : void 0;
|
|
2887
|
+
if (P && G) {
|
|
2888
2888
|
if (Se(t.ui.get(), `command:${T}`, ne?.menu).denied || Se(t.ui.get(), `action:${G}`).denied) return null;
|
|
2889
2889
|
try {
|
|
2890
|
-
return JSON.stringify({ done: await
|
|
2890
|
+
return JSON.stringify({ done: await P[G]() !== !1 });
|
|
2891
2891
|
} catch (ue) {
|
|
2892
2892
|
return d(n("commandFailed"), ue), null;
|
|
2893
2893
|
}
|
|
2894
2894
|
}
|
|
2895
|
-
if (!K && ne &&
|
|
2895
|
+
if (!K && ne && Pt(ne) && !Se(t.ui.get(), `command:${T}`, ne.menu).denied && !D(ne))
|
|
2896
2896
|
return y(ne), null;
|
|
2897
2897
|
try {
|
|
2898
2898
|
return await I.current.run(T, K ?? {});
|
|
@@ -2904,14 +2904,14 @@ function wu(e, t, n, r, i = (s) => s, o, a = {}) {
|
|
|
2904
2904
|
), k = E ? E.canUndo() : c?.info?.canUndo ?? !1, O = E ? E.canRedo() : c?.info?.canRedo ?? !1, U = H(
|
|
2905
2905
|
(T, K) => {
|
|
2906
2906
|
const ne = Q.get(T);
|
|
2907
|
-
if (!ne || Se(
|
|
2908
|
-
const
|
|
2909
|
-
if (
|
|
2907
|
+
if (!ne || Se(N, `command:${T}`, ne.menu).denied) return !1;
|
|
2908
|
+
const P = E ? yr[T] : void 0;
|
|
2909
|
+
if (P) return P === "undo" ? k : O;
|
|
2910
2910
|
if (K.has(T) || D(ne)) return !1;
|
|
2911
|
-
const G = V ?
|
|
2911
|
+
const G = V ? Pi(T, j) : null;
|
|
2912
2912
|
return G === null || (G === "undo" ? k : O);
|
|
2913
2913
|
},
|
|
2914
|
-
[Q, O, k, j, E, V, D,
|
|
2914
|
+
[Q, O, k, j, E, V, D, N]
|
|
2915
2915
|
), x = H((T) => U(T, f), [f, U]), C = H(
|
|
2916
2916
|
async (T) => {
|
|
2917
2917
|
const K = I.current.doc;
|
|
@@ -2932,13 +2932,13 @@ function wu(e, t, n, r, i = (s) => s, o, a = {}) {
|
|
|
2932
2932
|
},
|
|
2933
2933
|
[Q, t, ce, y]
|
|
2934
2934
|
);
|
|
2935
|
-
return { session: e, host: t, t: n, phrase: i, testId: r, commands: p, byId: Q, enabled: x, enabledNow: C, run: ce, ask: _, query: Z, save: W, report: d, dialog:
|
|
2935
|
+
return { session: e, host: t, t: n, phrase: i, testId: r, commands: p, byId: Q, enabled: x, enabledNow: C, run: ce, ask: _, query: Z, save: W, report: d, dialog: b, setDialog: y, comments: j, canUndo: k, canRedo: O };
|
|
2936
2936
|
}
|
|
2937
2937
|
const Ln = Ot(null);
|
|
2938
|
-
function
|
|
2938
|
+
function wu({ editor: e, tools: t = null, children: n }) {
|
|
2939
2939
|
const r = pe(() => ({ editor: e, tools: t }), [e, t]), { host: i, byId: o, session: a } = e, s = He(i.ui.subscribe, i.ui.get), d = t?.setDenied, c = i.readOnly === !0;
|
|
2940
2940
|
Te(() => {
|
|
2941
|
-
d?.((
|
|
2941
|
+
d?.((b) => c || Se(s, `tool:${b}`).denied);
|
|
2942
2942
|
}, [s, c, d]);
|
|
2943
2943
|
const l = pe(() => Zl(i.declaration), [i]), p = R(a.doc);
|
|
2944
2944
|
p.current = a.doc;
|
|
@@ -2947,21 +2947,21 @@ function bu({ editor: e, tools: t = null, children: n }) {
|
|
|
2947
2947
|
store: i.ui,
|
|
2948
2948
|
locale: i.init.locale,
|
|
2949
2949
|
// O(1): `useUi().state` calls it for every command on every render.
|
|
2950
|
-
menuOf: (
|
|
2950
|
+
menuOf: (b) => o.get(b)?.menu ?? [],
|
|
2951
2951
|
declared: l,
|
|
2952
|
-
press: (
|
|
2952
|
+
press: (b) => i.ui.action({ id: b, document: { path: i.init.document.path, dirty: p.current?.info.dirty ?? !1, revision: p.current?.info.revision ?? 0 } }),
|
|
2953
2953
|
offerHide: null,
|
|
2954
2954
|
openCustomize: null,
|
|
2955
2955
|
hide: null,
|
|
2956
|
-
renderButtons: (
|
|
2956
|
+
renderButtons: (b, w) => /* @__PURE__ */ u(zt, { place: b, as: w }),
|
|
2957
2957
|
// A commenter sees what they can run, not a document of disabled edits.
|
|
2958
|
-
sessionHidden: h.size ? (
|
|
2958
|
+
sessionHidden: h.size ? (b) => hl(o.get(b) ?? { id: b }, h) : void 0
|
|
2959
2959
|
}),
|
|
2960
2960
|
[o, h, l, i]
|
|
2961
2961
|
), g = R(async () => []);
|
|
2962
2962
|
return g.current = async () => {
|
|
2963
|
-
const
|
|
2964
|
-
return Gi({ commands:
|
|
2963
|
+
const b = await a.commands(), w = t && !t.tools.length ? await a.tool("tools") ?? [] : t?.tools ?? [];
|
|
2964
|
+
return Gi({ commands: b, declaration: i.declaration, engineTools: w, agent: i.init.capabilities.includes("agent"), t: e.t, phrase: e.phrase, config: i.ui.get() });
|
|
2965
2965
|
}, J(() => {
|
|
2966
2966
|
i.declaration && i.peer.handle("ui/elements", () => g.current());
|
|
2967
2967
|
}, [i]), /* @__PURE__ */ u(Ln.Provider, { value: r, children: /* @__PURE__ */ u(So, { strings: e.t, children: /* @__PURE__ */ u(Yi, { value: f, children: n }) }) });
|
|
@@ -2978,23 +2978,23 @@ function Xe() {
|
|
|
2978
2978
|
return Le(Ln)?.tools ?? null;
|
|
2979
2979
|
}
|
|
2980
2980
|
function Ji(e) {
|
|
2981
|
-
const { offerHide: t } =
|
|
2981
|
+
const { offerHide: t } = we();
|
|
2982
2982
|
return t ? (n) => {
|
|
2983
2983
|
n.preventDefault(), t(e, n.clientX, n.clientY);
|
|
2984
2984
|
} : void 0;
|
|
2985
2985
|
}
|
|
2986
2986
|
function lc({ command: e, params: t, ask: n, onRun: r, ...i }) {
|
|
2987
|
-
const o = te(), { enabled: a, byId: s, testId: d, phrase: c } = o, l =
|
|
2987
|
+
const o = te(), { enabled: a, byId: s, testId: d, phrase: c } = o, l = we(), p = Ji(`command:${e}`);
|
|
2988
2988
|
if (l.state(`command:${e}`).hidden) return null;
|
|
2989
2989
|
const h = s.get(e);
|
|
2990
2990
|
return /* @__PURE__ */ u(
|
|
2991
|
-
|
|
2991
|
+
be,
|
|
2992
2992
|
{
|
|
2993
2993
|
...i,
|
|
2994
2994
|
label: i.label ?? c(h?.title ?? e),
|
|
2995
2995
|
disabled: i.disabled || !a(e),
|
|
2996
2996
|
onClick: () => {
|
|
2997
|
-
n ? o.ask(e) : r && t === void 0 && !(h &&
|
|
2997
|
+
n ? o.ask(e) : r && t === void 0 && !(h && Pt(h)) ? r(e) : o.run(e, t);
|
|
2998
2998
|
},
|
|
2999
2999
|
onContextMenu: p ?? i.onContextMenu,
|
|
3000
3000
|
"data-testid": `${d}-cmd-${e}`,
|
|
@@ -3003,9 +3003,9 @@ function lc({ command: e, params: t, ask: n, onRun: r, ...i }) {
|
|
|
3003
3003
|
);
|
|
3004
3004
|
}
|
|
3005
3005
|
function vu({ tool: e, testId: t, ...n }) {
|
|
3006
|
-
const r = Xe(), { testId: i } = te(), a =
|
|
3006
|
+
const r = Xe(), { testId: i } = te(), a = we().state(`tool:${e}`);
|
|
3007
3007
|
return a.hidden ? null : /* @__PURE__ */ u(
|
|
3008
|
-
|
|
3008
|
+
be,
|
|
3009
3009
|
{
|
|
3010
3010
|
...n,
|
|
3011
3011
|
pressed: r?.active === e,
|
|
@@ -3026,7 +3026,7 @@ function xe({ icon: e, label: t, size: n = "small", children: r, disabled: i, sw
|
|
|
3026
3026
|
lt,
|
|
3027
3027
|
{
|
|
3028
3028
|
trigger: ({ toggle: h, open: f }) => /* @__PURE__ */ M("span", { style: { display: "inline-flex", alignItems: "center" }, "data-primary": s || void 0, children: [
|
|
3029
|
-
/* @__PURE__ */ u(
|
|
3029
|
+
/* @__PURE__ */ u(be, { icon: e, label: t, size: p, disabled: i, pressed: f, swatch: o, onClick: h, "data-testid": a, primary: s, lineLabel: d }),
|
|
3030
3030
|
p !== "large" ? /* @__PURE__ */ u(Ii, { size: 11, strokeWidth: $e, "aria-hidden": "true", style: { marginLeft: -4, opacity: 0.6 }, onClick: h }) : null
|
|
3031
3031
|
] }),
|
|
3032
3032
|
children: /* @__PURE__ */ u(vt.Provider, { value: "full", children: /* @__PURE__ */ u(Yt.Provider, { value: mn, children: r }) })
|
|
@@ -3044,19 +3044,19 @@ function cc({
|
|
|
3044
3044
|
path: s,
|
|
3045
3045
|
onRun: d
|
|
3046
3046
|
}) {
|
|
3047
|
-
const c = te(), { enabled: l, byId: p, testId: h, phrase: f } = c, g =
|
|
3048
|
-
if (g.state(`command:${e}`).hidden ||
|
|
3047
|
+
const c = te(), { enabled: l, byId: p, testId: h, phrase: f } = c, g = we(), b = Ji(`command:${e}`), w = s ? g.state(`command:${e}`, s) : null;
|
|
3048
|
+
if (g.state(`command:${e}`).hidden || w?.hidden) return null;
|
|
3049
3049
|
const m = p.get(e);
|
|
3050
|
-
return /* @__PURE__ */ u("div", { onContextMenu:
|
|
3050
|
+
return /* @__PURE__ */ u("div", { onContextMenu: b, style: { display: "contents" }, children: /* @__PURE__ */ u(
|
|
3051
3051
|
le,
|
|
3052
3052
|
{
|
|
3053
3053
|
icon: r,
|
|
3054
3054
|
label: n ?? f(m?.title ?? e),
|
|
3055
3055
|
shortcut: o === void 0 ? m?.shortcut : o,
|
|
3056
|
-
disabled: !l(e) || !!
|
|
3056
|
+
disabled: !l(e) || !!w?.disabled,
|
|
3057
3057
|
checked: a,
|
|
3058
3058
|
onSelect: () => {
|
|
3059
|
-
i ? c.ask(e) : d && t === void 0 && !(m &&
|
|
3059
|
+
i ? c.ask(e) : d && t === void 0 && !(m && Pt(m)) ? d(e) : c.run(e, t);
|
|
3060
3060
|
},
|
|
3061
3061
|
testId: `${h}-cmd-${e}`,
|
|
3062
3062
|
uiId: `command:${e}`
|
|
@@ -3120,18 +3120,18 @@ function Cu({
|
|
|
3120
3120
|
decorateUnder: l,
|
|
3121
3121
|
children: p
|
|
3122
3122
|
}) {
|
|
3123
|
-
const h = te(), f = Xe(), g = R(null), { doc:
|
|
3123
|
+
const h = te(), f = Xe(), g = R(null), { doc: b, change: w, failure: m, repaints: y } = h.session, [I, N] = B(null), E = He(y.subscribe, y.get), { t: Y } = h, q = f?.decorate ?? null, V = pe(() => gr(gr(l, q), c), [c, l, q]);
|
|
3124
3124
|
return /* @__PURE__ */ M("div", { className: "kui-canvas-region", "data-testid": s ?? `${h.testId}-canvas-region`, children: [
|
|
3125
3125
|
m ? /* @__PURE__ */ M("div", { className: "kui-message", role: "alert", children: [
|
|
3126
3126
|
/* @__PURE__ */ u("strong", { children: Y("openFailed") }),
|
|
3127
3127
|
/* @__PURE__ */ u("span", { className: "kui-muted", children: m })
|
|
3128
|
-
] }) :
|
|
3128
|
+
] }) : b ? /* @__PURE__ */ M(
|
|
3129
3129
|
Xl,
|
|
3130
3130
|
{
|
|
3131
3131
|
ref: e,
|
|
3132
3132
|
viewMemory: t ?? g,
|
|
3133
|
-
doc:
|
|
3134
|
-
change:
|
|
3133
|
+
doc: b,
|
|
3134
|
+
change: w,
|
|
3135
3135
|
repaint: E,
|
|
3136
3136
|
tool: d ?? f?.canvasTool ?? Re,
|
|
3137
3137
|
decorate: V,
|
|
@@ -3143,10 +3143,10 @@ function Cu({
|
|
|
3143
3143
|
onView: (j, D) => {
|
|
3144
3144
|
f?.viewZoom?.(j.zoom), a?.(j, D);
|
|
3145
3145
|
},
|
|
3146
|
-
onRender: (j) =>
|
|
3146
|
+
onRender: (j) => N(j === null ? null : { doc: b, message: Dn(j) }),
|
|
3147
3147
|
children: [
|
|
3148
3148
|
p,
|
|
3149
|
-
I?.doc ===
|
|
3149
|
+
I?.doc === b ? /* @__PURE__ */ u(ac, { message: I.message, title: Y("renderFailed"), retryLabel: Y("retryRender"), onRetry: () => {
|
|
3150
3150
|
e.current?.retryRender();
|
|
3151
3151
|
} }) : null
|
|
3152
3152
|
]
|
|
@@ -3159,15 +3159,15 @@ const vr = 1.25, hc = /* @__PURE__ */ new Set(["checkbox", "radio", "button", "s
|
|
|
3159
3159
|
function kr(e) {
|
|
3160
3160
|
return e instanceof HTMLInputElement ? !hc.has(e.type) : e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement && !e.classList.contains("kui-text-sink");
|
|
3161
3161
|
}
|
|
3162
|
-
function
|
|
3163
|
-
const e = te(), t =
|
|
3162
|
+
function Nn() {
|
|
3163
|
+
const e = te(), t = we(), n = e.host.readOnly === !0, r = n && (e.comments?.size ?? 0) > 0, i = (o, a, s) => {
|
|
3164
3164
|
const d = t.state(`action:${o}`), c = t.state(`command:${a}`);
|
|
3165
3165
|
return { hidden: d.hidden || c.hostHidden || n && !r, disabled: !s || d.disabled || c.denied };
|
|
3166
3166
|
};
|
|
3167
3167
|
return { undo: i("undo", "edit.undo", e.canUndo), redo: i("redo", "edit.redo", e.canRedo), readOnly: n, commenting: r };
|
|
3168
3168
|
}
|
|
3169
3169
|
function fc({ before: e, mode: t }) {
|
|
3170
|
-
const n = te(), r =
|
|
3170
|
+
const n = te(), r = we(), { session: i, host: o, t: a, testId: s } = n, { dirty: d } = i, c = (g) => r.state(`action:${g}`), { undo: l, redo: p, readOnly: h, commenting: f } = Nn();
|
|
3171
3171
|
return /* @__PURE__ */ M(Ce, { children: [
|
|
3172
3172
|
e,
|
|
3173
3173
|
/* @__PURE__ */ u(zt, { place: "action", as: "action" }),
|
|
@@ -3183,7 +3183,7 @@ function fc({ before: e, mode: t }) {
|
|
|
3183
3183
|
/* @__PURE__ */ u(ai, { size: 15, strokeWidth: $e, "aria-hidden": "true" }),
|
|
3184
3184
|
a("save")
|
|
3185
3185
|
] }),
|
|
3186
|
-
r.openCustomize && !c("more").hidden ? /* @__PURE__ */ u(lt, { align: "end", trigger: ({ toggle: g, open:
|
|
3186
|
+
r.openCustomize && !c("more").hidden ? /* @__PURE__ */ u(lt, { align: "end", trigger: ({ toggle: g, open: b }) => /* @__PURE__ */ u(De, { icon: Ms, label: a("more"), pressed: b, disabled: c("more").disabled, onClick: g, "data-testid": `${s}-more`, "data-kit-ui-id": "action:more" }), children: /* @__PURE__ */ u(le, { label: a("customize"), onSelect: () => r.openCustomize?.(), testId: `${s}-customize`, uiId: "action:more" }) }) : null
|
|
3187
3187
|
] });
|
|
3188
3188
|
}
|
|
3189
3189
|
function mc({ x: e, y: t, label: n, testId: r, onHide: i, onClose: o }) {
|
|
@@ -3199,17 +3199,17 @@ function mc({ x: e, y: t, label: n, testId: r, onHide: i, onClose: o }) {
|
|
|
3199
3199
|
}, [o]), /* @__PURE__ */ u("div", { className: "kui-dialog-backdrop kui-hide-menu-backdrop", onPointerDown: o, children: /* @__PURE__ */ u("div", { ref: a, className: "kui-popover kui-hide-menu", role: "menu", style: s ?? { left: e, top: t, visibility: "hidden" }, onPointerDown: (c) => c.stopPropagation(), children: /* @__PURE__ */ u(le, { label: n, onSelect: i, testId: r }) }) });
|
|
3200
3200
|
}
|
|
3201
3201
|
function pc({ top: e, status: t, statusEnd: n, onStatusClick: r, canvas: i, zoom: o, onKeyDown: a, statusBar: s = !0, hiddenCommands: d, fileChangedBar: c = !0, frame: l, children: p }) {
|
|
3202
|
-
const h = te(), f = Xe(), { session: g, t:
|
|
3202
|
+
const h = te(), f = Xe(), { session: g, t: b, testId: w } = h, { dirty: m } = g, y = Le(Wt), I = we(), [N, E] = B(null), [Y, q] = B(null), V = H(() => q(null), []), j = R(async () => {
|
|
3203
3203
|
});
|
|
3204
3204
|
j.current = async (x) => {
|
|
3205
3205
|
try {
|
|
3206
3206
|
await I.store.setPersonal(x);
|
|
3207
3207
|
} catch (C) {
|
|
3208
|
-
ln(h,
|
|
3208
|
+
ln(h, b("customizeFailed"), C);
|
|
3209
3209
|
}
|
|
3210
3210
|
};
|
|
3211
3211
|
const D = R(() => []);
|
|
3212
|
-
D.current = () => Gi({ commands: h.commands, declaration: h.host.declaration, engineTools: f?.tools ?? [], agent: h.host.init.capabilities.includes("agent"), t:
|
|
3212
|
+
D.current = () => Gi({ commands: h.commands, declaration: h.host.declaration, engineTools: f?.tools ?? [], agent: h.host.init.capabilities.includes("agent"), t: b, phrase: h.phrase, config: { ...I.store.get(), personal: [] } });
|
|
3213
3213
|
const { store: Z } = I, Q = Z.customizable && h.host.declaration !== null, fe = pe(
|
|
3214
3214
|
() => y && Q ? {
|
|
3215
3215
|
...y,
|
|
@@ -3238,18 +3238,18 @@ function pc({ top: e, status: t, statusEnd: n, onStatusClick: r, canvas: i, zoom
|
|
|
3238
3238
|
x.preventDefault();
|
|
3239
3239
|
return;
|
|
3240
3240
|
}
|
|
3241
|
-
const K = I.config.add.find((ye) => ye.shortcut && !ye.disabled && Hr(ye.shortcut, x,
|
|
3241
|
+
const K = I.config.add.find((ye) => ye.shortcut && !ye.disabled && Hr(ye.shortcut, x, Nt()));
|
|
3242
3242
|
if (K) {
|
|
3243
3243
|
x.preventDefault(), I.press(K.id);
|
|
3244
3244
|
return;
|
|
3245
3245
|
}
|
|
3246
|
-
const ne = x.metaKey || x.ctrlKey,
|
|
3247
|
-
if (ne &&
|
|
3246
|
+
const ne = x.metaKey || x.ctrlKey, P = x.key.toLowerCase();
|
|
3247
|
+
if (ne && P === "s") {
|
|
3248
3248
|
x.preventDefault(), !I.state("action:save").denied && !h.host.readOnly && h.save();
|
|
3249
3249
|
return;
|
|
3250
3250
|
}
|
|
3251
|
-
if (i?.current && ne && (
|
|
3252
|
-
x.preventDefault(),
|
|
3251
|
+
if (i?.current && ne && (P === "0" || P === "=" || P === "+" || P === "-")) {
|
|
3252
|
+
x.preventDefault(), P === "0" ? i.current.fit() : i.current.zoomBy(P === "-" ? 1 / vr : vr);
|
|
3253
3253
|
return;
|
|
3254
3254
|
}
|
|
3255
3255
|
const G = Fl(d ? h.commands.filter((ye) => !d(ye.id)) : h.commands, x);
|
|
@@ -3280,25 +3280,25 @@ function pc({ top: e, status: t, statusEnd: n, onStatusClick: r, canvas: i, zoom
|
|
|
3280
3280
|
tabIndex: -1,
|
|
3281
3281
|
children: [
|
|
3282
3282
|
e,
|
|
3283
|
-
c && g.conflict && g.doc ? /* @__PURE__ */ M("div", { className: "kui-file-changed", role: "alert", "data-testid": `${
|
|
3284
|
-
/* @__PURE__ */ u("span", { children:
|
|
3285
|
-
/* @__PURE__ */ u(me, { variant: "ghost", size: "sm", onClick: () => void g.keepMine().catch((x) => ln(h,
|
|
3286
|
-
/* @__PURE__ */ u(me, { variant: "primary", size: "sm", onClick: () => g.reopen(), "data-testid": `${
|
|
3283
|
+
c && g.conflict && g.doc ? /* @__PURE__ */ M("div", { className: "kui-file-changed", role: "alert", "data-testid": `${w}-file-changed`, children: [
|
|
3284
|
+
/* @__PURE__ */ u("span", { children: b("fileChanged") }),
|
|
3285
|
+
/* @__PURE__ */ u(me, { variant: "ghost", size: "sm", onClick: () => void g.keepMine().catch((x) => ln(h, b("saveFailed"), x)), "data-testid": `${w}-keep-mine`, children: b("keepMine") }),
|
|
3286
|
+
/* @__PURE__ */ u(me, { variant: "primary", size: "sm", onClick: () => g.reopen(), "data-testid": `${w}-reload`, children: b("reloadFile") })
|
|
3287
3287
|
] }) : null,
|
|
3288
3288
|
p,
|
|
3289
3289
|
s ? /* @__PURE__ */ M($o, { onClick: r ? (x) => !(x.target instanceof Element && x.target.closest('button, input, select, [role="menuitem"]')) && r() : void 0, children: [
|
|
3290
3290
|
t,
|
|
3291
|
-
m ? /* @__PURE__ */ u("span", { "data-testid": `${
|
|
3292
|
-
g.editedBy?.by === "agent" ? /* @__PURE__ */ M("span", { className: "kui-agent-edited", "data-testid": `${
|
|
3291
|
+
m ? /* @__PURE__ */ u("span", { "data-testid": `${w}-unsaved`, children: b("unsaved") }) : null,
|
|
3292
|
+
g.editedBy?.by === "agent" ? /* @__PURE__ */ M("span", { className: "kui-agent-edited", "data-testid": `${w}-agent-edited`, children: [
|
|
3293
3293
|
/* @__PURE__ */ u(Lt, { size: 12, strokeWidth: $e, "aria-hidden": "true" }),
|
|
3294
|
-
|
|
3294
|
+
b("agentEdited")
|
|
3295
3295
|
] }) : g.editedBy?.by === "system" ? (
|
|
3296
3296
|
// The host's own change (Kit UI protocol 2.7): the app, named by its feature on hover.
|
|
3297
|
-
/* @__PURE__ */ u("span", { className: "kui-host-edited", "data-testid": `${
|
|
3297
|
+
/* @__PURE__ */ u("span", { className: "kui-host-edited", "data-testid": `${w}-host-edited`, title: g.editedBy.originLabel, children: b("hostEdited") })
|
|
3298
3298
|
) : null,
|
|
3299
3299
|
/* @__PURE__ */ u(Io, {}),
|
|
3300
3300
|
n,
|
|
3301
|
-
i && o != null ? /* @__PURE__ */ u(Mo, { zoom: o, onZoom: (x) => i.current?.zoomTo(x), onFit: () => i.current?.fit(), labels: { out:
|
|
3301
|
+
i && o != null ? /* @__PURE__ */ u(Mo, { zoom: o, onZoom: (x) => i.current?.zoomTo(x), onFit: () => i.current?.fit(), labels: { out: b("zoomOut"), in: b("zoomIn"), fit: b("fit") } }) : null
|
|
3302
3302
|
] }) : null,
|
|
3303
3303
|
h.dialog ? /* @__PURE__ */ u(
|
|
3304
3304
|
Ol,
|
|
@@ -3306,7 +3306,7 @@ function pc({ top: e, status: t, statusEnd: n, onStatusClick: r, canvas: i, zoom
|
|
|
3306
3306
|
command: h.dialog.command,
|
|
3307
3307
|
values: h.dialog.values,
|
|
3308
3308
|
title: h.phrase(h.dialog.command.title),
|
|
3309
|
-
labels: { run:
|
|
3309
|
+
labels: { run: b("run"), cancel: b("cancel"), required: b("required"), more: b("moreOptions") },
|
|
3310
3310
|
onClose: () => h.setDialog(null),
|
|
3311
3311
|
onRun: (x) => {
|
|
3312
3312
|
const C = h.dialog.command.id;
|
|
@@ -3315,12 +3315,12 @@ function pc({ top: e, status: t, statusEnd: n, onStatusClick: r, canvas: i, zoom
|
|
|
3315
3315
|
},
|
|
3316
3316
|
h.dialog.command.id
|
|
3317
3317
|
) : null,
|
|
3318
|
-
|
|
3318
|
+
N ? /* @__PURE__ */ u(
|
|
3319
3319
|
oc,
|
|
3320
3320
|
{
|
|
3321
|
-
catalog:
|
|
3321
|
+
catalog: N,
|
|
3322
3322
|
personal: I.config.personal,
|
|
3323
|
-
labels: { title:
|
|
3323
|
+
labels: { title: b("customizeTitle"), search: b("customizeSearch"), restore: b("customizeRestore"), cancel: b("cancel"), save: b("customizeSave") },
|
|
3324
3324
|
onSave: (x) => {
|
|
3325
3325
|
E(null), j.current(x);
|
|
3326
3326
|
},
|
|
@@ -3332,8 +3332,8 @@ function pc({ top: e, status: t, statusEnd: n, onStatusClick: r, canvas: i, zoom
|
|
|
3332
3332
|
{
|
|
3333
3333
|
x: Y.x,
|
|
3334
3334
|
y: Y.y,
|
|
3335
|
-
label:
|
|
3336
|
-
testId: `${
|
|
3335
|
+
label: b("hideElement"),
|
|
3336
|
+
testId: `${w}-hide-element`,
|
|
3337
3337
|
onHide: () => {
|
|
3338
3338
|
q(null), j.current([...I.store.get().personal, Y.id]);
|
|
3339
3339
|
},
|
|
@@ -3356,28 +3356,28 @@ function gc(e, t, n, r = () => !0) {
|
|
|
3356
3356
|
const o = (a) => t.includes(a) ? t.indexOf(a) : t.length;
|
|
3357
3357
|
return [...i.values()].sort((a, s) => o(a.label) - o(s.label));
|
|
3358
3358
|
}
|
|
3359
|
-
function
|
|
3359
|
+
function bc({ label: e, path: t, children: n, uiId: r, testId: i }) {
|
|
3360
3360
|
const o = r ?? `menu:${t}`, { phrase: a } = te(), s = R(null), d = R(null), c = R(null), [l, p] = B(null), h = R(!1), f = () => {
|
|
3361
3361
|
const m = s.current?.getBoundingClientRect();
|
|
3362
3362
|
m && p({ left: m.right - 2, top: m.top - 4, maxHeight: Math.max(0, window.innerHeight - 16) });
|
|
3363
3363
|
}, g = () => {
|
|
3364
3364
|
c.current?.contains(document.activeElement) && d.current?.focus(), p(null);
|
|
3365
|
-
},
|
|
3365
|
+
}, b = H(() => {
|
|
3366
3366
|
const m = s.current?.getBoundingClientRect(), y = c.current;
|
|
3367
3367
|
if (!m || !y) return;
|
|
3368
|
-
const I = Math.max(0, window.innerHeight - 16),
|
|
3368
|
+
const I = Math.max(0, window.innerHeight - 16), N = Math.min(y.scrollHeight, I), E = y.offsetWidth, Y = m.right - 2, q = Y + E <= window.innerWidth - 4 ? Y : m.left + 2 - E >= 4 ? m.left + 2 - E : Y, V = Math.max(4, Math.min(q, window.innerWidth - E - 4)), j = Math.max(8, Math.min(m.top - 4, window.innerHeight - 8 - N));
|
|
3369
3369
|
p((D) => !D || D.left === V && D.top === j && D.maxHeight === I ? D : { left: V, top: j, maxHeight: I });
|
|
3370
|
-
}, []),
|
|
3370
|
+
}, []), w = l != null;
|
|
3371
3371
|
return Te(() => {
|
|
3372
|
-
if (!
|
|
3373
|
-
|
|
3372
|
+
if (!w) return;
|
|
3373
|
+
b();
|
|
3374
3374
|
const m = c.current;
|
|
3375
3375
|
if (!m || typeof ResizeObserver > "u") return;
|
|
3376
|
-
const y = new ResizeObserver(() =>
|
|
3376
|
+
const y = new ResizeObserver(() => b());
|
|
3377
3377
|
y.observe(m);
|
|
3378
3378
|
for (const I of m.children) y.observe(I);
|
|
3379
3379
|
return () => y.disconnect();
|
|
3380
|
-
}, [
|
|
3380
|
+
}, [w, b]), Te(() => {
|
|
3381
3381
|
!l || !h.current || !c.current || (h.current = !1, c.current.querySelector('[role^="menuitem"]:not(:disabled)')?.focus());
|
|
3382
3382
|
}, [l]), /* @__PURE__ */ M("div", { ref: s, className: "kui-submenu", onPointerEnter: f, onPointerLeave: g, children: [
|
|
3383
3383
|
/* @__PURE__ */ M(
|
|
@@ -3419,42 +3419,42 @@ function wc({ label: e, path: t, children: n, uiId: r, testId: i }) {
|
|
|
3419
3419
|
) : null
|
|
3420
3420
|
] });
|
|
3421
3421
|
}
|
|
3422
|
-
function
|
|
3422
|
+
function wc({ children: e }) {
|
|
3423
3423
|
const { t } = te();
|
|
3424
3424
|
return /* @__PURE__ */ u(Et, { className: "kui-options-strip", panelClassName: "kui-options-bar", labels: { start: t("optionsScrollStart"), end: t("optionsScrollEnd") }, testId: "options-scroll", children: e });
|
|
3425
3425
|
}
|
|
3426
3426
|
const yc = 400;
|
|
3427
3427
|
function vc({ tools: e, shown: t, active: n, onSelect: r, rail: i, pressMs: o }) {
|
|
3428
|
-
const { testId: a, t: s } = te(), d =
|
|
3428
|
+
const { testId: a, t: s } = te(), d = we(), [c, l] = B(null), p = R(null), h = R(null), f = R(!1);
|
|
3429
3429
|
J(() => {
|
|
3430
|
-
const
|
|
3430
|
+
const w = () => {
|
|
3431
3431
|
f.current = !1;
|
|
3432
3432
|
};
|
|
3433
|
-
return window.addEventListener("pointerdown",
|
|
3433
|
+
return window.addEventListener("pointerdown", w, !0), () => window.removeEventListener("pointerdown", w, !0);
|
|
3434
3434
|
}, []);
|
|
3435
3435
|
const g = () => {
|
|
3436
|
-
const
|
|
3437
|
-
|
|
3436
|
+
const w = p.current?.getBoundingClientRect(), m = i.current?.getBoundingClientRect().right ?? w?.right;
|
|
3437
|
+
w && m != null && e.length > 1 && l({ left: m + 4, top: Math.min(w.top, window.innerHeight - e.length * 30 - 16) });
|
|
3438
3438
|
};
|
|
3439
3439
|
J(() => {
|
|
3440
3440
|
if (!c) return;
|
|
3441
|
-
const
|
|
3441
|
+
const w = (m) => {
|
|
3442
3442
|
(!(m.target instanceof Node) || !document.querySelector(".kui-tool-flyout")?.contains(m.target)) && l(null);
|
|
3443
3443
|
};
|
|
3444
|
-
return window.addEventListener("pointerdown",
|
|
3444
|
+
return window.addEventListener("pointerdown", w, !0), () => window.removeEventListener("pointerdown", w, !0);
|
|
3445
3445
|
}, [c]);
|
|
3446
|
-
const
|
|
3446
|
+
const b = t.shortcut ? `${t.label} (${t.shortcut})` : t.label;
|
|
3447
3447
|
return /* @__PURE__ */ M(
|
|
3448
3448
|
"span",
|
|
3449
3449
|
{
|
|
3450
3450
|
ref: p,
|
|
3451
3451
|
className: "kui-tool-slot",
|
|
3452
3452
|
"data-grouped": e.length > 1,
|
|
3453
|
-
onContextMenu: (
|
|
3454
|
-
|
|
3453
|
+
onContextMenu: (w) => {
|
|
3454
|
+
w.preventDefault(), e.length > 1 ? g() : d.offerHide?.(`tool:${t.id}`, w.clientX, w.clientY);
|
|
3455
3455
|
},
|
|
3456
|
-
onPointerDown: (
|
|
3457
|
-
f.current = !1,
|
|
3456
|
+
onPointerDown: (w) => {
|
|
3457
|
+
f.current = !1, w.button === 0 && (h.current = window.setTimeout(() => {
|
|
3458
3458
|
f.current = e.length > 1, g();
|
|
3459
3459
|
}, o));
|
|
3460
3460
|
},
|
|
@@ -3467,8 +3467,8 @@ function vc({ tools: e, shown: t, active: n, onSelect: r, rail: i, pressMs: o })
|
|
|
3467
3467
|
De,
|
|
3468
3468
|
{
|
|
3469
3469
|
icon: t.icon,
|
|
3470
|
-
label:
|
|
3471
|
-
pressed: e.some((
|
|
3470
|
+
label: b,
|
|
3471
|
+
pressed: e.some((w) => w.id === n),
|
|
3472
3472
|
disabled: d.state(`tool:${t.id}`).disabled,
|
|
3473
3473
|
onClick: () => {
|
|
3474
3474
|
f.current ? f.current = !1 : r(t.id);
|
|
@@ -3478,26 +3478,26 @@ function vc({ tools: e, shown: t, active: n, onSelect: r, rail: i, pressMs: o })
|
|
|
3478
3478
|
}
|
|
3479
3479
|
),
|
|
3480
3480
|
c ? /* @__PURE__ */ M("div", { className: "kui-popover kui-tool-flyout", role: "menu", style: { left: c.left, top: c.top }, children: [
|
|
3481
|
-
e.map((
|
|
3481
|
+
e.map((w) => /* @__PURE__ */ M(
|
|
3482
3482
|
"button",
|
|
3483
3483
|
{
|
|
3484
3484
|
type: "button",
|
|
3485
3485
|
role: "menuitemradio",
|
|
3486
|
-
"aria-checked":
|
|
3486
|
+
"aria-checked": w.id === n,
|
|
3487
3487
|
className: "kui-menu-item",
|
|
3488
|
-
disabled: d.state(`tool:${
|
|
3488
|
+
disabled: d.state(`tool:${w.id}`).disabled,
|
|
3489
3489
|
onClick: () => {
|
|
3490
|
-
l(null), r(
|
|
3490
|
+
l(null), r(w.id);
|
|
3491
3491
|
},
|
|
3492
|
-
"data-testid": `${a}-tool-${
|
|
3493
|
-
"data-kit-ui-id": `tool:${
|
|
3492
|
+
"data-testid": `${a}-tool-${w.id}`,
|
|
3493
|
+
"data-kit-ui-id": `tool:${w.id}`,
|
|
3494
3494
|
children: [
|
|
3495
|
-
/* @__PURE__ */ u(
|
|
3496
|
-
/* @__PURE__ */ u("span", { children:
|
|
3497
|
-
|
|
3495
|
+
/* @__PURE__ */ u(w.icon, { size: 15, strokeWidth: $e, "aria-hidden": "true" }),
|
|
3496
|
+
/* @__PURE__ */ u("span", { children: w.label }),
|
|
3497
|
+
w.shortcut ? /* @__PURE__ */ u("kbd", { children: w.shortcut }) : null
|
|
3498
3498
|
]
|
|
3499
3499
|
},
|
|
3500
|
-
|
|
3500
|
+
w.id
|
|
3501
3501
|
)),
|
|
3502
3502
|
d.hide ? /* @__PURE__ */ M(
|
|
3503
3503
|
"button",
|
|
@@ -3535,34 +3535,34 @@ function Ic({ tools: e, active: t, onSelect: n, columns: r = 1, onColumns: i, co
|
|
|
3535
3535
|
J(() => {
|
|
3536
3536
|
h != null && p((D) => D.get(h) === t ? D : new Map(D).set(h, t));
|
|
3537
3537
|
}, [t, h]);
|
|
3538
|
-
const [f, g] = B(!1),
|
|
3538
|
+
const [f, g] = B(!1), b = R(null), w = we(), m = e.filter((D) => !w.state(`tool:${D.id}`).hidden), y = w.state(`tool:${t}`).denied ? m.find((D) => !w.state(`tool:${D.id}`).denied)?.id : void 0, I = R(n);
|
|
3539
3539
|
I.current = n, Te(() => {
|
|
3540
3540
|
y && I.current(y);
|
|
3541
3541
|
}, [y]);
|
|
3542
|
-
const
|
|
3542
|
+
const N = [];
|
|
3543
3543
|
for (const D of m) {
|
|
3544
|
-
const Z =
|
|
3545
|
-
Z && D.group != null && Z[0].group === D.group ? Z.push(D) :
|
|
3544
|
+
const Z = N.at(-1);
|
|
3545
|
+
Z && D.group != null && Z[0].group === D.group ? Z.push(D) : N.push([D]);
|
|
3546
3546
|
}
|
|
3547
3547
|
const E = [];
|
|
3548
|
-
for (const D of
|
|
3548
|
+
for (const D of N) {
|
|
3549
3549
|
const Z = E.at(-1);
|
|
3550
3550
|
Z && Z[0][0].section === D[0].section ? Z.push(D) : E.push([D]);
|
|
3551
3551
|
}
|
|
3552
3552
|
J(() => {
|
|
3553
3553
|
if (r !== "auto" || typeof ResizeObserver > "u") return;
|
|
3554
|
-
const D =
|
|
3554
|
+
const D = b.current, Z = D?.parentElement;
|
|
3555
3555
|
if (!D || !Z) return;
|
|
3556
|
-
const Q = () => g(xc(
|
|
3556
|
+
const Q = () => g(xc(N.length, E.length, Z.getBoundingClientRect().bottom - D.getBoundingClientRect().top)), fe = new ResizeObserver(Q);
|
|
3557
3557
|
return fe.observe(Z), () => fe.disconnect();
|
|
3558
|
-
}, [r,
|
|
3559
|
-
const Y = r === 2 || r === "auto" && f ? 2 : 1, q = o ?
|
|
3560
|
-
|
|
3558
|
+
}, [r, N.length, E.length]);
|
|
3559
|
+
const Y = r === 2 || r === "auto" && f ? 2 : 1, q = o ? w.state(o) : { hidden: !1, disabled: !1 }, V = (D) => {
|
|
3560
|
+
w.state(`tool:${D}`).denied || n(D);
|
|
3561
3561
|
}, j = (D) => {
|
|
3562
|
-
const Z = (ce) => !
|
|
3563
|
-
return /* @__PURE__ */ u(vc, { tools: D, shown: fe, active: t, onSelect: V, rail:
|
|
3562
|
+
const Z = (ce) => !w.state(`tool:${ce.id}`).denied, Q = D[0].group == null || !a ? void 0 : l.get(D[0].group), fe = D.find((ce) => ce.id === t) ?? D.find((ce) => ce.id === Q && Z(ce)) ?? D.find(Z) ?? D[0];
|
|
3563
|
+
return /* @__PURE__ */ u(vc, { tools: D, shown: fe, active: t, onSelect: V, rail: b, pressMs: s }, D[0].id);
|
|
3564
3564
|
};
|
|
3565
|
-
return /* @__PURE__ */ M("div", { className: "kui-tool-rail", role: "toolbar", "aria-orientation": "vertical", "data-testid": `${d}-tool-rail`, "data-columns": Y, ref:
|
|
3565
|
+
return /* @__PURE__ */ M("div", { className: "kui-tool-rail", role: "toolbar", "aria-orientation": "vertical", "data-testid": `${d}-tool-rail`, "data-columns": Y, ref: b, children: [
|
|
3566
3566
|
i && r !== "auto" && !q.hidden ? /* @__PURE__ */ u(
|
|
3567
3567
|
"button",
|
|
3568
3568
|
{
|
|
@@ -3590,7 +3590,7 @@ function xu({ hidden: e = [] }) {
|
|
|
3590
3590
|
return /* @__PURE__ */ u(Ic, { tools: i, active: t.active, onSelect: t.select });
|
|
3591
3591
|
}
|
|
3592
3592
|
function $u({ id: e, title: t, children: n, defaultOpen: r = !0, actions: i, testId: o }) {
|
|
3593
|
-
const [a, s] = B(r), d =
|
|
3593
|
+
const [a, s] = B(r), d = we();
|
|
3594
3594
|
e && (d.declared, void 0);
|
|
3595
3595
|
const c = e ? d.state(e) : null;
|
|
3596
3596
|
return c?.hidden ? null : /* @__PURE__ */ M("section", { className: "kui-panel-section", "data-open": a, "data-testid": o, "data-kit-ui-id": e, children: [
|
|
@@ -3750,11 +3750,11 @@ function Lc(e, t) {
|
|
|
3750
3750
|
schema: r.schema ?? null
|
|
3751
3751
|
}));
|
|
3752
3752
|
}
|
|
3753
|
-
function
|
|
3753
|
+
function Nc(e, t, n, r) {
|
|
3754
3754
|
const i = r?.name || "another session";
|
|
3755
3755
|
return new he(-32e3, `step ${t} (\`${e}\`) is not allowed: ${i} holds the lease on \`${n}\``, { reason: fn, command: e, step: t, scope: n, ...r ? { holder: r } : {} });
|
|
3756
3756
|
}
|
|
3757
|
-
async function
|
|
3757
|
+
async function Pc(e, t, n, r, i, o) {
|
|
3758
3758
|
if (!t) {
|
|
3759
3759
|
const s = n ? e.list().find((d) => !d.holder.self && d.scope === "*") : void 0;
|
|
3760
3760
|
if (s) throw o("*", s.holder);
|
|
@@ -3775,24 +3775,24 @@ async function Nc(e, t, n, r, i, o) {
|
|
|
3775
3775
|
function Ou(e, t, n, r = {}) {
|
|
3776
3776
|
const i = e.init.document.path, o = e.readOnly === !0, a = o && e.init.document.comments?.canComment === !0, s = t.commentCommands, d = pe(() => ul(s, a), [a, s]), c = kl(e.files, t, i, !0, n, { readOnly: o, canComment: a, replicaMergesFile: r.replicaMergesFile, followFile: r.followFile }), { doc: l, failure: p } = c, h = l?.info.revision ?? null, f = l?.info.dirty ?? !1, g = R(c);
|
|
3777
3777
|
g.current = c;
|
|
3778
|
-
const
|
|
3779
|
-
const W =
|
|
3778
|
+
const b = R({ doc: null, map: null, commands: null, loading: null }), w = H((C) => {
|
|
3779
|
+
const W = b.current;
|
|
3780
3780
|
if (W.doc === C && W.loading) return W.loading;
|
|
3781
3781
|
const _ = C.commands().then((T) => {
|
|
3782
3782
|
const K = new Map(T.map((ne) => [ne.id, ne.menu]));
|
|
3783
|
-
return
|
|
3783
|
+
return b.current.loading === _ && (b.current = { doc: C, map: K, commands: new Map(T.map((ne) => [ne.id, ne])), loading: _ }), K;
|
|
3784
3784
|
});
|
|
3785
3785
|
return _.catch(() => {
|
|
3786
|
-
|
|
3787
|
-
}),
|
|
3786
|
+
b.current.loading === _ && (b.current = { doc: null, map: null, commands: null, loading: null });
|
|
3787
|
+
}), b.current = { doc: C, map: null, commands: null, loading: _ }, _;
|
|
3788
3788
|
}, []);
|
|
3789
3789
|
J(() => {
|
|
3790
|
-
l &&
|
|
3790
|
+
l && w(l).catch(() => {
|
|
3791
3791
|
});
|
|
3792
|
-
}, [l,
|
|
3792
|
+
}, [l, w]);
|
|
3793
3793
|
const m = H(
|
|
3794
3794
|
(C) => {
|
|
3795
|
-
const W =
|
|
3795
|
+
const W = b.current.commands?.get(C);
|
|
3796
3796
|
return It(W ?? { id: C }, d);
|
|
3797
3797
|
},
|
|
3798
3798
|
[d]
|
|
@@ -3800,8 +3800,8 @@ function Ou(e, t, n, r = {}) {
|
|
|
3800
3800
|
async (C, W = {}, _ = null, T = {}) => {
|
|
3801
3801
|
const K = g.current.doc;
|
|
3802
3802
|
if (!K) return null;
|
|
3803
|
-
const ne =
|
|
3804
|
-
if (Se(e.ui.get(), `command:${C}`,
|
|
3803
|
+
const ne = b.current, P = ne.doc === K && ne.map ? ne.map : await w(K);
|
|
3804
|
+
if (Se(e.ui.get(), `command:${C}`, P.get(C) ?? []).denied) throw ht(C);
|
|
3805
3805
|
if (o && m(C)) throw mt(C);
|
|
3806
3806
|
try {
|
|
3807
3807
|
return await c.run(C, W, _, T);
|
|
@@ -3809,9 +3809,9 @@ function Ou(e, t, n, r = {}) {
|
|
|
3809
3809
|
throw Fi(G) ? mt(C) : G;
|
|
3810
3810
|
}
|
|
3811
3811
|
},
|
|
3812
|
-
[m, e,
|
|
3813
|
-
), I = r.agentSkipsUnchangedPaint === !0,
|
|
3814
|
-
|
|
3812
|
+
[m, e, w, o, c.run]
|
|
3813
|
+
), I = r.agentSkipsUnchangedPaint === !0, N = R(r);
|
|
3814
|
+
N.current = r;
|
|
3815
3815
|
const E = pe(() => _i(Vi, e.init.locale), [e]), Y = r.agentLeaseScope != null;
|
|
3816
3816
|
J(() => {
|
|
3817
3817
|
Y && dn(e);
|
|
@@ -3874,14 +3874,14 @@ function Ou(e, t, n, r = {}) {
|
|
|
3874
3874
|
const L = al(e.ui.get(), await W().commands());
|
|
3875
3875
|
return Lc(o ? L.map((re) => It(re, d) ? { ...re, enabled: !1 } : re) : L, A);
|
|
3876
3876
|
}), C.handle("ai/run", async (A) => {
|
|
3877
|
-
const { steps: L, save: re, draft: ie } = A, ae = Ec(A), se = W(), ge = await
|
|
3877
|
+
const { steps: L, save: re, draft: ie } = A, ae = Ec(A), se = W(), ge = await w(se), v = ol(e.ui.get(), L, ($) => ge.get($) ?? []);
|
|
3878
3878
|
if (v >= 0) throw ht(L[v].command, v);
|
|
3879
3879
|
const z = o ? L.findIndex(($) => m($.command)) : -1;
|
|
3880
3880
|
if (z >= 0) throw mt(L[z].command, z);
|
|
3881
3881
|
if (ie === !0) return ue(await T(!0), L);
|
|
3882
3882
|
const S = se.info.context === !0 ? -1 : L.findIndex(($) => $.context != null);
|
|
3883
3883
|
if (S >= 0) throw Dc(L[S].command, S);
|
|
3884
|
-
return
|
|
3884
|
+
return P(() => K(se, L, re, ae));
|
|
3885
3885
|
});
|
|
3886
3886
|
const K = async (A, L, re, ie) => {
|
|
3887
3887
|
const ae = [], se = ie.by === "system" ? { kind: "system", principal: "kdm", label: ie.originLabel } : { kind: "agent", principal: e.init.document.comments?.me ?? "agent", label: "ai/run" }, ge = { last: null, meanwhile: !1 }, v = A.info.context === !0 ? { state: null } : null, z = ($) => ({ ...I ? { skipUnchangedPaint: !0 } : {}, origin: se, ...v ? { agent: { state: v, set: $ } } : {} });
|
|
@@ -3946,7 +3946,7 @@ function Ou(e, t, n, r = {}) {
|
|
|
3946
3946
|
[],
|
|
3947
3947
|
L
|
|
3948
3948
|
) : $(` The ${L.length} step(s) before it were rolled back: the document is as it was before the run.`, [], L);
|
|
3949
|
-
},
|
|
3949
|
+
}, P = (A) => {
|
|
3950
3950
|
const L = q.current.then(A, A);
|
|
3951
3951
|
return q.current = L.then(
|
|
3952
3952
|
() => {
|
|
@@ -3955,7 +3955,7 @@ function Ou(e, t, n, r = {}) {
|
|
|
3955
3955
|
}
|
|
3956
3956
|
), L;
|
|
3957
3957
|
}, G = async (A, L, re, ie, ae, se) => {
|
|
3958
|
-
const ge =
|
|
3958
|
+
const ge = N.current.agentLeaseScope, v = ge ? dn(e) : null;
|
|
3959
3959
|
if (!ge || !v?.available) return ae();
|
|
3960
3960
|
let z = "";
|
|
3961
3961
|
try {
|
|
@@ -3963,8 +3963,8 @@ function Ou(e, t, n, r = {}) {
|
|
|
3963
3963
|
} catch {
|
|
3964
3964
|
z = "";
|
|
3965
3965
|
}
|
|
3966
|
-
const S =
|
|
3967
|
-
return
|
|
3966
|
+
const S = b.current.commands?.get(L)?.mutates ?? !0;
|
|
3967
|
+
return Pc(v, z, S, N.current.agentLeaseTtl, ae, ($, F) => (se.by === "agent" && e.notify({ level: "warning", title: E("agentLeaseHeld", { name: F?.name || E("someone") }) }), Nc(L, ie, $, F)));
|
|
3968
3968
|
};
|
|
3969
3969
|
C.handle("ai/preview", async ({ maxSize: A, draft: L }) => ({ png: await an(L === !0 ? await T(!1) : W(), A) }));
|
|
3970
3970
|
const ue = async (A, L) => {
|
|
@@ -3998,7 +3998,7 @@ function Ou(e, t, n, r = {}) {
|
|
|
3998
3998
|
V.current = { by: "agent" };
|
|
3999
3999
|
try {
|
|
4000
4000
|
const ie = await _.merge(re, L), ae = g.current.doc;
|
|
4001
|
-
return ae && Q({ by: "agent" }, ae.info.revision), ie.merged &&
|
|
4001
|
+
return ae && Q({ by: "agent" }, ae.info.revision), ie.merged && N.current.draftMerged?.({ summary: ie.summary }), ie;
|
|
4002
4002
|
} catch (ie) {
|
|
4003
4003
|
throw ie instanceof Je ? xr(ie.data) : ie;
|
|
4004
4004
|
} finally {
|
|
@@ -4023,7 +4023,7 @@ function Ou(e, t, n, r = {}) {
|
|
|
4023
4023
|
(A) => ye(async () => {
|
|
4024
4024
|
const { schema: L = null, draft: re, ...ie } = A ?? {}, ae = Array.isArray(ie.ops) ? ie.ops : [];
|
|
4025
4025
|
if (o && ae.length) throw new Je({ code: Oe, index: null, message: "the document is read-only" });
|
|
4026
|
-
const se = await
|
|
4026
|
+
const se = await w(W());
|
|
4027
4027
|
if (ae.forEach((z, S) => {
|
|
4028
4028
|
if (z?.op === "command" && typeof z.id == "string" && Se(e.ui.get(), `command:${z.id}`, se.get(z.id) ?? []).denied)
|
|
4029
4029
|
throw new Je({ code: "command-failed", index: S, message: ht(z.id).message });
|
|
@@ -4032,13 +4032,13 @@ function Ou(e, t, n, r = {}) {
|
|
|
4032
4032
|
return ae.length && _.edited(), v;
|
|
4033
4033
|
})
|
|
4034
4034
|
);
|
|
4035
|
-
const
|
|
4035
|
+
const Ne = C.on("document/fileChanged", () => void g.current.checkFile()), We = C.on("document/held", (A) => {
|
|
4036
4036
|
typeof A?.version == "string" && g.current.holdFile(A.version);
|
|
4037
4037
|
});
|
|
4038
4038
|
return e.replica && (C.handle("replica/version", async () => ({ version: await g.current.replica.version() })), C.handle("replica/export", ({ since: A }) => g.current.replica.exportChanges(A)), C.handle("replica/import", async ({ changes: A, blobs: L }) => ({ damage: await g.current.replica.importChanges(A, L) })), C.handle("replica/info", async () => ({ docId: await g.current.replica.docId() }))), () => {
|
|
4039
|
-
|
|
4039
|
+
Ne(), We();
|
|
4040
4040
|
};
|
|
4041
|
-
}, [d, Q, m, e, t.kitId,
|
|
4041
|
+
}, [d, Q, m, e, t.kitId, w, i, o, y, I, E]), { ...c, run: y, editedBy: D, comments: d };
|
|
4042
4042
|
}
|
|
4043
4043
|
const to = [
|
|
4044
4044
|
{ preset: "rect", icon: ct, label: "drawingRect" },
|
|
@@ -4054,7 +4054,7 @@ function Ru({ testId: e = "drawing", label: t, merge: n, exclude: r, primary: i
|
|
|
4054
4054
|
const o = te(), { t: a } = o, s = !o.enabled("drawing.insert"), d = (p) => void o.run("drawing.insert", p), c = o.byId.has("draw.shape"), l = (p) => c ? void o.run("draw.shape", { preset: p }) : d({ geometry: { preset: p } });
|
|
4055
4055
|
return /* @__PURE__ */ M(Me, { label: t ?? a("drawingIllustrations"), icon: _e, children: [
|
|
4056
4056
|
/* @__PURE__ */ u(xe, { icon: _e, label: a("drawingShapes"), size: "large", disabled: s, testId: `${e}-shapes`, primary: !0, children: to.map((p) => /* @__PURE__ */ u(le, { icon: p.icon, label: a(p.label), testId: `${e}-shape-${p.preset}`, onSelect: () => l(p.preset) }, p.preset)) }),
|
|
4057
|
-
/* @__PURE__ */ u(
|
|
4057
|
+
/* @__PURE__ */ u(be, { icon: Ue, label: a("drawingTextBox"), size: "large", disabled: s, onClick: () => d({ kind: "textBox", text: "" }), "data-testid": `${e}-text-box`, primary: !0 }),
|
|
4058
4058
|
n ? /* @__PURE__ */ u(uc, { path: n, titles: Fc, exclude: r, primary: i?.length ? i : void 0 }) : null
|
|
4059
4059
|
] });
|
|
4060
4060
|
}
|
|
@@ -4173,7 +4173,7 @@ function Du({ ids: e, testId: t = "drawing", effects: n = !0 }) {
|
|
|
4173
4173
|
] }),
|
|
4174
4174
|
/* @__PURE__ */ M(Fe, { children: [
|
|
4175
4175
|
/* @__PURE__ */ u(
|
|
4176
|
-
|
|
4176
|
+
be,
|
|
4177
4177
|
{
|
|
4178
4178
|
icon: In,
|
|
4179
4179
|
label: i("drawingGroup"),
|
|
@@ -4184,7 +4184,7 @@ function Du({ ids: e, testId: t = "drawing", effects: n = !0 }) {
|
|
|
4184
4184
|
}
|
|
4185
4185
|
),
|
|
4186
4186
|
/* @__PURE__ */ u(
|
|
4187
|
-
|
|
4187
|
+
be,
|
|
4188
4188
|
{
|
|
4189
4189
|
icon: Os,
|
|
4190
4190
|
label: i("drawingConnect"),
|
|
@@ -4194,7 +4194,7 @@ function Du({ ids: e, testId: t = "drawing", effects: n = !0 }) {
|
|
|
4194
4194
|
}
|
|
4195
4195
|
),
|
|
4196
4196
|
/* @__PURE__ */ u(
|
|
4197
|
-
|
|
4197
|
+
be,
|
|
4198
4198
|
{
|
|
4199
4199
|
icon: Mn,
|
|
4200
4200
|
label: i("drawingUngroup"),
|
|
@@ -4204,7 +4204,7 @@ function Du({ ids: e, testId: t = "drawing", effects: n = !0 }) {
|
|
|
4204
4204
|
}
|
|
4205
4205
|
),
|
|
4206
4206
|
/* @__PURE__ */ u(
|
|
4207
|
-
|
|
4207
|
+
be,
|
|
4208
4208
|
{
|
|
4209
4209
|
icon: $n,
|
|
4210
4210
|
label: i("drawingRotateRight"),
|
|
@@ -4214,7 +4214,7 @@ function Du({ ids: e, testId: t = "drawing", effects: n = !0 }) {
|
|
|
4214
4214
|
}
|
|
4215
4215
|
),
|
|
4216
4216
|
/* @__PURE__ */ u(
|
|
4217
|
-
|
|
4217
|
+
be,
|
|
4218
4218
|
{
|
|
4219
4219
|
icon: rt,
|
|
4220
4220
|
label: i("drawingDelete"),
|
|
@@ -4245,14 +4245,14 @@ function Lu({ testId: e = "ink" }) {
|
|
|
4245
4245
|
const g = setTimeout(s, 60);
|
|
4246
4246
|
return () => clearTimeout(g);
|
|
4247
4247
|
}, [s, i, n?.active]);
|
|
4248
|
-
const d = (g) => n?.tools.some((
|
|
4248
|
+
const d = (g) => n?.tools.some((b) => b.id === g) ?? !1, c = async (g) => {
|
|
4249
4249
|
d(g) ? n?.select(g) : await t.run(`draw.${g}`, {}), s();
|
|
4250
4250
|
}, l = n && d(o?.tool ?? "select") && n.tools.some((g) => g.id === n.active) ? n.active : o?.tool, p = o && Vc.includes(o.tool) ? o.tool : null, h = async (g) => {
|
|
4251
4251
|
p && (await t.run(`draw.${p}`, g), s());
|
|
4252
4252
|
}, f = !t.enabled("draw.pen");
|
|
4253
4253
|
return /* @__PURE__ */ M(Ce, { children: [
|
|
4254
4254
|
/* @__PURE__ */ u(Me, { label: r("inkTools"), icon: Ti, children: Gc.map((g) => /* @__PURE__ */ u(
|
|
4255
|
-
|
|
4255
|
+
be,
|
|
4256
4256
|
{
|
|
4257
4257
|
icon: g.icon,
|
|
4258
4258
|
label: r(g.label),
|
|
@@ -4363,7 +4363,7 @@ function ed(e) {
|
|
|
4363
4363
|
function ro(e) {
|
|
4364
4364
|
return e === "line" || e === "lineMarkers" || e === "stackedLine" || e === "scatter" || e === "radar";
|
|
4365
4365
|
}
|
|
4366
|
-
const
|
|
4366
|
+
const Pn = [
|
|
4367
4367
|
{ kind: "column", icon: je, label: "chartColumn" },
|
|
4368
4368
|
{
|
|
4369
4369
|
kind: "stackedColumn",
|
|
@@ -4377,9 +4377,9 @@ const Nn = [
|
|
|
4377
4377
|
{ kind: "pie", icon: Qn, label: "chartPie" },
|
|
4378
4378
|
{ kind: "doughnut", icon: Qn, label: "chartDoughnut" },
|
|
4379
4379
|
{ kind: "scatter", icon: Ls, label: "chartScatter" },
|
|
4380
|
-
{ kind: "radar", icon:
|
|
4380
|
+
{ kind: "radar", icon: Ns, label: "chartRadar" }
|
|
4381
4381
|
], td = ["top", "bottom", "left", "right"];
|
|
4382
|
-
function
|
|
4382
|
+
function Nu({
|
|
4383
4383
|
testId: e = "chart",
|
|
4384
4384
|
size: t = "large",
|
|
4385
4385
|
primary: n
|
|
@@ -4394,7 +4394,7 @@ function Pu({
|
|
|
4394
4394
|
disabled: !r.enabled("drawing.insert"),
|
|
4395
4395
|
testId: `${e}-insert`,
|
|
4396
4396
|
primary: n,
|
|
4397
|
-
children:
|
|
4397
|
+
children: Pn.map((o) => /* @__PURE__ */ u(
|
|
4398
4398
|
le,
|
|
4399
4399
|
{
|
|
4400
4400
|
icon: o.icon,
|
|
@@ -4427,13 +4427,13 @@ function nd(e) {
|
|
|
4427
4427
|
};
|
|
4428
4428
|
}, [t, e, n]), r;
|
|
4429
4429
|
}
|
|
4430
|
-
function
|
|
4430
|
+
function Pu({
|
|
4431
4431
|
id: e,
|
|
4432
4432
|
testId: t = "chart",
|
|
4433
4433
|
dataEditable: n = !0,
|
|
4434
4434
|
formats: r = no
|
|
4435
4435
|
}) {
|
|
4436
|
-
const i = te(), { t: o } = i, a = nd(e), [s, d] = B(!1), [c, l] = B(null), p = !a || !i.enabled("drawing.chart"), h = (m) => void i.run("drawing.chart", { id: e, ...m }), f = typeof a?.kind == "object", g = a?.kind === "pie" || a?.kind === "doughnut",
|
|
4436
|
+
const i = te(), { t: o } = i, a = nd(e), [s, d] = B(!1), [c, l] = B(null), p = !a || !i.enabled("drawing.chart"), h = (m) => void i.run("drawing.chart", { id: e, ...m }), f = typeof a?.kind == "object", g = a?.kind === "pie" || a?.kind === "doughnut", b = g || a?.kind === "radar" || f, w = (m) => h({ seriesFormat: (a?.series ?? []).map((y, I) => ({ index: I, ...m })) });
|
|
4437
4437
|
return /* @__PURE__ */ M(Ce, { children: [
|
|
4438
4438
|
/* @__PURE__ */ u(Me, { label: o("chartType"), icon: je, children: /* @__PURE__ */ u(
|
|
4439
4439
|
xe,
|
|
@@ -4444,7 +4444,7 @@ function Nu({
|
|
|
4444
4444
|
disabled: p || f,
|
|
4445
4445
|
testId: `${t}-type`,
|
|
4446
4446
|
primary: !0,
|
|
4447
|
-
children:
|
|
4447
|
+
children: Pn.map((m) => /* @__PURE__ */ u(
|
|
4448
4448
|
le,
|
|
4449
4449
|
{
|
|
4450
4450
|
icon: m.icon,
|
|
@@ -4459,10 +4459,10 @@ function Nu({
|
|
|
4459
4459
|
))
|
|
4460
4460
|
}
|
|
4461
4461
|
) }),
|
|
4462
|
-
/* @__PURE__ */ M(Me, { label: o("chartElements"), icon:
|
|
4462
|
+
/* @__PURE__ */ M(Me, { label: o("chartElements"), icon: Ps, children: [
|
|
4463
4463
|
/* @__PURE__ */ M(Fe, { children: [
|
|
4464
4464
|
/* @__PURE__ */ u(
|
|
4465
|
-
|
|
4465
|
+
be,
|
|
4466
4466
|
{
|
|
4467
4467
|
icon: qr,
|
|
4468
4468
|
label: o("chartTitle"),
|
|
@@ -4508,7 +4508,7 @@ function Nu({
|
|
|
4508
4508
|
}
|
|
4509
4509
|
),
|
|
4510
4510
|
/* @__PURE__ */ u(
|
|
4511
|
-
|
|
4511
|
+
be,
|
|
4512
4512
|
{
|
|
4513
4513
|
icon: pn,
|
|
4514
4514
|
label: o("chartDataLabels"),
|
|
@@ -4522,7 +4522,7 @@ function Nu({
|
|
|
4522
4522
|
] }),
|
|
4523
4523
|
/* @__PURE__ */ M(Fe, { children: [
|
|
4524
4524
|
/* @__PURE__ */ u(
|
|
4525
|
-
|
|
4525
|
+
be,
|
|
4526
4526
|
{
|
|
4527
4527
|
icon: St,
|
|
4528
4528
|
label: o("chartGridlines"),
|
|
@@ -4533,19 +4533,19 @@ function Nu({
|
|
|
4533
4533
|
}
|
|
4534
4534
|
),
|
|
4535
4535
|
r.includes("trends") ? /* @__PURE__ */ M(Ce, { children: [
|
|
4536
|
-
/* @__PURE__ */ M(xe, { icon: Fs, label: o("chartTrendline"), disabled: p ||
|
|
4537
|
-
Jc.map((m) => /* @__PURE__ */ u(le, { label: o(m.label), testId: `${t}-trendline-${m.id}`, onSelect: () =>
|
|
4536
|
+
/* @__PURE__ */ M(xe, { icon: Fs, label: o("chartTrendline"), disabled: p || b, testId: `${t}-trendline`, children: [
|
|
4537
|
+
Jc.map((m) => /* @__PURE__ */ u(le, { label: o(m.label), testId: `${t}-trendline-${m.id}`, onSelect: () => w({ trendline: m.trendline }) }, m.id)),
|
|
4538
4538
|
/* @__PURE__ */ u(Ae, {}),
|
|
4539
|
-
/* @__PURE__ */ u(le, { label: o("chartNone"), testId: `${t}-trendline-none`, onSelect: () =>
|
|
4539
|
+
/* @__PURE__ */ u(le, { label: o("chartNone"), testId: `${t}-trendline-none`, onSelect: () => w({ trendline: null }) })
|
|
4540
4540
|
] }),
|
|
4541
|
-
/* @__PURE__ */ M(xe, { icon: Ve, label: o("chartErrorBars"), disabled: p ||
|
|
4542
|
-
Zc.map((m) => /* @__PURE__ */ u(le, { label: o(m.label), testId: `${t}-error-bars-${m.id}`, onSelect: () =>
|
|
4541
|
+
/* @__PURE__ */ M(xe, { icon: Ve, label: o("chartErrorBars"), disabled: p || b, testId: `${t}-error-bars`, children: [
|
|
4542
|
+
Zc.map((m) => /* @__PURE__ */ u(le, { label: o(m.label), testId: `${t}-error-bars-${m.id}`, onSelect: () => w({ errorBars: m.errorBars }) }, m.id)),
|
|
4543
4543
|
/* @__PURE__ */ u(Ae, {}),
|
|
4544
|
-
/* @__PURE__ */ u(le, { label: o("chartNone"), testId: `${t}-error-bars-none`, onSelect: () =>
|
|
4544
|
+
/* @__PURE__ */ u(le, { label: o("chartNone"), testId: `${t}-error-bars-none`, onSelect: () => w({ errorBars: null }) })
|
|
4545
4545
|
] })
|
|
4546
4546
|
] }) : null,
|
|
4547
4547
|
/* @__PURE__ */ u(
|
|
4548
|
-
|
|
4548
|
+
be,
|
|
4549
4549
|
{
|
|
4550
4550
|
icon: Ue,
|
|
4551
4551
|
label: o("chartAxisTitles"),
|
|
@@ -4572,7 +4572,7 @@ function Nu({
|
|
|
4572
4572
|
}
|
|
4573
4573
|
),
|
|
4574
4574
|
n ? /* @__PURE__ */ u(Me, { label: o("chartData"), icon: yn, children: /* @__PURE__ */ u(
|
|
4575
|
-
|
|
4575
|
+
be,
|
|
4576
4576
|
{
|
|
4577
4577
|
icon: Ws,
|
|
4578
4578
|
label: o("chartEditData"),
|
|
@@ -4626,7 +4626,7 @@ function rd({
|
|
|
4626
4626
|
), p = l.includes("lineWidth") || ro(e?.kind) && l.length > 0 || l.includes("combo") && typeof e?.kind == "string" && !["pie", "doughnut", "radar", "scatter"].includes(e.kind);
|
|
4627
4627
|
return !n.includes("axes") && !n.includes("labelPosition") && l.length === 0 ? null : /* @__PURE__ */ u(Me, { label: a("chartFormat"), icon: Rt, children: /* @__PURE__ */ M(Fe, { children: [
|
|
4628
4628
|
n.includes("axes") ? /* @__PURE__ */ u(
|
|
4629
|
-
|
|
4629
|
+
be,
|
|
4630
4630
|
{
|
|
4631
4631
|
icon: Ve,
|
|
4632
4632
|
label: a("chartFormatAxis"),
|
|
@@ -4655,7 +4655,7 @@ function rd({
|
|
|
4655
4655
|
}
|
|
4656
4656
|
) : null,
|
|
4657
4657
|
l.length > 0 ? /* @__PURE__ */ u(
|
|
4658
|
-
|
|
4658
|
+
be,
|
|
4659
4659
|
{
|
|
4660
4660
|
icon: it,
|
|
4661
4661
|
label: a("chartFormatSeries"),
|
|
@@ -4666,7 +4666,7 @@ function rd({
|
|
|
4666
4666
|
) : null
|
|
4667
4667
|
] }) });
|
|
4668
4668
|
}
|
|
4669
|
-
function
|
|
4669
|
+
function wt(e) {
|
|
4670
4670
|
if (e.trim() === "") return null;
|
|
4671
4671
|
const t = Number(e);
|
|
4672
4672
|
return Number.isFinite(t) ? t : void 0;
|
|
@@ -4678,16 +4678,16 @@ function id({
|
|
|
4678
4678
|
onClose: n,
|
|
4679
4679
|
testId: r = "chart"
|
|
4680
4680
|
}) {
|
|
4681
|
-
const { t: i } = te(), [o, a] = B("yAxis"), s = (y) => e[y] ?? {}, [d, c] = B(() => Ir(s("yAxis"))), l = o === "yAxis" || e.kind === "scatter", p =
|
|
4681
|
+
const { t: i } = te(), [o, a] = B("yAxis"), s = (y) => e[y] ?? {}, [d, c] = B(() => Ir(s("yAxis"))), l = o === "yAxis" || e.kind === "scatter", p = wt(d.min), h = wt(d.max), f = wt(d.major), g = l && (p === void 0 || h === void 0 || f === void 0 || f != null && f <= 0 || p != null && h != null && p >= h) || d.numberFormat.length > 255, b = (y) => {
|
|
4682
4682
|
a(y), c(Ir(s(y)));
|
|
4683
|
-
},
|
|
4683
|
+
}, w = () => {
|
|
4684
4684
|
const y = {
|
|
4685
4685
|
numberFormat: d.numberFormat.trim() || null,
|
|
4686
4686
|
hidden: !d.shown
|
|
4687
4687
|
};
|
|
4688
4688
|
l && Object.assign(y, { min: p, max: h, major: f }), t({ [o]: y }), n();
|
|
4689
|
-
}, m = (y, I,
|
|
4690
|
-
const E = d[y], Y =
|
|
4689
|
+
}, m = (y, I, N) => {
|
|
4690
|
+
const E = d[y], Y = N && E.trim() !== "" && !Number.isFinite(Number(E));
|
|
4691
4691
|
return [
|
|
4692
4692
|
/* @__PURE__ */ u("label", { htmlFor: `chart-axis-${y}`, children: I }, `${y}-label`),
|
|
4693
4693
|
/* @__PURE__ */ u(
|
|
@@ -4695,7 +4695,7 @@ function id({
|
|
|
4695
4695
|
{
|
|
4696
4696
|
id: `chart-axis-${y}`,
|
|
4697
4697
|
className: "kui-field",
|
|
4698
|
-
inputMode:
|
|
4698
|
+
inputMode: N ? "decimal" : void 0,
|
|
4699
4699
|
placeholder: i("chartAxisAuto"),
|
|
4700
4700
|
"aria-invalid": Y,
|
|
4701
4701
|
value: E,
|
|
@@ -4719,7 +4719,7 @@ function id({
|
|
|
4719
4719
|
{
|
|
4720
4720
|
variant: "primary",
|
|
4721
4721
|
disabled: g,
|
|
4722
|
-
onClick:
|
|
4722
|
+
onClick: w,
|
|
4723
4723
|
"data-testid": `${r}-axis-ok`,
|
|
4724
4724
|
children: i("chartOk")
|
|
4725
4725
|
}
|
|
@@ -4737,7 +4737,7 @@ function id({
|
|
|
4737
4737
|
["yAxis", i("chartAxisValue")],
|
|
4738
4738
|
["xAxis", i("chartAxisCategory")]
|
|
4739
4739
|
],
|
|
4740
|
-
onChange:
|
|
4740
|
+
onChange: b,
|
|
4741
4741
|
testId: `${r}-axis-which`
|
|
4742
4742
|
}
|
|
4743
4743
|
),
|
|
@@ -4777,8 +4777,8 @@ function od({
|
|
|
4777
4777
|
onClose: r,
|
|
4778
4778
|
testId: i = "chart"
|
|
4779
4779
|
}) {
|
|
4780
|
-
const { t: o } = te(), a = ro(e.kind), s = t.includes("combo") && typeof e.kind == "string" && !["pie", "doughnut", "radar", "scatter"].includes(e.kind), [d, c] = B(0), l = (
|
|
4781
|
-
const m = e.series[
|
|
4780
|
+
const { t: o } = te(), a = ro(e.kind), s = t.includes("combo") && typeof e.kind == "string" && !["pie", "doughnut", "radar", "scatter"].includes(e.kind), [d, c] = B(0), l = (w) => {
|
|
4781
|
+
const m = e.series[w];
|
|
4782
4782
|
return {
|
|
4783
4783
|
lineWidth: yt(m?.lineWidth),
|
|
4784
4784
|
marker: m?.marker ?? "",
|
|
@@ -4786,9 +4786,9 @@ function od({
|
|
|
4786
4786
|
kind: typeof m?.kind == "string" ? m.kind : "",
|
|
4787
4787
|
secondary: m?.secondary ?? !1
|
|
4788
4788
|
};
|
|
4789
|
-
}, [p, h] = B(() => l(0)), f =
|
|
4790
|
-
const
|
|
4791
|
-
t.includes("lineWidth") && (
|
|
4789
|
+
}, [p, h] = B(() => l(0)), f = wt(p.lineWidth), g = f === void 0 || f != null && (f < 0 || f > 100), b = () => {
|
|
4790
|
+
const w = { index: d };
|
|
4791
|
+
t.includes("lineWidth") && (w.lineWidth = f), a && t.includes("marker") && (w.marker = p.marker === "" ? null : p.marker), a && t.includes("smooth") && (w.smooth = p.smooth), s && (w.kind = p.kind === "" ? null : p.kind, w.secondary = p.secondary), n({ seriesFormat: [w] }), r();
|
|
4792
4792
|
};
|
|
4793
4793
|
return /* @__PURE__ */ u(
|
|
4794
4794
|
st,
|
|
@@ -4803,7 +4803,7 @@ function od({
|
|
|
4803
4803
|
{
|
|
4804
4804
|
variant: "primary",
|
|
4805
4805
|
disabled: g,
|
|
4806
|
-
onClick:
|
|
4806
|
+
onClick: b,
|
|
4807
4807
|
"data-testid": `${i}-series-ok`,
|
|
4808
4808
|
children: o("chartOk")
|
|
4809
4809
|
}
|
|
@@ -4817,9 +4817,9 @@ function od({
|
|
|
4817
4817
|
label: o("chartSeries"),
|
|
4818
4818
|
quiet: !0,
|
|
4819
4819
|
value: String(d),
|
|
4820
|
-
choices: e.series.map((
|
|
4821
|
-
onChange: (
|
|
4822
|
-
c(Number(
|
|
4820
|
+
choices: e.series.map((w, m) => [String(m), w.name]),
|
|
4821
|
+
onChange: (w) => {
|
|
4822
|
+
c(Number(w)), h(l(Number(w)));
|
|
4823
4823
|
},
|
|
4824
4824
|
testId: `${i}-series-which`
|
|
4825
4825
|
}
|
|
@@ -4835,7 +4835,7 @@ function od({
|
|
|
4835
4835
|
placeholder: o("chartAxisAuto"),
|
|
4836
4836
|
"aria-invalid": g,
|
|
4837
4837
|
value: p.lineWidth,
|
|
4838
|
-
onChange: (
|
|
4838
|
+
onChange: (w) => h((m) => ({ ...m, lineWidth: w.target.value })),
|
|
4839
4839
|
"data-testid": `${i}-series-width`
|
|
4840
4840
|
},
|
|
4841
4841
|
"w"
|
|
@@ -4851,11 +4851,11 @@ function od({
|
|
|
4851
4851
|
value: p.marker,
|
|
4852
4852
|
choices: [
|
|
4853
4853
|
["", o("chartMarker_auto")],
|
|
4854
|
-
...Qc.filter((
|
|
4855
|
-
(
|
|
4854
|
+
...Qc.filter((w) => w !== "auto").map(
|
|
4855
|
+
(w) => [w, o(`chartMarker_${w}`)]
|
|
4856
4856
|
)
|
|
4857
4857
|
],
|
|
4858
|
-
onChange: (
|
|
4858
|
+
onChange: (w) => h((m) => ({ ...m, marker: w })),
|
|
4859
4859
|
testId: `${i}-series-marker`
|
|
4860
4860
|
},
|
|
4861
4861
|
"m"
|
|
@@ -4871,9 +4871,9 @@ function od({
|
|
|
4871
4871
|
value: p.kind,
|
|
4872
4872
|
choices: [
|
|
4873
4873
|
["", o("chartSeriesTypeChart")],
|
|
4874
|
-
...Xc.map((
|
|
4874
|
+
...Xc.map((w) => [w, o(Pn.find((m) => m.kind === w)?.label ?? w)])
|
|
4875
4875
|
],
|
|
4876
|
-
onChange: (
|
|
4876
|
+
onChange: (w) => h((m) => ({ ...m, kind: w })),
|
|
4877
4877
|
testId: `${i}-series-kind`
|
|
4878
4878
|
},
|
|
4879
4879
|
"k"
|
|
@@ -4884,7 +4884,7 @@ function od({
|
|
|
4884
4884
|
{
|
|
4885
4885
|
label: o("chartSecondaryAxis"),
|
|
4886
4886
|
checked: p.secondary,
|
|
4887
|
-
onChange: (
|
|
4887
|
+
onChange: (w) => h((m) => ({ ...m, secondary: w })),
|
|
4888
4888
|
testId: `${i}-series-secondary`
|
|
4889
4889
|
},
|
|
4890
4890
|
"x"
|
|
@@ -4897,7 +4897,7 @@ function od({
|
|
|
4897
4897
|
{
|
|
4898
4898
|
label: o("chartSmooth"),
|
|
4899
4899
|
checked: p.smooth,
|
|
4900
|
-
onChange: (
|
|
4900
|
+
onChange: (w) => h((m) => ({ ...m, smooth: w })),
|
|
4901
4901
|
testId: `${i}-series-smooth`
|
|
4902
4902
|
},
|
|
4903
4903
|
"s"
|
|
@@ -4919,25 +4919,25 @@ function sd({
|
|
|
4919
4919
|
onClose: n,
|
|
4920
4920
|
testId: r = "chart"
|
|
4921
4921
|
}) {
|
|
4922
|
-
const { t: i } = te(), [o, a] = B(e.categories), [s, d] = B(e.series.map((
|
|
4922
|
+
const { t: i } = te(), [o, a] = B(e.categories), [s, d] = B(e.series.map((b) => b.name)), [c, l] = B(
|
|
4923
4923
|
() => e.series.map(
|
|
4924
|
-
(
|
|
4925
|
-
(
|
|
4924
|
+
(b) => e.categories.map(
|
|
4925
|
+
(w, m) => b.values[m] == null ? "" : String(b.values[m])
|
|
4926
4926
|
)
|
|
4927
4927
|
)
|
|
4928
4928
|
), p = e.kind === "pie" || e.kind === "doughnut", h = c.some(
|
|
4929
|
-
(
|
|
4929
|
+
(b) => b.some((w) => w.trim() !== "" && !Number.isFinite(Number(w)))
|
|
4930
4930
|
), f = () => {
|
|
4931
4931
|
t({
|
|
4932
4932
|
categories: o,
|
|
4933
|
-
series: s.map((
|
|
4934
|
-
name:
|
|
4935
|
-
values: c[
|
|
4933
|
+
series: s.map((b, w) => ({
|
|
4934
|
+
name: b,
|
|
4935
|
+
values: c[w].map((m) => m.trim() === "" ? null : Number(m))
|
|
4936
4936
|
}))
|
|
4937
4937
|
}), n();
|
|
4938
|
-
}, g = (
|
|
4938
|
+
}, g = (b, w, m) => l(
|
|
4939
4939
|
(y) => y.map(
|
|
4940
|
-
(I,
|
|
4940
|
+
(I, N) => N === b ? I.map((E, Y) => Y === w ? m : E) : I
|
|
4941
4941
|
)
|
|
4942
4942
|
);
|
|
4943
4943
|
return /* @__PURE__ */ M(
|
|
@@ -4963,28 +4963,28 @@ function sd({
|
|
|
4963
4963
|
/* @__PURE__ */ u("div", { style: { maxHeight: 360, overflow: "auto" }, children: /* @__PURE__ */ M("table", { className: "kui-chart-data", children: [
|
|
4964
4964
|
/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ M("tr", { children: [
|
|
4965
4965
|
/* @__PURE__ */ u("th", {}),
|
|
4966
|
-
s.map((
|
|
4966
|
+
s.map((b, w) => /* @__PURE__ */ u("th", { children: /* @__PURE__ */ u(
|
|
4967
4967
|
"input",
|
|
4968
4968
|
{
|
|
4969
|
-
"aria-label": i("chartSeriesName", { n:
|
|
4970
|
-
value:
|
|
4969
|
+
"aria-label": i("chartSeriesName", { n: w + 1 }),
|
|
4970
|
+
value: b,
|
|
4971
4971
|
onChange: (m) => d(
|
|
4972
|
-
(y) => y.map((I,
|
|
4972
|
+
(y) => y.map((I, N) => N === w ? m.target.value : I)
|
|
4973
4973
|
),
|
|
4974
|
-
"data-testid": `${r}-data-series-${
|
|
4974
|
+
"data-testid": `${r}-data-series-${w}`
|
|
4975
4975
|
}
|
|
4976
|
-
) },
|
|
4976
|
+
) }, w))
|
|
4977
4977
|
] }) }),
|
|
4978
|
-
/* @__PURE__ */ u("tbody", { children: o.map((
|
|
4978
|
+
/* @__PURE__ */ u("tbody", { children: o.map((b, w) => /* @__PURE__ */ M("tr", { children: [
|
|
4979
4979
|
/* @__PURE__ */ u("th", { children: /* @__PURE__ */ u(
|
|
4980
4980
|
"input",
|
|
4981
4981
|
{
|
|
4982
|
-
"aria-label": i("chartCategoryName", { n:
|
|
4983
|
-
value:
|
|
4982
|
+
"aria-label": i("chartCategoryName", { n: w + 1 }),
|
|
4983
|
+
value: b,
|
|
4984
4984
|
onChange: (m) => a(
|
|
4985
|
-
(y) => y.map((I,
|
|
4985
|
+
(y) => y.map((I, N) => N === w ? m.target.value : I)
|
|
4986
4986
|
),
|
|
4987
|
-
"data-testid": `${r}-data-category-${
|
|
4987
|
+
"data-testid": `${r}-data-category-${w}`
|
|
4988
4988
|
}
|
|
4989
4989
|
) }),
|
|
4990
4990
|
s.map((m, y) => /* @__PURE__ */ u("td", { children: /* @__PURE__ */ u(
|
|
@@ -4993,25 +4993,25 @@ function sd({
|
|
|
4993
4993
|
inputMode: "decimal",
|
|
4994
4994
|
"aria-label": i("chartValue", {
|
|
4995
4995
|
series: s[y],
|
|
4996
|
-
category:
|
|
4996
|
+
category: b
|
|
4997
4997
|
}),
|
|
4998
|
-
"aria-invalid": c[y][
|
|
4999
|
-
value: c[y][
|
|
5000
|
-
onChange: (I) => g(y,
|
|
5001
|
-
"data-testid": `${r}-data-cell-${y}-${
|
|
4998
|
+
"aria-invalid": c[y][w].trim() !== "" && !Number.isFinite(Number(c[y][w])),
|
|
4999
|
+
value: c[y][w],
|
|
5000
|
+
onChange: (I) => g(y, w, I.target.value),
|
|
5001
|
+
"data-testid": `${r}-data-cell-${y}-${w}`
|
|
5002
5002
|
}
|
|
5003
5003
|
) }, y))
|
|
5004
|
-
] },
|
|
5004
|
+
] }, w)) })
|
|
5005
5005
|
] }) }),
|
|
5006
5006
|
/* @__PURE__ */ M("div", { style: { display: "flex", gap: 8, marginTop: 8 }, children: [
|
|
5007
5007
|
/* @__PURE__ */ u(
|
|
5008
5008
|
me,
|
|
5009
5009
|
{
|
|
5010
5010
|
onClick: () => {
|
|
5011
|
-
a((
|
|
5012
|
-
...
|
|
5013
|
-
i("chartCategoryText", { n:
|
|
5014
|
-
]), l((
|
|
5011
|
+
a((b) => [
|
|
5012
|
+
...b,
|
|
5013
|
+
i("chartCategoryText", { n: b.length + 1 })
|
|
5014
|
+
]), l((b) => b.map((w) => [...w, ""]));
|
|
5015
5015
|
},
|
|
5016
5016
|
"data-testid": `${r}-data-add-category`,
|
|
5017
5017
|
children: i("chartAddCategory")
|
|
@@ -5022,10 +5022,10 @@ function sd({
|
|
|
5022
5022
|
{
|
|
5023
5023
|
disabled: p,
|
|
5024
5024
|
onClick: () => {
|
|
5025
|
-
d((
|
|
5026
|
-
...
|
|
5027
|
-
i("chartSeriesText", { n:
|
|
5028
|
-
]), l((
|
|
5025
|
+
d((b) => [
|
|
5026
|
+
...b,
|
|
5027
|
+
i("chartSeriesText", { n: b.length + 1 })
|
|
5028
|
+
]), l((b) => [...b, o.map(() => "")]);
|
|
5029
5029
|
},
|
|
5030
5030
|
"data-testid": `${r}-data-add-series`,
|
|
5031
5031
|
children: i("chartAddSeries")
|
|
@@ -5036,7 +5036,7 @@ function sd({
|
|
|
5036
5036
|
{
|
|
5037
5037
|
disabled: o.length <= 1,
|
|
5038
5038
|
onClick: () => {
|
|
5039
|
-
a((
|
|
5039
|
+
a((b) => b.slice(0, -1)), l((b) => b.map((w) => w.slice(0, -1)));
|
|
5040
5040
|
},
|
|
5041
5041
|
"data-testid": `${r}-data-remove-category`,
|
|
5042
5042
|
children: i("chartRemoveCategory")
|
|
@@ -5047,7 +5047,7 @@ function sd({
|
|
|
5047
5047
|
{
|
|
5048
5048
|
disabled: s.length <= 1,
|
|
5049
5049
|
onClick: () => {
|
|
5050
|
-
d((
|
|
5050
|
+
d((b) => b.slice(0, -1)), l((b) => b.slice(0, -1));
|
|
5051
5051
|
},
|
|
5052
5052
|
"data-testid": `${r}-data-remove-series`,
|
|
5053
5053
|
children: i("chartRemoveSeries")
|
|
@@ -5060,10 +5060,10 @@ function sd({
|
|
|
5060
5060
|
}
|
|
5061
5061
|
const ld = 4e3;
|
|
5062
5062
|
function cd({ tool: e, onExit: t }) {
|
|
5063
|
-
const n = te(), r = Xe(), i =
|
|
5063
|
+
const n = te(), r = Xe(), i = we(), { undo: o } = Nn(), { host: a, t: s, testId: d, phrase: c } = n, l = r?.tools.find((w) => w.id === r.active), p = e ?? (l ? { label: c(l.label), icon: zi(l.icon, l.id) } : null), h = i.state("action:agent"), f = p?.icon, [g, b] = B(!0);
|
|
5064
5064
|
return J(() => {
|
|
5065
|
-
const
|
|
5066
|
-
return () => clearTimeout(
|
|
5065
|
+
const w = setTimeout(() => b(!1), ld);
|
|
5066
|
+
return () => clearTimeout(w);
|
|
5067
5067
|
}, []), /* @__PURE__ */ M("div", { className: "kui-focus-bar", role: "toolbar", "aria-label": s("focusBar"), "data-fresh": g || void 0, "data-testid": `${d}-focus-bar`, children: [
|
|
5068
5068
|
/* @__PURE__ */ M(me, { variant: "ghost", className: "kui-focus-exit", title: `${s("exitFocus")} (Esc)`, onClick: t, "data-testid": `${d}-focus-exit`, "data-kit-ui-id": "action:mode", children: [
|
|
5069
5069
|
/* @__PURE__ */ u(zs, { size: 16, strokeWidth: $e, "aria-hidden": "true" }),
|
|
@@ -5114,7 +5114,7 @@ function hd(e, t, n = () => !1) {
|
|
|
5114
5114
|
return r.map((i) => ({ label: i, children: io(e.filter((o) => o.path[0] === i), 1, t, n) })).filter((i) => i.children.length > 0 || n(i.label));
|
|
5115
5115
|
}
|
|
5116
5116
|
function fd({ row: e, checked: t, onKitCommand: n }) {
|
|
5117
|
-
const { phrase: r, testId: i } = te(), o =
|
|
5117
|
+
const { phrase: r, testId: i } = te(), o = we(), a = Ft(e.command);
|
|
5118
5118
|
o.declared;
|
|
5119
5119
|
const s = o.state(a, e.path);
|
|
5120
5120
|
return /* @__PURE__ */ u(le, { label: r(e.label), shortcut: e.shortcut, disabled: s.disabled, checked: t, onSelect: () => !s.denied && n?.(e.command), testId: `${i}-${a.replace(":", "-")}`, uiId: a });
|
|
@@ -5124,7 +5124,7 @@ function oo({ nodes: e, checked: t, onKitCommand: n, onCommand: r }) {
|
|
|
5124
5124
|
return /* @__PURE__ */ u(Ce, { children: e.map((o, a) => {
|
|
5125
5125
|
if (o.kind === "separator") return /* @__PURE__ */ u(Ae, {}, `---${a}`);
|
|
5126
5126
|
if (o.kind === "submenu")
|
|
5127
|
-
return /* @__PURE__ */ u(
|
|
5127
|
+
return /* @__PURE__ */ u(bc, { label: o.label, path: o.path, children: /* @__PURE__ */ u(oo, { nodes: o.children, checked: t, onKitCommand: n, onCommand: r }) }, `menu:${o.path}`);
|
|
5128
5128
|
const { row: s } = o, d = `${s.command}@${a}`;
|
|
5129
5129
|
return s.command.startsWith(Ke) ? /* @__PURE__ */ u(fd, { row: s, checked: t?.(s.command), onKitCommand: n }, d) : /* @__PURE__ */ u(cc, { command: s.command, path: s.path, label: i(s.label), shortcut: s.shortcut ?? void 0, checked: t?.(s.command), onRun: r }, d);
|
|
5130
5130
|
}) });
|
|
@@ -5137,7 +5137,7 @@ function md({ tree: e, nodes: t }) {
|
|
|
5137
5137
|
] });
|
|
5138
5138
|
}
|
|
5139
5139
|
function pd(e) {
|
|
5140
|
-
const { byId: t } = te(), { config: n, sessionHidden: r } =
|
|
5140
|
+
const { byId: t } = te(), { config: n, sessionHidden: r } = we(), i = R(/* @__PURE__ */ new WeakMap());
|
|
5141
5141
|
return pe(() => {
|
|
5142
5142
|
const o = /* @__PURE__ */ new Map(), a = (s) => Li(n, `menu:${s}`).length > 0 && !Se(n, `menu:${s}`).hidden;
|
|
5143
5143
|
for (const s of e) {
|
|
@@ -5159,11 +5159,11 @@ function pd(e) {
|
|
|
5159
5159
|
}
|
|
5160
5160
|
const Ze = (e) => e.flatMap((t) => t.kind === "row" ? [t.row] : t.kind === "submenu" ? Ze(t.children) : []), gd = 5;
|
|
5161
5161
|
function Mr({ row: e, tree: t, primary: n }) {
|
|
5162
|
-
const r = te(), i =
|
|
5162
|
+
const r = te(), i = we(), { byId: o, phrase: a, testId: s } = r, d = a(e.label);
|
|
5163
5163
|
if (e.command.startsWith(Ke)) {
|
|
5164
5164
|
const h = Ft(e.command), f = i.state(h, e.path), g = Ge({ id: e.command.slice(Ke.length), title: e.label });
|
|
5165
5165
|
return /* @__PURE__ */ u(
|
|
5166
|
-
|
|
5166
|
+
be,
|
|
5167
5167
|
{
|
|
5168
5168
|
icon: g,
|
|
5169
5169
|
lineLabel: g === at,
|
|
@@ -5179,7 +5179,7 @@ function Mr({ row: e, tree: t, primary: n }) {
|
|
|
5179
5179
|
}
|
|
5180
5180
|
const c = o.get(e.command), l = i.state(`command:${e.command}`, e.path), p = Ge(c ?? { id: e.command, title: e.label });
|
|
5181
5181
|
return /* @__PURE__ */ u(
|
|
5182
|
-
|
|
5182
|
+
be,
|
|
5183
5183
|
{
|
|
5184
5184
|
icon: p,
|
|
5185
5185
|
lineLabel: p === at,
|
|
@@ -5188,16 +5188,16 @@ function Mr({ row: e, tree: t, primary: n }) {
|
|
|
5188
5188
|
pressed: t.checked?.(e.command),
|
|
5189
5189
|
disabled: !r.enabled(e.command) || l.disabled,
|
|
5190
5190
|
onClick: () => {
|
|
5191
|
-
t.onCommand && !(c &&
|
|
5191
|
+
t.onCommand && !(c && Pt(c)) ? t.onCommand(e.command) : r.run(e.command);
|
|
5192
5192
|
},
|
|
5193
5193
|
"data-testid": `${s}-cmd-${e.command}`,
|
|
5194
5194
|
"data-kit-ui-id": `command:${e.command}`
|
|
5195
5195
|
}
|
|
5196
5196
|
);
|
|
5197
5197
|
}
|
|
5198
|
-
function
|
|
5199
|
-
const { byId: n, phrase: r } = te(), i =
|
|
5200
|
-
const g = f.find((
|
|
5198
|
+
function bd({ tab: e, nodes: t }) {
|
|
5199
|
+
const { byId: n, phrase: r } = te(), i = Nn(), o = /* @__PURE__ */ new Set([...i.undo.hidden ? [] : ["edit.undo"], ...i.redo.hidden ? [] : ["edit.redo"]]), a = (f) => f.filter((g) => !o.has(g.command)), s = (f) => {
|
|
5200
|
+
const g = f.find((b) => b.command !== "---");
|
|
5201
5201
|
return g ? Ge(n.get(g.command) ?? { id: g.command.replace(Ke, ""), title: g.label }) : void 0;
|
|
5202
5202
|
}, d = e.menu;
|
|
5203
5203
|
if (!d) return null;
|
|
@@ -5206,16 +5206,16 @@ function wd({ tab: e, nodes: t }) {
|
|
|
5206
5206
|
c.length || d.before?.length ? /* @__PURE__ */ u(Me, { id: `menu:${e.id}`, label: e.label, icon: s(c), children: /* @__PURE__ */ M("div", { className: "kui-command-grid", children: [
|
|
5207
5207
|
d.before?.map((f) => {
|
|
5208
5208
|
const g = f.icon ?? Ge({ id: f.testId ?? f.label, title: f.label });
|
|
5209
|
-
return /* @__PURE__ */ u(
|
|
5209
|
+
return /* @__PURE__ */ u(be, { icon: g, lineLabel: !f.icon && g === at, primary: f.primary, label: f.label, onClick: f.onSelect, "data-testid": f.testId }, f.label);
|
|
5210
5210
|
}),
|
|
5211
5211
|
c.map((f, g) => /* @__PURE__ */ u(Mr, { row: f, tree: d, primary: h(f) }, `${f.command}@${g}`))
|
|
5212
5212
|
] }) }) : null,
|
|
5213
|
-
l.map((f) => /* @__PURE__ */ u(Me, { id: `menu:${f.path}`, label: r(f.label), icon: s(a(Ze(f.children))), children: /* @__PURE__ */ u("div", { className: "kui-command-grid", children: a(Ze(f.children)).map((g,
|
|
5213
|
+
l.map((f) => /* @__PURE__ */ u(Me, { id: `menu:${f.path}`, label: r(f.label), icon: s(a(Ze(f.children))), children: /* @__PURE__ */ u("div", { className: "kui-command-grid", children: a(Ze(f.children)).map((g, b) => /* @__PURE__ */ u(Mr, { row: g, tree: d, primary: h(g) }, `${g.command}@${b}`)) }) }, f.path))
|
|
5214
5214
|
] });
|
|
5215
5215
|
}
|
|
5216
|
-
const Tr = { menus: Bs, line: Mi, classic: yi, focus: Ai }, Ar = () =>
|
|
5217
|
-
function
|
|
5218
|
-
const { t: r, testId: i } = te(), a =
|
|
5216
|
+
const Tr = { menus: Bs, line: Mi, classic: yi, focus: Ai }, Ar = () => Nt() ? "Cmd+\\" : "Ctrl+\\";
|
|
5217
|
+
function wd({ display: e, shown: t, areas: n = !0 }) {
|
|
5218
|
+
const { t: r, testId: i } = te(), a = we().state("action:mode");
|
|
5219
5219
|
if (a.hidden || e.allowed.length < 2) return null;
|
|
5220
5220
|
if (!n) {
|
|
5221
5221
|
const l = `${r("mode_focus")} (${Ar()})`;
|
|
@@ -5300,14 +5300,14 @@ function Cd(e, t, n, r) {
|
|
|
5300
5300
|
(l, p) => {
|
|
5301
5301
|
const h = e.current;
|
|
5302
5302
|
if (!p || !h || typeof ResizeObserver > "u") return;
|
|
5303
|
-
const f = h.getBoundingClientRect().width, g = p.scrollWidth - p.clientWidth,
|
|
5304
|
-
s((
|
|
5305
|
-
const m =
|
|
5303
|
+
const f = h.getBoundingClientRect().width, g = p.scrollWidth - p.clientWidth, b = `${l}:${n}`;
|
|
5304
|
+
s((w) => {
|
|
5305
|
+
const m = w.get(b);
|
|
5306
5306
|
if (g > 1) {
|
|
5307
5307
|
const y = Math.ceil(f + g);
|
|
5308
|
-
return m !== void 0 && Math.abs(m - y) <= 1 ?
|
|
5308
|
+
return m !== void 0 && Math.abs(m - y) <= 1 ? w : new Map(w).set(b, y);
|
|
5309
5309
|
}
|
|
5310
|
-
return m === void 0 || m <= f ?
|
|
5310
|
+
return m === void 0 || m <= f ? w : new Map(w).set(b, Math.floor(f));
|
|
5311
5311
|
});
|
|
5312
5312
|
},
|
|
5313
5313
|
[e, n]
|
|
@@ -5356,7 +5356,7 @@ function Td({ tabs: e, active: t, onTab: n }) {
|
|
|
5356
5356
|
const p = (f) => `${f.id}
|
|
5357
5357
|
${f.label}`;
|
|
5358
5358
|
for (const f of l.querySelectorAll(".kui-ribbon-tab")) {
|
|
5359
|
-
const g = e.find((
|
|
5359
|
+
const g = e.find((b) => b.id === f.dataset.tab);
|
|
5360
5360
|
g && !f.hidden && o.current.set(p(g), f.offsetWidth);
|
|
5361
5361
|
}
|
|
5362
5362
|
const h = e.every((f) => o.current.has(p(f))) ? Md(
|
|
@@ -5389,7 +5389,7 @@ function Ad(e, t) {
|
|
|
5389
5389
|
return e === null || t === null ? e === t : e.size === t.size && [...e].every((n) => t.has(n));
|
|
5390
5390
|
}
|
|
5391
5391
|
function Ed({ tab: e }) {
|
|
5392
|
-
const [t, n] = B(!1), r = R(null), i =
|
|
5392
|
+
const [t, n] = B(!1), r = R(null), i = we(), { t: o } = te(), a = i.state(Ye(e));
|
|
5393
5393
|
return /* @__PURE__ */ M("span", { ref: r, style: { display: "inline-flex" }, children: [
|
|
5394
5394
|
/* @__PURE__ */ u("button", { type: "button", className: "kui-menu-bar-item", "aria-expanded": t, "aria-haspopup": "dialog", onClick: () => n((s) => !s), "data-testid": `ribbon-tab-${e.id}`, "data-kit-ui-id": Ye(e), children: e.label }),
|
|
5395
5395
|
/* @__PURE__ */ u(Eo, { open: t, anchor: r, onClose: () => n(!1), label: e.label, className: "kui-drop-ribbon", testId: `ribbon-drop-${e.id}`, children: /* @__PURE__ */ u(Et, { className: "kui-drop-ribbon-strip", panelClassName: "kui-ribbon-panel", resetKey: e.id, labels: { start: o("ribbonScrollStart"), end: o("ribbonScrollEnd") }, testId: `ribbon-drop-${e.id}-scroll`, children: /* @__PURE__ */ u("fieldset", { className: "kui-element", disabled: a.disabled, children: /* @__PURE__ */ u(vt.Provider, { value: "full", children: e.ribbon }) }) }) })
|
|
@@ -5428,8 +5428,8 @@ function Ld(e) {
|
|
|
5428
5428
|
function Lr(e) {
|
|
5429
5429
|
return Fn(e).reduce((t, n) => t + n.offsetWidth, 0);
|
|
5430
5430
|
}
|
|
5431
|
-
function
|
|
5432
|
-
const { t: o } = te(), a =
|
|
5431
|
+
function Nd({ mode: e, tab: t, nodes: n, panel: r, measure: i }) {
|
|
5432
|
+
const { t: o } = te(), a = we(), s = t.ribbon ?? (t.menu ? /* @__PURE__ */ u(bd, { tab: t, nodes: n }) : null), d = H((y) => o("lineMore", { group: y }), [o]), c = e === "line", l = `${e}:${t.id}`, [p, h] = B({ key: l, level: 0, groups: [], fresh: 0 }), f = p.key === l ? p.level : 0, g = p.key === l ? p.groups : [], b = pe(() => c ? mn : Rd(f, g), [g, f, c]), w = R({ width: 0, content: 0 }), m = R(null);
|
|
5433
5433
|
return Te(() => {
|
|
5434
5434
|
const y = r.current;
|
|
5435
5435
|
if (!c && y) {
|
|
@@ -5438,7 +5438,7 @@ function Pd({ mode: e, tab: t, nodes: n, panel: r, measure: i }) {
|
|
|
5438
5438
|
h((Y) => ({ key: l, level: f + 1, groups: I, fresh: Y.fresh }));
|
|
5439
5439
|
return;
|
|
5440
5440
|
}
|
|
5441
|
-
|
|
5441
|
+
w.current = { width: y.clientWidth, content: Lr(y) };
|
|
5442
5442
|
const E = m.current;
|
|
5443
5443
|
if (E) {
|
|
5444
5444
|
E.disconnect(), E.observe(y);
|
|
@@ -5450,44 +5450,44 @@ function Pd({ mode: e, tab: t, nodes: n, panel: r, measure: i }) {
|
|
|
5450
5450
|
const y = r.current;
|
|
5451
5451
|
if (c || !y || typeof ResizeObserver > "u") return;
|
|
5452
5452
|
const I = new ResizeObserver(() => {
|
|
5453
|
-
const
|
|
5454
|
-
(y.clientWidth >
|
|
5453
|
+
const N = w.current;
|
|
5454
|
+
(y.clientWidth > N.width + 1 || Math.abs(Lr(y) - N.content) > 1) && h((E) => ({ key: l, level: 0, groups: E.groups, fresh: E.fresh + 1 }));
|
|
5455
5455
|
});
|
|
5456
5456
|
return m.current = I, I.observe(y), () => {
|
|
5457
5457
|
I.disconnect(), m.current = null;
|
|
5458
5458
|
};
|
|
5459
|
-
}, [l, c, r]), s ? /* @__PURE__ */ u(Et, { className: c ? "kui-line" : "kui-ribbon-body", panelClassName: c ? "kui-line-panel" : "kui-ribbon-panel", role: "tabpanel", resetKey: t.id, labels: { start: o("ribbonScrollStart"), end: o("ribbonScrollEnd") }, testId: "ribbon-scroll", panelRef: r, children: /* @__PURE__ */ u("fieldset", { className: "kui-element", disabled: a.state(Ye(t)).disabled, children: /* @__PURE__ */ u(Ao.Provider, { value: d, children: /* @__PURE__ */ u(vt.Provider, { value: c ? "line" : "full", children: /* @__PURE__ */ u(Yt.Provider, { value:
|
|
5459
|
+
}, [l, c, r]), s ? /* @__PURE__ */ u(Et, { className: c ? "kui-line" : "kui-ribbon-body", panelClassName: c ? "kui-line-panel" : "kui-ribbon-panel", role: "tabpanel", resetKey: t.id, labels: { start: o("ribbonScrollStart"), end: o("ribbonScrollEnd") }, testId: "ribbon-scroll", panelRef: r, children: /* @__PURE__ */ u("fieldset", { className: "kui-element", disabled: a.state(Ye(t)).disabled, children: /* @__PURE__ */ u(Ao.Provider, { value: d, children: /* @__PURE__ */ u(vt.Provider, { value: c ? "line" : "full", children: /* @__PURE__ */ u(Yt.Provider, { value: b, children: s }) }) }) }) }) : null;
|
|
5460
5460
|
}
|
|
5461
5461
|
function Bu({ tabs: e, tab: t, onTab: n, defaultTab: r, title: i, actions: o, options: a, rail: s, sidebar: d, panels: c, focusTool: l, statusBar: p = !0, children: h, ...f }) {
|
|
5462
|
-
const g = te(), { host:
|
|
5462
|
+
const g = te(), { host: b, phrase: w, testId: m } = g, y = we(), I = R(null), N = R(null), E = b.readOnly === !0, Y = xd(), q = y.config.add, V = pe(() => {
|
|
5463
5463
|
if (!e.some((G) => G.menu)) return e;
|
|
5464
|
-
const
|
|
5465
|
-
return
|
|
5466
|
-
}, [q,
|
|
5467
|
-
(
|
|
5468
|
-
fe(
|
|
5464
|
+
const P = q.map((G) => G.place).filter((G) => G.startsWith("menu:") && !G.includes("/")).map((G) => G.slice(5)).filter((G, ue, ye) => ye.indexOf(G) === ue && !e.some((Ie) => Ie.id === G));
|
|
5465
|
+
return P.length ? [...e, ...P.map((G) => ({ id: G, label: w(G), menu: { rows: [] } }))] : e;
|
|
5466
|
+
}, [q, w, e]), j = pd(V), D = V.filter((P) => y.state(Ye(P)).hidden || E && !P.view ? !1 : !P.menu || P.ribbon ? !0 : (j.get(P.id)?.length ?? 0) > 0 || (P.menu.before?.length ?? 0) > 0 || y.buttons(`menu:${P.id}`).length > 0), Z = Sd(b, D.length > 0), [Q, fe] = B(r ?? null), ce = t ?? Q, k = D.find((P) => P.id === ce) ?? D.find((P) => P.id === r) ?? D.find((P) => P.id.toLowerCase() !== "file") ?? D[0] ?? null, O = k?.id ?? null, U = H(
|
|
5467
|
+
(P) => {
|
|
5468
|
+
fe(P), n?.(P);
|
|
5469
5469
|
},
|
|
5470
5470
|
[n]
|
|
5471
5471
|
);
|
|
5472
5472
|
Te(() => {
|
|
5473
5473
|
t !== void 0 && O !== null && O !== t && n?.(O);
|
|
5474
5474
|
}, [O, n, t]);
|
|
5475
|
-
const x = Cd(I, Z.chosen, O ?? "", Z.allowed), C = Z.focus ? "focus" : x.effective, W = (
|
|
5475
|
+
const x = Cd(I, Z.chosen, O ?? "", Z.allowed), C = Z.focus ? "focus" : x.effective, W = (P) => (Nt() ? P.metaKey : P.ctrlKey) && !P.shiftKey && !P.altKey && P.code === "Backslash" ? !Z.allowed.includes("focus") || y.state("action:mode").denied ? !1 : (Z.toggleFocus(), !0) : !1, _ = () => Z.focus ? (Z.exitFocus(), !0) : !1, T = C === "focus", K = R(T);
|
|
5476
5476
|
Te(() => {
|
|
5477
5477
|
if (K.current === T) return;
|
|
5478
5478
|
K.current = T;
|
|
5479
|
-
const
|
|
5480
|
-
if (
|
|
5479
|
+
const P = document.activeElement;
|
|
5480
|
+
if (P && P !== document.body && P.isConnected) return;
|
|
5481
5481
|
((T ? null : I.current?.querySelector(".kui-mode-button")) ?? I.current)?.focus({ preventScroll: !0 });
|
|
5482
5482
|
}, [T]);
|
|
5483
5483
|
const ne = T ? /* @__PURE__ */ u(cd, { tool: l, onExit: Z.exitFocus }) : /* @__PURE__ */ M(Ce, { children: [
|
|
5484
5484
|
/* @__PURE__ */ M("div", { className: "kui-frame-top", "data-testid": `${m}-top-bar`, children: [
|
|
5485
5485
|
i ? /* @__PURE__ */ u("div", { className: "kui-frame-title", children: i }) : null,
|
|
5486
5486
|
C === "menus" ? /* @__PURE__ */ u(Od, { tabs: D, menus: j }) : /* @__PURE__ */ u(Td, { tabs: D, active: O, onTab: U }),
|
|
5487
|
-
/* @__PURE__ */ u("div", { className: "kui-ribbon-end", children: /* @__PURE__ */ u(fc, { before: o, mode: /* @__PURE__ */ u(
|
|
5487
|
+
/* @__PURE__ */ u("div", { className: "kui-ribbon-end", children: /* @__PURE__ */ u(fc, { before: o, mode: /* @__PURE__ */ u(wd, { display: Z, shown: C, areas: D.length > 0 }) }) })
|
|
5488
5488
|
] }),
|
|
5489
|
-
(C === "line" || C === "classic") && k ? /* @__PURE__ */ u(
|
|
5490
|
-
a ? /* @__PURE__ */ u(
|
|
5489
|
+
(C === "line" || C === "classic") && k ? /* @__PURE__ */ u(Nd, { mode: C, tab: k, nodes: j.get(k.id) ?? [], panel: N, measure: x.measure }) : null,
|
|
5490
|
+
a ? /* @__PURE__ */ u(wc, { children: a }) : null
|
|
5491
5491
|
] });
|
|
5492
5492
|
return /* @__PURE__ */ u(ao.Provider, { value: C, children: /* @__PURE__ */ u(so.Provider, { value: Z, children: /* @__PURE__ */ u(pc, { ...f, statusBar: p && !T, top: ne, frame: { ref: I, mode: C, chosen: Z.chosen, touch: Y, viewOnly: E, keyDown: W, escape: _ }, children: /* @__PURE__ */ M("div", { className: "kui-frame-body", children: [
|
|
5493
5493
|
s && !E && !T ? s : null,
|
|
@@ -5496,8 +5496,8 @@ function Bu({ tabs: e, tab: t, onTab: n, defaultTab: r, title: i, actions: o, op
|
|
|
5496
5496
|
c && !T ? c : null
|
|
5497
5497
|
] }) }) }) });
|
|
5498
5498
|
}
|
|
5499
|
-
const
|
|
5500
|
-
function
|
|
5499
|
+
const Pd = new ArrayBuffer(0);
|
|
5500
|
+
function Nr(e) {
|
|
5501
5501
|
return e.slice().buffer;
|
|
5502
5502
|
}
|
|
5503
5503
|
function Fd(e) {
|
|
@@ -5519,13 +5519,13 @@ class _u {
|
|
|
5519
5519
|
push() {
|
|
5520
5520
|
this.enqueue(async () => {
|
|
5521
5521
|
const t = this.page.replica(), n = t.version();
|
|
5522
|
-
this.pushed.includes(n) || (await this.engine.importChanges(
|
|
5522
|
+
this.pushed.includes(n) || (await this.engine.importChanges(Nr(t.exportChanges(this.pushed)), Pd), this.pushed = n);
|
|
5523
5523
|
});
|
|
5524
5524
|
}
|
|
5525
5525
|
/** Takes the worker's changes the page does not have yet. */
|
|
5526
5526
|
pull() {
|
|
5527
5527
|
this.enqueue(async () => {
|
|
5528
|
-
const t = this.page.replica(), { changes: n } = await this.engine.exportChanges(
|
|
5528
|
+
const t = this.page.replica(), { changes: n } = await this.engine.exportChanges(Nr(t.version().encode()));
|
|
5529
5529
|
if (this.closed || this.page.replica() !== t) return;
|
|
5530
5530
|
const r = t.version(), i = this.pushed.includes(r), o = new Uint8Array(n);
|
|
5531
5531
|
this.page.importChanges ? this.page.importChanges(o) : t.importChanges(o), i && (this.pushed = t.version()), t.version().equals(r) || this.pulled();
|
|
@@ -5587,7 +5587,7 @@ function Bd(e, t, n, r, i) {
|
|
|
5587
5587
|
const d = e.measureText(r).width + o.padX * 2, c = o.height ?? Math.round(zd(a) * 1.2) + o.padY * 2, l = o.align === "center" ? t - d / 2 : t;
|
|
5588
5588
|
e.fillStyle = s, e.beginPath(), e.roundRect(l, n, d, c, o.radius), e.fill(), e.fillStyle = o.color ?? (s === i.surface ? i.ink : i.surface), e.textBaseline = "middle", e.fillText(r, l + o.padX, n + c / 2);
|
|
5589
5589
|
}
|
|
5590
|
-
function
|
|
5590
|
+
function Pr(e, t, n, r, i) {
|
|
5591
5591
|
switch (r.kind) {
|
|
5592
5592
|
case "marquee": {
|
|
5593
5593
|
const o = i.marquee, a = t(r.x0, r.y0), s = t(r.x1, r.y1);
|
|
@@ -5663,11 +5663,11 @@ function _d(e, t = hn, n) {
|
|
|
5663
5663
|
n && (l = n(s, { context: r, toScreen: i, view: o, style: t, overlays: e, index: d, frame: a, drawDefault: (h = s) => {
|
|
5664
5664
|
r.save();
|
|
5665
5665
|
try {
|
|
5666
|
-
c(),
|
|
5666
|
+
c(), Pr(r, i, o, h, t);
|
|
5667
5667
|
} finally {
|
|
5668
5668
|
r.restore();
|
|
5669
5669
|
}
|
|
5670
|
-
} }) === !0), l || (r.restore(), r.save(), c(),
|
|
5670
|
+
} }) === !0), l || (r.restore(), r.save(), c(), Pr(r, i, o, s, t));
|
|
5671
5671
|
} finally {
|
|
5672
5672
|
r.restore();
|
|
5673
5673
|
}
|
|
@@ -5682,26 +5682,26 @@ const Hd = /* @__PURE__ */ new Set(["Delete", "Backspace"]), Fr = /* @__PURE__ *
|
|
|
5682
5682
|
function Ku(e, t, n, r) {
|
|
5683
5683
|
const [i, o] = B([]), [a, s] = B(r.initial), [d, c] = B(() => Kd), [l, p] = B(null), [h, f] = B(null), g = R(r);
|
|
5684
5684
|
g.current = r;
|
|
5685
|
-
const
|
|
5686
|
-
|
|
5687
|
-
const
|
|
5685
|
+
const b = R(d);
|
|
5686
|
+
b.current = d;
|
|
5687
|
+
const w = R(0), m = R(null), [y, I] = B(0), N = R(r.initial), E = R(null), Y = Object.keys(r.hostTools ?? {}).find((v) => r.hostTools?.[v] === Re) ?? Re.id;
|
|
5688
5688
|
let q = a;
|
|
5689
5689
|
d(a) && (q = i.find((v) => !r.hidden?.has(v.id) && !d(v.id))?.id ?? Y, i.length && q !== a && s(q));
|
|
5690
5690
|
const V = r.hostTools?.[q] ?? (q === Re.id && !i.some((v) => v.id === q) ? Re : void 0);
|
|
5691
|
-
|
|
5691
|
+
N.current = q;
|
|
5692
5692
|
const j = R(/* @__PURE__ */ new Set());
|
|
5693
5693
|
j.current = new Set(Object.keys(r.hostTools ?? {})), i.some((v) => v.id === Re.id) || j.current.add(Re.id);
|
|
5694
5694
|
const D = H((v) => {
|
|
5695
|
-
if (
|
|
5696
|
-
const z = ++
|
|
5697
|
-
m.current = z,
|
|
5695
|
+
if (b.current(v)) return;
|
|
5696
|
+
const z = ++w.current;
|
|
5697
|
+
m.current = z, N.current = v, I(z), s(v);
|
|
5698
5698
|
}, []), Z = H((v) => c(() => v), []), Q = R(1), fe = R(null), ce = R(!1), k = R([]), O = R(null), U = H((v, z) => {
|
|
5699
5699
|
if (!v) return;
|
|
5700
5700
|
O.current = v, p(v);
|
|
5701
5701
|
let S = null;
|
|
5702
5702
|
for (const $ of v.requests)
|
|
5703
|
-
$.kind === "switchTool" ? (m.current === null || z === m.current) && !
|
|
5704
|
-
S !== null && S !==
|
|
5703
|
+
$.kind === "switchTool" ? (m.current === null || z === m.current) && !b.current($.id) && (S = $.id) : $.kind === "status" ? f($.text) : g.current.onDialog?.($.name, $.params);
|
|
5704
|
+
S !== null && S !== N.current && (N.current = S, E.current = { id: S, serial: w.current }, j.current.has(S) || k.current.unshift({ name: "selectTool", args: [S, Q.current], settled: !0, coalesce: !1, selection: z }), s(S));
|
|
5705
5705
|
}, []), x = R(!1), C = R(null), W = H((v, z) => {
|
|
5706
5706
|
const S = document.activeElement ?? document.body;
|
|
5707
5707
|
x.current = !0, C.current = 0;
|
|
@@ -5737,20 +5737,20 @@ function Ku(e, t, n, r) {
|
|
|
5737
5737
|
}, [_, T]), ne = H((v) => !ce.current && !k.current.length ? v() : new Promise((z, S) => {
|
|
5738
5738
|
_({ work: () => v().then(z, S) }), T();
|
|
5739
5739
|
}), [_, T]);
|
|
5740
|
-
J(() =>
|
|
5740
|
+
J(() => bl(e, ne), [ne, e]), J(() => {
|
|
5741
5741
|
t && e("tools").then((v) => o(v ?? []));
|
|
5742
5742
|
}, [t, e]);
|
|
5743
|
-
const
|
|
5743
|
+
const P = !!V;
|
|
5744
5744
|
J(() => {
|
|
5745
5745
|
if (!t) {
|
|
5746
5746
|
E.current = null;
|
|
5747
5747
|
return;
|
|
5748
5748
|
}
|
|
5749
|
-
if (
|
|
5749
|
+
if (P) return;
|
|
5750
5750
|
const v = E.current;
|
|
5751
5751
|
E.current = null, !(v?.id === q && v.serial === y) && K("selectTool", [q, Q.current], !0, !1, y);
|
|
5752
|
-
}, [q,
|
|
5753
|
-
if (!t ||
|
|
5752
|
+
}, [q, P, t, y, K]), J(() => {
|
|
5753
|
+
if (!t || P) return;
|
|
5754
5754
|
const v = fe.current ?? { x: 0, y: 0 };
|
|
5755
5755
|
K("toolState", [v.x, v.y, "{}", Q.current], !1, !0);
|
|
5756
5756
|
}, [n.revision, t]);
|
|
@@ -5768,12 +5768,12 @@ function Ku(e, t, n, r) {
|
|
|
5768
5768
|
}),
|
|
5769
5769
|
hover: (v, { viewport: z }) => G("move", v, z.view.zoom, !1, !0),
|
|
5770
5770
|
doubleClick: (v, { viewport: z }) => G("doubleClick", v, z.view.zoom, !0)
|
|
5771
|
-
}, [q, V, G, l?.cursor, K]), ye = l?.overlays, { overlayStyle: Ie, drawOverlay:
|
|
5771
|
+
}, [q, V, G, l?.cursor, K]), ye = l?.overlays, { overlayStyle: Ie, drawOverlay: Ne } = r, We = Ud(), A = pe(() => {
|
|
5772
5772
|
const v = Wd(Ie);
|
|
5773
5773
|
return We && !Ie?.accent ? { ...v, accent: We } : v;
|
|
5774
5774
|
}, [We, Ie]), L = pe(
|
|
5775
|
-
() => ye?.length && !V ? Jl(_d(ye, A,
|
|
5776
|
-
[
|
|
5775
|
+
() => ye?.length && !V ? Jl(_d(ye, A, Ne)) : null,
|
|
5776
|
+
[Ne, V, ye, A]
|
|
5777
5777
|
), re = H((v) => {
|
|
5778
5778
|
if (V || !v.shiftKey && !v.altKey && !v.metaKey && !v.ctrlKey && v.key === "Escape" && g.current.escapable && !g.current.escapable()) return !1;
|
|
5779
5779
|
const S = v.metaKey || v.ctrlKey, $ = v.key.length === 1 || Hd.has(v.key);
|
|
@@ -5794,14 +5794,14 @@ function Ku(e, t, n, r) {
|
|
|
5794
5794
|
const X = F.findIndex((ee) => ee.id === q);
|
|
5795
5795
|
return F[(X + 1) % F.length].id;
|
|
5796
5796
|
}, [q, i]), ae = H(() => {
|
|
5797
|
-
if (
|
|
5797
|
+
if (P) return;
|
|
5798
5798
|
const v = fe.current ?? { x: 0, y: 0 };
|
|
5799
5799
|
K("toolState", [v.x, v.y, "{}", Q.current], !1, !0);
|
|
5800
|
-
}, [
|
|
5801
|
-
if (!Number.isFinite(v) || v <= 0 || Math.abs(v - Q.current) < 1e-9 || (Q.current = v, !t ||
|
|
5800
|
+
}, [P, K]), se = H((v) => {
|
|
5801
|
+
if (!Number.isFinite(v) || v <= 0 || Math.abs(v - Q.current) < 1e-9 || (Q.current = v, !t || P || !O.current)) return;
|
|
5802
5802
|
const z = fe.current ?? { x: 0, y: 0 };
|
|
5803
5803
|
K("toolState", [z.x, z.y, "{}", v], !1, !0);
|
|
5804
|
-
}, [
|
|
5804
|
+
}, [P, t, K]), ge = H((v) => {
|
|
5805
5805
|
v && K("toolText", [v, Q.current], !0);
|
|
5806
5806
|
}, [K]);
|
|
5807
5807
|
return {
|
|
@@ -5887,7 +5887,7 @@ function Vd(e) {
|
|
|
5887
5887
|
let n = zr;
|
|
5888
5888
|
const r = /* @__PURE__ */ new Set();
|
|
5889
5889
|
t && e.peer.on("presence/peers", (c) => {
|
|
5890
|
-
const l =
|
|
5890
|
+
const l = bo(c?.peers);
|
|
5891
5891
|
n = l.length ? l : zr;
|
|
5892
5892
|
for (const p of [...r]) p();
|
|
5893
5893
|
});
|
|
@@ -5902,7 +5902,7 @@ function Vd(e) {
|
|
|
5902
5902
|
subscribe: (c) => (r.add(c), () => r.delete(c)),
|
|
5903
5903
|
set: (c) => {
|
|
5904
5904
|
if (!t) return;
|
|
5905
|
-
const l =
|
|
5905
|
+
const l = wo(c);
|
|
5906
5906
|
if (!l) return;
|
|
5907
5907
|
const p = o + Yd - Date.now();
|
|
5908
5908
|
if (p <= 0 && !s) {
|
|
@@ -6087,8 +6087,8 @@ function Vu(e) {
|
|
|
6087
6087
|
/* @__PURE__ */ u("span", { style: ve.author, children: d(g.author, g.name) }),
|
|
6088
6088
|
/* @__PURE__ */ u("span", { style: ve.muted, children: s(g.created) }),
|
|
6089
6089
|
/* @__PURE__ */ u("span", { style: { flex: 1 } }),
|
|
6090
|
-
h && g.author === r ? /* @__PURE__ */ u(De, { icon: rt, label: t.delete, "data-testid": `${n}-delete`, onClick: (
|
|
6091
|
-
|
|
6090
|
+
h && g.author === r ? /* @__PURE__ */ u(De, { icon: rt, label: t.delete, "data-testid": `${n}-delete`, onClick: (b) => {
|
|
6091
|
+
b.stopPropagation(), e.onDelete(c.id, g.id);
|
|
6092
6092
|
} }) : null
|
|
6093
6093
|
] }),
|
|
6094
6094
|
/* @__PURE__ */ u("div", { style: ve.body, children: g.body })
|
|
@@ -6166,7 +6166,7 @@ export {
|
|
|
6166
6166
|
sh as BarSeparator,
|
|
6167
6167
|
lh as Button,
|
|
6168
6168
|
no as CHART_FORMATS,
|
|
6169
|
-
|
|
6169
|
+
Pn as CHART_KINDS,
|
|
6170
6170
|
Qc as CHART_MARKERS,
|
|
6171
6171
|
at as COMMAND_FALLBACK_ICON,
|
|
6172
6172
|
Qd as COMMENTS_PANEL_LABELS,
|
|
@@ -6175,18 +6175,18 @@ export {
|
|
|
6175
6175
|
uh as CardHeader,
|
|
6176
6176
|
id as ChartAxisDialog,
|
|
6177
6177
|
sd as ChartDataDialog,
|
|
6178
|
-
|
|
6179
|
-
|
|
6178
|
+
Pu as ChartDesignGroups,
|
|
6179
|
+
Nu as ChartInsertMenu,
|
|
6180
6180
|
od as ChartSeriesDialog,
|
|
6181
6181
|
hh as Checkbox,
|
|
6182
6182
|
fh as Choice,
|
|
6183
6183
|
mh as ColorGrid,
|
|
6184
6184
|
ph as ColorPicker,
|
|
6185
6185
|
gh as ColorWheel,
|
|
6186
|
-
|
|
6186
|
+
bh as Command,
|
|
6187
6187
|
lc as CommandButton,
|
|
6188
6188
|
Ol as CommandDialog,
|
|
6189
|
-
|
|
6189
|
+
wh as CommandEmpty,
|
|
6190
6190
|
yh as CommandGroup,
|
|
6191
6191
|
uc as CommandGroupButtons,
|
|
6192
6192
|
vh as CommandInput,
|
|
@@ -6216,14 +6216,14 @@ export {
|
|
|
6216
6216
|
Oh as EyeButton,
|
|
6217
6217
|
Gs as FILE_CHUNK_BYTES,
|
|
6218
6218
|
Rh as Field,
|
|
6219
|
-
|
|
6219
|
+
wl as FileChangedError,
|
|
6220
6220
|
Dh as FloatingPanels,
|
|
6221
6221
|
zu as FrameChrome,
|
|
6222
6222
|
Lh as GradientSlider,
|
|
6223
6223
|
Re as HAND_TOOL,
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6224
|
+
br as HOST_ICONS,
|
|
6225
|
+
Nh as Hint,
|
|
6226
|
+
Ph as Histogram,
|
|
6227
6227
|
zt as HostButtons,
|
|
6228
6228
|
Fh as ICON_STROKE,
|
|
6229
6229
|
Gc as INK_TOOLS,
|
|
@@ -6234,7 +6234,7 @@ export {
|
|
|
6234
6234
|
zh as KeyframeLane,
|
|
6235
6235
|
Xl as KitCanvas,
|
|
6236
6236
|
Cu as KitDocumentCanvas,
|
|
6237
|
-
|
|
6237
|
+
wu as KitEditorProvider,
|
|
6238
6238
|
pu as KitElement,
|
|
6239
6239
|
ot as KitEngine,
|
|
6240
6240
|
Ks as LINE_MIN_WIDTH,
|
|
@@ -6271,12 +6271,12 @@ export {
|
|
|
6271
6271
|
mf as PopoverTrigger,
|
|
6272
6272
|
pf as PreviewDialog,
|
|
6273
6273
|
Oe as READ_ONLY_REASON,
|
|
6274
|
-
|
|
6274
|
+
Pe as READ_ONLY_RULES,
|
|
6275
6275
|
Ll as RESERVED_SHORTCUTS,
|
|
6276
6276
|
gf as RGB_IDENTITY,
|
|
6277
6277
|
Mt as ReadOnlyError,
|
|
6278
|
-
|
|
6279
|
-
|
|
6278
|
+
bf as RenameField,
|
|
6279
|
+
wf as RibbonButton,
|
|
6280
6280
|
yf as RibbonGroup,
|
|
6281
6281
|
vf as RibbonItem,
|
|
6282
6282
|
xe as RibbonMenu,
|
|
@@ -6291,14 +6291,14 @@ export {
|
|
|
6291
6291
|
Af as Spinner,
|
|
6292
6292
|
Ef as StatusBar,
|
|
6293
6293
|
Of as StatusSpacer,
|
|
6294
|
-
|
|
6294
|
+
bc as SubMenu,
|
|
6295
6295
|
Rf as Switch,
|
|
6296
6296
|
Df as TableSizePicker,
|
|
6297
6297
|
lu as TesseraIcons,
|
|
6298
6298
|
Lf as TextInput,
|
|
6299
6299
|
Dl as TextSink,
|
|
6300
|
-
|
|
6301
|
-
|
|
6300
|
+
Nf as Textarea,
|
|
6301
|
+
Pf as Thumbnail,
|
|
6302
6302
|
Ff as TimecodeField,
|
|
6303
6303
|
Wf as Toaster,
|
|
6304
6304
|
vu as ToolButton,
|
|
@@ -6317,7 +6317,7 @@ export {
|
|
|
6317
6317
|
nr as applyTheme,
|
|
6318
6318
|
Yf as automaticFloatingPosition,
|
|
6319
6319
|
Iu as base64,
|
|
6320
|
-
|
|
6320
|
+
Pl as bindableShortcut,
|
|
6321
6321
|
Vf as brandTokens,
|
|
6322
6322
|
hd as catalogMenuTree,
|
|
6323
6323
|
lo as catalogNames,
|
|
@@ -6340,14 +6340,14 @@ export {
|
|
|
6340
6340
|
Qf as dockHeights,
|
|
6341
6341
|
fu as dragRect,
|
|
6342
6342
|
_d as drawEngineOverlays,
|
|
6343
|
-
|
|
6343
|
+
Pr as drawOverlayInStyle,
|
|
6344
6344
|
Yu as drawPresence,
|
|
6345
6345
|
dl as editsDocument,
|
|
6346
6346
|
th as fileErrorReason,
|
|
6347
6347
|
em as formatTimecode,
|
|
6348
6348
|
tm as hitCurvePoint,
|
|
6349
6349
|
du as isFileChangedError,
|
|
6350
|
-
|
|
6350
|
+
Nt as isMac,
|
|
6351
6351
|
nh as isOpenableUrl,
|
|
6352
6352
|
Fi as isReadOnlyError,
|
|
6353
6353
|
dn as kitLeases,
|
|
@@ -6364,7 +6364,7 @@ export {
|
|
|
6364
6364
|
sm as meterLayout,
|
|
6365
6365
|
Oi as modeStorageKey,
|
|
6366
6366
|
lm as moveCurvePoint,
|
|
6367
|
-
|
|
6367
|
+
Pt as needsParams,
|
|
6368
6368
|
Hu as oneInFlight,
|
|
6369
6369
|
rh as openErrorReason,
|
|
6370
6370
|
cm as overflowOf,
|
|
@@ -6385,8 +6385,8 @@ export {
|
|
|
6385
6385
|
pm as removeKitStore,
|
|
6386
6386
|
Gd as reportConflicts,
|
|
6387
6387
|
gm as resizeFloatingRect,
|
|
6388
|
-
|
|
6389
|
-
|
|
6388
|
+
bm as rgbToHex,
|
|
6389
|
+
wm as sampleCurve,
|
|
6390
6390
|
Mc as scopesCollide,
|
|
6391
6391
|
cr as shortcutMatches,
|
|
6392
6392
|
ym as sliderFraction,
|
|
@@ -6411,7 +6411,7 @@ export {
|
|
|
6411
6411
|
$d as useFrameMode,
|
|
6412
6412
|
Tu as useHostPick,
|
|
6413
6413
|
te as useKitEditor,
|
|
6414
|
-
|
|
6414
|
+
bu as useKitEditorState,
|
|
6415
6415
|
Ou as useKitSession,
|
|
6416
6416
|
Am as useKitStore,
|
|
6417
6417
|
Xe as useKitTools,
|
|
@@ -6422,7 +6422,7 @@ export {
|
|
|
6422
6422
|
yu as useReadOnly,
|
|
6423
6423
|
Gu as useRemoteCarets,
|
|
6424
6424
|
ju as useRemoteSelections,
|
|
6425
|
-
|
|
6425
|
+
we as useUi,
|
|
6426
6426
|
Om as useWorkspaces,
|
|
6427
6427
|
jt as viewPanes,
|
|
6428
6428
|
Rm as wheelRadius,
|
|
@@ -6430,5 +6430,5 @@ export {
|
|
|
6430
6430
|
Zu as withPhrases,
|
|
6431
6431
|
Lm as workspaceSlug,
|
|
6432
6432
|
Fm as workspaceTree,
|
|
6433
|
-
|
|
6433
|
+
Nm as writeKitStore
|
|
6434
6434
|
};
|