@forgedevstack/ink 1.1.8 → 1.1.9
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/CHANGELOG.md +9 -0
- package/dist/components/InkEditor/InkEditor.cjs +1 -1
- package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.js +845 -830
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -1
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +96 -82
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.cjs +1 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.cjs +1 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts +7 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.const.js +9 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts +4 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.d.ts.map +1 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.js +82 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts +8 -0
- package/dist/components/InkEditor/components/PresenceStack/PresenceStack.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/PresenceStack/index.d.ts +3 -0
- package/dist/components/InkEditor/components/PresenceStack/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.cjs +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.cjs +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts +7 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.const.js +10 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts +4 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.js +65 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts +6 -0
- package/dist/components/InkEditor/components/RemoteCursors/RemoteCursors.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/RemoteCursors/index.d.ts +3 -0
- package/dist/components/InkEditor/components/RemoteCursors/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -1
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +35 -34
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -1
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +39 -55
- package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts +3 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.cjs +1 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts +13 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/hooks/useThemePickerMenu.js +39 -0
- package/dist/components/InkEditor/components/index.d.ts +4 -0
- package/dist/components/InkEditor/components/index.d.ts.map +1 -1
- package/dist/components/InkTabs/InkTabs.cjs +1 -0
- package/dist/components/InkTabs/InkTabs.d.ts +4 -0
- package/dist/components/InkTabs/InkTabs.d.ts.map +1 -0
- package/dist/components/InkTabs/InkTabs.js +104 -0
- package/dist/components/InkTabs/index.d.ts +2 -0
- package/dist/components/InkTabs/index.d.ts.map +1 -0
- package/dist/components/InkWorkspace/InkWorkspace.cjs +1 -0
- package/dist/components/InkWorkspace/InkWorkspace.d.ts +4 -0
- package/dist/components/InkWorkspace/InkWorkspace.d.ts.map +1 -0
- package/dist/components/InkWorkspace/InkWorkspace.js +317 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.cjs +1 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts +11 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.d.ts.map +1 -0
- package/dist/components/InkWorkspace/components/WorkspaceIcons.js +39 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.cjs +1 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts +30 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.d.ts.map +1 -0
- package/dist/components/InkWorkspace/hooks/useInkWorkspace.js +72 -0
- package/dist/components/InkWorkspace/index.d.ts +4 -0
- package/dist/components/InkWorkspace/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/constants/collab.const.cjs +1 -0
- package/dist/constants/collab.const.d.ts +20 -0
- package/dist/constants/collab.const.d.ts.map +1 -0
- package/dist/constants/collab.const.js +54 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/numbers.cjs +1 -1
- package/dist/constants/numbers.js +42 -37
- package/dist/constants/workspace.const.cjs +1 -0
- package/dist/constants/workspace.const.d.ts +24 -0
- package/dist/constants/workspace.const.d.ts.map +1 -0
- package/dist/constants/workspace.const.js +23 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useInkCollaboration.cjs +1 -0
- package/dist/hooks/useInkCollaboration.d.ts +4 -0
- package/dist/hooks/useInkCollaboration.d.ts.map +1 -0
- package/dist/hooks/useInkCollaboration.js +86 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +150 -135
- package/dist/plugins/theme/inkTheme.cjs +1 -1
- package/dist/plugins/theme/inkTheme.js +19 -22
- package/dist/styles.css +1 -1
- package/dist/types/collab.types.d.ts +55 -0
- package/dist/types/collab.types.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/ink.types.d.ts +4 -0
- package/dist/types/ink.types.d.ts.map +1 -1
- package/dist/types/workspace.types.d.ts +54 -0
- package/dist/types/workspace.types.d.ts.map +1 -0
- package/dist/utils/collab.utils.cjs +1 -0
- package/dist/utils/collab.utils.d.ts +5 -0
- package/dist/utils/collab.utils.d.ts.map +1 -0
- package/dist/utils/collab.utils.js +32 -0
- package/dist/utils/collab.utils.test.d.ts +2 -0
- package/dist/utils/collab.utils.test.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/ink.brand.test.d.ts +2 -0
- package/dist/utils/ink.brand.test.d.ts.map +1 -0
- package/dist/utils/workspace.utils.cjs +1 -0
- package/dist/utils/workspace.utils.d.ts +5 -0
- package/dist/utils/workspace.utils.d.ts.map +1 -0
- package/dist/utils/workspace.utils.js +26 -0
- package/dist/utils/workspace.utils.test.d.ts +2 -0
- package/dist/utils/workspace.utils.test.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as le } from "react";
|
|
3
|
+
import { THEME_DEFAULT as ce } from "../../plugins/theme/theme.const.js";
|
|
4
|
+
import { InkTabs as oe } from "../InkTabs/InkTabs.js";
|
|
5
|
+
import { InkEditor as g } from "../InkEditor/InkEditor.js";
|
|
6
|
+
import { PresenceStack as re } from "../InkEditor/components/PresenceStack/PresenceStack.js";
|
|
7
|
+
import { useInkWorkspace as se } from "./hooks/useInkWorkspace.js";
|
|
8
|
+
import { SidebarToggleIcon as de, SingleViewIcon as me, SplitVerticalIcon as ke, SplitHorizontalIcon as pe, SaveDocIcon as he, NewFolderIcon as Ne, FileDocumentIcon as Ee, RenamePencilIcon as _e, CloseCrossIcon as Ie } from "./components/WorkspaceIcons.js";
|
|
9
|
+
import { NUMBER_ZERO as Te, NUMBER_ONE as Ce } from "../../constants/numbers.js";
|
|
10
|
+
import { EMPTY_STRING as W } from "../../constants/generals.const.js";
|
|
11
|
+
import "../../constants/openai.const.js";
|
|
12
|
+
import { cn as m } from "../../utils/cn.utils.js";
|
|
13
|
+
import "../../utils/paste.utils.js";
|
|
14
|
+
import { Button as t } from "../../common-components/Button/Button.js";
|
|
15
|
+
import "react-dom";
|
|
16
|
+
import { INK_WORKSPACE_HIDE_EXPLORER_TITLE as f, INK_WORKSPACE_SHOW_EXPLORER_TITLE as F, INK_WORKSPACE_TITLE as M, INK_WORKSPACE_DOCS_SUFFIX as Se, INK_WORKSPACE_SPLIT_VIEW_LABEL as I, INK_WORKSPACE_SINGLE_VIEW_TITLE as be, INK_SPLIT_MODE_NONE as T, INK_WORKSPACE_SPLIT_SIDE_TITLE as ue, INK_SPLIT_MODE_VERTICAL as B, INK_WORKSPACE_SPLIT_STACKED_TITLE as Oe, INK_SPLIT_MODE_HORIZONTAL as x, INK_WORKSPACE_SAVE_TITLE as H, INK_WORKSPACE_SEARCH_PLACEHOLDER as Ke, INK_WORKSPACE_NEW_DOC_BUTTON as C, INK_WORKSPACE_NEW_FOLDER as S, INK_WORKSPACE_CLOSE_FOLDER_BUTTON as b, INK_WORKSPACE_UNTITLED_FALLBACK as Re, INK_WORKSPACE_RENAME_TITLE as U, INK_WORKSPACE_DELETE_TITLE as V } from "../../constants/workspace.const.js";
|
|
17
|
+
const Ve = (u) => {
|
|
18
|
+
const {
|
|
19
|
+
documents: p,
|
|
20
|
+
activeDocumentId: O,
|
|
21
|
+
onActiveDocumentChange: K,
|
|
22
|
+
onDocumentChange: r,
|
|
23
|
+
onDocumentDelete: N,
|
|
24
|
+
onDocumentRename: X,
|
|
25
|
+
onDocumentSave: R,
|
|
26
|
+
folders: v = [],
|
|
27
|
+
onFolderCreate: w,
|
|
28
|
+
onFolderDelete: A,
|
|
29
|
+
collaboration: s,
|
|
30
|
+
editorProps: c = {},
|
|
31
|
+
className: j = W,
|
|
32
|
+
style: G
|
|
33
|
+
} = u, {
|
|
34
|
+
sidebarOpen: h,
|
|
35
|
+
setSidebarOpen: Q,
|
|
36
|
+
splitMode: d,
|
|
37
|
+
setSplitMode: E,
|
|
38
|
+
setSecondaryDocId: Z,
|
|
39
|
+
searchQuery: $,
|
|
40
|
+
setSearchQuery: z,
|
|
41
|
+
editingDocId: Y,
|
|
42
|
+
editTitle: q,
|
|
43
|
+
setEditTitle: J,
|
|
44
|
+
activeDocument: o,
|
|
45
|
+
secondaryDocument: l,
|
|
46
|
+
filteredDocs: ee,
|
|
47
|
+
handleCreateDocument: L,
|
|
48
|
+
handleStartRename: y,
|
|
49
|
+
handleSaveRename: P,
|
|
50
|
+
handleCancelRename: ae
|
|
51
|
+
} = se(u), [ie, ne] = le(c.themeId || ce), _ = c.themeId ?? ie, D = (a) => {
|
|
52
|
+
var k;
|
|
53
|
+
ne(a), (k = c.onThemeChange) == null || k.call(c, a);
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ i(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: m("ink-workspace-root", j),
|
|
59
|
+
style: G,
|
|
60
|
+
"data-split-mode": d,
|
|
61
|
+
"data-ink-theme": _,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ i("header", { className: "ink-workspace-header", children: [
|
|
64
|
+
/* @__PURE__ */ i("div", { className: "ink-workspace-header-left", children: [
|
|
65
|
+
/* @__PURE__ */ e(
|
|
66
|
+
t,
|
|
67
|
+
{
|
|
68
|
+
type: "button",
|
|
69
|
+
className: "ink-workspace-toggle-btn",
|
|
70
|
+
onClick: () => Q(!h),
|
|
71
|
+
title: h ? f : F,
|
|
72
|
+
"aria-label": h ? f : F,
|
|
73
|
+
children: /* @__PURE__ */ e(de, {})
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ e("span", { className: "ink-workspace-title", children: M }),
|
|
77
|
+
/* @__PURE__ */ i("span", { className: "ink-workspace-count", children: [
|
|
78
|
+
"(",
|
|
79
|
+
p.length,
|
|
80
|
+
" ",
|
|
81
|
+
Se,
|
|
82
|
+
")"
|
|
83
|
+
] })
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ i("div", { className: "ink-workspace-header-right", children: [
|
|
86
|
+
/* @__PURE__ */ i("div", { className: "ink-workspace-split-controls", role: "group", "aria-label": I, children: [
|
|
87
|
+
/* @__PURE__ */ e(
|
|
88
|
+
t,
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
className: m("ink-workspace-icon-btn", d === T && "ink-active"),
|
|
92
|
+
onClick: () => E(T),
|
|
93
|
+
title: be,
|
|
94
|
+
children: /* @__PURE__ */ e(me, {})
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ e(
|
|
98
|
+
t,
|
|
99
|
+
{
|
|
100
|
+
type: "button",
|
|
101
|
+
className: m("ink-workspace-icon-btn", d === B && "ink-active"),
|
|
102
|
+
onClick: () => E(B),
|
|
103
|
+
title: ue,
|
|
104
|
+
children: /* @__PURE__ */ e(ke, {})
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ e(
|
|
108
|
+
t,
|
|
109
|
+
{
|
|
110
|
+
type: "button",
|
|
111
|
+
className: m("ink-workspace-icon-btn", d === x && "ink-active"),
|
|
112
|
+
onClick: () => E(x),
|
|
113
|
+
title: Oe,
|
|
114
|
+
children: /* @__PURE__ */ e(pe, {})
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] }),
|
|
118
|
+
R && o && /* @__PURE__ */ e(
|
|
119
|
+
t,
|
|
120
|
+
{
|
|
121
|
+
type: "button",
|
|
122
|
+
className: "ink-workspace-icon-btn",
|
|
123
|
+
onClick: () => R(o.id),
|
|
124
|
+
title: H,
|
|
125
|
+
"aria-label": H,
|
|
126
|
+
children: /* @__PURE__ */ e(he, {})
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
(s == null ? void 0 : s.collaborators) && /* @__PURE__ */ e(
|
|
130
|
+
re,
|
|
131
|
+
{
|
|
132
|
+
collaborators: s.collaborators,
|
|
133
|
+
maxAvatars: s.maxAvatars
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] })
|
|
137
|
+
] }),
|
|
138
|
+
/* @__PURE__ */ i("div", { className: "ink-workspace-body", children: [
|
|
139
|
+
h && /* @__PURE__ */ i("aside", { className: "ink-workspace-sidebar", "aria-label": M, children: [
|
|
140
|
+
/* @__PURE__ */ i("div", { className: "ink-workspace-sidebar-toolbar", children: [
|
|
141
|
+
/* @__PURE__ */ e(
|
|
142
|
+
"input",
|
|
143
|
+
{
|
|
144
|
+
type: "text",
|
|
145
|
+
className: "ink-workspace-search-input",
|
|
146
|
+
placeholder: Ke,
|
|
147
|
+
value: $,
|
|
148
|
+
onChange: (a) => z(a.target.value)
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ e(
|
|
152
|
+
t,
|
|
153
|
+
{
|
|
154
|
+
type: "button",
|
|
155
|
+
className: "ink-workspace-new-doc-btn",
|
|
156
|
+
onClick: L,
|
|
157
|
+
title: C,
|
|
158
|
+
"aria-label": C,
|
|
159
|
+
children: C
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
w && /* @__PURE__ */ e(
|
|
163
|
+
t,
|
|
164
|
+
{
|
|
165
|
+
type: "button",
|
|
166
|
+
className: "ink-workspace-icon-btn",
|
|
167
|
+
onClick: () => w(S),
|
|
168
|
+
title: S,
|
|
169
|
+
"aria-label": S,
|
|
170
|
+
children: /* @__PURE__ */ e(Ne, {})
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
] }),
|
|
174
|
+
v.length > Te && /* @__PURE__ */ e("div", { className: "ink-workspace-folders-section", children: v.map((a) => /* @__PURE__ */ i("div", { className: "ink-workspace-folder-item", children: [
|
|
175
|
+
/* @__PURE__ */ e("span", { className: "ink-doc-icon", children: "📁" }),
|
|
176
|
+
/* @__PURE__ */ e("span", { className: "ink-doc-title", children: a.name }),
|
|
177
|
+
A && /* @__PURE__ */ e(
|
|
178
|
+
t,
|
|
179
|
+
{
|
|
180
|
+
type: "button",
|
|
181
|
+
className: "ink-doc-action-btn ink-delete",
|
|
182
|
+
onClick: () => A(a.id),
|
|
183
|
+
title: b,
|
|
184
|
+
"aria-label": b,
|
|
185
|
+
children: b
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
] }, a.id)) }),
|
|
189
|
+
/* @__PURE__ */ e("div", { className: "ink-workspace-doc-list", role: "tree", children: ee.map((a) => {
|
|
190
|
+
const k = a.id === O, te = Y === a.id;
|
|
191
|
+
return /* @__PURE__ */ i(
|
|
192
|
+
"div",
|
|
193
|
+
{
|
|
194
|
+
role: "treeitem",
|
|
195
|
+
"aria-selected": k,
|
|
196
|
+
className: m("ink-workspace-doc-item", k && "ink-doc-active"),
|
|
197
|
+
onClick: () => K(a.id),
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ e("span", { className: "ink-doc-icon", children: a.icon || /* @__PURE__ */ e(Ee, {}) }),
|
|
200
|
+
te ? /* @__PURE__ */ e(
|
|
201
|
+
"input",
|
|
202
|
+
{
|
|
203
|
+
type: "text",
|
|
204
|
+
className: "ink-doc-title-input",
|
|
205
|
+
value: q,
|
|
206
|
+
autoFocus: !0,
|
|
207
|
+
onChange: (n) => J(n.target.value),
|
|
208
|
+
onBlur: () => P(a.id),
|
|
209
|
+
onKeyDown: (n) => {
|
|
210
|
+
n.key === "Enter" && P(a.id), n.key === "Escape" && ae();
|
|
211
|
+
},
|
|
212
|
+
onClick: (n) => n.stopPropagation()
|
|
213
|
+
}
|
|
214
|
+
) : /* @__PURE__ */ e(
|
|
215
|
+
"span",
|
|
216
|
+
{
|
|
217
|
+
className: "ink-doc-title",
|
|
218
|
+
onDoubleClick: (n) => y(a.id, a.title, n),
|
|
219
|
+
children: a.title || Re
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
a.isDirty && /* @__PURE__ */ e("span", { className: "ink-doc-dirty-dot" }),
|
|
223
|
+
/* @__PURE__ */ i("div", { className: "ink-doc-actions", children: [
|
|
224
|
+
/* @__PURE__ */ e(
|
|
225
|
+
t,
|
|
226
|
+
{
|
|
227
|
+
type: "button",
|
|
228
|
+
className: "ink-doc-action-btn",
|
|
229
|
+
onClick: (n) => y(a.id, a.title, n),
|
|
230
|
+
title: U,
|
|
231
|
+
"aria-label": U,
|
|
232
|
+
children: /* @__PURE__ */ e(_e, {})
|
|
233
|
+
}
|
|
234
|
+
),
|
|
235
|
+
p.length > Ce && N && /* @__PURE__ */ e(
|
|
236
|
+
t,
|
|
237
|
+
{
|
|
238
|
+
type: "button",
|
|
239
|
+
className: "ink-doc-action-btn ink-delete",
|
|
240
|
+
onClick: (n) => {
|
|
241
|
+
n.stopPropagation(), N(a.id);
|
|
242
|
+
},
|
|
243
|
+
title: V,
|
|
244
|
+
"aria-label": V,
|
|
245
|
+
children: /* @__PURE__ */ e(Ie, {})
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
] })
|
|
249
|
+
]
|
|
250
|
+
},
|
|
251
|
+
a.id
|
|
252
|
+
);
|
|
253
|
+
}) })
|
|
254
|
+
] }),
|
|
255
|
+
/* @__PURE__ */ i("main", { className: m("ink-workspace-main-area", `ink-split-${d}`), children: [
|
|
256
|
+
/* @__PURE__ */ i("section", { className: "ink-workspace-pane ink-primary-pane", children: [
|
|
257
|
+
/* @__PURE__ */ e(
|
|
258
|
+
oe,
|
|
259
|
+
{
|
|
260
|
+
documents: p,
|
|
261
|
+
activeDocumentId: O,
|
|
262
|
+
onTabSelect: K,
|
|
263
|
+
onTabClose: N,
|
|
264
|
+
onTabAdd: L,
|
|
265
|
+
onTabRename: X
|
|
266
|
+
}
|
|
267
|
+
),
|
|
268
|
+
o && /* @__PURE__ */ e("div", { className: "ink-workspace-editor-wrapper", children: /* @__PURE__ */ e(
|
|
269
|
+
g,
|
|
270
|
+
{
|
|
271
|
+
value: o.content,
|
|
272
|
+
onChange: (a) => r == null ? void 0 : r(o.id, a),
|
|
273
|
+
readOnly: o.readOnly,
|
|
274
|
+
collaboration: s,
|
|
275
|
+
...c,
|
|
276
|
+
themeId: _,
|
|
277
|
+
onThemeChange: D
|
|
278
|
+
},
|
|
279
|
+
o.id
|
|
280
|
+
) })
|
|
281
|
+
] }),
|
|
282
|
+
d !== T && /* @__PURE__ */ i("section", { className: "ink-workspace-pane ink-secondary-pane", children: [
|
|
283
|
+
/* @__PURE__ */ i("div", { className: "ink-secondary-pane-header", children: [
|
|
284
|
+
/* @__PURE__ */ e("span", { className: "ink-secondary-pane-label", children: I }),
|
|
285
|
+
/* @__PURE__ */ e(
|
|
286
|
+
"select",
|
|
287
|
+
{
|
|
288
|
+
className: "ink-secondary-pane-select",
|
|
289
|
+
value: (l == null ? void 0 : l.id) || W,
|
|
290
|
+
onChange: (a) => Z(a.target.value),
|
|
291
|
+
"aria-label": I,
|
|
292
|
+
children: p.map((a) => /* @__PURE__ */ e("option", { value: a.id, children: a.title }, a.id))
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
] }),
|
|
296
|
+
l && /* @__PURE__ */ e("div", { className: "ink-workspace-editor-wrapper", children: /* @__PURE__ */ e(
|
|
297
|
+
g,
|
|
298
|
+
{
|
|
299
|
+
value: l.content,
|
|
300
|
+
onChange: (a) => r == null ? void 0 : r(l.id, a),
|
|
301
|
+
readOnly: l.readOnly,
|
|
302
|
+
...c,
|
|
303
|
+
themeId: _,
|
|
304
|
+
onThemeChange: D
|
|
305
|
+
},
|
|
306
|
+
`sec-${l.id}`
|
|
307
|
+
) })
|
|
308
|
+
] })
|
|
309
|
+
] })
|
|
310
|
+
] })
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
};
|
|
315
|
+
export {
|
|
316
|
+
Ve as InkWorkspace
|
|
317
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]}),t=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"})}),o=()=>e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"})]}),r=()=>e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"})]}),n=()=>e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[e.jsx("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),e.jsx("polyline",{points:"17 21 17 13 7 13 7 21"}),e.jsx("polyline",{points:"7 3 7 8 15 8"})]}),s=()=>e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[e.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),e.jsx("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),e.jsx("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]}),h=()=>e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]}),l=()=>e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[e.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),c=()=>e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]});exports.CloseCrossIcon=c;exports.FileDocumentIcon=h;exports.NewFolderIcon=s;exports.RenamePencilIcon=l;exports.SaveDocIcon=n;exports.SidebarToggleIcon=i;exports.SingleViewIcon=t;exports.SplitHorizontalIcon=r;exports.SplitVerticalIcon=o;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const SidebarToggleIcon: React.FC;
|
|
3
|
+
export declare const SingleViewIcon: React.FC;
|
|
4
|
+
export declare const SplitVerticalIcon: React.FC;
|
|
5
|
+
export declare const SplitHorizontalIcon: React.FC;
|
|
6
|
+
export declare const SaveDocIcon: React.FC;
|
|
7
|
+
export declare const NewFolderIcon: React.FC;
|
|
8
|
+
export declare const FileDocumentIcon: React.FC;
|
|
9
|
+
export declare const RenamePencilIcon: React.FC;
|
|
10
|
+
export declare const CloseCrossIcon: React.FC;
|
|
11
|
+
//# sourceMappingURL=WorkspaceIcons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceIcons.d.ts","sourceRoot":"","sources":["../../../../src/components/InkWorkspace/components/WorkspaceIcons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAKrC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAIlC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAKrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAKvC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAM/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAMjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAKpC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAKpC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAKlC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
const r = () => /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
3
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
4
|
+
/* @__PURE__ */ e("line", { x1: "9", y1: "3", x2: "9", y2: "21" })
|
|
5
|
+
] }), o = () => /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: /* @__PURE__ */ e("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }) }), n = () => /* @__PURE__ */ i("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
6
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
7
|
+
/* @__PURE__ */ e("line", { x1: "12", y1: "3", x2: "12", y2: "21" })
|
|
8
|
+
] }), h = () => /* @__PURE__ */ i("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
9
|
+
/* @__PURE__ */ e("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
10
|
+
/* @__PURE__ */ e("line", { x1: "3", y1: "12", x2: "21", y2: "12" })
|
|
11
|
+
] }), l = () => /* @__PURE__ */ i("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
12
|
+
/* @__PURE__ */ e("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }),
|
|
13
|
+
/* @__PURE__ */ e("polyline", { points: "17 21 17 13 7 13 7 21" }),
|
|
14
|
+
/* @__PURE__ */ e("polyline", { points: "7 3 7 8 15 8" })
|
|
15
|
+
] }), d = () => /* @__PURE__ */ i("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
16
|
+
/* @__PURE__ */ e("path", { d: "M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" }),
|
|
17
|
+
/* @__PURE__ */ e("line", { x1: "12", y1: "11", x2: "12", y2: "17" }),
|
|
18
|
+
/* @__PURE__ */ e("line", { x1: "9", y1: "14", x2: "15", y2: "14" })
|
|
19
|
+
] }), s = () => /* @__PURE__ */ i("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
20
|
+
/* @__PURE__ */ e("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
21
|
+
/* @__PURE__ */ e("polyline", { points: "14 2 14 8 20 8" })
|
|
22
|
+
] }), c = () => /* @__PURE__ */ i("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
23
|
+
/* @__PURE__ */ e("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
|
|
24
|
+
/* @__PURE__ */ e("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
|
|
25
|
+
] }), a = () => /* @__PURE__ */ i("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
26
|
+
/* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
27
|
+
/* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
28
|
+
] });
|
|
29
|
+
export {
|
|
30
|
+
a as CloseCrossIcon,
|
|
31
|
+
s as FileDocumentIcon,
|
|
32
|
+
d as NewFolderIcon,
|
|
33
|
+
c as RenamePencilIcon,
|
|
34
|
+
l as SaveDocIcon,
|
|
35
|
+
r as SidebarToggleIcon,
|
|
36
|
+
o as SingleViewIcon,
|
|
37
|
+
h as SplitHorizontalIcon,
|
|
38
|
+
n as SplitVerticalIcon
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),B=require("../../../constants/numbers.cjs"),y=require("../../../constants/generals.const.cjs");require("../../../constants/openai.const.cjs");require("react/jsx-runtime");require("../../../utils/paste.utils.cjs");require("react-dom");const O=require("../../../constants/workspace.const.cjs"),Z=_=>{const{documents:n,activeDocumentId:s,onDocumentCreate:S,onDocumentRename:r,sidebarOpen:p,onSidebarOpenChange:o,splitMode:M,onSplitModeChange:c,secondaryDocumentId:k,onSecondaryDocumentChange:a}=_,[f,E]=t.useState(!0),[T,q]=t.useState(O.INK_SPLIT_MODE_NONE),[N,v]=t.useState(null),[I,R]=t.useState(y.EMPTY_STRING),[m,b]=t.useState(null),[l,C]=t.useState(y.EMPTY_STRING),L=p!==void 0?p:f,P=t.useCallback(e=>{E(e),o==null||o(e)},[o]),w=M!==void 0?M:T,g=t.useCallback(e=>{q(e),c==null||c(e)},[c]),i=k!==void 0?k:N,h=t.useCallback(e=>{v(e),a==null||a(e)},[a]),K=t.useMemo(()=>n.find(e=>e.id===s)||n[B.NUMBER_ZERO],[n,s]),W=t.useMemo(()=>i?n.find(e=>e.id===i)||null:n.find(e=>e.id!==s)||null,[n,i,s]),G=t.useMemo(()=>{const e=I.trim();if(!e)return n;const u=e.toLowerCase();return n.filter(d=>{var D;return d.title.toLowerCase().includes(u)||((D=d.tags)==null?void 0:D.some(A=>A.toLowerCase().includes(u)))})},[n,I]),Q=t.useCallback(()=>{S&&S(O.INK_WORKSPACE_UNTITLED_DOC)},[S]),U=t.useCallback((e,u,d)=>{d.stopPropagation(),b(e),C(u)},[]),Y=t.useCallback(e=>{m===e&&l.trim()&&(r==null||r(e,l.trim())),b(null)},[m,l,r]),j=t.useCallback(()=>{b(null)},[]);return{sidebarOpen:L,setSidebarOpen:P,splitMode:w,setSplitMode:g,secondaryDocId:i,setSecondaryDocId:h,searchQuery:I,setSearchQuery:R,editingDocId:m,editTitle:l,setEditTitle:C,activeDocument:K,secondaryDocument:W,filteredDocs:G,handleCreateDocument:Q,handleStartRename:U,handleSaveRename:Y,handleCancelRename:j}};exports.useInkWorkspace=Z;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { InkDocument, InkWorkspaceProps, InkSplitMode } from '../../../types';
|
|
2
|
+
export interface UseInkWorkspaceReturn {
|
|
3
|
+
sidebarOpen: boolean;
|
|
4
|
+
setSidebarOpen: (open: boolean) => void;
|
|
5
|
+
splitMode: InkSplitMode;
|
|
6
|
+
setSplitMode: (mode: InkSplitMode) => void;
|
|
7
|
+
secondaryDocId: string | null;
|
|
8
|
+
setSecondaryDocId: (id: string | null) => void;
|
|
9
|
+
searchQuery: string;
|
|
10
|
+
setSearchQuery: (query: string) => void;
|
|
11
|
+
editingDocId: string | null;
|
|
12
|
+
editTitle: string;
|
|
13
|
+
setEditTitle: (title: string) => void;
|
|
14
|
+
activeDocument: InkDocument | undefined;
|
|
15
|
+
secondaryDocument: InkDocument | null;
|
|
16
|
+
filteredDocs: InkDocument[];
|
|
17
|
+
handleCreateDocument: () => void;
|
|
18
|
+
handleStartRename: (id: string, currentTitle: string, event: React.MouseEvent) => void;
|
|
19
|
+
handleSaveRename: (id: string) => void;
|
|
20
|
+
handleCancelRename: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Custom hook to manage state, split view modes, document filtering,
|
|
24
|
+
* and explorer interactions for the InkWorkspace component.
|
|
25
|
+
*
|
|
26
|
+
* @param props - InkWorkspaceProps containing documents, active ID, and lifecycle callbacks
|
|
27
|
+
* @returns UseInkWorkspaceReturn with state values and interaction handlers
|
|
28
|
+
*/
|
|
29
|
+
export declare const useInkWorkspace: (props: InkWorkspaceProps) => UseInkWorkspaceReturn;
|
|
30
|
+
//# sourceMappingURL=useInkWorkspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInkWorkspace.d.ts","sourceRoot":"","sources":["../../../../src/components/InkWorkspace/hooks/useInkWorkspace.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,YAAY,EACb,MAAM,SAAS,CAAC;AAQjB,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,SAAS,EAAE,YAAY,CAAC;IACxB,YAAY,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3C,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,cAAc,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,iBAAiB,EAAE,WAAW,GAAG,IAAI,CAAC;IACtC,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACvF,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,iBAAiB,KAAG,qBAyG1D,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useState as o, useCallback as n, useMemo as D } from "react";
|
|
2
|
+
import { NUMBER_ZERO as Z } from "../../../constants/numbers.js";
|
|
3
|
+
import { EMPTY_STRING as N } from "../../../constants/generals.const.js";
|
|
4
|
+
import "../../../constants/openai.const.js";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "../../../utils/paste.utils.js";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
import { INK_SPLIT_MODE_NONE as j, INK_WORKSPACE_UNTITLED_DOC as z } from "../../../constants/workspace.const.js";
|
|
9
|
+
const nt = (T) => {
|
|
10
|
+
const {
|
|
11
|
+
documents: e,
|
|
12
|
+
activeDocumentId: r,
|
|
13
|
+
onDocumentCreate: p,
|
|
14
|
+
onDocumentRename: s,
|
|
15
|
+
sidebarOpen: O,
|
|
16
|
+
onSidebarOpenChange: i,
|
|
17
|
+
splitMode: y,
|
|
18
|
+
onSplitModeChange: c,
|
|
19
|
+
secondaryDocumentId: E,
|
|
20
|
+
onSecondaryDocumentChange: d
|
|
21
|
+
} = T, [b, v] = o(!0), [C, L] = o(j), [R, w] = o(null), [I, P] = o(N), [S, f] = o(null), [l, M] = o(N), h = O !== void 0 ? O : b, k = n((t) => {
|
|
22
|
+
v(t), i == null || i(t);
|
|
23
|
+
}, [i]), K = y !== void 0 ? y : C, Q = n((t) => {
|
|
24
|
+
L(t), c == null || c(t);
|
|
25
|
+
}, [c]), a = E !== void 0 ? E : R, U = n((t) => {
|
|
26
|
+
w(t), d == null || d(t);
|
|
27
|
+
}, [d]), W = D(
|
|
28
|
+
() => e.find((t) => t.id === r) || e[Z],
|
|
29
|
+
[e, r]
|
|
30
|
+
), g = D(() => a ? e.find((t) => t.id === a) || null : e.find((t) => t.id !== r) || null, [e, a, r]), q = D(() => {
|
|
31
|
+
const t = I.trim();
|
|
32
|
+
if (!t) return e;
|
|
33
|
+
const u = t.toLowerCase();
|
|
34
|
+
return e.filter(
|
|
35
|
+
(m) => {
|
|
36
|
+
var _;
|
|
37
|
+
return m.title.toLowerCase().includes(u) || ((_ = m.tags) == null ? void 0 : _.some((Y) => Y.toLowerCase().includes(u)));
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}, [e, I]), x = n(() => {
|
|
41
|
+
p && p(z);
|
|
42
|
+
}, [p]), A = n((t, u, m) => {
|
|
43
|
+
m.stopPropagation(), f(t), M(u);
|
|
44
|
+
}, []), B = n((t) => {
|
|
45
|
+
S === t && l.trim() && (s == null || s(t, l.trim())), f(null);
|
|
46
|
+
}, [S, l, s]), G = n(() => {
|
|
47
|
+
f(null);
|
|
48
|
+
}, []);
|
|
49
|
+
return {
|
|
50
|
+
sidebarOpen: h,
|
|
51
|
+
setSidebarOpen: k,
|
|
52
|
+
splitMode: K,
|
|
53
|
+
setSplitMode: Q,
|
|
54
|
+
secondaryDocId: a,
|
|
55
|
+
setSecondaryDocId: U,
|
|
56
|
+
searchQuery: I,
|
|
57
|
+
setSearchQuery: P,
|
|
58
|
+
editingDocId: S,
|
|
59
|
+
editTitle: l,
|
|
60
|
+
setEditTitle: M,
|
|
61
|
+
activeDocument: W,
|
|
62
|
+
secondaryDocument: g,
|
|
63
|
+
filteredDocs: q,
|
|
64
|
+
handleCreateDocument: x,
|
|
65
|
+
handleStartRename: A,
|
|
66
|
+
handleSaveRename: B,
|
|
67
|
+
handleCancelRename: G
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
nt as useInkWorkspace
|
|
72
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InkWorkspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./numbers.cjs"),c="default-room",I="collab",_="active",l="idle",a="offline",E="editor",T="commenter",t="?",O=["var(--ink-collab-1, #3B82F6)","var(--ink-collab-2, #10B981)","var(--ink-collab-3, #8B5CF6)","var(--ink-collab-4, #F59E0B)","var(--ink-collab-5, #EC4899)","var(--ink-collab-6, #06B6D4)","var(--ink-collab-7, #F97316)"],e=[{id:"collab-1",name:"Sarah Connor",color:"#3B82F6",status:_,role:E,cursor:{line:o.NUMBER_TWO,col:o.NUMBER_FOURTEEN,offset:42}},{id:"collab-2",name:"Albert Specialist",color:"#10B981",status:_,role:E,cursor:{line:o.NUMBER_FIVE,col:o.NUMBER_TWENTY_EIGHT,offset:110}},{id:"collab-3",name:"Elena Rostova",color:"#8B5CF6",status:l,role:T,cursor:{line:o.NUMBER_EIGHT,col:o.NUMBER_SIX,offset:180}}];exports.COLLAB_THEME_COLORS=O;exports.DEFAULT_DEMO_COLLABORATORS=e;exports.DEFAULT_INITIAL=t;exports.ID_PREFIX_COLLAB=I;exports.INK_DEFAULT_ROOM_ID=c;exports.INK_ROLE_COMMENTER=T;exports.INK_ROLE_EDITOR=E;exports.INK_STATUS_ACTIVE=_;exports.INK_STATUS_IDLE=l;exports.INK_STATUS_OFFLINE=a;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InkCollaborator, InkCollaboratorRole, InkCollaboratorStatus } from '../types/collab.types';
|
|
2
|
+
export declare const INK_DEFAULT_ROOM_ID = "default-room";
|
|
3
|
+
export declare const INK_PRESENCE_DEFAULT_MAX_AVATARS = 4;
|
|
4
|
+
export declare const PLUS_SIGN = "+";
|
|
5
|
+
export declare const ID_PREFIX_COLLAB = "collab";
|
|
6
|
+
export declare const INK_STATUS_ACTIVE: InkCollaboratorStatus;
|
|
7
|
+
export declare const INK_STATUS_IDLE: InkCollaboratorStatus;
|
|
8
|
+
export declare const INK_STATUS_OFFLINE: InkCollaboratorStatus;
|
|
9
|
+
export declare const INK_ROLE_EDITOR: InkCollaboratorRole;
|
|
10
|
+
export declare const INK_ROLE_COMMENTER: InkCollaboratorRole;
|
|
11
|
+
export declare const INK_ROLE_VIEWER: InkCollaboratorRole;
|
|
12
|
+
export declare const DEFAULT_INITIAL = "?";
|
|
13
|
+
export declare const IDLE_LABEL_SUFFIX = " - Idle";
|
|
14
|
+
/**
|
|
15
|
+
* Palette for collaborator cursors and presence avatars.
|
|
16
|
+
* Supports theme token overrides through CSS custom properties with hex fallbacks.
|
|
17
|
+
*/
|
|
18
|
+
export declare const COLLAB_THEME_COLORS: string[];
|
|
19
|
+
export declare const DEFAULT_DEMO_COLLABORATORS: InkCollaborator[];
|
|
20
|
+
//# sourceMappingURL=collab.const.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collab.const.d.ts","sourceRoot":"","sources":["../../src/constants/collab.const.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEzG,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,gCAAgC,IAAc,CAAC;AAC5D,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,iBAAiB,EAAE,qBAAgC,CAAC;AACjE,eAAO,MAAM,eAAe,EAAE,qBAA8B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,EAAE,qBAAiC,CAAC;AACnE,eAAO,MAAM,eAAe,EAAE,mBAA8B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,EAAE,mBAAiC,CAAC;AACnE,eAAO,MAAM,eAAe,EAAE,mBAA8B,CAAC;AAC7D,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAQ/B,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,eAAe,EAyBvD,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { NUMBER_FOURTEEN as c, NUMBER_TWO as a, NUMBER_TWENTY_EIGHT as E, NUMBER_FIVE as n, NUMBER_SIX as r, NUMBER_EIGHT as t } from "./numbers.js";
|
|
2
|
+
const T = "default-room", i = "collab", o = "active", _ = "idle", I = "offline", l = "editor", s = "commenter", B = "?", N = [
|
|
3
|
+
"var(--ink-collab-1, #3B82F6)",
|
|
4
|
+
// Blue
|
|
5
|
+
"var(--ink-collab-2, #10B981)",
|
|
6
|
+
// Emerald
|
|
7
|
+
"var(--ink-collab-3, #8B5CF6)",
|
|
8
|
+
// Purple
|
|
9
|
+
"var(--ink-collab-4, #F59E0B)",
|
|
10
|
+
// Amber
|
|
11
|
+
"var(--ink-collab-5, #EC4899)",
|
|
12
|
+
// Pink
|
|
13
|
+
"var(--ink-collab-6, #06B6D4)",
|
|
14
|
+
// Cyan
|
|
15
|
+
"var(--ink-collab-7, #F97316)"
|
|
16
|
+
// Orange
|
|
17
|
+
], O = [
|
|
18
|
+
{
|
|
19
|
+
id: "collab-1",
|
|
20
|
+
name: "Sarah Connor",
|
|
21
|
+
color: "#3B82F6",
|
|
22
|
+
status: o,
|
|
23
|
+
role: l,
|
|
24
|
+
cursor: { line: a, col: c, offset: 42 }
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "collab-2",
|
|
28
|
+
name: "Albert Specialist",
|
|
29
|
+
color: "#10B981",
|
|
30
|
+
status: o,
|
|
31
|
+
role: l,
|
|
32
|
+
cursor: { line: n, col: E, offset: 110 }
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "collab-3",
|
|
36
|
+
name: "Elena Rostova",
|
|
37
|
+
color: "#8B5CF6",
|
|
38
|
+
status: _,
|
|
39
|
+
role: s,
|
|
40
|
+
cursor: { line: t, col: r, offset: 180 }
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
export {
|
|
44
|
+
N as COLLAB_THEME_COLORS,
|
|
45
|
+
O as DEFAULT_DEMO_COLLABORATORS,
|
|
46
|
+
B as DEFAULT_INITIAL,
|
|
47
|
+
i as ID_PREFIX_COLLAB,
|
|
48
|
+
T as INK_DEFAULT_ROOM_ID,
|
|
49
|
+
s as INK_ROLE_COMMENTER,
|
|
50
|
+
l as INK_ROLE_EDITOR,
|
|
51
|
+
o as INK_STATUS_ACTIVE,
|
|
52
|
+
_ as INK_STATUS_IDLE,
|
|
53
|
+
I as INK_STATUS_OFFLINE
|
|
54
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=150,E="#111827",N="#fef08a",I=3,T=3,M=1,R=1,L=12,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=150,E="#111827",N="#fef08a",I=3,T=3,M=1,R=1,L=12,U=12,O=50,S="#fde047",B=16,A=36,H=7,K=180,t=0,o=1,c=2,n=3,s=4,X=5,D=6,C=7,G=8,P=9,W=12,Y=14,F=15,V=16,e=17,f=24,r=28,Z=36,a=40,d=60,i=76,l=100,u=250,b=6,g=180,y=280,j=8,m=8,p=6,v=64,h=30,k=4,q=4,w=12,x=12,z=420,J=320,Q=180,$=24;exports.INK_COMMENT_HIGHLIGHT_COLOR=S;exports.INK_DEFAULT_HIGHLIGHT_COLOR=N;exports.INK_DEFAULT_TABLE_COLS=T;exports.INK_DEFAULT_TABLE_ROWS=I;exports.INK_DEFAULT_TEXT_COLOR=E;exports.INK_DEMO_AI_DELAY_MS=K;exports.INK_EXCEL_MENU_ESTIMATED_HEIGHT_PX=z;exports.INK_EXCEL_SHEET_COLS=q;exports.INK_EXCEL_SHEET_MAX_COLS=x;exports.INK_EXCEL_SHEET_MAX_ROWS=w;exports.INK_EXCEL_SHEET_ROWS=k;exports.INK_GRAPH_HEIGHT=Q;exports.INK_GRAPH_PAD=$;exports.INK_GRAPH_WIDTH=J;exports.INK_HISTORY_MAX=O;exports.INK_MIN_HEIGHT=_;exports.INK_SLASH_MENU_MAX_ITEMS=B;exports.INK_STYLE_MENU_EDGE_PX=j;exports.INK_STYLE_MENU_ESTIMATED_HEIGHT_PX=y;exports.INK_STYLE_MENU_GAP_PX=b;exports.INK_STYLE_MENU_MIN_WIDTH_PX=g;exports.INK_TABLE_COL_MIN_WIDTH_PX=v;exports.INK_TABLE_COL_RESIZE_EDGE_PX=p;exports.INK_TABLE_MAX_COLS=U;exports.INK_TABLE_MAX_ROWS=L;exports.INK_TABLE_MIN_COLS=R;exports.INK_TABLE_MIN_ROWS=M;exports.INK_TABLE_PICKER_MAX=m;exports.INK_TITLE_STYLE_COUNT=h;exports.INK_TOOLBAR_GAP_PX=H;exports.INK_TOOLBAR_MORE_WIDTH_PX=A;exports.NUMBER_EIGHT=G;exports.NUMBER_FIFTEEN=F;exports.NUMBER_FIVE=X;exports.NUMBER_FORTY=a;exports.NUMBER_FOUR=s;exports.NUMBER_FOURTEEN=Y;exports.NUMBER_NINE=P;exports.NUMBER_ONE=o;exports.NUMBER_ONE_HUNDRED=l;exports.NUMBER_SEVEN=C;exports.NUMBER_SEVENTEEN=e;exports.NUMBER_SEVENTY_SIX=i;exports.NUMBER_SIX=D;exports.NUMBER_SIXTEEN=V;exports.NUMBER_SIXTY=d;exports.NUMBER_THIRTY_SIX=Z;exports.NUMBER_THREE=n;exports.NUMBER_TWELVE=W;exports.NUMBER_TWENTY_EIGHT=r;exports.NUMBER_TWENTY_FOUR=f;exports.NUMBER_TWO=c;exports.NUMBER_TWO_HUNDRED_FIFTY=u;exports.NUMBER_ZERO=t;
|