@limetech/lime-elements 39.44.1 → 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.
@@ -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: 'markdown' | 'html';
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": 'markdown' | 'html';
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"?: 'markdown' | 'html';
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": 'markdown' | 'html';
11355
+ "contentType": ContentType;
11354
11356
  "value": string;
11355
11357
  "language": Languages;
11356
11358
  "disabled": boolean;
@@ -7,7 +7,7 @@ export declare function getHref(value: string): string;
7
7
  *
8
8
  * @param value
9
9
  */
10
- export declare function getTarget(value: string): "_self" | "_blank";
10
+ export declare function getTarget(value: string): "_blank" | "_self";
11
11
  /**
12
12
  *
13
13
  * @param input
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "39.44.1",
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.8",
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",