pages_core 3.8.1 → 3.8.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.
- checksums.yaml +4 -4
- data/app/assets/builds/pages_core/admin-dist.js +7 -7
- data/app/javascript/components/Attachments/Attachment.jsx +2 -2
- data/app/javascript/components/Attachments/AttachmentEditor.jsx +2 -2
- data/app/javascript/components/EditableImage.jsx +1 -1
- data/app/javascript/components/FileUploadButton.jsx +27 -34
- data/app/javascript/components/ImageEditor/Form.jsx +2 -2
- data/app/javascript/components/ImageEditor.jsx +1 -1
- data/app/javascript/components/ImageGrid/GridImage.jsx +1 -1
- data/app/javascript/components/ImageGrid.jsx +1 -1
- data/app/javascript/components/ImageUploader.jsx +1 -1
- data/app/javascript/components/Modal.jsx +1 -1
- data/app/javascript/components/Toast.jsx +1 -1
- data/app/javascript/components.js +1 -0
- data/app/javascript/index.js +1 -0
- data/app/javascript/{components → stores}/ModalStore.jsx +0 -0
- data/app/javascript/{components → stores}/ToastStore.jsx +0 -0
- data/app/javascript/stores.js +2 -0
- data/lib/pages_core/version.rb +1 -1
- metadata +4 -3
@@ -2,8 +2,8 @@ import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
3
3
|
import copyToClipboard from "../../lib/copyToClipboard";
|
4
4
|
import AttachmentEditor from "./AttachmentEditor";
|
5
|
-
import ModalStore from "
|
6
|
-
import ToastStore from "
|
5
|
+
import ModalStore from "../../stores/ModalStore";
|
6
|
+
import ToastStore from "../../stores/ToastStore";
|
7
7
|
|
8
8
|
import { useDraggable } from "../drag";
|
9
9
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import PropTypes from "prop-types";
|
3
3
|
import copyToClipboard, { copySupported } from "../../lib/copyToClipboard";
|
4
|
-
import ModalStore from "
|
5
|
-
import ToastStore from "
|
4
|
+
import ModalStore from "../../stores/ModalStore";
|
5
|
+
import ToastStore from "../../stores/ToastStore";
|
6
6
|
import { putJson } from "../../lib/request";
|
7
7
|
|
8
8
|
export default function AttachmentEditor(props) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import PropTypes from "prop-types";
|
3
3
|
import ImageEditor from "./ImageEditor";
|
4
|
-
import ModalStore from "
|
4
|
+
import ModalStore from "../stores/ModalStore";
|
5
5
|
|
6
6
|
export default function EditableImage(props) {
|
7
7
|
const [image, setImage] = useState(props.image);
|
@@ -1,49 +1,42 @@
|
|
1
|
-
import React from "react";
|
1
|
+
import React, { useRef } from "react";
|
2
2
|
import PropTypes from "prop-types";
|
3
3
|
|
4
|
-
export default
|
5
|
-
|
6
|
-
super(props);
|
7
|
-
this.inputRef = React.createRef();
|
8
|
-
this.handleChange = this.handleChange.bind(this);
|
9
|
-
this.triggerDialog = this.triggerDialog.bind(this);
|
10
|
-
}
|
4
|
+
export default function FileUploadButton(props) {
|
5
|
+
const inputRef = useRef();
|
11
6
|
|
12
|
-
handleChange(evt) {
|
7
|
+
const handleChange = (evt) => {
|
13
8
|
let fileList = evt.target.files;
|
14
9
|
let files = [];
|
15
10
|
for (var i = 0; i < fileList.length; i++) {
|
16
11
|
files.push(fileList[i]);
|
17
12
|
}
|
18
13
|
if (files.length > 0) {
|
19
|
-
|
14
|
+
props.callback(files);
|
20
15
|
}
|
21
|
-
}
|
16
|
+
};
|
22
17
|
|
23
|
-
|
24
|
-
return (
|
25
|
-
<div className="upload-button">
|
26
|
-
<span>
|
27
|
-
Drag and drop {this.props.type || "file"}
|
28
|
-
{this.props.multiple && "s"} here, or
|
29
|
-
{this.props.multiline && <br />}
|
30
|
-
<button onClick={this.triggerDialog}>
|
31
|
-
choose a file
|
32
|
-
</button>
|
33
|
-
</span>
|
34
|
-
<input type="file"
|
35
|
-
onChange={this.handleChange}
|
36
|
-
ref={this.inputRef}
|
37
|
-
style={{ display: "none" }}
|
38
|
-
multiple={this.props.multiple || false} />
|
39
|
-
</div>
|
40
|
-
);
|
41
|
-
}
|
42
|
-
|
43
|
-
triggerDialog(evt) {
|
18
|
+
const triggerDialog = (evt) => {
|
44
19
|
evt.preventDefault();
|
45
|
-
|
46
|
-
}
|
20
|
+
inputRef.current.click();
|
21
|
+
};
|
22
|
+
|
23
|
+
return (
|
24
|
+
<div className="upload-button">
|
25
|
+
<span>
|
26
|
+
Drag and drop {props.type || "file"}
|
27
|
+
{props.multiple && "s"} here, or
|
28
|
+
{props.multiline && <br />}
|
29
|
+
<button onClick={triggerDialog}>
|
30
|
+
choose a file
|
31
|
+
</button>
|
32
|
+
</span>
|
33
|
+
<input type="file"
|
34
|
+
onChange={handleChange}
|
35
|
+
ref={inputRef}
|
36
|
+
style={{ display: "none" }}
|
37
|
+
multiple={props.multiple || false} />
|
38
|
+
</div>
|
39
|
+
);
|
47
40
|
}
|
48
41
|
|
49
42
|
FileUploadButton.propTypes = {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import PropTypes from "prop-types";
|
3
|
-
import ModalStore from "
|
4
|
-
import ToastStore from "
|
3
|
+
import ModalStore from "../../stores/ModalStore";
|
4
|
+
import ToastStore from "../../stores/ToastStore";
|
5
5
|
import copyToClipboard, { copySupported } from "../../lib/copyToClipboard";
|
6
6
|
|
7
7
|
export default function Form(props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import PropTypes from "prop-types";
|
3
|
-
import ModalStore from "
|
3
|
+
import ModalStore from "../stores/ModalStore";
|
4
4
|
import { putJson } from "../lib/request";
|
5
5
|
|
6
6
|
import ImageCropper, { useCrop, cropParams } from "./ImageCropper";
|
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
3
3
|
import copyToClipboard from "../../lib/copyToClipboard";
|
4
4
|
import EditableImage from "../EditableImage";
|
5
|
-
import ToastStore from "
|
5
|
+
import ToastStore from "../../stores/ToastStore";
|
6
6
|
import Placeholder from "./Placeholder";
|
7
7
|
|
8
8
|
import { useDraggable } from "../drag";
|
@@ -4,7 +4,7 @@ import FileUploadButton from "./FileUploadButton";
|
|
4
4
|
import DragElement from "./ImageGrid/DragElement";
|
5
5
|
import FilePlaceholder from "./ImageGrid/FilePlaceholder";
|
6
6
|
import GridImage from "./ImageGrid/GridImage";
|
7
|
-
import ToastStore from "
|
7
|
+
import ToastStore from "../stores/ToastStore";
|
8
8
|
import { post } from "../lib/request";
|
9
9
|
|
10
10
|
import { createDraggable,
|
@@ -2,7 +2,7 @@ import React, { useState } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
3
3
|
import EditableImage from "./EditableImage";
|
4
4
|
import FileUploadButton from "./FileUploadButton";
|
5
|
-
import ToastStore from "
|
5
|
+
import ToastStore from "../stores/ToastStore";
|
6
6
|
import { post } from "../lib/request";
|
7
7
|
|
8
8
|
function getFiles(dt) {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export { default as Attachments } from "./components/Attachments";
|
2
2
|
export { default as DateRangeSelect } from "./components/DateRangeSelect";
|
3
3
|
export { default as EditableImage } from "./components/EditableImage";
|
4
|
+
export { default as FileUploadButton } from "./components/FileUploadButton";
|
4
5
|
export { default as ImageCropper } from "./components/ImageCropper";
|
5
6
|
export { default as ImageGrid } from "./components/ImageGrid";
|
6
7
|
export { default as ImageUploader } from "./components/ImageUploader";
|
data/app/javascript/index.js
CHANGED
File without changes
|
File without changes
|
data/lib/pages_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pages_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.8.
|
4
|
+
version: 3.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Inge Jørgensen
|
@@ -621,7 +621,6 @@ files:
|
|
621
621
|
- app/javascript/components/ImageGrid/Placeholder.jsx
|
622
622
|
- app/javascript/components/ImageUploader.jsx
|
623
623
|
- app/javascript/components/Modal.jsx
|
624
|
-
- app/javascript/components/ModalStore.jsx
|
625
624
|
- app/javascript/components/PageDates.jsx
|
626
625
|
- app/javascript/components/PageFiles.jsx
|
627
626
|
- app/javascript/components/PageImages.jsx
|
@@ -634,7 +633,6 @@ files:
|
|
634
633
|
- app/javascript/components/TagEditor/AddTagForm.jsx
|
635
634
|
- app/javascript/components/TagEditor/Tag.jsx
|
636
635
|
- app/javascript/components/Toast.jsx
|
637
|
-
- app/javascript/components/ToastStore.jsx
|
638
636
|
- app/javascript/components/drag.js
|
639
637
|
- app/javascript/components/drag/draggedOrder.js
|
640
638
|
- app/javascript/components/drag/useDragCollection.js
|
@@ -651,6 +649,9 @@ files:
|
|
651
649
|
- app/javascript/lib/copyToClipboard.js
|
652
650
|
- app/javascript/lib/readyHandler.js
|
653
651
|
- app/javascript/lib/request.js
|
652
|
+
- app/javascript/stores.js
|
653
|
+
- app/javascript/stores/ModalStore.jsx
|
654
|
+
- app/javascript/stores/ToastStore.jsx
|
654
655
|
- app/jobs/pages_core/autopublish_job.rb
|
655
656
|
- app/jobs/pages_core/sweep_cache_job.rb
|
656
657
|
- app/mailers/admin_mailer.rb
|