@lumea-labs/docs 0.1.0 → 0.1.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.
- package/dist/docs-content.d.ts +2 -2
- package/dist/docs-content.js +2 -1
- package/dist/docs-document.d.ts +2 -2
- package/dist/docs-document.js +2 -1
- package/dist/docs-formatting-toolbar.d.ts +2 -2
- package/dist/docs-formatting-toolbar.js +197 -172
- package/dist/docs-skeleton.d.ts +2 -2
- package/dist/docs-skeleton.js +24 -4
- package/dist/docs-toolbar.d.ts +2 -2
- package/dist/docs-toolbar.js +2 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/docs-content.d.ts
CHANGED
package/dist/docs-content.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { useEditor, EditorContent } from "@tiptap/react";
|
|
3
4
|
import StarterKit from "@tiptap/starter-kit";
|
|
4
5
|
import Placeholder from "@tiptap/extension-placeholder";
|
|
@@ -129,7 +130,7 @@ function DocsContent() {
|
|
|
129
130
|
};
|
|
130
131
|
}, [editor, internal]);
|
|
131
132
|
const containerCls = doc.meta.density === "compact" ? "flex min-h-0 flex-1 flex-col overflow-y-auto px-3 py-3 prose prose-sm max-w-none [&_.tiptap]:outline-none" : "flex min-h-0 flex-1 flex-col overflow-y-auto px-8 py-8 prose max-w-none [&_.tiptap]:outline-none";
|
|
132
|
-
return /* @__PURE__ */
|
|
133
|
+
return /* @__PURE__ */ jsx("div", { className: containerCls, children: /* @__PURE__ */ jsx(EditorContent, { editor }) });
|
|
133
134
|
}
|
|
134
135
|
export {
|
|
135
136
|
DocsContent
|
package/dist/docs-document.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { DocsBlock, DocsDensity, DocsLabels } from './types.js';
|
|
4
4
|
|
|
@@ -98,6 +98,6 @@ interface DocsInternalContextValue {
|
|
|
98
98
|
onChange?: (blocks: DocsBlock[]) => void;
|
|
99
99
|
}
|
|
100
100
|
declare function useDocsInternal(): DocsInternalContextValue;
|
|
101
|
-
declare function DocsDocument({ initialBlocks, initialMarkdown, onChange, density, labels, children, }: DocsDocumentProps):
|
|
101
|
+
declare function DocsDocument({ initialBlocks, initialMarkdown, onChange, density, labels, children, }: DocsDocumentProps): react_jsx_runtime.JSX.Element;
|
|
102
102
|
|
|
103
103
|
export { type DocsContextValue, DocsDocument, type DocsDocumentProps, type DocsEngineHandle, useDocsDocument, useDocsInternal };
|
package/dist/docs-document.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import {
|
|
3
4
|
createContext,
|
|
4
5
|
use,
|
|
@@ -74,7 +75,7 @@ function DocsDocument({
|
|
|
74
75
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
75
76
|
[]
|
|
76
77
|
);
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ jsx(DocsContext, { value: publicValue, children: /* @__PURE__ */ jsx(DocsInternalContext, { value: internalValue, children }) });
|
|
78
79
|
}
|
|
79
80
|
export {
|
|
80
81
|
DocsDocument,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Word-style formatting toolbar — fixed at the top of the document.
|
|
@@ -15,6 +15,6 @@ import * as react from 'react';
|
|
|
15
15
|
*
|
|
16
16
|
* Tailwind-only styling. No bundled CSS.
|
|
17
17
|
*/
|
|
18
|
-
declare function DocsFormattingToolbar():
|
|
18
|
+
declare function DocsFormattingToolbar(): react_jsx_runtime.JSX.Element;
|
|
19
19
|
|
|
20
20
|
export { DocsFormattingToolbar };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import {
|
|
3
4
|
Bold,
|
|
4
5
|
Code,
|
|
@@ -60,175 +61,199 @@ function DocsFormattingToolbar() {
|
|
|
60
61
|
};
|
|
61
62
|
const compact = doc.meta.density === "compact";
|
|
62
63
|
const cls = compact ? "flex h-10 shrink-0 flex-wrap items-center gap-0.5 border-b border-p-line bg-p-surface px-2" : "flex h-11 shrink-0 flex-wrap items-center gap-0.5 border-b border-p-line bg-p-surface px-3";
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
), /* @__PURE__ */ React.createElement(
|
|
72
|
-
ToolbarButton,
|
|
73
|
-
{
|
|
74
|
-
title: "Redo",
|
|
75
|
-
disabled: !ed || !f.canRedo,
|
|
76
|
-
onClick: () => ed?.chain().focus().redo().run()
|
|
77
|
-
},
|
|
78
|
-
/* @__PURE__ */ React.createElement(Redo2, { className: "size-3.5" })
|
|
79
|
-
), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(
|
|
80
|
-
ToolbarButton,
|
|
81
|
-
{
|
|
82
|
-
title: "Heading 1",
|
|
83
|
-
active: f.h1,
|
|
84
|
-
disabled: !ed,
|
|
85
|
-
onClick: () => ed?.chain().focus().toggleHeading({ level: 1 }).run()
|
|
86
|
-
},
|
|
87
|
-
/* @__PURE__ */ React.createElement(Heading1, { className: "size-3.5" })
|
|
88
|
-
), /* @__PURE__ */ React.createElement(
|
|
89
|
-
ToolbarButton,
|
|
90
|
-
{
|
|
91
|
-
title: "Heading 2",
|
|
92
|
-
active: f.h2,
|
|
93
|
-
disabled: !ed,
|
|
94
|
-
onClick: () => ed?.chain().focus().toggleHeading({ level: 2 }).run()
|
|
95
|
-
},
|
|
96
|
-
/* @__PURE__ */ React.createElement(Heading2, { className: "size-3.5" })
|
|
97
|
-
), /* @__PURE__ */ React.createElement(
|
|
98
|
-
ToolbarButton,
|
|
99
|
-
{
|
|
100
|
-
title: "Heading 3",
|
|
101
|
-
active: f.h3,
|
|
102
|
-
disabled: !ed,
|
|
103
|
-
onClick: () => ed?.chain().focus().toggleHeading({ level: 3 }).run()
|
|
104
|
-
},
|
|
105
|
-
/* @__PURE__ */ React.createElement(Heading3, { className: "size-3.5" })
|
|
106
|
-
), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(
|
|
107
|
-
ToolbarButton,
|
|
108
|
-
{
|
|
109
|
-
title: "Bold",
|
|
110
|
-
active: f.bold,
|
|
111
|
-
disabled: !ed,
|
|
112
|
-
onClick: () => ed?.chain().focus().toggleBold().run()
|
|
113
|
-
},
|
|
114
|
-
/* @__PURE__ */ React.createElement(Bold, { className: "size-3.5" })
|
|
115
|
-
), /* @__PURE__ */ React.createElement(
|
|
116
|
-
ToolbarButton,
|
|
117
|
-
{
|
|
118
|
-
title: "Italic",
|
|
119
|
-
active: f.italic,
|
|
120
|
-
disabled: !ed,
|
|
121
|
-
onClick: () => ed?.chain().focus().toggleItalic().run()
|
|
122
|
-
},
|
|
123
|
-
/* @__PURE__ */ React.createElement(Italic, { className: "size-3.5" })
|
|
124
|
-
), /* @__PURE__ */ React.createElement(
|
|
125
|
-
ToolbarButton,
|
|
126
|
-
{
|
|
127
|
-
title: "Strikethrough",
|
|
128
|
-
active: f.strike,
|
|
129
|
-
disabled: !ed,
|
|
130
|
-
onClick: () => ed?.chain().focus().toggleStrike().run()
|
|
131
|
-
},
|
|
132
|
-
/* @__PURE__ */ React.createElement(Strikethrough, { className: "size-3.5" })
|
|
133
|
-
), /* @__PURE__ */ React.createElement(
|
|
134
|
-
ToolbarButton,
|
|
135
|
-
{
|
|
136
|
-
title: "Inline code",
|
|
137
|
-
active: f.code,
|
|
138
|
-
disabled: !ed,
|
|
139
|
-
onClick: () => ed?.chain().focus().toggleCode().run()
|
|
140
|
-
},
|
|
141
|
-
/* @__PURE__ */ React.createElement(Code, { className: "size-3.5" })
|
|
142
|
-
), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(
|
|
143
|
-
ToolbarButton,
|
|
144
|
-
{
|
|
145
|
-
title: "Bullet list",
|
|
146
|
-
active: f.bulletList,
|
|
147
|
-
disabled: !ed,
|
|
148
|
-
onClick: () => ed?.chain().focus().toggleBulletList().run()
|
|
149
|
-
},
|
|
150
|
-
/* @__PURE__ */ React.createElement(List, { className: "size-3.5" })
|
|
151
|
-
), /* @__PURE__ */ React.createElement(
|
|
152
|
-
ToolbarButton,
|
|
153
|
-
{
|
|
154
|
-
title: "Ordered list",
|
|
155
|
-
active: f.orderedList,
|
|
156
|
-
disabled: !ed,
|
|
157
|
-
onClick: () => ed?.chain().focus().toggleOrderedList().run()
|
|
158
|
-
},
|
|
159
|
-
/* @__PURE__ */ React.createElement(ListOrdered, { className: "size-3.5" })
|
|
160
|
-
), /* @__PURE__ */ React.createElement(
|
|
161
|
-
ToolbarButton,
|
|
162
|
-
{
|
|
163
|
-
title: "Blockquote",
|
|
164
|
-
active: f.blockquote,
|
|
165
|
-
disabled: !ed,
|
|
166
|
-
onClick: () => ed?.chain().focus().toggleBlockquote().run()
|
|
167
|
-
},
|
|
168
|
-
/* @__PURE__ */ React.createElement(Quote, { className: "size-3.5" })
|
|
169
|
-
), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(
|
|
170
|
-
ToolbarButton,
|
|
171
|
-
{
|
|
172
|
-
title: "Link",
|
|
173
|
-
disabled: !ed,
|
|
174
|
-
onClick: () => {
|
|
175
|
-
const previous = ed?.getAttributes("link").href;
|
|
176
|
-
const url = window.prompt("URL", previous ?? "https://");
|
|
177
|
-
if (url === null) return;
|
|
178
|
-
if (url === "") {
|
|
179
|
-
ed?.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
ed?.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
|
|
64
|
+
return /* @__PURE__ */ jsxs("div", { className: cls, role: "toolbar", children: [
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
ToolbarButton,
|
|
67
|
+
{
|
|
68
|
+
title: "Undo",
|
|
69
|
+
disabled: !ed || !f.canUndo,
|
|
70
|
+
onClick: () => ed?.chain().focus().undo().run(),
|
|
71
|
+
children: /* @__PURE__ */ jsx(Undo2, { className: "size-3.5" })
|
|
183
72
|
}
|
|
184
|
-
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
onClick: () => ed?.chain().focus().toggleCodeBlock().run()
|
|
193
|
-
},
|
|
194
|
-
/* @__PURE__ */ React.createElement(FileCode2, { className: "size-3.5" })
|
|
195
|
-
), /* @__PURE__ */ React.createElement(
|
|
196
|
-
ToolbarButton,
|
|
197
|
-
{
|
|
198
|
-
title: "Insert image",
|
|
199
|
-
disabled: !ed,
|
|
200
|
-
onClick: () => {
|
|
201
|
-
const url = window.prompt("Image URL");
|
|
202
|
-
if (!url) return;
|
|
203
|
-
ed?.chain().focus().setImage({ src: url }).run();
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
ToolbarButton,
|
|
76
|
+
{
|
|
77
|
+
title: "Redo",
|
|
78
|
+
disabled: !ed || !f.canRedo,
|
|
79
|
+
onClick: () => ed?.chain().focus().redo().run(),
|
|
80
|
+
children: /* @__PURE__ */ jsx(Redo2, { className: "size-3.5" })
|
|
204
81
|
}
|
|
205
|
-
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
ToolbarButton,
|
|
86
|
+
{
|
|
87
|
+
title: "Heading 1",
|
|
88
|
+
active: f.h1,
|
|
89
|
+
disabled: !ed,
|
|
90
|
+
onClick: () => ed?.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
91
|
+
children: /* @__PURE__ */ jsx(Heading1, { className: "size-3.5" })
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
ToolbarButton,
|
|
96
|
+
{
|
|
97
|
+
title: "Heading 2",
|
|
98
|
+
active: f.h2,
|
|
99
|
+
disabled: !ed,
|
|
100
|
+
onClick: () => ed?.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
101
|
+
children: /* @__PURE__ */ jsx(Heading2, { className: "size-3.5" })
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
ToolbarButton,
|
|
106
|
+
{
|
|
107
|
+
title: "Heading 3",
|
|
108
|
+
active: f.h3,
|
|
109
|
+
disabled: !ed,
|
|
110
|
+
onClick: () => ed?.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
111
|
+
children: /* @__PURE__ */ jsx(Heading3, { className: "size-3.5" })
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
ToolbarButton,
|
|
117
|
+
{
|
|
118
|
+
title: "Bold",
|
|
119
|
+
active: f.bold,
|
|
120
|
+
disabled: !ed,
|
|
121
|
+
onClick: () => ed?.chain().focus().toggleBold().run(),
|
|
122
|
+
children: /* @__PURE__ */ jsx(Bold, { className: "size-3.5" })
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
ToolbarButton,
|
|
127
|
+
{
|
|
128
|
+
title: "Italic",
|
|
129
|
+
active: f.italic,
|
|
130
|
+
disabled: !ed,
|
|
131
|
+
onClick: () => ed?.chain().focus().toggleItalic().run(),
|
|
132
|
+
children: /* @__PURE__ */ jsx(Italic, { className: "size-3.5" })
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ jsx(
|
|
136
|
+
ToolbarButton,
|
|
137
|
+
{
|
|
138
|
+
title: "Strikethrough",
|
|
139
|
+
active: f.strike,
|
|
140
|
+
disabled: !ed,
|
|
141
|
+
onClick: () => ed?.chain().focus().toggleStrike().run(),
|
|
142
|
+
children: /* @__PURE__ */ jsx(Strikethrough, { className: "size-3.5" })
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
/* @__PURE__ */ jsx(
|
|
146
|
+
ToolbarButton,
|
|
147
|
+
{
|
|
148
|
+
title: "Inline code",
|
|
149
|
+
active: f.code,
|
|
150
|
+
disabled: !ed,
|
|
151
|
+
onClick: () => ed?.chain().focus().toggleCode().run(),
|
|
152
|
+
children: /* @__PURE__ */ jsx(Code, { className: "size-3.5" })
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
156
|
+
/* @__PURE__ */ jsx(
|
|
157
|
+
ToolbarButton,
|
|
158
|
+
{
|
|
159
|
+
title: "Bullet list",
|
|
160
|
+
active: f.bulletList,
|
|
161
|
+
disabled: !ed,
|
|
162
|
+
onClick: () => ed?.chain().focus().toggleBulletList().run(),
|
|
163
|
+
children: /* @__PURE__ */ jsx(List, { className: "size-3.5" })
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ jsx(
|
|
167
|
+
ToolbarButton,
|
|
168
|
+
{
|
|
169
|
+
title: "Ordered list",
|
|
170
|
+
active: f.orderedList,
|
|
171
|
+
disabled: !ed,
|
|
172
|
+
onClick: () => ed?.chain().focus().toggleOrderedList().run(),
|
|
173
|
+
children: /* @__PURE__ */ jsx(ListOrdered, { className: "size-3.5" })
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ jsx(
|
|
177
|
+
ToolbarButton,
|
|
178
|
+
{
|
|
179
|
+
title: "Blockquote",
|
|
180
|
+
active: f.blockquote,
|
|
181
|
+
disabled: !ed,
|
|
182
|
+
onClick: () => ed?.chain().focus().toggleBlockquote().run(),
|
|
183
|
+
children: /* @__PURE__ */ jsx(Quote, { className: "size-3.5" })
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
187
|
+
/* @__PURE__ */ jsx(
|
|
188
|
+
ToolbarButton,
|
|
189
|
+
{
|
|
190
|
+
title: "Link",
|
|
191
|
+
disabled: !ed,
|
|
192
|
+
onClick: () => {
|
|
193
|
+
const previous = ed?.getAttributes("link").href;
|
|
194
|
+
const url = window.prompt("URL", previous ?? "https://");
|
|
195
|
+
if (url === null) return;
|
|
196
|
+
if (url === "") {
|
|
197
|
+
ed?.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
ed?.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
|
|
201
|
+
},
|
|
202
|
+
children: /* @__PURE__ */ jsx(LinkIcon, { className: "size-3.5" })
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
206
|
+
/* @__PURE__ */ jsx(
|
|
207
|
+
ToolbarButton,
|
|
208
|
+
{
|
|
209
|
+
title: "Code block",
|
|
210
|
+
active: f.codeBlock,
|
|
211
|
+
disabled: !ed,
|
|
212
|
+
onClick: () => ed?.chain().focus().toggleCodeBlock().run(),
|
|
213
|
+
children: /* @__PURE__ */ jsx(FileCode2, { className: "size-3.5" })
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
/* @__PURE__ */ jsx(
|
|
217
|
+
ToolbarButton,
|
|
218
|
+
{
|
|
219
|
+
title: "Insert image",
|
|
220
|
+
disabled: !ed,
|
|
221
|
+
onClick: () => {
|
|
222
|
+
const url = window.prompt("Image URL");
|
|
223
|
+
if (!url) return;
|
|
224
|
+
ed?.chain().focus().setImage({ src: url }).run();
|
|
225
|
+
},
|
|
226
|
+
children: /* @__PURE__ */ jsx(ImageIcon, { className: "size-3.5" })
|
|
227
|
+
}
|
|
228
|
+
),
|
|
229
|
+
/* @__PURE__ */ jsx(
|
|
230
|
+
ToolbarButton,
|
|
231
|
+
{
|
|
232
|
+
title: "Insert table",
|
|
233
|
+
disabled: !ed,
|
|
234
|
+
onClick: () => ed?.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run(),
|
|
235
|
+
children: /* @__PURE__ */ jsx(TableIcon, { className: "size-3.5" })
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/* @__PURE__ */ jsx(
|
|
239
|
+
ToolbarButton,
|
|
240
|
+
{
|
|
241
|
+
title: "Horizontal rule",
|
|
242
|
+
disabled: !ed,
|
|
243
|
+
onClick: () => ed?.chain().focus().setHorizontalRule().run(),
|
|
244
|
+
children: /* @__PURE__ */ jsx(Minus, { className: "size-3.5" })
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
/* @__PURE__ */ jsx(
|
|
248
|
+
ToolbarButton,
|
|
249
|
+
{
|
|
250
|
+
title: "Clear formatting",
|
|
251
|
+
disabled: !ed,
|
|
252
|
+
onClick: () => ed?.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
253
|
+
children: /* @__PURE__ */ jsx(RemoveFormatting, { className: "size-3.5" })
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
] });
|
|
232
257
|
}
|
|
233
258
|
function ToolbarButton({
|
|
234
259
|
title,
|
|
@@ -237,7 +262,7 @@ function ToolbarButton({
|
|
|
237
262
|
onClick,
|
|
238
263
|
children
|
|
239
264
|
}) {
|
|
240
|
-
return /* @__PURE__ */
|
|
265
|
+
return /* @__PURE__ */ jsx(
|
|
241
266
|
"button",
|
|
242
267
|
{
|
|
243
268
|
type: "button",
|
|
@@ -246,13 +271,13 @@ function ToolbarButton({
|
|
|
246
271
|
"aria-pressed": active,
|
|
247
272
|
disabled,
|
|
248
273
|
onClick,
|
|
249
|
-
className: active ? "inline-flex h-7 w-7 items-center justify-center rounded-md bg-p-warm text-p-ink transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default" : "inline-flex h-7 w-7 items-center justify-center rounded-md bg-transparent text-p-ink-3 transition-colors cursor-pointer hover:bg-p-warm hover:text-p-ink disabled:opacity-30 disabled:cursor-default"
|
|
250
|
-
|
|
251
|
-
|
|
274
|
+
className: active ? "inline-flex h-7 w-7 items-center justify-center rounded-md bg-p-warm text-p-ink transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default" : "inline-flex h-7 w-7 items-center justify-center rounded-md bg-transparent text-p-ink-3 transition-colors cursor-pointer hover:bg-p-warm hover:text-p-ink disabled:opacity-30 disabled:cursor-default",
|
|
275
|
+
children
|
|
276
|
+
}
|
|
252
277
|
);
|
|
253
278
|
}
|
|
254
279
|
function Divider() {
|
|
255
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ jsx("span", { className: "mx-1 h-5 w-px shrink-0 bg-p-line", "aria-hidden": true });
|
|
256
281
|
}
|
|
257
282
|
export {
|
|
258
283
|
DocsFormattingToolbar
|
package/dist/docs-skeleton.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Loading skeleton for the doc surface — Word-style: h1 + 4
|
|
5
5
|
* paragraphs + bullet list. Soft shimmer keyframe defined inline so
|
|
6
6
|
* the package stays CSS-free.
|
|
7
7
|
*/
|
|
8
|
-
declare function DocsSkeleton():
|
|
8
|
+
declare function DocsSkeleton(): react_jsx_runtime.JSX.Element;
|
|
9
9
|
|
|
10
10
|
export { DocsSkeleton };
|
package/dist/docs-skeleton.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
function DocsSkeleton() {
|
|
3
|
-
return /* @__PURE__ */
|
|
4
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-4 overflow-hidden bg-p-bg px-12 py-10", children: [
|
|
5
|
+
/* @__PURE__ */ jsx(SkeletonStyles, {}),
|
|
6
|
+
/* @__PURE__ */ jsx(SkLine, { width: "55%", height: 28, radius: 6 }),
|
|
7
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2.5", children: [
|
|
8
|
+
/* @__PURE__ */ jsx(SkLine, {}),
|
|
9
|
+
/* @__PURE__ */ jsx(SkLine, { width: "92%" }),
|
|
10
|
+
/* @__PURE__ */ jsx(SkLine, { width: "78%" })
|
|
11
|
+
] }),
|
|
12
|
+
/* @__PURE__ */ jsx(SkLine, { width: "40%", height: 18, radius: 4 }),
|
|
13
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 pl-4", children: [
|
|
14
|
+
/* @__PURE__ */ jsx(SkLine, { width: "66%" }),
|
|
15
|
+
/* @__PURE__ */ jsx(SkLine, { width: "58%" }),
|
|
16
|
+
/* @__PURE__ */ jsx(SkLine, { width: "72%" })
|
|
17
|
+
] }),
|
|
18
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-col gap-2.5", children: [
|
|
19
|
+
/* @__PURE__ */ jsx(SkLine, { width: "88%" }),
|
|
20
|
+
/* @__PURE__ */ jsx(SkLine, { width: "94%" }),
|
|
21
|
+
/* @__PURE__ */ jsx(SkLine, { width: "40%" })
|
|
22
|
+
] })
|
|
23
|
+
] });
|
|
4
24
|
}
|
|
5
25
|
function SkLine({
|
|
6
26
|
width = "100%",
|
|
@@ -8,7 +28,7 @@ function SkLine({
|
|
|
8
28
|
radius = 4,
|
|
9
29
|
className
|
|
10
30
|
}) {
|
|
11
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
12
32
|
"div",
|
|
13
33
|
{
|
|
14
34
|
className: `fm-skeleton ${className ?? ""}`,
|
|
@@ -17,7 +37,7 @@ function SkLine({
|
|
|
17
37
|
);
|
|
18
38
|
}
|
|
19
39
|
function SkeletonStyles() {
|
|
20
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ jsx("style", { children: `
|
|
21
41
|
@keyframes fmSkShimmer {
|
|
22
42
|
0% { background-position: -200% 0; }
|
|
23
43
|
100% { background-position: 200% 0; }
|
|
@@ -32,7 +52,7 @@ function SkeletonStyles() {
|
|
|
32
52
|
background-size: 200% 100%;
|
|
33
53
|
animation: fmSkShimmer 1.6s ease-in-out infinite;
|
|
34
54
|
}
|
|
35
|
-
`);
|
|
55
|
+
` });
|
|
36
56
|
}
|
|
37
57
|
export {
|
|
38
58
|
DocsSkeleton
|
package/dist/docs-toolbar.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -13,6 +13,6 @@ import { ReactNode } from 'react';
|
|
|
13
13
|
*/
|
|
14
14
|
declare function DocsToolbar({ children }: {
|
|
15
15
|
children?: ReactNode;
|
|
16
|
-
}):
|
|
16
|
+
}): react_jsx_runtime.JSX.Element;
|
|
17
17
|
|
|
18
18
|
export { DocsToolbar };
|
package/dist/docs-toolbar.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { useDocsDocument } from "./docs-document";
|
|
3
4
|
function DocsToolbar({ children }) {
|
|
4
5
|
const { meta } = useDocsDocument();
|
|
5
6
|
const cls = meta.density === "compact" ? "flex h-10 shrink-0 items-center gap-1 border-b border-p-line bg-p-surface px-2" : "flex h-11 shrink-0 items-center gap-1 border-b border-p-line bg-p-surface px-3";
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsx("div", { className: cls, children });
|
|
7
8
|
}
|
|
8
9
|
export {
|
|
9
10
|
DocsToolbar
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED