@clepit/core 0.2.0-beta.322
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 +23 -0
- package/LICENSE +21 -0
- package/README.md +79 -0
- package/dist/core/editor/action-bar/css.d.ts +3 -0
- package/dist/core/editor/action-bar/index.d.ts +18 -0
- package/dist/core/editor/css.d.ts +3 -0
- package/dist/core/editor/index.d.ts +18 -0
- package/dist/core/editor/views/edit.d.ts +4 -0
- package/dist/core/editor/views/index.d.ts +4 -0
- package/dist/core/editor/views/json.d.ts +9 -0
- package/dist/core/editor/views/preview.d.ts +4 -0
- package/dist/core/element/index.d.ts +101 -0
- package/dist/core/i18n/index.d.ts +43 -0
- package/dist/core/managers/block/css.d.ts +3 -0
- package/dist/core/managers/block/index.d.ts +40 -0
- package/dist/core/managers/event.d.ts +13 -0
- package/dist/core/managers/style.d.ts +181 -0
- package/dist/core/renderer/draw.d.ts +27 -0
- package/dist/core/renderer/index.d.ts +15 -0
- package/dist/core/renderer/invalid-data.d.ts +4 -0
- package/dist/core/renderer/page.d.ts +37 -0
- package/dist/core/store.d.ts +42 -0
- package/dist/core/theme/css.d.ts +4 -0
- package/dist/core/theme/index.d.ts +42 -0
- package/dist/core/toolbars/block/css.d.ts +3 -0
- package/dist/core/toolbars/block/index.d.ts +38 -0
- package/dist/core/toolbars/inline/css.d.ts +6 -0
- package/dist/core/toolbars/inline/index.d.ts +43 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +2 -0
- package/dist/index.mjs +2 -0
- package/dist/tools/block/alert/css.d.ts +5 -0
- package/dist/tools/block/alert/index.d.ts +13 -0
- package/dist/tools/block/alert/input.d.ts +13 -0
- package/dist/tools/block/alert/output.d.ts +9 -0
- package/dist/tools/block/audio/css.d.ts +5 -0
- package/dist/tools/block/audio/index.d.ts +13 -0
- package/dist/tools/block/audio/input.d.ts +22 -0
- package/dist/tools/block/audio/output.d.ts +9 -0
- package/dist/tools/block/checklist/css.d.ts +5 -0
- package/dist/tools/block/checklist/index.d.ts +13 -0
- package/dist/tools/block/checklist/input.d.ts +14 -0
- package/dist/tools/block/checklist/output.d.ts +9 -0
- package/dist/tools/block/code/css.d.ts +5 -0
- package/dist/tools/block/code/grammar/engine.d.ts +52 -0
- package/dist/tools/block/code/grammar/languages.d.ts +6 -0
- package/dist/tools/block/code/highlight.d.ts +22 -0
- package/dist/tools/block/code/index.d.ts +13 -0
- package/dist/tools/block/code/input.d.ts +57 -0
- package/dist/tools/block/code/loaders/language.d.ts +17 -0
- package/dist/tools/block/code/loaders/theme.d.ts +21 -0
- package/dist/tools/block/code/output.d.ts +32 -0
- package/dist/tools/block/code/theme-css.d.ts +14 -0
- package/dist/tools/block/code/theme-generator.d.ts +27 -0
- package/dist/tools/block/code/variants.d.ts +14 -0
- package/dist/tools/block/collapsible/css.d.ts +6 -0
- package/dist/tools/block/collapsible/index.d.ts +13 -0
- package/dist/tools/block/collapsible/input.d.ts +13 -0
- package/dist/tools/block/collapsible/output.d.ts +16 -0
- package/dist/tools/block/collection/css.d.ts +6 -0
- package/dist/tools/block/collection/index.d.ts +13 -0
- package/dist/tools/block/collection/input.d.ts +11 -0
- package/dist/tools/block/collection/output.d.ts +12 -0
- package/dist/tools/block/columns/css.d.ts +6 -0
- package/dist/tools/block/columns/index.d.ts +13 -0
- package/dist/tools/block/columns/input.d.ts +12 -0
- package/dist/tools/block/columns/output.d.ts +11 -0
- package/dist/tools/block/date/css.d.ts +6 -0
- package/dist/tools/block/date/index.d.ts +13 -0
- package/dist/tools/block/date/input.d.ts +12 -0
- package/dist/tools/block/date/output.d.ts +10 -0
- package/dist/tools/block/delimiter/css.d.ts +5 -0
- package/dist/tools/block/delimiter/index.d.ts +13 -0
- package/dist/tools/block/delimiter/input.d.ts +12 -0
- package/dist/tools/block/delimiter/output.d.ts +9 -0
- package/dist/tools/block/doc-card/css.d.ts +6 -0
- package/dist/tools/block/doc-card/index.d.ts +13 -0
- package/dist/tools/block/doc-card/input.d.ts +11 -0
- package/dist/tools/block/doc-card/output.d.ts +11 -0
- package/dist/tools/block/embed/css.d.ts +6 -0
- package/dist/tools/block/embed/index.d.ts +13 -0
- package/dist/tools/block/embed/input.d.ts +11 -0
- package/dist/tools/block/embed/output.d.ts +23 -0
- package/dist/tools/block/embed/providers.d.ts +5 -0
- package/dist/tools/block/file/css.d.ts +6 -0
- package/dist/tools/block/file/index.d.ts +13 -0
- package/dist/tools/block/file/input.d.ts +14 -0
- package/dist/tools/block/file/output.d.ts +10 -0
- package/dist/tools/block/glance/css.d.ts +5 -0
- package/dist/tools/block/glance/index.d.ts +13 -0
- package/dist/tools/block/glance/input.d.ts +11 -0
- package/dist/tools/block/glance/output.d.ts +18 -0
- package/dist/tools/block/header/css.d.ts +5 -0
- package/dist/tools/block/header/index.d.ts +13 -0
- package/dist/tools/block/header/input.d.ts +13 -0
- package/dist/tools/block/header/output.d.ts +9 -0
- package/dist/tools/block/image/css.d.ts +5 -0
- package/dist/tools/block/image/index.d.ts +13 -0
- package/dist/tools/block/image/input.d.ts +22 -0
- package/dist/tools/block/image/output.d.ts +9 -0
- package/dist/tools/block/list/css.d.ts +5 -0
- package/dist/tools/block/list/index.d.ts +13 -0
- package/dist/tools/block/list/input.d.ts +16 -0
- package/dist/tools/block/list/output.d.ts +9 -0
- package/dist/tools/block/openapi/css.d.ts +5 -0
- package/dist/tools/block/openapi/index.d.ts +13 -0
- package/dist/tools/block/openapi/input.d.ts +11 -0
- package/dist/tools/block/openapi/output.d.ts +24 -0
- package/dist/tools/block/openapi/schema.d.ts +17 -0
- package/dist/tools/block/openapi/snippets.d.ts +5 -0
- package/dist/tools/block/openapi/spec.d.ts +46 -0
- package/dist/tools/block/paragraph/css.d.ts +5 -0
- package/dist/tools/block/paragraph/index.d.ts +13 -0
- package/dist/tools/block/paragraph/input.d.ts +12 -0
- package/dist/tools/block/paragraph/output.d.ts +13 -0
- package/dist/tools/block/quote/css.d.ts +5 -0
- package/dist/tools/block/quote/index.d.ts +13 -0
- package/dist/tools/block/quote/input.d.ts +15 -0
- package/dist/tools/block/quote/output.d.ts +14 -0
- package/dist/tools/block/sketch/css.d.ts +6 -0
- package/dist/tools/block/sketch/index.d.ts +13 -0
- package/dist/tools/block/sketch/input.d.ts +14 -0
- package/dist/tools/block/sketch/output.d.ts +16 -0
- package/dist/tools/block/table/css.d.ts +5 -0
- package/dist/tools/block/table/index.d.ts +13 -0
- package/dist/tools/block/table/input.d.ts +28 -0
- package/dist/tools/block/table/output.d.ts +28 -0
- package/dist/tools/block/toc/css.d.ts +6 -0
- package/dist/tools/block/toc/index.d.ts +13 -0
- package/dist/tools/block/toc/input.d.ts +11 -0
- package/dist/tools/block/toc/output.d.ts +18 -0
- package/dist/tools/block/typeset/css.d.ts +6 -0
- package/dist/tools/block/typeset/index.d.ts +22 -0
- package/dist/tools/block/typeset/input.d.ts +18 -0
- package/dist/tools/block/typeset/latex/layout.d.ts +32 -0
- package/dist/tools/block/typeset/latex/model.d.ts +64 -0
- package/dist/tools/block/typeset/latex/parse.d.ts +3 -0
- package/dist/tools/block/typeset/latex/render.d.ts +7 -0
- package/dist/tools/block/typeset/latex/symbols.d.ts +26 -0
- package/dist/tools/block/typeset/mermaid/layout.d.ts +71 -0
- package/dist/tools/block/typeset/mermaid/model.d.ts +78 -0
- package/dist/tools/block/typeset/mermaid/parse.d.ts +3 -0
- package/dist/tools/block/typeset/mermaid/render.d.ts +7 -0
- package/dist/tools/block/typeset/output.d.ts +46 -0
- package/dist/tools/block/updates/css.d.ts +6 -0
- package/dist/tools/block/updates/index.d.ts +13 -0
- package/dist/tools/block/updates/input.d.ts +14 -0
- package/dist/tools/block/updates/output.d.ts +19 -0
- package/dist/tools/block/video/css.d.ts +5 -0
- package/dist/tools/block/video/index.d.ts +13 -0
- package/dist/tools/block/video/input.d.ts +22 -0
- package/dist/tools/block/video/output.d.ts +9 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/inline/bold/css.d.ts +3 -0
- package/dist/tools/inline/bold/index.d.ts +10 -0
- package/dist/tools/inline/code/css.d.ts +3 -0
- package/dist/tools/inline/code/index.d.ts +12 -0
- package/dist/tools/inline/italic/css.d.ts +3 -0
- package/dist/tools/inline/italic/index.d.ts +10 -0
- package/dist/tools/inline/link/css.d.ts +3 -0
- package/dist/tools/inline/link/dialog.d.ts +31 -0
- package/dist/tools/inline/link/index.d.ts +11 -0
- package/dist/tools/inline/marker/css.d.ts +3 -0
- package/dist/tools/inline/marker/index.d.ts +16 -0
- package/dist/tools/inline/mention/css.d.ts +3 -0
- package/dist/tools/inline/mention/index.d.ts +10 -0
- package/dist/tools/inline/status/css.d.ts +3 -0
- package/dist/tools/inline/status/dialog.d.ts +30 -0
- package/dist/tools/inline/status/index.d.ts +12 -0
- package/dist/tools/inline/strikethrough/css.d.ts +3 -0
- package/dist/tools/inline/strikethrough/index.d.ts +10 -0
- package/dist/tools/inline/tooltip/css.d.ts +3 -0
- package/dist/tools/inline/tooltip/dialog.d.ts +52 -0
- package/dist/tools/inline/tooltip/index.d.ts +21 -0
- package/dist/tools/inline/underline/css.d.ts +3 -0
- package/dist/tools/inline/underline/index.d.ts +10 -0
- package/dist/types.d.ts +947 -0
- package/dist/utils/dialogs/css.d.ts +3 -0
- package/dist/utils/dom.d.ts +20 -0
- package/dist/utils/icons.d.ts +7 -0
- package/dist/utils/platform.d.ts +82 -0
- package/dist/utils/sanitize-html-nodom.d.ts +2 -0
- package/dist/utils/switch/css.d.ts +3 -0
- package/dist/utils/switch/index.d.ts +30 -0
- package/dist/utils/tooltip/css.d.ts +3 -0
- package/dist/utils/tooltip/index.d.ts +4 -0
- package/dist/utils/url.d.ts +52 -0
- package/package.json +66 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { OpenApiData } from '../../../types';
|
|
2
|
+
export type OpenApiParam = {
|
|
3
|
+
description?: string;
|
|
4
|
+
in: 'header' | 'path' | 'query';
|
|
5
|
+
name: string;
|
|
6
|
+
required: boolean;
|
|
7
|
+
schema?: unknown;
|
|
8
|
+
};
|
|
9
|
+
export type OpenApiResponse = {
|
|
10
|
+
description: string;
|
|
11
|
+
schema?: unknown;
|
|
12
|
+
status: string;
|
|
13
|
+
};
|
|
14
|
+
export type OpenApiOperation = {
|
|
15
|
+
description?: string;
|
|
16
|
+
id: string;
|
|
17
|
+
internal: boolean;
|
|
18
|
+
method: string;
|
|
19
|
+
params: OpenApiParam[];
|
|
20
|
+
path: string;
|
|
21
|
+
request?: unknown;
|
|
22
|
+
responses: OpenApiResponse[];
|
|
23
|
+
security: string[];
|
|
24
|
+
server?: string;
|
|
25
|
+
summary: string;
|
|
26
|
+
tags: string[];
|
|
27
|
+
};
|
|
28
|
+
export type OpenApiGroup = {
|
|
29
|
+
id: string;
|
|
30
|
+
operations: OpenApiOperation[];
|
|
31
|
+
title: string;
|
|
32
|
+
};
|
|
33
|
+
export type OpenApiServer = {
|
|
34
|
+
description?: string;
|
|
35
|
+
url: string;
|
|
36
|
+
};
|
|
37
|
+
export type OpenApiModel = {
|
|
38
|
+
groups: OpenApiGroup[];
|
|
39
|
+
schemas: Record<string, unknown>;
|
|
40
|
+
servers: OpenApiServer[];
|
|
41
|
+
title: string;
|
|
42
|
+
version: string;
|
|
43
|
+
};
|
|
44
|
+
export declare const slugify: (text: string) => string;
|
|
45
|
+
export declare const parseOpenApi: (spec: unknown, data: OpenApiData) => OpenApiModel;
|
|
46
|
+
//# sourceMappingURL=spec.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const inputStylesKey = "clepit-paragraph-input-styles";
|
|
2
|
+
export declare const inputStyle = "\n/* Paragraph block styles */\n.clepit-paragraph {\n outline: none;\n margin: 0;\n margin-block-start: 0;\n margin-block-end: 0;\n margin-inline-start: 0;\n margin-inline-end: 0;\n padding: 0 20px;\n}\n\n.clepit-block[data-tool=\"paragraph\"] .clepit-block-content {\n font-size: 16px;\n line-height: 1.6;\n}\n\n/* Paragraph placeholder styles */\n.clepit-paragraph[data-placeholder]:empty::before {\n content: attr(data-placeholder);\n color: var(--clepit-text-subtle);\n pointer-events: none;\n font-style: italic;\n}\n\n/* Paragraph link styles */\n.clepit-paragraph a {\n color: var(--clepit-primary);\n text-decoration: none;\n cursor: pointer;\n transition: color 0.2s ease;\n}\n\n.clepit-paragraph a:hover {\n color: var(--clepit-primary-hover);\n text-decoration: none;\n}\n\n/* Paragraph inline code styling */\n.clepit-paragraph code {\n background: var(--clepit-error-bg);\n color: var(--clepit-error);\n padding: 0 4px;\n border-radius: 4px;\n}\n\n/* Paragraph marker brush effect */\n.clepit-paragraph mark {\n background: none;\n position: relative;\n color: inherit;\n display: inline-block;\n z-index: 0; /* create stacking context so ::before sits behind text, not page */\n white-space: pre-wrap; /* ensure leading/trailing spaces inside mark render */\n}\n\n.clepit-paragraph mark::before {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n top: 0.15em;\n height: 1.25em;\n transform: rotate(-0.4deg);\n background: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'><path d='M0,8 C5,2 15,1 25,3 35,5 45,2 55,4 65,6 75,5 85,7 95,9 100,8 100,8 100,14 95,18 85,17 75,16 65,19 55,17 45,15 35,18 25,16 15,14 5,15 0,12 Z' fill='%23FFE047'/></svg>\") no-repeat center / 100% 100%;\n z-index: -1; /* behind text but within mark's stacking context */\n}\n\n";
|
|
3
|
+
export declare const outputStylesKey = "clepit-paragraph-output-styles";
|
|
4
|
+
export declare const outputStyle = "\n/* Output paragraph styles */\n.clepit-output-paragraph {\n margin: 0 0 1rem 0;\n line-height: 1.6;\n color: var(--clepit-text);\n}\n\n/* Output paragraph inline code styling */\n.clepit-output-paragraph code {\n background: var(--clepit-error-bg);\n color: var(--clepit-error);\n padding: 0 4px;\n border-radius: 4px;\n}\n\n/* Output paragraph marker brush effect */\n.clepit-output-paragraph mark {\n background: none;\n position: relative;\n color: inherit;\n display: inline-block;\n z-index: 0;\n white-space: pre-wrap;\n}\n\n.clepit-output-paragraph mark::before {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n top: 0.15em;\n height: 1.25em;\n transform: rotate(-0.4deg);\n background: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'><path d='M0,8 C5,2 15,1 25,3 35,5 45,2 55,4 65,6 75,5 85,7 95,9 100,8 100,8 100,14 95,18 85,17 75,16 65,19 55,17 45,15 35,18 25,16 15,14 5,15 0,12 Z' fill='%23FFE047'/></svg>\") no-repeat center / 100% 100%;\n z-index: -1;\n}\n\n/* Output paragraph link styles */\n.clepit-output-paragraph a {\n color: var(--clepit-primary);\n text-decoration: none;\n cursor: pointer;\n transition: color 0.2s ease;\n}\n\n.clepit-output-paragraph a:hover {\n color: var(--clepit-primary-hover);\n text-decoration: none;\n}\n";
|
|
5
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ParagraphInput } from './input';
|
|
2
|
+
import { ParagraphOutput } from './output';
|
|
3
|
+
import { ToolType } from '../../../types';
|
|
4
|
+
export declare const ParagraphTool: {
|
|
5
|
+
icon: string;
|
|
6
|
+
readonly input: typeof ParagraphInput;
|
|
7
|
+
label: string;
|
|
8
|
+
readonly output: typeof ParagraphOutput;
|
|
9
|
+
shortcut: string;
|
|
10
|
+
testId: string;
|
|
11
|
+
type: ToolType;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputConfig, ParagraphData } from '../../../types';
|
|
2
|
+
export declare class ParagraphInput {
|
|
3
|
+
static placeholder: string;
|
|
4
|
+
private static eventListenersMap;
|
|
5
|
+
private static addEventListener;
|
|
6
|
+
static save(element: HTMLElement): ParagraphData;
|
|
7
|
+
static render(containerId: string, data?: ParagraphData, config?: InputConfig<'paragraph'>): HTMLElement;
|
|
8
|
+
static isEmpty(blockElement: HTMLElement): boolean;
|
|
9
|
+
static isEmptyData(data: ParagraphData): boolean;
|
|
10
|
+
static destroy(containerId: string): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Backing, ClepitElement } from '../../../core/element';
|
|
2
|
+
import { BlockClassNames, BlockStyles, OutputConfig, ParagraphData } from '../../../types';
|
|
3
|
+
export declare class ParagraphOutput {
|
|
4
|
+
static render(data: ParagraphData, config?: OutputConfig, styles?: BlockStyles['paragraph'], classNames?: BlockClassNames['paragraph']): HTMLElement;
|
|
5
|
+
/**
|
|
6
|
+
* The same drawing, expressed against the element layer so it can run with no
|
|
7
|
+
* browser. `render` above stays the DOM path the editor uses; this is what a
|
|
8
|
+
* consumer server-rendering the package calls.
|
|
9
|
+
*/
|
|
10
|
+
static draw(data: ParagraphData, backing?: Backing): ClepitElement | null;
|
|
11
|
+
private static validate;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const inputStylesKey = "clepit-quote-input-styles";
|
|
2
|
+
export declare const inputStyle: string;
|
|
3
|
+
export declare const outputStylesKey = "clepit-quote-output-styles";
|
|
4
|
+
export declare const outputStyle = "\n/* Output quote styles */\n.clepit-output-quote-container {\n background: linear-gradient(135deg, var(--clepit-surface) 0%, var(--clepit-surface-2) 100%);\n border: 1px solid var(--clepit-border);\n border-radius: 4px;\n padding: 12px 14px;\n margin: 20px 0;\n position: relative;\n}\n\n.clepit-output-quote-author {\n color: var(--clepit-text-muted);\n font-size: 0.9em;\n font-style: normal;\n font-family: inherit;\n text-align: right;\n margin-top: 10px;\n}\n\n.clepit-output-quote-divider {\n height: 1px;\n margin: 15px 0;\n background: linear-gradient(to right, transparent, var(--clepit-border-subtle), transparent);\n}\n\n.clepit-output-quote-text {\n font-size: 1.2em;\n line-height: 1.6;\n font-family: cursive, serif;\n font-style: italic;\n margin-bottom: 15px;\n}\n\n.clepit-output-quote-content {\n /* Content styling handled by parent */\n}\n\n/* Output quote link styles */\n.clepit-output-quote a {\n color: var(--clepit-primary);\n text-decoration: none;\n cursor: pointer;\n transition: color 0.2s ease;\n}\n\n.clepit-output-quote a:hover {\n color: var(--clepit-primary-hover);\n text-decoration: none;\n}\n\n/* Output quote inline code styling */\n.clepit-output-quote code {\n background: var(--clepit-error-bg);\n color: var(--clepit-error);\n padding: 0 4px;\n border-radius: 4px;\n}\n\n.clepit-output-quote cite code {\n background: var(--clepit-error-bg);\n color: var(--clepit-error);\n padding: 0 4px;\n border-radius: 4px;\n}\n\n/* Output quote marker brush effect */\n.clepit-output-quote mark {\n background: none;\n position: relative;\n color: inherit;\n display: inline-block;\n z-index: 0;\n white-space: pre-wrap;\n}\n\n.clepit-output-quote mark::before {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n top: 0.15em;\n height: 1.25em;\n transform: rotate(-0.4deg);\n background: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'><path d='M0,8 C5,2 15,1 25,3 35,5 45,2 55,4 65,6 75,5 85,7 95,9 100,8 100,8 100,14 95,18 85,17 75,16 65,19 55,17 45,15 35,18 25,16 15,14 5,15 0,12 Z' fill='%23FFE047'/></svg>\") no-repeat center / 100% 100%;\n z-index: -1;\n}\n\n.clepit-output-quote cite mark {\n background: none;\n position: relative;\n color: inherit;\n display: inline-block;\n z-index: 0;\n white-space: pre-wrap;\n}\n\n.clepit-output-quote cite mark::before {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n top: 0.15em;\n height: 1.25em;\n transform: rotate(-0.4deg);\n background: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'><path d='M0,8 C5,2 15,1 25,3 35,5 45,2 55,4 65,6 75,5 85,7 95,9 100,8 100,8 100,14 95,18 85,17 75,16 65,19 55,17 45,15 35,18 25,16 15,14 5,15 0,12 Z' fill='%23FFE047'/></svg>\") no-repeat center / 100% 100%;\n z-index: -1;\n}\n";
|
|
5
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { QuoteInput } from './input';
|
|
2
|
+
import { QuoteOutput } from './output';
|
|
3
|
+
import { ToolType } from '../../../types';
|
|
4
|
+
export declare const QuoteTool: {
|
|
5
|
+
icon: string;
|
|
6
|
+
readonly input: typeof QuoteInput;
|
|
7
|
+
label: string;
|
|
8
|
+
readonly output: typeof QuoteOutput;
|
|
9
|
+
shortcut: string;
|
|
10
|
+
testId: string;
|
|
11
|
+
type: ToolType;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InputConfig, QuoteData } from '../../../types';
|
|
2
|
+
export declare class QuoteInput {
|
|
3
|
+
static placeholder: string;
|
|
4
|
+
static authorPlaceholder: string;
|
|
5
|
+
private static eventListenersMap;
|
|
6
|
+
private static addEventListener;
|
|
7
|
+
static save(element: HTMLElement): QuoteData;
|
|
8
|
+
static render(containerId: string, data?: QuoteData, config?: InputConfig<'quote'>): HTMLElement;
|
|
9
|
+
private static handleKeydown;
|
|
10
|
+
static handleKeydownInAuthorInput(event: Event): void;
|
|
11
|
+
static isEmpty(blockElement: HTMLElement): boolean;
|
|
12
|
+
static isEmptyData(data: QuoteData): boolean;
|
|
13
|
+
static destroy(containerId: string): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Backing, ClepitElement } from '../../../core/element';
|
|
2
|
+
import { BlockClassNames, BlockStyles, OutputConfig, QuoteData } from '../../../types';
|
|
3
|
+
export declare class QuoteOutput {
|
|
4
|
+
static render(data: QuoteData, config?: OutputConfig, styles?: BlockStyles['quote'], classNames?: BlockClassNames['quote']): HTMLElement;
|
|
5
|
+
/**
|
|
6
|
+
* The same drawing, against the element layer, so it runs with no browser.
|
|
7
|
+
*
|
|
8
|
+
* The tooltip pass in `render` is deliberately absent: attaching a tooltip is
|
|
9
|
+
* interaction, and interaction belongs to the DOM path.
|
|
10
|
+
*/
|
|
11
|
+
static draw(data: QuoteData, backing?: Backing): ClepitElement | null;
|
|
12
|
+
private static validate;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const inputStylesKey = "sketch-input";
|
|
2
|
+
export declare const outputStylesKey = "sketch-output";
|
|
3
|
+
export declare const sharedStyle = "\n.clepit-sketch {\n border: 1px solid rgba(127, 127, 127, 0.35);\n border-radius: 8px;\n overflow: hidden;\n}\n.clepit-sketch__canvas {\n display: block;\n width: 100%;\n height: 240px;\n touch-action: none;\n}\n.clepit-sketch--input .clepit-sketch__canvas {\n cursor: crosshair;\n}\n";
|
|
4
|
+
export declare const inputStyle = "\n.clepit-sketch {\n border: 1px solid rgba(127, 127, 127, 0.35);\n border-radius: 8px;\n overflow: hidden;\n}\n.clepit-sketch__canvas {\n display: block;\n width: 100%;\n height: 240px;\n touch-action: none;\n}\n.clepit-sketch--input .clepit-sketch__canvas {\n cursor: crosshair;\n}\n";
|
|
5
|
+
export declare const outputStyle = "\n.clepit-sketch {\n border: 1px solid rgba(127, 127, 127, 0.35);\n border-radius: 8px;\n overflow: hidden;\n}\n.clepit-sketch__canvas {\n display: block;\n width: 100%;\n height: 240px;\n touch-action: none;\n}\n.clepit-sketch--input .clepit-sketch__canvas {\n cursor: crosshair;\n}\n";
|
|
6
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SketchInput } from './input';
|
|
2
|
+
import { SketchOutput } from './output';
|
|
3
|
+
import { ToolType } from '../../../types';
|
|
4
|
+
export declare const SketchTool: {
|
|
5
|
+
icon: string;
|
|
6
|
+
readonly input: typeof SketchInput;
|
|
7
|
+
label: string;
|
|
8
|
+
readonly output: typeof SketchOutput;
|
|
9
|
+
shortcut: string;
|
|
10
|
+
testId: string;
|
|
11
|
+
type: ToolType;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputConfig, SketchData } from '../../../types';
|
|
2
|
+
export declare class SketchInput {
|
|
3
|
+
static placeholder: string;
|
|
4
|
+
private static eventListenersMap;
|
|
5
|
+
static save(element: HTMLElement): SketchData;
|
|
6
|
+
static render(containerId: string, data?: SketchData, config?: InputConfig<'sketch'>): HTMLElement;
|
|
7
|
+
/** Pointer events, not mouse: one code path covers pen, touch and mouse, and
|
|
8
|
+
* pointer capture keeps a stroke attached when the cursor leaves the canvas. */
|
|
9
|
+
private static attachDrawing;
|
|
10
|
+
static isEmpty(blockElement: HTMLElement): boolean;
|
|
11
|
+
static isEmptyData(data: SketchData): boolean;
|
|
12
|
+
static destroy(containerId: string): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Backing, ClepitElement } from '../../../core/element';
|
|
2
|
+
import { BlockClassNames, BlockStyles, OutputConfig, SketchData } from '../../../types';
|
|
3
|
+
/** The drawing surface's fixed logical height. Strokes are stored in these
|
|
4
|
+
* coordinates so a sketch drawn on a phone renders identically here. Must match
|
|
5
|
+
* `sketchCanvasHeight` in the Dart twin. */
|
|
6
|
+
export declare const SKETCH_CANVAS_HEIGHT = 240;
|
|
7
|
+
export declare class SketchOutput {
|
|
8
|
+
static render(data: SketchData, _config?: OutputConfig, styles?: BlockStyles['sketch'], classNames?: BlockClassNames['sketch']): HTMLElement;
|
|
9
|
+
/** The same drawing, against the element layer, so it runs with no browser.
|
|
10
|
+
* The SVG namespace is carried through `createNS` so the editor still gets a
|
|
11
|
+
* real SVG element rather than an unknown HTML tag that renders as nothing. */
|
|
12
|
+
static draw(data: SketchData, backing?: Backing): ClepitElement | null;
|
|
13
|
+
private static safeWidth;
|
|
14
|
+
private static validate;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const inputStylesKey = "clepit-table-input-styles";
|
|
2
|
+
export declare const inputStyle: string;
|
|
3
|
+
export declare const outputStylesKey = "clepit-table-output-styles";
|
|
4
|
+
export declare const outputStyle = "\n/* Output table styles */\n.clepit-output-table-container {\n margin: 1rem 0;\n overflow-x: auto;\n}\n\n.clepit-output-table {\n width: 100%;\n border-collapse: collapse;\n border: 1px solid var(--clepit-border);\n border-radius: 8px;\n overflow: hidden;\n background: var(--clepit-bg);\n box-shadow: 0 1px 2px rgba(0,0,0,0.04);\n}\n\n/* House style: rows carry no horizontal dividers and no column rules. Rows are\n * told apart by zebra striping, which is what does that job instead \u2014 removing\n * the rules is not a licence to remove the banding too. */\n/* These four rules were assigned from JavaScript, one element at a time, which\n * is a browser call inside a render path. In a stylesheet they cost nothing to\n * a page that draws without a browser, and a caller's own inline style still\n * wins over them exactly as it did before. */\n.clepit-output-table-wrapper {\n overflow: hidden;\n width: 100%;\n border-radius: 4px;\n margin-bottom: 1rem;\n}\n\n.clepit-output-table-scroller {\n overflow-x: auto;\n}\n\n.clepit-output-table {\n table-layout: auto;\n margin-top: 0;\n margin-bottom: 0;\n border-radius: 0;\n}\n\n.clepit-output-table th,\n.clepit-output-table td {\n padding: 10px 12px;\n text-align: left;\n min-width: 120px;\n max-width: 400px;\n}\n\n.clepit-output-table th {\n background: var(--clepit-surface);\n border-bottom: 1px solid var(--clepit-border);\n color: var(--clepit-text);\n font-weight: 600;\n}\n\n.clepit-output-table tbody tr:nth-child(odd) {\n background: var(--clepit-bg);\n}\n\n.clepit-output-table tbody tr:nth-child(even) {\n background: var(--clepit-surface);\n}\n\n/* No hover state: a rendered table is display, not a control. A row that\n * changes colour under the pointer reads as clickable when it is not. */\n\n/* Table Output Caption */\n.clepit-output-table-caption {\n margin-top: 0.5rem;\n font-size: 0.875rem;\n color: var(--clepit-text-muted);\n font-style: italic;\n text-align: center;\n}\n\n/* Make footer cell neutral so caption styles are visible */\n.clepit-output-table tfoot td,\n.clepit-output-table tfoot .clepit-output-table-caption-cell {\n padding: 0;\n border: 0;\n background: transparent;\n}\n\n.clepit-output-table-download-btn {\n margin-left: auto;\n width: 24px;\n height: 24px;\n border: none;\n outline: none;\n cursor: pointer;\n border-radius: 50%;\n background: transparent;\n transition: all 0.2s ease;\n padding: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n.clepit-output-table-download-btn:hover {\n background: var(--clepit-bg);\n}\n\n.clepit-output-table-download-btn:hover .clepit-download-icon {\n stroke: var(--clepit-primary);\n}\n\n.clepit-output-table-download-btn:active {\n transform: scale(0.95);\n}\n\n.clepit-download-icon {\n width: 20px;\n height: 20px;\n stroke: var(--clepit-text-muted);\n transition: stroke 0.2s ease;\n}\n\n.clepit-output-table-footer-container {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 12px;\n background: var(--clepit-surface);\n border: 1px solid var(--clepit-border);\n border-top: none;\n border-radius: 0 0 8px 8px;\n}\n";
|
|
5
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TableInput } from './input';
|
|
2
|
+
import { TableOutput } from './output';
|
|
3
|
+
import { ToolType } from '../../../types';
|
|
4
|
+
export declare const TableTool: {
|
|
5
|
+
icon: string;
|
|
6
|
+
readonly input: typeof TableInput;
|
|
7
|
+
label: string;
|
|
8
|
+
readonly output: typeof TableOutput;
|
|
9
|
+
shortcut: string;
|
|
10
|
+
testId: string;
|
|
11
|
+
type: ToolType;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { InputConfig, TableData } from '../../../types';
|
|
2
|
+
export declare class TableInput {
|
|
3
|
+
private static defaultCols;
|
|
4
|
+
private static defaultRows;
|
|
5
|
+
private static headerPlaceholder;
|
|
6
|
+
private static cellPlaceholder;
|
|
7
|
+
private static captionPlaceholder;
|
|
8
|
+
private static defaultData;
|
|
9
|
+
private static eventListenersMap;
|
|
10
|
+
private static addEventListener;
|
|
11
|
+
static save(element: HTMLElement): TableData;
|
|
12
|
+
static render(containerId: string, data?: TableData, config?: InputConfig<'table'>): HTMLElement;
|
|
13
|
+
private static createRow;
|
|
14
|
+
private static createCell;
|
|
15
|
+
private static createHeaderCell;
|
|
16
|
+
static handleAction(action: string, container: HTMLElement): void;
|
|
17
|
+
private static addRow;
|
|
18
|
+
private static removeRow;
|
|
19
|
+
private static addColumn;
|
|
20
|
+
private static removeColumn;
|
|
21
|
+
private static createMenu;
|
|
22
|
+
private static handleClick;
|
|
23
|
+
private static handleKeydown;
|
|
24
|
+
static isEmpty(blockElement: HTMLElement): boolean;
|
|
25
|
+
static isEmptyData(data: TableData): boolean;
|
|
26
|
+
static destroy(containerId: string): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Backing, ClepitElement } from '../../../core/element';
|
|
2
|
+
import { BlockClassNames, BlockStyles, OutputConfig, TableData } from '../../../types';
|
|
3
|
+
export declare class TableOutput {
|
|
4
|
+
private static eventListenersMap;
|
|
5
|
+
private static addEventListener;
|
|
6
|
+
static render(data: TableData, _config?: OutputConfig, styles?: BlockStyles['table'], classNames?: BlockClassNames['table'], containerId?: string): HTMLElement;
|
|
7
|
+
/**
|
|
8
|
+
* Everything the drawing deliberately left out.
|
|
9
|
+
*
|
|
10
|
+
* Turning a table into a CSV needs a Blob, an object URL and a synthetic
|
|
11
|
+
* click, none of which mean anything without a live page, so the download
|
|
12
|
+
* button is drawn as markup and wired only here.
|
|
13
|
+
*/
|
|
14
|
+
private static attach;
|
|
15
|
+
/**
|
|
16
|
+
* The block as markup, with no browser involved.
|
|
17
|
+
*
|
|
18
|
+
* The download button is drawn but not wired: turning a table into a CSV
|
|
19
|
+
* needs a Blob, an object URL and a click, none of which mean anything
|
|
20
|
+
* without a live page, so all of that stays in the attach step.
|
|
21
|
+
*/
|
|
22
|
+
static draw(data: TableData, backing?: Backing): ClepitElement | null;
|
|
23
|
+
private static drawDownloadIcon;
|
|
24
|
+
private static validate;
|
|
25
|
+
private static downloadTableAsCSV;
|
|
26
|
+
static destroy(containerId: string): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const inputStylesKey = "toc-input";
|
|
2
|
+
export declare const outputStylesKey = "toc-output";
|
|
3
|
+
export declare const sharedStyle = "\n.clepit-toc {\n display: block;\n}\n.clepit-toc__entry {\n display: block;\n padding: 2px 0;\n color: inherit;\n text-decoration: none;\n}\n.clepit-toc__entry:hover {\n text-decoration: underline;\n}\n.clepit-toc__empty {\n opacity: 0.55;\n}\n";
|
|
4
|
+
export declare const inputStyle = "\n.clepit-toc {\n display: block;\n}\n.clepit-toc__entry {\n display: block;\n padding: 2px 0;\n color: inherit;\n text-decoration: none;\n}\n.clepit-toc__entry:hover {\n text-decoration: underline;\n}\n.clepit-toc__empty {\n opacity: 0.55;\n}\n";
|
|
5
|
+
export declare const outputStyle = "\n.clepit-toc {\n display: block;\n}\n.clepit-toc__entry {\n display: block;\n padding: 2px 0;\n color: inherit;\n text-decoration: none;\n}\n.clepit-toc__entry:hover {\n text-decoration: underline;\n}\n.clepit-toc__empty {\n opacity: 0.55;\n}\n";
|
|
6
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TocInput } from './input';
|
|
2
|
+
import { TocOutput } from './output';
|
|
3
|
+
import { ToolType } from '../../../types';
|
|
4
|
+
export declare const TocTool: {
|
|
5
|
+
icon: string;
|
|
6
|
+
readonly input: typeof TocInput;
|
|
7
|
+
label: string;
|
|
8
|
+
readonly output: typeof TocOutput;
|
|
9
|
+
shortcut: string;
|
|
10
|
+
testId: string;
|
|
11
|
+
type: ToolType;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputConfig, TocData } from '../../../types';
|
|
2
|
+
export declare class TocInput {
|
|
3
|
+
static placeholder: string;
|
|
4
|
+
private static eventListenersMap;
|
|
5
|
+
static save(_element: HTMLElement): TocData;
|
|
6
|
+
static render(containerId: string, _data?: TocData, config?: InputConfig<'toc'>): HTMLElement;
|
|
7
|
+
static isEmpty(_blockElement: HTMLElement): boolean;
|
|
8
|
+
static isEmptyData(_data: TocData): boolean;
|
|
9
|
+
static destroy(containerId: string): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Backing, ClepitElement, DrawContext } from '../../../core/element';
|
|
2
|
+
import { Block, BlockClassNames, BlockStyles, OutputConfig, TocData } from '../../../types';
|
|
3
|
+
export declare class TocOutput {
|
|
4
|
+
/** The document's blocks, provided by the renderer before it renders a toc
|
|
5
|
+
* block — a toc derives from siblings, which no block-local data carries. */
|
|
6
|
+
static render(_data: TocData, config?: OutputConfig & {
|
|
7
|
+
documentBlocks?: Block[];
|
|
8
|
+
}, styles?: BlockStyles['toc'], classNames?: BlockClassNames['toc']): HTMLElement;
|
|
9
|
+
/**
|
|
10
|
+
* The same drawing, against the element layer, so it runs with no browser.
|
|
11
|
+
*
|
|
12
|
+
* Where `render` shows "headings appear here", this draws nothing. That
|
|
13
|
+
* placeholder tells an author the block is working; a published page has no
|
|
14
|
+
* author to reassure, and an empty frame there reads as a broken toc.
|
|
15
|
+
*/
|
|
16
|
+
static draw(data: TocData, backing?: Backing, context?: DrawContext): ClepitElement | null;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const inputStylesKey = "typeset-input";
|
|
2
|
+
export declare const outputStylesKey = "typeset-output";
|
|
3
|
+
export declare const sharedStyle = "\n.clepit-typeset {\n border: 1px solid rgba(127, 127, 127, 0.35);\n border-radius: 8px;\n padding: 12px;\n}\n.clepit-typeset__kind {\n display: block;\n opacity: 0.7;\n font-size: 0.85em;\n margin-bottom: 6px;\n}\n.clepit-typeset__kind:has(+ .clepit-typeset__title) {\n display: inline-block;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.06em;\n margin-bottom: 0;\n text-transform: uppercase;\n}\n.clepit-typeset__title {\n display: block;\n font-size: 1em;\n font-weight: 600;\n margin: 2px 0 8px;\n opacity: 1;\n}\n.clepit-typeset__title[data-placeholder]:empty::before {\n color: inherit;\n content: attr(data-placeholder);\n font-style: italic;\n font-weight: 400;\n opacity: 0.5;\n pointer-events: none;\n}\n.clepit-typeset__source {\n display: block;\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n}\n.clepit-typeset--input .clepit-typeset__source {\n outline: none;\n}\n.clepit-typeset__diagram {\n display: block;\n max-width: 100%;\n height: auto;\n}\n.clepit-typeset__node {\n fill: rgba(127, 127, 127, 0.08);\n stroke: currentColor;\n stroke-width: 1.5;\n}\n.clepit-typeset__label {\n fill: currentColor;\n font-size: 13px;\n font-family: inherit;\n}\n.clepit-typeset__edge,\n.clepit-typeset__message,\n.clepit-typeset__lifeline {\n stroke: currentColor;\n fill: none;\n}\n.clepit-typeset__lifeline {\n stroke-dasharray: 4 4;\n opacity: 0.55;\n}\n.clepit-typeset__arrowhead {\n fill: currentColor;\n}\n.clepit-typeset__edge-label {\n fill: currentColor;\n font-size: 12px;\n font-family: inherit;\n}\n.clepit-typeset__activation {\n fill: rgba(127, 127, 127, 0.3);\n stroke: currentColor;\n stroke-width: 1;\n}\n.clepit-typeset__note {\n fill: rgba(240, 200, 100, 0.18);\n stroke: currentColor;\n stroke-width: 1;\n}\n.clepit-typeset__formula {\n display: block;\n max-width: 100%;\n height: auto;\n}\n.clepit-typeset__glyph {\n fill: currentColor;\n font-family: ui-serif, Georgia, 'Times New Roman', serif;\n}\n.clepit-typeset__glyph--text {\n font-family: inherit;\n}\n.clepit-typeset__rule,\n.clepit-typeset__radical {\n fill: currentColor;\n}\n.clepit-typeset__radical {\n stroke: currentColor;\n stroke-width: 1.2;\n fill: none;\n}\n.clepit-typeset__fallback-reason {\n display: block;\n opacity: 0.7;\n font-size: 0.85em;\n margin-bottom: 6px;\n}\n";
|
|
4
|
+
export declare const inputStyle = "\n.clepit-typeset {\n border: 1px solid rgba(127, 127, 127, 0.35);\n border-radius: 8px;\n padding: 12px;\n}\n.clepit-typeset__kind {\n display: block;\n opacity: 0.7;\n font-size: 0.85em;\n margin-bottom: 6px;\n}\n.clepit-typeset__kind:has(+ .clepit-typeset__title) {\n display: inline-block;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.06em;\n margin-bottom: 0;\n text-transform: uppercase;\n}\n.clepit-typeset__title {\n display: block;\n font-size: 1em;\n font-weight: 600;\n margin: 2px 0 8px;\n opacity: 1;\n}\n.clepit-typeset__title[data-placeholder]:empty::before {\n color: inherit;\n content: attr(data-placeholder);\n font-style: italic;\n font-weight: 400;\n opacity: 0.5;\n pointer-events: none;\n}\n.clepit-typeset__source {\n display: block;\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n}\n.clepit-typeset--input .clepit-typeset__source {\n outline: none;\n}\n.clepit-typeset__diagram {\n display: block;\n max-width: 100%;\n height: auto;\n}\n.clepit-typeset__node {\n fill: rgba(127, 127, 127, 0.08);\n stroke: currentColor;\n stroke-width: 1.5;\n}\n.clepit-typeset__label {\n fill: currentColor;\n font-size: 13px;\n font-family: inherit;\n}\n.clepit-typeset__edge,\n.clepit-typeset__message,\n.clepit-typeset__lifeline {\n stroke: currentColor;\n fill: none;\n}\n.clepit-typeset__lifeline {\n stroke-dasharray: 4 4;\n opacity: 0.55;\n}\n.clepit-typeset__arrowhead {\n fill: currentColor;\n}\n.clepit-typeset__edge-label {\n fill: currentColor;\n font-size: 12px;\n font-family: inherit;\n}\n.clepit-typeset__activation {\n fill: rgba(127, 127, 127, 0.3);\n stroke: currentColor;\n stroke-width: 1;\n}\n.clepit-typeset__note {\n fill: rgba(240, 200, 100, 0.18);\n stroke: currentColor;\n stroke-width: 1;\n}\n.clepit-typeset__formula {\n display: block;\n max-width: 100%;\n height: auto;\n}\n.clepit-typeset__glyph {\n fill: currentColor;\n font-family: ui-serif, Georgia, 'Times New Roman', serif;\n}\n.clepit-typeset__glyph--text {\n font-family: inherit;\n}\n.clepit-typeset__rule,\n.clepit-typeset__radical {\n fill: currentColor;\n}\n.clepit-typeset__radical {\n stroke: currentColor;\n stroke-width: 1.2;\n fill: none;\n}\n.clepit-typeset__fallback-reason {\n display: block;\n opacity: 0.7;\n font-size: 0.85em;\n margin-bottom: 6px;\n}\n";
|
|
5
|
+
export declare const outputStyle = "\n.clepit-typeset {\n border: 1px solid rgba(127, 127, 127, 0.35);\n border-radius: 8px;\n padding: 12px;\n}\n.clepit-typeset__kind {\n display: block;\n opacity: 0.7;\n font-size: 0.85em;\n margin-bottom: 6px;\n}\n.clepit-typeset__kind:has(+ .clepit-typeset__title) {\n display: inline-block;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.06em;\n margin-bottom: 0;\n text-transform: uppercase;\n}\n.clepit-typeset__title {\n display: block;\n font-size: 1em;\n font-weight: 600;\n margin: 2px 0 8px;\n opacity: 1;\n}\n.clepit-typeset__title[data-placeholder]:empty::before {\n color: inherit;\n content: attr(data-placeholder);\n font-style: italic;\n font-weight: 400;\n opacity: 0.5;\n pointer-events: none;\n}\n.clepit-typeset__source {\n display: block;\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n}\n.clepit-typeset--input .clepit-typeset__source {\n outline: none;\n}\n.clepit-typeset__diagram {\n display: block;\n max-width: 100%;\n height: auto;\n}\n.clepit-typeset__node {\n fill: rgba(127, 127, 127, 0.08);\n stroke: currentColor;\n stroke-width: 1.5;\n}\n.clepit-typeset__label {\n fill: currentColor;\n font-size: 13px;\n font-family: inherit;\n}\n.clepit-typeset__edge,\n.clepit-typeset__message,\n.clepit-typeset__lifeline {\n stroke: currentColor;\n fill: none;\n}\n.clepit-typeset__lifeline {\n stroke-dasharray: 4 4;\n opacity: 0.55;\n}\n.clepit-typeset__arrowhead {\n fill: currentColor;\n}\n.clepit-typeset__edge-label {\n fill: currentColor;\n font-size: 12px;\n font-family: inherit;\n}\n.clepit-typeset__activation {\n fill: rgba(127, 127, 127, 0.3);\n stroke: currentColor;\n stroke-width: 1;\n}\n.clepit-typeset__note {\n fill: rgba(240, 200, 100, 0.18);\n stroke: currentColor;\n stroke-width: 1;\n}\n.clepit-typeset__formula {\n display: block;\n max-width: 100%;\n height: auto;\n}\n.clepit-typeset__glyph {\n fill: currentColor;\n font-family: ui-serif, Georgia, 'Times New Roman', serif;\n}\n.clepit-typeset__glyph--text {\n font-family: inherit;\n}\n.clepit-typeset__rule,\n.clepit-typeset__radical {\n fill: currentColor;\n}\n.clepit-typeset__radical {\n stroke: currentColor;\n stroke-width: 1.2;\n fill: none;\n}\n.clepit-typeset__fallback-reason {\n display: block;\n opacity: 0.7;\n font-size: 0.85em;\n margin-bottom: 6px;\n}\n";
|
|
6
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LatexInput, MermaidInput } from './input';
|
|
2
|
+
import { LatexOutput, MermaidOutput } from './output';
|
|
3
|
+
import { ToolType } from '../../../types';
|
|
4
|
+
export declare const LatexTool: {
|
|
5
|
+
icon: string;
|
|
6
|
+
readonly input: typeof LatexInput;
|
|
7
|
+
label: string;
|
|
8
|
+
readonly output: typeof LatexOutput;
|
|
9
|
+
shortcut: string;
|
|
10
|
+
testId: string;
|
|
11
|
+
type: ToolType;
|
|
12
|
+
};
|
|
13
|
+
export declare const MermaidTool: {
|
|
14
|
+
icon: string;
|
|
15
|
+
readonly input: typeof MermaidInput;
|
|
16
|
+
label: string;
|
|
17
|
+
readonly output: typeof MermaidOutput;
|
|
18
|
+
shortcut: string;
|
|
19
|
+
testId: string;
|
|
20
|
+
type: ToolType;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InputConfig, TypesetData } from '../../../types';
|
|
2
|
+
export declare class LatexInput {
|
|
3
|
+
static placeholder: string;
|
|
4
|
+
static save(element: HTMLElement): TypesetData;
|
|
5
|
+
static render(_containerId: string, data?: TypesetData, config?: InputConfig<'latex'>): HTMLElement;
|
|
6
|
+
static isEmpty(blockElement: HTMLElement): boolean;
|
|
7
|
+
static isEmptyData(data: TypesetData): boolean;
|
|
8
|
+
static destroy(_containerId: string): void;
|
|
9
|
+
}
|
|
10
|
+
export declare class MermaidInput {
|
|
11
|
+
static placeholder: string;
|
|
12
|
+
static save(element: HTMLElement): TypesetData;
|
|
13
|
+
static render(_containerId: string, data?: TypesetData, config?: InputConfig<'mermaid'>): HTMLElement;
|
|
14
|
+
static isEmpty(blockElement: HTMLElement): boolean;
|
|
15
|
+
static isEmptyData(data: TypesetData): boolean;
|
|
16
|
+
static destroy(_containerId: string): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AtomStyle, LatexNode } from './model';
|
|
2
|
+
export type LatexBox = {
|
|
3
|
+
/** Distance from the baseline to the box's bottom edge. */
|
|
4
|
+
depth: number;
|
|
5
|
+
draw: LatexDraw[];
|
|
6
|
+
/** Distance from the baseline to the box's top edge. */
|
|
7
|
+
height: number;
|
|
8
|
+
width: number;
|
|
9
|
+
};
|
|
10
|
+
export type LatexDraw = {
|
|
11
|
+
kind: 'glyph';
|
|
12
|
+
size: number;
|
|
13
|
+
style: AtomStyle;
|
|
14
|
+
text: string;
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'rule';
|
|
19
|
+
thickness: number;
|
|
20
|
+
width: number;
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'radical';
|
|
25
|
+
height: number;
|
|
26
|
+
size: number;
|
|
27
|
+
width: number;
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
};
|
|
31
|
+
export declare function layoutLatex(node: LatexNode, size?: number): LatexBox;
|
|
32
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** The parsed shape of a LaTeX math expression, independent of how it is drawn.
|
|
2
|
+
*
|
|
3
|
+
* The same split as the mermaid engine: parsing yields a tree, layout turns it
|
|
4
|
+
* into boxes, and only the final renderer differs per twin.
|
|
5
|
+
*
|
|
6
|
+
* The supported grammar is the closed list in the P7 design doc. Anything
|
|
7
|
+
* outside it produces `{ ok: false, reason }` rather than a partial tree —
|
|
8
|
+
* dropping an unrecognised subscript would silently change what the formula
|
|
9
|
+
* says, which is the failure P7-b exists to prevent. */
|
|
10
|
+
/** `upright` is the difference between the variable `sin` and the function
|
|
11
|
+
* \sin: TeX sets ordinary letters in italic and named operators upright, and
|
|
12
|
+
* getting that wrong makes a formula read as a product of three variables. */
|
|
13
|
+
export type AtomStyle = 'bold' | 'italic' | 'text' | 'upright';
|
|
14
|
+
export type LatexNode = {
|
|
15
|
+
kind: 'accent';
|
|
16
|
+
over: string;
|
|
17
|
+
base: LatexNode;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'atom';
|
|
20
|
+
style: AtomStyle;
|
|
21
|
+
text: string;
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'bigop';
|
|
24
|
+
lower: LatexNode | null;
|
|
25
|
+
symbol: string;
|
|
26
|
+
upper: LatexNode | null;
|
|
27
|
+
} | {
|
|
28
|
+
close: string;
|
|
29
|
+
kind: 'delimited';
|
|
30
|
+
open: string;
|
|
31
|
+
body: LatexNode;
|
|
32
|
+
} | {
|
|
33
|
+
denominator: LatexNode;
|
|
34
|
+
kind: 'fraction';
|
|
35
|
+
numerator: LatexNode;
|
|
36
|
+
} | {
|
|
37
|
+
index: LatexNode | null;
|
|
38
|
+
kind: 'radical';
|
|
39
|
+
radicand: LatexNode;
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'matrix';
|
|
42
|
+
rows: LatexNode[][];
|
|
43
|
+
style: MatrixStyle;
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'row';
|
|
46
|
+
items: LatexNode[];
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'space';
|
|
49
|
+
width: number;
|
|
50
|
+
} | {
|
|
51
|
+
base: LatexNode;
|
|
52
|
+
kind: 'script';
|
|
53
|
+
sub: LatexNode | null;
|
|
54
|
+
sup: LatexNode | null;
|
|
55
|
+
};
|
|
56
|
+
export type MatrixStyle = 'bracket' | 'double-pipe' | 'paren' | 'pipe' | 'plain';
|
|
57
|
+
export type LatexParseResult = {
|
|
58
|
+
ok: true;
|
|
59
|
+
root: LatexNode;
|
|
60
|
+
} | {
|
|
61
|
+
ok: false;
|
|
62
|
+
reason: string;
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Backing, ClepitElement } from '../../../../core/element';
|
|
2
|
+
import { LatexBox } from './layout';
|
|
3
|
+
/** One emission path, two destinations. The backing decides whether the formula
|
|
4
|
+
* lands in a live document or in a string, so a server-rendered page and the
|
|
5
|
+
* editor cannot drift into drawing different mathematics. */
|
|
6
|
+
export declare function renderLatex(box: LatexBox, backing?: Backing): ClepitElement;
|
|
7
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MatrixStyle } from './model';
|
|
2
|
+
/** The closed symbol tables for the supported LaTeX subset.
|
|
3
|
+
*
|
|
4
|
+
* A command absent from every table here is unsupported, and unsupported means
|
|
5
|
+
* the whole block falls back to its source. That is why these are exhaustive
|
|
6
|
+
* lists rather than pattern matches: a regex that accepted `\anything` would
|
|
7
|
+
* render an unknown command as empty space, which changes the formula.
|
|
8
|
+
*
|
|
9
|
+
* Kept identical to `utils/latex/symbols.dart` in the Dart twin. */
|
|
10
|
+
export declare const GREEK: Record<string, string>;
|
|
11
|
+
export declare const OPERATORS: Record<string, string>;
|
|
12
|
+
/** Big operators take limits above and below in display style, which is why
|
|
13
|
+
* they are a separate node kind rather than ordinary atoms. */
|
|
14
|
+
export declare const BIG_OPERATORS: Record<string, string>;
|
|
15
|
+
/** Set upright, because `\sin x` is a function applied to x, not s·i·n·x. */
|
|
16
|
+
export declare const NAMED_FUNCTIONS: string[];
|
|
17
|
+
export declare const ACCENTS: Record<string, string>;
|
|
18
|
+
export declare const SPACING: Record<string, number>;
|
|
19
|
+
export declare const DELIMITERS: Record<string, string>;
|
|
20
|
+
/** Refused outright rather than merely unsupported. The first group is macro
|
|
21
|
+
* definition, which turns a formula into a program and hands an author a way to
|
|
22
|
+
* make the parser diverge; the second is a link surface, and P7-b already pins
|
|
23
|
+
* that a `javascript:` URL in typeset source must stay inert literal text. */
|
|
24
|
+
export declare const REFUSED: string[];
|
|
25
|
+
export declare const MATRIX_ENVIRONMENTS: Record<string, MatrixStyle>;
|
|
26
|
+
//# sourceMappingURL=symbols.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { FlowchartModel, MermaidModel, SequenceMessageEnd } from './model';
|
|
2
|
+
export type LaidOutNode = {
|
|
3
|
+
height: number;
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
shape: FlowchartModel['nodes'][number]['shape'];
|
|
7
|
+
width: number;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
export type LaidOutEdge = {
|
|
12
|
+
arrow: boolean;
|
|
13
|
+
label: string | null;
|
|
14
|
+
labelX: number;
|
|
15
|
+
labelY: number;
|
|
16
|
+
line: FlowchartModel['edges'][number]['line'];
|
|
17
|
+
points: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
22
|
+
export type FlowchartLayout = {
|
|
23
|
+
edges: LaidOutEdge[];
|
|
24
|
+
height: number;
|
|
25
|
+
kind: 'flowchart';
|
|
26
|
+
nodes: LaidOutNode[];
|
|
27
|
+
width: number;
|
|
28
|
+
};
|
|
29
|
+
export type LaidOutLifeline = {
|
|
30
|
+
actor: boolean;
|
|
31
|
+
centerX: number;
|
|
32
|
+
headHeight: number;
|
|
33
|
+
headWidth: number;
|
|
34
|
+
id: string;
|
|
35
|
+
label: string;
|
|
36
|
+
};
|
|
37
|
+
export type LaidOutActivation = {
|
|
38
|
+
height: number;
|
|
39
|
+
width: number;
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
};
|
|
43
|
+
export type LaidOutMessage = {
|
|
44
|
+
end: SequenceMessageEnd;
|
|
45
|
+
fromX: number;
|
|
46
|
+
line: 'dotted' | 'solid';
|
|
47
|
+
selfCall: boolean;
|
|
48
|
+
text: string;
|
|
49
|
+
toX: number;
|
|
50
|
+
y: number;
|
|
51
|
+
};
|
|
52
|
+
export type LaidOutNote = {
|
|
53
|
+
height: number;
|
|
54
|
+
text: string;
|
|
55
|
+
width: number;
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
};
|
|
59
|
+
export type SequenceLayout = {
|
|
60
|
+
activations: LaidOutActivation[];
|
|
61
|
+
height: number;
|
|
62
|
+
kind: 'sequence';
|
|
63
|
+
lifelineBottom: number;
|
|
64
|
+
lifelines: LaidOutLifeline[];
|
|
65
|
+
messages: LaidOutMessage[];
|
|
66
|
+
notes: LaidOutNote[];
|
|
67
|
+
width: number;
|
|
68
|
+
};
|
|
69
|
+
export type MermaidLayout = FlowchartLayout | SequenceLayout;
|
|
70
|
+
export declare function layoutMermaid(model: MermaidModel): MermaidLayout;
|
|
71
|
+
//# sourceMappingURL=layout.d.ts.map
|