@clepit/core 0.2.0 → 0.3.0-beta.329
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 +13 -0
- package/README.md +1 -1
- package/dist/core/editor/index.d.ts +4 -0
- package/dist/core/element/index.d.ts +5 -0
- package/dist/core/managers/block/css.d.ts +1 -1
- package/dist/core/renderer/activate.d.ts +14 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/tools/block/code/output.d.ts +15 -1
- package/dist/tools/block/openapi/output.d.ts +6 -0
- package/dist/tools/block/table/output.d.ts +6 -1
- package/dist/types.d.ts +4 -1
- package/dist/utils/tooltip/index.d.ts +1 -1
- package/package.json +3 -19
|
@@ -2,7 +2,6 @@ import { Backing, ClepitElement, DrawContext } from '../../../core/element';
|
|
|
2
2
|
import { BlockClassNames, BlockStyles, CodeData, OutputConfig } from '../../../types';
|
|
3
3
|
export declare class CodeOutput {
|
|
4
4
|
private static eventListenersMap;
|
|
5
|
-
private static addEventListener;
|
|
6
5
|
/**
|
|
7
6
|
* The block as markup, with no browser involved.
|
|
8
7
|
*
|
|
@@ -16,6 +15,21 @@ export declare class CodeOutput {
|
|
|
16
15
|
*/
|
|
17
16
|
static draw(data: CodeData, backing?: Backing, context?: DrawContext): ClepitElement | null;
|
|
18
17
|
static render(data: CodeData, _config?: OutputConfig, styles?: BlockStyles['code'], classNames?: BlockClassNames['code'], containerId?: string): HTMLElement;
|
|
18
|
+
/**
|
|
19
|
+
* Wire behavior into markup that `draw` produced earlier, typically on a
|
|
20
|
+
* server: stored language preference, tab switching, sync, the clipboard.
|
|
21
|
+
* Returns a disposer that removes every listener it added, so a React host
|
|
22
|
+
* can activate on mount and release on unmount.
|
|
23
|
+
*/
|
|
24
|
+
static activate(container: HTMLElement, data: CodeData): () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Like `activate`, but for embedded samples whose block data is not at
|
|
27
|
+
* hand — an openapi reference draws its snippets through `draw` and only
|
|
28
|
+
* the markup survives to the client. Everything wiring needs is read back
|
|
29
|
+
* out of it: pane text is the code, tab text is the label (which is exactly
|
|
30
|
+
* what sync and storage match on), and the sync key rides on the container.
|
|
31
|
+
*/
|
|
32
|
+
static activateFromMarkup(container: HTMLElement): () => void;
|
|
19
33
|
/**
|
|
20
34
|
* Everything the drawing above deliberately left out.
|
|
21
35
|
*
|
|
@@ -11,6 +11,12 @@ export declare class OpenApiOutput {
|
|
|
11
11
|
* the editor show the same document. */
|
|
12
12
|
static draw(data: OpenApiData, backing?: Backing): ClepitElement | null;
|
|
13
13
|
static render(data: OpenApiData, _config?: OutputConfig, styles?: BlockStyles['openapi'], classNames?: BlockClassNames['openapi']): HTMLElement;
|
|
14
|
+
/**
|
|
15
|
+
* The response tabs and every embedded code sample become live on markup
|
|
16
|
+
* that `draw` produced earlier, typically on a server. Returns a disposer
|
|
17
|
+
* that removes every listener that was added.
|
|
18
|
+
*/
|
|
19
|
+
static activate(container: HTMLElement): () => void;
|
|
14
20
|
/**
|
|
15
21
|
* The response tabs become switchable.
|
|
16
22
|
*
|
|
@@ -2,8 +2,13 @@ import { Backing, ClepitElement } from '../../../core/element';
|
|
|
2
2
|
import { BlockClassNames, BlockStyles, OutputConfig, TableData } from '../../../types';
|
|
3
3
|
export declare class TableOutput {
|
|
4
4
|
private static eventListenersMap;
|
|
5
|
-
private static addEventListener;
|
|
6
5
|
static render(data: TableData, _config?: OutputConfig, styles?: BlockStyles['table'], classNames?: BlockClassNames['table'], containerId?: string): HTMLElement;
|
|
6
|
+
/**
|
|
7
|
+
* The download button becomes clickable on markup that `draw` produced
|
|
8
|
+
* earlier, typically on a server. Returns a disposer that removes every
|
|
9
|
+
* listener it added.
|
|
10
|
+
*/
|
|
11
|
+
static activate(wrapper: HTMLElement, data: TableData): () => void;
|
|
7
12
|
/**
|
|
8
13
|
* Everything the drawing deliberately left out.
|
|
9
14
|
*
|
package/dist/types.d.ts
CHANGED
|
@@ -873,10 +873,13 @@ export type EditorConfig = {
|
|
|
873
873
|
onInlineRewrite?: (selection: string, action: InlineRewriteAction) => Promise<string | null>;
|
|
874
874
|
inlineRewriteLabels?: Partial<Record<InlineRewriteAction, string>>;
|
|
875
875
|
blockToolLabels?: Partial<Record<BlockToolType, string>>;
|
|
876
|
-
blockToolbarLabels?: Partial<Record<
|
|
876
|
+
blockToolbarLabels?: Partial<Record<BlockToolbarLabel, string>>;
|
|
877
877
|
};
|
|
878
878
|
export declare const BLOCK_TOOLBAR_OPERATIONS: readonly ["convert", "moveUp", "moveDown", "delete"];
|
|
879
879
|
export type BlockToolbarOperation = (typeof BLOCK_TOOLBAR_OPERATIONS)[number];
|
|
880
|
+
export declare const BLOCK_MENU_LABELS: readonly ["searchBlocks", "searchOperations", "searchConvertOptions", "searchLanguages", "searchThemes", "noBlockTypesFound", "noOperationsFound", "noConvertOptionsFound", "alignLeft", "alignCenter", "alignRight", "codeLanguage", "codeTheme", "headingH1", "headingH2", "headingH3", "headingH4", "headingH5", "headingH6", "listUnordered", "listOrdered", "variantInfo", "variantWarning", "variantError", "variantSuccess", "variantPlain", "delimiterLine", "delimiterStars"];
|
|
881
|
+
export type BlockMenuLabel = (typeof BLOCK_MENU_LABELS)[number];
|
|
882
|
+
export type BlockToolbarLabel = BlockToolbarOperation | BlockMenuLabel;
|
|
880
883
|
export declare const INLINE_REWRITE_ACTIONS: readonly ["improve", "shorten", "lengthen", "simplify", "fix_grammar"];
|
|
881
884
|
export type InlineRewriteAction = (typeof INLINE_REWRITE_ACTIONS)[number];
|
|
882
885
|
export type RendererConfig = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { EditorClassNames, EditorStyles } from '../../types';
|
|
2
2
|
export type TooltipPosition = 'above' | 'below';
|
|
3
|
-
export declare function attachTooltip(target: HTMLElement, text: string, position?: TooltipPosition, classNames?: EditorClassNames['tooltips'], styles?: EditorStyles['tooltips']): void;
|
|
3
|
+
export declare function attachTooltip(target: HTMLElement, text: string, position?: TooltipPosition, classNames?: EditorClassNames['tooltips'], styles?: EditorStyles['tooltips']): () => void;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -18,25 +18,9 @@
|
|
|
18
18
|
"types": "./dist/index.d.ts"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
"files": [
|
|
22
|
-
"dist",
|
|
23
|
-
"!dist/**/*.map",
|
|
24
|
-
"CHANGELOG.md",
|
|
25
|
-
"LICENSE",
|
|
26
|
-
"README.md"
|
|
27
|
-
],
|
|
21
|
+
"files": ["dist", "!dist/**/*.map", "CHANGELOG.md", "LICENSE", "README.md"],
|
|
28
22
|
"homepage": "https://clepit.com",
|
|
29
|
-
"keywords": [
|
|
30
|
-
"editor",
|
|
31
|
-
"block-editor",
|
|
32
|
-
"wysiwyg",
|
|
33
|
-
"typescript",
|
|
34
|
-
"react",
|
|
35
|
-
"vue",
|
|
36
|
-
"vanilla",
|
|
37
|
-
"json",
|
|
38
|
-
"framework-agnostic"
|
|
39
|
-
],
|
|
23
|
+
"keywords": ["editor", "block-editor", "wysiwyg", "typescript", "react", "vue", "vanilla", "json", "framework-agnostic"],
|
|
40
24
|
"license": "MIT",
|
|
41
25
|
"main": "dist/index.js",
|
|
42
26
|
"module": "dist/index.mjs",
|
|
@@ -62,5 +46,5 @@
|
|
|
62
46
|
"typecheck": "tsc --noEmit -p tsconfig.typecheck.json"
|
|
63
47
|
},
|
|
64
48
|
"types": "dist/index.d.ts",
|
|
65
|
-
"version": "0.
|
|
49
|
+
"version": "0.3.0-beta.329"
|
|
66
50
|
}
|