@nivaro/react 0.2.53 → 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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +452 -4
- package/dist/index.js +644 -618
- package/dist/layout-editor.d.ts +252 -2
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +3968 -3618
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +598 -543
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +80 -67
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +9 -8
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +382 -320
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +786 -639
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +94 -0
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +65 -0
- package/dist/shared/components/layout-editor/AddPanel.js +226 -151
- package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
- package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
- package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
- package/dist/shared/components/layout-editor/ChangeNote.js +147 -0
- package/dist/shared/components/layout-editor/CollabParts.js +175 -0
- package/dist/shared/components/layout-editor/DesignNode.js +311 -116
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -26
- package/dist/shared/components/layout-editor/EditorTopBar.js +463 -175
- package/dist/shared/components/layout-editor/FindReplace.js +188 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +250 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1196 -305
- package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
- package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
- package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +464 -0
- package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
- package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
- package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
- package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
- package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
- package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
- package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
- package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
- package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
- package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
- package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
- package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
- package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
- package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
- package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
- package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
- package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
- package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
- package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
- package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
- package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
- package/dist/shared/components/layout-editor/assist/jump.js +142 -0
- package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
- package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
- package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
- package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
- package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
- package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
- package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
- package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
- package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
- package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
- package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +388 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +80 -0
- package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
- package/dist/shared/components/layout-editor/commands/intents.js +214 -0
- package/dist/shared/components/layout-editor/commands/parse.js +242 -0
- package/dist/shared/components/layout-editor/design-context.js +26 -6
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +181 -164
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +131 -0
- package/dist/shared/components/layout-editor/editor-notes.js +78 -0
- package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
- package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
- package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
- package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
- package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
- package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
- package/dist/shared/components/layout-editor/field-zones.js +116 -0
- package/dist/shared/components/layout-editor/form-map.js +138 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/history-api.js +87 -0
- package/dist/shared/components/layout-editor/inheritance.js +55 -0
- package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
- package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
- package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
- package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +179 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +291 -141
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +282 -180
- package/dist/shared/components/layout-editor/inspector/LookTab.js +166 -109
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +146 -118
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +162 -111
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +71 -70
- package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
- package/dist/shared/components/layout-editor/is-typing.js +9 -0
- package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
- package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
- package/dist/shared/components/layout-editor/load-error.js +37 -0
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
- package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
- package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
- package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
- package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
- package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
- package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
- package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
- package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
- package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
- package/dist/shared/components/layout-editor/nav/find.js +20 -0
- package/dist/shared/components/layout-editor/nav/tree.js +142 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
- package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
- package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
- package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
- package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
- package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
- package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +24 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/panel-style.js +8 -7
- package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
- package/dist/shared/components/layout-editor/pin.js +25 -0
- package/dist/shared/components/layout-editor/presence.js +111 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
- package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
- package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
- package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
- package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
- package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
- package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
- package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
- package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
- package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +125 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +215 -105
- package/dist/shared/components/layout-editor/settings/WhoSection.js +139 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +142 -21
- package/dist/shared/components/layout-editor/shortcuts.js +88 -0
- package/dist/shared/components/layout-editor/show-when.js +35 -0
- package/dist/shared/components/layout-editor/slot-names.js +4 -3
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +403 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +556 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +406 -0
- package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
- package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
- package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +232 -0
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -306
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +133 -0
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-i18n.js +66 -0
- package/dist/shared/lib/layout-lint.js +490 -0
- package/dist/shared/lib/layout-ops.js +116 -110
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/visible-when.js +34 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as D } from "@tanstack/react-query";
|
|
3
|
+
import { MessageSquare as P, Share2 as R, BellRing as W, Bell as B, Link2 as T, Copy as $, Crosshair as q, X as A } from "lucide-react";
|
|
4
|
+
import { useState as p } from "react";
|
|
5
|
+
import { toast as k } from "sonner";
|
|
6
|
+
import { useNivaroClient as j } from "../../../context.js";
|
|
7
|
+
import { get as E } from "../../../lib/commands.js";
|
|
8
|
+
import { cn as y } from "../../../lib/utils.js";
|
|
9
|
+
import { Popover as F, PopoverContent as U } from "../../ui/popover.js";
|
|
10
|
+
import { SimpleSelect as L } from "../../ui/SimpleSelect.js";
|
|
11
|
+
import { apiFailure as K } from "../overview/overview-api.js";
|
|
12
|
+
import { ToolButton as _ } from "../toolbar-kit.js";
|
|
13
|
+
import { useLayoutCollab as S, usePreviewComments as M, useCollabActions as v, usePreviewLinks as H, previewUrl as C } from "./collab-api.js";
|
|
14
|
+
const f = "inline-flex h-7 items-center gap-1 rounded-md px-2 text-[12px] text-slate-600 transition-colors hover:bg-muted hover:text-slate-900 disabled:opacity-40 dark:text-muted-foreground dark:hover:text-foreground", g = "text-[12px] font-semibold text-slate-700 dark:text-foreground", x = "text-[11.5px] leading-snug text-slate-500 dark:text-muted-foreground", O = (o) => o ? new Date(o).toLocaleDateString(void 0, { month: "short", day: "numeric" }) : "";
|
|
15
|
+
function w(o, n) {
|
|
16
|
+
k.error(K(o, n).message);
|
|
17
|
+
}
|
|
18
|
+
function le({ layoutId: o }) {
|
|
19
|
+
const { data: n } = S(o), m = v(o), [d, c] = p(!1), t = !!(n != null && n.watching);
|
|
20
|
+
return /* @__PURE__ */ e(
|
|
21
|
+
_,
|
|
22
|
+
{
|
|
23
|
+
label: "Watch this form",
|
|
24
|
+
ariaLabel: t ? "Stop watching this form" : "Watch this form",
|
|
25
|
+
icon: t ? /* @__PURE__ */ e(W, { className: "h-4 w-4" }) : /* @__PURE__ */ e(B, { className: "h-4 w-4" }),
|
|
26
|
+
hint: "Hear when someone saves a change",
|
|
27
|
+
iconOnly: !0,
|
|
28
|
+
checked: t,
|
|
29
|
+
disabled: d,
|
|
30
|
+
className: y(t && "text-[#0089ad] dark:text-nvr-cyan"),
|
|
31
|
+
tip: t ? "Watching: you hear when someone saves a change. Click to stop" : "Watch: hear when someone saves a change to this form",
|
|
32
|
+
data: { "data-form-watch": "" },
|
|
33
|
+
onClick: async () => {
|
|
34
|
+
c(!0);
|
|
35
|
+
try {
|
|
36
|
+
await m.setWatch(!t);
|
|
37
|
+
} catch (i) {
|
|
38
|
+
w(i, "Could not change the watch");
|
|
39
|
+
} finally {
|
|
40
|
+
c(!1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function Q({ layoutId: o, owner: n }) {
|
|
47
|
+
const m = j(), d = v(o), [c, t] = p(!1), [i, h] = p(""), { data: u = [] } = D({
|
|
48
|
+
queryKey: ["layout-editor", "collab", "people", i],
|
|
49
|
+
queryFn: () => m.request(E("/users", { search: i, limit: 6, people: "1" })).then((s) => s.data ?? []),
|
|
50
|
+
enabled: c && i.trim().length > 1
|
|
51
|
+
}), l = async (s) => {
|
|
52
|
+
try {
|
|
53
|
+
await d.setOwner(s), t(!1), h("");
|
|
54
|
+
} catch (a) {
|
|
55
|
+
w(a, "Could not change the owner");
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return c ? /* @__PURE__ */ r("div", { children: [
|
|
59
|
+
/* @__PURE__ */ e(
|
|
60
|
+
"input",
|
|
61
|
+
{
|
|
62
|
+
autoFocus: !0,
|
|
63
|
+
"aria-label": "Find a person",
|
|
64
|
+
value: i,
|
|
65
|
+
onChange: (s) => h(s.target.value),
|
|
66
|
+
onKeyDown: (s) => s.key === "Escape" && t(!1),
|
|
67
|
+
placeholder: "Type a name or email",
|
|
68
|
+
className: "h-8 w-full rounded-md border border-slate-200 bg-white px-2.5 text-[12.5px] outline-none placeholder:text-slate-400 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-foreground dark:placeholder:text-muted-foreground"
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
i.trim().length > 1 && /* @__PURE__ */ e("div", { className: "mt-1 overflow-hidden rounded-md border border-slate-200 dark:border-border", children: u.length === 0 ? /* @__PURE__ */ e("div", { className: y(x, "px-2.5 py-1.5"), children: "No one matches" }) : u.map((s) => {
|
|
72
|
+
const a = `${s.first_name ?? ""} ${s.last_name ?? ""}`.trim() || s.email;
|
|
73
|
+
return /* @__PURE__ */ r(
|
|
74
|
+
"button",
|
|
75
|
+
{
|
|
76
|
+
type: "button",
|
|
77
|
+
onClick: () => void l(s.id),
|
|
78
|
+
className: "block w-full px-2.5 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
79
|
+
children: [
|
|
80
|
+
a,
|
|
81
|
+
/* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-slate-400 dark:text-muted-foreground", children: s.email })
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
s.id
|
|
85
|
+
);
|
|
86
|
+
}) }),
|
|
87
|
+
/* @__PURE__ */ e("button", { type: "button", className: y(f, "mt-1"), onClick: () => t(!1), children: "Cancel" })
|
|
88
|
+
] }) : /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
89
|
+
/* @__PURE__ */ e(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
"data-form-owner": "",
|
|
93
|
+
className: y(
|
|
94
|
+
"min-w-0 flex-1 truncate text-[12.5px]",
|
|
95
|
+
n ? "text-slate-800 dark:text-foreground" : "text-slate-400 dark:text-muted-foreground"
|
|
96
|
+
),
|
|
97
|
+
children: (n == null ? void 0 : n.name) ?? "No owner yet"
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ e("button", { type: "button", className: f, onClick: () => t(!0), children: n ? "Change" : "Name an owner" }),
|
|
101
|
+
n && /* @__PURE__ */ e("button", { type: "button", className: f, onClick: () => void l(null), children: "Clear" })
|
|
102
|
+
] });
|
|
103
|
+
}
|
|
104
|
+
const N = "default";
|
|
105
|
+
function V({
|
|
106
|
+
layoutId: o,
|
|
107
|
+
review: n,
|
|
108
|
+
hasOwner: m
|
|
109
|
+
}) {
|
|
110
|
+
const d = v(o), [c, t] = p(!1), i = (a) => a === 1 ? "1 month" : `${a} months`, h = n.months == null ? N : String(n.months), u = [
|
|
111
|
+
{
|
|
112
|
+
value: N,
|
|
113
|
+
label: n.default_months > 0 ? `After ${i(n.default_months)} (default)` : "Never (default)"
|
|
114
|
+
},
|
|
115
|
+
...[3, 6, 12].filter((a) => a !== n.default_months).map((a) => ({ value: String(a), label: `After ${i(a)}` })),
|
|
116
|
+
...n.default_months > 0 ? [{ value: "0", label: "Never" }] : []
|
|
117
|
+
], l = n.next_at ? new Date(n.next_at) : null, s = (a) => a.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
|
|
118
|
+
return /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
119
|
+
/* @__PURE__ */ e(
|
|
120
|
+
L,
|
|
121
|
+
{
|
|
122
|
+
value: h,
|
|
123
|
+
disabled: c,
|
|
124
|
+
onChange: async (a) => {
|
|
125
|
+
t(!0);
|
|
126
|
+
try {
|
|
127
|
+
await d.setReviewMonths(a === N ? null : Number(a));
|
|
128
|
+
} catch (b) {
|
|
129
|
+
w(b, "Could not change the reminder");
|
|
130
|
+
} finally {
|
|
131
|
+
t(!1);
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
ariaLabel: "Remind the owner to review this form",
|
|
135
|
+
className: "h-8 w-full text-[12.5px]",
|
|
136
|
+
triggerProps: { "data-form-review": "" },
|
|
137
|
+
options: u
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ r("p", { className: x, children: [
|
|
141
|
+
m ? n.effective_months === 0 ? "The owner is never reminded." : l && l > /* @__PURE__ */ new Date() ? `If it stays unchanged, the owner is reminded on ${s(l)} with its health score and how much it was used.` : `It has been unchanged that long: the owner is reminded on a weekday morning, then every ${i(n.effective_months)} while it stays unchanged.` : "Name an owner first: the reminder goes to them, with the form’s health score and how much it was used.",
|
|
142
|
+
n.last_changed_at ? ` Last changed ${s(new Date(n.last_changed_at))}.` : ""
|
|
143
|
+
] })
|
|
144
|
+
] });
|
|
145
|
+
}
|
|
146
|
+
function X({ layoutId: o, open: n }) {
|
|
147
|
+
const { data: m = [] } = H(o, n), d = v(o), [c, t] = p("14"), [i, h] = p(!1), [u, l] = p(null), s = async (a) => {
|
|
148
|
+
try {
|
|
149
|
+
await navigator.clipboard.writeText(C(a)), k.success("Link copied");
|
|
150
|
+
} catch {
|
|
151
|
+
k.error("Could not copy — select the link and copy it");
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
return /* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
155
|
+
/* @__PURE__ */ e("p", { className: x, children: "Anyone with the link can read this form’s layout (never record data) and comment on its fields. It shows the last saved version, as you see it." }),
|
|
156
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
157
|
+
/* @__PURE__ */ e(
|
|
158
|
+
L,
|
|
159
|
+
{
|
|
160
|
+
value: c,
|
|
161
|
+
onChange: t,
|
|
162
|
+
ariaLabel: "Link lasts",
|
|
163
|
+
className: "h-8 w-[120px] text-[12.5px]",
|
|
164
|
+
options: [
|
|
165
|
+
{ value: "7", label: "7 days" },
|
|
166
|
+
{ value: "14", label: "14 days" },
|
|
167
|
+
{ value: "30", label: "30 days" },
|
|
168
|
+
{ value: "90", label: "90 days" }
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
),
|
|
172
|
+
/* @__PURE__ */ r(
|
|
173
|
+
"button",
|
|
174
|
+
{
|
|
175
|
+
type: "button",
|
|
176
|
+
disabled: i,
|
|
177
|
+
className: "inline-flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-medium text-white transition-opacity hover:opacity-90 disabled:opacity-50",
|
|
178
|
+
onClick: async () => {
|
|
179
|
+
h(!0);
|
|
180
|
+
try {
|
|
181
|
+
const a = await d.createLink(Number(c));
|
|
182
|
+
a != null && a.path && await s(a.path);
|
|
183
|
+
} catch (a) {
|
|
184
|
+
w(a, "Could not create the link");
|
|
185
|
+
} finally {
|
|
186
|
+
h(!1);
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
children: [
|
|
190
|
+
/* @__PURE__ */ e(T, { className: "h-3.5 w-3.5" }),
|
|
191
|
+
"Create link"
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
] }),
|
|
196
|
+
m.map((a) => /* @__PURE__ */ r(
|
|
197
|
+
"div",
|
|
198
|
+
{
|
|
199
|
+
"data-preview-link": a.id,
|
|
200
|
+
className: "rounded-md border border-slate-200 px-2.5 py-1.5 dark:border-border",
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ e("div", { className: "truncate font-mono text-[11.5px] text-slate-600 dark:text-muted-foreground", children: C(a.path) }),
|
|
203
|
+
/* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
204
|
+
/* @__PURE__ */ r("span", { children: [
|
|
205
|
+
"until ",
|
|
206
|
+
O(a.expires_at)
|
|
207
|
+
] }),
|
|
208
|
+
/* @__PURE__ */ r("span", { children: [
|
|
209
|
+
"· ",
|
|
210
|
+
a.view_count,
|
|
211
|
+
" ",
|
|
212
|
+
a.view_count === 1 ? "view" : "views"
|
|
213
|
+
] }),
|
|
214
|
+
/* @__PURE__ */ r("span", { children: [
|
|
215
|
+
"· ",
|
|
216
|
+
a.comments,
|
|
217
|
+
" ",
|
|
218
|
+
a.comments === 1 ? "comment" : "comments"
|
|
219
|
+
] }),
|
|
220
|
+
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
221
|
+
/* @__PURE__ */ r("button", { type: "button", className: f, onClick: () => void s(a.path), children: [
|
|
222
|
+
/* @__PURE__ */ e($, { className: "h-3 w-3" }),
|
|
223
|
+
"Copy"
|
|
224
|
+
] }),
|
|
225
|
+
u === a.id ? /* @__PURE__ */ e(
|
|
226
|
+
"button",
|
|
227
|
+
{
|
|
228
|
+
type: "button",
|
|
229
|
+
className: y(f, "text-red-600 dark:text-red-400"),
|
|
230
|
+
onClick: async () => {
|
|
231
|
+
try {
|
|
232
|
+
await d.revokeLink(a.id);
|
|
233
|
+
} catch (b) {
|
|
234
|
+
w(b, "Could not turn the link off");
|
|
235
|
+
}
|
|
236
|
+
l(null);
|
|
237
|
+
},
|
|
238
|
+
children: "Turn off for everyone"
|
|
239
|
+
}
|
|
240
|
+
) : /* @__PURE__ */ e("button", { type: "button", className: f, onClick: () => l(a.id), children: "Turn off" })
|
|
241
|
+
] })
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
a.id
|
|
245
|
+
))
|
|
246
|
+
] });
|
|
247
|
+
}
|
|
248
|
+
function z({
|
|
249
|
+
layoutId: o,
|
|
250
|
+
comments: n,
|
|
251
|
+
fieldLabel: m,
|
|
252
|
+
onSelectField: d
|
|
253
|
+
}) {
|
|
254
|
+
const c = v(o);
|
|
255
|
+
return n.length === 0 ? /* @__PURE__ */ e("p", { className: x, children: "No comments yet. People with a preview link leave them here." }) : /* @__PURE__ */ e("ul", { className: "space-y-1.5", children: n.map((t) => /* @__PURE__ */ r(
|
|
256
|
+
"li",
|
|
257
|
+
{
|
|
258
|
+
"data-preview-comment": t.id,
|
|
259
|
+
className: "rounded-md bg-slate-50 px-2.5 py-1.5 dark:bg-muted/40",
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
262
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 truncate font-semibold text-slate-700 dark:text-foreground", children: t.field ? m(t.field) : "Whole form" }),
|
|
263
|
+
/* @__PURE__ */ r("span", { className: "shrink-0", children: [
|
|
264
|
+
"· ",
|
|
265
|
+
t.name,
|
|
266
|
+
" · ",
|
|
267
|
+
O(t.at)
|
|
268
|
+
] }),
|
|
269
|
+
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
270
|
+
t.field && d && /* @__PURE__ */ e(
|
|
271
|
+
"button",
|
|
272
|
+
{
|
|
273
|
+
type: "button",
|
|
274
|
+
"aria-label": "Select this field",
|
|
275
|
+
"data-tip": "Select this field on the canvas",
|
|
276
|
+
className: f,
|
|
277
|
+
onClick: () => d(t.field),
|
|
278
|
+
children: /* @__PURE__ */ e(q, { className: "h-3 w-3" })
|
|
279
|
+
}
|
|
280
|
+
),
|
|
281
|
+
/* @__PURE__ */ e(
|
|
282
|
+
"button",
|
|
283
|
+
{
|
|
284
|
+
type: "button",
|
|
285
|
+
"aria-label": "Resolve comment",
|
|
286
|
+
"data-tip": "Resolve: remove the comment",
|
|
287
|
+
className: f,
|
|
288
|
+
onClick: async () => {
|
|
289
|
+
try {
|
|
290
|
+
await c.resolveComment(t.id);
|
|
291
|
+
} catch (i) {
|
|
292
|
+
w(i, "Could not resolve the comment");
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
children: /* @__PURE__ */ e(A, { className: "h-3 w-3" })
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
] }),
|
|
299
|
+
/* @__PURE__ */ e("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-[12.5px] text-slate-800 dark:text-foreground", children: t.text })
|
|
300
|
+
]
|
|
301
|
+
},
|
|
302
|
+
t.id
|
|
303
|
+
)) });
|
|
304
|
+
}
|
|
305
|
+
function ce({
|
|
306
|
+
layoutId: o,
|
|
307
|
+
fields: n,
|
|
308
|
+
onSelectField: m
|
|
309
|
+
}) {
|
|
310
|
+
const [d, c] = p(!1), { data: t } = S(o), { data: i = [] } = M(o), h = (l) => {
|
|
311
|
+
var s;
|
|
312
|
+
return ((s = n.find((a) => a.field === l)) == null ? void 0 : s.label) || l;
|
|
313
|
+
}, u = ((t == null ? void 0 : t.watchers) ?? []).filter((l) => {
|
|
314
|
+
var s;
|
|
315
|
+
return l.id !== ((s = t == null ? void 0 : t.owner) == null ? void 0 : s.id);
|
|
316
|
+
});
|
|
317
|
+
return /* @__PURE__ */ r(F, { open: d, onOpenChange: c, children: [
|
|
318
|
+
/* @__PURE__ */ e(
|
|
319
|
+
_,
|
|
320
|
+
{
|
|
321
|
+
popover: !0,
|
|
322
|
+
onOpen: () => c(!0),
|
|
323
|
+
label: "Share & watchers",
|
|
324
|
+
ariaLabel: "Share",
|
|
325
|
+
icon: /* @__PURE__ */ e(R, { className: "h-3.5 w-3.5" }),
|
|
326
|
+
tip: "Owner, watchers, preview links and comments",
|
|
327
|
+
hint: "Owner, watchers, preview links, comments",
|
|
328
|
+
badge: i.length || void 0,
|
|
329
|
+
data: { "data-form-share": "" },
|
|
330
|
+
trailing: i.length > 0 && /* @__PURE__ */ r(
|
|
331
|
+
"span",
|
|
332
|
+
{
|
|
333
|
+
"data-preview-comment-count": "",
|
|
334
|
+
className: "inline-flex h-4 min-w-4 items-center justify-center gap-0.5 rounded-full bg-nvr-cyan/15 px-1 text-[10.5px] font-semibold text-[#0089ad] dark:text-nvr-cyan",
|
|
335
|
+
children: [
|
|
336
|
+
/* @__PURE__ */ e(P, { className: "h-2.5 w-2.5" }),
|
|
337
|
+
i.length
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
)
|
|
341
|
+
}
|
|
342
|
+
),
|
|
343
|
+
/* @__PURE__ */ r(
|
|
344
|
+
U,
|
|
345
|
+
{
|
|
346
|
+
align: "end",
|
|
347
|
+
className: "max-h-[min(75vh,620px)] w-[400px] space-y-4 overflow-y-auto overscroll-contain p-3",
|
|
348
|
+
children: [
|
|
349
|
+
/* @__PURE__ */ r("section", { className: "space-y-1.5", children: [
|
|
350
|
+
/* @__PURE__ */ e("h3", { className: g, children: "Owner" }),
|
|
351
|
+
/* @__PURE__ */ e(Q, { layoutId: o, owner: (t == null ? void 0 : t.owner) ?? null }),
|
|
352
|
+
/* @__PURE__ */ e("p", { className: x, children: "The business owner hears first about change requests and every saved change." })
|
|
353
|
+
] }),
|
|
354
|
+
(t == null ? void 0 : t.review) && /* @__PURE__ */ r("section", { className: "space-y-1.5", "data-form-review-section": "", children: [
|
|
355
|
+
/* @__PURE__ */ e("h3", { className: g, children: "Review reminder" }),
|
|
356
|
+
/* @__PURE__ */ e(V, { layoutId: o, review: t.review, hasOwner: !!t.owner })
|
|
357
|
+
] }),
|
|
358
|
+
/* @__PURE__ */ r("section", { className: "space-y-1", children: [
|
|
359
|
+
/* @__PURE__ */ e("h3", { className: g, children: "Watching" }),
|
|
360
|
+
/* @__PURE__ */ e("p", { className: x, children: u.length === 0 ? "No one else watches this form. Use the bell to watch it yourself." : u.map((l) => l.name).join(", ") })
|
|
361
|
+
] }),
|
|
362
|
+
/* @__PURE__ */ r("section", { className: "space-y-1.5", children: [
|
|
363
|
+
/* @__PURE__ */ e("h3", { className: g, children: "Preview link" }),
|
|
364
|
+
/* @__PURE__ */ e(X, { layoutId: o, open: d })
|
|
365
|
+
] }),
|
|
366
|
+
/* @__PURE__ */ r("section", { className: "space-y-1.5", children: [
|
|
367
|
+
/* @__PURE__ */ e("h3", { className: g, children: "Comments from previews" }),
|
|
368
|
+
/* @__PURE__ */ e(
|
|
369
|
+
z,
|
|
370
|
+
{
|
|
371
|
+
layoutId: o,
|
|
372
|
+
comments: i,
|
|
373
|
+
fieldLabel: h,
|
|
374
|
+
onSelectField: m ? (l) => {
|
|
375
|
+
m(l), c(!1);
|
|
376
|
+
} : void 0
|
|
377
|
+
}
|
|
378
|
+
)
|
|
379
|
+
] })
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
)
|
|
383
|
+
] });
|
|
384
|
+
}
|
|
385
|
+
export {
|
|
386
|
+
ce as ShareButton,
|
|
387
|
+
le as WatchButton
|
|
388
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { useQuery as s, useQueryClient as m } from "@tanstack/react-query";
|
|
2
|
+
import { useCallback as b } from "react";
|
|
3
|
+
import { useNivaroClient as i } from "../../../context.js";
|
|
4
|
+
import { get as c, del as w, post as q, put as l } from "../../../lib/commands.js";
|
|
5
|
+
const u = {
|
|
6
|
+
one: (e) => ["layout-editor", "collab", e],
|
|
7
|
+
owners: () => ["layout-editor", "collab", "owners"],
|
|
8
|
+
links: (e) => ["layout-editor", "collab", e, "links"],
|
|
9
|
+
comments: (e) => ["layout-editor", "collab", e, "comments"]
|
|
10
|
+
}, r = (e, t) => (e == null ? void 0 : e.data) ?? t;
|
|
11
|
+
function $(e) {
|
|
12
|
+
const t = i();
|
|
13
|
+
return s({
|
|
14
|
+
queryKey: u.one(e),
|
|
15
|
+
queryFn: async () => r(await t.request(c(`/layout-collab/${e}`)), {
|
|
16
|
+
owner: null,
|
|
17
|
+
watching: !1,
|
|
18
|
+
watchers: []
|
|
19
|
+
}),
|
|
20
|
+
staleTime: 3e4
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function d(e, t) {
|
|
24
|
+
const o = i();
|
|
25
|
+
return s({
|
|
26
|
+
queryKey: u.links(e),
|
|
27
|
+
queryFn: async () => r(await o.request(c(`/layout-collab/${e}/preview-links`)), []),
|
|
28
|
+
enabled: t,
|
|
29
|
+
staleTime: 15e3
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function C(e) {
|
|
33
|
+
const t = i();
|
|
34
|
+
return s({
|
|
35
|
+
queryKey: u.comments(e),
|
|
36
|
+
queryFn: async () => r(await t.request(c(`/layout-collab/${e}/preview-comments`)), []),
|
|
37
|
+
staleTime: 3e4,
|
|
38
|
+
refetchOnWindowFocus: !0
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function h(e) {
|
|
42
|
+
const t = i(), o = m(), a = b(
|
|
43
|
+
() => o.invalidateQueries({ queryKey: ["layout-editor", "collab"] }),
|
|
44
|
+
[o]
|
|
45
|
+
);
|
|
46
|
+
return {
|
|
47
|
+
setWatch: async (n) => {
|
|
48
|
+
await t.request(l(`/layout-collab/${e}/watch`, { on: n })), await a();
|
|
49
|
+
},
|
|
50
|
+
setOwner: async (n) => {
|
|
51
|
+
await t.request(l(`/layout-collab/${e}/owner`, { user_id: n })), await a();
|
|
52
|
+
},
|
|
53
|
+
setReviewMonths: async (n) => {
|
|
54
|
+
await t.request(l(`/layout-collab/${e}/review`, { months: n })), await a();
|
|
55
|
+
},
|
|
56
|
+
createLink: async (n) => {
|
|
57
|
+
const y = await t.request(
|
|
58
|
+
q(`/layout-collab/${e}/preview-links`, { days: n })
|
|
59
|
+
);
|
|
60
|
+
return await a(), r(y, null);
|
|
61
|
+
},
|
|
62
|
+
revokeLink: async (n) => {
|
|
63
|
+
await t.request(w(`/layout-collab/preview-links/${n}`)), await a();
|
|
64
|
+
},
|
|
65
|
+
resolveComment: async (n) => {
|
|
66
|
+
await t.request(w(`/layout-collab/${e}/preview-comments/${n}`)), await a();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function K(e) {
|
|
71
|
+
return typeof window > "u" ? e : new URL(e, window.location.origin).toString();
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
u as collabKeys,
|
|
75
|
+
K as previewUrl,
|
|
76
|
+
h as useCollabActions,
|
|
77
|
+
$ as useLayoutCollab,
|
|
78
|
+
C as usePreviewComments,
|
|
79
|
+
d as usePreviewLinks
|
|
80
|
+
};
|