@clepit/core 0.5.0-beta.389 → 0.5.0-beta.395

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 CHANGED
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
  ## [Unreleased]
9
9
 
10
10
  ### Added
11
+ - `EditorConfig.allowedBlockTools` and `allowedInlineTools`: an embedder names the block types the block menu, its search, the convert submenu and the URL paste path offer, and the marks the inline toolbar serves. Absent, everything registered is offered, and a stored block outside the list still renders.
11
12
  - `EditorConfig.inlineRewriteTooltip`: the localized tooltip for the inline toolbar's rewrite wand. Without it the wand keeps saying `rewrite`, which was the only string the toolbar rendered untranslated.
12
13
  - `INLINE_REWRITE_ACTIONS` and `InlineRewriteAction` are exported from the package root, so a host can label every rewrite action without reaching into `types`.
13
14
 
@@ -0,0 +1,26 @@
1
+ import { pasteEmbedTarget } from '../tools/block/embed/paste';
2
+ import { pasteIssueTarget } from '../tools/inline/issue/paste';
3
+ import { EditorConfig, Tool } from '../types';
4
+ type BlockAllowance = Pick<EditorConfig, 'allowedBlockTools'> | undefined;
5
+ type InlineAllowance = Pick<EditorConfig, 'allowedInlineTools'> | undefined;
6
+ export declare const isBlockToolAllowed: (config: BlockAllowance, type: string) => boolean;
7
+ export declare const allowedBlockTools: (config: BlockAllowance, tools: Tool[]) => Tool[];
8
+ export declare const isInlineToolAllowed: (config: InlineAllowance, label: string) => boolean;
9
+ export type PasteTarget = {
10
+ kind: 'embed';
11
+ embed: NonNullable<ReturnType<typeof pasteEmbedTarget>>;
12
+ } | {
13
+ kind: 'image';
14
+ url: string;
15
+ } | {
16
+ kind: 'issue';
17
+ issue: NonNullable<ReturnType<typeof pasteIssueTarget>>;
18
+ } | {
19
+ kind: 'video';
20
+ url: string;
21
+ isVimeo: boolean;
22
+ isYouTube: boolean;
23
+ };
24
+ export declare const pasteTarget: (config: Pick<EditorConfig, "allowedBlockTools" | "disabledEmbedProviders" | "jiraSites"> | undefined, pastedText: string) => PasteTarget | null;
25
+ export {};
26
+ //# sourceMappingURL=allowed.d.ts.map