@clepit/core 0.4.0 → 0.5.0-beta.350

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/types.d.ts CHANGED
@@ -30,6 +30,8 @@ import { HeaderInput } from './tools/block/header/input';
30
30
  import { HeaderOutput } from './tools/block/header/output';
31
31
  import { ImageInput } from './tools/block/image/input';
32
32
  import { ImageOutput } from './tools/block/image/output';
33
+ import { IssuesInput } from './tools/block/issues/input';
34
+ import { IssuesOutput } from './tools/block/issues/output';
33
35
  import { ListInput } from './tools/block/list/input';
34
36
  import { ListOutput } from './tools/block/list/output';
35
37
  import { OpenApiInput } from './tools/block/openapi/input';
@@ -55,8 +57,8 @@ export declare const DELIMITER_VARIANTS: readonly ["line", "stars"];
55
57
  export declare const LIST_TYPES: readonly ["ordered", "unordered"];
56
58
  export declare const ALIGNMENTS: readonly ["center", "left", "right"];
57
59
  export declare const HEADER_LEVELS: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
58
- export declare const INLINE_TOOLS: readonly ["bold", "inline-code", "italic", "link", "marker", "strikethrough", "tooltip", "underline"];
59
- export declare const BLOCK_TOOLS: readonly ["alert", "audio", "checklist", "code", "collapsible", "collection", "columns", "date", "delimiter", "doc_card", "embed", "file", "glance", "header", "image", "latex", "list", "mermaid", "openapi", "paragraph", "quote", "sketch", "table", "toc", "updates", "video"];
60
+ export declare const INLINE_TOOLS: readonly ["bold", "inline-code", "italic", "link", "marker", "status", "strikethrough", "tooltip", "underline"];
61
+ export declare const BLOCK_TOOLS: readonly ["alert", "audio", "checklist", "code", "collapsible", "collection", "columns", "date", "delimiter", "doc_card", "embed", "file", "glance", "header", "image", "issues", "latex", "list", "mermaid", "openapi", "paragraph", "quote", "sketch", "table", "toc", "updates", "video"];
60
62
  export type CodeLanguage = 'assembly' | 'bash' | 'clojure' | 'cobol' | 'cpp' | 'csharp' | 'css' | 'dart' | 'diff' | 'dockerfile' | 'erlang' | 'fortran' | 'go' | 'graphql' | 'groovy' | 'haskell' | 'html' | 'java' | 'javascript' | 'json' | 'jsx' | 'julia' | 'kotlin' | 'lua' | 'markdown' | 'nginx' | 'objectivec' | 'pascal' | 'perl' | 'php' | 'plaintext' | 'powershell' | 'protobuf' | 'python' | 'r' | 'ruby' | 'rust' | 'scala' | 'scheme' | 'shell' | 'sql' | 'swift' | 'toml' | 'tsx' | 'typescript' | 'vb' | 'verilog' | 'vhdl' | 'xml' | 'yaml';
61
63
  export type CodeTheme = 'auto' | 'dark' | 'default' | 'dracula' | 'github' | 'github-dark' | 'light' | 'monokai' | 'solarized' | 'solarized-dark' | 'tomorrow';
62
64
  export type AlertVariant = (typeof ALERT_VARIANTS)[number];
@@ -73,8 +75,8 @@ export type Tool = {
73
75
  shortcut: string;
74
76
  testId: string;
75
77
  type: ToolType;
76
- input: typeof AlertInput | typeof CollapsibleInput | typeof CollectionInput | typeof EmbedInput | typeof SketchInput | typeof LatexInput | typeof MermaidInput | typeof ColumnsInput | typeof DateInput | typeof DocCardInput | typeof FileInput | typeof TocInput | typeof UpdatesInput | typeof GlanceInput | typeof DelimiterInput | typeof ListInput | typeof OpenApiInput | typeof HeaderInput | typeof QuoteInput | typeof CodeInput | typeof TableInput | typeof ImageInput | typeof AudioInput | typeof VideoInput | typeof ParagraphInput | typeof ChecklistInput;
77
- output: typeof AlertOutput | typeof CollapsibleOutput | typeof CollectionOutput | typeof EmbedOutput | typeof SketchOutput | typeof LatexOutput | typeof MermaidOutput | typeof ColumnsOutput | typeof DateOutput | typeof DocCardOutput | typeof FileOutput | typeof TocOutput | typeof UpdatesOutput | typeof GlanceOutput | typeof DelimiterOutput | typeof ListOutput | typeof OpenApiOutput | typeof HeaderOutput | typeof QuoteOutput | typeof CodeOutput | typeof TableOutput | typeof ImageOutput | typeof AudioOutput | typeof VideoOutput | typeof ParagraphOutput | typeof ChecklistOutput;
78
+ input: typeof AlertInput | typeof CollapsibleInput | typeof CollectionInput | typeof EmbedInput | typeof SketchInput | typeof LatexInput | typeof MermaidInput | typeof ColumnsInput | typeof DateInput | typeof DocCardInput | typeof FileInput | typeof IssuesInput | typeof TocInput | typeof UpdatesInput | typeof GlanceInput | typeof DelimiterInput | typeof ListInput | typeof OpenApiInput | typeof HeaderInput | typeof QuoteInput | typeof CodeInput | typeof TableInput | typeof ImageInput | typeof AudioInput | typeof VideoInput | typeof ParagraphInput | typeof ChecklistInput;
79
+ output: typeof AlertOutput | typeof CollapsibleOutput | typeof CollectionOutput | typeof EmbedOutput | typeof SketchOutput | typeof LatexOutput | typeof MermaidOutput | typeof ColumnsOutput | typeof DateOutput | typeof DocCardOutput | typeof FileOutput | typeof IssuesOutput | typeof TocOutput | typeof UpdatesOutput | typeof GlanceOutput | typeof DelimiterOutput | typeof ListOutput | typeof OpenApiOutput | typeof HeaderOutput | typeof QuoteOutput | typeof CodeOutput | typeof TableOutput | typeof ImageOutput | typeof AudioOutput | typeof VideoOutput | typeof ParagraphOutput | typeof ChecklistOutput;
78
80
  };
79
81
  export type CSSValue = string | number | ((val: CSSProperties) => string | number) | undefined;
80
82
  export type CSSProperties = Prettify<{
@@ -186,6 +188,55 @@ export type DateData = {
186
188
  date: string;
187
189
  };
188
190
  export type TocData = Record<string, never>;
191
+ export type IssuesData = Record<string, never>;
192
+ /** The four trackers of the Link and track group, by wire key. */
193
+ export declare const ISSUE_TOOLS: readonly ["asana", "github_issues", "jira", "linear"];
194
+ export type IssueTool = (typeof ISSUE_TOOLS)[number];
195
+ /** The four states every tracker's own vocabulary folds into; the tool's own
196
+ * word rides beside it as `stateName`. */
197
+ export type IssueCategory = 'cancelled' | 'done' | 'started' | 'todo';
198
+ /** Why an issue could not be read, in the wire words the chip renders. */
199
+ export type IssueReason = 'connect_tool' | 'no_access' | 'provider_unreachable';
200
+ /** An issue as it stood when read. `key` is the tool's handle (`ENG-142`,
201
+ * `acme/app#88`) and empty for an Asana task; `stateName` is the tool's own
202
+ * word and empty where a tool has only a done flag. Every field but `url` and
203
+ * `tool` is empty or absent while `reason` stands. */
204
+ export type IssueSnapshot = {
205
+ assigneeAvatarUrl?: string;
206
+ assigneeName?: string;
207
+ category: IssueCategory;
208
+ color?: string;
209
+ key: string;
210
+ pull?: boolean;
211
+ reason?: IssueReason;
212
+ stateName: string;
213
+ title: string;
214
+ tool: string;
215
+ updatedAt: string;
216
+ url: string;
217
+ };
218
+ /** What the classifier makes of a URL: the tool and the handle it can read off
219
+ * the address, and for Jira the site the read goes to. */
220
+ export type IssueTarget = {
221
+ key: string;
222
+ site?: string;
223
+ tool: IssueTool;
224
+ };
225
+ /** The words the chip, the card and the Linked issues table draw. This
226
+ * package ships English fallbacks; a host passes translations through
227
+ * `EditorConfig.issueLabels`. */
228
+ export declare const ISSUE_LABELS: readonly ["categoryCancelled", "categoryDone", "categoryStarted", "categoryTodo", "columnAssignee", "columnIssue", "columnStatus", "columnTitle", "connectAction", "connectTool", "linkedIssuesEmpty", "noAccess", "openInTool", "providerUnreachable", "showAsCard", "unassigned", "updatedRelative"];
229
+ export type IssueLabel = (typeof ISSUE_LABELS)[number];
230
+ /** The two parts of a chip a member may switch off (pick 2C, 2026-09-06). */
231
+ export type IssueChipParts = {
232
+ assignee: boolean;
233
+ status: boolean;
234
+ };
235
+ /** Whether an issue link pasted on its own line becomes a card. Off by default. */
236
+ export type IssueCards = 'off' | 'on';
237
+ /** The fix beside an issue reason that only the host can perform: connecting
238
+ * the tool, which lands on the host's Integrations page. */
239
+ export type IssueAction = 'connect';
189
240
  export type CollectionData = {
190
241
  collectionId: string;
191
242
  };
@@ -194,7 +245,40 @@ export type UpdatesData = {
194
245
  };
195
246
  /** `link` is a first-class outcome, not a failure: most services publish no
196
247
  * supported public iframe. `invalid` is a URL we refuse to render at all. */
197
- export type EmbedProvider = 'airtable' | 'drawio' | 'figma' | 'googleMaps' | 'invalid' | 'link' | 'miro' | 'youtube';
248
+ export type EmbedProvider = 'airtable' | 'drawio' | 'figma' | 'githubGist' | 'googleDrive' | 'googleMaps' | 'invalid' | 'link' | 'loom' | 'miro' | 'youtube';
249
+ /** Why a card shows where live content could: the wire words the server and
250
+ * the switch produce, rendered as one line under the title. */
251
+ export type EmbedReason = 'connect_google' | 'no_access' | 'provider_unreachable' | 'switched_off';
252
+ /** A Drive file as the paster's own Google account saw it. */
253
+ export type EmbedFile = {
254
+ iconUrl: string;
255
+ mimeType: string;
256
+ name: string;
257
+ };
258
+ export type EmbedGistFile = {
259
+ content: string;
260
+ language: string | null;
261
+ name: string;
262
+ truncated: boolean;
263
+ };
264
+ /** A gist as pasted. The web frames GitHub's own script; every renderer
265
+ * without a browser draws these files as code. */
266
+ export type EmbedGist = {
267
+ files: EmbedGistFile[];
268
+ htmlUrl: string;
269
+ id: string;
270
+ owner: string;
271
+ };
272
+ /** What a paste of a supported link does: the member's preference, `live` by
273
+ * default (pick 2A, 2026-09-05). */
274
+ export type PasteEmbeds = 'card' | 'live' | 'offer';
275
+ /** The words the embed block draws. This package ships English fallbacks; a
276
+ * host passes translations through `EditorConfig.embedLabels`. */
277
+ export declare const EMBED_LABELS: readonly ["connectGoogle", "connectGoogleAction", "noAccess", "providerUnreachable", "tryAgain", "switchedOff", "offerShowLive", "viewOnGithub", "truncated"];
278
+ export type EmbedLabel = (typeof EMBED_LABELS)[number];
279
+ /** What the fix beside a reason asks the host to do. `retry` the core handles
280
+ * itself; `connectGoogle` only the host can, since it owns the routes. */
281
+ export type EmbedAction = 'connectGoogle' | 'retry';
198
282
  /** Points are a FLAT x,y list — a sketch is thousands of points and the flat
199
283
  * form roughly halves the stored JSON. */
200
284
  export type SketchStroke = {
@@ -218,15 +302,26 @@ export type EmbedData = {
218
302
  title?: string;
219
303
  description?: string;
220
304
  imageUrl?: string;
305
+ display?: 'card';
306
+ file?: EmbedFile;
307
+ gist?: EmbedGist;
308
+ reason?: EmbedReason;
309
+ issue?: IssueSnapshot;
221
310
  };
222
311
  export type EmbedResolution = {
223
312
  url: string;
224
313
  provider: EmbedProvider;
225
314
  embedUrl: string | null;
226
315
  aspect?: number;
316
+ gist?: {
317
+ id: string;
318
+ owner: string;
319
+ };
320
+ switchedOff?: boolean;
227
321
  };
228
322
  export type EmbedResolveOptions = {
229
323
  mapsEmbedKey?: string;
324
+ disabledProviders?: readonly string[];
230
325
  };
231
326
  export type DocCardData = {
232
327
  pageId: string;
@@ -294,6 +389,11 @@ export type Block<T = BlockToolType> = T extends 'alert' ? {
294
389
  type: T;
295
390
  data: TocData;
296
391
  tunes?: BlockTunes;
392
+ } : T extends 'issues' ? {
393
+ id?: string;
394
+ type: T;
395
+ data: IssuesData;
396
+ tunes?: BlockTunes;
297
397
  } : T extends 'glance' ? {
298
398
  id?: string;
299
399
  type: T;
@@ -804,6 +904,11 @@ export type OutputConfig = {
804
904
  content?: string;
805
905
  arrow?: string;
806
906
  };
907
+ disabledEmbedProviders?: readonly string[];
908
+ embedLabels?: Partial<Record<EmbedLabel, string>>;
909
+ issues?: Record<string, IssueSnapshot>;
910
+ issueChip?: IssueChipParts;
911
+ issueLabels?: Partial<Record<IssueLabel, string>>;
807
912
  };
808
913
  export interface OutputComponent {
809
914
  render: <T extends ToolType>(data: Block<T>['data'], config?: OutputConfig, styles?: BlockStyles[T], classNames?: BlockClassNames[T]) => HTMLElement;
@@ -893,10 +998,21 @@ export type EditorConfig = {
893
998
  inlineRewriteLabels?: Partial<Record<InlineRewriteAction, string>>;
894
999
  blockToolLabels?: Partial<Record<BlockToolType, string>>;
895
1000
  blockToolbarLabels?: Partial<Record<BlockToolbarLabel, string>>;
1001
+ resolveLink?: (url: string) => Promise<Partial<EmbedData>>;
1002
+ onEmbedAction?: (action: EmbedAction, blockId: string) => void;
1003
+ disabledEmbedProviders?: readonly string[];
1004
+ pasteEmbeds?: PasteEmbeds;
1005
+ embedLabels?: Partial<Record<EmbedLabel, string>>;
1006
+ resolveIssues?: (urls: string[]) => Promise<Record<string, IssueSnapshot>>;
1007
+ onIssueAction?: (action: IssueAction, tool: string) => void;
1008
+ issueCards?: IssueCards;
1009
+ issueChip?: IssueChipParts;
1010
+ issueLabels?: Partial<Record<IssueLabel, string>>;
1011
+ jiraSites?: readonly string[];
896
1012
  };
897
1013
  export declare const BLOCK_TOOLBAR_OPERATIONS: readonly ["convert", "moveUp", "moveDown", "delete"];
898
1014
  export type BlockToolbarOperation = (typeof BLOCK_TOOLBAR_OPERATIONS)[number];
899
- 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"];
1015
+ 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", "embedShowLive", "embedShowCard", "embedShowLink", "embedCopyLink", "embedShowChip"];
900
1016
  export type BlockMenuLabel = (typeof BLOCK_MENU_LABELS)[number];
901
1017
  export type BlockToolbarLabel = BlockToolbarOperation | BlockMenuLabel;
902
1018
  export declare const INLINE_REWRITE_ACTIONS: readonly ["improve", "shorten", "lengthen", "simplify", "fix_grammar"];
@@ -921,6 +1037,11 @@ export type RendererConfig = {
921
1037
  light?: ThemeTokens;
922
1038
  dark?: ThemeTokens;
923
1039
  };
1040
+ /** The freshest issue snapshots, by URL: chips, cards and tables redraw from these. */
1041
+ issues?: Record<string, IssueSnapshot>;
1042
+ /** The reader's two chip switches; both on when absent. */
1043
+ issueChip?: IssueChipParts;
1044
+ issueLabels?: Partial<Record<IssueLabel, string>>;
924
1045
  };
925
1046
  export interface EditorInstance {
926
1047
  currentView: EditorView;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Bomdisoft",
3
3
  "dependencies": {},
4
- "description": "A block-style editor with built-in plugins and renderer",
4
+ "description": "Clepit: a block-style editor with clean JSON output and a renderer that works with or without a browser. Framework-agnostic core.",
5
5
  "devDependencies": {
6
6
  "@bomdisoft/store": "0.0.0",
7
7
  "@bomdisoft/typescript-config": "0.0.0",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "files": ["dist", "!dist/**/*.map", "CHANGELOG.md", "LICENSE", "README.md"],
28
28
  "homepage": "https://clepit.com",
29
- "keywords": ["editor", "block-editor", "wysiwyg", "typescript", "react", "vue", "vanilla", "json", "framework-agnostic"],
29
+ "keywords": ["clepit", "editor", "block-editor", "block-style editor", "rich-text", "wysiwyg", "renderer", "ssr", "typescript", "json", "framework-agnostic", "editorjs"],
30
30
  "license": "MIT",
31
31
  "main": "dist/index.js",
32
32
  "module": "dist/index.mjs",
@@ -53,5 +53,5 @@
53
53
  },
54
54
  "sideEffects": false,
55
55
  "types": "dist/index.d.ts",
56
- "version": "0.4.0"
56
+ "version": "0.5.0-beta.350"
57
57
  }