@builder.io/react 3.2.11 → 3.2.12
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/CHANGELOG.md +8 -0
- package/README.md +0 -2
- package/dist/builder-react-lite.cjs.js +1 -1
- package/dist/builder-react-lite.esm.js +1 -1
- package/dist/builder-react.browser.js +2 -2
- package/dist/builder-react.browser.js.map +1 -1
- package/dist/builder-react.cjs.js +1 -1
- package/dist/builder-react.cjs.js.map +1 -1
- package/dist/builder-react.es5.js +1 -1
- package/dist/builder-react.es5.js.map +1 -1
- package/dist/builder-react.unpkg.js +2 -2
- package/dist/builder-react.unpkg.js.map +1 -1
- package/dist/lib/package.json +1 -1
- package/dist/lib/src/blocks/Embed.js +0 -26
- package/dist/lib/src/blocks/Embed.js.map +1 -1
- package/package.json +2 -2
- package/src/blocks/Embed.tsx +0 -30
package/dist/lib/package.json
CHANGED
|
@@ -99,32 +99,6 @@ exports.Embed = (0, with_builder_1.withBuilder)(EmbedComponent, {
|
|
|
99
99
|
required: true,
|
|
100
100
|
defaultValue: '',
|
|
101
101
|
helperText: 'e.g. enter a youtube url, google map, etc',
|
|
102
|
-
onChange: function (options) {
|
|
103
|
-
var url = options.get('url');
|
|
104
|
-
if (url) {
|
|
105
|
-
options.set('content', 'Loading...');
|
|
106
|
-
// TODO: get this out of here!
|
|
107
|
-
var apiKey = _iframelyApiKey;
|
|
108
|
-
return fetch("https://iframe.ly/api/iframely?url=".concat(url, "&api_key=").concat(apiKey))
|
|
109
|
-
.then(function (res) { return res.json(); })
|
|
110
|
-
.then(function (data) {
|
|
111
|
-
if (options.get('url') === url) {
|
|
112
|
-
if (data.html) {
|
|
113
|
-
options.set('content', data.html);
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
options.set('content', 'Invalid url, please try another');
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
.catch(function (err) {
|
|
121
|
-
options.set('content', 'There was an error embedding this URL, please try again or another URL');
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
options.delete('content');
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
102
|
},
|
|
129
103
|
{
|
|
130
104
|
name: 'content',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Embed.js","sourceRoot":"","sources":["../../../../src/blocks/Embed.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;AACb,gDAA0B;AAC1B,uCAA0C;AAC1C,0DAAwD;
|
|
1
|
+
{"version":3,"file":"Embed.js","sourceRoot":"","sources":["../../../../src/blocks/Embed.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;AACb,gDAA0B;AAC1B,uCAA0C;AAC1C,0DAAwD;AAExD;IAA6B,kCAAoB;IAAjD;QAAA,qEAgEC;QA/DC,gBAAU,GAAuB,IAAI,CAAC;QAEtC,qBAAe,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5B,gBAAU,GAAG,IAAI,GAAG,EAAE,CAAC;;IA4DzB,CAAC;IA1DC,2CAAkB,GAAlB,UAAmB,SAAc;QAC/B,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,OAAO,EAAE;YAC5C,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAC1B;IACH,CAAC;IAED,0CAAiB,GAAjB;QACE,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IAED,0CAAiB,GAAjB;QACE,IAAI,IAAI,CAAC,UAAU,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACpD,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;YAC/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACvC,IAAM,MAAM,GAAG,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GAAG,IAAI,OAAA,CAAC,KAAI,CAAC,UAAU,GAAG,GAAG,CAAC,EAAvB,CAAuB,EACnC,SAAS,EAAC,eAAe,EACzB,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,GACjD,CACH,CAAC;IACJ,CAAC;IACH,qBAAC;AAAD,CAAC,AAhED,CAA6B,eAAK,CAAC,SAAS,GAgE3C;AAEY,QAAA,KAAK,GAAG,IAAA,0BAAW,EAAC,cAAc,EAAE;IAC/C,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE;QACN;YACE,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,2CAA2C;SACxD;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,MAAM;YACZ,YAAY,EAAE,6EAA2E;YACzF,UAAU,EAAE,IAAI;SACjB;KACF;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/react",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "dist/builder-react.cjs.js",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"react-dom": ">=16.8.0"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
-
"@builder.io/sdk": "2.2.
|
|
101
|
+
"@builder.io/sdk": "2.2.6",
|
|
102
102
|
"@emotion/core": "^10.0.17",
|
|
103
103
|
"hash-sum": "^2.0.0",
|
|
104
104
|
"isolated-vm": "^5.0.0",
|
package/src/blocks/Embed.tsx
CHANGED
|
@@ -3,9 +3,6 @@ import React from 'react';
|
|
|
3
3
|
import { Builder } from '@builder.io/sdk';
|
|
4
4
|
import { withBuilder } from '../functions/with-builder';
|
|
5
5
|
|
|
6
|
-
// Provided by the web app as a local variable in onChange functions
|
|
7
|
-
declare const _iframelyApiKey: string;
|
|
8
|
-
|
|
9
6
|
class EmbedComponent extends React.Component<any> {
|
|
10
7
|
elementRef: HTMLElement | null = null;
|
|
11
8
|
|
|
@@ -82,33 +79,6 @@ export const Embed = withBuilder(EmbedComponent, {
|
|
|
82
79
|
required: true,
|
|
83
80
|
defaultValue: '',
|
|
84
81
|
helperText: 'e.g. enter a youtube url, google map, etc',
|
|
85
|
-
onChange(options: Map<string, any>) {
|
|
86
|
-
const url = options.get('url');
|
|
87
|
-
if (url) {
|
|
88
|
-
options.set('content', 'Loading...');
|
|
89
|
-
// TODO: get this out of here!
|
|
90
|
-
const apiKey = _iframelyApiKey;
|
|
91
|
-
return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`)
|
|
92
|
-
.then(res => res.json())
|
|
93
|
-
.then(data => {
|
|
94
|
-
if (options.get('url') === url) {
|
|
95
|
-
if (data.html) {
|
|
96
|
-
options.set('content', data.html);
|
|
97
|
-
} else {
|
|
98
|
-
options.set('content', 'Invalid url, please try another');
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
.catch(err => {
|
|
103
|
-
options.set(
|
|
104
|
-
'content',
|
|
105
|
-
'There was an error embedding this URL, please try again or another URL'
|
|
106
|
-
);
|
|
107
|
-
});
|
|
108
|
-
} else {
|
|
109
|
-
options.delete('content');
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
82
|
},
|
|
113
83
|
{
|
|
114
84
|
name: 'content',
|