@fileverse-dev/ddoc 6.0.1 → 7.0.0-drop-in.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.
- package/README.md +89 -18
- package/dist/data-BCRDUrcS.mjs +59842 -0
- package/dist/{ddoc-persistence-C2ay3lLb.mjs → ddoc-persistence-DLdSviUr.mjs} +14 -13
- package/dist/headless-editor-utils.es.js +1 -1
- package/dist/index-C2HUe78M.mjs +14053 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +11197 -21742
- package/dist/markdown-source-pane-BJbpMXo2.mjs +143 -0
- package/dist/package/components/editor-navbar.d.ts +12 -0
- package/dist/package/components/editor-toolbar.d.ts +2 -1
- package/dist/package/components/fullscreen-toolbar.d.ts +2 -2
- package/dist/package/components/mobile-toolbar.d.ts +2 -1
- package/dist/package/components/tabs/document-mobile-tab-panel.d.ts +3 -1
- package/dist/package/components/tabs/document-tabs-sidebar.d.ts +2 -1
- package/dist/package/components/toc/document-outline.d.ts +1 -1
- package/dist/package/components/toc/toc.d.ts +1 -1
- package/dist/package/components/toc/types.d.ts +7 -0
- package/dist/package/extensions/emoji/components/emoji-utils.d.ts +2 -2
- package/dist/package/hooks/use-canvas-metrics.d.ts +16 -0
- package/dist/package/hooks/use-controllable-state.d.ts +3 -0
- package/dist/package/hooks/use-editor-media-query.d.ts +4 -0
- package/dist/package/hooks/use-focus-mode.d.ts +1 -3
- package/dist/package/hooks/use-tab-editor.d.ts +4 -1
- package/dist/package/types.d.ts +41 -5
- package/dist/package/use-ddoc-editor.d.ts +3 -1
- package/dist/package/utils/container-query-support.d.ts +1 -0
- package/dist/package/utils/editor-width-store.d.ts +6 -0
- package/dist/package/utils/responsive.d.ts +3 -1
- package/dist/package/utils/stats-publisher.d.ts +8 -0
- package/dist/persistence.es.js +1 -1
- package/dist/{split-view-toolbar-DrK-Wp2F.mjs → split-view-toolbar-6aBSjsO2.mjs} +47 -46
- package/dist/style.css +1 -1
- package/dist/tab-utils-BNFvrUAj.mjs +284 -0
- package/dist/use-headless-editor-Cipcv5df.mjs +44491 -0
- package/package.json +5 -2
- package/tailwind.preset.cjs +42 -0
- package/dist/index-By29BevC.mjs +0 -13126
- package/dist/markdown-source-pane-CYcEKMfr.mjs +0 -6069
- package/dist/tab-utils-CAcIp-Dt.mjs +0 -313
- package/dist/use-headless-editor-BIcZNvlS.mjs +0 -162510
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fileverse-dev/ddoc",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "DDoc",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "7.0.0-drop-in.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/fileverse/fileverse-ddocs.git"
|
|
@@ -118,16 +118,19 @@
|
|
|
118
118
|
"lib0": "^0.2.95",
|
|
119
119
|
"lowlight": "^3.3.0",
|
|
120
120
|
"mammoth": "^1.10.0",
|
|
121
|
+
"markdown-it": "^14.1.0",
|
|
121
122
|
"markdown-it-footnote": "^4.0.0",
|
|
122
123
|
"odf-kit": "^0.9.3",
|
|
123
124
|
"ollama": "^0.5.14",
|
|
124
125
|
"platform": "^1.3.6",
|
|
126
|
+
"prettier": "^3.4.2",
|
|
125
127
|
"prosemirror-model": "^1.21.0",
|
|
126
128
|
"prosemirror-state": "^1.4.3",
|
|
127
129
|
"react-tweet": "^3.2.2",
|
|
128
130
|
"react-uuid": "^2.0.0",
|
|
129
131
|
"react-window": "^2.2.7",
|
|
130
132
|
"socket.io-client": "^4.7.5",
|
|
133
|
+
"tippy.js": "^6.3.7",
|
|
131
134
|
"tiptap-markdown": "^0.9.0",
|
|
132
135
|
"turndown": "^7.2.0",
|
|
133
136
|
"usehooks-ts": "^3.1.1",
|
|
@@ -181,6 +184,7 @@
|
|
|
181
184
|
"@typescript-eslint/parser": "^6.10.0",
|
|
182
185
|
"@vitejs/plugin-react": "^4.2.0",
|
|
183
186
|
"autoprefixer": "^10.4.19",
|
|
187
|
+
"emojibase": "^17.0.0",
|
|
184
188
|
"eslint": "^8.53.0",
|
|
185
189
|
"eslint-config-prettier": "^9.1.0",
|
|
186
190
|
"eslint-plugin-prettier": "^5.2.1",
|
|
@@ -193,7 +197,6 @@
|
|
|
193
197
|
"postcss": "^8.4.38",
|
|
194
198
|
"postcss-nested": "^6.2.0",
|
|
195
199
|
"postcss-selector-parser": "^6.1.4",
|
|
196
|
-
"prettier": "^3.4.2",
|
|
197
200
|
"react": "^18.2.0",
|
|
198
201
|
"react-dom": "^18.2.0",
|
|
199
202
|
"tailwindcss": "^3.4.3",
|
package/tailwind.preset.cjs
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
// This file is the `@fileverse-dev/ddoc/tailwind` preset. It composes the ui preset
|
|
2
2
|
// (dark mode, theme, design-system classes) and adds the `mobile` screen.
|
|
3
|
+
// It also adds the ddoc-* variants (docs/DROP_IN_EDITOR.md §2.9).
|
|
3
4
|
// Consumers: `presets: [require('@fileverse-dev/ddoc/tailwind')]` and add
|
|
4
5
|
// node_modules/@fileverse-dev/ddoc/dist/**/*.{js,mjs} plus
|
|
5
6
|
// node_modules/@fileverse/ui/dist/**/*.{js,mjs} to `content` (the dist is chunked).
|
|
7
|
+
const plugin = require('tailwindcss/plugin');
|
|
8
|
+
|
|
9
|
+
// Same widths as the screens, evaluated against the editor root when the
|
|
10
|
+
// element is inside one and against the window otherwise. :where() keeps the
|
|
11
|
+
// window form at the specificity of a screen variant.
|
|
12
|
+
const DDOC_BREAKPOINTS = { sm: 640, md: 768, mobile: 960, lg: 1024, xl: 1280 };
|
|
13
|
+
|
|
6
14
|
module.exports = {
|
|
7
15
|
presets: [require('@fileverse/ui/tailwind')],
|
|
8
16
|
theme: {
|
|
@@ -12,4 +20,38 @@ module.exports = {
|
|
|
12
20
|
},
|
|
13
21
|
},
|
|
14
22
|
},
|
|
23
|
+
plugins: [
|
|
24
|
+
plugin(({ addVariant, matchVariant }) => {
|
|
25
|
+
const breakpoints = Object.entries(DDOC_BREAKPOINTS);
|
|
26
|
+
// Registration order is CSS order. Like Tailwind's screens: max variants
|
|
27
|
+
// first, widest first, so the narrower one wins; then min, ascending.
|
|
28
|
+
for (const [name, px] of [...breakpoints].reverse()) {
|
|
29
|
+
addVariant(`ddoc-max-${name}`, [
|
|
30
|
+
`@container ddoc-editor (max-width: ${px - 0.02}px)`,
|
|
31
|
+
`@media (max-width: ${px - 0.02}px) { &:where(:not(.ddoc-editor-cq *)) }`,
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
34
|
+
for (const [name, px] of breakpoints) {
|
|
35
|
+
addVariant(`ddoc-${name}`, [
|
|
36
|
+
`@container ddoc-editor (min-width: ${px}px)`,
|
|
37
|
+
`@media (min-width: ${px}px) { &:where(:not(.ddoc-editor-cq *)) }`,
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
// One-off widths: ddoc-min-[1410px]: and ddoc-max-[1280px]: (inclusive).
|
|
41
|
+
for (const bound of ['min', 'max']) {
|
|
42
|
+
matchVariant(
|
|
43
|
+
`ddoc-${bound}`,
|
|
44
|
+
(value) => [
|
|
45
|
+
`@container ddoc-editor (${bound}-width: ${value})`,
|
|
46
|
+
`@media (${bound}-width: ${value}) { &:where(:not(.ddoc-editor-cq *)) }`,
|
|
47
|
+
],
|
|
48
|
+
{
|
|
49
|
+
sort: (a, z) =>
|
|
50
|
+
(parseFloat(a.value) - parseFloat(z.value)) *
|
|
51
|
+
(bound === 'min' ? 1 : -1),
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
],
|
|
15
57
|
};
|