@webiny/app-headless-cms 6.4.3-beta.0 → 6.4.3-beta.1
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.
|
@@ -4,10 +4,10 @@ import { renderPlugins } from "@webiny/app/plugins/index.js";
|
|
|
4
4
|
const EditorBar = ()=>/*#__PURE__*/ react.createElement(HeaderBar, {
|
|
5
5
|
"data-testid": "cms-editor-top-bar",
|
|
6
6
|
start: /*#__PURE__*/ react.createElement("div", {
|
|
7
|
-
className: "flex items-center justify-start
|
|
7
|
+
className: "flex items-center justify-start"
|
|
8
8
|
}, renderPlugins("content-model-editor-default-bar-left")),
|
|
9
9
|
end: /*#__PURE__*/ react.createElement("div", {
|
|
10
|
-
className: "flex items-center justify-end
|
|
10
|
+
className: "flex items-center justify-end"
|
|
11
11
|
}, renderPlugins("content-model-editor-default-bar-right"))
|
|
12
12
|
});
|
|
13
13
|
const Header = EditorBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentModelEditor/Header.js","sources":["../../../../src/admin/components/ContentModelEditor/Header.tsx"],"sourcesContent":["import React from \"react\";\nimport { HeaderBar } from \"@webiny/admin-ui\";\nimport { renderPlugins } from \"@webiny/app/plugins/index.js\";\n\nconst EditorBar = () => {\n return (\n <HeaderBar\n data-testid={\"cms-editor-top-bar\"}\n start={\n <div className={\"flex items-center justify-start
|
|
1
|
+
{"version":3,"file":"admin/components/ContentModelEditor/Header.js","sources":["../../../../src/admin/components/ContentModelEditor/Header.tsx"],"sourcesContent":["import React from \"react\";\nimport { HeaderBar } from \"@webiny/admin-ui\";\nimport { renderPlugins } from \"@webiny/app/plugins/index.js\";\n\nconst EditorBar = () => {\n return (\n <HeaderBar\n data-testid={\"cms-editor-top-bar\"}\n start={\n <div className={\"flex items-center justify-start\"}>\n {renderPlugins(\"content-model-editor-default-bar-left\")}\n </div>\n }\n end={\n <div className={\"flex items-center justify-end\"}>\n {renderPlugins(\"content-model-editor-default-bar-right\")}\n </div>\n }\n />\n );\n};\n\nexport default EditorBar;\n"],"names":["EditorBar","HeaderBar","renderPlugins"],"mappings":";;;AAIA,MAAMA,YAAY,IACP,WAAP,GACI,oBAACC,WAASA;QACN,eAAa;QACb,qBACI,oBAAC;YAAI,WAAW;WACXC,cAAc;QAGvB,mBACI,oBAAC;YAAI,WAAW;WACXA,cAAc;;AAOnC,eAAeF"}
|
|
@@ -2,63 +2,34 @@ import react, { useCallback, useState } from "react";
|
|
|
2
2
|
import { useHotkeys } from "@webiny/app-admin";
|
|
3
3
|
import { i18n } from "@webiny/app/i18n/index.js";
|
|
4
4
|
import { useModelEditor } from "../../../../hooks/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { EditableTitle } from "@webiny/admin-ui";
|
|
6
6
|
const t = i18n.namespace("ContentModelEditor.Name");
|
|
7
7
|
const Name = ()=>{
|
|
8
8
|
const { data, setData } = useModelEditor();
|
|
9
|
-
const [
|
|
10
|
-
const
|
|
11
|
-
const cancelChanges = ()=>{
|
|
12
|
-
setEditing(false);
|
|
13
|
-
};
|
|
14
|
-
const startEditing = ()=>{
|
|
15
|
-
setLocalName(data.name);
|
|
16
|
-
setEditing(true);
|
|
17
|
-
};
|
|
18
|
-
const saveName = useCallback((event)=>{
|
|
19
|
-
event.preventDefault();
|
|
9
|
+
const [editing, setEditing] = useState(false);
|
|
10
|
+
const saveName = useCallback((name)=>{
|
|
20
11
|
setData((data)=>{
|
|
21
|
-
data.name =
|
|
12
|
+
data.name = name;
|
|
22
13
|
return data;
|
|
23
14
|
});
|
|
24
|
-
setEditing(false);
|
|
25
15
|
}, [
|
|
26
|
-
|
|
16
|
+
setData
|
|
27
17
|
]);
|
|
28
18
|
useHotkeys({
|
|
29
19
|
zIndex: 100,
|
|
30
20
|
keys: {
|
|
31
|
-
"alt+cmd+enter":
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
useHotkeys({
|
|
35
|
-
zIndex: 101,
|
|
36
|
-
disabled: !editingEnabled,
|
|
37
|
-
keys: {
|
|
38
|
-
esc: (event)=>{
|
|
39
|
-
event.preventDefault();
|
|
40
|
-
cancelChanges();
|
|
41
|
-
},
|
|
42
|
-
enter: saveName
|
|
21
|
+
"alt+cmd+enter": ()=>setEditing(true)
|
|
43
22
|
}
|
|
44
23
|
});
|
|
45
24
|
const autoFocus = !window.Cypress;
|
|
46
|
-
return
|
|
25
|
+
return /*#__PURE__*/ react.createElement(EditableTitle, {
|
|
26
|
+
value: data.name,
|
|
27
|
+
onCommit: saveName,
|
|
47
28
|
autoFocus: autoFocus,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
size: "md"
|
|
53
|
-
}) : /*#__PURE__*/ react.createElement(Tooltip, {
|
|
54
|
-
side: "bottom",
|
|
55
|
-
content: /*#__PURE__*/ react.createElement("span", null, t`Rename content model`),
|
|
56
|
-
trigger: /*#__PURE__*/ react.createElement(Heading, {
|
|
57
|
-
level: 5,
|
|
58
|
-
className: "px-xs border-sm border-neutral-base rounded-md hover:border-neutral-muted",
|
|
59
|
-
"data-testid": "cms-editor-model-title",
|
|
60
|
-
onClick: startEditing
|
|
61
|
-
}, data.name)
|
|
29
|
+
isEditing: editing,
|
|
30
|
+
onEditingChange: setEditing,
|
|
31
|
+
tooltip: /*#__PURE__*/ react.createElement("span", null, t`Rename content model`),
|
|
32
|
+
"data-testid": "cms-editor-model-title"
|
|
62
33
|
});
|
|
63
34
|
};
|
|
64
35
|
export { Name };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/plugins/editor/defaultBar/Name/Name.js","sources":["../../../../../../src/admin/plugins/editor/defaultBar/Name/Name.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { useHotkeys } from \"@webiny/app-admin\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { useModelEditor } from \"~/admin/hooks/index.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"admin/plugins/editor/defaultBar/Name/Name.js","sources":["../../../../../../src/admin/plugins/editor/defaultBar/Name/Name.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport { useHotkeys } from \"@webiny/app-admin\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { useModelEditor } from \"~/admin/hooks/index.js\";\nimport { EditableTitle } from \"@webiny/admin-ui\";\n\nconst t = i18n.namespace(\"ContentModelEditor.Name\");\n\ndeclare global {\n interface Window {\n Cypress: any;\n }\n}\n\nexport const Name = () => {\n const { data, setData } = useModelEditor();\n const [editing, setEditing] = useState<boolean>(false);\n\n const saveName = useCallback(\n (name: string) => {\n setData(data => {\n data.name = name;\n return data;\n });\n },\n [setData]\n );\n\n useHotkeys({\n zIndex: 100,\n keys: {\n \"alt+cmd+enter\": () => setEditing(true)\n }\n });\n\n // Disable autoFocus because for some reason, blur event would automatically be triggered when clicking\n // on the page title when doing Cypress testing. Not sure if this is RMWC or Cypress related issue.\n const autoFocus = !window.Cypress;\n\n return (\n <EditableTitle\n value={data.name}\n onCommit={saveName}\n autoFocus={autoFocus}\n isEditing={editing}\n onEditingChange={setEditing}\n tooltip={<span>{t`Rename content model`}</span>}\n data-testid=\"cms-editor-model-title\"\n />\n );\n};\n"],"names":["t","i18n","Name","data","setData","useModelEditor","editing","setEditing","useState","saveName","useCallback","name","useHotkeys","autoFocus","window","EditableTitle"],"mappings":";;;;;AAMA,MAAMA,IAAIC,KAAK,SAAS,CAAC;AAQlB,MAAMC,OAAO;IAChB,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAE,GAAGC;IAC1B,MAAM,CAACC,SAASC,WAAW,GAAGC,SAAkB;IAEhD,MAAMC,WAAWC,YACb,CAACC;QACGP,QAAQD,CAAAA;YACJA,KAAK,IAAI,GAAGQ;YACZ,OAAOR;QACX;IACJ,GACA;QAACC;KAAQ;IAGbQ,WAAW;QACP,QAAQ;QACR,MAAM;YACF,iBAAiB,IAAML,WAAW;QACtC;IACJ;IAIA,MAAMM,YAAY,CAACC,OAAO,OAAO;IAEjC,OAAO,WAAP,GACI,oBAACC,eAAaA;QACV,OAAOZ,KAAK,IAAI;QAChB,UAAUM;QACV,WAAWI;QACX,WAAWP;QACX,iBAAiBC;QACjB,uBAAS,oBAAC,cAAMP,CAAC,CAAC,oBAAoB,CAAC;QACvC,eAAY;;AAGxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-headless-cms",
|
|
3
|
-
"version": "6.4.3-beta.
|
|
3
|
+
"version": "6.4.3-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -31,25 +31,25 @@
|
|
|
31
31
|
"@lexical/utils": "0.44.0",
|
|
32
32
|
"@svgr/webpack": "8.1.0",
|
|
33
33
|
"@types/react": "18.3.29",
|
|
34
|
-
"@webiny/admin-ui": "6.4.3-beta.
|
|
35
|
-
"@webiny/app": "6.4.3-beta.
|
|
36
|
-
"@webiny/app-aco": "6.4.3-beta.
|
|
37
|
-
"@webiny/app-admin": "6.4.3-beta.
|
|
38
|
-
"@webiny/app-graphql-playground": "6.4.3-beta.
|
|
39
|
-
"@webiny/app-headless-cms-common": "6.4.3-beta.
|
|
40
|
-
"@webiny/app-trash-bin": "6.4.3-beta.
|
|
41
|
-
"@webiny/error": "6.4.3-beta.
|
|
42
|
-
"@webiny/feature": "6.4.3-beta.
|
|
43
|
-
"@webiny/form": "6.4.3-beta.
|
|
44
|
-
"@webiny/icons": "6.4.3-beta.
|
|
45
|
-
"@webiny/lexical-converter": "6.4.3-beta.
|
|
46
|
-
"@webiny/lexical-editor": "6.4.3-beta.
|
|
47
|
-
"@webiny/lexical-nodes": "6.4.3-beta.
|
|
48
|
-
"@webiny/plugins": "6.4.3-beta.
|
|
49
|
-
"@webiny/react-composition": "6.4.3-beta.
|
|
50
|
-
"@webiny/react-properties": "6.4.3-beta.
|
|
51
|
-
"@webiny/utils": "6.4.3-beta.
|
|
52
|
-
"@webiny/validation": "6.4.3-beta.
|
|
34
|
+
"@webiny/admin-ui": "6.4.3-beta.1",
|
|
35
|
+
"@webiny/app": "6.4.3-beta.1",
|
|
36
|
+
"@webiny/app-aco": "6.4.3-beta.1",
|
|
37
|
+
"@webiny/app-admin": "6.4.3-beta.1",
|
|
38
|
+
"@webiny/app-graphql-playground": "6.4.3-beta.1",
|
|
39
|
+
"@webiny/app-headless-cms-common": "6.4.3-beta.1",
|
|
40
|
+
"@webiny/app-trash-bin": "6.4.3-beta.1",
|
|
41
|
+
"@webiny/error": "6.4.3-beta.1",
|
|
42
|
+
"@webiny/feature": "6.4.3-beta.1",
|
|
43
|
+
"@webiny/form": "6.4.3-beta.1",
|
|
44
|
+
"@webiny/icons": "6.4.3-beta.1",
|
|
45
|
+
"@webiny/lexical-converter": "6.4.3-beta.1",
|
|
46
|
+
"@webiny/lexical-editor": "6.4.3-beta.1",
|
|
47
|
+
"@webiny/lexical-nodes": "6.4.3-beta.1",
|
|
48
|
+
"@webiny/plugins": "6.4.3-beta.1",
|
|
49
|
+
"@webiny/react-composition": "6.4.3-beta.1",
|
|
50
|
+
"@webiny/react-properties": "6.4.3-beta.1",
|
|
51
|
+
"@webiny/utils": "6.4.3-beta.1",
|
|
52
|
+
"@webiny/validation": "6.4.3-beta.1",
|
|
53
53
|
"apollo-cache": "1.3.5",
|
|
54
54
|
"apollo-client": "2.6.10",
|
|
55
55
|
"apollo-link": "1.2.14",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"zod": "4.4.3"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@webiny/build-tools": "6.4.3-beta.
|
|
74
|
+
"@webiny/build-tools": "6.4.3-beta.1",
|
|
75
75
|
"rimraf": "6.1.3",
|
|
76
76
|
"typescript": "6.0.3",
|
|
77
77
|
"vitest": "4.1.8"
|