@dossier/d-quill
Advanced tools
Comparing version 0.3.6 to 0.3.7
import React, { useContext, useRef } from "react"; | ||
import { Button, Icon, Input, MithraContext } from "@dossier/mithra-ui"; | ||
import { Button, Icon, Input, MithraContext, Stack } from "@dossier/mithra-ui"; | ||
var LinkSelectorEditor = function (props) { | ||
var linkInputRef = useRef(null); | ||
var getMessage = useContext(MithraContext).getMessage; | ||
var btnText = getMessage("gui.standard.save") || "Lagre"; | ||
return (React.createElement("div", { className: "LinkSelectorEditor" }, | ||
var btnText = getMessage("gui.standard.save"); | ||
return (React.createElement(Stack, { className: "LinkSelectorEditor", justifyContent: "flex-end", flexDirection: "row" }, | ||
React.createElement(Input, { className: "linkInput", ref: linkInputRef, fillParent: true, placeholder: props.placeholder }), | ||
@@ -9,0 +9,0 @@ React.createElement(Button, { className: "linkBtn", leftContent: React.createElement(Icon, { icon: "Check" }), variant: "primary", type: "button", text: btnText, onClick: function () { |
@@ -165,6 +165,6 @@ import React, { useCallback, useContext, useEffect, useRef, useState, } from "react"; | ||
React.createElement("div", { id: id, className: computedClassName }, | ||
React.createElement("div", { ref: editorRef }), | ||
showVideoInput && React.createElement(LinkSelectorEditor, { onCancel: toggleVideoInput, onSubmit: insertVideoUrl, placeholder: "gui.notification.SystemMessageAuthoringFormEgg.link.addVideo" })))); | ||
React.createElement("div", { ref: editorRef })), | ||
showVideoInput && React.createElement(LinkSelectorEditor, { onCancel: toggleVideoInput, onSubmit: insertVideoUrl, placeholder: "gui.notification.SystemMessageAuthoringFormEgg.placeholder.addVideoLink" }))); | ||
} | ||
RichTextEditor.displayName = "RichTextEditor"; | ||
export default RichTextEditor; |
@@ -43,3 +43,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
input.setAttribute("type", "file"); | ||
input.click(); | ||
input.setAttribute("accept", 'image/*'); | ||
/* When selected a file, check if image and upload | ||
@@ -53,4 +53,3 @@ * if not return warning. */ | ||
if (/^image\//.test(file.type)) { | ||
saveToProFile(file) | ||
.then(); | ||
saveToProFile(file).then(); | ||
} | ||
@@ -67,2 +66,6 @@ else { | ||
}; | ||
/* Adding to DOM for IE11 */ | ||
document.body.appendChild(input); | ||
/* Opening input promp */ | ||
input.click(); | ||
}; | ||
@@ -69,0 +72,0 @@ var saveToProFile = function (file) { return __awaiter(_this, void 0, void 0, function () { |
@@ -61,2 +61,5 @@ import { useEffect, useRef } from "react"; | ||
if (validSite) { | ||
if (validSite[5] === undefined) { | ||
return "https://www.youtube.com/embed/" + validSite[4] + "?showinfo=0"; | ||
} | ||
return "https://www.youtube.com/embed/" + validSite[5] + "?showinfo=0"; | ||
@@ -63,0 +66,0 @@ } |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "0.3.6"; | ||
export declare const VERSION = "0.3.7"; |
// THIS FILE IS GENERATED WHEN PUBLISHING TO NPM | ||
// DO NOT TOUCH | ||
export var VERSION = "0.3.6"; | ||
export var VERSION = "0.3.7"; |
{ | ||
"name": "@dossier/d-quill", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "A powerful React rich text editor", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
67365
1363