@nivaro/react 0.2.54 → 0.2.55

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.
Files changed (150) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +339 -2
  4. package/dist/index.js +644 -618
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/ItemEditForm.js +4066 -3832
  10. package/dist/shared/components/JobsTray.js +100 -55
  11. package/dist/shared/components/MyWorkView.js +91 -89
  12. package/dist/shared/components/NotificationBell.js +80 -79
  13. package/dist/shared/components/ProfileView.js +568 -520
  14. package/dist/shared/components/RecordCompare.js +254 -0
  15. package/dist/shared/components/RecordReadView.js +599 -552
  16. package/dist/shared/components/ReportView.js +578 -543
  17. package/dist/shared/components/RowPresence.js +91 -0
  18. package/dist/shared/components/WidgetSlot.js +474 -458
  19. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  20. package/dist/shared/components/ai/AskPanel.js +139 -119
  21. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  22. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  23. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  24. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  25. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  26. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  27. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  28. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  29. package/dist/shared/components/chat/Composer.js +357 -303
  30. package/dist/shared/components/chat/MessageActions.js +92 -0
  31. package/dist/shared/components/chat/MessageFormat.js +290 -264
  32. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  33. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  34. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  35. package/dist/shared/components/chat/RoomParts.js +213 -274
  36. package/dist/shared/components/chat/ScreenClip.js +184 -0
  37. package/dist/shared/components/chat/chat-core.js +402 -483
  38. package/dist/shared/components/chat/chat-drafts.js +59 -0
  39. package/dist/shared/components/chat/chat-emoji.js +348 -0
  40. package/dist/shared/components/chat/chat-local-time.js +41 -0
  41. package/dist/shared/components/chat/chat-outbox.js +303 -0
  42. package/dist/shared/components/chat/chat-window.js +163 -0
  43. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  44. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  45. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  46. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  47. package/dist/shared/components/help-videos/api.js +76 -73
  48. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  49. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  50. package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
  51. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  52. package/dist/shared/components/item-edit/FieldRow.js +292 -279
  53. package/dist/shared/components/item-edit/GroupSection.js +698 -574
  54. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  55. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  56. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  57. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  58. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  59. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  60. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  61. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  62. package/dist/shared/components/item-edit/lock-why.js +39 -32
  63. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  64. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  65. package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
  66. package/dist/shared/components/layout-editor/AddPanel.js +134 -117
  67. package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
  68. package/dist/shared/components/layout-editor/CollabParts.js +80 -75
  69. package/dist/shared/components/layout-editor/DesignNode.js +126 -120
  70. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
  71. package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
  72. package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
  73. package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
  74. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  75. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  76. package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
  77. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
  78. package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
  79. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
  80. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  81. package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
  82. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  83. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  84. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  85. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  86. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  87. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  88. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  89. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
  90. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
  91. package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
  92. package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
  93. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  94. package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
  95. package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
  96. package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
  97. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  98. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  99. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  100. package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
  101. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  102. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  103. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  104. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  105. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  106. package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
  107. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  108. package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
  109. package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
  110. package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
  111. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  112. package/dist/shared/components/layout-editor/structure-ops.js +81 -77
  113. package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
  114. package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
  115. package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
  116. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  117. package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
  118. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  119. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  120. package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
  121. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  122. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  123. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  124. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  125. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  126. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  127. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  128. package/dist/shared/components/support/SupportView.js +75 -73
  129. package/dist/shared/lib/background-runs.js +150 -0
  130. package/dist/shared/lib/delivery-ack.js +9 -0
  131. package/dist/shared/lib/entry-badge-style.js +13 -0
  132. package/dist/shared/lib/entry-config.js +71 -0
  133. package/dist/shared/lib/form-sections.js +64 -0
  134. package/dist/shared/lib/form-structure.js +99 -0
  135. package/dist/shared/lib/form-usage-beacon.js +101 -52
  136. package/dist/shared/lib/jobs-tray.js +25 -23
  137. package/dist/shared/lib/keyset-pager.js +37 -0
  138. package/dist/shared/lib/layout-ops.js +84 -82
  139. package/dist/shared/lib/layout-resolve.js +113 -0
  140. package/dist/shared/lib/placement-behaviour.js +144 -0
  141. package/dist/shared/lib/prefetch.js +149 -0
  142. package/dist/shared/lib/presence-hooks.js +199 -0
  143. package/dist/shared/lib/record-outbox.js +82 -81
  144. package/dist/shared/lib/replay-socket.js +93 -0
  145. package/dist/shared/lib/request-gate.js +51 -50
  146. package/dist/shared/lib/room-gaps.js +96 -0
  147. package/dist/shared/lib/search-log.js +27 -0
  148. package/dist/shared/lib/socket-realtime.js +101 -80
  149. package/dist/shared/lib/worker-socket.js +200 -0
  150. package/package.json +1 -1
@@ -1,69 +1,76 @@
1
- import { jsxs as s, jsx as a, Fragment as D } from "react/jsx-runtime";
2
- import { Rows3 as G } from "lucide-react";
3
- import { useState as q, useMemo as x } from "react";
4
- import { UNGROUPED_KEY as I } from "../../../lib/layout-ops.js";
5
- import { titleCase as y } from "../../../lib/utils.js";
6
- import { Skeleton as L } from "../../ui/skeleton.js";
7
- import { Toggle as K } from "../settings/controls.js";
8
- import { suggestSections as W } from "./suggest-sections.js";
9
- import { useLayoutUsageToday as Y, useLayoutFriction as z, useCoChanges as A, formatDuration as B } from "./usage-api.js";
10
- const i = "px-3 pb-1.5 pt-4 text-[12px] font-semibold text-slate-700 dark:text-foreground", n = "px-3 text-[12px] leading-snug text-slate-500 dark:text-muted-foreground";
11
- function d({ label: o, value: p }) {
1
+ import { jsxs as s, jsx as t, Fragment as W } from "react/jsx-runtime";
2
+ import { ChevronsDownUp as Y, Rows3 as z } from "lucide-react";
3
+ import { useState as _, useMemo as u } from "react";
4
+ import { UNGROUPED_KEY as B } from "../../../lib/layout-ops.js";
5
+ import { titleCase as C } from "../../../lib/utils.js";
6
+ import { Skeleton as $ } from "../../ui/skeleton.js";
7
+ import { Toggle as H } from "../settings/controls.js";
8
+ import { AbTestSection as J } from "./AbTestSection.js";
9
+ import { suggestCollapse as Q, rateText as V } from "./suggest-collapse.js";
10
+ import { suggestSections as X } from "./suggest-sections.js";
11
+ import { useLayoutUsageToday as Z, useLayoutFriction as ee, useCoChanges as te, formatDuration as ae } from "./usage-api.js";
12
+ const i = "px-3 pb-1.5 pt-4 text-[12px] font-semibold text-slate-700 dark:text-foreground", d = "px-3 text-[12px] leading-snug text-slate-500 dark:text-muted-foreground";
13
+ function c({ label: n, value: m }) {
12
14
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-0.5 bg-white px-2.5 py-2 dark:bg-card", children: [
13
- /* @__PURE__ */ a("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: o }),
14
- /* @__PURE__ */ a("span", { className: "text-[14px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: p })
15
+ /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: n }),
16
+ /* @__PURE__ */ t("span", { className: "text-[14px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: m })
15
17
  ] });
16
18
  }
17
- function S({ children: o }) {
18
- return /* @__PURE__ */ a("div", { className: "mx-3 grid grid-cols-3 gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: o });
19
+ function j({ children: n }) {
20
+ return /* @__PURE__ */ t("div", { className: "mx-3 grid grid-cols-3 gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: n });
19
21
  }
20
- function se({
21
- bundle: o,
22
- collection: p,
23
- fields: f,
24
- apply: _,
25
- showFill: j,
26
- onShowFill: $
22
+ function ge({
23
+ bundle: n,
24
+ collection: m,
25
+ fields: b,
26
+ apply: N,
27
+ showFill: M,
28
+ onShowFill: U,
29
+ onOpenLayout: D
27
30
  }) {
28
- const b = Number(o.layout.id), { data: r, isLoading: C } = Y(b), { data: t, isLoading: h } = z(b), { data: c, isLoading: M } = A(p), [N, U] = q(() => /* @__PURE__ */ new Set()), v = x(() => {
29
- const e = new Map(f.map((l) => [l.field, l.label || y(l.field)]));
30
- return (l) => e.get(l) ?? y(l);
31
- }, [f]), m = (e) => {
31
+ var S;
32
+ const v = Number(n.layout.id), { data: o, isLoading: P } = Z(v), { data: a, isLoading: p } = ee(v), { data: h, isLoading: T } = te(m), [k, R] = _(() => /* @__PURE__ */ new Set()), [E, F] = _(!1), y = u(() => {
33
+ const e = new Map(b.map((l) => [l.field, l.label || C(l.field)]));
34
+ return (l) => e.get(l) ?? C(l);
35
+ }, [b]), g = (e) => {
32
36
  var l;
33
- return e == null || e === I ? "Ungrouped" : ((l = o.groups.find((g) => g.key === e)) == null ? void 0 : l.label) ?? e;
34
- }, E = (e) => e === "__form__" ? "Whole form" : e === "__general__" ? "General" : m(e), F = x(() => new Set(o.placements.map((e) => e.field)), [o.placements]), w = x(
35
- () => W(o, (c == null ? void 0 : c.pairs) ?? []).filter((e) => !N.has(e.id)),
36
- [o, c, N]
37
- ), u = (t == null ? void 0 : t.steps) ?? [], O = Math.max(1, ...u.map((e) => e.avg_ms)), k = ((t == null ? void 0 : t.changed_after_save.fields) ?? []).slice(0, 8), P = r && !r.ready || t && !t.ready;
37
+ return e == null || e === B ? "Ungrouped" : ((l = n.groups.find((x) => x.key === e)) == null ? void 0 : l.label) ?? e;
38
+ }, O = (e) => e === "__form__" ? "Whole form" : e === "__general__" ? "General" : g(e), A = u(() => new Set(n.placements.map((e) => e.field)), [n.placements]), w = u(
39
+ () => X(n, (h == null ? void 0 : h.pairs) ?? []).filter((e) => !k.has(e.id)),
40
+ [n, h, k]
41
+ ), r = u(
42
+ () => Q(n, (a == null ? void 0 : a.sections) ?? []),
43
+ [n, a == null ? void 0 : a.sections]
44
+ ), f = (a == null ? void 0 : a.steps) ?? [], G = Math.max(1, ...f.map((e) => e.avg_ms)), L = ((a == null ? void 0 : a.changed_after_save.fields) ?? []).slice(0, 8), q = o && !o.ready || a && !a.ready;
38
45
  return /* @__PURE__ */ s("div", { "data-editor-usage": "", className: "flex flex-col pb-4", children: [
39
46
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-2 px-3 pt-3", children: [
40
- /* @__PURE__ */ a("span", { className: "text-[12.5px] text-slate-700 dark:text-foreground", children: "Show how full each field is" }),
41
- /* @__PURE__ */ a(K, { label: "Show how full each field is", checked: j, onChange: $ })
47
+ /* @__PURE__ */ t("span", { className: "text-[12.5px] text-slate-700 dark:text-foreground", children: "Show how full each field is" }),
48
+ /* @__PURE__ */ t(H, { label: "Show how full each field is", checked: M, onChange: U })
42
49
  ] }),
43
- /* @__PURE__ */ a("p", { className: `${n} pt-1`, children: "Each field on the form shows the share of records that have a value." }),
44
- P && /* @__PURE__ */ a("p", { role: "note", className: `${n} pt-3`, children: "Usage is not being recorded on this instance yet (its database needs the latest update)." }),
45
- /* @__PURE__ */ a("p", { className: i, children: "Today" }),
46
- C ? /* @__PURE__ */ a(L, { className: "mx-3 h-12 rounded-lg" }) : /* @__PURE__ */ s(S, { children: [
47
- /* @__PURE__ */ a(d, { label: "Opens", value: ((r == null ? void 0 : r.opens) ?? 0).toLocaleString() }),
48
- /* @__PURE__ */ a(d, { label: "People", value: ((r == null ? void 0 : r.people) ?? 0).toLocaleString() }),
49
- /* @__PURE__ */ a(d, { label: "Records", value: ((r == null ? void 0 : r.records) ?? 0).toLocaleString() })
50
+ /* @__PURE__ */ t("p", { className: `${d} pt-1`, children: "Each field on the form shows the share of records that have a value." }),
51
+ q && /* @__PURE__ */ t("p", { role: "note", className: `${d} pt-3`, children: "Usage is not being recorded on this instance yet (its database needs the latest update)." }),
52
+ /* @__PURE__ */ t("p", { className: i, children: "Today" }),
53
+ P ? /* @__PURE__ */ t($, { className: "mx-3 h-12 rounded-lg" }) : /* @__PURE__ */ s(j, { children: [
54
+ /* @__PURE__ */ t(c, { label: "Opens", value: ((o == null ? void 0 : o.opens) ?? 0).toLocaleString() }),
55
+ /* @__PURE__ */ t(c, { label: "People", value: ((o == null ? void 0 : o.people) ?? 0).toLocaleString() }),
56
+ /* @__PURE__ */ t(c, { label: "Records", value: ((o == null ? void 0 : o.records) ?? 0).toLocaleString() })
50
57
  ] }),
51
58
  /* @__PURE__ */ s("p", { className: i, children: [
52
59
  "Last ",
53
- (t == null ? void 0 : t.days) ?? 30,
60
+ (a == null ? void 0 : a.days) ?? 30,
54
61
  " days"
55
62
  ] }),
56
- h ? /* @__PURE__ */ a(L, { className: "mx-3 h-12 rounded-lg" }) : /* @__PURE__ */ s(S, { children: [
57
- /* @__PURE__ */ a(d, { label: "Opens", value: ((t == null ? void 0 : t.opens) ?? 0).toLocaleString() }),
58
- /* @__PURE__ */ a(d, { label: "Saves", value: ((t == null ? void 0 : t.saves) ?? 0).toLocaleString() }),
59
- /* @__PURE__ */ a(d, { label: "Left unfinished", value: ((t == null ? void 0 : t.abandons) ?? 0).toLocaleString() })
63
+ p ? /* @__PURE__ */ t($, { className: "mx-3 h-12 rounded-lg" }) : /* @__PURE__ */ s(j, { children: [
64
+ /* @__PURE__ */ t(c, { label: "Opens", value: ((a == null ? void 0 : a.opens) ?? 0).toLocaleString() }),
65
+ /* @__PURE__ */ t(c, { label: "Saves", value: ((a == null ? void 0 : a.saves) ?? 0).toLocaleString() }),
66
+ /* @__PURE__ */ t(c, { label: "Left unfinished", value: ((a == null ? void 0 : a.abandons) ?? 0).toLocaleString() })
60
67
  ] }),
61
- /* @__PURE__ */ a("p", { className: i, children: "Time per step" }),
62
- u.length === 0 ? /* @__PURE__ */ a("p", { className: n, children: h ? "Loading…" : "No visits recorded yet." }) : /* @__PURE__ */ a("ul", { "data-usage-steps": "", className: "flex flex-col gap-2 px-3", children: u.map((e) => /* @__PURE__ */ s("li", { className: "flex flex-col gap-1", children: [
68
+ /* @__PURE__ */ t("p", { className: i, children: "Time per step" }),
69
+ f.length === 0 ? /* @__PURE__ */ t("p", { className: d, children: p ? "Loading…" : "No visits recorded yet." }) : /* @__PURE__ */ t("ul", { "data-usage-steps": "", className: "flex flex-col gap-2 px-3", children: f.map((e) => /* @__PURE__ */ s("li", { className: "flex flex-col gap-1", children: [
63
70
  /* @__PURE__ */ s("div", { className: "flex items-baseline justify-between gap-2 text-[12px]", children: [
64
- /* @__PURE__ */ a("span", { className: "truncate text-slate-800 dark:text-foreground", children: E(e.key) }),
71
+ /* @__PURE__ */ t("span", { className: "truncate text-slate-800 dark:text-foreground", children: O(e.key) }),
65
72
  /* @__PURE__ */ s("span", { className: "shrink-0 tabular-nums text-slate-500 dark:text-muted-foreground", children: [
66
- B(e.avg_ms),
73
+ ae(e.avg_ms),
67
74
  e.abandons > 0 && /* @__PURE__ */ s("span", { className: "text-amber-700 dark:text-amber-300", children: [
68
75
  " · ",
69
76
  e.abandons,
@@ -71,24 +78,24 @@ function se({
71
78
  ] })
72
79
  ] })
73
80
  ] }),
74
- /* @__PURE__ */ a("div", { className: "h-1.5 overflow-hidden rounded-full bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ a(
81
+ /* @__PURE__ */ t("div", { className: "h-1.5 overflow-hidden rounded-full bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ t(
75
82
  "div",
76
83
  {
77
84
  className: "h-full rounded-full bg-slate-400 dark:bg-slate-500",
78
- style: { width: `${Math.max(2, Math.round(e.avg_ms / O * 100))}%` }
85
+ style: { width: `${Math.max(2, Math.round(e.avg_ms / G * 100))}%` }
79
86
  }
80
87
  ) })
81
88
  ] }, e.key)) }),
82
- /* @__PURE__ */ a("p", { className: i, children: "Changed soon after saving" }),
83
- k.length === 0 ? /* @__PURE__ */ a("p", { className: n, children: h ? "Loading…" : "No field was changed within a day of a record being created." }) : /* @__PURE__ */ s(D, { children: [
84
- /* @__PURE__ */ a("ul", { "data-usage-changed": "", className: "flex flex-col px-3", children: k.map((e) => /* @__PURE__ */ s(
89
+ /* @__PURE__ */ t("p", { className: i, children: "Changed soon after saving" }),
90
+ L.length === 0 ? /* @__PURE__ */ t("p", { className: d, children: p ? "Loading…" : "No field was changed within a day of a record being created." }) : /* @__PURE__ */ s(W, { children: [
91
+ /* @__PURE__ */ t("ul", { "data-usage-changed": "", className: "flex flex-col px-3", children: L.map((e) => /* @__PURE__ */ s(
85
92
  "li",
86
93
  {
87
94
  className: "flex items-baseline justify-between gap-2 border-b border-slate-100 py-1 text-[12px] last:border-0 dark:border-border",
88
95
  children: [
89
96
  /* @__PURE__ */ s("span", { className: "min-w-0 truncate text-slate-800 dark:text-foreground", children: [
90
- v(e.field),
91
- !F.has(e.field) && /* @__PURE__ */ s("span", { className: "text-slate-400 dark:text-muted-foreground", children: [
97
+ y(e.field),
98
+ !A.has(e.field) && /* @__PURE__ */ s("span", { className: "text-slate-400 dark:text-muted-foreground", children: [
92
99
  " ",
93
100
  "· not on this form"
94
101
  ] })
@@ -101,14 +108,80 @@ function se({
101
108
  },
102
109
  e.field
103
110
  )) }),
104
- /* @__PURE__ */ s("p", { className: `${n} pt-1`, children: [
111
+ /* @__PURE__ */ s("p", { className: `${d} pt-1`, children: [
105
112
  "Edits within 24 hours of a record being created, last 90 days",
106
- (t == null ? void 0 : t.changed_after_save.scope) === "collection" ? ", across every form of this collection." : ", on records opened with this form."
113
+ (a == null ? void 0 : a.changed_after_save.scope) === "collection" ? ", across every form of this collection." : ", on records opened with this form."
107
114
  ] })
108
115
  ] }),
109
- /* @__PURE__ */ a("p", { className: i, children: "Suggested sections" }),
110
- M ? /* @__PURE__ */ a("p", { className: n, children: "Loading…" }) : w.length === 0 ? /* @__PURE__ */ a("p", { className: n, children: "No suggestions. Fields people change together already sit together on this form." }) : /* @__PURE__ */ a("ul", { "data-usage-suggestions": "", className: "flex flex-col gap-2 px-3", children: w.map((e) => {
111
- const l = e.fields.map(v), g = l.length > 1 ? `${l.slice(0, -1).join(", ")} and ${l[l.length - 1]}` : l[0], R = [...new Set(Object.values(e.from).map(m))];
116
+ /* @__PURE__ */ t("p", { className: i, children: "Rarely opened sections" }),
117
+ p ? /* @__PURE__ */ t("p", { className: d, children: "Loading…" }) : r.candidates.length === 0 || E ? /* @__PURE__ */ t("p", { className: d, children: (S = a == null ? void 0 : a.sections) != null && S.length ? "No suggestion. People open every section that starts open often enough." : "No section visits recorded yet." }) : /* @__PURE__ */ s(
118
+ "div",
119
+ {
120
+ "data-usage-collapse": "",
121
+ className: "mx-3 flex flex-col gap-2 rounded-lg border border-slate-200 bg-white p-2.5 dark:border-border dark:bg-card",
122
+ children: [
123
+ /* @__PURE__ */ s("p", { className: "m-0 text-[12px] leading-snug text-slate-700 dark:text-foreground", children: [
124
+ /* @__PURE__ */ t(Y, { className: "mr-1 inline h-3.5 w-3.5 align-[-2px] text-slate-400" }),
125
+ "People rarely open",
126
+ " ",
127
+ r.candidates.length === 1 ? "this section" : "these sections",
128
+ ". Starting",
129
+ " ",
130
+ r.candidates.length === 1 ? "it" : "them",
131
+ " collapsed keeps the form shorter."
132
+ ] }),
133
+ /* @__PURE__ */ t("ul", { className: "m-0 flex list-none flex-col p-0", children: r.candidates.map((e) => /* @__PURE__ */ s(
134
+ "li",
135
+ {
136
+ "data-usage-collapse-section": e.key,
137
+ className: "flex flex-col border-b border-slate-100 py-1 text-[12px] last:border-0 dark:border-border",
138
+ children: [
139
+ /* @__PURE__ */ t("span", { className: "truncate text-slate-800 dark:text-foreground", children: e.label }),
140
+ /* @__PURE__ */ s("span", { className: "tabular-nums text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
141
+ "opened in ",
142
+ V(e.rate),
143
+ " of ",
144
+ e.shown.toLocaleString(),
145
+ " visits"
146
+ ] })
147
+ ]
148
+ },
149
+ e.key
150
+ )) }),
151
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
152
+ /* @__PURE__ */ t(
153
+ "button",
154
+ {
155
+ type: "button",
156
+ onClick: () => N(r.ops, {
157
+ label: r.candidates.length === 1 ? `Collapse ${r.candidates[0].label}` : `Collapse ${r.candidates.length} rarely opened sections`
158
+ }),
159
+ className: "inline-flex h-7 items-center rounded-md bg-nvr-cyan px-2.5 text-[12px] font-medium text-white transition-opacity hover:opacity-90",
160
+ children: r.candidates.length === 1 ? "Start it collapsed" : `Start all ${r.candidates.length} collapsed`
161
+ }
162
+ ),
163
+ /* @__PURE__ */ t(
164
+ "button",
165
+ {
166
+ type: "button",
167
+ onClick: () => F(!0),
168
+ className: "inline-flex h-7 items-center rounded-md px-2 text-[12px] text-slate-500 transition-colors hover:bg-muted hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground",
169
+ children: "Not now"
170
+ }
171
+ )
172
+ ] })
173
+ ]
174
+ }
175
+ ),
176
+ /* @__PURE__ */ s("p", { className: `${d} pt-1`, children: [
177
+ "A section counts as opened when someone expands it, clicks in it or types in it. Last",
178
+ " ",
179
+ (a == null ? void 0 : a.days) ?? 30,
180
+ " days."
181
+ ] }),
182
+ /* @__PURE__ */ t("p", { className: i, children: "Suggested sections" }),
183
+ T ? /* @__PURE__ */ t("p", { className: d, children: "Loading…" }) : w.length === 0 ? /* @__PURE__ */ t("p", { className: d, children: "No suggestions. Fields people change together already sit together on this form." }) : /* @__PURE__ */ t("ul", { "data-usage-suggestions": "", className: "flex flex-col gap-2 px-3", children: w.map((e) => {
184
+ const l = e.fields.map(y), x = l.length > 1 ? `${l.slice(0, -1).join(", ")} and ${l[l.length - 1]}` : l[0], I = [...new Set(Object.values(e.from).map(g))];
112
185
  return /* @__PURE__ */ s(
113
186
  "li",
114
187
  {
@@ -116,11 +189,11 @@ function se({
116
189
  className: "flex flex-col gap-2 rounded-lg border border-slate-200 bg-white p-2.5 dark:border-border dark:bg-card",
117
190
  children: [
118
191
  /* @__PURE__ */ s("p", { className: "m-0 text-[12px] leading-snug text-slate-700 dark:text-foreground", children: [
119
- /* @__PURE__ */ a(G, { className: "mr-1 inline h-3.5 w-3.5 align-[-2px] text-slate-400" }),
192
+ /* @__PURE__ */ t(z, { className: "mr-1 inline h-3.5 w-3.5 align-[-2px] text-slate-400" }),
120
193
  "People usually change ",
121
- /* @__PURE__ */ a("b", { className: "font-semibold", children: g }),
194
+ /* @__PURE__ */ t("b", { className: "font-semibold", children: x }),
122
195
  " together, but they sit in ",
123
- R.join(" and "),
196
+ I.join(" and "),
124
197
  "."
125
198
  ] }),
126
199
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
@@ -128,19 +201,19 @@ function se({
128
201
  "button",
129
202
  {
130
203
  type: "button",
131
- onClick: () => _(e.ops, { label: `Move ${g} into ${m(e.target)}` }),
204
+ onClick: () => N(e.ops, { label: `Move ${x} into ${g(e.target)}` }),
132
205
  className: "inline-flex h-7 items-center rounded-md bg-nvr-cyan px-2.5 text-[12px] font-medium text-white transition-opacity hover:opacity-90",
133
206
  children: [
134
207
  "Move into ",
135
- m(e.target)
208
+ g(e.target)
136
209
  ]
137
210
  }
138
211
  ),
139
- /* @__PURE__ */ a(
212
+ /* @__PURE__ */ t(
140
213
  "button",
141
214
  {
142
215
  type: "button",
143
- onClick: () => U((T) => new Set(T).add(e.id)),
216
+ onClick: () => R((K) => new Set(K).add(e.id)),
144
217
  className: "inline-flex h-7 items-center rounded-md px-2 text-[12px] text-slate-500 transition-colors hover:bg-muted hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground",
145
218
  children: "Not now"
146
219
  }
@@ -150,9 +223,10 @@ function se({
150
223
  },
151
224
  e.id
152
225
  );
153
- }) })
226
+ }) }),
227
+ /* @__PURE__ */ t(J, { bundle: n, collection: m, onOpenLayout: D })
154
228
  ] });
155
229
  }
156
230
  export {
157
- se as UsagePanel
231
+ ge as UsagePanel
158
232
  };
@@ -0,0 +1,86 @@
1
+ import { useQuery as m, useQueryClient as p } from "@tanstack/react-query";
2
+ import { useCallback as q } from "react";
3
+ import { useNivaroClient as c } from "../../../context.js";
4
+ import { get as b, del as $, post as d } from "../../../lib/commands.js";
5
+ import { useInvalidateLayouts as v } from "../overview/overview-api.js";
6
+ const f = {
7
+ test: (t) => ["layout-editor", "ab-test", t],
8
+ results: (t) => ["layout-editor", "ab-test", t, "results"],
9
+ roles: () => ["layout-editor", "ab-test", "roles"]
10
+ }, y = (t, e) => (t == null ? void 0 : t.data) ?? e;
11
+ function T(t) {
12
+ const e = c();
13
+ return m({
14
+ queryKey: f.test(t),
15
+ queryFn: async () => y(
16
+ await e.request(b(`/collection-layouts/${t}/ab-test`)),
17
+ null
18
+ ),
19
+ staleTime: 3e4,
20
+ retry: !1
21
+ });
22
+ }
23
+ function g(t, e) {
24
+ const o = c();
25
+ return m({
26
+ queryKey: f.results(t),
27
+ queryFn: async () => y(
28
+ await o.request(b(`/collection-layouts/${t}/ab-test/results`)),
29
+ null
30
+ ),
31
+ enabled: e,
32
+ staleTime: 5 * 6e4,
33
+ retry: !1
34
+ });
35
+ }
36
+ function k(t) {
37
+ const e = c();
38
+ return m({
39
+ queryKey: f.roles(),
40
+ queryFn: async () => y(
41
+ await e.request(b("/roles")),
42
+ []
43
+ ).filter((s) => !s.admin_access).map((s) => ({ id: String(s.id), name: String(s.name) })).sort((s, r) => s.name.localeCompare(r.name)),
44
+ enabled: t,
45
+ staleTime: 5 * 6e4
46
+ });
47
+ }
48
+ function N(t, e) {
49
+ const o = c(), s = p(), r = v(e), w = q(async () => {
50
+ await s.invalidateQueries({ queryKey: ["layout-editor", "ab-test"] }), r();
51
+ }, [s, r]);
52
+ return {
53
+ /** A copy of this form to change and test (create_hidden, never the default). */
54
+ copy: async (n) => {
55
+ var i;
56
+ for (let u = 1; u <= 5; u++)
57
+ try {
58
+ const a = await o.request(
59
+ d(`/collection-layouts/${t}/clone`, {
60
+ name: u === 1 ? `${n} (new version)` : `${n} (new version ${u})`
61
+ })
62
+ ), l = Number(y(a, {}).id);
63
+ if (Number.isFinite(l) && l > 0) return l;
64
+ break;
65
+ } catch (a) {
66
+ if (((a == null ? void 0 : a.status) ?? ((i = a == null ? void 0 : a.response) == null ? void 0 : i.status)) !== 409) throw a;
67
+ }
68
+ throw new Error("Could not copy this form");
69
+ },
70
+ start: async (n, i) => {
71
+ await o.request(
72
+ d(`/collection-layouts/${t}/ab-test`, { variant_id: n, role_id: i })
73
+ ), await w();
74
+ },
75
+ end: async (n) => {
76
+ await o.request($(`/collection-layouts/${t}/ab-test?keep=${n}`)), await w();
77
+ }
78
+ };
79
+ }
80
+ export {
81
+ f as abKeys,
82
+ N as useAbActions,
83
+ g as useAbResults,
84
+ T as useAbTest,
85
+ k as useSplittableRoles
86
+ };
@@ -0,0 +1,32 @@
1
+ const h = 20, y = 0.1;
2
+ function _(e, p, r = {}) {
3
+ const u = r.minShown ?? 20, f = r.maxRate ?? 0.1;
4
+ if (e.layout.accordion_mode) return { candidates: [], ops: [] };
5
+ const i = e.groups, c = /* @__PURE__ */ new Map();
6
+ for (const n of [...i].sort((o, t) => o.sort - t.sort || (o.id ?? 0) - (t.id ?? 0))) {
7
+ if (n.type !== "section") continue;
8
+ const o = n.parent_key ?? "";
9
+ c.has(o) || c.set(o, n.key);
10
+ }
11
+ const d = new Map(p.map((n) => [n.key, n])), s = [];
12
+ for (const n of i) {
13
+ if (n.type !== "section" || n.is_collapsed || c.get(n.parent_key ?? "") === n.key) continue;
14
+ const o = d.get(n.key);
15
+ if (!o || o.shown < u) continue;
16
+ const t = Math.min(o.opened, o.shown), a = t / o.shown;
17
+ a > f || s.push({ key: n.key, label: n.label || n.key, shown: o.shown, opened: t, rate: a });
18
+ }
19
+ return s.sort((n, o) => n.rate - o.rate || o.shown - n.shown), {
20
+ candidates: s,
21
+ ops: s.map((n) => ({ op: "group_update", key: n.key, patch: { is_collapsed: !0 } }))
22
+ };
23
+ }
24
+ function k(e) {
25
+ return e <= 0 ? "none" : e < 0.01 ? "under 1%" : `${Math.round(e * 100)}%`;
26
+ }
27
+ export {
28
+ y as MAX_OPEN_RATE,
29
+ h as MIN_SHOWN,
30
+ k as rateText,
31
+ _ as suggestCollapse
32
+ };
@@ -2,11 +2,11 @@ var V = Object.defineProperty;
2
2
  var B = (n, e, t) => e in n ? V(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var c = (n, e, t) => B(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { useQueryClient as P, useQuery as z } from "@tanstack/react-query";
5
- import { useState as Q, useRef as Y, useSyncExternalStore as G, useEffect as b, useCallback as l } from "react";
5
+ import { useState as Q, useRef as Y, useSyncExternalStore as G, useEffect as b, useCallback as p } from "react";
6
6
  import { toast as H } from "sonner";
7
7
  import { useNivaroClient as M } from "../../context.js";
8
8
  import { get as J, post as X } from "../../lib/commands.js";
9
- import { applyLayoutOps as p, isCanvasSlot as Z, GROUP_PATCH_KEYS as ee, PLACEMENT_PATCH_KEYS as te } from "../../lib/layout-ops.js";
9
+ import { applyLayoutOps as f, isCanvasSlot as Z, GROUP_PATCH_KEYS as ee, PLACEMENT_PATCH_KEYS as te } from "../../lib/layout-ops.js";
10
10
  const C = {
11
11
  bundle: (n) => ["layout-editor", "bundle", n],
12
12
  versions: (n) => ["layout-editor", "versions", n]
@@ -50,7 +50,7 @@ function F(n, e = "The layout could not be saved") {
50
50
  const t = n, s = (t == null ? void 0 : t.status) ?? ((o = t == null ? void 0 : t.response) == null ? void 0 : o.status) ?? null, r = ((u = t == null ? void 0 : t.response) == null ? void 0 : u.data) ?? (t == null ? void 0 : t.response), a = typeof (r == null ? void 0 : r.error) == "string" && r.error || typeof (r == null ? void 0 : r.message) == "string" && r.message || typeof (t == null ? void 0 : t.message) == "string" && t.message || e;
51
51
  return { status: s, message: he(a), bundle: q(r == null ? void 0 : r.bundle) };
52
52
  }
53
- const ce = (n) => p(n, [{ op: "layout_update", patch: {} }]), S = (n, e) => n.placements.find((t) => t.field === e.field && t.group_key === (e.group_key ?? null));
53
+ const ce = (n) => f(n, [{ op: "layout_update", patch: {} }]), S = (n, e) => n.placements.find((t) => t.field === e.field && t.group_key === (e.group_key ?? null));
54
54
  function A(n) {
55
55
  const e = {};
56
56
  for (const t of te) e[t] = n[t];
@@ -172,7 +172,7 @@ function fe(n, e) {
172
172
  function g(n, e) {
173
173
  let t = ce(n), s = [];
174
174
  for (const r of e)
175
- s = [...le(t, r), ...s], t = p(t, [r]);
175
+ s = [...le(t, r), ...s], t = f(t, [r]);
176
176
  return s;
177
177
  }
178
178
  function ve(n) {
@@ -243,7 +243,7 @@ class ke {
243
243
  const a = this.draft;
244
244
  let o;
245
245
  try {
246
- p(a, e), o = g(a, e);
246
+ f(a, e), o = g(a, e);
247
247
  } catch (i) {
248
248
  this.fail(y(i));
249
249
  return;
@@ -264,7 +264,7 @@ class ke {
264
264
  return;
265
265
  }
266
266
  try {
267
- p(this.draft, e.inverse);
267
+ f(this.draft, e.inverse);
268
268
  } catch (s) {
269
269
  this.fail(`Could not undo: ${y(s)}`);
270
270
  return;
@@ -276,7 +276,7 @@ class ke {
276
276
  const e = this.redoStack.pop();
277
277
  if (!(!e || !this.draft)) {
278
278
  try {
279
- p(this.draft, e.forward), e.inverse = g(this.draft, e.forward);
279
+ f(this.draft, e.forward), e.inverse = g(this.draft, e.forward);
280
280
  } catch (t) {
281
281
  this.fail(`Could not redo: ${y(t)}`);
282
282
  return;
@@ -353,7 +353,7 @@ class ke {
353
353
  for (const s of e) {
354
354
  if (!this.draft) break;
355
355
  try {
356
- p(this.draft, s.ops);
356
+ f(this.draft, s.ops);
357
357
  } catch {
358
358
  this.dropped = [...this.dropped, s.label];
359
359
  continue;
@@ -376,7 +376,7 @@ class ke {
376
376
  applyText(e, t) {
377
377
  const s = this.draft;
378
378
  try {
379
- p(
379
+ f(
380
380
  s,
381
381
  e.map((r) => r.op)
382
382
  );
@@ -403,7 +403,7 @@ class ke {
403
403
  this.markCheckpoint();
404
404
  const a = e.map((i) => i.key).join("");
405
405
  try {
406
- p(s, r);
406
+ f(s, r);
407
407
  } catch (i) {
408
408
  this.fail(y(i));
409
409
  return;
@@ -493,7 +493,7 @@ class ke {
493
493
  for (const u of t)
494
494
  try {
495
495
  const i = g(o, u.ops);
496
- o = p(o, u.ops), a.set(u.id, i), s.push(u);
496
+ o = f(o, u.ops), a.set(u.id, i), s.push(u);
497
497
  } catch {
498
498
  r.push(u);
499
499
  }
@@ -558,7 +558,7 @@ class ke {
558
558
  const o = [], u = [];
559
559
  for (const [i, h] of r.entries())
560
560
  try {
561
- e = p(e, h.ops), o.push(h);
561
+ e = f(e, h.ops), o.push(h);
562
562
  } catch (v) {
563
563
  i === 0 && a ? o.push(h) : h.kind === "save" ? u.push(...h.parts ?? []) : (this.rollback(h), this.error ?? (this.error = y(v)), this.outcome = "error");
564
564
  }
@@ -567,7 +567,7 @@ class ke {
567
567
  this.queue = s.kept, this.unsaved = t([...s.restored, ...this.unsaved], !1).kept;
568
568
  for (const [r, a] of this.text)
569
569
  try {
570
- e = p(e, [a.op]);
570
+ e = f(e, [a.op]);
571
571
  } catch {
572
572
  clearTimeout(a.timer), this.text.delete(r);
573
573
  }
@@ -637,21 +637,22 @@ function ye(n, e, t) {
637
637
  if (r != null && r.engine.isBusy()) return r;
638
638
  const a = C.bundle(n), o = { current: e }, i = { engine: new ke(
639
639
  {
640
- send: async (h, v, k, f) => {
640
+ send: async (h, v, k, d) => {
641
641
  const _ = await o.current.client.request(
642
642
  X(`/collection-layouts/${n}/ops`, {
643
643
  ops: h,
644
644
  base_rev: v,
645
645
  note: k,
646
- ...f ? { reason: f.reason, ticket: f.ticket ?? null } : {}
646
+ ...d ? { reason: d.reason, ticket: d.ticket ?? null } : {},
647
+ ...d != null && d.freeze_override ? { freeze_override: d.freeze_override } : {}
647
648
  })
648
649
  ), m = q(_);
649
650
  if (!m) throw new Error("The server answered without the saved layout");
650
651
  return m;
651
652
  },
652
653
  saved: (h, v) => {
653
- var k, f;
654
- o.current.qc.setQueryData(a, h), (f = (k = o.current).onSaved) == null || f.call(k, h, v);
654
+ var k, d;
655
+ o.current.qc.setQueryData(a, h), (d = (k = o.current).onSaved) == null || d.call(k, h, v);
655
656
  },
656
657
  reload: () => {
657
658
  o.current.qc.invalidateQueries({ queryKey: a });
@@ -691,22 +692,22 @@ function Oe(n, e = {}) {
691
692
  }, [i, r.data]), b(() => {
692
693
  i.setAutosave(a);
693
694
  }, [i, a]), b(() => () => i.flushText(), [i]);
694
- const v = l(
695
- (d, W) => i.apply(d, W),
695
+ const v = p(
696
+ (l, W) => i.apply(l, W),
696
697
  [i]
697
- ), k = l(() => i.undo(), [i]), f = l(() => i.redo(), [i]), _ = l(() => i.flushText(), [i]), m = l((d) => i.whenIdle(d), [i]), K = l(
698
- (d) => {
699
- o(d), i.setAutosave(d);
698
+ ), k = p(() => i.undo(), [i]), d = p(() => i.redo(), [i]), _ = p(() => i.flushText(), [i]), m = p((l) => i.whenIdle(l), [i]), K = p(
699
+ (l) => {
700
+ o(l), i.setAutosave(l);
700
701
  },
701
702
  [i]
702
- ), U = l(() => i.unsavedOps(), [i]), L = l((d) => i.save(d), [i]), j = l(() => i.discard(), [i]), D = l(() => i.clearDropped(), [i]), N = l((d) => i.restore(d), [i]), R = l((d) => i.jump(d), [i]), O = !h.bundle && r.error != null;
703
+ ), U = p(() => i.unsavedOps(), [i]), L = p((l) => i.save(l), [i]), j = p(() => i.discard(), [i]), D = p(() => i.clearDropped(), [i]), N = p((l) => i.restore(l), [i]), R = p((l) => i.jump(l), [i]), O = !h.bundle && r.error != null;
703
704
  return {
704
705
  ...h,
705
706
  status: O ? "error" : h.status,
706
707
  error: h.error ?? (O ? F(r.error, "The layout could not be read").message : null),
707
708
  apply: v,
708
709
  undo: k,
709
- redo: f,
710
+ redo: d,
710
711
  flush: _,
711
712
  whenIdle: m,
712
713
  setAutosave: K,