@fileverse-dev/ddoc 4.1.12-durability-2 → 4.1.12-menubar-4

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 (30) hide show
  1. package/dist/{index-Anwb_Wtj.mjs → index-C-48tNYP.mjs} +45459 -45376
  2. package/dist/{index-DbEmQ3zM.mjs → index-CoUwgH4G.mjs} +1 -1
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.es.js +5 -6
  5. package/dist/{markdown-source-pane-BKjCjPre.mjs → markdown-source-pane-CSqCwVNs.mjs} +2 -2
  6. package/dist/package/components/editor-utils.d.ts +1 -25
  7. package/dist/package/components/split-view/split-view-markdown-pane.d.ts +1 -3
  8. package/dist/package/extensions/mardown-paste-handler/index.d.ts +0 -5
  9. package/dist/package/hooks/use-editor-commands.d.ts +20 -0
  10. package/dist/package/hooks/use-focus-mode.d.ts +6 -1
  11. package/dist/package/hooks/use-headless-editor.d.ts +9 -1
  12. package/dist/package/hooks/use-tab-editor.d.ts +2 -3
  13. package/dist/package/hooks/use-yjs-setup.d.ts +0 -1
  14. package/dist/package/stores/comment-store-provider.d.ts +3 -1
  15. package/dist/package/stores/comment-store.d.ts +15 -0
  16. package/dist/package/sync-local/SyncManager.d.ts +7 -12
  17. package/dist/package/sync-local/socketClient.d.ts +7 -21
  18. package/dist/package/sync-local/types/index.d.ts +9 -41
  19. package/dist/package/types.d.ts +7 -12
  20. package/dist/package/use-ddoc-editor.d.ts +0 -1
  21. package/dist/package/utils/insert-commands.d.ts +20 -0
  22. package/dist/package/utils/make-editor.d.ts +9 -0
  23. package/dist/package/utils/selection-utils.d.ts +35 -0
  24. package/dist/package/utils/typography.d.ts +26 -0
  25. package/dist/{split-view-toolbar-COesAtId.mjs → split-view-toolbar-CrXMylDY.mjs} +2 -2
  26. package/dist/style.css +1 -1
  27. package/package.json +11 -5
  28. package/dist/package/components/split-view/split-view-css-accordion.d.ts +0 -13
  29. package/dist/package/sync-local/floor.d.ts +0 -6
  30. package/dist/package/utils/sanitize-css.d.ts +0 -45
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "4.1.12-durability-2",
5
+ "version": "4.1.12-menubar-4",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {
@@ -25,7 +25,8 @@
25
25
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
26
26
  "preview": "vite preview",
27
27
  "prepare": "husky install",
28
- "build:watch": "vite build --watch"
28
+ "build:watch": "vite build --watch",
29
+ "test": "vitest run"
29
30
  },
30
31
  "lint-staged": {
31
32
  "**/*.{js,jsx,ts,tsx}": [
@@ -120,6 +121,7 @@
120
121
  "y-indexeddb": "^9.0.12",
121
122
  "y-prosemirror": "^1.2.5",
122
123
  "y-protocols": "^1.0.6",
124
+ "y-webrtc": "^10.3.0",
123
125
  "yjs": "^13.6.15",
124
126
  "zustand": "^5.0.12"
125
127
  },
@@ -129,13 +131,15 @@
129
131
  "@dnd-kit/utilities": ">=3.2.2",
130
132
  "@fileverse/crypto": ">=0.0.21",
131
133
  "@fileverse/ens": "0.0.4",
132
- "@fileverse/ui": "5.1.9",
134
+ "@fileverse/ui": "5.1.10-menubar-7",
133
135
  "framer-motion": ">=11.2.10",
134
136
  "frimousse": ">=0.3.0",
135
137
  "mermaid": "11.14.0",
136
138
  "viem": ">=2.35.0"
137
139
  },
138
140
  "devDependencies": {
141
+ "@testing-library/jest-dom": "^6.4.0",
142
+ "@testing-library/react": "^16.0.0",
139
143
  "@types/dompurify": "^3.0.5",
140
144
  "@types/katex": "^0.16.7",
141
145
  "@types/markdown-it-footnote": "^3.0.4",
@@ -154,11 +158,13 @@
154
158
  "eslint-plugin-react-hooks": "^4.6.0",
155
159
  "eslint-plugin-react-refresh": "^0.4.4",
156
160
  "husky": "^9.1.7",
161
+ "jsdom": "^25.0.0",
157
162
  "lint-staged": "^15.2.10",
158
163
  "postcss": "^8.4.38",
159
164
  "prettier": "^3.4.2",
160
165
  "tailwindcss": "^3.4.3",
161
166
  "typescript": "^5.2.2",
162
- "vite": "^5.0.0"
167
+ "vite": "^5.0.0",
168
+ "vitest": "^2.1.0"
163
169
  }
164
- }
170
+ }
@@ -1,13 +0,0 @@
1
- interface SplitViewCssAccordionProps {
2
- /** The document's custom CSS (raw author selectors). */
3
- customCSS?: string;
4
- }
5
- /**
6
- * Split View LEFT pane: a collapsible, READ-ONLY view of the document's custom
7
- * CSS, shown above the markdown source. Custom CSS is edited in the styling
8
- * palette (the single source of truth), not in the markdown pane — this is a
9
- * transparency affordance so the author can see what CSS is applied while in
10
- * markdown mode. Renders nothing when there is no custom CSS.
11
- */
12
- export declare const SplitViewCssAccordion: ({ customCSS, }: SplitViewCssAccordionProps) => import("react/jsx-runtime").JSX.Element | null;
13
- export {};
@@ -1,6 +0,0 @@
1
- export declare function advanceFloor(floor: number, pageSeqsAscending: number[]): number;
2
- export declare function shouldAuthorSnapshot(p: {
3
- isOwner: boolean;
4
- updatesSinceLastSnapshot: number;
5
- threshold: number;
6
- }): boolean;
@@ -1,45 +0,0 @@
1
- /**
2
- * Sanitize + scope + validate author-supplied custom CSS before it is injected
3
- * into the document.
4
- *
5
- * Authors write **normal, full-page CSS** — `body { … }`, `html body h1 { … }`,
6
- * `h1 { … }`, `* { … }` — the way they'd style any web page. We transparently
7
- * scope every rule to the document so it can't leak into the app, AND we map the
8
- * page-root selectors (`html`, `body`, `:root`) onto the document root so that
9
- * `body { background: … }` styles the doc surface and `html body h1 { … }`
10
- * styles the doc's headings. No `.ProseMirror` prefix, no learning curve.
11
- *
12
- * Because the raw string reaches VIEWERS of a published doc, it is untrusted.
13
- * Every selector is force-scoped (so a `}` breakout is neutralised — the escaped
14
- * rule is simply scoped too), and dangerous declarations are stripped:
15
- * - external resource loads / exfiltration: `url(…)`, `@import`;
16
- * - clickjacking / UI redressing: `position: fixed | sticky`;
17
- * - legacy script vectors: `expression()`, `-moz-binding`, `behavior:`.
18
- *
19
- * We parse with the browser's own CSS engine (no dependency), rewrite each
20
- * selector, strip dangerous declarations at every nesting level, and let the
21
- * engine re-serialise — so the output is always a valid, balanced stylesheet.
22
- *
23
- * The sanitizer knows exactly what it removed, so it returns non-blocking
24
- * `diagnostics`; the editing UI surfaces them (CSS is forgiving — we warn,
25
- * never block).
26
- */
27
- export interface CssDiagnostic {
28
- level: 'warning' | 'error';
29
- message: string;
30
- }
31
- export interface CssValidationResult {
32
- /** Sanitized, scoped CSS, safe to inject. '' when nothing survives. */
33
- css: string;
34
- /** What was stripped/ignored, deduped. Empty when the CSS was fully clean. */
35
- diagnostics: CssDiagnostic[];
36
- }
37
- /**
38
- * Sanitize + scope AND report. Use this from the editing UI for diagnostics.
39
- */
40
- export declare const validateCustomCss: (raw: string | undefined | null, scope?: string) => CssValidationResult;
41
- /**
42
- * Sanitized + scoped CSS only — used at injection/export sinks that just need
43
- * the safe string. Diagnostics are surfaced separately via validateCustomCss.
44
- */
45
- export declare const sanitizeCustomCss: (raw: string | undefined | null, scope?: string) => string;