@lesjoursfr/edith 0.1.5 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lesjoursfr/edith",
3
- "version": "0.1.5",
3
+ "version": "1.0.0",
4
4
  "description": "Simple WYSIWYG editor.",
5
5
  "license": "MIT",
6
6
  "repository": "lesjoursfr/edith",
@@ -45,40 +45,40 @@
45
45
  "editor"
46
46
  ],
47
47
  "devDependencies": {
48
- "@babel/core": "^7.19.0",
49
- "@babel/preset-env": "^7.19.0",
50
- "@codemirror/lang-html": "^6.1.1",
48
+ "@babel/core": "^7.19.6",
49
+ "@babel/preset-env": "^7.19.4",
50
+ "@codemirror/lang-html": "^6.1.3",
51
51
  "@fortawesome/fontawesome-free": "^6.2.0",
52
52
  "@popperjs/core": "^2.11.6",
53
- "ava": "^4.3.3",
53
+ "ava": "^5.0.1",
54
54
  "babel-loader": "^8.2.5",
55
55
  "codemirror": "^6.0.1",
56
56
  "css-loader": "^6.7.1",
57
- "eslint": "^8.23.0",
57
+ "eslint": "^8.26.0",
58
58
  "eslint-config-prettier": "^8.5.0",
59
59
  "eslint-config-standard": "^17.0.0",
60
60
  "eslint-plugin-import": "^2.26.0",
61
- "eslint-plugin-n": "^15.2.5",
62
- "eslint-plugin-promise": "^6.0.1",
63
- "jsdom": "^20.0.0",
61
+ "eslint-plugin-n": "^15.3.0",
62
+ "eslint-plugin-promise": "^6.1.1",
63
+ "jsdom": "^20.0.1",
64
64
  "mini-css-extract-plugin": "^2.6.1",
65
- "postcss": "^8.4.16",
65
+ "postcss": "^8.4.18",
66
66
  "prettier": "^2.7.1",
67
- "sass": "^1.54.8",
68
- "sass-loader": "^13.0.2",
67
+ "sass": "^1.55.0",
68
+ "sass-loader": "^13.1.0",
69
69
  "style-loader": "^3.3.1",
70
- "stylelint": "^14.11.0",
70
+ "stylelint": "^14.14.0",
71
71
  "stylelint-config-prettier": "^9.0.3",
72
72
  "stylelint-config-sass-guidelines": "^9.0.1",
73
73
  "webpack": "^5.74.0",
74
74
  "webpack-cli": "^4.10.0",
75
- "webpack-dev-server": "^4.10.1"
75
+ "webpack-dev-server": "^4.11.1"
76
76
  },
77
77
  "peerDependencies": {
78
- "@codemirror/lang-html": "^6.1.1",
78
+ "@codemirror/lang-html": "^6.1.3",
79
79
  "@fortawesome/fontawesome-free": "^6.2.0",
80
80
  "@popperjs/core": "^2.11.6",
81
81
  "codemirror": "^6.0.1"
82
82
  },
83
- "packageManager": "yarn@3.2.3"
83
+ "packageManager": "yarn@3.2.4"
84
84
  }
package/src/css/main.scss CHANGED
@@ -167,6 +167,7 @@ $color-modal-submit-border: #0d6efd;
167
167
  position: fixed;
168
168
  top: 20%;
169
169
  width: 400px;
170
+ z-index: 10;
170
171
 
171
172
  .edith-modal-header {
172
173
  border-bottom: 1px solid $color-modal-border;
package/src/ui/editor.js CHANGED
@@ -317,15 +317,15 @@ EdithEditor.prototype.onPasteEvent = function (e) {
317
317
  // Detect style blocs in parents
318
318
  let dest = sel.anchorNode;
319
319
  const style = { B: false, I: false, U: false, S: false, Q: false };
320
- while (!hasClass(dest.parentNode, "edith-visual")) {
321
- // Get the parent
322
- dest = dest.parentNode;
323
-
320
+ while (dest !== null && !hasClass(dest, "edith-visual")) {
324
321
  // Check if it's a style tag
325
322
  if (hasTagName(dest, ["b", "i", "u", "s", "q"])) {
326
323
  // Update the style
327
324
  style[dest.tagName] = true;
328
325
  }
326
+
327
+ // Get the parent
328
+ dest = dest.parentNode;
329
329
  }
330
330
 
331
331
  // We have HTML content