@cocreate/selection 1.4.4 → 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## [1.4.7](https://github.com/CoCreate-app/CoCreate-selection/compare/v1.4.6...v1.4.7) (2022-03-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * if insert position is beforeend and the previousSibling is a textnode type=textNode ([031eac5](https://github.com/CoCreate-app/CoCreate-selection/commit/031eac52fdada4eb54675e64a07394a92c616b6e))
7
+ * typo if condition ended with ; and type updated to position for afterbegin ([b916009](https://github.com/CoCreate-app/CoCreate-selection/commit/b91600977f60c43071b06dc66e6ef48ab7fcfc34))
8
+
9
+ ## [1.4.6](https://github.com/CoCreate-app/CoCreate-selection/compare/v1.4.5...v1.4.6) (2022-02-24)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * CoCreate.config replace CoCreate.app with * ([6b1077c](https://github.com/CoCreate-app/CoCreate-selection/commit/6b1077c13ae6d5d7d9d0ad71422e2a4282ccb3f9))
15
+
16
+ ## [1.4.5](https://github.com/CoCreate-app/CoCreate-selection/compare/v1.4.4...v1.4.5) (2022-02-16)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * update dependencies ([076c059](https://github.com/CoCreate-app/CoCreate-selection/commit/076c059e9fd99e77d37458c8f1f614dd6fc8099d))
22
+
1
23
  ## [1.4.4](https://github.com/CoCreate-app/CoCreate-selection/compare/v1.4.3...v1.4.4) (2022-02-10)
2
24
 
3
25
 
@@ -14,7 +14,7 @@ module.exports = {
14
14
  "name": "index.html",
15
15
  "path": "/docs/selection/index.html",
16
16
  "domains": [
17
- "cocreate.app",
17
+ "*",
18
18
  "general.cocreate.app"
19
19
  ],
20
20
  "directory": "/docs/selection",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/selection",
3
- "version": "1.4.4",
3
+ "version": "1.4.7",
4
4
  "description": "A simple selection component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "selection",
@@ -61,8 +61,8 @@
61
61
  "webpack-log": "^3.0.1"
62
62
  },
63
63
  "dependencies": {
64
- "@cocreate/docs": "^1.2.68",
65
- "@cocreate/hosting": "^1.2.63",
66
- "@cocreate/utils": "^1.6.3"
64
+ "@cocreate/docs": "^1.2.69",
65
+ "@cocreate/hosting": "^1.2.64",
66
+ "@cocreate/utils": "^1.6.4"
67
67
  }
68
68
  }
package/src/index.js CHANGED
@@ -188,10 +188,13 @@ export function getElementPosition(str, start, end) {
188
188
  element = insert.target;
189
189
  position = insert.position;
190
190
  type = 'insertAdjacent';
191
- if(!position)
191
+ if (!position)
192
192
  type = 'textNode';
193
- if (type == 'textNode' || type == 'afterbegin');
193
+ if (position == 'beforeend' && findEl.previousSibling && findEl.previousSibling.nodeType == 3 )
194
+ type = 'textNode';
195
+ if (type == 'textNode' || position == 'afterbegin')
194
196
  nodeStart = start - angleEnd - 1;
197
+
195
198
  findEl.remove();
196
199
  }
197
200
  }