@webiny/app-aco 6.3.0-beta.1 → 6.3.0-beta.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useState","slugify","Grid","Input","useDialogs","useSnackbar","Bind","useForm","validation","Extensions","FolderTree","ROOT_FOLDER","useCreateFolder","ParentFolderField","FormComponent","currentParentId","parentId","setParentId","form","generateSlug","data","slug","title","setValue","replacement","lower","remove","trim","createElement","Fragment","Column","span","name","validators","create","bind","Object","assign","label","onBlur","size","required","autoFocus","defaultValue","onChange","focusedFolderId","onFolderClick","folder","id","useCreateDialog","dialogs","createFolder","showSnackbar","onAccept","error","message","showDialog","params","content","acceptLabel","cancelLabel","loadingLabel"],"sources":["useCreateDialog.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport slugify from \"slugify\";\nimport { Grid, Input } from \"@webiny/admin-ui\";\nimport { useDialogs, useSnackbar } from \"@webiny/app-admin\";\nimport type { GenericFormData } from \"@webiny/form\";\nimport { Bind, useForm } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { Extensions, FolderTree } from \"~/components/index.js\";\nimport { ROOT_FOLDER } from \"~/constants.js\";\nimport type { FolderDto } from \"~/domain/folder/FolderDto.js\";\nimport { useCreateFolder } from \"~/features/folders/createFolder/index.js\";\nimport { ParentFolderField } from \"./ParentFolderField.js\";\n\ninterface ShowDialogParams {\n currentParentId?: string | null;\n}\n\ninterface UseCreateDialogResponse {\n showDialog: (params?: ShowDialogParams) => void;\n}\n\ninterface FormComponentProps {\n currentParentId?: string | null;\n}\n\nconst FormComponent = ({ currentParentId = null }: FormComponentProps) => {\n const [parentId, setParentId] = useState<string | null>(currentParentId);\n const form = useForm();\n\n const generateSlug = () => {\n if (form.data.slug || !form.data.title) {\n return;\n }\n\n // We want to update slug only when the folder is first being created.\n form.setValue(\n \"slug\",\n slugify(form.data.title, {\n replacement: \"-\",\n lower: true,\n remove: /[
|
|
1
|
+
{"version":3,"names":["React","useCallback","useState","slugify","Grid","Input","useDialogs","useSnackbar","Bind","useForm","validation","Extensions","FolderTree","ROOT_FOLDER","useCreateFolder","ParentFolderField","FormComponent","currentParentId","parentId","setParentId","form","generateSlug","data","slug","title","setValue","replacement","lower","remove","trim","createElement","Fragment","Column","span","name","validators","create","bind","Object","assign","label","onBlur","size","required","autoFocus","defaultValue","onChange","focusedFolderId","onFolderClick","folder","id","useCreateDialog","dialogs","createFolder","showSnackbar","onAccept","error","message","showDialog","params","content","acceptLabel","cancelLabel","loadingLabel"],"sources":["useCreateDialog.tsx"],"sourcesContent":["import React, { useCallback, useState } from \"react\";\nimport slugify from \"slugify\";\nimport { Grid, Input } from \"@webiny/admin-ui\";\nimport { useDialogs, useSnackbar } from \"@webiny/app-admin\";\nimport type { GenericFormData } from \"@webiny/form\";\nimport { Bind, useForm } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { Extensions, FolderTree } from \"~/components/index.js\";\nimport { ROOT_FOLDER } from \"~/constants.js\";\nimport type { FolderDto } from \"~/domain/folder/FolderDto.js\";\nimport { useCreateFolder } from \"~/features/folders/createFolder/index.js\";\nimport { ParentFolderField } from \"./ParentFolderField.js\";\n\ninterface ShowDialogParams {\n currentParentId?: string | null;\n}\n\ninterface UseCreateDialogResponse {\n showDialog: (params?: ShowDialogParams) => void;\n}\n\ninterface FormComponentProps {\n currentParentId?: string | null;\n}\n\nconst FormComponent = ({ currentParentId = null }: FormComponentProps) => {\n const [parentId, setParentId] = useState<string | null>(currentParentId);\n const form = useForm();\n\n const generateSlug = () => {\n if (form.data.slug || !form.data.title) {\n return;\n }\n\n // We want to update slug only when the folder is first being created.\n form.setValue(\n \"slug\",\n slugify(form.data.title, {\n replacement: \"-\",\n lower: true,\n remove: /[*#?<>_{}[\\]+~.()'\"!:;@]/g,\n trim: false\n })\n );\n };\n\n return (\n <>\n <Grid>\n <Grid.Column span={12}>\n <Bind name={\"title\"} validators={validation.create(\"required\")}>\n {bind => (\n <Input\n {...bind}\n label={\"Title\"}\n onBlur={generateSlug}\n size={\"lg\"}\n required\n autoFocus={true}\n />\n )}\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <Bind name={\"slug\"} validators={validation.create(\"required,slug\")}>\n <Input label={\"Slug\"} size={\"lg\"} required />\n </Bind>\n </Grid.Column>\n <Grid.Column span={12}>\n <ParentFolderField>\n <Bind name={\"parentId\"} defaultValue={parentId}>\n {({ onChange }) => (\n <FolderTree\n focusedFolderId={parentId || ROOT_FOLDER}\n onFolderClick={folder => {\n setParentId(folder.id);\n onChange(folder.id === ROOT_FOLDER ? null : folder.id);\n }}\n />\n )}\n </Bind>\n </ParentFolderField>\n </Grid.Column>\n </Grid>\n <Extensions />\n </>\n );\n};\n\nexport const useCreateDialog = (): UseCreateDialogResponse => {\n const dialogs = useDialogs();\n const { createFolder } = useCreateFolder();\n const { showSnackbar } = useSnackbar();\n\n const onAccept = useCallback(async (data: FolderDto) => {\n try {\n await createFolder({\n ...data,\n parentId: data.parentId === ROOT_FOLDER ? null : data.parentId\n });\n showSnackbar(\"Folder created successfully!\");\n } catch (error) {\n showSnackbar(error.message);\n }\n }, []);\n\n const showDialog = (params?: ShowDialogParams) => {\n const { currentParentId = null } = params ?? {};\n\n dialogs.showDialog({\n title: \"Create a new folder\",\n content: <FormComponent currentParentId={currentParentId} />,\n acceptLabel: \"Create folder\",\n cancelLabel: \"Cancel\",\n loadingLabel: \"Creating folder...\",\n /**\n * We need to cast as there are no generics to pass for the onAccept function.\n */\n onAccept: onAccept as (data: GenericFormData) => Promise<void>\n });\n };\n\n return {\n showDialog\n };\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACpD,OAAOC,OAAO,MAAM,SAAS;AAC7B,SAASC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;AAC9C,SAASC,UAAU,EAAEC,WAAW,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a,CAAC,GAAG/C,WAAW,CAAC,CAAC;EAEtC,MAAMgD,QAAQ,GAAGtD,WAAW,CAAC,MAAOqB,IAAe,IAAK;IACpD,IAAI;MACA,MAAM+B,YAAY,CAAC;QACf,GAAG/B,IAAI;QACPJ,QAAQ,EAAEI,IAAI,CAACJ,QAAQ,KAAKL,WAAW,GAAG,IAAI,GAAGS,IAAI,CAACJ;MAC1D,CAAC,CAAC;MACFoC,YAAY,CAAC,8BAA8B,CAAC;IAChD,CAAC,CAAC,OAAOE,KAAK,EAAE;MACZF,YAAY,CAACE,KAAK,CAACC,OAAO,CAAC;IAC/B;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,UAAU,GAAIC,MAAyB,IAAK;IAC9C,MAAM;MAAE1C,eAAe,GAAG;IAAK,CAAC,GAAG0C,MAAM,IAAI,CAAC,CAAC;IAE/CP,OAAO,CAACM,UAAU,CAAC;MACflC,KAAK,EAAE,qBAAqB;MAC5BoC,OAAO,eAAE5D,KAAA,CAAA8B,aAAA,CAACd,aAAa;QAACC,eAAe,EAAEA;MAAgB,CAAE,CAAC;MAC5D4C,WAAW,EAAE,eAAe;MAC5BC,WAAW,EAAE,QAAQ;MACrBC,YAAY,EAAE,oBAAoB;MAClC;AACZ;AACA;MACYR,QAAQ,EAAEA;IACd,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACHG;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-aco",
|
|
3
|
-
"version": "6.3.0-beta.
|
|
3
|
+
"version": "6.3.0-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
6
9
|
"repository": {
|
|
7
10
|
"type": "git",
|
|
8
11
|
"url": "https://github.com/webiny/webiny-js.git",
|
|
@@ -13,24 +16,24 @@
|
|
|
13
16
|
"license": "MIT",
|
|
14
17
|
"dependencies": {
|
|
15
18
|
"@apollo/react-hooks": "3.1.5",
|
|
16
|
-
"@webiny/admin-ui": "6.3.0-beta.
|
|
17
|
-
"@webiny/app": "6.3.0-beta.
|
|
18
|
-
"@webiny/app-admin": "6.3.0-beta.
|
|
19
|
-
"@webiny/app-headless-cms-common": "6.3.0-beta.
|
|
20
|
-
"@webiny/app-utils": "6.3.0-beta.
|
|
21
|
-
"@webiny/feature": "6.3.0-beta.
|
|
22
|
-
"@webiny/form": "6.3.0-beta.
|
|
23
|
-
"@webiny/icons": "6.3.0-beta.
|
|
24
|
-
"@webiny/plugins": "6.3.0-beta.
|
|
25
|
-
"@webiny/react-properties": "6.3.0-beta.
|
|
26
|
-
"@webiny/shared-aco": "6.3.0-beta.
|
|
27
|
-
"@webiny/utils": "6.3.0-beta.
|
|
28
|
-
"@webiny/validation": "6.3.0-beta.
|
|
19
|
+
"@webiny/admin-ui": "6.3.0-beta.3",
|
|
20
|
+
"@webiny/app": "6.3.0-beta.3",
|
|
21
|
+
"@webiny/app-admin": "6.3.0-beta.3",
|
|
22
|
+
"@webiny/app-headless-cms-common": "6.3.0-beta.3",
|
|
23
|
+
"@webiny/app-utils": "6.3.0-beta.3",
|
|
24
|
+
"@webiny/feature": "6.3.0-beta.3",
|
|
25
|
+
"@webiny/form": "6.3.0-beta.3",
|
|
26
|
+
"@webiny/icons": "6.3.0-beta.3",
|
|
27
|
+
"@webiny/plugins": "6.3.0-beta.3",
|
|
28
|
+
"@webiny/react-properties": "6.3.0-beta.3",
|
|
29
|
+
"@webiny/shared-aco": "6.3.0-beta.3",
|
|
30
|
+
"@webiny/utils": "6.3.0-beta.3",
|
|
31
|
+
"@webiny/validation": "6.3.0-beta.3",
|
|
29
32
|
"dot-prop-immutable": "2.1.1",
|
|
30
33
|
"graphql": "16.13.2",
|
|
31
34
|
"graphql-tag": "2.12.6",
|
|
32
35
|
"lodash": "4.18.1",
|
|
33
|
-
"mobx": "6.15.
|
|
36
|
+
"mobx": "6.15.1",
|
|
34
37
|
"mobx-react-lite": "4.1.1",
|
|
35
38
|
"react": "18.3.1",
|
|
36
39
|
"react-dom": "18.3.1",
|
|
@@ -39,18 +42,18 @@
|
|
|
39
42
|
},
|
|
40
43
|
"devDependencies": {
|
|
41
44
|
"@types/react": "18.3.28",
|
|
42
|
-
"@webiny/build-tools": "6.3.0-beta.
|
|
45
|
+
"@webiny/build-tools": "6.3.0-beta.3",
|
|
43
46
|
"@webiny/di": "0.2.3",
|
|
44
|
-
"@webiny/wcp": "6.3.0-beta.
|
|
47
|
+
"@webiny/wcp": "6.3.0-beta.3",
|
|
45
48
|
"apollo-client": "2.6.10",
|
|
46
49
|
"apollo-link": "1.2.14",
|
|
47
50
|
"rimraf": "6.1.3",
|
|
48
51
|
"typescript": "6.0.3",
|
|
49
|
-
"vitest": "4.1.
|
|
52
|
+
"vitest": "4.1.5"
|
|
50
53
|
},
|
|
51
54
|
"publishConfig": {
|
|
52
55
|
"access": "public",
|
|
53
56
|
"directory": "dist"
|
|
54
57
|
},
|
|
55
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "e154ec3326903876c357d35422dc60d29e061419"
|
|
56
59
|
}
|