@limetech/lime-elements 39.44.0 → 39.44.2
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 +15 -0
- package/dist/cjs/{files-Bt11HLi4.js → files-DI4jItxi.js} +5 -2
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-form.cjs.entry.js +55 -2
- package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +10807 -10738
- package/dist/collection/components/text-editor/prosemirror-adapter/editor-config.js +75 -0
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +52 -51
- package/dist/collection/util/files.js +5 -2
- package/dist/esm/{files-CZAZotms.js → files-DnkFEKoB.js} +5 -2
- package/dist/esm/limel-file-dropzone_2.entry.js +1 -1
- package/dist/esm/limel-form.entry.js +55 -2
- package/dist/esm/limel-profile-picture.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +10807 -10738
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-49f810e0.entry.js +1 -0
- package/dist/lime-elements/{p-8893e1df.entry.js → p-6722e6e2.entry.js} +1 -1
- package/dist/lime-elements/{p-09fb0765.entry.js → p-68eda654.entry.js} +1 -1
- package/dist/lime-elements/{p-C4caLnTg.js → p-CGVVDGcv.js} +1 -1
- package/dist/lime-elements/{p-92ea6adc.entry.js → p-ea34a4bc.entry.js} +1 -1
- package/dist/types/components/text-editor/prosemirror-adapter/editor-config.d.ts +60 -0
- package/dist/types/components/text-editor/prosemirror-adapter/prosemirror-adapter.d.ts +3 -1
- package/dist/types/components.d.ts +5 -3
- package/dist/types/util/link-helper.d.ts +1 -1
- package/package.json +4 -2
- package/dist/lime-elements/p-b3b1ae38.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as n,a as t,b as o,c as r}from"./p-BCq5M9TE.js";function e(e){const i={id:crypto.randomUUID(),filename:e.name,contentType:e.type,size:e.size,fileContent:e};return i.icon={name:r(i),title:o(i),color:t(i),backgroundColor:n(i)},i}function i(n,t){return void 0===t||"*"===t||t.split(",").map((n=>n.trim())).some((t=>{if(t===n.contentType)return!0;if(t.endsWith("/*")){const o=t.split("/")[0];return n.contentType.startsWith(`${o}/`)}
|
|
1
|
+
import{g as n,a as t,b as o,c as r}from"./p-BCq5M9TE.js";function e(e){const i={id:crypto.randomUUID(),filename:e.name,contentType:e.type,size:e.size,fileContent:e};return i.icon={name:r(i),title:o(i),color:t(i),backgroundColor:n(i)},i}function i(n,t){return void 0===t||"*"===t||t.split(",").map((n=>n.trim())).some((t=>{if(t===n.contentType)return!0;if(t.endsWith("/*")){const o=t.split("/")[0];return n.contentType.startsWith(`${o}/`)}return t.startsWith(".")?n.filename.toLowerCase().endsWith(t.toLowerCase()):void 0}))}export{e as c,i}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,a as r}from"./p-BGxJfR2f.js";import{c as o,i as a}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s,H as e,a as r}from"./p-BGxJfR2f.js";import{c as o,i as a}from"./p-CGVVDGcv.js";import{a as n}from"./p-DtrvybFR.js";import{c}from"./p-BE1Efiuj.js";import{i as h}from"./p-B8VKuhvH.js";import{c as l}from"./p-JbKhhoXs.js";import"./p-BCq5M9TE.js";import"./p-Bu_YRgCL.js";import"./p-CgNJbSP4.js";import"./p-mmkVLOjW.js";import"./p-CZ30nDJE.js";import"./p-D4RdItCq.js";import"./p-BJQylLSL.js";import"./p-oiMYqRQ0.js";import"./p-BYfPV0O4.js";import"./p-BcJ-TDVt.js";import"./p-DbBZn7JO.js";import"./p-B--C3qwe.js";import"./p-BOEi1C7r.js";import"./p-CK4jS9_E.js";function p(t,i,s,e){for(var r=-1,o=null==t?0:t.length;++r<o;){var a=t[r];i(e,a,s(a),t)}return e}function f(t,i,s,e){return n(t,(function(t,r,o){i(e,t,s(t),o)})),e}var d,m,b=(d=function(t,i,s){t[s?0:1].push(i)},m=function(){return[[],[]]},function(t,i){var s=h(t)?p:f,e=m?[[],[]]:{};return s(t,d,c(i),e)});const u=class{constructor(e){t(this,e),this.filesSelected=i(this,"filesSelected"),this.filesRejected=i(this,"filesRejected"),this.accept="*",this.disabled=!1,this.helperText="",this.hasFileToDrop=!1,this.renderOnDragLayout=()=>{if(!this.disabled&&this.hasFileToDrop)return s("div",{class:"has-file-to-drop"},s("limel-icon",{class:"icon",name:"upload_2"}),s("div",{class:"text-helpertext"},this.renderText(),this.renderHelperText()))},this.renderText=()=>{if(this.text)return s("span",{class:"text"},this.text)},this.renderHelperText=()=>{if(this.helperText)return s("span",{class:"helper-text"},this.helperText)},this.handleDrop=t=>{if(t.stopPropagation(),t.preventDefault(),this.hasFileToDrop=!1,this.disabled)return;const i=[...t.dataTransfer.files].map(o),[s,e]=b(i,(t=>a(t,this.accept)));s.length>0&&this.filesSelected.emit(s),e.length>0&&this.filesRejected.emit(e)},this.handleDragOver=t=>{this.hasFileToDrop=!0,t.preventDefault()},this.handleDragLeave=t=>{this.hasFileToDrop=!1,t.preventDefault()}}render(){return s(e,{key:"5143c9cda4ccbcd0c34bb55fb7f8eb6b9d028863",onDrop:this.handleDrop,onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave},s("slot",{key:"c283ffdb9838d4cee80842127360303f77a6de39"}),this.renderOnDragLayout())}};u.style=":host(limel-file-dropzone){display:block;position:relative}.has-file-to-drop{animation:display-drop-zone 0.6s ease forwards;box-sizing:border-box;isolation:isolate;z-index:1;position:absolute;inset:0.25rem;overflow:hidden;display:flex;justify-content:center;align-items:center;gap:0.5rem;color:rgb(var(--contrast-700));border:0.125rem dashed rgb(var(--color-cyan-light));border-radius:0.75rem}.text-helpertext{display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.icon{width:clamp(2rem, 5vh, 7rem)}.text{font-size:clamp(1rem, 2vh, 1.75rem)}.helper-text{font-size:clamp(0.75rem, 1.5vh, 1rem)}@keyframes display-drop-zone{0%{background-color:rgb(var(--contrast-1100), 0);backdrop-filter:blur(0);-webkit-backdrop-filter:blur(0);scale:0.9;opacity:0}50%{scale:1;opacity:1}100%{background-color:rgb(var(--contrast-1100), 0.8);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem)}}";const j=class{constructor(s){t(this,s),this.filesSelected=i(this,"filesSelected"),this.accept="*",this.disabled=!1,this.multiple=!1,this.fileInputId=l(),this.handleClick=t=>{if(this.disabled)return t.stopPropagation(),void t.preventDefault();this.triggerFileDialog(),t.stopPropagation()},this.handleKeyUp=t=>{t.stopPropagation(),t.preventDefault(),"Enter"===t.code&&this.triggerFileDialog()},this.handleFileChange=t=>{const i=[...this.fileInput.files];i.length>0&&(t.stopPropagation(),this.filesSelected.emit(i.map(o)),this.fileInput.value="")}}componentDidLoad(){this.fileInput=this.element.shadowRoot.getElementById(this.fileInputId)}render(){return s(e,{key:"4746b407c045a406385f4b26b7a82298a37c7fca",onClick:this.handleClick,onKeyUp:this.handleKeyUp,onKeyDown:this.handleKeyDown},s("input",{key:"b599d3a8d60802f0977c2ffc12f14975a7a8d4f0",hidden:!0,id:this.fileInputId,onChange:this.handleFileChange,type:"file",accept:this.accept,disabled:this.disabled,multiple:this.multiple}),s("slot",{key:"4e526023fd5287a112708d2012cc9b897facb93b"}))}handleKeyDown(t){"Tab"!==t.code&&"Backspace"!==t.code&&"Enter"!==t.code&&(t.preventDefault(),t.stopPropagation())}triggerFileDialog(){this.fileInput.click()}get element(){return r(this)}};export{u as limel_file_dropzone,j as limel_file_input}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Plugin } from 'prosemirror-state';
|
|
2
|
+
import { Schema } from 'prosemirror-model';
|
|
3
|
+
import { MenuCommandFactory } from './menu/menu-commands';
|
|
4
|
+
import { createLinkPlugin } from './plugins/link/link-plugin';
|
|
5
|
+
import { createImageInserterPlugin } from './plugins/image/inserter';
|
|
6
|
+
import { createMenuStateTrackingPlugin } from './plugins/menu-state-tracking-plugin';
|
|
7
|
+
import { ContentTypeConverter } from '../utils/content-type-converter';
|
|
8
|
+
import { CustomElementDefinition } from '../../../global/shared-types/custom-element.types';
|
|
9
|
+
import { Languages } from '../../date-picker/date.types';
|
|
10
|
+
import { TriggerCharacter, InlineImages } from '../text-editor.types';
|
|
11
|
+
/**
|
|
12
|
+
* Content format the text editor reads and emits.
|
|
13
|
+
*
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
export type ContentType = 'markdown' | 'html';
|
|
17
|
+
export interface EditorSchemaOptions {
|
|
18
|
+
customElements: CustomElementDefinition[];
|
|
19
|
+
contentType: ContentType;
|
|
20
|
+
language: Languages;
|
|
21
|
+
inlineImages?: InlineImages;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Builds the ProseMirror schema used by the text editor.
|
|
25
|
+
*
|
|
26
|
+
* This is the single source of truth for the editor's schema: the
|
|
27
|
+
* `limel-prosemirror-adapter` component and any test that needs the real
|
|
28
|
+
* schema both call this, so the two can never drift apart.
|
|
29
|
+
*
|
|
30
|
+
* @param options - schema configuration derived from the editor's props
|
|
31
|
+
* @returns the configured ProseMirror schema
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildEditorSchema(options: EditorSchemaOptions): Schema;
|
|
34
|
+
export interface EditorPluginsOptions {
|
|
35
|
+
schema: Schema;
|
|
36
|
+
menuCommandFactory: MenuCommandFactory;
|
|
37
|
+
contentConverter: ContentTypeConverter;
|
|
38
|
+
language: Languages;
|
|
39
|
+
contentType: ContentType;
|
|
40
|
+
triggerCharacters: TriggerCharacter[];
|
|
41
|
+
inlineImages?: InlineImages;
|
|
42
|
+
onNewLinkSelection: Parameters<typeof createLinkPlugin>[0];
|
|
43
|
+
onImagePasted: Parameters<typeof createImageInserterPlugin>[0];
|
|
44
|
+
onActiveItemsChange: Parameters<typeof createMenuStateTrackingPlugin>[2];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Builds the ordered list of ProseMirror plugins used by the text editor.
|
|
48
|
+
*
|
|
49
|
+
* Plugin order is significant: ProseMirror resolves event props
|
|
50
|
+
* (`handlePaste`, `handleDOMEvents`, `handleKeyDown`) by calling plugins in
|
|
51
|
+
* this order and stopping at the first that returns a truthy value, and it
|
|
52
|
+
* chains `appendTransaction` in this order. Changing the order changes
|
|
53
|
+
* behavior. Callbacks the plugins need are injected so this can be built
|
|
54
|
+
* outside the component (e.g. in tests).
|
|
55
|
+
*
|
|
56
|
+
* @param options - the schema, command factory, converter and plugin callbacks
|
|
57
|
+
* @returns the ordered plugin list
|
|
58
|
+
*/
|
|
59
|
+
export declare function buildEditorPlugins(options: EditorPluginsOptions): Plugin[];
|
|
60
|
+
//# sourceMappingURL=editor-config.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Languages } from '../../date-picker/date.types';
|
|
2
2
|
import { CustomElementDefinition } from '../../../global/shared-types/custom-element.types';
|
|
3
3
|
import { TriggerCharacter, InlineImages } from '../text-editor.types';
|
|
4
|
+
import { ContentType } from './editor-config';
|
|
4
5
|
import { EditorUiType } from '../types';
|
|
5
6
|
/**
|
|
6
7
|
* The ProseMirror adapter offers a rich text editing experience with markdown support.
|
|
@@ -17,7 +18,7 @@ export declare class ProsemirrorAdapter {
|
|
|
17
18
|
*
|
|
18
19
|
* Assumed to be set only once, so not reactive to changes
|
|
19
20
|
*/
|
|
20
|
-
contentType:
|
|
21
|
+
contentType: ContentType;
|
|
21
22
|
/**
|
|
22
23
|
* The value of the editor, expected to be markdown
|
|
23
24
|
*/
|
|
@@ -88,6 +89,7 @@ export declare class ProsemirrorAdapter {
|
|
|
88
89
|
private changeWaiting;
|
|
89
90
|
private transactionFired;
|
|
90
91
|
private lastClickedPos;
|
|
92
|
+
private focusRestoreTimeout;
|
|
91
93
|
private metadata;
|
|
92
94
|
/**
|
|
93
95
|
* Used to stop change event emitting as result of getting updated value from consumer
|
|
@@ -44,6 +44,7 @@ import { PickerItem } from "./components/picker/picker-item.types";
|
|
|
44
44
|
import { Searcher } from "./components/picker/searcher.types";
|
|
45
45
|
import { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
|
|
46
46
|
import { FlowItem } from "./components/progress-flow/progress-flow.types";
|
|
47
|
+
import { ContentType } from "./components/text-editor/prosemirror-adapter/editor-config";
|
|
47
48
|
import { EditorImage, EditorMetadata, ImageInserter, InlineImages, TriggerCharacter, TriggerEventDetail } from "./components/text-editor/text-editor.types";
|
|
48
49
|
import { EditorUiType } from "./components/text-editor/types";
|
|
49
50
|
import { Option } from "./components/select/option.types";
|
|
@@ -91,6 +92,7 @@ export { PickerItem } from "./components/picker/picker-item.types";
|
|
|
91
92
|
export { Searcher } from "./components/picker/searcher.types";
|
|
92
93
|
export { ActionPosition, ActionScrollBehavior } from "./components/picker/actions.types";
|
|
93
94
|
export { FlowItem } from "./components/progress-flow/progress-flow.types";
|
|
95
|
+
export { ContentType } from "./components/text-editor/prosemirror-adapter/editor-config";
|
|
94
96
|
export { EditorImage, EditorMetadata, ImageInserter, InlineImages, TriggerCharacter, TriggerEventDetail } from "./components/text-editor/text-editor.types";
|
|
95
97
|
export { EditorUiType } from "./components/text-editor/types";
|
|
96
98
|
export { Option } from "./components/select/option.types";
|
|
@@ -3192,7 +3194,7 @@ export namespace Components {
|
|
|
3192
3194
|
* The type of content that the editor should handle and emit, defaults to `markdown` Assumed to be set only once, so not reactive to changes
|
|
3193
3195
|
* @default 'markdown'
|
|
3194
3196
|
*/
|
|
3195
|
-
"contentType":
|
|
3197
|
+
"contentType": ContentType;
|
|
3196
3198
|
/**
|
|
3197
3199
|
* set to private to avoid usage while under development
|
|
3198
3200
|
* @private
|
|
@@ -9912,7 +9914,7 @@ declare namespace LocalJSX {
|
|
|
9912
9914
|
* The type of content that the editor should handle and emit, defaults to `markdown` Assumed to be set only once, so not reactive to changes
|
|
9913
9915
|
* @default 'markdown'
|
|
9914
9916
|
*/
|
|
9915
|
-
"contentType"?:
|
|
9917
|
+
"contentType"?: ContentType;
|
|
9916
9918
|
/**
|
|
9917
9919
|
* set to private to avoid usage while under development
|
|
9918
9920
|
* @private
|
|
@@ -11350,7 +11352,7 @@ declare namespace LocalJSX {
|
|
|
11350
11352
|
"currentStep": boolean;
|
|
11351
11353
|
}
|
|
11352
11354
|
interface LimelProsemirrorAdapterAttributes {
|
|
11353
|
-
"contentType":
|
|
11355
|
+
"contentType": ContentType;
|
|
11354
11356
|
"value": string;
|
|
11355
11357
|
"language": Languages;
|
|
11356
11358
|
"disabled": boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/lime-elements",
|
|
3
|
-
"version": "39.44.
|
|
3
|
+
"version": "39.44.2",
|
|
4
4
|
"description": "Lime Elements",
|
|
5
5
|
"author": "Lime Technologies",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"api:update": "npm run build && node scripts/fix-tsdoc-tags.cjs && api-extractor run --local --verbose",
|
|
22
22
|
"api:verify": "(shx test -f src/components.d.ts || (npm run build && npm run build)) && node scripts/fix-tsdoc-tags.cjs && api-extractor run",
|
|
23
23
|
"build": "cross-env-shell NODE_ENV=prod SASS_PATH=node_modules \"stencil build --config stencil.config.dist.ts\"",
|
|
24
|
+
"clean": "shx rm -rf .stencil dist www",
|
|
24
25
|
"dev": "cross-env-shell SASS_PATH=node_modules \"stencil build --dev --docs\"",
|
|
25
26
|
"watch": "cross-env-shell SASS_PATH=node_modules \"stencil build --dev --watch --docs --serve\"",
|
|
26
27
|
"watch:prod": "shx rm -rf www/ && cross-env-shell SASS_PATH=node_modules \"stencil build --watch\"",
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
"@types/react": "^19.2.16",
|
|
70
71
|
"@types/react-dom": "^19.2.3",
|
|
71
72
|
"@types/tabulator-tables": "^6.3.3",
|
|
72
|
-
"@vitest/browser-playwright": "^4.1.
|
|
73
|
+
"@vitest/browser-playwright": "^4.1.10",
|
|
73
74
|
"axe-core": "4.12.0",
|
|
74
75
|
"codemirror": "^5.65.9",
|
|
75
76
|
"cross-env": "^10.1.0",
|
|
@@ -96,6 +97,7 @@
|
|
|
96
97
|
"prosemirror-model": ">=1.22.1",
|
|
97
98
|
"prosemirror-schema-basic": "^1.2.4",
|
|
98
99
|
"prosemirror-tables": "^1.8.5",
|
|
100
|
+
"prosemirror-test-builder": "^1.1.1",
|
|
99
101
|
"react": "^19.2.7",
|
|
100
102
|
"react-dom": "^19.2.7",
|
|
101
103
|
"rehype-parse": "^9.0.1",
|