@factorialco/f0-react 6.105.0 → 6.106.1

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 (28) hide show
  1. package/dist/{ChatPdfThumbnail-CV6YlrJT.js → ChatPdfThumbnail-CvPGNkfi.js} +1 -1
  2. package/dist/ChatPostComposerDialog-PqdSpYU_.js +142 -0
  3. package/dist/{CoachmarkProvider-DPVNJLZU.js → CoachmarkProvider-i6ZvFK89.js} +12132 -12059
  4. package/dist/{DocumentToolbar-BrZ13rVL.js → DocumentToolbar-DUEyzdRD.js} +2 -2
  5. package/dist/{DocxViewer-CF3W_zjV.js → DocxViewer-D6neUJ0R.js} +2 -2
  6. package/dist/{F0AiProcessingOverlay-B-MR6cMY.js → F0AiProcessingOverlay-jkio5JGp.js} +728 -766
  7. package/dist/{F0CanvasPanel-DT64c3E-.js → F0CanvasPanel-C8sTxHKI.js} +30476 -30171
  8. package/dist/{F0VideoPlayer-CFHQr9KH.js → F0VideoPlayer-C_ibK2BV.js} +1 -1
  9. package/dist/{LocationMap-Dhaq_SGK.js → LocationMap-BT9udvzN.js} +1 -1
  10. package/dist/{SheetViewer-BMj7kc1c.js → SheetViewer-DJ-x_CcQ.js} +2 -2
  11. package/dist/{TextViewer-CgLPN38a.js → TextViewer-Bmz2gWSJ.js} +2 -2
  12. package/dist/ai.d.ts +195 -20
  13. package/dist/ai.js +2 -2
  14. package/dist/component-status.d.ts +12 -12
  15. package/dist/component-status.js +1 -1
  16. package/dist/{experimental-CGRTS8ta.js → experimental-BU2O7g5B.js} +18465 -17453
  17. package/dist/experimental.d.ts +908 -18
  18. package/dist/experimental.js +161 -159
  19. package/dist/f0.d.ts +202 -20
  20. package/dist/f0.js +205 -205
  21. package/dist/i18n-provider-defaults.d.ts +184 -12
  22. package/dist/i18n-provider-defaults.js +210 -3
  23. package/dist/{index-CLLyZsKL.js → index-Ba2G26pm.js} +3 -3
  24. package/dist/index-BcRGcyyC.js +4 -0
  25. package/dist/{pdfWorker-BgsVA819.js → pdfWorker-CdrPQX6i.js} +2 -2
  26. package/dist/styles.css +1 -1
  27. package/package.json +1 -1
  28. package/dist/index-B1S8Pxtc.js +0 -4
@@ -1,5 +1,5 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { D as l, P as d, e as s } from "./pdfWorker-BgsVA819.js";
2
+ import { D as l, P as d, e as s } from "./pdfWorker-CdrPQX6i.js";
3
3
  s();
4
4
  const f = ({
5
5
  url: n,
@@ -0,0 +1,142 @@
1
+ import { jsx as c, jsxs as I } from "react/jsx-runtime";
2
+ import { useRef as M, useState as n, useCallback as v } from "react";
3
+ import { F as R } from "./CoachmarkProvider-i6ZvFK89.js";
4
+ import { u as _, m as x } from "./F0CanvasPanel-C8sTxHKI.js";
5
+ import { u as B, a as L, s as P } from "./experimental-BU2O7g5B.js";
6
+ const N = 140, O = 1e4, K = ({
7
+ onClose: d,
8
+ searchMembers: f
9
+ }) => {
10
+ const t = _(), { createPost: p } = B(), y = L(), a = M(null), [r, D] = n(""), [m, E] = n(""), [T, k] = n([]), [w, A] = n([]), [l, g] = n(!1), [H, u] = n(!1), s = r.trim().length > 0 || P(m).length > 0, b = r.trim().length > 0 && !l, h = v(() => {
11
+ y.onPostCompositionCancelled({ hadDraft: s }), d();
12
+ }, [y, s, d]), C = v(() => {
13
+ if (s) {
14
+ u(!0);
15
+ return;
16
+ }
17
+ h();
18
+ }, [s, h]), F = async () => {
19
+ if (!(!p || !b)) {
20
+ g(!0), a.current?.setError(null);
21
+ try {
22
+ const e = T.map((o) => w.find((i) => i.id === o)).filter((o) => !!o).map((o) => ({
23
+ id: o.id,
24
+ name: o.name,
25
+ avatar: o.avatar,
26
+ subtitle: o.subtitle,
27
+ profileHref: o.profileHref
28
+ }));
29
+ await p({
30
+ title: r.trim(),
31
+ description: P(m).length > 0 ? m : void 0,
32
+ mentions: e.length > 0 ? e : void 0
33
+ }), a.current?.clear(), d();
34
+ } catch {
35
+ a.current?.setError(t.chat.community.publishError);
36
+ } finally {
37
+ g(!1);
38
+ }
39
+ }
40
+ };
41
+ return H ? /* @__PURE__ */ c(
42
+ x,
43
+ {
44
+ isOpen: !0,
45
+ onClose: () => u(!1),
46
+ width: "sm",
47
+ title: t.chat.community.discardTitle,
48
+ description: t.chat.community.discardDescription,
49
+ primaryAction: {
50
+ label: t.chat.community.discard,
51
+ onClick: h
52
+ },
53
+ secondaryAction: {
54
+ label: t.chat.community.keepEditing,
55
+ onClick: () => u(!1)
56
+ },
57
+ children: null
58
+ }
59
+ ) : /* @__PURE__ */ c(
60
+ x,
61
+ {
62
+ isOpen: !0,
63
+ onClose: C,
64
+ width: "lg",
65
+ title: t.chat.community.newPost,
66
+ children: /* @__PURE__ */ I(
67
+ "div",
68
+ {
69
+ className: "flex flex-col gap-3",
70
+ "data-testid": "chat-post-composer-dialog",
71
+ children: [
72
+ /* @__PURE__ */ c(
73
+ "input",
74
+ {
75
+ type: "text",
76
+ "aria-label": t.chat.community.postTitle,
77
+ placeholder: t.chat.community.postTitlePlaceholder,
78
+ value: r,
79
+ maxLength: N,
80
+ autoFocus: !0,
81
+ disabled: l,
82
+ onChange: (e) => D(e.target.value),
83
+ onKeyDown: (e) => {
84
+ e.key === "Enter" && e.preventDefault();
85
+ },
86
+ className: "w-full rounded-md border border-solid border-f1-border-secondary bg-f1-background px-3 py-2 text-lg font-medium text-f1-foreground outline-none placeholder:font-normal placeholder:text-f1-foreground-tertiary focus-visible:border-f1-border-selected"
87
+ }
88
+ ),
89
+ /* @__PURE__ */ c(
90
+ R,
91
+ {
92
+ ref: a,
93
+ title: t.chat.community.newPost,
94
+ placeholder: t.chat.community.postBodyPlaceholder,
95
+ height: "md",
96
+ plainHtmlMode: !0,
97
+ maxCharacters: O,
98
+ disabled: l,
99
+ mentionsConfig: f ? {
100
+ users: [],
101
+ onMentionQueryStringChanged: async (e) => {
102
+ const o = await f(e);
103
+ return A(o), o.map(
104
+ (i) => ({
105
+ id: i.id,
106
+ label: i.name,
107
+ image_url: i.avatar && "src" in i.avatar ? i.avatar.src ?? void 0 : void 0,
108
+ href: i.profileHref
109
+ })
110
+ );
111
+ }
112
+ } : void 0,
113
+ onChange: (e) => {
114
+ E(e.value ?? ""), k(e.mentionIds ?? []);
115
+ },
116
+ primaryAction: {
117
+ action: {
118
+ label: t.chat.community.publish,
119
+ onClick: () => {
120
+ F();
121
+ },
122
+ disabled: !b,
123
+ variant: "default"
124
+ }
125
+ },
126
+ secondaryAction: {
127
+ label: t.chat.community.cancel,
128
+ onClick: C,
129
+ disabled: l,
130
+ variant: "outline"
131
+ }
132
+ }
133
+ )
134
+ ]
135
+ }
136
+ )
137
+ }
138
+ );
139
+ };
140
+ export {
141
+ K as ChatPostComposerDialog
142
+ };