@livepreso/react-plugin-textfield 0.1.0 → 0.1.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/CHANGELOG.json +25 -1
- package/CHANGELOG.md +16 -2
- package/components/BubbleMenu.js +2 -7
- package/components/Select/Select.module.scss +1 -1
- package/index.js +9 -0
- package/package.json +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livepreso/react-plugin-textfield",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.2",
|
|
6
|
+
"tag": "@livepreso/react-plugin-textfield_v0.1.2",
|
|
7
|
+
"date": "Mon, 27 Oct 2025 00:19:05 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Add user editability check"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"version": "0.1.1",
|
|
18
|
+
"tag": "@livepreso/react-plugin-textfield_v0.1.1",
|
|
19
|
+
"date": "Wed, 01 Oct 2025 02:27:21 GMT",
|
|
20
|
+
"comments": {
|
|
21
|
+
"patch": [
|
|
22
|
+
{
|
|
23
|
+
"comment": "Remove TextField component toolbar inset as it is no longer required."
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
4
28
|
{
|
|
5
29
|
"version": "0.1.0",
|
|
6
30
|
"tag": "@livepreso/react-plugin-textfield_v0.1.0",
|
|
7
|
-
"date": "
|
|
31
|
+
"date": "Mon, 29 Sep 2025 23:56:57 GMT",
|
|
8
32
|
"comments": {
|
|
9
33
|
"minor": [
|
|
10
34
|
{
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
# Change Log - @livepreso/react-plugin-textfield
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 27 Oct 2025 00:19:05 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.1.2
|
|
6
|
+
Mon, 27 Oct 2025 00:19:05 GMT
|
|
7
|
+
|
|
8
|
+
### Patches
|
|
9
|
+
|
|
10
|
+
- Add user editability check
|
|
11
|
+
|
|
12
|
+
## 0.1.1
|
|
13
|
+
Wed, 01 Oct 2025 02:27:21 GMT
|
|
14
|
+
|
|
15
|
+
### Patches
|
|
16
|
+
|
|
17
|
+
- Remove TextField component toolbar inset as it is no longer required.
|
|
4
18
|
|
|
5
19
|
## 0.1.0
|
|
6
|
-
|
|
20
|
+
Mon, 29 Sep 2025 23:56:57 GMT
|
|
7
21
|
|
|
8
22
|
### Minor changes
|
|
9
23
|
|
package/components/BubbleMenu.js
CHANGED
|
@@ -8,7 +8,7 @@ import { Plugin, PluginKey } from "@tiptap/pm/state";
|
|
|
8
8
|
import { OverlayPortal, useTransitions } from "@livepreso/content-react";
|
|
9
9
|
import style from "./BubbleMenu.module.scss";
|
|
10
10
|
import { EDITABLE_OUTER_SELECTOR } from "../constants";
|
|
11
|
-
import {
|
|
11
|
+
import { getTestRect } from "./utils";
|
|
12
12
|
|
|
13
13
|
class UnscaledBubbleMenuView extends BubbleMenuView {
|
|
14
14
|
show() {
|
|
@@ -27,12 +27,7 @@ class UnscaledBubbleMenuView extends BubbleMenuView {
|
|
|
27
27
|
|
|
28
28
|
const div = window.Bridge.UI.overlay;
|
|
29
29
|
const divRect = div.getBoundingClientRect();
|
|
30
|
-
|
|
31
|
-
// Percentage applied to maxWidth keeps toolbars out of the way of left/right slide navigation
|
|
32
|
-
// Calculated based on the current current's raw dimensions, against our standard 120px left/right padding
|
|
33
|
-
const { width: rawWidth } = getContentDimensions();
|
|
34
|
-
const widthPerc = rawWidth ? (rawWidth - 240) / rawWidth : 1;
|
|
35
|
-
this.element.style.maxWidth = `${divRect.width * widthPerc}px`;
|
|
30
|
+
this.element.style.maxWidth = `${divRect.width}px`;
|
|
36
31
|
this.element.style.maxHeight = `${divRect.height}px`;
|
|
37
32
|
|
|
38
33
|
const getBoundingClientRect = () => {
|
package/index.js
CHANGED
|
@@ -268,9 +268,18 @@ function CMSValField({ id, children, ...props }) {
|
|
|
268
268
|
const [cmsValue, setCMSValue] = useCMSVal(id);
|
|
269
269
|
const value = !isThumbnailScreenshot && cmsValue;
|
|
270
270
|
|
|
271
|
+
// Check if the app allows editing this field. If the function doesn't exist
|
|
272
|
+
// assume it's ok.
|
|
273
|
+
const userCanEdit =
|
|
274
|
+
isUserTemplate ||
|
|
275
|
+
isUserTemplateLibrary ||
|
|
276
|
+
(Bridge.CMSVals?.canEditKey?.(id) ?? true);
|
|
277
|
+
|
|
271
278
|
const isEditable =
|
|
272
279
|
props.isEditable &&
|
|
280
|
+
userCanEdit &&
|
|
273
281
|
(isPresomanager || isUserTemplateLibrary || isUserTemplate);
|
|
282
|
+
|
|
274
283
|
return (
|
|
275
284
|
<EditableTextField
|
|
276
285
|
{...props}
|