@movable/studio-framework 3.4.1 → 3.5.0-canary.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/dist/index.es.js +26 -22
- package/dist/index.es.js.map +7 -0
- package/dist/index.js +26 -22
- package/package.json +11 -9
package/dist/index.js
CHANGED
|
@@ -1622,6 +1622,7 @@ class StudioTool extends React__default['default'].Component {
|
|
|
1622
1622
|
|
|
1623
1623
|
function trimTextOverflow(element) {
|
|
1624
1624
|
const parentElement = element.parentElement;
|
|
1625
|
+
parentElement.style.overflowWrap = 'break-word';
|
|
1625
1626
|
const parentBox = parentElement.getBoundingClientRect(); // It fits already; no need to resize.
|
|
1626
1627
|
|
|
1627
1628
|
if (!overflowsParent$1(element, parentBox)) {
|
|
@@ -1691,8 +1692,7 @@ function findOverlappingElement(element, parentBox) {
|
|
|
1691
1692
|
|
|
1692
1693
|
function overflowsParent$1(element, parentBox) {
|
|
1693
1694
|
const selfBox = element.getBoundingClientRect();
|
|
1694
|
-
|
|
1695
|
-
return isOutside;
|
|
1695
|
+
return selfBox.bottom > parentBox.bottom;
|
|
1696
1696
|
}
|
|
1697
1697
|
|
|
1698
1698
|
const {
|
|
@@ -2453,37 +2453,40 @@ function getDocumentNode(node) {
|
|
|
2453
2453
|
}
|
|
2454
2454
|
|
|
2455
2455
|
const BASE_STYLE = 'margin: 0px;';
|
|
2456
|
-
function cleanHTML(element) {
|
|
2456
|
+
function cleanHTML(element, format) {
|
|
2457
2457
|
const doc = getDocumentNode(element);
|
|
2458
|
-
const body = doc.body;
|
|
2459
|
-
const html = doc.children[0];
|
|
2460
2458
|
const analytics = doc.querySelector('#mi-data');
|
|
2461
2459
|
const analyticsLength = analytics ? (analytics.getAttribute('data-mi-data') || '').length : 0;
|
|
2462
|
-
const imageRedirect = doc.querySelector('#mi-redirect-image');
|
|
2463
|
-
const newBody = doc.createElement('body');
|
|
2464
|
-
newBody.style.cssText = BASE_STYLE;
|
|
2465
|
-
newBody.appendChild(element);
|
|
2466
2460
|
|
|
2467
2461
|
if (analyticsLength > 500) {
|
|
2468
2462
|
analytics.setAttribute('data-mi-data', '{}');
|
|
2469
2463
|
console.log('extraData trying to be set exceeds 500 characters, setting extraData to be empty to avoid breaking crops');
|
|
2470
2464
|
}
|
|
2471
2465
|
|
|
2472
|
-
if (
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2466
|
+
if (format === 'html') {
|
|
2467
|
+
const body = doc.body;
|
|
2468
|
+
const html = doc.children[0];
|
|
2469
|
+
const imageRedirect = doc.querySelector('#mi-redirect-image');
|
|
2470
|
+
const newBody = doc.createElement('body');
|
|
2471
|
+
newBody.style.cssText = BASE_STYLE;
|
|
2472
|
+
newBody.appendChild(element);
|
|
2476
2473
|
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2474
|
+
if (analytics) {
|
|
2475
|
+
analytics.style.display = 'none';
|
|
2476
|
+
newBody.appendChild(analytics);
|
|
2477
|
+
}
|
|
2481
2478
|
|
|
2482
|
-
|
|
2483
|
-
|
|
2479
|
+
if (imageRedirect) {
|
|
2480
|
+
imageRedirect.style.display = 'none';
|
|
2481
|
+
newBody.appendChild(imageRedirect);
|
|
2482
|
+
}
|
|
2484
2483
|
|
|
2485
|
-
|
|
2486
|
-
scripts
|
|
2484
|
+
html.replaceChild(newBody, body);
|
|
2485
|
+
const scripts = doc.querySelectorAll('script');
|
|
2486
|
+
|
|
2487
|
+
for (let index = 0; index < scripts.length; index++) {
|
|
2488
|
+
scripts[index].remove();
|
|
2489
|
+
}
|
|
2487
2490
|
}
|
|
2488
2491
|
}
|
|
2489
2492
|
|
|
@@ -3109,8 +3112,9 @@ class StudioFramework {
|
|
|
3109
3112
|
}
|
|
3110
3113
|
}
|
|
3111
3114
|
|
|
3115
|
+
cleanHTML(targetElement, format);
|
|
3116
|
+
|
|
3112
3117
|
if (format === 'html') {
|
|
3113
|
-
cleanHTML(targetElement);
|
|
3114
3118
|
addBrowserContent(targetElement);
|
|
3115
3119
|
}
|
|
3116
3120
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@movable/studio-framework",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0-canary.0",
|
|
4
4
|
"description": "A Component library for reactive Studio apps.",
|
|
5
5
|
"author": "Movable Ink",
|
|
6
6
|
"repository": "movableink/studio-framework",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"module": "dist/index.es.js",
|
|
10
10
|
"jsnext:main": "dist/index.es.js",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"test": "tsc && karma start --single-run",
|
|
13
|
-
"develop-test": "karma start --autoWatch true",
|
|
12
|
+
"test": "tsc && npx karma start --single-run",
|
|
13
|
+
"develop-test": "npx karma start --autoWatch true",
|
|
14
14
|
"build": "rollup -c",
|
|
15
15
|
"start": "rollup -c -w",
|
|
16
16
|
"prepublish": "yarn run build"
|
|
@@ -31,18 +31,20 @@
|
|
|
31
31
|
"@babel/preset-react": "^7.14.5",
|
|
32
32
|
"@babel/preset-typescript": "^7.13.0",
|
|
33
33
|
"@movable/eslint-config-react": "^1.0.1",
|
|
34
|
-
"@movable/framework-types": "^3.
|
|
35
|
-
"@movable/studio-framework-test-helpers": "^3.
|
|
34
|
+
"@movable/framework-types": "^3.5.0-canary.0",
|
|
35
|
+
"@movable/studio-framework-test-helpers": "^3.5.0-canary.0",
|
|
36
36
|
"@types/qunit": "^2.11.1",
|
|
37
37
|
"@types/qunit-dom": "^0.7.0",
|
|
38
38
|
"@types/react": "^17.0.6",
|
|
39
39
|
"@types/react-dom": "^17.0.8",
|
|
40
40
|
"cross-env": "^7.0.3",
|
|
41
41
|
"htm": "^3.0.2",
|
|
42
|
-
"karma": "^6.
|
|
42
|
+
"karma": "^6.4.4",
|
|
43
43
|
"karma-chrome-launcher": "^3.1.0",
|
|
44
|
-
"karma-
|
|
45
|
-
"karma-
|
|
44
|
+
"karma-puppeteer-launcher": "^1.0.4",
|
|
45
|
+
"karma-qunit": "^4.2.0",
|
|
46
|
+
"karma-rollup-preprocessor": "^7.0.8",
|
|
47
|
+
"puppeteer": "^22.14.0",
|
|
46
48
|
"qunit": "^2.16.0",
|
|
47
49
|
"react": "^17.0.2",
|
|
48
50
|
"react-dom": "^17.0.2",
|
|
@@ -64,5 +66,5 @@
|
|
|
64
66
|
"volta": {
|
|
65
67
|
"extends": "../../package.json"
|
|
66
68
|
},
|
|
67
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "a1e30a20251fd44185d22a791e0d783ef1f65817"
|
|
68
70
|
}
|