@clepit/core 0.7.0-beta.474 → 0.7.0-beta.481

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,10 @@ import { DialogLabel, EditorClassNames, EditorStyles } from '../../../types';
2
2
  export interface LinkDialogOptions {
3
3
  text: string;
4
4
  url: string;
5
+ isLinked: boolean;
6
+ anchor?: DOMRect;
5
7
  onConfirm: (text: string, url: string) => void;
8
+ onRemove: () => void;
6
9
  onCancel: () => void;
7
10
  styles?: EditorStyles['dialogs'];
8
11
  classNames?: EditorClassNames['dialogs'];
@@ -10,22 +13,18 @@ export interface LinkDialogOptions {
10
13
  }
11
14
  export declare class LinkDialog {
12
15
  private static isOpen;
13
- private overlay;
14
- private dialog;
15
- private textInput;
16
+ private card;
16
17
  private urlInput;
17
18
  private options;
18
19
  constructor(options: LinkDialogOptions);
19
20
  show(): void;
20
21
  hide(): void;
21
22
  private word;
22
- private createDialog;
23
- private createInputGroup;
24
- private createButtonGroup;
25
- private bindEvents;
26
- private handleKeyDown;
23
+ private createCard;
24
+ private applyUrl;
25
+ private dismiss;
27
26
  private handleInputKeyDown;
28
- private focusFirstInput;
27
+ private handleToggle;
29
28
  private applyStyles;
30
29
  private applyClassNames;
31
30
  destroy(): void;
@@ -4,6 +4,7 @@ export declare class LinkInput {
4
4
  static icon: string;
5
5
  static shortcut: string;
6
6
  static apply(range: Range, classNames: EditorClassNames['dialogs'], styles: EditorStyles['dialogs'], labels?: Partial<Record<DialogLabel, string>>): void;
7
+ private static announce;
7
8
  static remove(range: Range): void;
8
9
  private static findLinkElement;
9
10
  static isActive(range: Range): boolean;
@@ -12,6 +12,7 @@ export type StatusDialogOptions = {
12
12
  };
13
13
  export declare class StatusDialog {
14
14
  private static isOpen;
15
+ private static count;
15
16
  private overlay;
16
17
  private dialog;
17
18
  private textInput;
@@ -31,6 +31,7 @@ export type TooltipDialogOptions = {
31
31
  };
32
32
  };
33
33
  export declare class TooltipDialog {
34
+ private static count;
34
35
  private overlay;
35
36
  private dialog;
36
37
  private inputText;
package/dist/types.d.ts CHANGED
@@ -1034,9 +1034,9 @@ export declare const BLOCK_TOOLBAR_OPERATIONS: readonly ["convert", "moveUp", "m
1034
1034
  export type BlockToolbarOperation = (typeof BLOCK_TOOLBAR_OPERATIONS)[number];
1035
1035
  export declare const BLOCK_MENU_LABELS: readonly ["addBlock", "blockActions", "searchBlocks", "searchOperations", "searchConvertOptions", "searchLanguages", "searchThemes", "sectionBasic", "sectionMedia", "noBlockTypesFound", "noOperationsFound", "noConvertOptionsFound", "deleteLastBlock", "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", "tableInsertAbove", "tableInsertBelow", "tableInsertLeft", "tableInsertRight", "tableMoveLeft", "tableMoveRight", "tableRowActions", "tableColumnActions", "diagramTitleHint", "formulaTitleHint", "imageDropTitle", "imageDropAction", "imageDropFormats", "imageUploading", "imageUploadFailed", "imageInvalidType"];
1036
1036
  export type BlockMenuLabel = (typeof BLOCK_MENU_LABELS)[number];
1037
- export declare const CONTROL_LABELS: readonly ["editView", "previewView", "jsonView", "copyJson", "downloadJson", "clearEditor"];
1037
+ export declare const CONTROL_LABELS: readonly ["editView", "previewView", "jsonView", "copyJson", "downloadJson", "clearEditor", "viewSwitcher"];
1038
1038
  export type ControlLabel = (typeof CONTROL_LABELS)[number];
1039
- export declare const DIALOG_LABELS: readonly ["insertLink", "insertTooltip", "inlineStatus", "textField", "urlField", "tooltipField", "statusLabelField", "statusVariantField", "urlPlaceholder", "linkTextPlaceholder", "textPlaceholder", "tooltipPlaceholder", "statusLabelPlaceholder", "cancel", "apply", "statusInfo", "statusSuccess", "statusWarning", "statusError", "statusPlain"];
1039
+ export declare const DIALOG_LABELS: readonly ["insertLink", "insertTooltip", "inlineStatus", "textField", "urlField", "tooltipField", "statusLabelField", "statusVariantField", "urlPlaceholder", "textPlaceholder", "tooltipPlaceholder", "statusLabelPlaceholder", "cancel", "apply", "removeLink", "statusInfo", "statusSuccess", "statusWarning", "statusError", "statusPlain"];
1040
1040
  export type DialogLabel = (typeof DIALOG_LABELS)[number];
1041
1041
  export type BlockToolbarLabel = BlockToolbarOperation | BlockMenuLabel;
1042
1042
  export declare const INLINE_TOOLBAR_LABELS: readonly ["formatText", "textType", "text", "more", "bold", "italic", "underline", "strikethrough", "inlineCode", "link", "highlight", "status", "tooltip"];
@@ -1,3 +1,3 @@
1
1
  export declare const stylesKey = "clepit-dialogs-styles";
2
- export declare const style = "\n/* Dialog Overlay */\n/* A native <dialog>. showModal() puts it in the top layer and paints a real\n * ::backdrop, so the full-screen scrim, the z-index and the manual centring are\n * the browser's job now. The non-modal branch below keeps the old flex overlay\n * for a DOM without showModal, where the element is an ordinary block. */\n.clepit-dialog-overlay {\n border: none;\n padding: 0;\n background: transparent;\n max-width: none;\n max-height: none;\n}\n\n.clepit-dialog-overlay[open] {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.clepit-dialog-overlay::backdrop {\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(2px);\n}\n\n/* Fallback: no showModal, so the element is not in the top layer and paints no\n * backdrop of its own. */\n.clepit-dialog-overlay:not([open]) {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n align-items: center;\n justify-content: center;\n z-index: 10000;\n backdrop-filter: blur(2px);\n}\n\n/* Dialog Container */\n.clepit-dialog {\n background: var(--clepit-bg);\n border-radius: 8px;\n box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);\n padding: 24px;\n min-width: 400px;\n max-width: 500px;\n max-height: 80vh;\n overflow-y: auto;\n position: relative;\n transform: scale(0.95);\n opacity: 0;\n transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.clepit-dialog--hidden {\n transform: scale(0.95);\n opacity: 0;\n}\n\n.clepit-dialog:not(.clepit-dialog--hidden) {\n transform: scale(1);\n opacity: 1;\n}\n\n/* Dialog Title */\n.clepit-dialog-title {\n margin: 0 0 20px 0;\n font-size: 18px;\n font-weight: 600;\n color: var(--clepit-text);\n text-align: center;\n}\n\n/* Dialog Group */\n.clepit-dialog-group {\n margin-bottom: 16px;\n}\n\n/* Dialog Label */\n.clepit-dialog-label {\n display: block;\n margin-bottom: 6px;\n font-size: 14px;\n font-weight: 500;\n color: var(--clepit-text);\n}\n\n/* Dialog Input */\n.clepit-dialog-input {\n width: 100%;\n padding: 10px 12px;\n border: 1px solid var(--clepit-border);\n border-radius: 6px;\n font-size: 14px;\n color: var(--clepit-text);\n background: var(--clepit-bg);\n transition: border-color 0.2s ease, box-shadow 0.2s ease;\n box-sizing: border-box;\n}\n\n.clepit-dialog-input:focus {\n outline: none;\n border-color: var(--clepit-primary);\n box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);\n}\n\n.clepit-dialog-input::placeholder {\n color: var(--clepit-text-subtle);\n}\n\n/* Dialog Buttons */\n.clepit-dialog-buttons {\n display: flex;\n gap: 12px;\n justify-content: flex-end;\n margin-top: 24px;\n}\n\n/* Dialog Button */\n.clepit-dialog-button {\n padding: 10px 20px;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n min-width: 80px;\n}\n\n.clepit-dialog-button--cancel {\n background: var(--clepit-surface);\n color: var(--clepit-text);\n border: 1px solid var(--clepit-border);\n}\n\n.clepit-dialog-button--cancel:hover {\n background: var(--clepit-border);\n border-color: var(--clepit-text-subtle);\n}\n\n.clepit-dialog-button--save {\n background: var(--clepit-primary);\n color: white;\n}\n\n.clepit-dialog-button--save:hover {\n background: var(--clepit-primary);\n}\n\n.clepit-dialog-button--save:disabled {\n background: var(--clepit-text-subtle);\n cursor: not-allowed;\n}\n\n/* Responsive */\n@media (max-width: 640px) {\n .clepit-dialog {\n min-width: 320px;\n max-width: 90vw;\n margin: 20px;\n }\n\n .clepit-dialog-buttons {\n flex-direction: column;\n }\n\n .clepit-dialog-button {\n width: 100%;\n }\n}\n";
2
+ export declare const style = "\n.clepit-dialog-overlay {\n border: none;\n padding: 0;\n background: transparent;\n max-width: none;\n max-height: none;\n}\n\n.clepit-dialog-overlay[open] {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.clepit-dialog-overlay::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n.clepit-dialog-overlay:not([open]) {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n align-items: center;\n justify-content: center;\n z-index: 10000;\n}\n\n.clepit-dialog {\n position: relative;\n box-sizing: border-box;\n width: min(440px, calc(100vw - 32px));\n max-height: 80vh;\n overflow-y: auto;\n padding: 24px;\n border: 1px solid var(--clepit-border);\n border-radius: var(--clepit-radius-lg);\n background: var(--clepit-menu-bg);\n box-shadow: var(--clepit-menu-shadow);\n color: var(--clepit-text);\n font-family: inherit;\n transform: scale(0.98);\n opacity: 0;\n transition: transform 0.15s ease-out, opacity 0.15s ease-out;\n}\n\n.clepit-dialog:not(.clepit-dialog--hidden) {\n transform: scale(1);\n opacity: 1;\n}\n\n.clepit-dialog--hidden {\n transform: scale(0.98);\n opacity: 0;\n}\n\n.clepit-dialog-title {\n margin: 0 0 16px;\n font-size: 17px;\n font-weight: 600;\n line-height: 1.4;\n color: var(--clepit-text);\n}\n\n.clepit-dialog-group {\n margin-bottom: 16px;\n}\n\n.clepit-dialog-label {\n display: block;\n margin-bottom: 6px;\n font-size: 13px;\n font-weight: 500;\n color: var(--clepit-text);\n}\n\n.clepit-dialog-input {\n display: block;\n width: 100%;\n height: 36px;\n margin-bottom: 16px;\n padding: 0 10px;\n border: 1px solid var(--clepit-border);\n border-radius: var(--clepit-radius-md);\n background: var(--clepit-bg);\n color: var(--clepit-text);\n font: inherit;\n font-size: 14px;\n box-sizing: border-box;\n}\n\n.clepit-dialog-group .clepit-dialog-input {\n margin-bottom: 0;\n}\n\n.clepit-dialog-input:focus-visible {\n outline: 2px solid var(--clepit-focus-ring);\n outline-offset: -1px;\n border-color: transparent;\n}\n\n.clepit-dialog-input::placeholder {\n color: var(--clepit-text-subtle);\n}\n\n.clepit-dialog-buttons {\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n margin-top: 24px;\n}\n\n.clepit-dialog-button {\n height: 30px;\n padding: 0 14px;\n border: 0;\n border-radius: var(--clepit-radius-md);\n font: inherit;\n font-size: 13.5px;\n font-weight: 500;\n white-space: nowrap;\n cursor: pointer;\n transition: background-color 0.15s ease;\n}\n\n.clepit-dialog-button:focus-visible {\n outline: 2px solid var(--clepit-focus-ring);\n outline-offset: 1px;\n}\n\n.clepit-dialog-button--cancel {\n background: transparent;\n color: var(--clepit-text-muted);\n}\n\n.clepit-dialog-button--cancel:hover {\n background: var(--clepit-hover-bg);\n color: var(--clepit-text);\n}\n\n.clepit-dialog-button--save {\n background: var(--clepit-primary);\n color: var(--clepit-on-primary);\n}\n\n.clepit-dialog-button--save:hover {\n background: var(--clepit-primary-hover);\n}\n\n.clepit-dialog-button--save:disabled {\n background: var(--clepit-text-subtle);\n cursor: not-allowed;\n}\n\n@media (pointer: coarse) {\n .clepit-dialog-input,\n .clepit-dialog-button {\n height: 44px;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .clepit-dialog,\n .clepit-dialog-button {\n transition: none;\n }\n}\n";
3
3
  //# sourceMappingURL=css.d.ts.map
@@ -1,6 +1,3 @@
1
- export declare const EDIT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 20h9\"/><path d=\"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z\"/></svg>";
2
- export declare const PREVIEW_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></svg>";
3
- export declare const JSON_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"/><polyline points=\"14,2 14,8 20,8\"/><line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"/><line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"/><polyline points=\"10,9 9,9 8,9\"/></svg>";
4
1
  export declare const COPY_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"/><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"/></svg>";
5
2
  export declare const DOWNLOAD_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7,10 12,15 17,10\"/><line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"/></svg>";
6
3
  export declare const CLEAR_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M3 6h18\"/><path d=\"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6\"/><path d=\"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\"/><line x1=\"10\" y1=\"11\" x2=\"10\" y2=\"17\"/><line x1=\"14\" y1=\"11\" x2=\"14\" y2=\"17\"/></svg>";
package/package.json CHANGED
@@ -53,5 +53,5 @@
53
53
  },
54
54
  "sideEffects": false,
55
55
  "types": "dist/index.d.ts",
56
- "version": "0.7.0-beta.474"
56
+ "version": "0.7.0-beta.481"
57
57
  }