@estiva-app/ui 0.98.1 → 0.99.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.
Files changed (193) hide show
  1. package/README.md +1 -1
  2. package/dist/AppProvider.d.ts +6 -3
  3. package/dist/AppProvider.d.ts.map +1 -1
  4. package/dist/ArchiveDialog.d.ts +35 -0
  5. package/dist/ArchiveDialog.d.ts.map +1 -0
  6. package/dist/AttachedCard.d.ts +13 -2
  7. package/dist/AttachedCard.d.ts.map +1 -1
  8. package/dist/Card.d.ts +6 -1
  9. package/dist/Card.d.ts.map +1 -1
  10. package/dist/ChipInput.d.ts +3 -1
  11. package/dist/ChipInput.d.ts.map +1 -1
  12. package/dist/CollapsibleSection.d.ts +27 -2
  13. package/dist/CollapsibleSection.d.ts.map +1 -1
  14. package/dist/CommentBox.d.ts +2 -2
  15. package/dist/CommentBox.d.ts.map +1 -1
  16. package/dist/ConfirmDialog.d.ts +15 -2
  17. package/dist/ConfirmDialog.d.ts.map +1 -1
  18. package/dist/ConversationCard.d.ts +6 -1
  19. package/dist/ConversationCard.d.ts.map +1 -1
  20. package/dist/ConversationLayout.d.ts +19 -4
  21. package/dist/ConversationLayout.d.ts.map +1 -1
  22. package/dist/ConversationPlace.d.ts +17 -0
  23. package/dist/ConversationPlace.d.ts.map +1 -0
  24. package/dist/DocumentEditor.d.ts +38 -0
  25. package/dist/DocumentEditor.d.ts.map +1 -1
  26. package/dist/DocumentField.d.ts +50 -0
  27. package/dist/DocumentField.d.ts.map +1 -0
  28. package/dist/EditableText.d.ts +38 -4
  29. package/dist/EditableText.d.ts.map +1 -1
  30. package/dist/EmptyState.d.ts +10 -5
  31. package/dist/EmptyState.d.ts.map +1 -1
  32. package/dist/FormDialog.d.ts +38 -0
  33. package/dist/FormDialog.d.ts.map +1 -0
  34. package/dist/InlineText.d.ts.map +1 -1
  35. package/dist/MoveDialog.d.ts +61 -0
  36. package/dist/MoveDialog.d.ts.map +1 -0
  37. package/dist/NavItem.d.ts +9 -2
  38. package/dist/NavItem.d.ts.map +1 -1
  39. package/dist/NavTree.d.ts +16 -3
  40. package/dist/NavTree.d.ts.map +1 -1
  41. package/dist/PinnedComment.d.ts +3 -1
  42. package/dist/PinnedComment.d.ts.map +1 -1
  43. package/dist/ReactionHorizon.d.ts +3 -1
  44. package/dist/ReactionHorizon.d.ts.map +1 -1
  45. package/dist/ResolveDialog.d.ts +3 -1
  46. package/dist/ResolveDialog.d.ts.map +1 -1
  47. package/dist/SelectionToolbar.d.ts +2 -2
  48. package/dist/Thread.d.ts +6 -3
  49. package/dist/Thread.d.ts.map +1 -1
  50. package/dist/commentBoxFrame.d.ts.map +1 -1
  51. package/dist/conversation.examples.d.ts +4 -1
  52. package/dist/conversation.examples.d.ts.map +1 -1
  53. package/dist/conversationScroll.d.ts +80 -0
  54. package/dist/conversationScroll.d.ts.map +1 -0
  55. package/dist/editor.d.ts +1 -0
  56. package/dist/editor.d.ts.map +1 -1
  57. package/dist/editor.js +228 -69
  58. package/dist/editor.js.map +4 -4
  59. package/dist/eslint/index.js +2 -2
  60. package/dist/eslint/index.js.map +2 -2
  61. package/dist/eslint/no-field-outside-a-form.d.ts +2 -2
  62. package/dist/eslint/no-field-outside-a-form.d.ts.map +1 -1
  63. package/dist/eslint/no-native-title.d.ts +1 -1
  64. package/dist/eslint/no-native-title.d.ts.map +1 -1
  65. package/dist/formBusy.d.ts +5 -2
  66. package/dist/formBusy.d.ts.map +1 -1
  67. package/dist/index.d.ts +14 -6
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +2207 -1463
  70. package/dist/index.js.map +4 -4
  71. package/dist/looks.d.ts +8 -0
  72. package/dist/looks.d.ts.map +1 -1
  73. package/dist/seenOnScreen.d.ts +27 -0
  74. package/dist/seenOnScreen.d.ts.map +1 -0
  75. package/dist/showInConversation.d.ts +31 -0
  76. package/dist/showInConversation.d.ts.map +1 -0
  77. package/dist/threadCard.d.ts +13 -0
  78. package/dist/threadCard.d.ts.map +1 -1
  79. package/package.json +1 -1
  80. package/registry.json +784 -25
  81. package/src/AppProvider.mdx +4 -0
  82. package/src/AppProvider.test.tsx +34 -2
  83. package/src/AppProvider.tsx +17 -6
  84. package/src/ArchiveDialog.mdx +70 -0
  85. package/src/ArchiveDialog.stories.tsx +64 -0
  86. package/src/ArchiveDialog.test.tsx +90 -0
  87. package/src/ArchiveDialog.tsx +70 -0
  88. package/src/AttachedCard.mdx +6 -0
  89. package/src/AttachedCard.stories.tsx +9 -1
  90. package/src/AttachedCard.test.tsx +111 -2
  91. package/src/AttachedCard.tsx +77 -7
  92. package/src/Card.mdx +20 -1
  93. package/src/Card.stories.tsx +20 -0
  94. package/src/Card.test.tsx +87 -1
  95. package/src/Card.tsx +51 -3
  96. package/src/ChipInput.mdx +7 -1
  97. package/src/ChipInput.stories.tsx +9 -0
  98. package/src/ChipInput.test.tsx +42 -0
  99. package/src/ChipInput.tsx +7 -3
  100. package/src/CollapsibleSection.mdx +20 -1
  101. package/src/CollapsibleSection.stories.tsx +19 -1
  102. package/src/CollapsibleSection.test.tsx +85 -2
  103. package/src/CollapsibleSection.tsx +54 -15
  104. package/src/CommentBox.mdx +2 -1
  105. package/src/CommentBox.test.tsx +81 -1
  106. package/src/CommentBox.tsx +32 -11
  107. package/src/ConfirmDialog.mdx +25 -3
  108. package/src/ConfirmDialog.stories.tsx +27 -0
  109. package/src/ConfirmDialog.test.tsx +87 -1
  110. package/src/ConfirmDialog.tsx +39 -8
  111. package/src/ConversationCard.mdx +3 -0
  112. package/src/ConversationCard.stories.tsx +11 -1
  113. package/src/ConversationCard.test.tsx +76 -0
  114. package/src/ConversationCard.tsx +52 -48
  115. package/src/ConversationLayout.mdx +30 -4
  116. package/src/ConversationLayout.scroll.test.tsx +411 -0
  117. package/src/ConversationLayout.stories.tsx +79 -1
  118. package/src/ConversationLayout.test.tsx +79 -0
  119. package/src/ConversationLayout.tsx +136 -15
  120. package/src/ConversationPlace.mdx +53 -0
  121. package/src/ConversationPlace.stories.tsx +48 -0
  122. package/src/ConversationPlace.test.tsx +51 -0
  123. package/src/ConversationPlace.tsx +30 -0
  124. package/src/DocumentEditor.mdx +2 -1
  125. package/src/DocumentEditor.tsx +118 -64
  126. package/src/DocumentField.mdx +83 -0
  127. package/src/DocumentField.stories.tsx +110 -0
  128. package/src/DocumentField.test.tsx +281 -0
  129. package/src/DocumentField.tsx +199 -0
  130. package/src/EditableText.buttons.test.tsx +318 -0
  131. package/src/EditableText.mdx +50 -2
  132. package/src/EditableText.stories.tsx +96 -2
  133. package/src/EditableText.tsx +189 -5
  134. package/src/EmptyState.mdx +33 -8
  135. package/src/EmptyState.stories.tsx +26 -1
  136. package/src/EmptyState.test.tsx +63 -2
  137. package/src/EmptyState.tsx +28 -6
  138. package/src/Form.mdx +3 -1
  139. package/src/FormDialog.mdx +78 -0
  140. package/src/FormDialog.stories.tsx +90 -0
  141. package/src/FormDialog.test.tsx +183 -0
  142. package/src/FormDialog.tsx +93 -0
  143. package/src/InlineText.mdx +1 -0
  144. package/src/InlineText.tsx +2 -1
  145. package/src/MoveDialog.mdx +74 -0
  146. package/src/MoveDialog.stories.tsx +121 -0
  147. package/src/MoveDialog.test.tsx +203 -0
  148. package/src/MoveDialog.tsx +183 -0
  149. package/src/NavItem.mdx +15 -0
  150. package/src/NavItem.stories.tsx +15 -0
  151. package/src/NavItem.test.tsx +64 -1
  152. package/src/NavItem.tsx +10 -2
  153. package/src/NavTree.mdx +26 -4
  154. package/src/NavTree.stories.tsx +59 -0
  155. package/src/NavTree.test.tsx +232 -2
  156. package/src/NavTree.tsx +93 -43
  157. package/src/PinnedComment.mdx +6 -1
  158. package/src/PinnedComment.stories.tsx +11 -1
  159. package/src/PinnedComment.tsx +15 -2
  160. package/src/ReactionHorizon.mdx +2 -0
  161. package/src/ReactionHorizon.stories.tsx +3 -0
  162. package/src/ReactionHorizon.test.tsx +32 -0
  163. package/src/ReactionHorizon.tsx +28 -11
  164. package/src/ReplyCard.mdx +3 -0
  165. package/src/ReplyCard.stories.tsx +19 -1
  166. package/src/ResolveDialog.mdx +2 -0
  167. package/src/ResolveDialog.test.tsx +21 -0
  168. package/src/ResolveDialog.tsx +11 -39
  169. package/src/SelectionToolbar.tsx +2 -2
  170. package/src/Textarea.mdx +1 -0
  171. package/src/Thread.mdx +18 -1
  172. package/src/Thread.stories.tsx +55 -3
  173. package/src/Thread.test.tsx +11 -0
  174. package/src/Thread.tsx +53 -11
  175. package/src/commentBoxFrame.tsx +2 -2
  176. package/src/conversation.examples.tsx +10 -2
  177. package/src/conversationScroll.ts +155 -0
  178. package/src/editor.ts +1 -0
  179. package/src/editorSelection.test.tsx +53 -0
  180. package/src/eslint/no-field-outside-a-form.test.ts +4 -0
  181. package/src/eslint/no-field-outside-a-form.ts +2 -2
  182. package/src/eslint/no-native-title.ts +1 -1
  183. package/src/formBusy.ts +5 -2
  184. package/src/index.ts +16 -6
  185. package/src/looks.ts +10 -0
  186. package/src/registry/registry.test.ts +12 -6
  187. package/src/seenOnScreen.test.tsx +182 -0
  188. package/src/seenOnScreen.ts +146 -0
  189. package/src/showInConversation.test.tsx +168 -0
  190. package/src/showInConversation.ts +93 -0
  191. package/src/threadCard.ts +16 -0
  192. package/stories/Choosing.mdx +7 -2
  193. package/tailwind-preset.js +7 -0
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,KAAK,MAAM,EAAE,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAEnL,OAAO,EACL,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,YAA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AAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxI,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAA"}
package/dist/editor.js CHANGED
@@ -1583,8 +1583,11 @@ import { richTextClassName } from "@estiva-app/ui";
1583
1583
  import { ScrollArea } from "@estiva-app/ui";
1584
1584
 
1585
1585
  // src/looks.ts
1586
+ var FIELD_SHELL_CLASSES = "bg-bg-field border border-border-field shadow-field hover:border-border-strong group-hover/field:border-border-strong rounded-lg transition-colors";
1587
+ var FIELD_SHELL_FOCUS_CLASSES = "focus-within:border-border-focus focus-within:hover:border-border-focus group-hover/field:focus-within:border-border-focus signal:transition-shadow signal:focus-within:shadow-focus-ring";
1586
1588
  var FLOATING_SURFACE_CLASSES = "rounded-lg border border-border-default bg-bg-elevated shadow-lg";
1587
1589
  var WRITING_BOX_CLASSES = "relative bg-bg-field border border-border-field rounded-lg p-3 flex flex-col gap-4";
1590
+ var EDITOR_SELECTION_CLASSES = "selection:bg-bg-selected";
1588
1591
  var BOX_HINT_CLASSES = "min-w-0 truncate select-none text-caption text-text-muted signal:font-mono signal:text-menu signal:font-normal signal:tracking-wider";
1589
1592
  var WRITING_RING_CLASSES = "signal:transition-shadow signal:focus-within:border-border-focus signal:focus-within:shadow-focus-ring";
1590
1593
  var LINK_UNDERLINE_CLASSES = "no-underline bg-[linear-gradient(currentColor,currentColor)] bg-[length:100%_1px] bg-bottom bg-no-repeat";
@@ -1592,7 +1595,7 @@ var WEB_LINK_CLASSES = `${LINK_UNDERLINE_CLASSES} before:content-[''] before:inl
1592
1595
 
1593
1596
  // src/commentBoxFrame.tsx
1594
1597
  import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
1595
- var COMPOSE_EDITOR_CLASSES = richTextClassName("default", "outline-none w-full bg-transparent min-h-[20px] [&>p+p]:-mt-1");
1598
+ var COMPOSE_EDITOR_CLASSES = richTextClassName("default", cn("outline-none w-full bg-transparent min-h-[20px] [&>p+p]:-mt-1", EDITOR_SELECTION_CLASSES));
1596
1599
  var COMPOSE_SCROLL_CLASSES = { area: "-mr-3", viewport: "max-h-[50vh]", content: "pr-3" };
1597
1600
  var ComposeKeys = Extension6.create({
1598
1601
  name: "composeKeys",
@@ -2276,6 +2279,7 @@ var PastedImages = Extension9.create({
2276
2279
  // src/CommentBox.tsx
2277
2280
  import { ToolbarButton as ToolbarButton2 } from "@estiva-app/ui";
2278
2281
  import { caretOnOpen } from "@estiva-app/ui";
2282
+ import { sendsInLayout } from "@estiva-app/ui";
2279
2283
  import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
2280
2284
  var ATTACH_EVENT = "commentbox:attach";
2281
2285
  var askForFile = (editor) => editor.view.dom.dispatchEvent(new CustomEvent(ATTACH_EVENT, { bubbles: true }));
@@ -2436,7 +2440,20 @@ var holdsUrgent = (editor) => {
2436
2440
  return found;
2437
2441
  };
2438
2442
  var fileCount = 0;
2439
- function CommentBox({
2443
+ function ClosedLine({ reason, className }) {
2444
+ return /* @__PURE__ */ jsxs5(Card, { fill: "inset", className: cn2("flex items-start gap-3 px-4 py-3", className), children: [
2445
+ /* @__PURE__ */ jsx7(IconLock, { size: 16, stroke: 1.5, className: "mt-0.5 shrink-0 text-text-muted", "aria-hidden": true }),
2446
+ /* @__PURE__ */ jsx7("p", { className: "text-body-2 text-text-secondary", children: reason })
2447
+ ] });
2448
+ }
2449
+ function CommentBox(props) {
2450
+ const { closed, className } = props;
2451
+ const [built, setBuilt] = useState3(!closed);
2452
+ if (!closed && !built) setBuilt(true);
2453
+ if (closed && !built) return /* @__PURE__ */ jsx7(ClosedLine, { reason: closed.reason, className });
2454
+ return /* @__PURE__ */ jsx7(OpenCommentBox, { ...props });
2455
+ }
2456
+ function OpenCommentBox({
2440
2457
  people,
2441
2458
  references,
2442
2459
  referencesChanged,
@@ -2576,8 +2593,10 @@ function CommentBox({
2576
2593
  const uploading = files.some((f) => f.state === "uploading");
2577
2594
  const failed = files.filter((f) => f.state === "failed").length;
2578
2595
  const ready = files.some((f) => f.state === "ready");
2596
+ const layout = useContext(sendsInLayout);
2579
2597
  const go = useCallback4(
2580
2598
  (ed) => {
2599
+ layout?.sending();
2581
2600
  const body = ed.getJSON();
2582
2601
  const sent = files.filter((f) => f.state === "ready");
2583
2602
  const sentUnder = underOf(body);
@@ -2590,6 +2609,7 @@ function CommentBox({
2590
2609
  onSent?.(body, sent, sentUnder);
2591
2610
  void answered(send(body, sent, sentUnder)).then((answer) => {
2592
2611
  if (answer.accepted) return;
2612
+ layout?.refused();
2593
2613
  onRefused?.();
2594
2614
  if (ed.isDestroyed) {
2595
2615
  draft?.write(body);
@@ -2608,6 +2628,7 @@ function CommentBox({
2608
2628
  void answered(send(body, sent, sentUnder)).then((answer) => {
2609
2629
  setSending(false);
2610
2630
  if (!answer.accepted) {
2631
+ layout?.refused();
2611
2632
  setRefused(answer.reason);
2612
2633
  return;
2613
2634
  }
@@ -2619,7 +2640,7 @@ function CommentBox({
2619
2640
  });
2620
2641
  return false;
2621
2642
  },
2622
- [files, removed, underOf, showsAtOnce, send, draft, onSent, onRefused]
2643
+ [files, removed, underOf, showsAtOnce, send, draft, onSent, onRefused, layout]
2623
2644
  );
2624
2645
  save.current = () => {
2625
2646
  if (!editor || !edit || sending || uploading || failed > 0) return true;
@@ -2641,12 +2662,7 @@ function CommentBox({
2641
2662
  storage.send = null;
2642
2663
  };
2643
2664
  }, [editor, edit]);
2644
- if (closed) {
2645
- return /* @__PURE__ */ jsxs5(Card, { fill: "inset", className: cn2("flex items-start gap-3 px-4 py-3", className), children: [
2646
- /* @__PURE__ */ jsx7(IconLock, { size: 16, stroke: 1.5, className: "mt-0.5 shrink-0 text-text-muted", "aria-hidden": true }),
2647
- /* @__PURE__ */ jsx7("p", { className: "text-body-2 text-text-secondary", children: closed.reason })
2648
- ] });
2649
- }
2665
+ if (closed) return /* @__PURE__ */ jsx7(ClosedLine, { reason: closed.reason, className });
2650
2666
  const fileCards = files.length > 0 ? /* @__PURE__ */ jsx7(Fragment3, { children: files.map((f) => /* @__PURE__ */ jsx7(
2651
2667
  AttachmentCard,
2652
2668
  {
@@ -2798,7 +2814,7 @@ function InlineText({ value, placeholder, label, onCommit, onText, onEnter, vari
2798
2814
  "aria-multiline": "false",
2799
2815
  "aria-placeholder": placeholder,
2800
2816
  ...readOnly ? { "aria-readonly": "true" } : {},
2801
- class: "outline-none"
2817
+ class: cn3("outline-none", EDITOR_SELECTION_CLASSES)
2802
2818
  },
2803
2819
  handleKeyDown: (view, event) => {
2804
2820
  if (event.key === "Enter") {
@@ -3582,6 +3598,7 @@ import { EditorContent as EditorContent3, useEditor as useEditor2, useEditorStat
3582
3598
  import { TableKit } from "@tiptap/extension-table";
3583
3599
  import { IconMessagePlus } from "@tabler/icons-react";
3584
3600
  import { Button as Button2 } from "@estiva-app/ui";
3601
+ import { cn as cn5 } from "@estiva-app/ui";
3585
3602
  import { FieldLine as FieldLine2 } from "@estiva-app/ui";
3586
3603
  import { FilePicker as FilePicker2 } from "@estiva-app/ui";
3587
3604
  import { richTextClassName as richTextClassName2 } from "@estiva-app/ui";
@@ -3737,64 +3754,21 @@ function DocumentEditor({
3737
3754
  attachTo.current = attach;
3738
3755
  const editor = useEditor2(
3739
3756
  {
3740
- extensions: [
3741
- DocumentKit.configure({
3742
- strike: false,
3743
- heading: { levels: [1, 2, 3] },
3744
- dropcursor: blockDropCursor,
3745
- codeBlock: false,
3746
- // A link on words is made by pasting a URL over them or by the strip's Link, and opens on a click, as a bare
3747
- // address does — through `BareLinks`, which opens only a followable address and never hands the tab this window;
3748
- // Tiptap's own click opens without that. A bare address stays text: a link made on it by typing would change what is saved.
3749
- link: { openOnClick: false, shouldAutoLink: () => false, HTMLAttributes: LINK_MARK_ATTRIBUTES }
3750
- }),
3751
- PasteOverWords,
3752
- KeptSelection,
3753
- BareLinks,
3754
- CodeBlockColours,
3755
- TableKit.configure({ table: { resizable: false } }),
3756
- BlockId,
3757
- Checklist,
3758
- Callout,
3759
- // A link is being edited only while the caret is on its line: anywhere else on the page it previews on hover.
3760
- ReferenceNode.configure({ view: referenceView ?? null, editingLine: true }),
3761
- // A link's chip in a sentence, its row alone on its line, its card in the row's place (SPEC §13.3).
3762
- LinkPlaces,
3763
- // A click on a link offers Open, and alone on its line Show as Row or Card.
3764
- ReferenceMenu,
3765
- UnknownBlock,
3766
- AttachmentNode.configure({ view: attachmentView ?? null }),
3767
- SlashCommands.configure({ sections: slashSections({ table, upload: !!upload, pickFile }) }),
3768
- ...references ? [
3769
- ReferenceTrigger.configure({
3770
- items: () => [],
3771
- sections: (query) => latest.current.references?.sections(query) ?? [],
3772
- subscribe: (listener) => latest.current.references?.subscribe?.(listener) ?? (() => {
3773
- }),
3774
- nodeName: "reference",
3775
- ariaLabel: references.ariaLabel,
3776
- sectionLabel: references.sectionLabel,
3777
- icon: references.icon ?? null
3778
- })
3779
- ] : [],
3780
- ...mentions ? [PersonReference.configure({ people: () => latest.current.mentions?.people() ?? [], uriOf: (person) => latest.current.mentions?.uriOf(person) ?? null })] : [],
3781
- ...linkChips ? [LinkChips.configure(linkChips)] : [],
3782
- ...upload ? [
3783
- // A pasted picture is placed as `/` File places one; text on the clipboard stays text.
3784
- PastedImages.configure({
3785
- onImages: (pasted) => {
3786
- if (!latest.current.upload) return false;
3787
- void attachTo.current(pasted);
3788
- return true;
3789
- }
3790
- })
3791
- ] : [],
3792
- // Markdown pasted as plain text lands as the blocks it spells, tables included.
3793
- ...readMarkdown ? [PastedMarkdown.configure({ read: (text) => latest.current.readMarkdown?.(text) })] : [],
3794
- // Where each comment is, drawn as a decoration, so a save never carries it.
3795
- ...onCommentOnSelection ? [CommentHighlights] : [],
3796
- ...extensions
3797
- ],
3757
+ extensions: documentExtensions({
3758
+ latest,
3759
+ references,
3760
+ mentions,
3761
+ linkChips,
3762
+ table,
3763
+ upload: !!upload,
3764
+ readMarkdown: !!readMarkdown,
3765
+ comments: !!onCommentOnSelection,
3766
+ referenceView,
3767
+ attachmentView,
3768
+ pickFile,
3769
+ attach: attachTo,
3770
+ extensions
3771
+ }),
3798
3772
  // Made once. A value coming back must not rebuild the editor under the caret; see the effect below.
3799
3773
  content: held ?? codec.read(value, format),
3800
3774
  editable: !readOnly,
@@ -3807,7 +3781,7 @@ function DocumentEditor({
3807
3781
  tabindex: "0",
3808
3782
  // A row or a card is its whole line (`LinkPlaces`), drawn on that line: a block inside it would push the
3809
3783
  // separator and trailing break ProseMirror puts beside it onto empty lines of their own (code review).
3810
- class: richTextClassName2("default", "outline-none [&_[data-link-place]]:inline-block [&_[data-link-place]]:w-full [&_[data-link-place]]:align-top")
3784
+ class: richTextClassName2("default", cn5("outline-none [&_[data-link-place]]:inline-block [&_[data-link-place]]:w-full [&_[data-link-place]]:align-top", EDITOR_SELECTION_CLASSES))
3811
3785
  },
3812
3786
  handleKeyDown: (view, event) => {
3813
3787
  if (event.key !== "Escape") return false;
@@ -3907,6 +3881,66 @@ function DocumentEditor({
3907
3881
  ] });
3908
3882
  return /* @__PURE__ */ jsx11(Fragment6, { children: wrap ? wrap(drawn, editor) : drawn });
3909
3883
  }
3884
+ function documentExtensions({ latest, references, mentions, linkChips, table, upload, readMarkdown, comments, referenceView, attachmentView, pickFile, attach, extensions }) {
3885
+ return [
3886
+ DocumentKit.configure({
3887
+ strike: false,
3888
+ heading: { levels: [1, 2, 3] },
3889
+ dropcursor: blockDropCursor,
3890
+ codeBlock: false,
3891
+ // A link on words is made by pasting a URL over them or by the strip's Link, and opens on a click, as a bare
3892
+ // address does — through `BareLinks`, which opens only a followable address and never hands the tab this window;
3893
+ // Tiptap's own click opens without that. A bare address stays text: a link made on it by typing would change what is saved.
3894
+ link: { openOnClick: false, shouldAutoLink: () => false, HTMLAttributes: LINK_MARK_ATTRIBUTES }
3895
+ }),
3896
+ PasteOverWords,
3897
+ KeptSelection,
3898
+ BareLinks,
3899
+ CodeBlockColours,
3900
+ TableKit.configure({ table: { resizable: false } }),
3901
+ BlockId,
3902
+ Checklist,
3903
+ Callout,
3904
+ // A link is being edited only while the caret is on its line: anywhere else on the page it previews on hover.
3905
+ ReferenceNode.configure({ view: referenceView ?? null, editingLine: true }),
3906
+ // A link's chip in a sentence, its row alone on its line, its card in the row's place (SPEC §13.3).
3907
+ LinkPlaces,
3908
+ // A click on a link offers Open, and alone on its line Show as Row or Card.
3909
+ ReferenceMenu,
3910
+ UnknownBlock,
3911
+ AttachmentNode.configure({ view: attachmentView ?? null }),
3912
+ SlashCommands.configure({ sections: slashSections({ table, upload, pickFile }) }),
3913
+ ...references ? [
3914
+ ReferenceTrigger.configure({
3915
+ items: () => [],
3916
+ sections: (query) => latest.current.references?.sections(query) ?? [],
3917
+ subscribe: (listener) => latest.current.references?.subscribe?.(listener) ?? (() => {
3918
+ }),
3919
+ nodeName: "reference",
3920
+ ariaLabel: references.ariaLabel,
3921
+ sectionLabel: references.sectionLabel,
3922
+ icon: references.icon ?? null
3923
+ })
3924
+ ] : [],
3925
+ ...mentions ? [PersonReference.configure({ people: () => latest.current.mentions?.people() ?? [], uriOf: (person) => latest.current.mentions?.uriOf(person) ?? null })] : [],
3926
+ ...linkChips ? [LinkChips.configure(linkChips)] : [],
3927
+ ...upload ? [
3928
+ // A pasted picture is placed as `/` File places one; text on the clipboard stays text.
3929
+ PastedImages.configure({
3930
+ onImages: (pasted) => {
3931
+ if (!latest.current.upload) return false;
3932
+ void attach.current(pasted);
3933
+ return true;
3934
+ }
3935
+ })
3936
+ ] : [],
3937
+ // Markdown pasted as plain text lands as the blocks it spells, tables included.
3938
+ ...readMarkdown ? [PastedMarkdown.configure({ read: (text) => latest.current.readMarkdown?.(text) })] : [],
3939
+ // Where each comment is, drawn as a decoration, so a save never carries it.
3940
+ ...comments ? [CommentHighlights] : [],
3941
+ ...extensions
3942
+ ];
3943
+ }
3910
3944
  function slashSections({ table, upload, pickFile }) {
3911
3945
  const insert = [
3912
3946
  // Three by three with a header row, as every app's Insert → Table makes it.
@@ -3918,6 +3952,130 @@ function slashSections({ table, upload, pickFile }) {
3918
3952
  ];
3919
3953
  return [formatSection("block"), ...insert.length > 0 ? [{ label: "Insert", commands: insert }] : []];
3920
3954
  }
3955
+
3956
+ // src/DocumentField.tsx
3957
+ import { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef7, useState as useState7 } from "react";
3958
+ import { EditorContent as EditorContent4, useEditor as useEditor3, useEditorState as useEditorState3 } from "@tiptap/react";
3959
+ import { cn as cn6 } from "@estiva-app/ui";
3960
+ import { useFormBusy } from "@estiva-app/ui";
3961
+ import { richTextClassName as richTextClassName3 } from "@estiva-app/ui";
3962
+ import { Fragment as Fragment7, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
3963
+ var NONE = [];
3964
+ var nothing = () => {
3965
+ };
3966
+ var isBlank = (editor) => {
3967
+ let blank = true;
3968
+ editor.state.doc.descendants((node) => {
3969
+ if (node.isText ? /\S/.test(node.text ?? "") : node.isLeaf && node.type.name !== "hardBreak") blank = false;
3970
+ return blank;
3971
+ });
3972
+ return blank;
3973
+ };
3974
+ function DocumentField({
3975
+ value,
3976
+ format,
3977
+ codec,
3978
+ onChange,
3979
+ label,
3980
+ placeholder,
3981
+ references,
3982
+ mentions,
3983
+ linkChips,
3984
+ readMarkdown,
3985
+ referenceView,
3986
+ attachmentView,
3987
+ extensions = NONE,
3988
+ "aria-required": required
3989
+ }) {
3990
+ const latest = useRef7({ value, format, codec, onChange, references, mentions, readMarkdown });
3991
+ useEffect8(() => {
3992
+ latest.current = { value, format, codec, onChange, references, mentions, readMarkdown };
3993
+ });
3994
+ const inFlight = useRef7([value]);
3995
+ const read = (text) => latest.current.codec.read(text, latest.current.format);
3996
+ const pickFile = useRef7(nothing);
3997
+ const attach = useRef7(async () => {
3998
+ });
3999
+ const [initial] = useState7(() => read(value));
4000
+ const editor = useEditor3(
4001
+ {
4002
+ extensions: documentExtensions({
4003
+ latest,
4004
+ references,
4005
+ mentions,
4006
+ linkChips,
4007
+ table: false,
4008
+ upload: false,
4009
+ readMarkdown: !!readMarkdown,
4010
+ comments: false,
4011
+ referenceView,
4012
+ attachmentView,
4013
+ pickFile,
4014
+ attach,
4015
+ extensions
4016
+ }),
4017
+ // Made once: a value coming back must not rebuild the editor under the caret; see the effect below.
4018
+ content: initial,
4019
+ editorProps: {
4020
+ attributes: {
4021
+ "aria-label": label,
4022
+ role: "textbox",
4023
+ "aria-multiline": "true",
4024
+ ...required !== void 0 && required !== false ? { "aria-required": "true" } : {},
4025
+ // Three lines tall at rest, as a Textarea of three rows beside it. A row or a card is its whole line (`LinkPlaces`).
4026
+ // eslint-disable-next-line token-spacing/no-restricted-classes -- @estiva-escape: three lines of the field's own text (140% of 14px each), the height of a Textarea of three rows
4027
+ class: richTextClassName3("default", cn6("outline-none min-h-[4.2em] [&_[data-link-place]]:inline-block [&_[data-link-place]]:w-full [&_[data-link-place]]:align-top", EDITOR_SELECTION_CLASSES))
4028
+ },
4029
+ /*
4030
+ Ctrl/Cmd+Enter sends the form around it, as from any of its fields. The field asks the form itself: the
4031
+ editor marks every Enter it is given as handled (a browser's Enter would otherwise change the text), and the
4032
+ form leaves a handled key alone — measured in Chrome, the form never heard it. An open list keeps its keys.
4033
+ */
4034
+ handleKeyDown: (view, event) => {
4035
+ if (event.key !== "Enter" || !(event.ctrlKey || event.metaKey) || event.altKey || event.shiftKey || isSuggestionOpen()) return false;
4036
+ const form = view.dom.closest("form");
4037
+ if (!form) return false;
4038
+ form.requestSubmit();
4039
+ return true;
4040
+ }
4041
+ },
4042
+ onUpdate: ({ editor: ed }) => {
4043
+ const next = isBlank(ed) ? { value: "" } : latest.current.codec.write(ed.getJSON());
4044
+ inFlight.current.push(next.value);
4045
+ latest.current.onChange(next.value, next.contentFormat);
4046
+ }
4047
+ },
4048
+ []
4049
+ );
4050
+ useEffect8(() => {
4051
+ if (!editor || editor.isDestroyed) return;
4052
+ const at = inFlight.current.indexOf(value);
4053
+ if (at !== -1) {
4054
+ inFlight.current = inFlight.current.slice(at + 1);
4055
+ return;
4056
+ }
4057
+ inFlight.current = [];
4058
+ editor.commands.setContent(read(value), { emitUpdate: false });
4059
+ }, [editor, value]);
4060
+ const busy = useFormBusy();
4061
+ useLayoutEffect2(() => {
4062
+ if (editor && !editor.isDestroyed && editor.isEditable === busy) editor.setEditable(!busy, false);
4063
+ }, [editor, busy]);
4064
+ const empty = useEditorState3({ editor, selector: ({ editor: ed }) => !ed || ed.isEmpty });
4065
+ const into = (event) => {
4066
+ if (event.target !== event.currentTarget || !editor) return;
4067
+ event.preventDefault();
4068
+ editor.commands.focus("end");
4069
+ };
4070
+ return /* @__PURE__ */ jsxs10(Fragment7, { children: [
4071
+ /* @__PURE__ */ jsxs10("div", { className: cn6(FIELD_SHELL_CLASSES, FIELD_SHELL_FOCUS_CLASSES, "relative cursor-text px-3 py-2"), onMouseDown: into, children: [
4072
+ /* @__PURE__ */ jsx12(EditorContent4, { editor }),
4073
+ empty && placeholder && /* @__PURE__ */ jsx12("span", { "aria-hidden": true, className: "pointer-events-none absolute left-3 top-2 text-body-2 text-text-muted", children: placeholder })
4074
+ ] }),
4075
+ /* @__PURE__ */ jsx12(SelectionToolbar, { editor, marks: ["bold", "italic", "underline", "code"], link: true }),
4076
+ /* @__PURE__ */ jsx12(ReferenceMenuView, { editor })
4077
+ ] });
4078
+ }
3921
4079
  export {
3922
4080
  AttachmentNode,
3923
4081
  BlockId,
@@ -3928,6 +4086,7 @@ export {
3928
4086
  CommentBox,
3929
4087
  CommentHighlights,
3930
4088
  DocumentEditor,
4089
+ DocumentField,
3931
4090
  EditorBlockHandle,
3932
4091
  EditorTableControls,
3933
4092
  FORMATS,