@webiny/app-headless-cms 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.eb196ccd2f
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/ContentEntryListConfig.d.ts +7 -2
- package/admin/components/ContentEntries/Scheduler/actions/ScheduleEntryAction.js +32 -23
- package/admin/components/ContentEntries/Scheduler/actions/ScheduleEntryAction.js.map +1 -1
- package/admin/components/ContentEntries/Scheduler/actions/hooks/useGetSchedulerItem.js +5 -2
- package/admin/components/ContentEntries/Scheduler/actions/hooks/useGetSchedulerItem.js.map +1 -1
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerGetGraphQLGateway.d.ts +11 -13
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerGetGraphQLGateway.js +15 -7
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerGetGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerListGraphQLGateway.js +1 -3
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerListGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerPublishGraphQLGateway.js +8 -2
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerPublishGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerUnpublishGraphQLGateway.d.ts +3 -3
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerUnpublishGraphQLGateway.js +4 -2
- package/admin/components/ContentEntries/Scheduler/adapters/SchedulerUnpublishGraphQLGateway.js.map +1 -1
- package/admin/components/ContentEntries/Scheduler/adapters/index.d.ts +5 -0
- package/admin/components/ContentEntries/Scheduler/adapters/index.js +7 -0
- package/admin/components/ContentEntries/Scheduler/adapters/index.js.map +1 -0
- package/admin/components/ContentEntries/Scheduler/adapters/schema/schedulerEntry.d.ts +13 -13
- package/admin/components/ContentEntries/Scheduler/adapters/schema/schedulerEntry.js +6 -2
- package/admin/components/ContentEntries/Scheduler/adapters/schema/schedulerEntry.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellActions.js +3 -3
- package/admin/components/ContentEntries/Table/Cells/CellActions.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellAuthor.js +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellAuthor.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellCreated.js +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellCreated.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellModified.js +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellModified.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellName.d.ts +4 -4
- package/admin/components/ContentEntries/Table/Cells/CellName.js +2 -2
- package/admin/components/ContentEntries/Table/Cells/CellName.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellStatus.js +4 -3
- package/admin/components/ContentEntries/Table/Cells/CellStatus.js.map +1 -1
- package/admin/components/ContentEntries/Table/index.js +6 -3
- package/admin/components/ContentEntries/Table/index.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/AdvancedSearch/FieldRenderer.d.ts +2 -2
- package/admin/config/contentEntries/list/Browser/AdvancedSearch/FieldRenderer.js +1 -2
- package/admin/config/contentEntries/list/Browser/AdvancedSearch/FieldRenderer.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/EntryAction.d.ts +2 -2
- package/admin/config/contentEntries/list/Browser/EntryAction.js +1 -2
- package/admin/config/contentEntries/list/Browser/EntryAction.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/FolderAction.d.ts +2 -2
- package/admin/config/contentEntries/list/Browser/FolderAction.js +1 -2
- package/admin/config/contentEntries/list/Browser/FolderAction.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/Table/Column.d.ts +9 -4
- package/admin/config/contentEntries/list/Browser/Table/Column.js +5 -3
- package/admin/config/contentEntries/list/Browser/Table/Column.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/Table/index.d.ts +7 -2
- package/admin/config/contentEntries/list/Browser/index.d.ts +7 -2
- package/admin/config/contentEntries/list/ContentEntryListConfig.d.ts +7 -2
- package/admin/hooks/useEntry.d.ts +3 -3
- package/admin/hooks/useEntry.js.map +1 -1
- package/admin/hooks/useModelFieldGraphqlContext.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/index.js +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/FieldSettings.d.ts +1 -1
- package/admin/plugins/index.d.ts +3 -3
- package/admin/views/contentEntries/ContentEntry/SingletonContentEntry.js +3 -3
- package/admin/views/contentEntries/ContentEntry/SingletonContentEntry.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/useMockRecords.d.ts +1 -1
- package/admin/views/contentEntries/hooks/useContentEntriesList.d.ts +6 -5
- package/admin/views/contentEntries/hooks/useContentEntriesList.js +5 -12
- package/admin/views/contentEntries/hooks/useContentEntriesList.js.map +1 -1
- package/admin/views/contentEntries/hooks/useMoveContentEntryToFolder.d.ts +2 -2
- package/admin/views/contentEntries/hooks/useMoveContentEntryToFolder.js.map +1 -1
- package/allPlugins.d.ts +4 -4
- package/package.json +30 -30
- package/types.d.ts +3 -3
- package/types.js.map +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const useMockRecords: () => {
|
|
2
2
|
loading: import("@webiny/app-aco/types").Loading<import("@webiny/app-aco/types").LoadingActions>;
|
|
3
|
-
meta: import("@webiny/app-aco
|
|
3
|
+
meta: import("@webiny/app-aco").ListMeta;
|
|
4
4
|
records: import("@webiny/app-aco/table.types").SearchRecordItem<import("@webiny/app-aco/types").GenericSearchData>[];
|
|
5
5
|
listRecords(params: import("@webiny/app-aco/types").ListSearchRecordsQueryVariables): Promise<import("@webiny/app-aco/table.types").SearchRecordItem<import("@webiny/app-aco/types").GenericSearchData>[]>;
|
|
6
6
|
getRecord(id: string): Promise<import("@webiny/app-aco/table.types").SearchRecordItem<import("@webiny/app-aco/types").GenericSearchData> | null>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { CmsContentEntry,
|
|
2
|
+
import type { CmsContentEntry, TableItem } from "../../../../types";
|
|
3
3
|
import type { OnSortingChange, Sorting } from "@webiny/ui/DataTable";
|
|
4
|
-
import type {
|
|
4
|
+
import type { ListMeta } from "@webiny/app-aco";
|
|
5
|
+
import type { FolderItem } from "@webiny/app-aco/types";
|
|
5
6
|
export interface ContentEntriesListProviderContext {
|
|
6
7
|
modelId: string;
|
|
7
8
|
folderId: string;
|
|
8
9
|
navigateTo: (folderId?: string) => void;
|
|
9
|
-
folders:
|
|
10
|
-
getEntryEditUrl: (item:
|
|
10
|
+
folders: FolderItem[];
|
|
11
|
+
getEntryEditUrl: (item: CmsContentEntry) => string;
|
|
11
12
|
hideFilters: () => void;
|
|
12
13
|
isListLoading: boolean;
|
|
13
14
|
isListLoadingMore: boolean;
|
|
@@ -16,7 +17,7 @@ export interface ContentEntriesListProviderContext {
|
|
|
16
17
|
listTitle?: string;
|
|
17
18
|
meta: ListMeta;
|
|
18
19
|
onSelectRow: (rows: TableItem[] | []) => void;
|
|
19
|
-
records:
|
|
20
|
+
records: CmsContentEntry[];
|
|
20
21
|
search: string;
|
|
21
22
|
selected: CmsContentEntry[];
|
|
22
23
|
setSearch: (value: string) => void;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React, { useCallback, useEffect,
|
|
1
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
2
2
|
import debounce from "lodash/debounce";
|
|
3
|
-
import omit from "lodash/omit";
|
|
4
3
|
import { useRouter } from "@webiny/react-router";
|
|
5
4
|
import { makeDecoratable } from "@webiny/react-composition";
|
|
6
5
|
import { useContentEntries } from "./useContentEntries";
|
|
7
|
-
import {
|
|
6
|
+
import { createSort, useAcoList, useNavigateFolder } from "@webiny/app-aco";
|
|
8
7
|
import { CMS_ENTRY_LIST_LINK, ROOT_FOLDER } from "../../../constants";
|
|
9
8
|
export const ContentEntriesListContext = /*#__PURE__*/React.createContext(undefined);
|
|
10
9
|
export const ContentEntriesListProvider = ({
|
|
@@ -84,7 +83,7 @@ export const ContentEntriesListProvider = ({
|
|
|
84
83
|
}, [search]);
|
|
85
84
|
const onSelectRow = rows => {
|
|
86
85
|
const items = rows.filter(item => item.$type === "RECORD");
|
|
87
|
-
const cmsContentEntries = items.map(item =>
|
|
86
|
+
const cmsContentEntries = items.map(item => item.data);
|
|
88
87
|
setSelected(cmsContentEntries);
|
|
89
88
|
};
|
|
90
89
|
const getEntryEditUrl = useCallback(entry => {
|
|
@@ -92,12 +91,6 @@ export const ContentEntriesListProvider = ({
|
|
|
92
91
|
const idPath = encodeURIComponent(entry.id);
|
|
93
92
|
return `${baseUrl}?id=${idPath}${folderPath}`;
|
|
94
93
|
}, [baseUrl, currentFolderId]);
|
|
95
|
-
const records = useMemo(() => {
|
|
96
|
-
return createRecordsData(initialRecords);
|
|
97
|
-
}, [initialRecords]);
|
|
98
|
-
const folders = useMemo(() => {
|
|
99
|
-
return createFoldersData(initialFolders);
|
|
100
|
-
}, [initialFolders]);
|
|
101
94
|
useEffect(() => {
|
|
102
95
|
if (!sorting?.length) {
|
|
103
96
|
return;
|
|
@@ -116,7 +109,7 @@ export const ContentEntriesListProvider = ({
|
|
|
116
109
|
modelId: contentModel.modelId,
|
|
117
110
|
folderId: currentFolderId || ROOT_FOLDER,
|
|
118
111
|
navigateTo,
|
|
119
|
-
folders,
|
|
112
|
+
folders: initialFolders,
|
|
120
113
|
getEntryEditUrl,
|
|
121
114
|
isListLoading,
|
|
122
115
|
isListLoadingMore,
|
|
@@ -125,7 +118,7 @@ export const ContentEntriesListProvider = ({
|
|
|
125
118
|
listMoreRecords,
|
|
126
119
|
meta,
|
|
127
120
|
onSelectRow,
|
|
128
|
-
records,
|
|
121
|
+
records: initialRecords,
|
|
129
122
|
search,
|
|
130
123
|
selected,
|
|
131
124
|
setSelected,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useMemo","useState","debounce","omit","useRouter","makeDecoratable","useContentEntries","createFoldersData","createRecordsData","createSort","useAcoList","useNavigateFolder","CMS_ENTRY_LIST_LINK","ROOT_FOLDER","ContentEntriesListContext","createContext","undefined","ContentEntriesListProvider","children","history","contentModel","currentFolderId","folders","initialFolders","isListLoading","isListLoadingMore","isSearch","listMoreRecords","listTitle","meta","records","initialRecords","selected","setSearchQuery","setListSort","setFilters","setSelected","showFilters","hideFilters","showingFilters","showingSelectAll","isSelectedAll","selectAll","unselectAll","getWhere","sorting","setSorting","search","setSearch","query","URLSearchParams","location","searchQuery","get","baseUrl","modelId","updateSearch","delete","set","push","toString","onSelectRow","rows","items","filter","item","$type","cmsContentEntries","map","getEntryEditUrl","entry","folderPath","encodeURIComponent","idPath","id","length","sort","navigateTo","input","folderId","context","createElement","Provider","value","useContentEntriesList","useContext","Error"],"sources":["useContentEntriesList.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport debounce from \"lodash/debounce\";\nimport omit from \"lodash/omit\";\nimport { useRouter } from \"@webiny/react-router\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { useContentEntries } from \"./useContentEntries\";\nimport type { CmsContentEntry, EntryTableItem, TableItem } from \"~/types\";\nimport type { OnSortingChange, Sorting } from \"@webiny/ui/DataTable\";\nimport {\n createFoldersData,\n createRecordsData,\n createSort,\n useAcoList,\n useNavigateFolder\n} from \"@webiny/app-aco\";\nimport { CMS_ENTRY_LIST_LINK, ROOT_FOLDER } from \"~/admin/constants\";\nimport type { FolderTableItem, ListMeta } from \"@webiny/app-aco/types\";\n\ninterface UpdateSearchCallableParams {\n search: string;\n query: URLSearchParams;\n}\ninterface UpdateSearchCallable {\n (params: UpdateSearchCallableParams): void;\n}\n\nexport interface ContentEntriesListProviderContext {\n modelId: string;\n folderId: string;\n navigateTo: (folderId?: string) => void;\n folders: FolderTableItem[];\n getEntryEditUrl: (item: EntryTableItem) => string;\n hideFilters: () => void;\n isListLoading: boolean;\n isListLoadingMore: boolean;\n isSearch: boolean;\n listMoreRecords: () => void;\n listTitle?: string;\n meta: ListMeta;\n onSelectRow: (rows: TableItem[] | []) => void;\n records: EntryTableItem[];\n search: string;\n selected: CmsContentEntry[];\n setSearch: (value: string) => void;\n setSelected: (data: CmsContentEntry[]) => void;\n setSorting: OnSortingChange;\n showFilters: () => void;\n showingFilters: boolean;\n showingSelectAll: boolean;\n sorting: Sorting;\n setFilters: (data: Record<string, any>) => void;\n selectAll: () => void;\n unselectAll: () => void;\n isSelectedAll: boolean;\n getWhere: () => Record<string, any>;\n searchQuery: string;\n}\n\nexport const ContentEntriesListContext = React.createContext<\n ContentEntriesListProviderContext | undefined\n>(undefined);\n\ninterface ContentEntriesListProviderProps {\n children: React.ReactNode;\n}\n\nexport const ContentEntriesListProvider = ({ children }: ContentEntriesListProviderProps) => {\n const { history } = useRouter();\n const { contentModel } = useContentEntries();\n const { currentFolderId } = useNavigateFolder();\n\n const {\n folders: initialFolders,\n isListLoading,\n isListLoadingMore,\n isSearch,\n listMoreRecords,\n listTitle,\n meta,\n records: initialRecords,\n selected,\n setSearchQuery,\n setListSort,\n setFilters,\n setSelected,\n showFilters,\n hideFilters,\n showingFilters,\n showingSelectAll,\n isSelectedAll,\n selectAll,\n unselectAll,\n getWhere\n } = useAcoList<CmsContentEntry>();\n\n const [sorting, setSorting] = useState<Sorting>([]);\n const [search, setSearch] = useState<string>(\"\");\n const query = new URLSearchParams(location.search);\n const searchQuery = query.get(\"search\") || \"\";\n const baseUrl = `${CMS_ENTRY_LIST_LINK}/${contentModel.modelId}`;\n\n // Search-related logics: update `searchQuery` state and querystring\n const updateSearch = useCallback(\n debounce<UpdateSearchCallable>(({ search, query }) => {\n const searchQuery = query.get(\"search\");\n\n if (typeof searchQuery !== \"string\" && !search) {\n return;\n }\n\n setSearchQuery(search);\n\n if (searchQuery !== search) {\n if (!search) {\n // In case of empty `search` - remove it from `querystring`\n query.delete(\"search\");\n } else {\n // Otherwise, add it to `querystring`\n query.set(\"search\", search);\n }\n history.push(`${baseUrl}?${query.toString()}`);\n }\n }, 500),\n [baseUrl]\n );\n\n // Set \"search\" from search \"query\" on page load.\n useEffect(() => {\n setSearch(searchQuery);\n }, [searchQuery]);\n\n // When \"search\" changes, trigger search-related logics\n useEffect(() => {\n updateSearch({ search, query });\n }, [search]);\n\n const onSelectRow: ContentEntriesListProviderContext[\"onSelectRow\"] = rows => {\n const items = rows.filter(item => item.$type === \"RECORD\");\n\n const cmsContentEntries = items\n .map(item => omit(item, [\"$type\", \"$selectable\"]))\n .map(item => item as unknown as CmsContentEntry);\n\n setSelected(cmsContentEntries);\n };\n\n const getEntryEditUrl = useCallback(\n (entry: EntryTableItem): string => {\n const folderPath = currentFolderId\n ? `&folderId=${encodeURIComponent(currentFolderId)}`\n : \"\";\n\n const idPath = encodeURIComponent(entry.id);\n\n return `${baseUrl}?id=${idPath}${folderPath}`;\n },\n [baseUrl, currentFolderId]\n );\n\n const records = useMemo(() => {\n return createRecordsData(initialRecords);\n }, [initialRecords]);\n\n const folders = useMemo(() => {\n return createFoldersData(initialFolders);\n }, [initialFolders]);\n\n useEffect(() => {\n if (!sorting?.length) {\n return;\n }\n const sort = createSort(sorting);\n if (!sort) {\n return;\n }\n setListSort(sort);\n }, [sorting]);\n\n const navigateTo = useCallback(\n (input?: string) => {\n const folderId = encodeURIComponent(input || currentFolderId || ROOT_FOLDER);\n\n history.push(`${baseUrl}?folderId=${folderId}`);\n },\n [currentFolderId, baseUrl]\n );\n\n const context: ContentEntriesListProviderContext = {\n modelId: contentModel.modelId,\n folderId: currentFolderId || ROOT_FOLDER,\n navigateTo,\n folders,\n getEntryEditUrl,\n isListLoading,\n isListLoadingMore,\n isSearch,\n listTitle,\n listMoreRecords,\n meta,\n onSelectRow,\n records,\n search,\n selected,\n setSelected,\n setSearch,\n sorting,\n setSorting,\n showingFilters,\n showFilters,\n hideFilters,\n setFilters,\n showingSelectAll,\n isSelectedAll,\n selectAll,\n unselectAll,\n getWhere,\n searchQuery\n };\n\n return (\n <ContentEntriesListContext.Provider value={context}>\n {children}\n </ContentEntriesListContext.Provider>\n );\n};\n\nexport const useContentEntriesList = makeDecoratable((): ContentEntriesListProviderContext => {\n const context = React.useContext(ContentEntriesListContext);\n\n if (!context) {\n throw new Error(\"useContentEntriesList must be used within a ContentEntriesListContext\");\n }\n\n return context;\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,OAAOC,IAAI,MAAM,aAAa;AAC9B,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,iBAAiB;AAG1B,SACIC,iBAAiB,EACjBC,iBAAiB,EACjBC,UAAU,EACVC,UAAU,EACVC,iBAAiB,QACd,iBAAiB;AACxB,SAASC,mBAAmB,EAAEC,WAAW;AA2CzC,OAAO,MAAMC,yBAAyB,gBAAGjB,KAAK,CAACkB,aAAa,CAE1DC,SAAS,CAAC;AAMZ,OAAO,MAAMC,0BAA0B,GAAGA,CAAC;EAAEC;AAA0C,CAAC,KAAK;EACzF,MAAM;IAAEC;EAAQ,CAAC,GAAGf,SAAS,CAAC,CAAC;EAC/B,MAAM;IAAEgB;EAAa,CAAC,GAAGd,iBAAiB,CAAC,CAAC;EAC5C,MAAM;IAAEe;EAAgB,CAAC,GAAGV,iBAAiB,CAAC,CAAC;EAE/C,MAAM;IACFW,OAAO,EAAEC,cAAc;IACvBC,aAAa;IACbC,iBAAiB;IACjBC,QAAQ;IACRC,eAAe;IACfC,SAAS;IACTC,IAAI;IACJC,OAAO,EAAEC,cAAc;IACvBC,QAAQ;IACRC,cAAc;IACdC,WAA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AM,IAAIM,KAAK,CAAC,uEAAuE,CAAC;EAC5F;EAEA,OAAON,OAAO;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useState","debounce","useRouter","makeDecoratable","useContentEntries","createSort","useAcoList","useNavigateFolder","CMS_ENTRY_LIST_LINK","ROOT_FOLDER","ContentEntriesListContext","createContext","undefined","ContentEntriesListProvider","children","history","contentModel","currentFolderId","folders","initialFolders","isListLoading","isListLoadingMore","isSearch","listMoreRecords","listTitle","meta","records","initialRecords","selected","setSearchQuery","setListSort","setFilters","setSelected","showFilters","hideFilters","showingFilters","showingSelectAll","isSelectedAll","selectAll","unselectAll","getWhere","sorting","setSorting","search","setSearch","query","URLSearchParams","location","searchQuery","get","baseUrl","modelId","updateSearch","delete","set","push","toString","onSelectRow","rows","items","filter","item","$type","cmsContentEntries","map","data","getEntryEditUrl","entry","folderPath","encodeURIComponent","idPath","id","length","sort","navigateTo","input","folderId","context","createElement","Provider","value","useContentEntriesList","useContext","Error"],"sources":["useContentEntriesList.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport debounce from \"lodash/debounce\";\nimport { useRouter } from \"@webiny/react-router\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { useContentEntries } from \"./useContentEntries\";\nimport type { CmsContentEntry, TableItem } from \"~/types\";\nimport type { OnSortingChange, Sorting } from \"@webiny/ui/DataTable\";\nimport { createSort, useAcoList, useNavigateFolder } from \"@webiny/app-aco\";\nimport { CMS_ENTRY_LIST_LINK, ROOT_FOLDER } from \"~/admin/constants\";\nimport type { ListMeta } from \"@webiny/app-aco\";\nimport type { FolderItem } from \"@webiny/app-aco/types\";\n\ninterface UpdateSearchCallableParams {\n search: string;\n query: URLSearchParams;\n}\ninterface UpdateSearchCallable {\n (params: UpdateSearchCallableParams): void;\n}\n\nexport interface ContentEntriesListProviderContext {\n modelId: string;\n folderId: string;\n navigateTo: (folderId?: string) => void;\n folders: FolderItem[];\n getEntryEditUrl: (item: CmsContentEntry) => string;\n hideFilters: () => void;\n isListLoading: boolean;\n isListLoadingMore: boolean;\n isSearch: boolean;\n listMoreRecords: () => void;\n listTitle?: string;\n meta: ListMeta;\n onSelectRow: (rows: TableItem[] | []) => void;\n records: CmsContentEntry[];\n search: string;\n selected: CmsContentEntry[];\n setSearch: (value: string) => void;\n setSelected: (data: CmsContentEntry[]) => void;\n setSorting: OnSortingChange;\n showFilters: () => void;\n showingFilters: boolean;\n showingSelectAll: boolean;\n sorting: Sorting;\n setFilters: (data: Record<string, any>) => void;\n selectAll: () => void;\n unselectAll: () => void;\n isSelectedAll: boolean;\n getWhere: () => Record<string, any>;\n searchQuery: string;\n}\n\nexport const ContentEntriesListContext = React.createContext<\n ContentEntriesListProviderContext | undefined\n>(undefined);\n\ninterface ContentEntriesListProviderProps {\n children: React.ReactNode;\n}\n\nexport const ContentEntriesListProvider = ({ children }: ContentEntriesListProviderProps) => {\n const { history } = useRouter();\n const { contentModel } = useContentEntries();\n const { currentFolderId } = useNavigateFolder();\n\n const {\n folders: initialFolders,\n isListLoading,\n isListLoadingMore,\n isSearch,\n listMoreRecords,\n listTitle,\n meta,\n records: initialRecords,\n selected,\n setSearchQuery,\n setListSort,\n setFilters,\n setSelected,\n showFilters,\n hideFilters,\n showingFilters,\n showingSelectAll,\n isSelectedAll,\n selectAll,\n unselectAll,\n getWhere\n } = useAcoList<CmsContentEntry>();\n\n const [sorting, setSorting] = useState<Sorting>([]);\n const [search, setSearch] = useState<string>(\"\");\n const query = new URLSearchParams(location.search);\n const searchQuery = query.get(\"search\") || \"\";\n const baseUrl = `${CMS_ENTRY_LIST_LINK}/${contentModel.modelId}`;\n\n // Search-related logics: update `searchQuery` state and querystring\n const updateSearch = useCallback(\n debounce<UpdateSearchCallable>(({ search, query }) => {\n const searchQuery = query.get(\"search\");\n\n if (typeof searchQuery !== \"string\" && !search) {\n return;\n }\n\n setSearchQuery(search);\n\n if (searchQuery !== search) {\n if (!search) {\n // In case of empty `search` - remove it from `querystring`\n query.delete(\"search\");\n } else {\n // Otherwise, add it to `querystring`\n query.set(\"search\", search);\n }\n history.push(`${baseUrl}?${query.toString()}`);\n }\n }, 500),\n [baseUrl]\n );\n\n // Set \"search\" from search \"query\" on page load.\n useEffect(() => {\n setSearch(searchQuery);\n }, [searchQuery]);\n\n // When \"search\" changes, trigger search-related logics\n useEffect(() => {\n updateSearch({ search, query });\n }, [search]);\n\n const onSelectRow: ContentEntriesListProviderContext[\"onSelectRow\"] = rows => {\n const items = rows.filter(item => item.$type === \"RECORD\");\n\n const cmsContentEntries = items.map(item => item.data as CmsContentEntry);\n\n setSelected(cmsContentEntries);\n };\n\n const getEntryEditUrl = useCallback(\n (entry: CmsContentEntry): string => {\n const folderPath = currentFolderId\n ? `&folderId=${encodeURIComponent(currentFolderId)}`\n : \"\";\n\n const idPath = encodeURIComponent(entry.id);\n\n return `${baseUrl}?id=${idPath}${folderPath}`;\n },\n [baseUrl, currentFolderId]\n );\n\n useEffect(() => {\n if (!sorting?.length) {\n return;\n }\n const sort = createSort(sorting);\n if (!sort) {\n return;\n }\n setListSort(sort);\n }, [sorting]);\n\n const navigateTo = useCallback(\n (input?: string) => {\n const folderId = encodeURIComponent(input || currentFolderId || ROOT_FOLDER);\n\n history.push(`${baseUrl}?folderId=${folderId}`);\n },\n [currentFolderId, baseUrl]\n );\n\n const context: ContentEntriesListProviderContext = {\n modelId: contentModel.modelId,\n folderId: currentFolderId || ROOT_FOLDER,\n navigateTo,\n folders: initialFolders,\n getEntryEditUrl,\n isListLoading,\n isListLoadingMore,\n isSearch,\n listTitle,\n listMoreRecords,\n meta,\n onSelectRow,\n records: initialRecords,\n search,\n selected,\n setSelected,\n setSearch,\n sorting,\n setSorting,\n showingFilters,\n showFilters,\n hideFilters,\n setFilters,\n showingSelectAll,\n isSelectedAll,\n selectAll,\n unselectAll,\n getWhere,\n searchQuery\n };\n\n return (\n <ContentEntriesListContext.Provider value={context}>\n {children}\n </ContentEntriesListContext.Provider>\n );\n};\n\nexport const useContentEntriesList = makeDecoratable((): ContentEntriesListProviderContext => {\n const context = React.useContext(ContentEntriesListContext);\n\n if (!context) {\n throw new Error(\"useContentEntriesList must be used within a ContentEntriesListContext\");\n }\n\n return context;\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC/D,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,iBAAiB;AAG1B,SAASC,UAAU,EAAEC,UAAU,EAAEC,iBAAiB,QAAQ,iBAAiB;AAC3E,SAASC,mBAAmB,EAAEC,WAAW;AA4CzC,OAAO,MAAMC,yBAAyB,gBAAGb,KAAK,CAACc,aAAa,CAE1DC,SAAS,CAAC;AAMZ,OAAO,MAAMC,0BAA0B,GAAGA,CAAC;EAAEC;AAA0C,CAAC,KAAK;EACzF,MAAM;IAAEC;EAAQ,CAAC,GAAGb,SAAS,CAAC,CAAC;EAC/B,MAAM;IAAEc;EAAa,CAAC,GAAGZ,iBAAiB,CAAC,CAAC;EAC5C,MAAM;IAAEa;EAAgB,CAAC,GAAGV,iBAAiB,CAAC,CAAC;EAE/C,MAAM;IACFW,OAAO,EAAEC,cAAc;IACvBC,aAAa;IACbC,iBAAiB;IACjBC,QAAQ;IACRC,eAAe;IACfC,SAAS;IACTC,IAAI;IACJC,OAAO,EAAEC,cAAc;IACvBC,QAAQ;IACRC,cAAc;IACdC,WAAW;IACXC,UAAU;IACVC,WAAW;IACXC,WAAW;IACXC,WAAW;IACXC,cAAc;IACdC,gBAAgB;IAChBC,aAAa;IACbC,SAAS;IACTC,WAAW;IACXC;EACJ,CAAC,GAAGlC,UAAU,CAAkB,CAAC;EAEjC,MAAM,CAACmC,OAAO,EAAEC,UAAU,CAAC,GAAG1C,QAAQ,CAAU,EAAE,CAAC;EACnD,MAAM,C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,OAAO,EAAEC,cAAc;IACvB+C,eAAe;IACf9C,aAAa;IACbC,iBAAiB;IACjBC,QAAQ;IACRE,SAAS;IACTD,eAAe;IACfE,IAAI;IACJgC,WAAW;IACX/B,OAAO,EAAEC,cAAc;IACvBgB,MAAM;IACNf,QAAQ;IACRI,WAAW;IACXY,SAAS;IACTH,OAAO;IACPC,UAAU;IACVP,cAAc;IACdF,WAAW;IACXC,WAAW;IACXH,UAAU;IACVK,gBAAgB;IAChBC,aAAa;IACbC,SAAS;IACTC,WAAW;IACXC,QAAQ;IACRQ;EACJ,CAAC;EAED,oBACInD,KAAA,CAAAiF,aAAA,CAACpE,yBAAyB,CAACqE,QAAQ;IAACC,KAAK,EAAEH;EAAQ,GAC9C/D,QAC+B,CAAC;AAE7C,CAAC;AAED,OAAO,MAAMmE,qBAAqB,GAAG9E,eAAe,CAAC,MAAyC;EAC1F,MAAM0E,OAAO,GAAGhF,KAAK,CAACqF,UAAU,CAACxE,yBAAyB,CAAC;EAE3D,IAAI,CAACmE,OAAO,EAAE;IACV,MAAM,IAAIM,KAAK,CAAC,uEAAuE,CAAC;EAC5F;EAEA,OAAON,OAAO;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CmsContentEntry } from "../../../../types";
|
|
2
2
|
interface UseMoveContentEntryToFolder {
|
|
3
|
-
record:
|
|
3
|
+
record: CmsContentEntry;
|
|
4
4
|
}
|
|
5
5
|
export declare function useMoveContentEntryToFolder({ record }: UseMoveContentEntryToFolder): () => void;
|
|
6
6
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useSnackbar","useMoveToFolderDialog","useRecords","useMoveContentEntryToFolder","record","showSnackbar","showDialog","moveRecord","title","message","loadingLabel","acceptLabel","focusedFolderId","wbyAco_location","folderId","onAccept","folder","id","location","label"],"sources":["useMoveContentEntryToFolder.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { useMoveToFolderDialog, useRecords } from \"@webiny/app-aco\";\nimport type {
|
|
1
|
+
{"version":3,"names":["useCallback","useSnackbar","useMoveToFolderDialog","useRecords","useMoveContentEntryToFolder","record","showSnackbar","showDialog","moveRecord","title","message","loadingLabel","acceptLabel","focusedFolderId","wbyAco_location","folderId","onAccept","folder","id","location","label"],"sources":["useMoveContentEntryToFolder.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useSnackbar } from \"@webiny/app-admin\";\nimport { useMoveToFolderDialog, useRecords } from \"@webiny/app-aco\";\nimport type { CmsContentEntry } from \"~/types\";\n\ninterface UseMoveContentEntryToFolder {\n record: CmsContentEntry;\n}\n\nexport function useMoveContentEntryToFolder({ record }: UseMoveContentEntryToFolder) {\n const { showSnackbar } = useSnackbar();\n const { showDialog } = useMoveToFolderDialog();\n const { moveRecord } = useRecords();\n\n return useCallback(() => {\n showDialog({\n title: \"Move entry to a new location\",\n message: \"Select a new location for this entry:\",\n loadingLabel: \"Moving entry...\",\n acceptLabel: \"Move entry\",\n focusedFolderId: record.wbyAco_location.folderId,\n async onAccept({ folder }) {\n await moveRecord({\n id: record.id,\n location: {\n folderId: folder.id\n }\n });\n showSnackbar(\n `Entry \"${record.title}\" was successfully moved to folder \"${folder.label}\"!`\n );\n }\n });\n }, [record.id]);\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,qBAAqB,EAAEC,UAAU,QAAQ,iBAAiB;AAOnE,OAAO,SAASC,2BAA2BA,CAAC;EAAEC;AAAoC,CAAC,EAAE;EACjF,MAAM;IAAEC;EAAa,CAAC,GAAGL,WAAW,CAAC,CAAC;EACtC,MAAM;IAAEM;EAAW,CAAC,GAAGL,qBAAqB,CAAC,CAAC;EAC9C,MAAM;IAAEM;EAAW,CAAC,GAAGL,UAAU,CAAC,CAAC;EAEnC,OAAOH,WAAW,CAAC,MAAM;IACrBO,UAAU,CAAC;MACPE,KAAK,EAAE,8BAA8B;MACrCC,OAAO,EAAE,uCAAuC;MAChDC,YAAY,EAAE,iBAAiB;MAC/BC,WAAW,EAAE,YAAY;MACzBC,eAAe,EAAER,MAAM,CAACS,eAAe,CAACC,QAAQ;MAChD,MAAMC,QAAQA,CAAC;QAAEC;MAAO,CAAC,EAAE;QACvB,MAAMT,UAAU,CAAC;UACbU,EAAE,EAAEb,MAAM,CAACa,EAAE;UACbC,QAAQ,EAAE;YACNJ,QAAQ,EAAEE,MAAM,CAACC;UACrB;QACJ,CAAC,CAAC;QACFZ,YAAY,CACR,UAAUD,MAAM,CAACI,KAAK,uCAAuCQ,MAAM,CAACG,KAAK,IAC7E,CAAC;MACL;IACJ,CAAC,CAAC;EACN,CAAC,EAAE,CAACf,MAAM,CAACa,EAAE,CAAC,CAAC;AACnB","ignoreList":[]}
|
package/allPlugins.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const _default: (import("@webiny/app-headless-cms-common/types").
|
|
2
|
+
declare const _default: (import("@webiny/app-headless-cms-common/types").CmsModelFieldRendererPlugin | import("@webiny/app-headless-cms-common/types").CmsModelFieldTypePlugin | import("@webiny/app-headless-cms-common/types").CmsModelFieldValidatorPlugin<any> | import("@webiny/app-headless-cms-common/types").CmsModelFieldRendererPlugin[] | (import("@webiny/app-headless-cms-common/types").CmsIconsPlugin | import("@webiny/app/types").RoutePlugin[] | import("@webiny/app-admin/types").AdminInstallationPlugin | import("@webiny/app-headless-cms-common/types").CmsFieldValueTransformer<{
|
|
3
3
|
id: string;
|
|
4
4
|
type: string;
|
|
5
5
|
fieldId: string;
|
|
@@ -7,7 +7,7 @@ declare const _default: (import("@webiny/app-headless-cms-common/types").CmsMode
|
|
|
7
7
|
label: string;
|
|
8
8
|
helpText?: string | undefined;
|
|
9
9
|
placeholderText?: string | undefined;
|
|
10
|
-
validation?: (import("@webiny/
|
|
10
|
+
validation?: (import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator | import("@webiny/validation/types").Validator)[] | undefined;
|
|
11
11
|
listValidation?: import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator[] | undefined;
|
|
12
12
|
multipleValues?: boolean | undefined;
|
|
13
13
|
predefinedValues?: import("@webiny/app-headless-cms-common/types").CmsEditorFieldPredefinedValues | undefined;
|
|
@@ -17,9 +17,9 @@ declare const _default: (import("@webiny/app-headless-cms-common/types").CmsMode
|
|
|
17
17
|
settings?: Record<string, any> | undefined;
|
|
18
18
|
} | ((props: import("@webiny/app-headless-cms-common/types").CmsModelFieldRendererProps) => import("react").ReactNode);
|
|
19
19
|
tags?: string[] | undefined;
|
|
20
|
-
}>[] | import("@webiny/app").ApolloCacheObjectIdPlugin<import("@webiny/app").ApolloCacheObject> | {
|
|
20
|
+
}>[] | import("@webiny/app-headless-cms-common/types").CmsEditorFormSettingsPlugin | import("@webiny/app-admin/types").AdminAppPermissionRendererPlugin | import("@webiny/app").ApolloCacheObjectIdPlugin<import("@webiny/app").ApolloCacheObject> | {
|
|
21
21
|
name: string;
|
|
22
22
|
type: string;
|
|
23
23
|
render(): import("react").JSX.Element;
|
|
24
|
-
}[])[] | import("@webiny/app-plugin-admin-welcome-screen/types").AdminWelcomeScreenWidgetPlugin)[];
|
|
24
|
+
}[])[] | import("@webiny/app-headless-cms-common/types").CmsModelFieldRegexValidatorExpressionPlugin | import("@webiny/app-plugin-admin-welcome-screen/types").AdminWelcomeScreenWidgetPlugin)[];
|
|
25
25
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-headless-cms",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.eb196ccd2f",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,33 +27,33 @@
|
|
|
27
27
|
"@lexical/utils": "0.23.1",
|
|
28
28
|
"@svgr/webpack": "6.5.1",
|
|
29
29
|
"@types/react": "18.2.79",
|
|
30
|
-
"@webiny/admin-ui": "0.0.0-unstable.
|
|
31
|
-
"@webiny/app": "0.0.0-unstable.
|
|
32
|
-
"@webiny/app-aco": "0.0.0-unstable.
|
|
33
|
-
"@webiny/app-admin": "0.0.0-unstable.
|
|
34
|
-
"@webiny/app-graphql-playground": "0.0.0-unstable.
|
|
35
|
-
"@webiny/app-headless-cms-common": "0.0.0-unstable.
|
|
36
|
-
"@webiny/app-headless-cms-scheduler": "0.0.0-unstable.
|
|
37
|
-
"@webiny/app-i18n": "0.0.0-unstable.
|
|
38
|
-
"@webiny/app-plugin-admin-welcome-screen": "0.0.0-unstable.
|
|
39
|
-
"@webiny/app-security": "0.0.0-unstable.
|
|
40
|
-
"@webiny/app-tenancy": "0.0.0-unstable.
|
|
41
|
-
"@webiny/app-trash-bin": "0.0.0-unstable.
|
|
42
|
-
"@webiny/error": "0.0.0-unstable.
|
|
43
|
-
"@webiny/feature-flags": "0.0.0-unstable.
|
|
44
|
-
"@webiny/form": "0.0.0-unstable.
|
|
45
|
-
"@webiny/icons": "0.0.0-unstable.
|
|
46
|
-
"@webiny/lexical-editor": "0.0.0-unstable.
|
|
47
|
-
"@webiny/lexical-nodes": "0.0.0-unstable.
|
|
48
|
-
"@webiny/lexical-theme": "0.0.0-unstable.
|
|
49
|
-
"@webiny/plugins": "0.0.0-unstable.
|
|
50
|
-
"@webiny/react-composition": "0.0.0-unstable.
|
|
51
|
-
"@webiny/react-properties": "0.0.0-unstable.
|
|
52
|
-
"@webiny/react-router": "0.0.0-unstable.
|
|
53
|
-
"@webiny/theme": "0.0.0-unstable.
|
|
54
|
-
"@webiny/ui": "0.0.0-unstable.
|
|
55
|
-
"@webiny/utils": "0.0.0-unstable.
|
|
56
|
-
"@webiny/validation": "0.0.0-unstable.
|
|
30
|
+
"@webiny/admin-ui": "0.0.0-unstable.eb196ccd2f",
|
|
31
|
+
"@webiny/app": "0.0.0-unstable.eb196ccd2f",
|
|
32
|
+
"@webiny/app-aco": "0.0.0-unstable.eb196ccd2f",
|
|
33
|
+
"@webiny/app-admin": "0.0.0-unstable.eb196ccd2f",
|
|
34
|
+
"@webiny/app-graphql-playground": "0.0.0-unstable.eb196ccd2f",
|
|
35
|
+
"@webiny/app-headless-cms-common": "0.0.0-unstable.eb196ccd2f",
|
|
36
|
+
"@webiny/app-headless-cms-scheduler": "0.0.0-unstable.eb196ccd2f",
|
|
37
|
+
"@webiny/app-i18n": "0.0.0-unstable.eb196ccd2f",
|
|
38
|
+
"@webiny/app-plugin-admin-welcome-screen": "0.0.0-unstable.eb196ccd2f",
|
|
39
|
+
"@webiny/app-security": "0.0.0-unstable.eb196ccd2f",
|
|
40
|
+
"@webiny/app-tenancy": "0.0.0-unstable.eb196ccd2f",
|
|
41
|
+
"@webiny/app-trash-bin": "0.0.0-unstable.eb196ccd2f",
|
|
42
|
+
"@webiny/error": "0.0.0-unstable.eb196ccd2f",
|
|
43
|
+
"@webiny/feature-flags": "0.0.0-unstable.eb196ccd2f",
|
|
44
|
+
"@webiny/form": "0.0.0-unstable.eb196ccd2f",
|
|
45
|
+
"@webiny/icons": "0.0.0-unstable.eb196ccd2f",
|
|
46
|
+
"@webiny/lexical-editor": "0.0.0-unstable.eb196ccd2f",
|
|
47
|
+
"@webiny/lexical-nodes": "0.0.0-unstable.eb196ccd2f",
|
|
48
|
+
"@webiny/lexical-theme": "0.0.0-unstable.eb196ccd2f",
|
|
49
|
+
"@webiny/plugins": "0.0.0-unstable.eb196ccd2f",
|
|
50
|
+
"@webiny/react-composition": "0.0.0-unstable.eb196ccd2f",
|
|
51
|
+
"@webiny/react-properties": "0.0.0-unstable.eb196ccd2f",
|
|
52
|
+
"@webiny/react-router": "0.0.0-unstable.eb196ccd2f",
|
|
53
|
+
"@webiny/theme": "0.0.0-unstable.eb196ccd2f",
|
|
54
|
+
"@webiny/ui": "0.0.0-unstable.eb196ccd2f",
|
|
55
|
+
"@webiny/utils": "0.0.0-unstable.eb196ccd2f",
|
|
56
|
+
"@webiny/validation": "0.0.0-unstable.eb196ccd2f",
|
|
57
57
|
"apollo-cache": "1.3.5",
|
|
58
58
|
"apollo-client": "2.6.10",
|
|
59
59
|
"apollo-link": "1.2.14",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@emotion/babel-plugin": "11.11.0",
|
|
84
|
-
"@webiny/project-utils": "0.0.0-unstable.
|
|
84
|
+
"@webiny/project-utils": "0.0.0-unstable.eb196ccd2f",
|
|
85
85
|
"babel-plugin-module-resolver": "5.0.2",
|
|
86
86
|
"rimraf": "6.0.1",
|
|
87
87
|
"typescript": "5.3.3"
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
]
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "eb196ccd2f32296e10f7add6dd7220d4e3abece4"
|
|
113
113
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { CmsContentEntry } from "@webiny/app-headless-cms-common/types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { FolderTableRow, RecordTableRow } from "@webiny/app-aco";
|
|
3
3
|
import type { DragSourceMonitor, XYCoord } from "react-dnd";
|
|
4
4
|
import type { DragDropManager, Identifier, Listener, Unsubscribe } from "dnd-core";
|
|
5
5
|
export * from "@webiny/app-headless-cms-common/types";
|
|
6
6
|
/***
|
|
7
7
|
* ###### TABLE ########
|
|
8
8
|
*/
|
|
9
|
-
export type EntryTableItem = CmsContentEntry
|
|
10
|
-
export type TableItem =
|
|
9
|
+
export type EntryTableItem = RecordTableRow<CmsContentEntry>;
|
|
10
|
+
export type TableItem = FolderTableRow | EntryTableItem;
|
|
11
11
|
export declare class DragSourceMonitorImpl<DragObject = unknown, DropResult = unknown> implements DragSourceMonitor<DragObject, DropResult> {
|
|
12
12
|
private internalMonitor;
|
|
13
13
|
private sourceId;
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CmsContentEntry } from \"@webiny/app-headless-cms-common/types\";\nimport type {
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CmsContentEntry } from \"@webiny/app-headless-cms-common/types\";\nimport type { FolderTableRow, RecordTableRow } from \"@webiny/app-aco\";\nimport type { DragSourceMonitor, XYCoord } from \"react-dnd\";\nimport type { DragDropManager, Identifier, Listener, Unsubscribe } from \"dnd-core\";\n\nexport * from \"@webiny/app-headless-cms-common/types\";\n\n/***\n * ###### TABLE ########\n */\nexport type EntryTableItem = RecordTableRow<CmsContentEntry>;\n\nexport type TableItem = FolderTableRow | EntryTableItem;\n\nexport declare class DragSourceMonitorImpl<DragObject = unknown, DropResult = unknown>\n implements DragSourceMonitor<DragObject, DropResult>\n{\n private internalMonitor;\n private sourceId;\n constructor(manager: DragDropManager);\n receiveHandlerId(sourceId: Identifier | null): void;\n getHandlerId(): Identifier | null;\n subscribeToStateChange(\n listener: Listener,\n options?: {\n handlerIds: Identifier[] | undefined;\n }\n ): Unsubscribe;\n subscribeToOffsetChange(listener: Listener): Unsubscribe;\n canDrag(): boolean;\n isDragging(): boolean;\n getItemType(): Identifier | null;\n getItem<T = DragObject>(): T;\n getDropResult<T = DropResult>(): T | null;\n didDrop(): boolean;\n getInitialClientOffset(): XYCoord | null;\n getInitialSourceClientOffset(): XYCoord | null;\n getClientOffset(): XYCoord | null;\n getDifferenceFromInitialOffset(): XYCoord | null;\n getSourceClientOffset(): XYCoord | null;\n getTargetIds(): Identifier[];\n}\n"],"mappings":"AAKA,cAAc,uCAAuC;;AAErD;AACA;AACA;AAFA","ignoreList":[]}
|