@clepit/core 0.2.0 → 0.3.0-beta.324

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.
@@ -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
  *
@@ -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.2.0"
49
+ "version": "0.3.0-beta.324"
66
50
  }