@payloadcms/next 3.0.0-alpha.8 → 3.0.0-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.
- package/dist/cjs/withPayload.cjs +87 -0
- package/dist/cjs/withPayload.cjs.map +1 -0
- package/dist/config.js +2 -12
- package/dist/config.js.map +1 -0
- package/dist/elements/LeaveWithoutSaving/index.js +25 -76
- package/dist/elements/LeaveWithoutSaving/index.js.map +1 -0
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js +11 -29
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -0
- package/dist/exports/layouts.d.ts +2 -0
- package/dist/exports/layouts.d.ts.map +1 -0
- package/dist/exports/layouts.js +3 -0
- package/dist/exports/layouts.js.map +1 -0
- package/dist/exports/routes.d.ts +3 -0
- package/dist/exports/routes.d.ts.map +1 -0
- package/dist/exports/routes.js +4 -0
- package/dist/exports/routes.js.map +1 -0
- package/dist/exports/utilities.d.ts +3 -0
- package/dist/exports/utilities.d.ts.map +1 -0
- package/dist/exports/utilities.js +4 -0
- package/dist/exports/utilities.js.map +1 -0
- package/dist/exports/views.d.ts +4 -0
- package/dist/exports/views.d.ts.map +1 -0
- package/dist/exports/views.js +5 -0
- package/dist/exports/views.js.map +1 -0
- package/dist/index.js +3 -35
- package/dist/index.js.map +1 -0
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +62 -77
- package/dist/layouts/Root/index.js.map +1 -0
- package/dist/next-fileupload/fileFactory.d.ts +2 -2
- package/dist/next-fileupload/fileFactory.d.ts.map +1 -1
- package/dist/next-fileupload/fileFactory.js +9 -19
- package/dist/next-fileupload/fileFactory.js.map +1 -0
- package/dist/next-fileupload/handlers.d.ts +2 -2
- package/dist/next-fileupload/handlers.d.ts.map +1 -1
- package/dist/next-fileupload/handlers.js +25 -89
- package/dist/next-fileupload/handlers.js.map +1 -0
- package/dist/next-fileupload/index.d.ts +1 -1
- package/dist/next-fileupload/index.js +10 -25
- package/dist/next-fileupload/index.js.map +1 -0
- package/dist/next-fileupload/isEligibleRequest.js +2 -12
- package/dist/next-fileupload/isEligibleRequest.js.map +1 -0
- package/dist/next-fileupload/processMultipart.d.ts +1 -1
- package/dist/next-fileupload/processMultipart.d.ts.map +1 -1
- package/dist/next-fileupload/processMultipart.js +33 -46
- package/dist/next-fileupload/processMultipart.js.map +1 -0
- package/dist/next-fileupload/processNested.js +4 -14
- package/dist/next-fileupload/processNested.js.map +1 -0
- package/dist/next-fileupload/uploadTimer.js +2 -12
- package/dist/next-fileupload/uploadTimer.js.map +1 -0
- package/dist/next-fileupload/utilities.d.ts +1 -1
- package/dist/next-fileupload/utilities.d.ts.map +1 -1
- package/dist/next-fileupload/utilities.js +31 -76
- package/dist/next-fileupload/utilities.js.map +1 -0
- package/dist/next-stream-file/index.d.ts +4 -0
- package/dist/next-stream-file/index.d.ts.map +1 -1
- package/dist/next-stream-file/index.js +6 -21
- package/dist/next-stream-file/index.js.map +1 -0
- package/dist/prod/payload/favicon.svg +15 -0
- package/dist/prod/payload/og-image.png +0 -0
- package/dist/prod/styles.css +1 -0
- package/dist/routes/graphql/handler.d.ts.map +1 -1
- package/dist/routes/graphql/handler.js +19 -36
- package/dist/routes/graphql/handler.js.map +1 -0
- package/dist/routes/graphql/index.d.ts +2 -2
- package/dist/routes/graphql/index.d.ts.map +1 -1
- package/dist/routes/graphql/index.js +3 -21
- package/dist/routes/graphql/index.js.map +1 -0
- package/dist/routes/graphql/playground.js +6 -16
- package/dist/routes/graphql/playground.js.map +1 -0
- package/dist/routes/index.d.ts +2 -3
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +3 -37
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/rest/auth/access.d.ts +1 -1
- package/dist/routes/rest/auth/access.d.ts.map +1 -1
- package/dist/routes/rest/auth/access.js +6 -21
- package/dist/routes/rest/auth/access.js.map +1 -0
- package/dist/routes/rest/auth/forgotPassword.d.ts +1 -1
- package/dist/routes/rest/auth/forgotPassword.d.ts.map +1 -1
- package/dist/routes/rest/auth/forgotPassword.js +6 -21
- package/dist/routes/rest/auth/forgotPassword.js.map +1 -0
- package/dist/routes/rest/auth/init.d.ts +1 -1
- package/dist/routes/rest/auth/init.d.ts.map +1 -1
- package/dist/routes/rest/auth/init.js +4 -14
- package/dist/routes/rest/auth/init.js.map +1 -0
- package/dist/routes/rest/auth/login.d.ts +1 -1
- package/dist/routes/rest/auth/login.d.ts.map +1 -1
- package/dist/routes/rest/auth/login.js +10 -25
- package/dist/routes/rest/auth/login.js.map +1 -0
- package/dist/routes/rest/auth/logout.d.ts +1 -1
- package/dist/routes/rest/auth/logout.d.ts.map +1 -1
- package/dist/routes/rest/auth/logout.js +9 -24
- package/dist/routes/rest/auth/logout.js.map +1 -0
- package/dist/routes/rest/auth/me.d.ts +1 -1
- package/dist/routes/rest/auth/me.d.ts.map +1 -1
- package/dist/routes/rest/auth/me.js +8 -23
- package/dist/routes/rest/auth/me.js.map +1 -0
- package/dist/routes/rest/auth/refresh.d.ts +1 -1
- package/dist/routes/rest/auth/refresh.d.ts.map +1 -1
- package/dist/routes/rest/auth/refresh.js +11 -25
- package/dist/routes/rest/auth/refresh.js.map +1 -0
- package/dist/routes/rest/auth/registerFirstUser.d.ts +1 -1
- package/dist/routes/rest/auth/registerFirstUser.d.ts.map +1 -1
- package/dist/routes/rest/auth/registerFirstUser.js +12 -25
- package/dist/routes/rest/auth/registerFirstUser.js.map +1 -0
- package/dist/routes/rest/auth/resetPassword.d.ts +1 -1
- package/dist/routes/rest/auth/resetPassword.d.ts.map +1 -1
- package/dist/routes/rest/auth/resetPassword.js +8 -23
- package/dist/routes/rest/auth/resetPassword.js.map +1 -0
- package/dist/routes/rest/auth/unlock.d.ts +1 -1
- package/dist/routes/rest/auth/unlock.d.ts.map +1 -1
- package/dist/routes/rest/auth/unlock.js +6 -21
- package/dist/routes/rest/auth/unlock.js.map +1 -0
- package/dist/routes/rest/auth/verifyEmail.d.ts +1 -1
- package/dist/routes/rest/auth/verifyEmail.d.ts.map +1 -1
- package/dist/routes/rest/auth/verifyEmail.js +6 -21
- package/dist/routes/rest/auth/verifyEmail.js.map +1 -0
- package/dist/routes/rest/buildFormState.d.ts +3 -3
- package/dist/routes/rest/buildFormState.d.ts.map +1 -1
- package/dist/routes/rest/buildFormState.js +143 -79
- package/dist/routes/rest/buildFormState.js.map +1 -0
- package/dist/routes/rest/checkEndpoints.d.ts.map +1 -1
- package/dist/routes/rest/checkEndpoints.js +4 -19
- package/dist/routes/rest/checkEndpoints.js.map +1 -0
- package/dist/routes/rest/collections/create.d.ts +1 -1
- package/dist/routes/rest/collections/create.d.ts.map +1 -1
- package/dist/routes/rest/collections/create.js +10 -24
- package/dist/routes/rest/collections/create.js.map +1 -0
- package/dist/routes/rest/collections/delete.d.ts +1 -1
- package/dist/routes/rest/collections/delete.d.ts.map +1 -1
- package/dist/routes/rest/collections/delete.js +13 -31
- package/dist/routes/rest/collections/delete.js.map +1 -0
- package/dist/routes/rest/collections/deleteByID.d.ts +1 -1
- package/dist/routes/rest/collections/deleteByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/deleteByID.js +9 -24
- package/dist/routes/rest/collections/deleteByID.js.map +1 -0
- package/dist/routes/rest/collections/docAccess.d.ts +1 -1
- package/dist/routes/rest/collections/docAccess.d.ts.map +1 -1
- package/dist/routes/rest/collections/docAccess.js +6 -21
- package/dist/routes/rest/collections/docAccess.js.map +1 -0
- package/dist/routes/rest/collections/duplicate.d.ts +3 -0
- package/dist/routes/rest/collections/duplicate.d.ts.map +1 -0
- package/dist/routes/rest/collections/duplicate.js +28 -0
- package/dist/routes/rest/collections/duplicate.js.map +1 -0
- package/dist/routes/rest/collections/find.d.ts +1 -1
- package/dist/routes/rest/collections/find.d.ts.map +1 -1
- package/dist/routes/rest/collections/find.js +11 -29
- package/dist/routes/rest/collections/find.js.map +1 -0
- package/dist/routes/rest/collections/findByID.d.ts +1 -1
- package/dist/routes/rest/collections/findByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/findByID.js +8 -23
- package/dist/routes/rest/collections/findByID.js.map +1 -0
- package/dist/routes/rest/collections/findVersionByID.d.ts +1 -1
- package/dist/routes/rest/collections/findVersionByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/findVersionByID.js +8 -23
- package/dist/routes/rest/collections/findVersionByID.js.map +1 -0
- package/dist/routes/rest/collections/findVersions.d.ts +1 -1
- package/dist/routes/rest/collections/findVersions.d.ts.map +1 -1
- package/dist/routes/rest/collections/findVersions.js +11 -29
- package/dist/routes/rest/collections/findVersions.js.map +1 -0
- package/dist/routes/rest/collections/preview.d.ts +3 -0
- package/dist/routes/rest/collections/preview.d.ts.map +1 -0
- package/dist/routes/rest/collections/preview.js +36 -0
- package/dist/routes/rest/collections/preview.js.map +1 -0
- package/dist/routes/rest/collections/restoreVersion.d.ts +1 -1
- package/dist/routes/rest/collections/restoreVersion.d.ts.map +1 -1
- package/dist/routes/rest/collections/restoreVersion.js +8 -23
- package/dist/routes/rest/collections/restoreVersion.js.map +1 -0
- package/dist/routes/rest/collections/update.d.ts +1 -1
- package/dist/routes/rest/collections/update.d.ts.map +1 -1
- package/dist/routes/rest/collections/update.js +13 -31
- package/dist/routes/rest/collections/update.js.map +1 -0
- package/dist/routes/rest/collections/updateByID.d.ts +1 -1
- package/dist/routes/rest/collections/updateByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/updateByID.js +8 -23
- package/dist/routes/rest/collections/updateByID.js.map +1 -0
- package/dist/routes/rest/files/checkFileAccess.d.ts +7 -0
- package/dist/routes/rest/files/checkFileAccess.d.ts.map +1 -0
- package/dist/routes/rest/files/checkFileAccess.js +50 -0
- package/dist/routes/rest/files/checkFileAccess.js.map +1 -0
- package/dist/routes/rest/files/getFile.d.ts +9 -0
- package/dist/routes/rest/files/getFile.d.ts.map +1 -0
- package/dist/routes/rest/files/getFile.js +52 -0
- package/dist/routes/rest/files/getFile.js.map +1 -0
- package/dist/routes/rest/globals/docAccess.d.ts +1 -1
- package/dist/routes/rest/globals/docAccess.d.ts.map +1 -1
- package/dist/routes/rest/globals/docAccess.js +6 -21
- package/dist/routes/rest/globals/docAccess.js.map +1 -0
- package/dist/routes/rest/globals/findOne.d.ts +1 -1
- package/dist/routes/rest/globals/findOne.d.ts.map +1 -1
- package/dist/routes/rest/globals/findOne.js +10 -25
- package/dist/routes/rest/globals/findOne.js.map +1 -0
- package/dist/routes/rest/globals/findVersionByID.d.ts +1 -1
- package/dist/routes/rest/globals/findVersionByID.d.ts.map +1 -1
- package/dist/routes/rest/globals/findVersionByID.js +8 -23
- package/dist/routes/rest/globals/findVersionByID.js.map +1 -0
- package/dist/routes/rest/globals/findVersions.d.ts +1 -1
- package/dist/routes/rest/globals/findVersions.d.ts.map +1 -1
- package/dist/routes/rest/globals/findVersions.js +11 -29
- package/dist/routes/rest/globals/findVersions.js.map +1 -0
- package/dist/routes/rest/globals/preview.d.ts +3 -0
- package/dist/routes/rest/globals/preview.d.ts.map +1 -0
- package/dist/routes/rest/globals/preview.js +35 -0
- package/dist/routes/rest/globals/preview.js.map +1 -0
- package/dist/routes/rest/globals/restoreVersion.d.ts +1 -1
- package/dist/routes/rest/globals/restoreVersion.d.ts.map +1 -1
- package/dist/routes/rest/globals/restoreVersion.js +8 -23
- package/dist/routes/rest/globals/restoreVersion.js.map +1 -0
- package/dist/routes/rest/globals/update.d.ts +1 -1
- package/dist/routes/rest/globals/update.d.ts.map +1 -1
- package/dist/routes/rest/globals/update.js +10 -25
- package/dist/routes/rest/globals/update.js.map +1 -0
- package/dist/routes/rest/index.d.ts.map +1 -1
- package/dist/routes/rest/index.js +129 -122
- package/dist/routes/rest/index.js.map +1 -0
- package/dist/routes/rest/{RouteError.d.ts → routeError.d.ts} +3 -3
- package/dist/routes/rest/routeError.d.ts.map +1 -0
- package/dist/routes/rest/routeError.js +93 -0
- package/dist/routes/rest/routeError.js.map +1 -0
- package/dist/routes/rest/types.js +2 -5
- package/dist/routes/rest/types.js.map +1 -0
- package/dist/scss/app.scss +2 -2
- package/dist/utilities/buildFieldSchemaMap/index.d.ts +4 -0
- package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +1 -0
- package/dist/utilities/buildFieldSchemaMap/index.js +28 -0
- package/dist/utilities/buildFieldSchemaMap/index.js.map +1 -0
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts +14 -0
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +1 -0
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js +72 -0
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +1 -0
- package/dist/utilities/buildFieldSchemaMap/types.d.ts +3 -0
- package/dist/utilities/buildFieldSchemaMap/types.d.ts.map +1 -0
- package/dist/utilities/buildFieldSchemaMap/types.js +3 -0
- package/dist/utilities/buildFieldSchemaMap/types.js.map +1 -0
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/createPayloadRequest.js +29 -32
- package/dist/utilities/createPayloadRequest.js.map +1 -0
- package/dist/utilities/getDataAndFile.js +6 -16
- package/dist/utilities/getDataAndFile.js.map +1 -0
- package/dist/utilities/getNextRequestI18n.d.ts +11 -0
- package/dist/utilities/getNextRequestI18n.d.ts.map +1 -0
- package/dist/utilities/getNextRequestI18n.js +18 -0
- package/dist/utilities/getNextRequestI18n.js.map +1 -0
- package/dist/utilities/getPayloadHMR.d.ts +4 -0
- package/dist/utilities/getPayloadHMR.d.ts.map +1 -0
- package/dist/utilities/getPayloadHMR.js +75 -0
- package/dist/utilities/getPayloadHMR.js.map +1 -0
- package/dist/utilities/getRequestLanguage.d.ts +6 -3
- package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
- package/dist/utilities/getRequestLanguage.js +14 -16
- package/dist/utilities/getRequestLanguage.js.map +1 -0
- package/dist/utilities/getRequestLocales.js +2 -12
- package/dist/utilities/getRequestLocales.js.map +1 -0
- package/dist/utilities/initPage.d.ts +4 -16
- package/dist/utilities/initPage.d.ts.map +1 -1
- package/dist/utilities/initPage.js +70 -54
- package/dist/utilities/initPage.js.map +1 -0
- package/dist/utilities/meta.js +5 -15
- package/dist/utilities/meta.js.map +1 -0
- package/dist/utilities/timestamp.d.ts +2 -0
- package/dist/utilities/timestamp.d.ts.map +1 -0
- package/dist/utilities/timestamp.js +7 -0
- package/dist/utilities/timestamp.js.map +1 -0
- package/dist/views/API/RenderJSON/index.js +17 -69
- package/dist/views/API/RenderJSON/index.js.map +1 -0
- package/dist/views/API/index.client.d.ts +1 -2
- package/dist/views/API/index.client.d.ts.map +1 -1
- package/dist/views/API/index.client.js +58 -106
- package/dist/views/API/index.client.js.map +1 -0
- package/dist/views/API/index.d.ts +2 -3
- package/dist/views/API/index.d.ts.map +1 -1
- package/dist/views/API/index.js +5 -25
- package/dist/views/API/index.js.map +1 -0
- package/dist/views/API/meta.d.ts +1 -1
- package/dist/views/API/meta.d.ts.map +1 -1
- package/dist/views/API/meta.js +4 -14
- package/dist/views/API/meta.js.map +1 -0
- package/dist/views/Account/Settings/index.d.ts.map +1 -1
- package/dist/views/Account/Settings/index.js +16 -30
- package/dist/views/Account/Settings/index.js.map +1 -0
- package/dist/views/Account/ToggleTheme/index.js +10 -59
- package/dist/views/Account/ToggleTheme/index.js.map +1 -0
- package/dist/views/Account/index.d.ts +3 -12
- package/dist/views/Account/index.d.ts.map +1 -1
- package/dist/views/Account/index.js +43 -152
- package/dist/views/Account/index.js.map +1 -0
- package/dist/views/Account/meta.d.ts +3 -0
- package/dist/views/Account/meta.d.ts.map +1 -0
- package/dist/views/Account/meta.js +11 -0
- package/dist/views/Account/meta.js.map +1 -0
- package/dist/views/CreateFirstUser/index.client.d.ts +2 -0
- package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +15 -22
- package/dist/views/CreateFirstUser/index.client.js.map +1 -0
- package/dist/views/CreateFirstUser/index.d.ts +3 -17
- package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.js +23 -64
- package/dist/views/CreateFirstUser/index.js.map +1 -0
- package/dist/views/CreateFirstUser/meta.d.ts +3 -0
- package/dist/views/CreateFirstUser/meta.d.ts.map +1 -0
- package/dist/views/CreateFirstUser/meta.js +11 -0
- package/dist/views/CreateFirstUser/meta.js.map +1 -0
- package/dist/views/Dashboard/Default/index.client.d.ts +4 -2
- package/dist/views/Dashboard/Default/index.client.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/index.client.js +35 -82
- package/dist/views/Dashboard/Default/index.client.js.map +1 -0
- package/dist/views/Dashboard/Default/index.d.ts +4 -3
- package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/index.js +17 -31
- package/dist/views/Dashboard/Default/index.js.map +1 -0
- package/dist/views/Dashboard/index.d.ts +3 -14
- package/dist/views/Dashboard/index.d.ts.map +1 -1
- package/dist/views/Dashboard/index.js +18 -113
- package/dist/views/Dashboard/index.js.map +1 -0
- package/dist/views/Dashboard/meta.d.ts +3 -0
- package/dist/views/Dashboard/meta.d.ts.map +1 -0
- package/dist/views/Dashboard/meta.js +11 -0
- package/dist/views/Dashboard/meta.js.map +1 -0
- package/dist/views/Document/getCustomViewByKey.d.ts +2 -2
- package/dist/views/Document/getCustomViewByKey.d.ts.map +1 -1
- package/dist/views/Document/getCustomViewByKey.js +2 -12
- package/dist/views/Document/getCustomViewByKey.js.map +1 -0
- package/dist/views/Document/getCustomViewByRoute.d.ts +8 -0
- package/dist/views/Document/getCustomViewByRoute.d.ts.map +1 -0
- package/dist/views/Document/getCustomViewByRoute.js +22 -0
- package/dist/views/Document/getCustomViewByRoute.js.map +1 -0
- package/dist/views/Document/getMetaBySegment.d.ts +6 -16
- package/dist/views/Document/getMetaBySegment.d.ts.map +1 -1
- package/dist/views/Document/getMetaBySegment.js +39 -86
- package/dist/views/Document/getMetaBySegment.js.map +1 -0
- package/dist/views/Document/getViewsFromConfig.d.ts +12 -9
- package/dist/views/Document/getViewsFromConfig.d.ts.map +1 -1
- package/dist/views/Document/getViewsFromConfig.js +198 -121
- package/dist/views/Document/getViewsFromConfig.js.map +1 -0
- package/dist/views/Document/index.d.ts +4 -22
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/index.js +115 -192
- package/dist/views/Document/index.js.map +1 -0
- package/dist/views/Document/meta.d.ts +3 -0
- package/dist/views/Document/meta.d.ts.map +1 -0
- package/dist/views/Document/meta.js +4 -0
- package/dist/views/Document/meta.js.map +1 -0
- package/dist/views/Edit/Default/Auth/APIKey.d.ts +1 -2
- package/dist/views/Edit/Default/Auth/APIKey.d.ts.map +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.js +37 -78
- package/dist/views/Edit/Default/Auth/APIKey.js.map +1 -0
- package/dist/views/Edit/Default/Auth/index.d.ts +2 -3
- package/dist/views/Edit/Default/Auth/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/Auth/index.js +42 -93
- package/dist/views/Edit/Default/Auth/index.js.map +1 -0
- package/dist/views/Edit/Default/Auth/types.js +2 -5
- package/dist/views/Edit/Default/Auth/types.js.map +1 -0
- package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts +5 -4
- package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/SetDocumentTitle/index.js +27 -39
- package/dist/views/Edit/Default/SetDocumentTitle/index.js.map +1 -0
- package/dist/views/Edit/Default/SetStepNav/index.d.ts +1 -2
- package/dist/views/Edit/Default/SetStepNav/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/SetStepNav/index.js +17 -23
- package/dist/views/Edit/Default/SetStepNav/index.js.map +1 -0
- package/dist/views/Edit/Default/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/index.js +109 -109
- package/dist/views/Edit/Default/index.js.map +1 -0
- package/dist/views/Edit/Default/types.js +2 -5
- package/dist/views/Edit/Default/types.js.map +1 -0
- package/dist/views/Edit/index.client.d.ts +1 -2
- package/dist/views/Edit/index.client.d.ts.map +1 -1
- package/dist/views/Edit/index.client.js +11 -94
- package/dist/views/Edit/index.client.js.map +1 -0
- package/dist/views/Edit/index.d.ts +2 -3
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js +5 -25
- package/dist/views/Edit/index.js.map +1 -0
- package/dist/views/Edit/meta.d.ts +1 -1
- package/dist/views/Edit/meta.d.ts.map +1 -1
- package/dist/views/Edit/meta.js +11 -21
- package/dist/views/Edit/meta.js.map +1 -0
- package/dist/views/Edit/sanitizeEditViewProps.d.ts +1 -2
- package/dist/views/Edit/sanitizeEditViewProps.d.ts.map +1 -1
- package/dist/views/Edit/sanitizeEditViewProps.js +5 -18
- package/dist/views/Edit/sanitizeEditViewProps.js.map +1 -0
- package/dist/views/ForgotPassword/index.d.ts +4 -12
- package/dist/views/ForgotPassword/index.d.ts.map +1 -1
- package/dist/views/ForgotPassword/index.js +27 -91
- package/dist/views/ForgotPassword/index.js.map +1 -0
- package/dist/views/ForgotPassword/meta.d.ts +3 -0
- package/dist/views/ForgotPassword/meta.d.ts.map +1 -0
- package/dist/views/ForgotPassword/meta.js +11 -0
- package/dist/views/ForgotPassword/meta.js.map +1 -0
- package/dist/views/List/Default/index.d.ts.map +1 -1
- package/dist/views/List/Default/index.js +80 -109
- package/dist/views/List/Default/index.js.map +1 -0
- package/dist/views/List/Default/types.d.ts +3 -2
- package/dist/views/List/Default/types.d.ts.map +1 -1
- package/dist/views/List/Default/types.js +2 -5
- package/dist/views/List/Default/types.js.map +1 -0
- package/dist/views/List/index.d.ts +3 -20
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +69 -114
- package/dist/views/List/index.js.map +1 -0
- package/dist/views/List/meta.d.ts +7 -0
- package/dist/views/List/meta.d.ts.map +1 -0
- package/dist/views/List/meta.js +19 -0
- package/dist/views/List/meta.js.map +1 -0
- package/dist/views/LivePreview/Context/collisionDetection.js +6 -14
- package/dist/views/LivePreview/Context/collisionDetection.js.map +1 -0
- package/dist/views/LivePreview/Context/context.d.ts +2 -2
- package/dist/views/LivePreview/Context/context.d.ts.map +1 -1
- package/dist/views/LivePreview/Context/context.js +4 -22
- package/dist/views/LivePreview/Context/context.js.map +1 -0
- package/dist/views/LivePreview/Context/index.d.ts +5 -3
- package/dist/views/LivePreview/Context/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Context/index.js +38 -93
- package/dist/views/LivePreview/Context/index.js.map +1 -0
- package/dist/views/LivePreview/Context/sizeReducer.js +2 -12
- package/dist/views/LivePreview/Context/sizeReducer.js.map +1 -0
- package/dist/views/LivePreview/Device/index.js +10 -61
- package/dist/views/LivePreview/Device/index.js.map +1 -0
- package/dist/views/LivePreview/DeviceContainer/index.js +6 -21
- package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -0
- package/dist/views/LivePreview/IFrame/index.d.ts +4 -3
- package/dist/views/LivePreview/IFrame/index.d.ts.map +1 -1
- package/dist/views/LivePreview/IFrame/index.js +6 -58
- package/dist/views/LivePreview/IFrame/index.js.map +1 -0
- package/dist/views/LivePreview/Preview/index.d.ts +1 -1
- package/dist/views/LivePreview/Preview/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Preview/index.js +23 -72
- package/dist/views/LivePreview/Preview/index.js.map +1 -0
- package/dist/views/LivePreview/Toolbar/Controls/index.d.ts +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.js +24 -37
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -0
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js +9 -61
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -0
- package/dist/views/LivePreview/Toolbar/index.d.ts +1 -1
- package/dist/views/LivePreview/Toolbar/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.js +16 -32
- package/dist/views/LivePreview/Toolbar/index.js.map +1 -0
- package/dist/views/LivePreview/ToolbarArea/index.js +6 -22
- package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -0
- package/dist/views/LivePreview/index.client.d.ts +2 -3
- package/dist/views/LivePreview/index.client.d.ts.map +1 -1
- package/dist/views/LivePreview/index.client.js +83 -106
- package/dist/views/LivePreview/index.client.js.map +1 -0
- package/dist/views/LivePreview/index.d.ts +2 -2
- package/dist/views/LivePreview/index.d.ts.map +1 -1
- package/dist/views/LivePreview/index.js +34 -30
- package/dist/views/LivePreview/index.js.map +1 -0
- package/dist/views/LivePreview/meta.d.ts +1 -1
- package/dist/views/LivePreview/meta.d.ts.map +1 -1
- package/dist/views/LivePreview/meta.js +11 -21
- package/dist/views/LivePreview/meta.js.map +1 -0
- package/dist/views/LivePreview/usePopupWindow.d.ts.map +1 -1
- package/dist/views/LivePreview/usePopupWindow.js +11 -21
- package/dist/views/LivePreview/usePopupWindow.js.map +1 -0
- package/dist/views/Login/LoginForm/index.d.ts.map +1 -1
- package/dist/views/Login/LoginForm/index.js +22 -36
- package/dist/views/Login/LoginForm/index.js.map +1 -0
- package/dist/views/Login/index.d.ts +4 -15
- package/dist/views/Login/index.d.ts.map +1 -1
- package/dist/views/Login/index.js +16 -88
- package/dist/views/Login/index.js.map +1 -0
- package/dist/views/Login/meta.d.ts +3 -0
- package/dist/views/Login/meta.d.ts.map +1 -0
- package/dist/views/Login/meta.js +11 -0
- package/dist/views/Login/meta.js.map +1 -0
- package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
- package/dist/views/Logout/LogoutClient.js +15 -69
- package/dist/views/Logout/LogoutClient.js.map +1 -0
- package/dist/views/Logout/index.d.ts +5 -17
- package/dist/views/Logout/index.d.ts.map +1 -1
- package/dist/views/Logout/index.js +12 -53
- package/dist/views/Logout/index.js.map +1 -0
- package/dist/views/Logout/meta.d.ts +3 -0
- package/dist/views/Logout/meta.d.ts.map +1 -0
- package/dist/views/Logout/meta.js +11 -0
- package/dist/views/Logout/meta.js.map +1 -0
- package/dist/views/NotFound/index.client.d.ts +6 -0
- package/dist/views/NotFound/index.client.d.ts.map +1 -0
- package/dist/views/NotFound/index.client.js +41 -0
- package/dist/views/NotFound/index.client.js.map +1 -0
- package/dist/views/NotFound/index.d.ts +26 -5
- package/dist/views/NotFound/index.d.ts.map +1 -1
- package/dist/views/NotFound/index.js +34 -45
- package/dist/views/NotFound/index.js.map +1 -0
- package/dist/views/NotFound/index.scss +1 -0
- package/dist/views/NotFound/meta.d.ts +8 -0
- package/dist/views/NotFound/meta.d.ts.map +1 -0
- package/dist/views/NotFound/meta.js +11 -0
- package/dist/views/NotFound/meta.js.map +1 -0
- package/dist/views/ResetPassword/index.d.ts +4 -17
- package/dist/views/ResetPassword/index.d.ts.map +1 -1
- package/dist/views/ResetPassword/index.js +34 -62
- package/dist/views/ResetPassword/index.js.map +1 -0
- package/dist/views/ResetPassword/meta.d.ts +3 -0
- package/dist/views/ResetPassword/meta.d.ts.map +1 -0
- package/dist/views/ResetPassword/meta.js +11 -0
- package/dist/views/ResetPassword/meta.js.map +1 -0
- package/dist/views/Root/getCustomViewByRoute.d.ts +6 -0
- package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -0
- package/dist/views/Root/getCustomViewByRoute.js +19 -0
- package/dist/views/Root/getCustomViewByRoute.js.map +1 -0
- package/dist/views/Root/getViewFromConfig.d.ts +18 -0
- package/dist/views/Root/getViewFromConfig.d.ts.map +1 -0
- package/dist/views/Root/getViewFromConfig.js +138 -0
- package/dist/views/Root/getViewFromConfig.js.map +1 -0
- package/dist/views/Root/index.d.ts +13 -6
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +43 -226
- package/dist/views/Root/index.js.map +1 -0
- package/dist/views/Root/isPathMatchingRoute.d.ts +8 -0
- package/dist/views/Root/isPathMatchingRoute.d.ts.map +1 -0
- package/dist/views/Root/isPathMatchingRoute.js +16 -0
- package/dist/views/Root/isPathMatchingRoute.js.map +1 -0
- package/dist/views/Root/meta.d.ts +14 -0
- package/dist/views/Root/meta.d.ts.map +1 -0
- package/dist/views/Root/meta.js +159 -0
- package/dist/views/Root/meta.js.map +1 -0
- package/dist/views/Unauthorized/index.d.ts +4 -11
- package/dist/views/Unauthorized/index.d.ts.map +1 -1
- package/dist/views/Unauthorized/index.js +18 -42
- package/dist/views/Unauthorized/index.js.map +1 -0
- package/dist/views/Unauthorized/index.scss +36 -0
- package/dist/views/Unauthorized/meta.d.ts +3 -0
- package/dist/views/Unauthorized/meta.d.ts.map +1 -0
- package/dist/views/Unauthorized/meta.js +11 -0
- package/dist/views/Unauthorized/meta.js.map +1 -0
- package/dist/views/Verify/index.d.ts +4 -17
- package/dist/views/Verify/index.d.ts.map +1 -1
- package/dist/views/Verify/index.js +14 -55
- package/dist/views/Verify/index.js.map +1 -0
- package/dist/views/Verify/meta.d.ts +3 -0
- package/dist/views/Verify/meta.d.ts.map +1 -0
- package/dist/views/Verify/meta.js +11 -0
- package/dist/views/Verify/meta.js.map +1 -0
- package/dist/views/Version/Default/SetStepNav.d.ts +4 -3
- package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
- package/dist/views/Version/Default/SetStepNav.js +36 -28
- package/dist/views/Version/Default/SetStepNav.js.map +1 -0
- package/dist/views/Version/Default/index.d.ts +1 -1
- package/dist/views/Version/Default/index.d.ts.map +1 -1
- package/dist/views/Version/Default/index.js +53 -93
- package/dist/views/Version/Default/index.js.map +1 -0
- package/dist/views/Version/Default/types.d.ts +4 -9
- package/dist/views/Version/Default/types.d.ts.map +1 -1
- package/dist/views/Version/Default/types.js +2 -5
- package/dist/views/Version/Default/types.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js +4 -20
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +31 -47
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +10 -26
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +20 -35
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +7 -62
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts +6 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +16 -31
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +6 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +11 -26
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +7 -62
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +11 -27
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js +2 -12
- package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts +54 -19
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js +25 -40
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/styles.js +2 -12
- package/dist/views/Version/RenderFieldsToDiff/fields/styles.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js +2 -5
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/index.d.ts +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +28 -43
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts +2 -2
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/types.js +2 -5
- package/dist/views/Version/RenderFieldsToDiff/types.js.map +1 -0
- package/dist/views/Version/Restore/index.d.ts +1 -1
- package/dist/views/Version/Restore/index.d.ts.map +1 -1
- package/dist/views/Version/Restore/index.js +24 -71
- package/dist/views/Version/Restore/index.js.map +1 -0
- package/dist/views/Version/Restore/types.d.ts +1 -1
- package/dist/views/Version/Restore/types.d.ts.map +1 -1
- package/dist/views/Version/Restore/types.js +2 -5
- package/dist/views/Version/Restore/types.js.map +1 -0
- package/dist/views/Version/SelectComparison/index.d.ts +1 -1
- package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +53 -90
- package/dist/views/Version/SelectComparison/index.js.map +1 -0
- package/dist/views/Version/SelectComparison/types.d.ts +1 -1
- package/dist/views/Version/SelectComparison/types.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/types.js +2 -5
- package/dist/views/Version/SelectComparison/types.js.map +1 -0
- package/dist/views/Version/SelectLocales/index.d.ts +1 -1
- package/dist/views/Version/SelectLocales/index.d.ts.map +1 -1
- package/dist/views/Version/SelectLocales/index.js +11 -25
- package/dist/views/Version/SelectLocales/index.js.map +1 -0
- package/dist/views/Version/SelectLocales/types.d.ts +4 -4
- package/dist/views/Version/SelectLocales/types.d.ts.map +1 -1
- package/dist/views/Version/SelectLocales/types.js +2 -5
- package/dist/views/Version/SelectLocales/types.js.map +1 -0
- package/dist/views/Version/index.d.ts +2 -2
- package/dist/views/Version/index.d.ts.map +1 -1
- package/dist/views/Version/index.js +35 -42
- package/dist/views/Version/index.js.map +1 -0
- package/dist/views/Version/meta.d.ts +1 -1
- package/dist/views/Version/meta.d.ts.map +1 -1
- package/dist/views/Version/meta.js +13 -19
- package/dist/views/Version/meta.js.map +1 -0
- package/dist/views/Version/shared.js +3 -21
- package/dist/views/Version/shared.js.map +1 -0
- package/dist/views/Versions/buildColumns.d.ts +2 -2
- package/dist/views/Versions/buildColumns.d.ts.map +1 -1
- package/dist/views/Versions/buildColumns.js +36 -42
- package/dist/views/Versions/buildColumns.js.map +1 -0
- package/dist/views/Versions/cells/AutosaveCell/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +10 -59
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -0
- package/dist/views/Versions/cells/CreatedAt/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js +18 -25
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -0
- package/dist/views/Versions/cells/ID/index.js +6 -57
- package/dist/views/Versions/cells/ID/index.js.map +1 -0
- package/dist/views/Versions/index.client.d.ts +1 -6
- package/dist/views/Versions/index.client.d.ts.map +1 -1
- package/dist/views/Versions/index.client.js +31 -117
- package/dist/views/Versions/index.client.js.map +1 -0
- package/dist/views/Versions/index.d.ts +2 -3
- package/dist/views/Versions/index.d.ts.map +1 -1
- package/dist/views/Versions/index.js +40 -72
- package/dist/views/Versions/index.js.map +1 -0
- package/dist/views/Versions/meta.d.ts +1 -1
- package/dist/views/Versions/meta.d.ts.map +1 -1
- package/dist/views/Versions/meta.js +7 -17
- package/dist/views/Versions/meta.js.map +1 -0
- package/dist/views/Versions/types.js +2 -5
- package/dist/views/Versions/types.js.map +1 -0
- package/dist/webpackEntry.d.ts +5 -0
- package/dist/webpackEntry.d.ts.map +1 -0
- package/dist/webpackEntry.js +6 -0
- package/dist/webpackEntry.js.map +1 -0
- package/dist/withPayload.d.ts +7 -2
- package/dist/withPayload.d.ts.map +1 -1
- package/dist/withPayload.js +7 -8
- package/dist/withPayload.js.map +1 -0
- package/package.json +38 -53
- package/src/index.js +1 -0
- package/dist/295bdb5117ce718dc7ce.woff2 +0 -1
- package/dist/3dec23c585a4abb5db73.woff +0 -1
- package/dist/542802f243f0fcaf55b3.woff2 +0 -1
- package/dist/5e5b3593b8911609ead8.woff +0 -1
- package/dist/64ee2a3127da82b7ea68.woff2 +0 -1
- package/dist/67a3a8f8301a0429df2d.woff +0 -1
- package/dist/8d0dc94a123c04b123f0.woff +0 -1
- package/dist/94db87589768ca1eec3c.woff2 +0 -1
- package/dist/997a8ea7da8ec3068210.woff2 +0 -1
- package/dist/9ab00e972f6f94ca3ff4.woff +0 -1
- package/dist/ab1f8b95d9d1911a4a3e.woff +0 -1
- package/dist/ba5a15d71add74a81bb9.woff +0 -1
- package/dist/bd2c036744af4b004ea6.woff2 +0 -1
- package/dist/bin/index.d.ts +0 -2
- package/dist/bin/index.d.ts.map +0 -1
- package/dist/bin/index.js +0 -37
- package/dist/bin/install.d.ts +0 -4
- package/dist/bin/install.d.ts.map +0 -1
- package/dist/bin/install.js +0 -77
- package/dist/cc56c782af93204aba75.woff +0 -1
- package/dist/d377d6e20b542fe3b375.woff2 +0 -1
- package/dist/e415ace668b22ac52c65.woff2 +0 -1
- package/dist/exports/index.d.ts +0 -2
- package/dist/exports/index.d.ts.map +0 -1
- package/dist/exports/index.js +0 -13
- package/dist/graphql/registerSchema.d.ts +0 -2
- package/dist/graphql/registerSchema.d.ts.map +0 -1
- package/dist/graphql/registerSchema.js +0 -3
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/layouts/Admin/index.d.ts +0 -12
- package/dist/layouts/Admin/index.d.ts.map +0 -1
- package/dist/layouts/Admin/index.js +0 -44
- package/dist/layouts/Document/index.d.ts +0 -14
- package/dist/layouts/Document/index.d.ts.map +0 -1
- package/dist/layouts/Document/index.js +0 -82
- package/dist/routes/rest/RouteError.d.ts.map +0 -1
- package/dist/routes/rest/RouteError.js +0 -104
- package/dist/routes/rest/[collection]/file/[filename]/route.d.ts +0 -8
- package/dist/routes/rest/[collection]/file/[filename]/route.d.ts.map +0 -1
- package/dist/routes/rest/[collection]/file/[filename]/route.js +0 -116
- package/dist/styles.css +0 -1
- package/dist/utilities/auth.d.ts +0 -10
- package/dist/utilities/auth.d.ts.map +0 -1
- package/dist/utilities/auth.js +0 -42
- package/dist/utilities/createClientConfig.d.ts +0 -5
- package/dist/utilities/createClientConfig.d.ts.map +0 -1
- package/dist/utilities/createClientConfig.js +0 -120
- package/dist/utilities/getNextI18n.d.ts +0 -7
- package/dist/utilities/getNextI18n.d.ts.map +0 -1
- package/dist/utilities/getNextI18n.js +0 -28
- package/dist/utilities/getNextT.d.ts +0 -7
- package/dist/utilities/getNextT.d.ts.map +0 -1
- package/dist/utilities/getNextT.js +0 -28
- package/dist/views/Document/getCustomViewByPath.d.ts +0 -4
- package/dist/views/Document/getCustomViewByPath.d.ts.map +0 -1
- package/dist/views/Document/getCustomViewByPath.js +0 -26
- package/dist/views/Edit/Default/RenderCustomView.d.ts +0 -2
- package/dist/views/Edit/Default/RenderCustomView.d.ts.map +0 -1
- package/dist/views/Edit/Default/RenderCustomView.js +0 -3
- package/dist/views/Edit/types.d.js +0 -7
- package/dist/views/Edit/types.d.ts +0 -32
- package/dist/views/Edit/types.d.ts.map +0 -1
- package/dist/views/Edit/types.js +0 -6
- package/dist/views/List/Default/Cell/cellTypes.spec.js +0 -234
- package/dist/views/List/Default/Cell/fields/Array/index.d.ts +0 -7
- package/dist/views/List/Default/Cell/fields/Array/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/Array/index.js +0 -27
- package/dist/views/List/Default/Cell/fields/Blocks/index.d.ts +0 -8
- package/dist/views/List/Default/Cell/fields/Blocks/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/Blocks/index.js +0 -45
- package/dist/views/List/Default/Cell/fields/Checkbox/index.d.ts +0 -5
- package/dist/views/List/Default/Cell/fields/Checkbox/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/Checkbox/index.js +0 -23
- package/dist/views/List/Default/Cell/fields/Checkbox/index.scss +0 -22
- package/dist/views/List/Default/Cell/fields/Code/index.d.ts +0 -8
- package/dist/views/List/Default/Cell/fields/Code/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/Code/index.js +0 -29
- package/dist/views/List/Default/Cell/fields/Code/index.scss +0 -27
- package/dist/views/List/Default/Cell/fields/Date/index.d.ts +0 -7
- package/dist/views/List/Default/Cell/fields/Date/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/Date/index.js +0 -26
- package/dist/views/List/Default/Cell/fields/File/index.d.ts +0 -7
- package/dist/views/List/Default/Cell/fields/File/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/File/index.js +0 -39
- package/dist/views/List/Default/Cell/fields/File/index.scss +0 -23
- package/dist/views/List/Default/Cell/fields/JSON/index.d.ts +0 -5
- package/dist/views/List/Default/Cell/fields/JSON/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/JSON/index.js +0 -26
- package/dist/views/List/Default/Cell/fields/JSON/index.scss +0 -22
- package/dist/views/List/Default/Cell/fields/Relationship/index.d.ts +0 -9
- package/dist/views/List/Default/Cell/fields/Relationship/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/Relationship/index.js +0 -121
- package/dist/views/List/Default/Cell/fields/Relationship/index.scss +0 -3
- package/dist/views/List/Default/Cell/fields/Richtext/index.d.ts +0 -2
- package/dist/views/List/Default/Cell/fields/Richtext/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/Richtext/index.js +0 -3
- package/dist/views/List/Default/Cell/fields/Select/index.d.ts +0 -7
- package/dist/views/List/Default/Cell/fields/Select/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/Select/index.js +0 -40
- package/dist/views/List/Default/Cell/fields/Textarea/index.d.ts +0 -4
- package/dist/views/List/Default/Cell/fields/Textarea/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/Textarea/index.js +0 -23
- package/dist/views/List/Default/Cell/fields/index.d.ts +0 -17
- package/dist/views/List/Default/Cell/fields/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/fields/index.js +0 -36
- package/dist/views/List/Default/Cell/index.d.ts +0 -4
- package/dist/views/List/Default/Cell/index.d.ts.map +0 -1
- package/dist/views/List/Default/Cell/index.js +0 -89
- package/dist/views/List/Default/RelationshipProvider/index.d.ts +0 -20
- package/dist/views/List/Default/RelationshipProvider/index.d.ts.map +0 -1
- package/dist/views/List/Default/RelationshipProvider/index.js +0 -153
- package/dist/views/List/Default/RelationshipProvider/reducer.d.ts +0 -19
- package/dist/views/List/Default/RelationshipProvider/reducer.d.ts.map +0 -1
- package/dist/views/List/Default/RelationshipProvider/reducer.js +0 -55
- package/dist/views/Unauthorized/UnauthorizedClient.d.ts +0 -5
- package/dist/views/Unauthorized/UnauthorizedClient.d.ts.map +0 -1
- package/dist/views/Unauthorized/UnauthorizedClient.js +0 -27
- package/src/index.ts +0 -6
- /package/dist/{static/SuisseIntl-Bold.2211c494.woff → prod/payload/SuisseIntl-Bold.woff} +0 -0
- /package/dist/{static/SuisseIntl-Bold.9c7dfd00.woff2 → prod/payload/SuisseIntl-Bold.woff2} +0 -0
- /package/dist/{static/SuisseIntl-Medium.d7aeda9e.woff → prod/payload/SuisseIntl-Medium.woff} +0 -0
- /package/dist/{static/SuisseIntl-Medium.5b718d97.woff2 → prod/payload/SuisseIntl-Medium.woff2} +0 -0
- /package/dist/{static/SuisseIntl-SemiBold.e7caa9e1.woff → prod/payload/SuisseIntl-SemiBold.woff} +0 -0
- /package/dist/{static/SuisseIntl-SemiBold.40ad7515.woff2 → prod/payload/SuisseIntl-SemiBold.woff2} +0 -0
- /package/dist/{static/SuisseIntl.8b4ddd0d.woff → prod/payload/SuisseIntl.woff} +0 -0
- /package/dist/{static/SuisseIntl.51922ceb.woff2 → prod/payload/SuisseIntl.woff2} +0 -0
- /package/dist/{static/merriweather-v30-latin-900.efe8f6a3.woff → prod/payload/merriweather-v30-latin-900.woff} +0 -0
- /package/dist/{static/merriweather-v30-latin-900.52244336.woff2 → prod/payload/merriweather-v30-latin-900.woff2} +0 -0
- /package/dist/{static/merriweather-v30-latin-900italic.78b8935f.woff → prod/payload/merriweather-v30-latin-900italic.woff} +0 -0
- /package/dist/{static/merriweather-v30-latin-900italic.f53bb8d4.woff2 → prod/payload/merriweather-v30-latin-900italic.woff2} +0 -0
- /package/dist/{static/merriweather-v30-latin-italic.8f612153.woff → prod/payload/merriweather-v30-latin-italic.woff} +0 -0
- /package/dist/{static/merriweather-v30-latin-italic.a1cfdc5b.woff2 → prod/payload/merriweather-v30-latin-italic.woff2} +0 -0
- /package/dist/{static/merriweather-v30-latin-regular.787999a6.woff → prod/payload/merriweather-v30-latin-regular.woff} +0 -0
- /package/dist/{static/merriweather-v30-latin-regular.e009f214.woff2 → prod/payload/merriweather-v30-latin-regular.woff2} +0 -0
|
@@ -1,92 +1,33 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const _sizeReducer = require("./sizeReducer");
|
|
17
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
18
|
-
if (typeof WeakMap !== "function") return null;
|
|
19
|
-
var cacheBabelInterop = new WeakMap();
|
|
20
|
-
var cacheNodeInterop = new WeakMap();
|
|
21
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
22
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
23
|
-
})(nodeInterop);
|
|
24
|
-
}
|
|
25
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
26
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
27
|
-
return obj;
|
|
28
|
-
}
|
|
29
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
30
|
-
return {
|
|
31
|
-
default: obj
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
35
|
-
if (cache && cache.has(obj)) {
|
|
36
|
-
return cache.get(obj);
|
|
37
|
-
}
|
|
38
|
-
var newObj = {
|
|
39
|
-
__proto__: null
|
|
40
|
-
};
|
|
41
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
42
|
-
for(var key in obj){
|
|
43
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
44
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
45
|
-
if (desc && (desc.get || desc.set)) {
|
|
46
|
-
Object.defineProperty(newObj, key, desc);
|
|
47
|
-
} else {
|
|
48
|
-
newObj[key] = obj[key];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
newObj.default = obj;
|
|
53
|
-
if (cache) {
|
|
54
|
-
cache.set(obj, newObj);
|
|
55
|
-
}
|
|
56
|
-
return newObj;
|
|
57
|
-
}
|
|
58
|
-
const LivePreviewProvider = (props)=>{
|
|
59
|
-
const { breakpoints, children, isPopupOpen, openPopupWindow, popupRef, url } = props;
|
|
60
|
-
const [previewWindowType, setPreviewWindowType] = (0, _react.useState)('iframe');
|
|
61
|
-
const [appIsReady, setAppIsReady] = (0, _react.useState)(false);
|
|
62
|
-
const iframeRef = _react.default.useRef(null);
|
|
63
|
-
const [iframeHasLoaded, setIframeHasLoaded] = (0, _react.useState)(false);
|
|
64
|
-
const [zoom, setZoom] = (0, _react.useState)(1);
|
|
65
|
-
const [position, setPosition] = (0, _react.useState)({
|
|
2
|
+
import { DndContext } from '@dnd-kit/core';
|
|
3
|
+
import { fieldSchemaToJSON } from 'payload/utilities';
|
|
4
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
5
|
+
import { customCollisionDetection } from './collisionDetection.js';
|
|
6
|
+
import { LivePreviewContext } from './context.js';
|
|
7
|
+
import { sizeReducer } from './sizeReducer.js';
|
|
8
|
+
export const LivePreviewProvider = ({ breakpoints, children, fieldSchema, isPopupOpen, openPopupWindow, popupRef, url })=>{
|
|
9
|
+
const [previewWindowType, setPreviewWindowType] = useState('iframe');
|
|
10
|
+
const [appIsReady, setAppIsReady] = useState(false);
|
|
11
|
+
const [listeningForMessages, setListeningForMessages] = useState(false);
|
|
12
|
+
const iframeRef = React.useRef(null);
|
|
13
|
+
const [iframeHasLoaded, setIframeHasLoaded] = useState(false);
|
|
14
|
+
const [zoom, setZoom] = useState(1);
|
|
15
|
+
const [position, setPosition] = useState({
|
|
66
16
|
x: 0,
|
|
67
17
|
y: 0
|
|
68
18
|
});
|
|
69
|
-
const [size, setSize] =
|
|
19
|
+
const [size, setSize] = React.useReducer(sizeReducer, {
|
|
70
20
|
height: 0,
|
|
71
21
|
width: 0
|
|
72
22
|
});
|
|
73
|
-
const [measuredDeviceSize, setMeasuredDeviceSize] =
|
|
23
|
+
const [measuredDeviceSize, setMeasuredDeviceSize] = useState({
|
|
74
24
|
height: 0,
|
|
75
25
|
width: 0
|
|
76
26
|
});
|
|
77
|
-
const [breakpoint, setBreakpoint] =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// const { collection } = props
|
|
82
|
-
// fields = collection.fields
|
|
83
|
-
// }
|
|
84
|
-
// if ('global' in props) {
|
|
85
|
-
// const { global } = props
|
|
86
|
-
// fields = global.fields
|
|
87
|
-
// }
|
|
88
|
-
// return fieldSchemaToJSON(fields)
|
|
89
|
-
// })
|
|
27
|
+
const [breakpoint, setBreakpoint] = React.useState('responsive');
|
|
28
|
+
const [fieldSchemaJSON] = useState(()=>{
|
|
29
|
+
return fieldSchemaToJSON(fieldSchema);
|
|
30
|
+
});
|
|
90
31
|
// The toolbar needs to freely drag and drop around the page
|
|
91
32
|
const handleDragEnd = (ev)=>{
|
|
92
33
|
// only update position if the toolbar is completely within the preview area
|
|
@@ -102,7 +43,7 @@ const LivePreviewProvider = (props)=>{
|
|
|
102
43
|
// reset
|
|
103
44
|
}
|
|
104
45
|
};
|
|
105
|
-
const setWidth =
|
|
46
|
+
const setWidth = useCallback((width)=>{
|
|
106
47
|
setSize({
|
|
107
48
|
type: 'width',
|
|
108
49
|
value: width
|
|
@@ -110,7 +51,7 @@ const LivePreviewProvider = (props)=>{
|
|
|
110
51
|
}, [
|
|
111
52
|
setSize
|
|
112
53
|
]);
|
|
113
|
-
const setHeight =
|
|
54
|
+
const setHeight = useCallback((height)=>{
|
|
114
55
|
setSize({
|
|
115
56
|
type: 'height',
|
|
116
57
|
value: height
|
|
@@ -120,7 +61,7 @@ const LivePreviewProvider = (props)=>{
|
|
|
120
61
|
]);
|
|
121
62
|
// explicitly set new width and height when as new breakpoints are selected
|
|
122
63
|
// exclude `custom` breakpoint as it is handled by the `setWidth` and `setHeight` directly
|
|
123
|
-
|
|
64
|
+
useEffect(()=>{
|
|
124
65
|
const foundBreakpoint = breakpoints?.find((bp)=>bp.name === breakpoint);
|
|
125
66
|
if (foundBreakpoint && breakpoint !== 'responsive' && breakpoint !== 'custom' && typeof foundBreakpoint?.width === 'number' && typeof foundBreakpoint?.height === 'number') {
|
|
126
67
|
setSize({
|
|
@@ -139,7 +80,7 @@ const LivePreviewProvider = (props)=>{
|
|
|
139
80
|
// This indicates that the app is ready to receive `window.postMessage` events
|
|
140
81
|
// This is also the only cross-origin way of detecting when a popup window has loaded
|
|
141
82
|
// Unlike iframe elements which have an `onLoad` handler, there is no way to access `window.open` on popups
|
|
142
|
-
|
|
83
|
+
useEffect(()=>{
|
|
143
84
|
const handleMessage = (event)=>{
|
|
144
85
|
if (url?.startsWith(event.origin) && event.data && typeof event.data === 'object' && event.data.type === 'payload-live-preview') {
|
|
145
86
|
if (event.data.ready) {
|
|
@@ -148,13 +89,15 @@ const LivePreviewProvider = (props)=>{
|
|
|
148
89
|
}
|
|
149
90
|
};
|
|
150
91
|
window.addEventListener('message', handleMessage);
|
|
92
|
+
setListeningForMessages(true);
|
|
151
93
|
return ()=>{
|
|
152
94
|
window.removeEventListener('message', handleMessage);
|
|
153
95
|
};
|
|
154
96
|
}, [
|
|
155
|
-
url
|
|
97
|
+
url,
|
|
98
|
+
listeningForMessages
|
|
156
99
|
]);
|
|
157
|
-
const handleWindowChange =
|
|
100
|
+
const handleWindowChange = useCallback((type)=>{
|
|
158
101
|
setAppIsReady(false);
|
|
159
102
|
setPreviewWindowType(type);
|
|
160
103
|
if (type === 'popup') openPopupWindow();
|
|
@@ -163,20 +106,22 @@ const LivePreviewProvider = (props)=>{
|
|
|
163
106
|
]);
|
|
164
107
|
// when the user closes the popup window, switch back to the iframe
|
|
165
108
|
// the `usePopupWindow` reports the `isPopupOpen` state for us to use here
|
|
166
|
-
|
|
167
|
-
|
|
109
|
+
useEffect(()=>{
|
|
110
|
+
const newPreviewWindowType = isPopupOpen ? 'popup' : 'iframe';
|
|
111
|
+
if (newPreviewWindowType !== previewWindowType) {
|
|
168
112
|
handleWindowChange('iframe');
|
|
169
113
|
}
|
|
170
114
|
}, [
|
|
115
|
+
previewWindowType,
|
|
171
116
|
isPopupOpen,
|
|
172
117
|
handleWindowChange
|
|
173
118
|
]);
|
|
174
|
-
return /*#__PURE__*/
|
|
119
|
+
return /*#__PURE__*/ React.createElement(LivePreviewContext.Provider, {
|
|
175
120
|
value: {
|
|
176
121
|
appIsReady,
|
|
177
122
|
breakpoint,
|
|
178
123
|
breakpoints,
|
|
179
|
-
fieldSchemaJSON
|
|
124
|
+
fieldSchemaJSON,
|
|
180
125
|
iframeHasLoaded,
|
|
181
126
|
iframeRef,
|
|
182
127
|
isPopupOpen,
|
|
@@ -199,10 +144,10 @@ const LivePreviewProvider = (props)=>{
|
|
|
199
144
|
url,
|
|
200
145
|
zoom
|
|
201
146
|
}
|
|
202
|
-
}, /*#__PURE__*/
|
|
203
|
-
collisionDetection:
|
|
147
|
+
}, /*#__PURE__*/ React.createElement(DndContext, {
|
|
148
|
+
collisionDetection: customCollisionDetection,
|
|
204
149
|
onDragEnd: handleDragEnd
|
|
205
|
-
}, children));
|
|
150
|
+
}, listeningForMessages && children));
|
|
206
151
|
};
|
|
207
152
|
|
|
208
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy92aWV3cy9MaXZlUHJldmlldy9Db250ZXh0L2luZGV4LnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIGNsaWVudCdcbmltcG9ydCB0eXBlIHsgRWRpdFZpZXdQcm9wcywgTGl2ZVByZXZpZXdDb25maWcgfSBmcm9tICdwYX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ZGVyXG4gICAgICB2YWx1ZT17e1xuICAgICAgICBhcHBJc1JlYWR5LFxuICAgICAgICBicmVha3BvaW50LFxuICAgICAgICBicmVha3BvaW50cyxcbiAgICAgICAgZmllbGRTY2hlbWFKU09OOiBbXSxcbiAgICAgICAgaWZyYW1lSGFzTG9hZGVkLFxuICAgICAgICBpZnJhbWVSZWYsXG4gICAgICAgIGlzUG9wdXBPcGVuLFxuICAgICAgICBtZWFzdXJlZERldmljZVNpemUsXG4gICAgICAgIG9wZW5Qb3B1cFdpbmRvdyxcbiAgICAgICAgcG9wdXBSZWYsXG4gICAgICAgIHByZXZpZXdXaW5kb3dUeXBlLFxuICAgICAgICBzZXRBcHBJc1JlYWR5LFxuICAgICAgICBzZXRCcmVha3BvaW50LFxuICAgICAgICBzZXRIZWlnaHQsXG4gICAgICAgIHNldElmcmFtZUhhc0xvYWRlZCxcbiAgICAgICAgc2V0TWVhc3VyZWREZXZpY2VTaXplLFxuICAgICAgICBzZXRQcmV2aWV3V2luZG93VHlwZTogaGFuZGxlV2luZG93Q2hhbmdlLFxuICAgICAgICBzZXRTaXplLFxuICAgICAgICBzZXRUb29sYmFyUG9zaXRpb246IHNldFBvc2l0aW9uLFxuICAgICAgICBzZXRXaWR0aCxcbiAgICAgICAgc2V0Wm9vbSxcbiAgICAgICAgc2l6ZSxcbiAgICAgICAgdG9vbGJhclBvc2l0aW9uOiBwb3NpdGlvbixcbiAgICAgICAgdXJsLFxuICAgICAgICB6b29tLFxuICAgICAgfX1cbiAgICA+XG4gICAgICA8RG5kQ29udGV4dCBjb2xsaXNpb25EZXRlY3Rpb249e2N1c3RvbUNvbGxpc2lvbkRldGVjdGlvbn0gb25EcmFnRW5kPXtoYW5kbGVEcmFnRW5kfT5cbiAgICAgICAge2NoaWxkcmVufVxuICAgICAgPC9EbmRDb250ZXh0PlxuICAgIDwvTGl2ZVByZXZpZXdDb250ZXh0LlByb3ZpZGVyPlxuICApXG59XG4iXSwibmFtZXMiOlsiTGl2ZVBy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UFjO1FBQ2RILHFCQUFxQmlDO1FBQ3JCLElBQUlBLFNBQVMsU0FBU3JDO0lBQ3hCLEdBQ0E7UUFBQ0E7S0FBZ0I7SUFHbkIsbUVBQW1FO0lBQ25FLDBFQUEwRTtJQUMxRXdDLElBQUFBLGdCQUFTLEVBQUM7UUFDUixJQUFJLENBQUN6QyxhQUFhO1lBQ2hCdUQsbUJBQW1CO1FBQ3JCO0lBQ0YsR0FBRztRQUFDdkQ7UUFBYXVEO0tBQW1CO0lBRXBDLHFCQUNFLDZCQUFDQywyQkFBa0IsQ0FBQ0MsUUFBUTtRQUMxQmxCLE9BQU87WUFDTGhDO1lBQ0FxQjtZQUNBOUI7WUFDQTRELGlCQUFpQixFQUFFO1lBQ25COUM7WUFDQUg7WUFDQVQ7WUFDQTBCO1lBQ0F6QjtZQUNBQztZQUNBRTtZQUNBSTtZQUNBcUI7WUFDQVc7WUFDQTNCO1lBQ0FjO1lBQ0F0QixzQkFBc0JrRDtZQUN0QmxDO1lBQ0FzQyxvQkFBb0IxQztZQUNwQm1CO1lBQ0FyQjtZQUNBSztZQUNBd0MsaUJBQWlCNUM7WUFDakJiO1lBQ0FXO1FBQ0Y7cUJBRUEsNkJBQUMrQyxnQkFBVTtRQUFDQyxvQkFBb0JDLDRDQUF3QjtRQUFFQyxXQUFXbEM7T0FDbEUvQjtBQUlUIn0=
|
|
153
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/LivePreview/Context/index.tsx"],"sourcesContent":["'use client'\nimport type { LivePreviewConfig } from 'payload/config'\nimport type { ClientFieldConfig, Field } from 'payload/types'\n\nimport { DndContext } from '@dnd-kit/core'\nimport { fieldSchemaToJSON } from 'payload/utilities'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport type { usePopupWindow } from '../usePopupWindow.js'\n\nimport { customCollisionDetection } from './collisionDetection.js'\nimport { LivePreviewContext } from './context.js'\nimport { sizeReducer } from './sizeReducer.js'\n\nexport type LivePreviewProviderProps = {\n appIsReady?: boolean\n breakpoints?: LivePreviewConfig['breakpoints']\n children: React.ReactNode\n deviceSize?: {\n height: number\n width: number\n }\n fieldSchema: ClientFieldConfig[]\n isPopupOpen?: boolean\n openPopupWindow?: ReturnType<typeof usePopupWindow>['openPopupWindow']\n popupRef?: React.MutableRefObject<Window>\n url?: string\n}\n\nexport const LivePreviewProvider: React.FC<LivePreviewProviderProps> = ({\n breakpoints,\n children,\n fieldSchema,\n isPopupOpen,\n openPopupWindow,\n popupRef,\n url,\n}) => {\n const [previewWindowType, setPreviewWindowType] = useState<'iframe' | 'popup'>('iframe')\n\n const [appIsReady, setAppIsReady] = useState(false)\n const [listeningForMessages, setListeningForMessages] = useState(false)\n\n const iframeRef = React.useRef<HTMLIFrameElement>(null)\n\n const [iframeHasLoaded, setIframeHasLoaded] = useState(false)\n\n const [zoom, setZoom] = useState(1)\n\n const [position, setPosition] = useState({ x: 0, y: 0 })\n\n const [size, setSize] = React.useReducer(sizeReducer, { height: 0, width: 0 })\n\n const [measuredDeviceSize, setMeasuredDeviceSize] = useState({\n height: 0,\n width: 0,\n })\n\n const [breakpoint, setBreakpoint] =\n React.useState<LivePreviewConfig['breakpoints'][0]['name']>('responsive')\n\n const [fieldSchemaJSON] = useState(() => {\n return fieldSchemaToJSON(fieldSchema)\n })\n\n // The toolbar needs to freely drag and drop around the page\n const handleDragEnd = (ev) => {\n // only update position if the toolbar is completely within the preview area\n // otherwise reset it back to the previous position\n // TODO: reset to the nearest edge of the preview area\n if (ev.over && ev.over.id === 'live-preview-area') {\n const newPos = {\n x: position.x + ev.delta.x,\n y: position.y + ev.delta.y,\n }\n\n setPosition(newPos)\n } else {\n // reset\n }\n }\n\n const setWidth = useCallback(\n (width) => {\n setSize({ type: 'width', value: width })\n },\n [setSize],\n )\n\n const setHeight = useCallback(\n (height) => {\n setSize({ type: 'height', value: height })\n },\n [setSize],\n )\n\n // explicitly set new width and height when as new breakpoints are selected\n // exclude `custom` breakpoint as it is handled by the `setWidth` and `setHeight` directly\n useEffect(() => {\n const foundBreakpoint = breakpoints?.find((bp) => bp.name === breakpoint)\n\n if (\n foundBreakpoint &&\n breakpoint !== 'responsive' &&\n breakpoint !== 'custom' &&\n typeof foundBreakpoint?.width === 'number' &&\n typeof foundBreakpoint?.height === 'number'\n ) {\n setSize({\n type: 'reset',\n value: {\n height: foundBreakpoint.height,\n width: foundBreakpoint.width,\n },\n })\n }\n }, [breakpoint, breakpoints])\n\n // Receive the `ready` message from the popup window\n // This indicates that the app is ready to receive `window.postMessage` events\n // This is also the only cross-origin way of detecting when a popup window has loaded\n // Unlike iframe elements which have an `onLoad` handler, there is no way to access `window.open` on popups\n useEffect(() => {\n const handleMessage = (event: MessageEvent) => {\n if (\n url?.startsWith(event.origin) &&\n event.data &&\n typeof event.data === 'object' &&\n event.data.type === 'payload-live-preview'\n ) {\n if (event.data.ready) {\n setAppIsReady(true)\n }\n }\n }\n\n window.addEventListener('message', handleMessage)\n\n setListeningForMessages(true)\n\n return () => {\n window.removeEventListener('message', handleMessage)\n }\n }, [url, listeningForMessages])\n\n const handleWindowChange = useCallback(\n (type: 'iframe' | 'popup') => {\n setAppIsReady(false)\n setPreviewWindowType(type)\n if (type === 'popup') openPopupWindow()\n },\n [openPopupWindow],\n )\n\n // when the user closes the popup window, switch back to the iframe\n // the `usePopupWindow` reports the `isPopupOpen` state for us to use here\n useEffect(() => {\n const newPreviewWindowType = isPopupOpen ? 'popup' : 'iframe'\n\n if (newPreviewWindowType !== previewWindowType) {\n handleWindowChange('iframe')\n }\n }, [previewWindowType, isPopupOpen, handleWindowChange])\n\n return (\n <LivePreviewContext.Provider\n value={{\n appIsReady,\n breakpoint,\n breakpoints,\n fieldSchemaJSON,\n iframeHasLoaded,\n iframeRef,\n isPopupOpen,\n measuredDeviceSize,\n openPopupWindow,\n popupRef,\n previewWindowType,\n setAppIsReady,\n setBreakpoint,\n setHeight,\n setIframeHasLoaded,\n setMeasuredDeviceSize,\n setPreviewWindowType: handleWindowChange,\n setSize,\n setToolbarPosition: setPosition,\n setWidth,\n setZoom,\n size,\n toolbarPosition: position,\n url,\n zoom,\n }}\n >\n <DndContext collisionDetection={customCollisionDetection} onDragEnd={handleDragEnd}>\n {listeningForMessages && children}\n </DndContext>\n </LivePreviewContext.Provider>\n )\n}\n"],"names":["DndContext","fieldSchemaToJSON","React","useCallback","useEffect","useState","customCollisionDetection","LivePreviewContext","sizeReducer","LivePreviewProvider","breakpoints","children","fieldSchema","isPopupOpen","openPopupWindow","popupRef","url","previewWindowType","setPreviewWindowType","appIsReady","setAppIsReady","listeningForMessages","setListeningForMessages","iframeRef","useRef","iframeHasLoaded","setIframeHasLoaded","zoom","setZoom","position","setPosition","x","y","size","setSize","useReducer","height","width","measuredDeviceSize","setMeasuredDeviceSize","breakpoint","setBreakpoint","fieldSchemaJSON","handleDragEnd","ev","over","id","newPos","delta","setWidth","type","value","setHeight","foundBreakpoint","find","bp","name","handleMessage","event","startsWith","origin","data","ready","window","addEventListener","removeEventListener","handleWindowChange","newPreviewWindowType","Provider","setToolbarPosition","toolbarPosition","collisionDetection","onDragEnd"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,UAAU,QAAQ,gBAAe;AAC1C,SAASC,iBAAiB,QAAQ,oBAAmB;AACrD,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAI/D,SAASC,wBAAwB,QAAQ,0BAAyB;AAClE,SAASC,kBAAkB,QAAQ,eAAc;AACjD,SAASC,WAAW,QAAQ,mBAAkB;AAiB9C,OAAO,MAAMC,sBAA0D,CAAC,EACtEC,WAAW,EACXC,QAAQ,EACRC,WAAW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;QAAaqD;KAAmB;IAEvD,qBACE,oBAAC3D,mBAAmB6D,QAAQ;QAC1BjB,OAAO;YACLhC;YACAqB;YACA9B;YACAgC;YACAjB;YACAF;YACAV;YACAyB;YACAxB;YACAC;YACAE;YACAG;YACAqB;YACAW;YACA1B;YACAa;YACArB,sBAAsBgD;YACtBhC;YACAmC,oBAAoBvC;YACpBmB;YACArB;YACAK;YACAqC,iBAAiBzC;YACjBb;YACAW;QACF;qBAEA,oBAAC3B;QAAWuE,oBAAoBjE;QAA0BkE,WAAW7B;OAClEtB,wBAAwBV;AAIjC,EAAC"}
|
|
@@ -8,17 +8,7 @@
|
|
|
8
8
|
// return { ...state, ...(action?.value || {}) }
|
|
9
9
|
// }
|
|
10
10
|
// },
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, "__esModule", {
|
|
13
|
-
value: true
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(exports, "sizeReducer", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function() {
|
|
18
|
-
return sizeReducer;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
const sizeReducer = (state, action)=>{
|
|
11
|
+
export const sizeReducer = (state, action)=>{
|
|
22
12
|
switch(action.type){
|
|
23
13
|
case 'width':
|
|
24
14
|
return {
|
|
@@ -38,4 +28,4 @@ const sizeReducer = (state, action)=>{
|
|
|
38
28
|
}
|
|
39
29
|
};
|
|
40
30
|
|
|
41
|
-
//# sourceMappingURL=
|
|
31
|
+
//# sourceMappingURL=sizeReducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/LivePreview/Context/sizeReducer.ts"],"sourcesContent":["// export const sizeReducer: (state, action) => {\n// switch (action.type) {\n// case 'width':\n// return { ...state, width: action.value }\n// case 'height':\n// return { ...state, height: action.value }\n// default:\n// return { ...state, ...(action?.value || {}) }\n// }\n// },\n\ntype SizeReducerState = {\n height: number\n width: number\n}\n\nexport type SizeReducerAction =\n | {\n type: 'height' | 'width'\n value: number\n }\n | {\n type: 'reset'\n value: {\n height: number\n width: number\n }\n }\n\nexport const sizeReducer = (state: SizeReducerState, action: SizeReducerAction) => {\n switch (action.type) {\n case 'width':\n return { ...state, width: action.value }\n case 'height':\n return { ...state, height: action.value }\n default:\n return { ...state, ...(action?.value || {}) }\n }\n}\n"],"names":["sizeReducer","state","action","type","width","value","height"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,iDAAiD;AACjD,2BAA2B;AAC3B,oBAAoB;AACpB,iDAAiD;AACjD,qBAAqB;AACrB,kDAAkD;AAClD,eAAe;AACf,sDAAsD;AACtD,MAAM;AACN,KAAK;AAoBL,OAAO,MAAMA,cAAc,CAACC,OAAyBC;IACnD,OAAQA,OAAOC,IAAI;QACjB,KAAK;YACH,OAAO;gBAAE,GAAGF,KAAK;gBAAEG,OAAOF,OAAOG,KAAK;YAAC;QACzC,KAAK;YACH,OAAO;gBAAE,GAAGJ,KAAK;gBAAEK,QAAQJ,OAAOG,KAAK;YAAC;QAC1C;YACE,OAAO;gBAAE,GAAGJ,KAAK;gBAAE,GAAIC,QAAQG,SAAS,CAAC,CAAC;YAAE;IAChD;AACF,EAAC"}
|
|
@@ -1,69 +1,18 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, "DeviceContainer", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function() {
|
|
9
|
-
return DeviceContainer;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
const _ui = require("@payloadcms/ui");
|
|
13
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
14
|
-
const _context = require("../Context/context");
|
|
15
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
16
|
-
if (typeof WeakMap !== "function") return null;
|
|
17
|
-
var cacheBabelInterop = new WeakMap();
|
|
18
|
-
var cacheNodeInterop = new WeakMap();
|
|
19
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
20
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
21
|
-
})(nodeInterop);
|
|
22
|
-
}
|
|
23
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
24
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
25
|
-
return obj;
|
|
26
|
-
}
|
|
27
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
28
|
-
return {
|
|
29
|
-
default: obj
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
33
|
-
if (cache && cache.has(obj)) {
|
|
34
|
-
return cache.get(obj);
|
|
35
|
-
}
|
|
36
|
-
var newObj = {
|
|
37
|
-
__proto__: null
|
|
38
|
-
};
|
|
39
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
40
|
-
for(var key in obj){
|
|
41
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
42
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
43
|
-
if (desc && (desc.get || desc.set)) {
|
|
44
|
-
Object.defineProperty(newObj, key, desc);
|
|
45
|
-
} else {
|
|
46
|
-
newObj[key] = obj[key];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
newObj.default = obj;
|
|
51
|
-
if (cache) {
|
|
52
|
-
cache.set(obj, newObj);
|
|
53
|
-
}
|
|
54
|
-
return newObj;
|
|
55
|
-
}
|
|
56
|
-
const DeviceContainer = (props)=>{
|
|
2
|
+
import { useResize } from '@payloadcms/ui/hooks/useResize';
|
|
3
|
+
import React, { useEffect } from 'react';
|
|
4
|
+
import { useLivePreviewContext } from '../Context/context.js';
|
|
5
|
+
export const DeviceContainer = (props)=>{
|
|
57
6
|
const { children } = props;
|
|
58
|
-
const deviceFrameRef =
|
|
59
|
-
const { breakpoint, setMeasuredDeviceSize, size, zoom } =
|
|
7
|
+
const deviceFrameRef = React.useRef(null);
|
|
8
|
+
const { breakpoint, setMeasuredDeviceSize, size, zoom } = useLivePreviewContext();
|
|
60
9
|
// Keep an accurate measurement of the actual device size as it is truly rendered
|
|
61
10
|
// This is helpful when `sizes` are non-number units like percentages, etc.
|
|
62
|
-
const { size: measuredDeviceSize } =
|
|
11
|
+
const { size: measuredDeviceSize } = useResize(deviceFrameRef);
|
|
63
12
|
// Sync the measured device size with the context so that other components can use it
|
|
64
13
|
// This happens from the bottom up so that as this component mounts and unmounts,
|
|
65
14
|
// Its size is freshly populated again upon re-mounting, i.e. going from iframe->popup->iframe
|
|
66
|
-
|
|
15
|
+
useEffect(()=>{
|
|
67
16
|
if (measuredDeviceSize) {
|
|
68
17
|
setMeasuredDeviceSize(measuredDeviceSize);
|
|
69
18
|
}
|
|
@@ -88,7 +37,7 @@ const DeviceContainer = (props)=>{
|
|
|
88
37
|
width = `${size?.width / (typeof zoom === 'number' ? zoom : 1)}px`;
|
|
89
38
|
height = `${size?.height / (typeof zoom === 'number' ? zoom : 1)}px`;
|
|
90
39
|
}
|
|
91
|
-
return /*#__PURE__*/
|
|
40
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
92
41
|
ref: deviceFrameRef,
|
|
93
42
|
style: {
|
|
94
43
|
height,
|
|
@@ -99,4 +48,4 @@ const DeviceContainer = (props)=>{
|
|
|
99
48
|
}, children);
|
|
100
49
|
};
|
|
101
50
|
|
|
102
|
-
//# sourceMappingURL=
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/LivePreview/Device/index.tsx"],"sourcesContent":["'use client'\nimport { useResize } from '@payloadcms/ui/hooks/useResize'\nimport React, { useEffect } from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\n\nexport const DeviceContainer: React.FC<{\n children: React.ReactNode\n}> = (props) => {\n const { children } = props\n\n const deviceFrameRef = React.useRef<HTMLDivElement>(null)\n\n const { breakpoint, setMeasuredDeviceSize, size, zoom } = useLivePreviewContext()\n\n // Keep an accurate measurement of the actual device size as it is truly rendered\n // This is helpful when `sizes` are non-number units like percentages, etc.\n const { size: measuredDeviceSize } = useResize(deviceFrameRef)\n\n // Sync the measured device size with the context so that other components can use it\n // This happens from the bottom up so that as this component mounts and unmounts,\n // Its size is freshly populated again upon re-mounting, i.e. going from iframe->popup->iframe\n useEffect(() => {\n if (measuredDeviceSize) {\n setMeasuredDeviceSize(measuredDeviceSize)\n }\n }, [measuredDeviceSize, setMeasuredDeviceSize])\n\n let x = '0'\n let margin = '0'\n\n if (breakpoint && breakpoint !== 'responsive') {\n x = '-50%'\n\n if (\n typeof zoom === 'number' &&\n typeof size.width === 'number' &&\n typeof size.height === 'number'\n ) {\n const scaledWidth = size.width / zoom\n const difference = scaledWidth - size.width\n x = `${difference / 2}px`\n margin = '0 auto'\n }\n }\n\n let width = zoom ? `${100 / zoom}%` : '100%'\n let height = zoom ? `${100 / zoom}%` : '100%'\n\n if (breakpoint !== 'responsive') {\n width = `${size?.width / (typeof zoom === 'number' ? zoom : 1)}px`\n height = `${size?.height / (typeof zoom === 'number' ? zoom : 1)}px`\n }\n\n return (\n <div\n ref={deviceFrameRef}\n style={{\n height,\n margin,\n transform: `translate3d(${x}, 0, 0)`,\n width,\n }}\n >\n {children}\n </div>\n )\n}\n"],"names":["useResize","React","useEffect","useLivePreviewContext","DeviceContainer","props","children","deviceFrameRef","useRef","breakpoint","setMeasuredDeviceSize","size","zoom","measuredDeviceSize","x","margin","width","height","scaledWidth","difference","div","ref","style","transform"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,iCAAgC;AAC1D,OAAOC,SAASC,SAAS,QAAQ,QAAO;AAExC,SAASC,qBAAqB,QAAQ,wBAAuB;AAE7D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QACF;OAECV;AAGP,EAAC"}
|
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "DeviceContainer", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function() {
|
|
9
|
-
return DeviceContainer;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
13
|
-
const _context = require("../Context/context");
|
|
14
|
-
function _interop_require_default(obj) {
|
|
15
|
-
return obj && obj.__esModule ? obj : {
|
|
16
|
-
default: obj
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
const DeviceContainer = (props)=>{
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useLivePreviewContext } from '../Context/context.js';
|
|
4
|
+
export const DeviceContainer = (props)=>{
|
|
20
5
|
const { children } = props;
|
|
21
|
-
const { breakpoint, breakpoints, size, zoom } =
|
|
6
|
+
const { breakpoint, breakpoints, size, zoom } = useLivePreviewContext();
|
|
22
7
|
const foundBreakpoint = breakpoint && breakpoints?.find((bp)=>bp.name === breakpoint);
|
|
23
8
|
let x = '0';
|
|
24
9
|
let margin = '0';
|
|
@@ -31,7 +16,7 @@ const DeviceContainer = (props)=>{
|
|
|
31
16
|
margin = '0 auto';
|
|
32
17
|
}
|
|
33
18
|
}
|
|
34
|
-
return /*#__PURE__*/
|
|
19
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
35
20
|
style: {
|
|
36
21
|
height: foundBreakpoint && foundBreakpoint?.name !== 'responsive' ? `${size?.height / (typeof zoom === 'number' ? zoom : 1)}px` : typeof zoom === 'number' ? `${100 / zoom}%` : '100%',
|
|
37
22
|
margin,
|
|
@@ -41,4 +26,4 @@ const DeviceContainer = (props)=>{
|
|
|
41
26
|
}, children);
|
|
42
27
|
};
|
|
43
28
|
|
|
44
|
-
//# sourceMappingURL=
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/LivePreview/DeviceContainer/index.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\n\nexport const DeviceContainer: React.FC<{\n children: React.ReactNode\n}> = (props) => {\n const { children } = props\n\n const { breakpoint, breakpoints, size, zoom } = useLivePreviewContext()\n\n const foundBreakpoint = breakpoint && breakpoints?.find((bp) => bp.name === breakpoint)\n\n let x = '0'\n let margin = '0'\n\n if (foundBreakpoint && breakpoint !== 'responsive') {\n x = '-50%'\n\n if (\n typeof zoom === 'number' &&\n typeof size.width === 'number' &&\n typeof size.height === 'number'\n ) {\n const scaledWidth = size.width / zoom\n const difference = scaledWidth - size.width\n x = `${difference / 2}px`\n margin = '0 auto'\n }\n }\n\n return (\n <div\n style={{\n height:\n foundBreakpoint && foundBreakpoint?.name !== 'responsive'\n ? `${size?.height / (typeof zoom === 'number' ? zoom : 1)}px`\n : typeof zoom === 'number'\n ? `${100 / zoom}%`\n : '100%',\n margin,\n transform: `translate3d(${x}, 0, 0)`,\n width:\n foundBreakpoint && foundBreakpoint?.name !== 'responsive'\n ? `${size?.width / (typeof zoom === 'number' ? zoom : 1)}px`\n : typeof zoom === 'number'\n ? `${100 / zoom}%`\n : '100%',\n }}\n >\n {children}\n </div>\n )\n}\n"],"names":["React","useLivePreviewContext","DeviceContainer","props","children","breakpoint","breakpoints","size","zoom","foundBreakpoint","find","bp","name","x","margin","width","height","scaledWidth","difference","div","style","transform"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,OAAOA,WAAW,QAAO;AAEzB,SAASC,qBAAqB,QAAQ,wBAAuB;AAE7D,OAAO,MAAMC,kBAER,CAACC;IACJ,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,MAAM,EAAEE,UAAU,EAAEC,WAAW,EAAEC,IAAI,EAAEC,IAAI,EAAE,GAAGP;IAEhD,MAAMQ,kBAAkBJ,cAAcC,aAAaI,KAAK,CAACC,KAAOA,GAAGC,IAAI,KAAKP;IAE5E,IAAIQ,IAAI;IACR,IAAIC,SAAS;IAEb,IAAIL,mBAAmBJ,eAAe,cAAc;QAClDQ,IAAI;QAEJ,IACE,OAAOL,SAAS,YAChB,OAAOD,KAAKQ,KAAK,KAAK,YACtB,OAAOR,KAAKS,MAAM,KAAK,UACvB;YACA,MAAMC,cAAcV,KAAKQ,KAAK,GAAGP;YACjC,MAAMU,aAAaD,cAAcV,KAAKQ,KAAK;YAC3CF,IAAI,CAAC,EAAEK,aAAa,EAAE,EAAE,CAAC;YACzBJ,SAAS;QACX;IACF;IAEA,qBACE,oBAACK;QACCC,OAAO;YACLJ,QACEP,mBAAmBA,iBAAiBG,SAAS,eACzC,CAAC,EAAEL,MAAMS,SAAU,CAAA,OAAOR,SAAS,WAAWA,OAAO,CAAA,EAAG,EAAE,CAAC,GAC3D,OAAOA,SAAS,WACd,CAAC,EAAE,MAAMA,KAAK,CAAC,CAAC,GAChB;YACRM;YACAO,WAAW,CAAC,YAAY,EAAER,EAAE,OAAO,CAAC;YACpCE,OACEN,mBAAmBA,iBAAiBG,SAAS,eACzC,CAAC,EAAEL,MAAMQ,QAAS,CAAA,OAAOP,SAAS,WAAWA,OAAO,CAAA,EAAG,EAAE,CAAC,GAC1D,OAAOA,SAAS,WACd,CAAC,EAAE,MAAMA,KAAK,CAAC,CAAC,GAChB;QACV;OAECJ;AAGP,EAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.scss';
|
|
3
|
-
|
|
4
|
-
ref: React.Ref<HTMLIFrameElement>;
|
|
3
|
+
type Props = {
|
|
5
4
|
setIframeHasLoaded: (value: boolean) => void;
|
|
6
5
|
url: string;
|
|
7
|
-
}
|
|
6
|
+
};
|
|
7
|
+
export declare const IFrame: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLIFrameElement>>;
|
|
8
|
+
export {};
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/IFrame/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAGzC,OAAO,cAAc,CAAA;AAIrB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/IFrame/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAGzC,OAAO,cAAc,CAAA;AAIrB,KAAK,KAAK,GAAG;IACX,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAC5C,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,eAAO,MAAM,MAAM,iFAmBjB,CAAA"}
|
|
@@ -1,63 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "IFrame", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function() {
|
|
9
|
-
return IFrame;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
13
|
-
const _context = require("../Context/context");
|
|
14
|
-
require("./index.scss");
|
|
15
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
16
|
-
if (typeof WeakMap !== "function") return null;
|
|
17
|
-
var cacheBabelInterop = new WeakMap();
|
|
18
|
-
var cacheNodeInterop = new WeakMap();
|
|
19
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
20
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
21
|
-
})(nodeInterop);
|
|
22
|
-
}
|
|
23
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
24
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
25
|
-
return obj;
|
|
26
|
-
}
|
|
27
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
28
|
-
return {
|
|
29
|
-
default: obj
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
33
|
-
if (cache && cache.has(obj)) {
|
|
34
|
-
return cache.get(obj);
|
|
35
|
-
}
|
|
36
|
-
var newObj = {
|
|
37
|
-
__proto__: null
|
|
38
|
-
};
|
|
39
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
40
|
-
for(var key in obj){
|
|
41
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
42
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
43
|
-
if (desc && (desc.get || desc.set)) {
|
|
44
|
-
Object.defineProperty(newObj, key, desc);
|
|
45
|
-
} else {
|
|
46
|
-
newObj[key] = obj[key];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
newObj.default = obj;
|
|
51
|
-
if (cache) {
|
|
52
|
-
cache.set(obj, newObj);
|
|
53
|
-
}
|
|
54
|
-
return newObj;
|
|
55
|
-
}
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { useLivePreviewContext } from '../Context/context.js';
|
|
56
4
|
const baseClass = 'live-preview-iframe';
|
|
57
|
-
const IFrame = /*#__PURE__*/
|
|
5
|
+
export const IFrame = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
58
6
|
const { setIframeHasLoaded, url } = props;
|
|
59
|
-
const { zoom } =
|
|
60
|
-
return /*#__PURE__*/
|
|
7
|
+
const { zoom } = useLivePreviewContext();
|
|
8
|
+
return /*#__PURE__*/ React.createElement("iframe", {
|
|
61
9
|
className: baseClass,
|
|
62
10
|
onLoad: ()=>{
|
|
63
11
|
setIframeHasLoaded(true);
|
|
@@ -71,4 +19,4 @@ const IFrame = /*#__PURE__*/ (0, _react.forwardRef)((props, ref)=>{
|
|
|
71
19
|
});
|
|
72
20
|
});
|
|
73
21
|
|
|
74
|
-
//# sourceMappingURL=
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/LivePreview/IFrame/index.tsx"],"sourcesContent":["'use client'\nimport React, { forwardRef } from 'react'\n\nimport { useLivePreviewContext } from '../Context/context.js'\nimport './index.scss'\n\nconst baseClass = 'live-preview-iframe'\n\ntype Props = {\n setIframeHasLoaded: (value: boolean) => void\n url: string\n}\n\nexport const IFrame = forwardRef<HTMLIFrameElement, Props>((props, ref) => {\n const { setIframeHasLoaded, url } = props\n\n const { zoom } = useLivePreviewContext()\n\n return (\n <iframe\n className={baseClass}\n onLoad={() => {\n setIframeHasLoaded(true)\n }}\n ref={ref}\n src={url}\n style={{\n transform: typeof zoom === 'number' ? `scale(${zoom}) ` : undefined,\n }}\n title={url}\n />\n )\n})\n"],"names":["React","forwardRef","useLivePreviewContext","baseClass","IFrame","props","ref","setIframeHasLoaded","url","zoom","iframe","className","onLoad","src","style","transform","undefined","title"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,OAAOA,SAASC,UAAU,QAAQ,QAAO;AAEzC,SAASC,qBAAqB,QAAQ,wBAAuB;AAG7D,MAAMC,YAAY;AAOlB,OAAO,MAAMC,uBAASH,WAAqC,CAACI,OAAOC;IACjE,MAAM,EAAEC,kBAAkB,EAAEC,GAAG,EAAE,GAAGH;IAEpC,MAAM,EAAEI,IAAI,EAAE,GAAGP;IAEjB,qBACE,oBAACQ;QACCC,WAAWR;QACXS,QAAQ;YACNL,mBAAmB;QACrB;QACAD,KAAKA;QACLO,KAAKL;QACLM,OAAO;YACLC,WAAW,OAAON,SAAS,WAAW,CAAC,MAAM,EAAEA,KAAK,EAAE,CAAC,GAAGO;QAC5D;QACAC,OAAOT;;AAGb,GAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Preview/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/LivePreview/Preview/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAMlD,OAAO,KAAoB,MAAM,OAAO,CAAA;AAMxC,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA4F/C,CAAA"}
|