@clepit/core 0.5.0 → 0.6.0-beta.397

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/core/allowed.d.ts +26 -0
  3. package/dist/core/editor/index.d.ts +11 -1
  4. package/dist/core/editor/issues.d.ts +19 -0
  5. package/dist/core/element/index.d.ts +13 -1
  6. package/dist/core/labels.d.ts +3 -0
  7. package/dist/core/managers/block/css.d.ts +1 -1
  8. package/dist/core/managers/block/index.d.ts +4 -0
  9. package/dist/core/managers/event.d.ts +5 -0
  10. package/dist/core/store.d.ts +1 -0
  11. package/dist/core/toolbars/block/index.d.ts +1 -0
  12. package/dist/index.d.ts +7 -2
  13. package/dist/index.js +1 -1
  14. package/dist/index.mjs +1 -1
  15. package/dist/tools/block/embed/css.d.ts +3 -3
  16. package/dist/tools/block/embed/input.d.ts +10 -1
  17. package/dist/tools/block/embed/issue-card.d.ts +17 -0
  18. package/dist/tools/block/embed/offer.d.ts +13 -0
  19. package/dist/tools/block/embed/output.d.ts +16 -2
  20. package/dist/tools/block/embed/paste.d.ts +16 -0
  21. package/dist/tools/block/embed/providers.d.ts +7 -2
  22. package/dist/tools/block/issues/css.d.ts +7 -0
  23. package/dist/tools/block/issues/index.d.ts +13 -0
  24. package/dist/tools/block/issues/input.d.ts +14 -0
  25. package/dist/tools/block/issues/output.d.ts +24 -0
  26. package/dist/tools/block/openapi/input.d.ts +1 -1
  27. package/dist/tools/block/typeset/input.d.ts +2 -2
  28. package/dist/tools/inline/issue/css.d.ts +10 -0
  29. package/dist/tools/inline/issue/index.d.ts +58 -0
  30. package/dist/tools/inline/issue/labels.d.ts +11 -0
  31. package/dist/tools/inline/issue/menu.d.ts +14 -0
  32. package/dist/tools/inline/issue/paste.d.ts +22 -0
  33. package/dist/tools/inline/issue/providers.d.ts +9 -0
  34. package/dist/types.d.ts +134 -5
  35. package/package.json +6 -6
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';
@@ -56,7 +58,7 @@ 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
60
  export declare const INLINE_TOOLS: readonly ["bold", "inline-code", "italic", "link", "marker", "status", "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"];
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;
@@ -877,6 +982,8 @@ export type EditorConfig = {
877
982
  initialData?: EditorData;
878
983
  initialView?: EditorView;
879
984
  allowJsonViewEditing?: boolean;
985
+ hasViewSwitcher?: boolean;
986
+ hasDocumentActions?: boolean;
880
987
  margins?: BlockMargins;
881
988
  styles?: EditorStyles;
882
989
  classNames?: EditorClassNames;
@@ -891,13 +998,30 @@ export type EditorConfig = {
891
998
  };
892
999
  onInlineRewrite?: (selection: string, action: InlineRewriteAction) => Promise<string | null>;
893
1000
  inlineRewriteLabels?: Partial<Record<InlineRewriteAction, string>>;
1001
+ inlineRewriteTooltip?: string;
894
1002
  blockToolLabels?: Partial<Record<BlockToolType, string>>;
895
1003
  blockToolbarLabels?: Partial<Record<BlockToolbarLabel, string>>;
1004
+ controlLabels?: Partial<Record<ControlLabel, string>>;
1005
+ resolveLink?: (url: string) => Promise<Partial<EmbedData>>;
1006
+ onEmbedAction?: (action: EmbedAction, blockId: string) => void;
1007
+ disabledEmbedProviders?: readonly string[];
1008
+ pasteEmbeds?: PasteEmbeds;
1009
+ embedLabels?: Partial<Record<EmbedLabel, string>>;
1010
+ resolveIssues?: (urls: string[]) => Promise<Record<string, IssueSnapshot>>;
1011
+ onIssueAction?: (action: IssueAction, tool: string) => void;
1012
+ issueCards?: IssueCards;
1013
+ issueChip?: IssueChipParts;
1014
+ issueLabels?: Partial<Record<IssueLabel, string>>;
1015
+ jiraSites?: readonly string[];
1016
+ allowedBlockTools?: readonly BlockToolType[];
1017
+ allowedInlineTools?: readonly InlineToolType[];
896
1018
  };
897
1019
  export declare const BLOCK_TOOLBAR_OPERATIONS: readonly ["convert", "moveUp", "moveDown", "delete"];
898
1020
  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"];
1021
+ 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", "alertTextHint", "checklistItemHint", "codeHint", "collapsibleTitleHint", "glanceLabelHint", "glanceValueHint", "headerHint", "listItemHint", "mediaCaptionHint", "openApiSourceHint", "quoteAuthorHint", "quoteBodyHint", "tableCaptionHint", "tableCellHint", "tableHeaderHint", "diagramTitleHint", "formulaTitleHint"];
900
1022
  export type BlockMenuLabel = (typeof BLOCK_MENU_LABELS)[number];
1023
+ export declare const CONTROL_LABELS: readonly ["editView", "previewView", "jsonView", "copyJson", "downloadJson", "clearEditor"];
1024
+ export type ControlLabel = (typeof CONTROL_LABELS)[number];
901
1025
  export type BlockToolbarLabel = BlockToolbarOperation | BlockMenuLabel;
902
1026
  export declare const INLINE_REWRITE_ACTIONS: readonly ["improve", "shorten", "lengthen", "simplify", "fix_grammar"];
903
1027
  export type InlineRewriteAction = (typeof INLINE_REWRITE_ACTIONS)[number];
@@ -921,6 +1045,11 @@ export type RendererConfig = {
921
1045
  light?: ThemeTokens;
922
1046
  dark?: ThemeTokens;
923
1047
  };
1048
+ /** The freshest issue snapshots, by URL: chips, cards and tables redraw from these. */
1049
+ issues?: Record<string, IssueSnapshot>;
1050
+ /** The reader's two chip switches; both on when absent. */
1051
+ issueChip?: IssueChipParts;
1052
+ issueLabels?: Partial<Record<IssueLabel, string>>;
924
1053
  };
925
1054
  export interface EditorInstance {
926
1055
  currentView: EditorView;
package/package.json CHANGED
@@ -5,12 +5,12 @@
5
5
  "devDependencies": {
6
6
  "@bomdisoft/store": "0.0.0",
7
7
  "@bomdisoft/typescript-config": "0.0.0",
8
- "@happy-dom/global-registrator": "^20.11.6",
9
- "@types/bun": "^1.4.0",
10
- "terser": "^5.50.0",
8
+ "@happy-dom/global-registrator": "^20.14.5",
9
+ "@types/bun": "^1.4.2",
10
+ "terser": "^5.51.2",
11
11
  "typescript": "^6.0.3",
12
- "vite": "^8.2.2",
13
- "vite-plugin-dts": "^5.0.3"
12
+ "vite": "^8.3.0",
13
+ "vite-plugin-dts": "^5.1.0"
14
14
  },
15
15
  "exports": {
16
16
  ".": {
@@ -53,5 +53,5 @@
53
53
  },
54
54
  "sideEffects": false,
55
55
  "types": "dist/index.d.ts",
56
- "version": "0.5.0"
56
+ "version": "0.6.0-beta.397"
57
57
  }