@ones-editor/editor 2.8.15-beta.1 → 2.8.15-beta.2
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/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +12 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -88286,21 +88286,27 @@ ${data2.plantumlText}
|
|
|
88286
88286
|
};
|
|
88287
88287
|
class FigmaAnalyzer {
|
|
88288
88288
|
constructor() {
|
|
88289
|
-
__publicField(this, "regex", /https:\/\/([\w.-]+\.)?figma.com
|
|
88289
|
+
__publicField(this, "regex", /https:\/\/([\w.-]+\.)?figma.com\/.*$/i);
|
|
88290
88290
|
}
|
|
88291
88291
|
analyze(url) {
|
|
88292
88292
|
if (url.match(this.regex)) {
|
|
88293
88293
|
const urlObj = new URL(url);
|
|
88294
88294
|
const search = new URLSearchParams();
|
|
88295
|
+
let pathname = urlObj.pathname;
|
|
88296
|
+
pathname = pathname.replace(/^\/file\//i, "/design/");
|
|
88295
88297
|
const nodeId = urlObj.searchParams.get("node-id");
|
|
88296
88298
|
if (nodeId) {
|
|
88297
88299
|
search.append("node-id", nodeId);
|
|
88298
88300
|
}
|
|
88299
88301
|
search.append("embed-host", "share");
|
|
88302
|
+
let targetURL = `https://embed.figma.com${pathname}?${search.toString()}`;
|
|
88303
|
+
if (!pathname.match(/^\/design\//i)) {
|
|
88304
|
+
targetURL = url;
|
|
88305
|
+
}
|
|
88300
88306
|
return {
|
|
88301
88307
|
type: "iframe",
|
|
88302
88308
|
providerName: "figma",
|
|
88303
|
-
url:
|
|
88309
|
+
url: targetURL
|
|
88304
88310
|
};
|
|
88305
88311
|
}
|
|
88306
88312
|
return null;
|
|
@@ -88513,7 +88519,8 @@ ${data2.plantumlText}
|
|
|
88513
88519
|
return urlAnalyzer.analyze(url);
|
|
88514
88520
|
}
|
|
88515
88521
|
function formatValue(value) {
|
|
88516
|
-
|
|
88522
|
+
const regex = /^(https?:)?\/\//i;
|
|
88523
|
+
if (value && !value.match(regex)) {
|
|
88517
88524
|
return `${window.location.protocol}//${value}`;
|
|
88518
88525
|
}
|
|
88519
88526
|
return value;
|
|
@@ -92775,7 +92782,7 @@ ${data2.plantumlText}
|
|
|
92775
92782
|
}
|
|
92776
92783
|
}
|
|
92777
92784
|
});
|
|
92778
|
-
editor.version = "2.8.15-beta.
|
|
92785
|
+
editor.version = "2.8.15-beta.2";
|
|
92779
92786
|
return editor;
|
|
92780
92787
|
}
|
|
92781
92788
|
function isDoc(doc2) {
|
|
@@ -92888,7 +92895,7 @@ ${data2.plantumlText}
|
|
|
92888
92895
|
}
|
|
92889
92896
|
});
|
|
92890
92897
|
OnesEditorToolbar.register(editor);
|
|
92891
|
-
editor.version = "2.8.15-beta.
|
|
92898
|
+
editor.version = "2.8.15-beta.2";
|
|
92892
92899
|
return editor;
|
|
92893
92900
|
}
|
|
92894
92901
|
async function showDocVersions(editor, options, serverUrl) {
|