@estiva-app/ui 0.62.1 → 0.64.0
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/CodeBlockColours.d.ts +11 -0
- package/dist/CodeBlockColours.d.ts.map +1 -0
- package/dist/ComposerTriggers.d.ts +8 -2
- package/dist/ComposerTriggers.d.ts.map +1 -1
- package/dist/KindIcon.d.ts +30 -0
- package/dist/KindIcon.d.ts.map +1 -0
- package/dist/Link.d.ts +1 -1
- package/dist/PastedImages.d.ts +33 -0
- package/dist/PastedImages.d.ts.map +1 -0
- package/dist/RichText.d.ts +2 -1
- package/dist/RichText.d.ts.map +1 -1
- package/dist/codeColours.d.ts +29 -0
- package/dist/codeColours.d.ts.map +1 -0
- package/dist/editor.d.ts +2 -0
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +86 -13
- package/dist/editor.js.map +4 -4
- package/dist/eslint/index.js +1 -0
- package/dist/eslint/index.js.map +2 -2
- package/dist/eslint/no-restyled-part.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +291 -237
- package/dist/index.js.map +4 -4
- package/package.json +8 -2
- package/registry.json +179 -16
- package/src/CodeBlockColours.mdx +48 -0
- package/src/CodeBlockColours.stories.tsx +37 -0
- package/src/CodeBlockColours.ts +14 -0
- package/src/ComposerTriggers.mdx +6 -4
- package/src/ComposerTriggers.test.tsx +30 -0
- package/src/ComposerTriggers.tsx +9 -3
- package/src/KindIcon.mdx +58 -0
- package/src/KindIcon.stories.tsx +64 -0
- package/src/KindIcon.tsx +64 -0
- package/src/Link.mdx +1 -1
- package/src/Link.stories.tsx +1 -1
- package/src/Link.test.tsx +2 -2
- package/src/Link.tsx +2 -2
- package/src/PastedImages.mdx +61 -0
- package/src/PastedImages.stories.tsx +53 -0
- package/src/PastedImages.test.ts +83 -0
- package/src/PastedImages.ts +105 -0
- package/src/RichText.stories.tsx +24 -0
- package/src/RichText.tsx +31 -17
- package/src/codeColours.ts +33 -0
- package/src/editor.ts +2 -0
- package/src/eslint/no-restyled-part.ts +1 -0
- package/src/index.ts +1 -0
- package/src/pages.test.ts +5 -1
- package/src/registry/registry.test.ts +7 -7
- package/stories/Choosing.mdx +3 -0
- package/tailwind-preset.js +8 -0
- package/tokens.css +50 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A code block in the editor, with the colours RichText reads it in (Katerina,
|
|
3
|
+
* 9 October): the same highlight.js languages, the same classes, and the
|
|
4
|
+
* editor's root wears `richTextClassName`, which colours them.
|
|
5
|
+
*
|
|
6
|
+
* It replaces the starter kit's code block: `StarterKit.configure({ codeBlock: false })`,
|
|
7
|
+
* then add `CodeBlockColours`. The block keeps its name, `codeBlock`, and its
|
|
8
|
+
* `language` attribute, so nothing already written changes.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CodeBlockColours: import("@tiptap/core").Node<import("@tiptap/extension-code-block-lowlight").CodeBlockLowlightOptions, any>;
|
|
11
|
+
//# sourceMappingURL=CodeBlockColours.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockColours.d.ts","sourceRoot":"","sources":["../src/CodeBlockColours.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,4GAA4C,CAAA"}
|
|
@@ -116,15 +116,21 @@ export interface ReferenceMenuOptions {
|
|
|
116
116
|
ariaLabel: string;
|
|
117
117
|
/** The section's heading. */
|
|
118
118
|
sectionLabel: string;
|
|
119
|
-
/** At each row's start: a 16px icon — unless the row brings its own (`CaptionedItem.icon`). */
|
|
119
|
+
/** At each row's start: a 16px icon — unless the row brings its own (`CaptionedItem.icon`), or `iconFor` answers. */
|
|
120
120
|
icon: ReactNode;
|
|
121
|
+
/**
|
|
122
|
+
* A row's 16px icon from what it points at — its `uri` — when the list holds
|
|
123
|
+
* several kinds of thing; `undefined` from it draws `icon`. Give the chip the
|
|
124
|
+
* same answer at 14px (`CaptionedReference`'s `iconFor`), so a pick keeps it.
|
|
125
|
+
*/
|
|
126
|
+
iconFor?: (uri: string) => ReactNode | undefined;
|
|
121
127
|
}
|
|
122
128
|
/**
|
|
123
129
|
* The list `[` opens: `label: snippet` rows, the same box as the people list.
|
|
124
130
|
* One section headed `sectionLabel`, or — when the rows say which section they
|
|
125
131
|
* are in — a heading for each, in the order the rows arrive.
|
|
126
132
|
*/
|
|
127
|
-
export declare function referenceMenu({ ariaLabel, sectionLabel, icon }: ReferenceMenuOptions): SuggestionPopupOptions<CaptionedItem>;
|
|
133
|
+
export declare function referenceMenu({ ariaLabel, sectionLabel, icon, iconFor }: ReferenceMenuOptions): SuggestionPopupOptions<CaptionedItem>;
|
|
128
134
|
export interface ReferenceTriggerOptions extends ReferenceMenuOptions {
|
|
129
135
|
/** Everything `[` can offer, asked each time the query changes. Narrowed by {@link filterReferences}. */
|
|
130
136
|
items: () => readonly CaptionedItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposerTriggers.d.ts","sourceRoot":"","sources":["../src/ComposerTriggers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAA;AAErD,OAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAMxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAmB,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAiBhF,mCAAmC;AACnC,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,G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GAAE,UAAqB,GAAG,OAAO,CA8B9F;AAED,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,IAAI,GAAE,UAAqB,GAAG,YAAY,CAYvE;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAM9D;AAMD,4FAA4F;AAC5F,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE,CAGpG;AAED,MAAM,WAAW,oBAAoB;IACnC,+EAA+E;IAC/E,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAA;CAClC;AAID;;;;GAIG;AACH,eAAO,MAAM,aAAa,sCA6BxB,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a thing is, as the apps name it: a topic, a project, an issue, another
|
|
3
|
+
* app's file, or a message.
|
|
4
|
+
*
|
|
5
|
+
* The one part that names Estiva's own kinds of thing (Katerina, 8 October):
|
|
6
|
+
* every app draws the same icon for the same kind, so the table lives here once
|
|
7
|
+
* instead of in each app.
|
|
8
|
+
*/
|
|
9
|
+
export type ThingKind = 'topic' | 'project' | 'issue' | 'file' | 'message';
|
|
10
|
+
/**
|
|
11
|
+
* The kind of thing behind an event kind: a message is a message, a channel or
|
|
12
|
+
* a bare file is a topic, a project and an issue are themselves, and anything
|
|
13
|
+
* else is another app's file.
|
|
14
|
+
*/
|
|
15
|
+
export declare function thingKindOf(eventKind: number | undefined): ThingKind;
|
|
16
|
+
export interface KindIconProps {
|
|
17
|
+
kind: ThingKind;
|
|
18
|
+
/** 16 in a row or a list; 14 inside a chip. Default 16. */
|
|
19
|
+
size?: 14 | 16;
|
|
20
|
+
/**
|
|
21
|
+
* `secondary`: the quieter grey a list row's icon wears. `inherit`: the ink
|
|
22
|
+
* of what holds it — a chip, a selected row. Default `secondary`.
|
|
23
|
+
*/
|
|
24
|
+
tone?: 'secondary' | 'inherit';
|
|
25
|
+
/** Space and position only. */
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/** The icon before a thing's name that says what kind of thing it is. */
|
|
29
|
+
export declare function KindIcon({ kind, size, tone, className }: KindIconProps): import("react").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=KindIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KindIcon.d.ts","sourceRoot":"","sources":["../src/KindIcon.tsx"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;AAoB1E;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAMpE;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAA;IACf,2DAA2D;IAC3D,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,CAAA;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IAC9B,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAID,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,IAAkB,EAAE,SAAS,EAAE,EAAE,aAAa,+BAGzF"}
|
package/dist/Link.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
|
6
6
|
* on 13 September 2026, in three jobs (UIG-27). The looks are the ones those
|
|
7
7
|
* links already had, reduced by Katerina's ruling:
|
|
8
8
|
*
|
|
9
|
-
* - `text` — a link inside written text: the
|
|
9
|
+
* - `text` — a link inside written text: the theme's link colour, always underlined,
|
|
10
10
|
* dimming on hover. The look a link in a body of text already had.
|
|
11
11
|
* - `quiet` — a title or a timestamp that is also a link. It takes the colour
|
|
12
12
|
* and size of the text it sits in and underlines on hover. Two looks that
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
/** As much of a `DataTransfer` as the paste reads. */
|
|
3
|
+
export interface ClipboardSource {
|
|
4
|
+
files?: ArrayLike<File> | null;
|
|
5
|
+
getData(format: string): string;
|
|
6
|
+
}
|
|
7
|
+
/** `'Screenshot 2026-09-07 14-32-05.png'`: sortable, and readable on a file card. */
|
|
8
|
+
export declare function pastedImageName(contentType: string, at?: Date, index?: number): string;
|
|
9
|
+
/**
|
|
10
|
+
* The pictures on the clipboard, named — `[]` when there is nothing to attach.
|
|
11
|
+
*
|
|
12
|
+
* **Text wins.** A copy from a spreadsheet or a document puts a rendered
|
|
13
|
+
* picture of the selection beside the text; attaching the picture instead of
|
|
14
|
+
* pasting the text is wrong every time. So a clipboard holding text is left to
|
|
15
|
+
* the editor, and a screenshot, which holds none, lands here. Pictures only:
|
|
16
|
+
* any other file comes through the app's own file picker.
|
|
17
|
+
*/
|
|
18
|
+
export declare function pastedImages(source: ClipboardSource | null | undefined, at?: Date): File[];
|
|
19
|
+
export interface PastedImagesOptions {
|
|
20
|
+
/**
|
|
21
|
+
* The pictures a paste carried, named. Return `true` when the app took them
|
|
22
|
+
* (an upload started), `false` to let the editor paste as it would have —
|
|
23
|
+
* for a box that cannot upload right now.
|
|
24
|
+
*/
|
|
25
|
+
onImages: (files: File[]) => boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Pasting a picture attaches it: a screenshot pasted into the editor reaches
|
|
29
|
+
* the app as named files, the way the app's own file picker would hand them.
|
|
30
|
+
* Text on the clipboard wins (see {@link pastedImages}).
|
|
31
|
+
*/
|
|
32
|
+
export declare const PastedImages: Extension<PastedImagesOptions, any>;
|
|
33
|
+
//# sourceMappingURL=PastedImages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PastedImages.d.ts","sourceRoot":"","sources":["../src/PastedImages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAGxC,sDAAsD;AACtD,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC9B,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CAChC;AA0BD,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,GAAE,IAAiB,EAAE,KAAK,SAAI,GAAG,MAAM,CAO7F;AASD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EAAE,EAAE,GAAE,IAAiB,GAAG,IAAI,EAAE,CAUtG;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,OAAO,CAAA;CACrC;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,qCAmBvB,CAAA"}
|
package/dist/RichText.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ import type { ReactNode } from 'react';
|
|
|
8
8
|
* and the two had drifted: headings, list markers, quotes and code differed,
|
|
9
9
|
* one app had tables and the other dropped them, one had links and the other
|
|
10
10
|
* printed the brackets (UIG-30). The look here is Katerina's picks of
|
|
11
|
-
* 28 September, one per difference, most of them Peek's
|
|
11
|
+
* 28 September, one per difference, most of them Peek's, with the room and
|
|
12
|
+
* colours she changed on 9 October.
|
|
12
13
|
*
|
|
13
14
|
* **It takes the tree, not the text.** The caller parses (the format comes from
|
|
14
15
|
* the item's tag, never from the body) and hands the blocks in. So this package
|
package/dist/RichText.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../src/RichText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,O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;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,SAAS,GAAG,SAAS,CAAA;CAC9D;AAqCD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,YAAwB,EAAE,SAAS,CAAC,EAAE,MAAM,UAGnF;AA0KD,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,IAAgB,EAChB,UAA2B,EAC3B,eAA+C,EAC/C,WAAW,GACZ,EAAE,aAAa,sCAQf"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Colours inside a code block, by language (Katerina, 9 October).
|
|
4
|
+
*
|
|
5
|
+
* highlight.js reads the code and names each word (a keyword, a string, a
|
|
6
|
+
* comment); RichText's class list gives each name its colour from the theme's
|
|
7
|
+
* `syntax-*` tokens. The same instance colours the editor's code block
|
|
8
|
+
* (`CodeBlockColours`), so what is written looks the same as what is read.
|
|
9
|
+
*
|
|
10
|
+
* `common` is highlight.js's 37 everyday languages. A language outside them, or
|
|
11
|
+
* none, leaves the code in one colour.
|
|
12
|
+
*/
|
|
13
|
+
export declare const lowlight: {
|
|
14
|
+
highlight: (language: string, value: string, options?: Readonly<import("lowlight").Options> | null | undefined) => import("hast").Root;
|
|
15
|
+
highlightAuto: (value: string, options?: Readonly<import("lowlight").AutoOptions> | null | undefined) => import("hast").Root;
|
|
16
|
+
listLanguages: () => Array<string>;
|
|
17
|
+
register: {
|
|
18
|
+
(grammars: Readonly<Record<string, import("highlight.js").LanguageFn>>): undefined;
|
|
19
|
+
(name: string, grammar: import("highlight.js").LanguageFn): undefined;
|
|
20
|
+
};
|
|
21
|
+
registerAlias: {
|
|
22
|
+
(aliases: Readonly<Record<string, ReadonlyArray<string> | string>>): undefined;
|
|
23
|
+
(language: string, alias: ReadonlyArray<string> | string): undefined;
|
|
24
|
+
};
|
|
25
|
+
registered: (aliasOrName: string) => boolean;
|
|
26
|
+
};
|
|
27
|
+
/** The code, its words wrapped in highlight.js's classes; the text as it is when the language is unknown. */
|
|
28
|
+
export declare function codeColours(text: string, language?: string): ReactNode;
|
|
29
|
+
//# sourceMappingURL=codeColours.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeColours.d.ts","sourceRoot":"","sources":["../src/codeColours.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ;wDANb,CAAC;0CACmB,CAAC;;;;;;;;;;;CAKiB,CAAA;AAc9C,6GAA6G;AAC7G,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAGtE"}
|
package/dist/editor.d.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* `Toolbar`, `MenuItem`, `SuggestionMenu` — is the main entry's own, not a copy.
|
|
9
9
|
*/
|
|
10
10
|
export { KeptSelection, SelectionToolbar, normalizeHref, type MarkId, type SelectionToolbarProps } from './SelectionToolbar';
|
|
11
|
+
export { PastedImages, pastedImages, pastedImageName, type PastedImagesOptions, type ClipboardSource } from './PastedImages';
|
|
12
|
+
export { CodeBlockColours } from './CodeBlockColours';
|
|
11
13
|
export { suggestionPopup, isSuggestionActive, isSuggestionOpen, type SuggestionPopupOptions } from './suggestionPopup';
|
|
12
14
|
export { EditorBlockHandle, blockDropCursor, deleteBlock, moveBlock, duplicateBlock, startBlockDrag, type EditorBlockHandleProps, type BlockTurnInto } from './EditorBlockHandle';
|
|
13
15
|
export { PersonMention, UrgentPersonMention, CaptionedReference, ReferenceTrigger, SlashCommands, peopleMenu, referenceMenu, filterPeople, urgentPubkeys, filterReferences, formatSection, applyFormat, typeTrigger, filterSlashSections, FORMATS, type MentionPerson, type PersonMentionOptions, type CaptionedItem, type CaptionedReferenceOptions, type ReferenceTriggerOptions, type ReferenceMenuOptions, type SlashCommand, type SlashSection, type SlashCommandsOptions, type FormatId, type FormatDef, type CodeFormat, } from './ComposerTriggers';
|
package/dist/editor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,KAAK,MAAM,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC5H,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AACtH,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,sBAAsB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACjL,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,OAAO,EACP,YAAY,EACZ,aAAa,EACb,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"editor.d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ANGED
|
@@ -280,6 +280,75 @@ function SelectionToolbar({ editor, marks = ["bold", "italic", "underline"], lin
|
|
|
280
280
|
);
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
+
// src/PastedImages.ts
|
|
284
|
+
import { Extension as Extension2 } from "@tiptap/core";
|
|
285
|
+
import { Plugin as Plugin2, PluginKey as PluginKey2 } from "@tiptap/pm/state";
|
|
286
|
+
var IMAGE_EXTENSIONS = {
|
|
287
|
+
"image/png": "png",
|
|
288
|
+
"image/jpeg": "jpg",
|
|
289
|
+
"image/gif": "gif",
|
|
290
|
+
"image/webp": "webp",
|
|
291
|
+
"image/heic": "heic",
|
|
292
|
+
"image/heif": "heif",
|
|
293
|
+
"image/svg+xml": "svg"
|
|
294
|
+
};
|
|
295
|
+
var GENERIC_STEMS = /* @__PURE__ */ new Set(["image", "blob", "unknown", "untitled", "screenshot"]);
|
|
296
|
+
function extensionFor(contentType) {
|
|
297
|
+
const type = contentType.toLowerCase();
|
|
298
|
+
return IMAGE_EXTENSIONS[type] ?? type.split("/")[1]?.split("+")[0] ?? "png";
|
|
299
|
+
}
|
|
300
|
+
function pastedImageName(contentType, at = /* @__PURE__ */ new Date(), index = 0) {
|
|
301
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
302
|
+
const stamp = `${at.getFullYear()}-${pad(at.getMonth() + 1)}-${pad(at.getDate())} ${pad(at.getHours())}-${pad(at.getMinutes())}-${pad(at.getSeconds())}`;
|
|
303
|
+
const nth = index > 0 ? ` (${index + 1})` : "";
|
|
304
|
+
return `Screenshot ${stamp}${nth}.${extensionFor(contentType)}`;
|
|
305
|
+
}
|
|
306
|
+
function hasUsableName(name) {
|
|
307
|
+
const dot = name.lastIndexOf(".");
|
|
308
|
+
if (dot <= 0 || dot === name.length - 1) return false;
|
|
309
|
+
return !GENERIC_STEMS.has(name.slice(0, dot).toLowerCase());
|
|
310
|
+
}
|
|
311
|
+
function pastedImages(source, at = /* @__PURE__ */ new Date()) {
|
|
312
|
+
if (!source) return [];
|
|
313
|
+
if (source.getData("text/plain").trim() !== "") return [];
|
|
314
|
+
const images = Array.from(source.files ?? []).filter((f) => f.type.toLowerCase().startsWith("image/"));
|
|
315
|
+
let generated = 0;
|
|
316
|
+
return images.map(
|
|
317
|
+
(file) => hasUsableName(file.name) ? file : new File([file], pastedImageName(file.type, at, generated++), { type: file.type, lastModified: file.lastModified })
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
var PastedImages = Extension2.create({
|
|
321
|
+
name: "pastedImages",
|
|
322
|
+
addOptions() {
|
|
323
|
+
return { onImages: () => false };
|
|
324
|
+
},
|
|
325
|
+
addProseMirrorPlugins() {
|
|
326
|
+
const options = this.options;
|
|
327
|
+
return [
|
|
328
|
+
new Plugin2({
|
|
329
|
+
key: new PluginKey2("pastedImages"),
|
|
330
|
+
props: {
|
|
331
|
+
handlePaste: (_view, event) => {
|
|
332
|
+
const files = pastedImages(event.clipboardData);
|
|
333
|
+
return files.length > 0 && options.onImages(files);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
})
|
|
337
|
+
];
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
// src/CodeBlockColours.ts
|
|
342
|
+
import { CodeBlockLowlight } from "@tiptap/extension-code-block-lowlight";
|
|
343
|
+
|
|
344
|
+
// src/codeColours.ts
|
|
345
|
+
import { createElement } from "react";
|
|
346
|
+
import { common, createLowlight } from "lowlight";
|
|
347
|
+
var lowlight = createLowlight(common);
|
|
348
|
+
|
|
349
|
+
// src/CodeBlockColours.ts
|
|
350
|
+
var CodeBlockColours = CodeBlockLowlight.configure({ lowlight });
|
|
351
|
+
|
|
283
352
|
// src/suggestionPopup.tsx
|
|
284
353
|
import { forwardRef, useRef as useRef2, useImperativeHandle } from "react";
|
|
285
354
|
import { ReactRenderer } from "@tiptap/react";
|
|
@@ -503,8 +572,8 @@ function EditorBlockHandle({ editor, turnInto = [], actions, children, className
|
|
|
503
572
|
}
|
|
504
573
|
|
|
505
574
|
// src/ComposerTriggers.tsx
|
|
506
|
-
import { Extension as
|
|
507
|
-
import { PluginKey as
|
|
575
|
+
import { Extension as Extension3 } from "@tiptap/core";
|
|
576
|
+
import { PluginKey as PluginKey3 } from "@tiptap/pm/state";
|
|
508
577
|
import Mention from "@tiptap/extension-mention";
|
|
509
578
|
import Suggestion from "@tiptap/suggestion";
|
|
510
579
|
import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
|
|
@@ -665,7 +734,7 @@ var CaptionedReference = Mention.extend({
|
|
|
665
734
|
);
|
|
666
735
|
}
|
|
667
736
|
});
|
|
668
|
-
function referenceMenu({ ariaLabel, sectionLabel, icon }) {
|
|
737
|
+
function referenceMenu({ ariaLabel, sectionLabel, icon, iconFor }) {
|
|
669
738
|
return {
|
|
670
739
|
ariaLabel,
|
|
671
740
|
width: "w-[658px]",
|
|
@@ -681,11 +750,11 @@ function referenceMenu({ ariaLabel, sectionLabel, icon }) {
|
|
|
681
750
|
return groups;
|
|
682
751
|
},
|
|
683
752
|
itemKey: (item) => `reference-${item.id}`,
|
|
684
|
-
row: (item) => ({ leading: item.icon ?? icon, label: captionOf(item.label, item.snippet), description: item.description, hint: /* @__PURE__ */ jsx4(EnterHint, {}) })
|
|
753
|
+
row: (item) => ({ leading: item.icon ?? iconFor?.(item.uri) ?? icon, label: captionOf(item.label, item.snippet), description: item.description, hint: /* @__PURE__ */ jsx4(EnterHint, {}) })
|
|
685
754
|
};
|
|
686
755
|
}
|
|
687
756
|
var listed = (options, query) => options.sections ? options.sections(query).flatMap((section) => section.items.map((item) => ({ ...item, section: section.label }))) : filterReferences(options.items(), query);
|
|
688
|
-
var ReferenceTrigger =
|
|
757
|
+
var ReferenceTrigger = Extension3.create({
|
|
689
758
|
name: "referenceTrigger",
|
|
690
759
|
addOptions() {
|
|
691
760
|
return { items: () => [], nodeName: "captionedReference", ariaLabel: "References", sectionLabel: "References", icon: null };
|
|
@@ -696,7 +765,7 @@ var ReferenceTrigger = Extension2.create({
|
|
|
696
765
|
Suggestion({
|
|
697
766
|
editor: this.editor,
|
|
698
767
|
char: "[",
|
|
699
|
-
pluginKey: new
|
|
768
|
+
pluginKey: new PluginKey3("referenceTrigger"),
|
|
700
769
|
...listening("]"),
|
|
701
770
|
// As a mention's: only where the chip may go.
|
|
702
771
|
allow: ({ state, range }) => {
|
|
@@ -774,7 +843,7 @@ function filterSlashSections(sections, query) {
|
|
|
774
843
|
const q = query.toLowerCase();
|
|
775
844
|
return sections.map((section) => ({ ...section, commands: q ? section.commands.filter((command) => matches(command, q)) : section.commands }));
|
|
776
845
|
}
|
|
777
|
-
var SlashCommands =
|
|
846
|
+
var SlashCommands = Extension3.create({
|
|
778
847
|
name: "slashCommands",
|
|
779
848
|
addOptions() {
|
|
780
849
|
return { sections: [formatSection()] };
|
|
@@ -786,7 +855,7 @@ var SlashCommands = Extension2.create({
|
|
|
786
855
|
editor: this.editor,
|
|
787
856
|
char: "/",
|
|
788
857
|
startOfLine: false,
|
|
789
|
-
pluginKey: new
|
|
858
|
+
pluginKey: new PluginKey3("slashCommands"),
|
|
790
859
|
items: ({ query }) => filterSlashSections(sections, query).flatMap((section, at) => section.commands.map((command) => ({ ...command, section: at }))),
|
|
791
860
|
command: ({ editor, range, props }) => {
|
|
792
861
|
editor.chain().focus().deleteRange(range).run();
|
|
@@ -806,8 +875,8 @@ var SlashCommands = Extension2.create({
|
|
|
806
875
|
});
|
|
807
876
|
|
|
808
877
|
// src/BlockNodes.tsx
|
|
809
|
-
import { Extension as
|
|
810
|
-
import { Plugin as
|
|
878
|
+
import { Extension as Extension4, Node as Node2 } from "@tiptap/core";
|
|
879
|
+
import { Plugin as Plugin3, PluginKey as PluginKey4 } from "@tiptap/pm/state";
|
|
811
880
|
import { Mapping, ReplaceAroundStep } from "@tiptap/pm/transform";
|
|
812
881
|
import { NodeViewWrapper as NodeViewWrapper2, ReactNodeViewRenderer as ReactNodeViewRenderer2 } from "@tiptap/react";
|
|
813
882
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
@@ -955,7 +1024,7 @@ function bringsInBlocks(transactions) {
|
|
|
955
1024
|
})
|
|
956
1025
|
);
|
|
957
1026
|
}
|
|
958
|
-
var BlockId =
|
|
1027
|
+
var BlockId = Extension4.create({
|
|
959
1028
|
name: "blockId",
|
|
960
1029
|
onCreate() {
|
|
961
1030
|
const { state, view } = this.editor;
|
|
@@ -967,8 +1036,8 @@ var BlockId = Extension3.create({
|
|
|
967
1036
|
},
|
|
968
1037
|
addProseMirrorPlugins() {
|
|
969
1038
|
return [
|
|
970
|
-
new
|
|
971
|
-
key: new
|
|
1039
|
+
new Plugin3({
|
|
1040
|
+
key: new PluginKey4("blockIdSplit"),
|
|
972
1041
|
appendTransaction: (transactions, old, state) => {
|
|
973
1042
|
if (!bringsInBlocks(transactions)) return null;
|
|
974
1043
|
const mapping = new Mapping();
|
|
@@ -1102,9 +1171,11 @@ export {
|
|
|
1102
1171
|
AttachmentNode,
|
|
1103
1172
|
BlockId,
|
|
1104
1173
|
CaptionedReference,
|
|
1174
|
+
CodeBlockColours,
|
|
1105
1175
|
EditorBlockHandle,
|
|
1106
1176
|
FORMATS,
|
|
1107
1177
|
KeptSelection,
|
|
1178
|
+
PastedImages,
|
|
1108
1179
|
PersonMention,
|
|
1109
1180
|
ReferenceNode,
|
|
1110
1181
|
ReferenceTrigger,
|
|
@@ -1124,6 +1195,8 @@ export {
|
|
|
1124
1195
|
isSuggestionOpen,
|
|
1125
1196
|
moveBlock,
|
|
1126
1197
|
normalizeHref,
|
|
1198
|
+
pastedImageName,
|
|
1199
|
+
pastedImages,
|
|
1127
1200
|
peopleMenu,
|
|
1128
1201
|
referenceMenu,
|
|
1129
1202
|
startBlockDrag,
|