@cocreate/selection 1.5.6 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/demo/index.html +1 -0
- package/docs/index.html +2 -1
- package/package.json +1 -1
- package/src/index.js +6 -6
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# [1.6.0](https://github.com/CoCreate-app/CoCreate-selection/compare/v1.5.7...v1.6.0) (2023-04-24)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* added pwa manifest ([f3dacdf](https://github.com/CoCreate-app/CoCreate-selection/commit/f3dacdf0e5cf79eb1b224df86f9b578ebaee8cd0))
|
7
|
+
|
8
|
+
## [1.5.7](https://github.com/CoCreate-app/CoCreate-selection/compare/v1.5.6...v1.5.7) (2023-04-13)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* replaced substr with substring ([e51f5e6](https://github.com/CoCreate-app/CoCreate-selection/commit/e51f5e631dc6b5d7b0da3de10cc4371227d008b0))
|
14
|
+
|
1
15
|
## [1.5.6](https://github.com/CoCreate-app/CoCreate-selection/compare/v1.5.5...v1.5.6) (2023-04-11)
|
2
16
|
|
3
17
|
|
package/demo/index.html
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
8
|
<link rel="icon" href="https://cdn.cocreate.app/favicon.ico" type="image/ico" sizes="16x16">
|
9
9
|
<title>selection | CoCreateJS</title>
|
10
|
+
<link rel="manifest" href="/manifest.json">
|
10
11
|
</head>
|
11
12
|
|
12
13
|
<body>
|
package/docs/index.html
CHANGED
@@ -12,7 +12,8 @@
|
|
12
12
|
|
13
13
|
<link rel="stylesheet" href="/docs/index.css" collection="files" document_id="60888216117c640e7596303f" name="src" type="text/css" save="true" />
|
14
14
|
|
15
|
-
|
15
|
+
<link rel="manifest" href="/manifest.json" />
|
16
|
+
</head>
|
16
17
|
|
17
18
|
<body>
|
18
19
|
<nav class="nav display:flex align-items:center left:0px background:whitesmoke padding-top:10px padding-bottom:10px" content_id="content" scroll="sticky-nav,hide-nav" scroll-up="10" scroll-down="10" collection="files" document_id="60395ef42b3ac232657040fd" name="src">
|
package/package.json
CHANGED
package/src/index.js
CHANGED
@@ -170,8 +170,8 @@ export function hasSelection(el) {
|
|
170
170
|
|
171
171
|
export function getElementPosition(str, start, end) {
|
172
172
|
let response = {};
|
173
|
-
let startString = str.
|
174
|
-
let endString = str.
|
173
|
+
let startString = str.substring(0, start);
|
174
|
+
let endString = str.substring(start);
|
175
175
|
let angleStart = startString.lastIndexOf("<");
|
176
176
|
let angleEnd = startString.lastIndexOf(">");
|
177
177
|
let endStringAngleEnd = endString.indexOf(">");
|
@@ -205,9 +205,9 @@ export function getElementPosition(str, start, end) {
|
|
205
205
|
let node = str.slice(angleStart, startString.length + endStringAngleEnd + 1);
|
206
206
|
if (node.startsWith("</")) {
|
207
207
|
startNode = node.slice(0, 1) + node.slice(2);
|
208
|
-
startNode = startNode.
|
208
|
+
startNode = startNode.substring(0, startNode.length - 1);
|
209
209
|
nodeStart = startString.lastIndexOf(startNode);
|
210
|
-
let endString1 = str.
|
210
|
+
let endString1 = str.substring(nodeStart);
|
211
211
|
let end = endString1.indexOf(">");
|
212
212
|
nodeEnd = nodeStart + end + 1;
|
213
213
|
type = 'isEndTag';
|
@@ -323,7 +323,7 @@ export function getStringPosition({string, target, position, attribute, property
|
|
323
323
|
}
|
324
324
|
else {
|
325
325
|
start = getElFromString(dom, string, element, 'beforebegin');
|
326
|
-
let elString = string.
|
326
|
+
let elString = string.substring(start);
|
327
327
|
let attrValue = element.getAttribute(attribute);
|
328
328
|
let attrStart = elString.indexOf(` ${attribute}=`);
|
329
329
|
start = start + attrStart;
|
@@ -339,7 +339,7 @@ export function getStringPosition({string, target, position, attribute, property
|
|
339
339
|
if (prop && val){
|
340
340
|
if (attrValue.includes(`${prop}:`)){
|
341
341
|
let propStart = attrValue.indexOf(`${prop}:`);
|
342
|
-
let propString = attrValue.
|
342
|
+
let propString = attrValue.substring(propStart);
|
343
343
|
let propEnd = propString.indexOf(" ");
|
344
344
|
if (propEnd > 0)
|
345
345
|
propString = propString.slice(0, propEnd);
|