@fileverse-dev/ddoc 4.1.11-patch-3 → 4.1.12-menubar-3
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/{index-CAQPA7Hs.mjs → index-BWdjUdQy.mjs} +1 -1
- package/dist/{index-k1yI08g6.mjs → index-DwLAI_Ie.mjs} +22186 -22123
- package/dist/index.d.ts +2 -2
- package/dist/index.es.js +5 -6
- package/dist/{markdown-source-pane-BoxLMIir.mjs → markdown-source-pane-D6jRN_JD.mjs} +2 -2
- package/dist/package/components/editor-utils.d.ts +1 -25
- package/dist/package/components/split-view/split-view-markdown-pane.d.ts +1 -3
- package/dist/package/extensions/mardown-paste-handler/index.d.ts +0 -5
- package/dist/package/hooks/use-editor-commands.d.ts +20 -0
- package/dist/package/hooks/use-focus-mode.d.ts +6 -1
- package/dist/package/hooks/use-headless-editor.d.ts +9 -1
- package/dist/package/types.d.ts +7 -12
- package/dist/package/utils/insert-commands.d.ts +20 -0
- package/dist/package/utils/typography.d.ts +26 -0
- package/dist/{split-view-toolbar-ndChIJxD.mjs → split-view-toolbar-D4bIgxWm.mjs} +2 -2
- package/dist/style.css +1 -1
- package/package.json +10 -5
- package/dist/package/components/split-view/split-view-css-accordion.d.ts +0 -13
- 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.
|
|
5
|
+
"version": "4.1.12-menubar-3",
|
|
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}": [
|
|
@@ -130,13 +131,15 @@
|
|
|
130
131
|
"@dnd-kit/utilities": ">=3.2.2",
|
|
131
132
|
"@fileverse/crypto": ">=0.0.21",
|
|
132
133
|
"@fileverse/ens": "0.0.4",
|
|
133
|
-
"@fileverse/ui": "5.1.
|
|
134
|
+
"@fileverse/ui": "5.1.10-menubar-7",
|
|
134
135
|
"framer-motion": ">=11.2.10",
|
|
135
136
|
"frimousse": ">=0.3.0",
|
|
136
137
|
"mermaid": "11.14.0",
|
|
137
138
|
"viem": ">=2.35.0"
|
|
138
139
|
},
|
|
139
140
|
"devDependencies": {
|
|
141
|
+
"@testing-library/jest-dom": "^6.4.0",
|
|
142
|
+
"@testing-library/react": "^16.0.0",
|
|
140
143
|
"@types/dompurify": "^3.0.5",
|
|
141
144
|
"@types/katex": "^0.16.7",
|
|
142
145
|
"@types/markdown-it-footnote": "^3.0.4",
|
|
@@ -155,11 +158,13 @@
|
|
|
155
158
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
156
159
|
"eslint-plugin-react-refresh": "^0.4.4",
|
|
157
160
|
"husky": "^9.1.7",
|
|
161
|
+
"jsdom": "^25.0.0",
|
|
158
162
|
"lint-staged": "^15.2.10",
|
|
159
163
|
"postcss": "^8.4.38",
|
|
160
164
|
"prettier": "^3.4.2",
|
|
161
165
|
"tailwindcss": "^3.4.3",
|
|
162
166
|
"typescript": "^5.2.2",
|
|
163
|
-
"vite": "^5.0.0"
|
|
167
|
+
"vite": "^5.0.0",
|
|
168
|
+
"vitest": "^2.1.0"
|
|
164
169
|
}
|
|
165
|
-
}
|
|
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,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;
|