@exmg/exm-markdown-editor 0.0.2-alpha.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.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { Validator } from '@material/web/labs/behaviors/validators/validator.js';
7
+ export class MardownEditorValidator extends Validator {
8
+ computeValidity(state) {
9
+ var _a;
10
+ if (!this.inputElement) {
11
+ this.inputElement = state.internalElement;
12
+ }
13
+ if (!this.inputElement) {
14
+ // Lazily create the input element if not existing
15
+ this.inputElement = document.createElement('input');
16
+ this.inputElement.type = 'text';
17
+ }
18
+ // Set values to the input element
19
+ this.inputElement.value = (_a = state.value) !== null && _a !== void 0 ? _a : '';
20
+ this.inputElement.required = state.required;
21
+ return {
22
+ validity: this.inputElement.validity,
23
+ validationMessage: this.inputElement.validationMessage,
24
+ };
25
+ }
26
+ equals(prevState, state) {
27
+ return prevState.value === state.value && prevState.required === state.required;
28
+ }
29
+ copy(state) {
30
+ return {
31
+ ...state,
32
+ };
33
+ }
34
+ }
35
+ //# sourceMappingURL=exm-markdown-editor-validator.js.map
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@exmg/exm-markdown-editor",
3
+ "version": "0.0.2-alpha.0+df24e0c",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "module": "dist/index.js",
8
+ "exports": {
9
+ ".": "./dist/index.js",
10
+ "./exm-markdown-editor.js": "./dist/exm-markdown-editor.js",
11
+ "./exm-markdown-editor-toolbar.js": "./dist/exm-markdown-editor-toolbar.js"
12
+ },
13
+ "description": "Element that wrap-around marked-element to make the markdown editable",
14
+ "contributors": [
15
+ "Ex Machina Group"
16
+ ],
17
+ "keywords": [
18
+ "web-components",
19
+ "typescript",
20
+ "lit",
21
+ "markdown",
22
+ "editor",
23
+ "wysiwyg"
24
+ ],
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git@bitbucket.org:exmachina/exm-web-components.git",
28
+ "directory": "packages/exm-markdown-editor"
29
+ },
30
+ "homepage": "https://bitbucket.org/exmachina/exm-web-components",
31
+ "license": "MIT",
32
+ "files": [
33
+ "**/*.scss",
34
+ "**/*.js",
35
+ "**/*.d.ts"
36
+ ],
37
+ "dependencies": {
38
+ "codemirror": "^5.54.0",
39
+ "marked": "^9.0.0"
40
+ },
41
+ "peerDependencies": {
42
+ "@exmg/lit-base": "^3.0.3",
43
+ "@material/web": "^2.2.0",
44
+ "lit": "^3.2.1",
45
+ "tslib": "^2.6.2"
46
+ },
47
+ "devDependencies": {
48
+ "@types/codemirror": "^0.0.79",
49
+ "@types/marked": "^1.2.2"
50
+ },
51
+ "scripts": {},
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
55
+ "gitHead": "df24e0c74a76a7e1c258f69386036e24e7860256"
56
+ }