@limetech/lime-elements 39.40.0 → 39.41.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/index.cjs.js +2 -1
  3. package/dist/cjs/lime-elements.cjs.js +1 -1
  4. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +440 -212
  5. package/dist/cjs/limel-text-editor.cjs.entry.js +2 -2
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{types-Bu6wcdI0.js → types-C7gNcwzE.js} +12 -0
  8. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/inserter.js +101 -30
  9. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/node.js +160 -54
  10. package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/view.js +6 -1
  11. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +51 -5
  12. package/dist/collection/components/text-editor/text-editor.js +33 -3
  13. package/dist/collection/components/text-editor/text-editor.types.js +10 -1
  14. package/dist/collection/components/text-editor/utils/content-type-converter.js +30 -1
  15. package/dist/collection/components/text-editor/utils/html-converter.js +4 -2
  16. package/dist/collection/components/text-editor/utils/markdown-converter.js +9 -5
  17. package/dist/esm/index.js +1 -1
  18. package/dist/esm/lime-elements.js +1 -1
  19. package/dist/esm/limel-prosemirror-adapter.entry.js +440 -212
  20. package/dist/esm/limel-text-editor.entry.js +2 -2
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm/{types-BWYo6dLf.js → types-C_Yu8dOg.js} +12 -1
  23. package/dist/lime-elements/index.esm.js +1 -1
  24. package/dist/lime-elements/lime-elements.esm.js +1 -1
  25. package/dist/lime-elements/p-1f35fc44.entry.js +1 -0
  26. package/dist/lime-elements/p-56781dc7.entry.js +1 -0
  27. package/dist/lime-elements/p-C_Yu8dOg.js +1 -0
  28. package/dist/types/components/text-editor/prosemirror-adapter/plugins/image/inserter.d.ts +2 -2
  29. package/dist/types/components/text-editor/prosemirror-adapter/plugins/image/node.d.ts +41 -19
  30. package/dist/types/components/text-editor/prosemirror-adapter/prosemirror-adapter.d.ts +13 -1
  31. package/dist/types/components/text-editor/text-editor.d.ts +10 -2
  32. package/dist/types/components/text-editor/text-editor.types.d.ts +52 -0
  33. package/dist/types/components/text-editor/utils/content-type-converter.d.ts +12 -0
  34. package/dist/types/components/text-editor/utils/html-converter.d.ts +3 -1
  35. package/dist/types/components/text-editor/utils/markdown-converter.d.ts +3 -1
  36. package/dist/types/components.d.ts +30 -6
  37. package/package.json +1 -1
  38. package/dist/lime-elements/p-366419ee.entry.js +0 -1
  39. package/dist/lime-elements/p-BWYo6dLf.js +0 -1
  40. package/dist/lime-elements/p-b7d734d2.entry.js +0 -1
@@ -0,0 +1 @@
1
+ function e(e){return"tagName"in e}const t={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(t),o={Heading:"heading",one:1,two:2,three:3},d={Left:0,Middle:1,Right:2};export{t as E,o as L,d as M,l as e,e as i}
@@ -1,10 +1,10 @@
1
1
  import { Plugin, PluginKey } from 'prosemirror-state';
2
2
  import { EditorView } from 'prosemirror-view';
3
3
  import { FileInfo } from '../../../../../global/shared-types/file.types';
4
- import { ImageInserter } from '../../../text-editor.types';
4
+ import { ImageInserter, InlineImages } from '../../../text-editor.types';
5
5
  export declare const pluginKey: PluginKey<any>;
6
6
  type ImagePastedCallback = (data: ImageInserter) => CustomEvent<ImageInserter>;
7
- export declare const createImageInserterPlugin: (imagePastedCallback: ImagePastedCallback) => Plugin<any>;
7
+ export declare const createImageInserterPlugin: (imagePastedCallback: ImagePastedCallback, inlineImages?: InlineImages) => Plugin<any>;
8
8
  export declare const imageInserterFactory: (view: EditorView, base64Data: string, fileInfo: FileInfo) => ImageInserter;
9
9
  export {};
10
10
  //# sourceMappingURL=inserter.d.ts.map
@@ -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
- * any of its child nodes is an image node.
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
- constructor(plugins: CustomElementDefinition[]);
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
- constructor(plugins: CustomElementDefinition[], language: Languages);
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
  }
@@ -44,7 +44,7 @@ import { Searcher } from "./components/picker/searcher.types";
44
44
  import { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
45
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";
@@ -91,7 +91,7 @@ export { Searcher } from "./components/picker/searcher.types";
91
91
  export { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
92
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";
@@ -3199,6 +3199,12 @@ export namespace Components {
3199
3199
  * Emits any pending debounced `change` event immediately. Does nothing if no change is pending.
3200
3200
  */
3201
3201
  "flushPendingChanges": () => Promise<void>;
3202
+ /**
3203
+ * 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`).
3204
+ * @private
3205
+ * @alpha
3206
+ */
3207
+ "inlineImages"?: InlineImages;
3202
3208
  /**
3203
3209
  * Defines the language for translations.
3204
3210
  */
@@ -3810,8 +3816,8 @@ export namespace Components {
3810
3816
  * @exampleComponent limel-example-text-editor-with-markdown
3811
3817
  * @exampleComponent limel-example-text-editor-with-html
3812
3818
  * @exampleComponent limel-example-text-editor-with-tables
3813
- * @exampleComponent limel-example-text-editor-with-inline-images-file-storage
3814
3819
  * @exampleComponent limel-example-text-editor-with-inline-images-base64
3820
+ * @exampleComponent limel-example-text-editor-with-inline-images-custom-tag
3815
3821
  * @exampleComponent limel-example-text-editor-allow-resize
3816
3822
  * @exampleComponent limel-example-text-editor-size
3817
3823
  * @exampleComponent limel-example-text-editor-ui
@@ -3855,6 +3861,12 @@ export namespace Components {
3855
3861
  * Optional helper text to display below the input field when it has focus
3856
3862
  */
3857
3863
  "helperText"?: string;
3864
+ /**
3865
+ * Configures inline image support: the editor owns the paste lifecycle and resize, the consumer owns upload, storage format, and URL resolution.
3866
+ * @private
3867
+ * @alpha
3868
+ */
3869
+ "inlineImages"?: InlineImages;
3858
3870
  /**
3859
3871
  * Set to `true` to indicate that the current value of the editor is invalid.
3860
3872
  * @default false
@@ -6420,8 +6432,8 @@ declare global {
6420
6432
  * @exampleComponent limel-example-text-editor-with-markdown
6421
6433
  * @exampleComponent limel-example-text-editor-with-html
6422
6434
  * @exampleComponent limel-example-text-editor-with-tables
6423
- * @exampleComponent limel-example-text-editor-with-inline-images-file-storage
6424
6435
  * @exampleComponent limel-example-text-editor-with-inline-images-base64
6436
+ * @exampleComponent limel-example-text-editor-with-inline-images-custom-tag
6425
6437
  * @exampleComponent limel-example-text-editor-allow-resize
6426
6438
  * @exampleComponent limel-example-text-editor-size
6427
6439
  * @exampleComponent limel-example-text-editor-ui
@@ -9889,6 +9901,12 @@ declare namespace LocalJSX {
9889
9901
  * @default false
9890
9902
  */
9891
9903
  "disabled"?: boolean;
9904
+ /**
9905
+ * 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`).
9906
+ * @private
9907
+ * @alpha
9908
+ */
9909
+ "inlineImages"?: InlineImages;
9892
9910
  /**
9893
9911
  * Defines the language for translations.
9894
9912
  */
@@ -10585,8 +10603,8 @@ declare namespace LocalJSX {
10585
10603
  * @exampleComponent limel-example-text-editor-with-markdown
10586
10604
  * @exampleComponent limel-example-text-editor-with-html
10587
10605
  * @exampleComponent limel-example-text-editor-with-tables
10588
- * @exampleComponent limel-example-text-editor-with-inline-images-file-storage
10589
10606
  * @exampleComponent limel-example-text-editor-with-inline-images-base64
10607
+ * @exampleComponent limel-example-text-editor-with-inline-images-custom-tag
10590
10608
  * @exampleComponent limel-example-text-editor-allow-resize
10591
10609
  * @exampleComponent limel-example-text-editor-size
10592
10610
  * @exampleComponent limel-example-text-editor-ui
@@ -10622,6 +10640,12 @@ declare namespace LocalJSX {
10622
10640
  * Optional helper text to display below the input field when it has focus
10623
10641
  */
10624
10642
  "helperText"?: string;
10643
+ /**
10644
+ * Configures inline image support: the editor owns the paste lifecycle and resize, the consumer owns upload, storage format, and URL resolution.
10645
+ * @private
10646
+ * @alpha
10647
+ */
10648
+ "inlineImages"?: InlineImages;
10625
10649
  /**
10626
10650
  * Set to `true` to indicate that the current value of the editor is invalid.
10627
10651
  * @default false
@@ -12813,8 +12837,8 @@ declare module "@stencil/core" {
12813
12837
  * @exampleComponent limel-example-text-editor-with-markdown
12814
12838
  * @exampleComponent limel-example-text-editor-with-html
12815
12839
  * @exampleComponent limel-example-text-editor-with-tables
12816
- * @exampleComponent limel-example-text-editor-with-inline-images-file-storage
12817
12840
  * @exampleComponent limel-example-text-editor-with-inline-images-base64
12841
+ * @exampleComponent limel-example-text-editor-with-inline-images-custom-tag
12818
12842
  * @exampleComponent limel-example-text-editor-allow-resize
12819
12843
  * @exampleComponent limel-example-text-editor-size
12820
12844
  * @exampleComponent limel-example-text-editor-ui
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "39.40.0",
3
+ "version": "39.41.0",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -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
- 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}