@limetech/lime-elements 39.40.0 → 39.42.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/CHANGELOG.md +20 -0
- package/dist/cjs/{image-resize-FAwzj92q.js → image-resize-BWRGvgkM.js} +42 -2
- package/dist/cjs/index.cjs.js +3 -2
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-action-bar_3.cjs.entry.js +1 -1
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
- package/dist/cjs/limel-callout.cjs.entry.js +1 -1
- package/dist/cjs/limel-chart.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip-set.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-code-diff.cjs.entry.js +1 -1
- package/dist/cjs/limel-code-editor.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +1 -1
- package/dist/cjs/limel-drag-handle.cjs.entry.js +1 -1
- package/dist/cjs/limel-email-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file.cjs.entry.js +84 -18
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-list-item.cjs.entry.js +1 -1
- package/dist/cjs/limel-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-profile-picture.cjs.entry.js +2 -2
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +440 -212
- package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +1 -1
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +1 -1
- package/dist/cjs/limel-text-editor.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{translations-VEsa81QY.js → translations-Bnw00bkf.js} +8 -0
- package/dist/cjs/{types-Bu6wcdI0.js → types-C7gNcwzE.js} +12 -0
- package/dist/collection/components/file/file.js +119 -18
- package/dist/collection/components/profile-picture/profile-picture.js +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/inserter.js +101 -30
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/node.js +160 -54
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/view.js +6 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +51 -5
- package/dist/collection/components/text-editor/text-editor.js +33 -3
- package/dist/collection/components/text-editor/text-editor.types.js +10 -1
- package/dist/collection/components/text-editor/utils/content-type-converter.js +30 -1
- package/dist/collection/components/text-editor/utils/html-converter.js +4 -2
- package/dist/collection/components/text-editor/utils/markdown-converter.js +9 -5
- package/dist/collection/translations/da.js +1 -0
- package/dist/collection/translations/de.js +1 -0
- package/dist/collection/translations/en.js +1 -0
- package/dist/collection/translations/fi.js +1 -0
- package/dist/collection/translations/fr.js +1 -0
- package/dist/collection/translations/nl.js +1 -0
- package/dist/collection/translations/no.js +1 -0
- package/dist/collection/translations/sv.js +1 -0
- package/dist/collection/util/image-resize.js +42 -2
- package/dist/esm/{image-resize-DPcww8rE.js → image-resize-65ma7B85.js} +42 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-action-bar_3.entry.js +1 -1
- package/dist/esm/limel-ai-avatar.entry.js +1 -1
- package/dist/esm/limel-callout.entry.js +1 -1
- package/dist/esm/limel-chart.entry.js +1 -1
- package/dist/esm/limel-chip-set.entry.js +1 -1
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-code-diff.entry.js +1 -1
- package/dist/esm/limel-code-editor.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +1 -1
- package/dist/esm/limel-drag-handle.entry.js +1 -1
- package/dist/esm/limel-email-viewer.entry.js +1 -1
- package/dist/esm/limel-file-viewer.entry.js +1 -1
- package/dist/esm/limel-file.entry.js +84 -18
- package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
- package/dist/esm/limel-list-item.entry.js +1 -1
- package/dist/esm/limel-picker.entry.js +1 -1
- package/dist/esm/limel-profile-picture.entry.js +2 -2
- package/dist/esm/limel-prosemirror-adapter.entry.js +440 -212
- package/dist/esm/limel-snackbar.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +1 -1
- package/dist/esm/limel-text-editor-link-menu.entry.js +1 -1
- package/dist/esm/limel-text-editor.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{translations-EPnIW0K5.js → translations-Cb9R_zmF.js} +8 -0
- package/dist/esm/{types-BWYo6dLf.js → types-C_Yu8dOg.js} +12 -1
- package/dist/lime-elements/index.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-068e7087.entry.js → p-19c81ded.entry.js} +2 -2
- package/dist/lime-elements/p-1cc3b516.entry.js +1 -0
- package/dist/lime-elements/{p-ca0a8a5a.entry.js → p-1e3cdfa1.entry.js} +1 -1
- package/dist/lime-elements/p-1f35fc44.entry.js +1 -0
- package/dist/lime-elements/{p-2531a103.entry.js → p-2284caa7.entry.js} +1 -1
- package/dist/lime-elements/{p-d8cb7d42.entry.js → p-2f223e46.entry.js} +1 -1
- package/dist/lime-elements/{p-a3a2aafe.entry.js → p-4a09fb2e.entry.js} +1 -1
- package/dist/lime-elements/{p-f197036b.entry.js → p-552d0733.entry.js} +1 -1
- package/dist/lime-elements/p-65ma7B85.js +1 -0
- package/dist/lime-elements/{p-fd78537c.entry.js → p-6fbf20c6.entry.js} +1 -1
- package/dist/lime-elements/{p-5571f0de.entry.js → p-758939be.entry.js} +1 -1
- package/dist/lime-elements/{p-19347686.entry.js → p-7f7e2180.entry.js} +1 -1
- package/dist/lime-elements/{p-2a871a95.entry.js → p-89f9bd6c.entry.js} +1 -1
- package/dist/lime-elements/{p-79caf3f6.entry.js → p-9ae7d11b.entry.js} +1 -1
- package/dist/lime-elements/p-C_Yu8dOg.js +1 -0
- package/dist/lime-elements/p-Cb9R_zmF.js +1 -0
- package/dist/lime-elements/{p-6edf13b1.entry.js → p-a089b580.entry.js} +1 -1
- package/dist/lime-elements/{p-04b4e903.entry.js → p-aa080a8f.entry.js} +1 -1
- package/dist/lime-elements/{p-54961e0e.entry.js → p-c1ceade7.entry.js} +1 -1
- package/dist/lime-elements/{p-e08f770e.entry.js → p-c8116a01.entry.js} +1 -1
- package/dist/lime-elements/{p-36ccc68e.entry.js → p-c8982eef.entry.js} +1 -1
- package/dist/lime-elements/{p-d98168a1.entry.js → p-ca0b86ee.entry.js} +1 -1
- package/dist/lime-elements/{p-1525274d.entry.js → p-d7bb4310.entry.js} +1 -1
- package/dist/lime-elements/p-d7f75a6d.entry.js +1 -0
- package/dist/lime-elements/{p-bb201b0d.entry.js → p-e545c9e8.entry.js} +1 -1
- package/dist/types/components/file/file.d.ts +20 -0
- package/dist/types/components/text-editor/prosemirror-adapter/plugins/image/inserter.d.ts +2 -2
- package/dist/types/components/text-editor/prosemirror-adapter/plugins/image/node.d.ts +41 -19
- package/dist/types/components/text-editor/prosemirror-adapter/prosemirror-adapter.d.ts +13 -1
- package/dist/types/components/text-editor/text-editor.d.ts +10 -2
- package/dist/types/components/text-editor/text-editor.types.d.ts +52 -0
- package/dist/types/components/text-editor/utils/content-type-converter.d.ts +12 -0
- package/dist/types/components/text-editor/utils/html-converter.d.ts +3 -1
- package/dist/types/components/text-editor/utils/markdown-converter.d.ts +3 -1
- package/dist/types/components.d.ts +50 -8
- package/dist/types/translations/da.d.ts +1 -0
- package/dist/types/translations/de.d.ts +1 -0
- package/dist/types/translations/en.d.ts +1 -0
- package/dist/types/translations/fi.d.ts +1 -0
- package/dist/types/translations/fr.d.ts +1 -0
- package/dist/types/translations/nl.d.ts +1 -0
- package/dist/types/translations/no.d.ts +1 -0
- package/dist/types/translations/sv.d.ts +1 -0
- package/dist/types/util/image-resize.d.ts +12 -4
- package/package.json +1 -1
- package/dist/lime-elements/p-366419ee.entry.js +0 -1
- package/dist/lime-elements/p-5cf7464f.entry.js +0 -1
- package/dist/lime-elements/p-BWYo6dLf.js +0 -1
- package/dist/lime-elements/p-DPcww8rE.js +0 -1
- package/dist/lime-elements/p-EPnIW0K5.js +0 -1
- package/dist/lime-elements/p-b7d734d2.entry.js +0 -1
|
@@ -1,41 +1,63 @@
|
|
|
1
1
|
import { NodeSpec, Node } from 'prosemirror-model';
|
|
2
|
-
import { EditorImageState } from '../../../text-editor.types';
|
|
2
|
+
import { EditorImageState, InlineImages } from '../../../text-editor.types';
|
|
3
3
|
import { MarkdownSerializerState } from 'prosemirror-markdown';
|
|
4
4
|
import { Languages } from '../../../../date-picker/date.types';
|
|
5
5
|
export declare const imageCache: Map<string, HTMLImageElement>;
|
|
6
6
|
type MarkdownSerializerFunction = (state: MarkdownSerializerState, node: Node) => void;
|
|
7
|
+
export declare const IMAGE_ID_ATTRIBUTE = "image-id";
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* The attribute names accepted for an inline-image tag. Backs the sanitizer
|
|
10
|
+
* whitelist built in `buildContentWhitelist`, so a stored tag keeps these
|
|
11
|
+
* attributes through parsing. The serializers here enumerate their own output
|
|
12
|
+
* attributes separately and are not driven by this list.
|
|
13
|
+
*/
|
|
14
|
+
export declare const INLINE_IMAGE_ATTRIBUTES: string[];
|
|
15
|
+
export interface ImageNodeAttrs {
|
|
16
|
+
src: string;
|
|
17
|
+
alt: string;
|
|
18
|
+
state: EditorImageState;
|
|
19
|
+
/**
|
|
20
|
+
* Transient, per-session key used to correlate an async upload with its
|
|
21
|
+
* thumbnail node and to key the image cache. Not persisted; regenerated
|
|
22
|
+
* when content is parsed.
|
|
23
|
+
*/
|
|
24
|
+
fileInfoId: string | number;
|
|
25
|
+
/**
|
|
26
|
+
* Opaque id of the stored image, set when inline images are configured and
|
|
27
|
+
* persisted on the tag.
|
|
28
|
+
*/
|
|
29
|
+
imageId?: string;
|
|
30
|
+
height?: string;
|
|
31
|
+
width?: string;
|
|
32
|
+
minHeight?: string;
|
|
33
|
+
minWidth?: string;
|
|
34
|
+
maxWidth?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Builds the `image` NodeSpec, wired for inline-image parsing/serialization
|
|
38
|
+
* when `inlineImages` is configured.
|
|
9
39
|
* @param language
|
|
40
|
+
* @param inlineImages
|
|
10
41
|
*/
|
|
11
|
-
export declare function getImageNode(language: Languages): Record<string, NodeSpec>;
|
|
42
|
+
export declare function getImageNode(language: Languages, inlineImages?: InlineImages): Record<string, NodeSpec>;
|
|
12
43
|
/**
|
|
13
|
-
*
|
|
44
|
+
* Builds the markdown serializer for the `image` node, emitting the inline-image
|
|
45
|
+
* tag when `inlineImages` is configured and a `<img>` otherwise.
|
|
14
46
|
* @param language
|
|
47
|
+
* @param inlineImages
|
|
15
48
|
*/
|
|
16
|
-
export declare function getImageNodeMarkdownSerializer(language: Languages): Record<string, MarkdownSerializerFunction>;
|
|
49
|
+
export declare function getImageNodeMarkdownSerializer(language: Languages, inlineImages?: InlineImages): Record<string, MarkdownSerializerFunction>;
|
|
17
50
|
/**
|
|
18
|
-
*
|
|
51
|
+
* Applies the node's stored dimensions to a rendered `<img>` element.
|
|
19
52
|
* @param img
|
|
20
53
|
* @param node
|
|
21
54
|
*/
|
|
22
55
|
export declare function applyImageStyles(img: HTMLImageElement, node: Node): void;
|
|
23
56
|
/**
|
|
24
|
-
* Recursively checks if a ProseMirror node or
|
|
25
|
-
*
|
|
57
|
+
* Recursively checks if a ProseMirror node or any of its descendants is an
|
|
58
|
+
* image node.
|
|
26
59
|
* @param node
|
|
27
60
|
*/
|
|
28
61
|
export declare function hasImageNode(node: Node): boolean;
|
|
29
|
-
export interface ImageNodeAttrs {
|
|
30
|
-
src: string;
|
|
31
|
-
alt: string;
|
|
32
|
-
state: EditorImageState;
|
|
33
|
-
fileInfoId: string | number;
|
|
34
|
-
height?: string;
|
|
35
|
-
width?: string;
|
|
36
|
-
minHeight?: string;
|
|
37
|
-
minWidth?: string;
|
|
38
|
-
maxWidth?: string;
|
|
39
|
-
}
|
|
40
62
|
export {};
|
|
41
63
|
//# sourceMappingURL=node.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Languages } from '../../date-picker/date.types';
|
|
2
2
|
import { CustomElementDefinition } from '../../../global/shared-types/custom-element.types';
|
|
3
|
-
import { TriggerCharacter } from '../text-editor.types';
|
|
3
|
+
import { TriggerCharacter, InlineImages } from '../text-editor.types';
|
|
4
4
|
import { EditorUiType } from '../types';
|
|
5
5
|
/**
|
|
6
6
|
* The ProseMirror adapter offers a rich text editing experience with markdown support.
|
|
@@ -40,6 +40,16 @@ export declare class ProsemirrorAdapter {
|
|
|
40
40
|
* @alpha
|
|
41
41
|
*/
|
|
42
42
|
customElements: CustomElementDefinition[];
|
|
43
|
+
/**
|
|
44
|
+
* Configures inline image support. When set, the editor owns the paste +
|
|
45
|
+
* upload lifecycle and persists images either as the configured tag
|
|
46
|
+
* carrying only a file id (`InlineImageTag`), or as a plain `<img src>`
|
|
47
|
+
* (`InlineImageSrc`).
|
|
48
|
+
*
|
|
49
|
+
* @private
|
|
50
|
+
* @alpha
|
|
51
|
+
*/
|
|
52
|
+
inlineImages?: InlineImages;
|
|
43
53
|
/**
|
|
44
54
|
* set to private to avoid usage while under development
|
|
45
55
|
*
|
|
@@ -63,6 +73,7 @@ export declare class ProsemirrorAdapter {
|
|
|
63
73
|
private menuCommandFactory;
|
|
64
74
|
private schema;
|
|
65
75
|
private contentConverter;
|
|
76
|
+
private validatedInlineImages?;
|
|
66
77
|
private actionBarElement;
|
|
67
78
|
private lastEmittedValue;
|
|
68
79
|
/**
|
|
@@ -137,6 +148,7 @@ export declare class ProsemirrorAdapter {
|
|
|
137
148
|
render(): any;
|
|
138
149
|
renderToolbar(): any;
|
|
139
150
|
renderLinkMenu(): any;
|
|
151
|
+
private validateInlineImages;
|
|
140
152
|
private setupContentConverter;
|
|
141
153
|
private getActionBarItems;
|
|
142
154
|
private getTranslatedItem;
|
|
@@ -2,7 +2,7 @@ import { EventEmitter } from '../../stencil-public-runtime';
|
|
|
2
2
|
import { FormComponent } from '../form/form.types';
|
|
3
3
|
import { Languages } from '../date-picker/date.types';
|
|
4
4
|
import { CustomElementDefinition } from '../../global/shared-types/custom-element.types';
|
|
5
|
-
import { TriggerCharacter, TriggerEventDetail } from './text-editor.types';
|
|
5
|
+
import { TriggerCharacter, TriggerEventDetail, InlineImages } from './text-editor.types';
|
|
6
6
|
import { EditorUiType } from './types';
|
|
7
7
|
/**
|
|
8
8
|
* A rich text editor that offers a rich text editing experience with markdown support,
|
|
@@ -18,8 +18,8 @@ import { EditorUiType } from './types';
|
|
|
18
18
|
* @exampleComponent limel-example-text-editor-with-markdown
|
|
19
19
|
* @exampleComponent limel-example-text-editor-with-html
|
|
20
20
|
* @exampleComponent limel-example-text-editor-with-tables
|
|
21
|
-
* @exampleComponent limel-example-text-editor-with-inline-images-file-storage
|
|
22
21
|
* @exampleComponent limel-example-text-editor-with-inline-images-base64
|
|
22
|
+
* @exampleComponent limel-example-text-editor-with-inline-images-custom-tag
|
|
23
23
|
* @exampleComponent limel-example-text-editor-allow-resize
|
|
24
24
|
* @exampleComponent limel-example-text-editor-size
|
|
25
25
|
* @exampleComponent limel-example-text-editor-ui
|
|
@@ -88,6 +88,14 @@ export declare class TextEditor implements FormComponent<string> {
|
|
|
88
88
|
* @alpha
|
|
89
89
|
*/
|
|
90
90
|
customElements: CustomElementDefinition[];
|
|
91
|
+
/**
|
|
92
|
+
* Configures inline image support: the editor owns the paste lifecycle and
|
|
93
|
+
* resize, the consumer owns upload, storage format, and URL resolution.
|
|
94
|
+
*
|
|
95
|
+
* @private
|
|
96
|
+
* @alpha
|
|
97
|
+
*/
|
|
98
|
+
inlineImages?: InlineImages;
|
|
91
99
|
/**
|
|
92
100
|
* A set of trigger characters
|
|
93
101
|
*
|
|
@@ -52,6 +52,58 @@ export interface ImageInserter {
|
|
|
52
52
|
*/
|
|
53
53
|
insertFailedThumbnail: () => void;
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Configures inline image support in the editor. The editor owns the paste
|
|
57
|
+
* lifecycle (thumbnail → upload → resizable image or failed state). Choose how
|
|
58
|
+
* images are persisted with one of two shapes: `InlineImageTag` (a custom
|
|
59
|
+
* id-carrying element) or `InlineImageSrc` (a plain `<img>`).
|
|
60
|
+
*
|
|
61
|
+
* @alpha
|
|
62
|
+
*/
|
|
63
|
+
export type InlineImages = InlineImageTag | InlineImageSrc;
|
|
64
|
+
/**
|
|
65
|
+
* Persists images as `<tagName image-id="…">`, carrying only an id; the editor
|
|
66
|
+
* resolves it to a displayable src via `getUrl`. Portable — no URL is baked
|
|
67
|
+
* into the stored content.
|
|
68
|
+
*
|
|
69
|
+
* @alpha
|
|
70
|
+
*/
|
|
71
|
+
export interface InlineImageTag {
|
|
72
|
+
/**
|
|
73
|
+
* Custom element the image is persisted as, e.g. `my-image`. Not a built-in
|
|
74
|
+
* tag like `img` — use the {@link InlineImageSrc} shape for plain `<img>`.
|
|
75
|
+
*/
|
|
76
|
+
tagName: `${string}-${string}`;
|
|
77
|
+
/**
|
|
78
|
+
* Resolves a stored id to a displayable src URL. The id originates from
|
|
79
|
+
* stored, potentially untrusted content and is only checked for
|
|
80
|
+
* non-emptiness before it reaches here, so validate it before using it to
|
|
81
|
+
* build a backend URL.
|
|
82
|
+
*/
|
|
83
|
+
getUrl: (id: string) => string;
|
|
84
|
+
/**
|
|
85
|
+
* Uploads a pasted image, resolving to the stored id. Omit to render and
|
|
86
|
+
* round-trip existing images without allowing new pastes.
|
|
87
|
+
*/
|
|
88
|
+
upload?: (file: File) => Promise<string>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Persists images as a plain `<img src="…">`.
|
|
92
|
+
*
|
|
93
|
+
* @alpha
|
|
94
|
+
*/
|
|
95
|
+
export interface InlineImageSrc {
|
|
96
|
+
/** Uploads a pasted image, resolving to its src — a URL or a data URI. */
|
|
97
|
+
upload: (file: File) => Promise<string>;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Narrows `InlineImages` to its tag shape, exposing `tagName`/`getUrl`.
|
|
101
|
+
*
|
|
102
|
+
* @param config - the inline-images configuration to test
|
|
103
|
+
* @returns whether images are persisted as a custom id-carrying element
|
|
104
|
+
* @alpha
|
|
105
|
+
*/
|
|
106
|
+
export declare function isInlineImageTag(config: InlineImages): config is InlineImageTag;
|
|
55
107
|
/**
|
|
56
108
|
* @alpha
|
|
57
109
|
*/
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { EditorView } from 'prosemirror-view';
|
|
2
2
|
import { Schema } from 'prosemirror-model';
|
|
3
|
+
import { CustomElementDefinition } from '../../../global/shared-types/custom-element.types';
|
|
4
|
+
import { InlineImages } from '../text-editor.types';
|
|
3
5
|
/**
|
|
4
6
|
* Abstract class implementing a generic parser/serialiser
|
|
5
7
|
* for different editor content types
|
|
@@ -12,4 +14,14 @@ export interface ContentTypeConverter {
|
|
|
12
14
|
parseAsHTML: (text: string, schema: Schema) => Promise<string>;
|
|
13
15
|
serialize: (view: EditorView, schema: Schema) => string;
|
|
14
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Build the sanitization whitelist for editor content: the consumer's custom
|
|
19
|
+
* elements, plus (when inline images are configured) the inline-image tag so it
|
|
20
|
+
* survives parsing into an image node. Shared by all content converters.
|
|
21
|
+
*
|
|
22
|
+
* @param customNodes
|
|
23
|
+
* @param inlineImages
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildContentWhitelist(customNodes: CustomElementDefinition[], inlineImages?: InlineImages): CustomElementDefinition[];
|
|
15
27
|
//# sourceMappingURL=content-type-converter.d.ts.map
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ContentTypeConverter } from './content-type-converter';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { CustomElementDefinition } from '../../../interface';
|
|
4
|
+
import { InlineImages } from '../text-editor.types';
|
|
4
5
|
/**
|
|
5
6
|
* @private
|
|
6
7
|
*/
|
|
7
8
|
export declare class HTMLConverter implements ContentTypeConverter {
|
|
8
9
|
private customNodes;
|
|
9
|
-
|
|
10
|
+
private readonly inlineImages?;
|
|
11
|
+
constructor(plugins: CustomElementDefinition[], inlineImages?: InlineImages);
|
|
10
12
|
parseAsHTML: (text: string) => Promise<string>;
|
|
11
13
|
serialize: (view: EditorView) => string;
|
|
12
14
|
}
|
|
@@ -2,13 +2,15 @@ import { ContentTypeConverter } from './content-type-converter';
|
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { CustomElementDefinition } from '../../../global/shared-types/custom-element.types';
|
|
4
4
|
import { Languages } from '../../date-picker/date.types';
|
|
5
|
+
import { InlineImages } from '../text-editor.types';
|
|
5
6
|
/**
|
|
6
7
|
* @private
|
|
7
8
|
*/
|
|
8
9
|
export declare class MarkdownConverter implements ContentTypeConverter {
|
|
9
10
|
private markdownSerializer;
|
|
10
11
|
private customNodes;
|
|
11
|
-
|
|
12
|
+
private readonly inlineImages?;
|
|
13
|
+
constructor(plugins: CustomElementDefinition[], language: Languages, inlineImages?: InlineImages);
|
|
12
14
|
parseAsHTML: (text: string) => Promise<string>;
|
|
13
15
|
serialize: (view: EditorView) => string;
|
|
14
16
|
}
|
|
@@ -31,6 +31,7 @@ import { ClosingActions, DialogHeading } from "./components/dialog/dialog.types"
|
|
|
31
31
|
import { DockItem } from "./components/dock/dock.types";
|
|
32
32
|
import { Email } from "./components/email-viewer/email-viewer.types";
|
|
33
33
|
import { FileInfo } from "./global/shared-types/file.types";
|
|
34
|
+
import { ResizeOptions } from "./util/image-resize";
|
|
34
35
|
import { OfficeViewer } from "./components/file-viewer/file-viewer.types";
|
|
35
36
|
import { FlexContainerAlign, FlexContainerDirection, FlexContainerJustify } from "./components/flex-container/flex-container.types";
|
|
36
37
|
import { FormError, FormSchema, ValidationError, ValidationStatus } from "./components/form/form.types";
|
|
@@ -42,9 +43,8 @@ import { CustomElementDefinition } from "./global/shared-types/custom-element.ty
|
|
|
42
43
|
import { PickerItem } from "./components/picker/picker-item.types";
|
|
43
44
|
import { Searcher } from "./components/picker/searcher.types";
|
|
44
45
|
import { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
|
|
45
|
-
import { ResizeOptions } from "./util/image-resize";
|
|
46
46
|
import { FlowItem } from "./components/progress-flow/progress-flow.types";
|
|
47
|
-
import { EditorImage, EditorMetadata, ImageInserter, TriggerCharacter, TriggerEventDetail } from "./components/text-editor/text-editor.types";
|
|
47
|
+
import { EditorImage, EditorMetadata, ImageInserter, InlineImages, TriggerCharacter, TriggerEventDetail } from "./components/text-editor/text-editor.types";
|
|
48
48
|
import { EditorUiType } from "./components/text-editor/types";
|
|
49
49
|
import { Option } from "./components/select/option.types";
|
|
50
50
|
import { SpinnerSize } from "./components/spinner/spinner.types";
|
|
@@ -78,6 +78,7 @@ export { ClosingActions, DialogHeading } from "./components/dialog/dialog.types"
|
|
|
78
78
|
export { DockItem } from "./components/dock/dock.types";
|
|
79
79
|
export { Email } from "./components/email-viewer/email-viewer.types";
|
|
80
80
|
export { FileInfo } from "./global/shared-types/file.types";
|
|
81
|
+
export { ResizeOptions } from "./util/image-resize";
|
|
81
82
|
export { OfficeViewer } from "./components/file-viewer/file-viewer.types";
|
|
82
83
|
export { FlexContainerAlign, FlexContainerDirection, FlexContainerJustify } from "./components/flex-container/flex-container.types";
|
|
83
84
|
export { FormError, FormSchema, ValidationError, ValidationStatus } from "./components/form/form.types";
|
|
@@ -89,9 +90,8 @@ export { CustomElementDefinition } from "./global/shared-types/custom-element.ty
|
|
|
89
90
|
export { PickerItem } from "./components/picker/picker-item.types";
|
|
90
91
|
export { Searcher } from "./components/picker/searcher.types";
|
|
91
92
|
export { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
|
|
92
|
-
export { ResizeOptions } from "./util/image-resize";
|
|
93
93
|
export { FlowItem } from "./components/progress-flow/progress-flow.types";
|
|
94
|
-
export { EditorImage, EditorMetadata, ImageInserter, TriggerCharacter, TriggerEventDetail } from "./components/text-editor/text-editor.types";
|
|
94
|
+
export { EditorImage, EditorMetadata, ImageInserter, InlineImages, TriggerCharacter, TriggerEventDetail } from "./components/text-editor/text-editor.types";
|
|
95
95
|
export { EditorUiType } from "./components/text-editor/types";
|
|
96
96
|
export { Option } from "./components/select/option.types";
|
|
97
97
|
export { SpinnerSize } from "./components/spinner/spinner.types";
|
|
@@ -1605,6 +1605,8 @@ export namespace Components {
|
|
|
1605
1605
|
* @exampleComponent limel-example-file-per-file-status
|
|
1606
1606
|
* @exampleComponent limel-example-file-menu-items
|
|
1607
1607
|
* @exampleComponent limel-example-file-accepted-types
|
|
1608
|
+
* @exampleComponent limel-example-file-resize-image
|
|
1609
|
+
* @exampleComponent limel-example-file-resize-mixed
|
|
1608
1610
|
* @exampleComponent limel-example-file-composite
|
|
1609
1611
|
*/
|
|
1610
1612
|
interface LimelFile {
|
|
@@ -1651,6 +1653,11 @@ export namespace Components {
|
|
|
1651
1653
|
* @default false
|
|
1652
1654
|
*/
|
|
1653
1655
|
"required": boolean;
|
|
1656
|
+
/**
|
|
1657
|
+
* Optional client-side image resize, applied before the `change` event is emitted: a selected image is downscaled and re-encoded on the user's device. Only decodable raster images are resized; all other files pass through unchanged. See the examples for details and caveats.
|
|
1658
|
+
* @beta
|
|
1659
|
+
*/
|
|
1660
|
+
"resizeImage"?: ResizeOptions;
|
|
1654
1661
|
/**
|
|
1655
1662
|
* The selected file.
|
|
1656
1663
|
*/
|
|
@@ -3199,6 +3206,12 @@ export namespace Components {
|
|
|
3199
3206
|
* Emits any pending debounced `change` event immediately. Does nothing if no change is pending.
|
|
3200
3207
|
*/
|
|
3201
3208
|
"flushPendingChanges": () => Promise<void>;
|
|
3209
|
+
/**
|
|
3210
|
+
* Configures inline image support. When set, the editor owns the paste + upload lifecycle and persists images either as the configured tag carrying only a file id (`InlineImageTag`), or as a plain `<img src>` (`InlineImageSrc`).
|
|
3211
|
+
* @private
|
|
3212
|
+
* @alpha
|
|
3213
|
+
*/
|
|
3214
|
+
"inlineImages"?: InlineImages;
|
|
3202
3215
|
/**
|
|
3203
3216
|
* Defines the language for translations.
|
|
3204
3217
|
*/
|
|
@@ -3810,8 +3823,8 @@ export namespace Components {
|
|
|
3810
3823
|
* @exampleComponent limel-example-text-editor-with-markdown
|
|
3811
3824
|
* @exampleComponent limel-example-text-editor-with-html
|
|
3812
3825
|
* @exampleComponent limel-example-text-editor-with-tables
|
|
3813
|
-
* @exampleComponent limel-example-text-editor-with-inline-images-file-storage
|
|
3814
3826
|
* @exampleComponent limel-example-text-editor-with-inline-images-base64
|
|
3827
|
+
* @exampleComponent limel-example-text-editor-with-inline-images-custom-tag
|
|
3815
3828
|
* @exampleComponent limel-example-text-editor-allow-resize
|
|
3816
3829
|
* @exampleComponent limel-example-text-editor-size
|
|
3817
3830
|
* @exampleComponent limel-example-text-editor-ui
|
|
@@ -3855,6 +3868,12 @@ export namespace Components {
|
|
|
3855
3868
|
* Optional helper text to display below the input field when it has focus
|
|
3856
3869
|
*/
|
|
3857
3870
|
"helperText"?: string;
|
|
3871
|
+
/**
|
|
3872
|
+
* Configures inline image support: the editor owns the paste lifecycle and resize, the consumer owns upload, storage format, and URL resolution.
|
|
3873
|
+
* @private
|
|
3874
|
+
* @alpha
|
|
3875
|
+
*/
|
|
3876
|
+
"inlineImages"?: InlineImages;
|
|
3858
3877
|
/**
|
|
3859
3878
|
* Set to `true` to indicate that the current value of the editor is invalid.
|
|
3860
3879
|
* @default false
|
|
@@ -5119,6 +5138,8 @@ declare global {
|
|
|
5119
5138
|
* @exampleComponent limel-example-file-per-file-status
|
|
5120
5139
|
* @exampleComponent limel-example-file-menu-items
|
|
5121
5140
|
* @exampleComponent limel-example-file-accepted-types
|
|
5141
|
+
* @exampleComponent limel-example-file-resize-image
|
|
5142
|
+
* @exampleComponent limel-example-file-resize-mixed
|
|
5122
5143
|
* @exampleComponent limel-example-file-composite
|
|
5123
5144
|
*/
|
|
5124
5145
|
interface HTMLLimelFileElement extends Components.LimelFile, HTMLStencilElement {
|
|
@@ -6420,8 +6441,8 @@ declare global {
|
|
|
6420
6441
|
* @exampleComponent limel-example-text-editor-with-markdown
|
|
6421
6442
|
* @exampleComponent limel-example-text-editor-with-html
|
|
6422
6443
|
* @exampleComponent limel-example-text-editor-with-tables
|
|
6423
|
-
* @exampleComponent limel-example-text-editor-with-inline-images-file-storage
|
|
6424
6444
|
* @exampleComponent limel-example-text-editor-with-inline-images-base64
|
|
6445
|
+
* @exampleComponent limel-example-text-editor-with-inline-images-custom-tag
|
|
6425
6446
|
* @exampleComponent limel-example-text-editor-allow-resize
|
|
6426
6447
|
* @exampleComponent limel-example-text-editor-size
|
|
6427
6448
|
* @exampleComponent limel-example-text-editor-ui
|
|
@@ -8211,6 +8232,8 @@ declare namespace LocalJSX {
|
|
|
8211
8232
|
* @exampleComponent limel-example-file-per-file-status
|
|
8212
8233
|
* @exampleComponent limel-example-file-menu-items
|
|
8213
8234
|
* @exampleComponent limel-example-file-accepted-types
|
|
8235
|
+
* @exampleComponent limel-example-file-resize-image
|
|
8236
|
+
* @exampleComponent limel-example-file-resize-mixed
|
|
8214
8237
|
* @exampleComponent limel-example-file-composite
|
|
8215
8238
|
*/
|
|
8216
8239
|
interface LimelFile {
|
|
@@ -8265,6 +8288,11 @@ declare namespace LocalJSX {
|
|
|
8265
8288
|
* @default false
|
|
8266
8289
|
*/
|
|
8267
8290
|
"required"?: boolean;
|
|
8291
|
+
/**
|
|
8292
|
+
* Optional client-side image resize, applied before the `change` event is emitted: a selected image is downscaled and re-encoded on the user's device. Only decodable raster images are resized; all other files pass through unchanged. See the examples for details and caveats.
|
|
8293
|
+
* @beta
|
|
8294
|
+
*/
|
|
8295
|
+
"resizeImage"?: ResizeOptions;
|
|
8268
8296
|
/**
|
|
8269
8297
|
* The selected file.
|
|
8270
8298
|
*/
|
|
@@ -9889,6 +9917,12 @@ declare namespace LocalJSX {
|
|
|
9889
9917
|
* @default false
|
|
9890
9918
|
*/
|
|
9891
9919
|
"disabled"?: boolean;
|
|
9920
|
+
/**
|
|
9921
|
+
* Configures inline image support. When set, the editor owns the paste + upload lifecycle and persists images either as the configured tag carrying only a file id (`InlineImageTag`), or as a plain `<img src>` (`InlineImageSrc`).
|
|
9922
|
+
* @private
|
|
9923
|
+
* @alpha
|
|
9924
|
+
*/
|
|
9925
|
+
"inlineImages"?: InlineImages;
|
|
9892
9926
|
/**
|
|
9893
9927
|
* Defines the language for translations.
|
|
9894
9928
|
*/
|
|
@@ -10585,8 +10619,8 @@ declare namespace LocalJSX {
|
|
|
10585
10619
|
* @exampleComponent limel-example-text-editor-with-markdown
|
|
10586
10620
|
* @exampleComponent limel-example-text-editor-with-html
|
|
10587
10621
|
* @exampleComponent limel-example-text-editor-with-tables
|
|
10588
|
-
* @exampleComponent limel-example-text-editor-with-inline-images-file-storage
|
|
10589
10622
|
* @exampleComponent limel-example-text-editor-with-inline-images-base64
|
|
10623
|
+
* @exampleComponent limel-example-text-editor-with-inline-images-custom-tag
|
|
10590
10624
|
* @exampleComponent limel-example-text-editor-allow-resize
|
|
10591
10625
|
* @exampleComponent limel-example-text-editor-size
|
|
10592
10626
|
* @exampleComponent limel-example-text-editor-ui
|
|
@@ -10622,6 +10656,12 @@ declare namespace LocalJSX {
|
|
|
10622
10656
|
* Optional helper text to display below the input field when it has focus
|
|
10623
10657
|
*/
|
|
10624
10658
|
"helperText"?: string;
|
|
10659
|
+
/**
|
|
10660
|
+
* Configures inline image support: the editor owns the paste lifecycle and resize, the consumer owns upload, storage format, and URL resolution.
|
|
10661
|
+
* @private
|
|
10662
|
+
* @alpha
|
|
10663
|
+
*/
|
|
10664
|
+
"inlineImages"?: InlineImages;
|
|
10625
10665
|
/**
|
|
10626
10666
|
* Set to `true` to indicate that the current value of the editor is invalid.
|
|
10627
10667
|
* @default false
|
|
@@ -12061,6 +12101,8 @@ declare module "@stencil/core" {
|
|
|
12061
12101
|
* @exampleComponent limel-example-file-per-file-status
|
|
12062
12102
|
* @exampleComponent limel-example-file-menu-items
|
|
12063
12103
|
* @exampleComponent limel-example-file-accepted-types
|
|
12104
|
+
* @exampleComponent limel-example-file-resize-image
|
|
12105
|
+
* @exampleComponent limel-example-file-resize-mixed
|
|
12064
12106
|
* @exampleComponent limel-example-file-composite
|
|
12065
12107
|
*/
|
|
12066
12108
|
"limel-file": LocalJSX.IntrinsicElements["limel-file"] & JSXBase.HTMLAttributes<HTMLLimelFileElement>;
|
|
@@ -12813,8 +12855,8 @@ declare module "@stencil/core" {
|
|
|
12813
12855
|
* @exampleComponent limel-example-text-editor-with-markdown
|
|
12814
12856
|
* @exampleComponent limel-example-text-editor-with-html
|
|
12815
12857
|
* @exampleComponent limel-example-text-editor-with-tables
|
|
12816
|
-
* @exampleComponent limel-example-text-editor-with-inline-images-file-storage
|
|
12817
12858
|
* @exampleComponent limel-example-text-editor-with-inline-images-base64
|
|
12859
|
+
* @exampleComponent limel-example-text-editor-with-inline-images-custom-tag
|
|
12818
12860
|
* @exampleComponent limel-example-text-editor-allow-resize
|
|
12819
12861
|
* @exampleComponent limel-example-text-editor-size
|
|
12820
12862
|
* @exampleComponent limel-example-text-editor-ui
|
|
@@ -29,6 +29,7 @@ declare const _default: {
|
|
|
29
29
|
'chip-set.clear-all': string;
|
|
30
30
|
'snackbar.dismiss': string;
|
|
31
31
|
'file.drag-and-drop-tips': string;
|
|
32
|
+
'file.optimizing': string;
|
|
32
33
|
'file-viewer.message.unsupported-filetype': string;
|
|
33
34
|
'file-viewer.message.try-other-options': string;
|
|
34
35
|
'file-viewer.message.file-not-found': string;
|
|
@@ -29,6 +29,7 @@ declare const _default: {
|
|
|
29
29
|
'chip-set.clear-all': string;
|
|
30
30
|
'snackbar.dismiss': string;
|
|
31
31
|
'file.drag-and-drop-tips': string;
|
|
32
|
+
'file.optimizing': string;
|
|
32
33
|
'file-viewer.message.unsupported-filetype': string;
|
|
33
34
|
'file-viewer.message.try-other-options': string;
|
|
34
35
|
'file-viewer.message.file-not-found': string;
|
|
@@ -29,6 +29,7 @@ declare const _default: {
|
|
|
29
29
|
'chip-set.clear-all': string;
|
|
30
30
|
'snackbar.dismiss': string;
|
|
31
31
|
'file.drag-and-drop-tips': string;
|
|
32
|
+
'file.optimizing': string;
|
|
32
33
|
'file-viewer.message.unsupported-filetype': string;
|
|
33
34
|
'file-viewer.message.try-other-options': string;
|
|
34
35
|
'file-viewer.message.file-not-found': string;
|
|
@@ -29,6 +29,7 @@ declare const _default: {
|
|
|
29
29
|
'chip-set.clear-all': string;
|
|
30
30
|
'snackbar.dismiss': string;
|
|
31
31
|
'file.drag-and-drop-tips': string;
|
|
32
|
+
'file.optimizing': string;
|
|
32
33
|
'file-viewer.message.unsupported-filetype': string;
|
|
33
34
|
'file-viewer.message.try-other-options': string;
|
|
34
35
|
'file-viewer.message.file-not-found': string;
|
|
@@ -29,6 +29,7 @@ declare const _default: {
|
|
|
29
29
|
'chip-set.clear-all': string;
|
|
30
30
|
'snackbar.dismiss': string;
|
|
31
31
|
'file.drag-and-drop-tips': string;
|
|
32
|
+
'file.optimizing': string;
|
|
32
33
|
'file-viewer.message.unsupported-filetype': string;
|
|
33
34
|
'file-viewer.message.try-other-options': string;
|
|
34
35
|
'file-viewer.message.file-not-found': string;
|
|
@@ -29,6 +29,7 @@ declare const _default: {
|
|
|
29
29
|
'chip-set.clear-all': string;
|
|
30
30
|
'snackbar.dismiss': string;
|
|
31
31
|
'file.drag-and-drop-tips': string;
|
|
32
|
+
'file.optimizing': string;
|
|
32
33
|
'file-viewer.message.unsupported-filetype': string;
|
|
33
34
|
'file-viewer.message.try-other-options': string;
|
|
34
35
|
'file-viewer.message.file-not-found': string;
|
|
@@ -28,6 +28,7 @@ declare const _default: {
|
|
|
28
28
|
'drag-handle.drag-to-reorder': string;
|
|
29
29
|
'chip-set.clear-all': string;
|
|
30
30
|
'file.drag-and-drop-tips': string;
|
|
31
|
+
'file.optimizing': string;
|
|
31
32
|
'file-viewer.message.unsupported-filetype': string;
|
|
32
33
|
'file-viewer.message.try-other-options': string;
|
|
33
34
|
'file-viewer.message.file-not-found': string;
|
|
@@ -29,6 +29,7 @@ declare const _default: {
|
|
|
29
29
|
'chip-set.clear-all': string;
|
|
30
30
|
'snackbar.dismiss': string;
|
|
31
31
|
'file.drag-and-drop-tips': string;
|
|
32
|
+
'file.optimizing': string;
|
|
32
33
|
'file-viewer.message.unsupported-filetype': string;
|
|
33
34
|
'file-viewer.message.try-other-options': string;
|
|
34
35
|
'file-viewer.message.file-not-found': string;
|
|
@@ -108,10 +108,18 @@
|
|
|
108
108
|
* @beta
|
|
109
109
|
*/
|
|
110
110
|
export type ResizeOptions = {
|
|
111
|
-
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Target width in CSS pixels. Omit to derive it from `height` while
|
|
113
|
+
* preserving the source aspect ratio; omit both `width` and `height` to
|
|
114
|
+
* keep the source dimensions and only re-encode.
|
|
115
|
+
*/
|
|
116
|
+
width?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Target height in CSS pixels. Omit to derive it from `width` while
|
|
119
|
+
* preserving the source aspect ratio; omit both `width` and `height` to
|
|
120
|
+
* keep the source dimensions and only re-encode.
|
|
121
|
+
*/
|
|
122
|
+
height?: number;
|
|
115
123
|
/** Fit strategy; defaults to 'cover'. */
|
|
116
124
|
fit?: 'cover' | 'contain';
|
|
117
125
|
/** Output MIME type; 'image/jpeg' by default. */
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as r}from"./p-BGxJfR2f.js";import{c as o}from"./p-JbKhhoXs.js";const l=class{constructor(r){t(this,r),this.change=e(this,"change"),this.imagePasted=e(this,"imagePasted"),this.imageRemoved=e(this,"imageRemoved"),this.metadataChange=e(this,"metadataChange"),this.triggerStart=e(this,"triggerStart"),this.triggerStop=e(this,"triggerStop"),this.triggerChange=e(this,"triggerChange"),this.contentType="markdown",this.language="en",this.disabled=!1,this.readonly=!1,this.invalid=!1,this.customElements=[],this.triggers=[],this.required=!1,this.allowResize=!0,this.ui="standard",this.renderHelperLine=()=>{if(this.helperText)return i("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.isInvalid()})},this.isInvalid=()=>!this.readonly&&(!!this.invalid||void 0),this.handleChange=t=>{t.stopPropagation(),this.change.emit(t.detail)},this.handleImagePasted=t=>{t.stopPropagation(),this.imagePasted.emit(t.detail)},this.handleMetadataChange=t=>{t.stopPropagation(),this.metadataChange.emit(t.detail)},this.handleImageRemoved=t=>{t.stopPropagation(),this.imageRemoved.emit(t.detail)},this.helperTextId=o(),this.editorId=o()}async flushPendingChanges(){var t;await(null===(t=this.adapterElement)||void 0===t?void 0:t.flushPendingChanges())}async clear(){var t;await(null===(t=this.adapterElement)||void 0===t?void 0:t.clear())}render(){return i(r,{key:"12f7643f82a4899efd112dc74e67fbd79be64d9f"},i("limel-notched-outline",{key:"109e7c03874e141f073a05882ca48188adaced72",labelId:this.editorId,label:this.label,required:this.required,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasFloatingLabel:!0},this.renderEditor(),this.renderPlaceholder()),this.renderHelperLine())}renderEditor(){return this.readonly?i("limel-markdown",{slot:"content",value:this.value,"aria-controls":this.helperText?this.helperTextId:void 0,id:this.editorId}):i("limel-prosemirror-adapter",{ref:t=>this.adapterElement=t,slot:"content","aria-placeholder":this.placeholder,contentType:this.contentType,onChange:this.handleChange,onImagePasted:this.handleImagePasted,onImageRemoved:this.handleImageRemoved,onMetadataChange:this.handleMetadataChange,customElements:this.customElements,value:this.value,"aria-controls":this.helperText?this.helperTextId:void 0,id:this.editorId,"aria-disabled":this.disabled,"aria-invalid":this.invalid,"aria-required":this.required,language:this.language,triggerCharacters:this.triggers,disabled:this.disabled,ui:this.ui})}renderPlaceholder(){if(this.placeholder&&!this.value)return i("span",{class:"placeholder","aria-hidden":"true",slot:"content"},this.placeholder)}static get delegatesFocus(){return!0}};l.style='@charset "UTF-8";*{box-sizing:border-box}:host(limel-text-editor){--limel-notched-outline-z-index:2;--limel-prosemirror-adapter-toolbar-opacity:0.6;--limel-text-editor-padding:0.25rem 1rem 0.75rem 1rem;--limel-prosemirror-adapter-toolbar-grid-template-rows:1fr;--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration:0.3s;--limel-prosemirror-adapter-toolbar-transition-timing-function:cubic-bezier( 0.19, 0.23, 0.26, 0.89 );position:relative;isolation:isolate;display:flex;flex-direction:column;width:100%;min-width:5rem;min-height:5rem;height:100%;max-height:var(--text-editor-max-height, calc(100vh - (env(safe-area-inset-top) + env(safe-area-inset-bottom)) - 4rem));padding:1px}:host(limel-text-editor) limel-notched-outline{height:100%}:host(limel-text-editor:focus-within),:host(limel-text-editor:not([ui=minimal]):hover){--limel-prosemirror-adapter-toolbar-opacity:1}:host(limel-text-editor[ui=minimal]:not(:focus-within)){--limel-prosemirror-adapter-toolbar-grid-template-rows:0fr;--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration:0.46s;--limel-prosemirror-adapter-action-bar-padding-top-bottom:0;--limel-prosemirror-adapter-toolbar-opacity:0}:host(limel-text-editor[ui=minimal]:not(:focus-within)),:host(limel-text-editor[ui=no-toolbar]){--limel-text-editor-padding:0.75rem 1rem 0.75rem 1rem;--limel-text-editor-placeholder-top:0;min-height:2.5rem}:host(limel-text-editor[ui=minimal]:not(:focus-within)) limel-prosemirror-adapter,:host(limel-text-editor[ui=no-toolbar]) limel-prosemirror-adapter{min-height:2.5rem}:host(limel-text-editor:focus-within) .placeholder,:host(limel-text-editor:focus) .placeholder{opacity:0}:host(limel-text-editor[disabled]:not([disabled=false])) limel-prosemirror-adapter{cursor:not-allowed;opacity:0.4;pointer-events:none}:host(limel-text-editor[readonly]:not([readonly=false])){--limel-text-editor-padding:0.75rem 1rem 0.75rem 1rem;--limel-text-editor-placeholder-top:0}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown{display:block;padding:var(--limel-text-editor-padding);overflow-y:auto;-webkit-overflow-scrolling:touch;height:100%}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:before,:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:after{z-index:1;pointer-events:none;content:"";display:block;position:absolute;width:100%}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:after{height:1.75rem;top:0;background:linear-gradient(var(--text-editor-fade-out-background-color, rgb(var(--contrast-100))), transparent)}:host(limel-text-editor[readonly]:not([readonly=false])) limel-markdown:before{height:2rem;bottom:-0.25rem;background:linear-gradient(transparent, var(--text-editor-fade-out-background-color, rgb(var(--contrast-100))))}.placeholder{transition-property:top;transition-duration:var(--limel-prosemirror-adapter-toolbar-grid-template-rows-transition-duration);transition-timing-function:var(--limel-prosemirror-adapter-toolbar-transition-timing-function);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;pointer-events:none;position:absolute;top:var(--limel-text-editor-placeholder-top, 2.25rem);left:0;right:0;padding:var(--limel-text-editor-padding);font-style:italic;font-size:var(--limel-theme-default-font-size);color:rgb(var(--contrast-900))}limel-prosemirror-adapter{flex-grow:1;min-width:0;min-height:5rem;height:100%;max-height:100%;overflow:hidden auto;-webkit-overflow-scrolling:touch}:host(limel-text-editor:focus),:host(limel-text-editor:focus-visible),:host(limel-text-editor:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-text-editor){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-text-editor:focus) limel-helper-line,:host(limel-text-editor:focus-visible) limel-helper-line,:host(limel-text-editor:focus-within) limel-helper-line,:host(limel-text-editor:hover) limel-helper-line{will-change:grid-template-rows}:host(limel-text-editor[allow-resize]) limel-prosemirror-adapter{resize:vertical}';export{l as limel_text_editor}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,h as e,H as s}from"./p-BGxJfR2f.js";import{t as r}from"./p-EPnIW0K5.js";import{g as n,a,b as o,c as h}from"./p-BCq5M9TE.js";import{f as l}from"./p-u_sd2HMb.js";import"./p-Bu_YRgCL.js";import"./p-CgNJbSP4.js";const d={id:null,text:null,removable:!0},p=class{constructor(e){i(this,e),this.change=t(this,"change"),this.interact=t(this,"interact"),this.required=!1,this.disabled=!1,this.readonly=!1,this.invalid=!1,this.loading=!1,this.accept="*",this.language="en",this.dropZoneTip=()=>this.getTranslation("file.drag-and-drop-tips"),this.handleNewFiles=i=>{this.preventAndStop(i),this.change.emit(i.detail[0])},this.handleChipSetChange=i=>{i.stopPropagation();const t=0===i.detail.length?i.detail[0]:null;t||this.change.emit(t)},this.handleChipInteract=i=>{this.preventAndStop(i),this.interact.emit(i.detail.id)}}render(){return e(s,{key:"efdeb4e071a7bf484780eb239a1117a0e0fd0472","aria-busy":this.isBusy?"true":"false"},e("limel-file-dropzone",{key:"88d3924f5db23d1f3b07321bc7dc35663feeac8f",disabled:this.disabled||this.readonly||!!this.value,accept:this.accept,onFilesSelected:this.handleNewFiles},this.renderChipset()),this.renderDragAndDropTip(),this.renderSpinner())}get statusText(){var i,t,e;return null!==(e=null===(t=null===(i=this.value)||void 0===i?void 0:i.statusText)||void 0===t?void 0:t.trim())&&void 0!==e?e:""}get isBusy(){var i,t;return this.loading||Boolean(null===(i=this.value)||void 0===i?void 0:i.loading)||void 0!==(null===(t=this.value)||void 0===t?void 0:t.progress)}renderSpinner(){if(this.isBusy)return e("limel-spinner",null)}renderDragAndDropTip(){if(!(this.value||this.disabled||this.readonly||this.isBusy))return e("div",{class:"drag-and-drop-tip"},e("span",{class:"invisible-label-mock",role:"presentation"},this.label),e("span",{class:"tip"},this.dropZoneTip()))}getChipArray(){return this.value?[Object.assign(Object.assign({},d),{text:this.value.filename,id:this.value.id,icon:{name:h(this.value),title:o(this.value),color:a(this.value),backgroundColor:n(this.value)},badge:this.getBadge(),href:this.value.href,menuItems:this.value.menuItems,loading:this.value.loading,progress:this.value.progress,invalid:this.value.invalid})]:[]}getBadge(){return this.statusText?this.statusText:"number"==typeof this.value.size?l(this.value.size):void 0}renderChipset(){const i=e("limel-chip-set",{disabled:this.disabled,readonly:this.readonly,invalid:this.invalid,label:this.label,helperText:this.helperText,leadingIcon:"upload_to_cloud",language:this.language,onChange:this.handleChipSetChange,onInteract:this.handleChipInteract,required:this.required,type:"input",value:this.getChipArray()});return this.value?i:e("limel-file-input",{accept:this.accept,disabled:this.disabled||this.readonly},i)}preventAndStop(i){i.stopPropagation(),i.preventDefault()}getTranslation(i){return r.get(i,this.language)}};p.style='@charset "UTF-8";:host(limel-file){--badge-max-width:auto;position:relative}.drag-and-drop-tip{pointer-events:none;position:absolute;box-sizing:border-box;margin:0.25rem;inset:0;display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;border-radius:0.25rem;border:1px dashed rgb(var(--contrast-700));padding:0 0.5rem}.drag-and-drop-tip .invisible-label-mock{flex-shrink:0;opacity:0;padding-right:1rem;padding-left:1.5rem}.drag-and-drop-tip .tip{font-size:smaller;color:var(--limel-theme-text-secondary-on-background-color);height:auto;max-height:3rem;line-height:1;display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}limel-spinner{pointer-events:none;position:absolute;inset:0 0.375rem 0 auto;margin:auto}';export{p as limel_file}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={Bold:"strong",Italic:"em",Blockquote:"blockquote",HeaderLevel1:"headerlevel1",HeaderLevel2:"headerlevel2",HeaderLevel3:"headerlevel3",Link:"link",OrderedList:"ordered_list",BulletList:"bullet_list",Strikethrough:"strikethrough",Code:"code",CodeBlock:"code_block"},l=Object.values(e),t={Heading:"heading",one:1,two:2,three:3},d={Left:0,Middle:1,Right:2};export{e as E,t as L,d as M,l as e}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
async function n(n,o){const{width:e,height:r,fit:a="cover",type:i="image/jpeg",quality:c=.85,rename:s=n=>t(n,i)}=o,l=await async function(n){var t,o;if("function"==typeof globalThis.createImageBitmap)try{return await globalThis.createImageBitmap(n,{imageOrientation:"from-image"})}catch(n){"production"!==(null===(o=null===(t=globalThis.process)||void 0===t?void 0:t.env)||void 0===o?void 0:o.NODE_ENV)&&"undefined"!=typeof console&&"function"==typeof console.debug&&console.debug("createImageBitmap failed, falling back to HTMLImageElement:",n)}return await async function(n){var t;const o=URL.createObjectURL(n);try{const n=new Image;return n.decoding="sync",n.src=o,await(null===(t=n.decode)||void 0===t?void 0:t.call(n).catch((()=>{}))),n.complete||await new Promise(((t,o)=>{const e=()=>{n.removeEventListener("load",r),n.removeEventListener("error",a)},r=()=>{e(),t()},a=n=>{e(),o(n)};n.addEventListener("load",r),n.addEventListener("error",a)})),n}finally{URL.revokeObjectURL(o)}}(n)}(n),{sx:u,sy:d,sw:f,sh:y,dx:w,dy:g,dw:h,dh:m}=function(n,t,o,e,r){const a=n/t,i=o/e;if("cover"===r){let r,c;return a>i?(c=t,r=t*i):(r=n,c=n/i),{sx:(n-r)/2,sy:(t-c)/2,sw:r,sh:c,dx:0,dy:0,dw:o,dh:e}}let c,s;a>i?(c=o,s=o/a):(s=e,c=e*a);return{sx:0,sy:0,sw:n,sh:t,dx:(o-c)/2,dy:(e-s)/2,dw:c,dh:s}}(l.width,l.height,e,r,a),p=function(n,t){if(function(){try{return"function"==typeof globalThis.OffscreenCanvas}catch(n){return!1}}())return new globalThis.OffscreenCanvas(n,t);const o=document.createElement("canvas");return o.width=n,o.height=t,o}(e,r),v=function(n){const t=n.getContext("2d",{alpha:!0});if(!t)throw new Error("2D canvas context not available");return t}(p);v.clearRect(0,0,e,r),v.drawImage(l,u,d,f,y,w,g,h,m);const b=await function(n,t,o){return"convertToBlob"in n?n.convertToBlob({type:t,quality:o}):new Promise(((e,r)=>{n.toBlob((n=>{n?e(n):r(new Error("Failed to create blob from canvas"))}),t,o)}))}(p,i,c),x=s(n.name);return new File([b],x,{type:i})}function t(n,t){const o="image/png"===t?"png":"jpg",e=n.lastIndexOf(".");return`${e>0?n.slice(0,e):n}.${o}`}export{n as r}
|