@synopackageland/ui 0.17.9 → 0.17.10

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 (41) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +51 -17
  3. package/dist/components/composite/comment-item/CommentItem.vue.d.ts +5 -1
  4. package/dist/components/composite/copy-button/CopyButton.vue.d.ts +2 -2
  5. package/dist/components/composite/file-picker/FilePicker.vue.d.ts +5 -2
  6. package/dist/components/composite/file-thumbs/FileThumbs.vue.d.ts +24 -0
  7. package/dist/components/composite/image-lightbox/ImageLightbox.vue.d.ts +19 -0
  8. package/dist/components/composite/mention-list/MentionList.vue.d.ts +31 -0
  9. package/dist/components/composite/rich-text-view/RichTextBlocks.vue.d.ts +14 -0
  10. package/dist/components/composite/rich-text-view/RichTextImage.vue.d.ts +12 -0
  11. package/dist/components/composite/rich-text-view/RichTextInline.vue.d.ts +23 -0
  12. package/dist/components/composite/rich-text-view/RichTextView.vue.d.ts +28 -0
  13. package/dist/components/composite/upload-queue/UploadQueue.vue.d.ts +36 -0
  14. package/dist/components/composite/wizard/WizardStep.vue.d.ts +1 -1
  15. package/dist/components/rich-text-editor/RichTextEditor.vue.d.ts +83 -0
  16. package/dist/components/rich-text-editor/extensions.d.ts +30 -0
  17. package/dist/components/rich-text-editor/markdown.d.ts +22 -0
  18. package/dist/i18n/filePicker.d.ts +3 -0
  19. package/dist/i18n/text.d.ts +48 -0
  20. package/dist/index.d.ts +15 -4
  21. package/dist/index.js +11143 -9907
  22. package/dist/json/catalog.d.ts +2 -2
  23. package/dist/json/registry.d.ts +34 -34
  24. package/dist/json-preview/preview.js +3436 -3004
  25. package/dist/lib/files.d.ts +28 -0
  26. package/dist/lib/mentions.d.ts +0 -10
  27. package/dist/lib/richText.d.ts +66 -0
  28. package/dist/lib/uploadQueue.d.ts +39 -0
  29. package/dist/reka-runtime.json +1 -1
  30. package/dist/rich-text.d.ts +3 -0
  31. package/dist/rich-text.js +1075 -0
  32. package/dist/theme.css +1 -1
  33. package/dist/themes/dsm7-embedded-theme.css +1 -1
  34. package/dist/themes/dsm7-embedded.css +1 -1
  35. package/dist/themes/dsm7.css +1 -1
  36. package/docs/theme-hooks.md +11 -2
  37. package/package.json +14 -1
  38. package/dist/components/composite/comment-item/CommentInlineParts.vue.d.ts +0 -7
  39. package/dist/components/composite/mention-textarea/MentionTextarea.vue.d.ts +0 -52
  40. package/dist/lib/commentMarkdown.d.ts +0 -34
  41. /package/dist/components/composite/{mention-textarea → comment-item}/PersonInitials.vue.d.ts +0 -0
@@ -0,0 +1,28 @@
1
+ /** `processing`: stored, its thumbnails not made yet. `missing`: gone from storage. `changed`: its content no longer matches what was stored. */
2
+ export type FileState = 'processing' | 'ready' | 'failed' | 'missing' | 'changed';
3
+ export type FileItem = {
4
+ id: string;
5
+ name: string;
6
+ /** MIME type, such as `image/jpeg`. */
7
+ type?: string;
8
+ size?: number;
9
+ /** `ready` when not set. */
10
+ state?: FileState;
11
+ /** The original, to download or show full size. */
12
+ url?: string;
13
+ /** A small picture (about 320px) for a grid cell or a list. */
14
+ thumb?: string;
15
+ /** A large picture (about 1280px) for a lightbox. */
16
+ preview?: string;
17
+ width?: number;
18
+ height?: number;
19
+ /** A CSS colour shown while the picture loads or is processed. */
20
+ dominant?: string;
21
+ };
22
+ /** Whether the file is a picture a browser shows: JPEG, PNG, WebP or GIF. */
23
+ export declare function isPicture(file: Pick<FileItem, 'name' | 'type'>): boolean;
24
+ /** HEIC, HEIF and AVIF: kept as files, but no picture is made from them. */
25
+ export declare function isUnsupportedPicture(file: {
26
+ name: string;
27
+ type?: string;
28
+ }): boolean;
@@ -22,16 +22,6 @@ export type MentionPart = {
22
22
  inactive: boolean;
23
23
  known: boolean;
24
24
  };
25
- /** Text with `@Label` for each chosen mention → a body with `@[id]` tokens and the ids, in order, once each. */
26
- export declare function mentionTokens(text: string, mentions: readonly MentionCandidate[]): {
27
- body: string;
28
- ids: string[];
29
- };
30
- /** A body with `@[id]` tokens → the `@Label` text to edit, and the people it mentions. An unknown id shows as itself. */
31
- export declare function mentionText(body: string, people: readonly MentionCandidate[]): {
32
- text: string;
33
- mentions: MentionCandidate[];
34
- };
35
25
  /** Splits a body into plain text, `@[id]` mentions and http(s) links, for display. */
36
26
  export declare function mentionParts(body: string, people?: readonly MentionCandidate[]): MentionPart[];
37
27
  /** Length in characters (code points), as a server counting runes sees it. */
@@ -0,0 +1,66 @@
1
+ import { MentionCandidate } from './mentions';
2
+ type Marks = {
3
+ strong?: true;
4
+ em?: true;
5
+ strike?: true;
6
+ };
7
+ export type RichTextInline = ({
8
+ type: 'text';
9
+ text: string;
10
+ } & Marks) | ({
11
+ type: 'link';
12
+ text: string;
13
+ href: string;
14
+ } & Marks) | ({
15
+ type: 'mention';
16
+ id: string;
17
+ label: string;
18
+ inactive: boolean;
19
+ known: boolean;
20
+ } & Marks) | {
21
+ type: 'code';
22
+ text: string;
23
+ }
24
+ /** `![alt](file:ID)`; `id` is the file the app stores. */
25
+ | {
26
+ type: 'image';
27
+ id: string;
28
+ alt: string;
29
+ };
30
+ export type RichTextListItem = {
31
+ parts: RichTextInline[];
32
+ list?: RichTextList;
33
+ };
34
+ export type RichTextList = {
35
+ type: 'list';
36
+ ordered: boolean;
37
+ start: number;
38
+ items: RichTextListItem[];
39
+ };
40
+ export type RichTextBlock = {
41
+ type: 'paragraph';
42
+ parts: RichTextInline[];
43
+ } | {
44
+ type: 'heading';
45
+ level: 2 | 3;
46
+ parts: RichTextInline[];
47
+ } | RichTextList | {
48
+ type: 'quote';
49
+ blocks: RichTextBlock[];
50
+ } | {
51
+ type: 'code';
52
+ text: string;
53
+ };
54
+ export type RichTextOptions = {
55
+ /** Names for the mention tokens; an unknown id shows as itself. */
56
+ people?: readonly MentionCandidate[];
57
+ /** Reads `## ` and `### ` as headings, for a rich text field; a comment leaves them as typed. */
58
+ headings?: boolean;
59
+ };
60
+ /** A body → its blocks of inline parts. */
61
+ export declare function richTextParts(body: string, options?: RichTextOptions): RichTextBlock[];
62
+ /** A body as plain text without the Markdown, for a notification, a preview or a search: mentions as `@Label`, links as their text, images as their alt text, list items as `• item`. */
63
+ export declare function richTextText(body: string, options?: RichTextOptions): string;
64
+ /** The file ids of the body's images, in order, once each. */
65
+ export declare function richTextFileIds(body: string): string[];
66
+ export {};
@@ -0,0 +1,39 @@
1
+ export type UploadStatus = 'queued' | 'uploading' | 'done' | 'failed' | 'canceled';
2
+ export type UploadTask<R = unknown> = {
3
+ key: string;
4
+ file: File;
5
+ name: string;
6
+ size: number;
7
+ /** Bytes sent so far, as the upload function reports them. */
8
+ loaded: number;
9
+ status: UploadStatus;
10
+ /** The last error's message, when `failed`. */
11
+ error?: string;
12
+ /** What the upload function resolved with, when `done`. */
13
+ result?: R;
14
+ };
15
+ export type UploadFunction<R> = (file: File, options: {
16
+ signal: AbortSignal;
17
+ onProgress: (loaded: number) => void;
18
+ }) => Promise<R>;
19
+ export type UploadQueueOptions<R> = {
20
+ /** Files sent at once; 3 by default. */
21
+ concurrency?: number;
22
+ /** Automatic retries after a failure, a second apart and then longer; 2 by default. */
23
+ retries?: number;
24
+ onDone?: (task: UploadTask<R>) => void;
25
+ onFailed?: (task: UploadTask<R>) => void;
26
+ };
27
+ export type UploadQueueController<R> = {
28
+ tasks: UploadTask<R>[];
29
+ /** Queues the files and returns their tasks. */
30
+ add: (files: Iterable<File>) => UploadTask<R>[];
31
+ retry: (key: string) => void;
32
+ cancel: (key: string) => void;
33
+ cancelAll: () => void;
34
+ /** Drops the task from the list, cancelling it first. */
35
+ remove: (key: string) => void;
36
+ /** Drops the tasks that are done or cancelled. */
37
+ clear: () => void;
38
+ };
39
+ export declare function useUploadQueue<R>(upload: UploadFunction<R>, options?: UploadQueueOptions<R>): UploadQueueController<R>;
@@ -3,7 +3,7 @@
3
3
  "version": "2.10.5",
4
4
  "delivery": "bundled-patched-esm",
5
5
  "patchManifestSha256": "14f10159b60d48ac7a0686f58faf7a30e99898dc267b3c032cf2bdd6052dc52b",
6
- "bundleSha256": "d0bd784a7fa38aa20e38f78621c19dc6055ce1cda61dd2f69127c6774fa13150",
6
+ "bundleSha256": "6689916a8e6efff9f280730df748e7721a556d511b4d273cac5dfbcb23ddb17b",
7
7
  "sourceHashes": {
8
8
  "shared/useBodyScrollLock.js": "657592f283cb6fd25454abd284a0024af21936cb56e05b762ff0d22b6a979d32",
9
9
  "DismissableLayer/DismissableLayer.js": "da05ca544d9822a8e2b71057e78c0e1ef59423aa3893534338fb58e1ecbd1a8d",
@@ -0,0 +1,3 @@
1
+ export { default as RichTextEditor } from './components/rich-text-editor/RichTextEditor.vue';
2
+ export { docToMarkdown, markdownToDoc } from './components/rich-text-editor/markdown';
3
+ export type { MarkdownOptions, SerializeOptions } from './components/rich-text-editor/markdown';