lkd-web-kit 0.7.15 → 0.7.16
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/components/EmptyState/index.cjs +5 -5
- package/dist/components/Icon.cjs +2 -2
- package/dist/components/InfinityLoadMoreButton/index.cjs +2 -2
- package/dist/components/InfinitySelect/index.cjs +9 -10
- package/dist/components/InfinitySelect/index.js +0 -1
- package/dist/components/MyCheckboxGroup/index.cjs +2 -2
- package/dist/components/MyDateInput/index.cjs +3 -3
- package/dist/components/MyDatePickerInput/CalendarIcon.cjs +7 -7
- package/dist/components/MyDatePickerInput/index.cjs +3 -3
- package/dist/components/MyDateTimePicker/index.cjs +3 -3
- package/dist/components/MyMonthPickerInput/index.cjs +3 -3
- package/dist/components/MyMultiSelect/index.cjs +2 -2
- package/dist/components/MyNotifications/index.cjs +2 -2
- package/dist/components/MyNumberInput/index.cjs +2 -2
- package/dist/components/MyRadioGroup/index.cjs +2 -2
- package/dist/components/MySelect/index.cjs +2 -2
- package/dist/components/MyTextInput/index.cjs +2 -2
- package/dist/components/MyTextarea/index.cjs +2 -2
- package/dist/components/MyTimeInput/index.cjs +2 -2
- package/dist/components/NavItems.cjs +4 -4
- package/dist/contexts/NavigationHistoryContext/hook.cjs +2 -2
- package/dist/contexts/NavigationHistoryContext/hook.js +2 -2
- package/dist/contexts/NavigationHistoryContext/index.cjs +3 -3
- package/dist/contexts/PageDataContext/index.cjs +2 -2
- package/dist/form/Form.cjs +2 -2
- package/dist/form/FormSubmitButton.cjs +2 -2
- package/dist/form/base/FormCheckbox.cjs +2 -2
- package/dist/form/base/FormCheckboxGroup.cjs +2 -2
- package/dist/form/base/FormDateInput.cjs +2 -2
- package/dist/form/base/FormDatePickerInput.cjs +2 -2
- package/dist/form/base/FormDateTimePicker.cjs +2 -2
- package/dist/form/base/FormMonthPickerInput.cjs +2 -2
- package/dist/form/base/FormMultiSelect.cjs +2 -2
- package/dist/form/base/FormNumberInput.cjs +2 -2
- package/dist/form/base/FormRadioGroup.cjs +2 -2
- package/dist/form/base/FormSelect.cjs +2 -2
- package/dist/form/base/FormSelectInfinity.cjs +2 -2
- package/dist/form/base/FormTextInput.cjs +2 -2
- package/dist/form/base/FormTextarea.cjs +2 -2
- package/dist/form/base/FormTimeInput.cjs +2 -2
- package/dist/hocs/withController.cjs +3 -3
- package/dist/hocs/withModalManager.cjs +2 -2
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.cjs +2 -2
- package/package.json +1 -1
- package/dist/_virtual/___vite-browser-external.cjs +0 -12
- package/dist/_virtual/___vite-browser-external.js +0 -6
- package/dist/_virtual/__vite-browser-external.cjs +0 -5
- package/dist/_virtual/__vite-browser-external.js +0 -3
- package/dist/_virtual/_commonjsHelpers.cjs +0 -34
- package/dist/_virtual/_commonjsHelpers.js +0 -30
- package/dist/_virtual/_interop_require_default.cjs +0 -7
- package/dist/_virtual/_interop_require_default.js +0 -3
- package/dist/_virtual/_interop_require_wildcard.cjs +0 -7
- package/dist/_virtual/_interop_require_wildcard.js +0 -3
- package/dist/_virtual/add-base-path.cjs +0 -7
- package/dist/_virtual/add-base-path.js +0 -3
- package/dist/_virtual/add-locale.cjs +0 -7
- package/dist/_virtual/add-locale.js +0 -3
- package/dist/_virtual/add-locale2.cjs +0 -7
- package/dist/_virtual/add-locale2.js +0 -3
- package/dist/_virtual/add-path-prefix.cjs +0 -7
- package/dist/_virtual/add-path-prefix.js +0 -3
- package/dist/_virtual/add-path-suffix.cjs +0 -7
- package/dist/_virtual/add-path-suffix.js +0 -3
- package/dist/_virtual/app-paths.cjs +0 -7
- package/dist/_virtual/app-paths.js +0 -3
- package/dist/_virtual/bloom-filter.cjs +0 -7
- package/dist/_virtual/bloom-filter.js +0 -3
- package/dist/_virtual/compare-states.cjs +0 -7
- package/dist/_virtual/compare-states.js +0 -3
- package/dist/_virtual/constants.cjs +0 -7
- package/dist/_virtual/constants.js +0 -3
- package/dist/_virtual/denormalize-page-path.cjs +0 -7
- package/dist/_virtual/denormalize-page-path.js +0 -3
- package/dist/_virtual/deployment-id.cjs +0 -7
- package/dist/_virtual/deployment-id.js +0 -3
- package/dist/_virtual/detect-domain-locale.cjs +0 -7
- package/dist/_virtual/detect-domain-locale.js +0 -3
- package/dist/_virtual/detect-domain-locale2.cjs +0 -7
- package/dist/_virtual/detect-domain-locale2.js +0 -3
- package/dist/_virtual/disable-smooth-scroll.cjs +0 -7
- package/dist/_virtual/disable-smooth-scroll.js +0 -3
- package/dist/_virtual/encode-uri-path.cjs +0 -7
- package/dist/_virtual/encode-uri-path.js +0 -3
- package/dist/_virtual/ensure-leading-slash.cjs +0 -7
- package/dist/_virtual/ensure-leading-slash.js +0 -3
- package/dist/_virtual/escape-regexp.cjs +0 -7
- package/dist/_virtual/escape-regexp.js +0 -3
- package/dist/_virtual/format-next-pathname-info.cjs +0 -7
- package/dist/_virtual/format-next-pathname-info.js +0 -3
- package/dist/_virtual/format-url.cjs +0 -7
- package/dist/_virtual/format-url.js +0 -3
- package/dist/_virtual/get-asset-path-from-route.cjs +0 -7
- package/dist/_virtual/get-asset-path-from-route.js +0 -3
- package/dist/_virtual/get-cookie-parser.cjs +0 -7
- package/dist/_virtual/get-cookie-parser.js +0 -3
- package/dist/_virtual/get-dynamic-param.cjs +0 -7
- package/dist/_virtual/get-dynamic-param.js +0 -3
- package/dist/_virtual/get-next-pathname-info.cjs +0 -7
- package/dist/_virtual/get-next-pathname-info.js +0 -3
- package/dist/_virtual/get-segment-param.cjs +0 -7
- package/dist/_virtual/get-segment-param.js +0 -3
- package/dist/_virtual/has-base-path.cjs +0 -7
- package/dist/_virtual/has-base-path.js +0 -3
- package/dist/_virtual/head-manager-context.shared-runtime.cjs +0 -7
- package/dist/_virtual/head-manager-context.shared-runtime.js +0 -3
- package/dist/_virtual/html-bots.cjs +0 -7
- package/dist/_virtual/html-bots.js +0 -3
- package/dist/_virtual/index.cjs +0 -7
- package/dist/_virtual/index.js +0 -3
- package/dist/_virtual/index2.cjs +0 -7
- package/dist/_virtual/index2.js +0 -3
- package/dist/_virtual/index3.cjs +0 -7
- package/dist/_virtual/index3.js +0 -3
- package/dist/_virtual/index4.cjs +0 -7
- package/dist/_virtual/index4.js +0 -3
- package/dist/_virtual/index5.cjs +0 -7
- package/dist/_virtual/index5.js +0 -3
- package/dist/_virtual/interception-routes.cjs +0 -7
- package/dist/_virtual/interception-routes.js +0 -3
- package/dist/_virtual/interpolate-as.cjs +0 -7
- package/dist/_virtual/interpolate-as.js +0 -3
- package/dist/_virtual/invariant-error.cjs +0 -7
- package/dist/_virtual/invariant-error.js +0 -3
- package/dist/_virtual/is-api-route.cjs +0 -7
- package/dist/_virtual/is-api-route.js +0 -3
- package/dist/_virtual/is-bot.cjs +0 -7
- package/dist/_virtual/is-bot.js +0 -3
- package/dist/_virtual/is-dynamic.cjs +0 -7
- package/dist/_virtual/is-dynamic.js +0 -3
- package/dist/_virtual/is-error.cjs +0 -7
- package/dist/_virtual/is-error.js +0 -3
- package/dist/_virtual/is-local-url.cjs +0 -7
- package/dist/_virtual/is-local-url.js +0 -3
- package/dist/_virtual/is-plain-object.cjs +0 -7
- package/dist/_virtual/is-plain-object.js +0 -3
- package/dist/_virtual/mitt.cjs +0 -7
- package/dist/_virtual/mitt.js +0 -3
- package/dist/_virtual/normalize-locale-path.cjs +0 -7
- package/dist/_virtual/normalize-locale-path.js +0 -3
- package/dist/_virtual/normalize-path-sep.cjs +0 -7
- package/dist/_virtual/normalize-path-sep.js +0 -3
- package/dist/_virtual/normalize-trailing-slash.cjs +0 -7
- package/dist/_virtual/normalize-trailing-slash.js +0 -3
- package/dist/_virtual/omit.cjs +0 -7
- package/dist/_virtual/omit.js +0 -3
- package/dist/_virtual/parse-loader-tree.cjs +0 -7
- package/dist/_virtual/parse-loader-tree.js +0 -3
- package/dist/_virtual/parse-path.cjs +0 -7
- package/dist/_virtual/parse-path.js +0 -3
- package/dist/_virtual/parse-relative-url.cjs +0 -7
- package/dist/_virtual/parse-relative-url.js +0 -3
- package/dist/_virtual/parse-url.cjs +0 -7
- package/dist/_virtual/parse-url.js +0 -3
- package/dist/_virtual/path-has-prefix.cjs +0 -7
- package/dist/_virtual/path-has-prefix.js +0 -3
- package/dist/_virtual/path-match.cjs +0 -7
- package/dist/_virtual/path-match.js +0 -3
- package/dist/_virtual/prepare-destination.cjs +0 -7
- package/dist/_virtual/prepare-destination.js +0 -3
- package/dist/_virtual/querystring.cjs +0 -7
- package/dist/_virtual/querystring.js +0 -3
- package/dist/_virtual/react-is.development.cjs +0 -7
- package/dist/_virtual/react-is.development.js +0 -3
- package/dist/_virtual/react-is.production.cjs +0 -7
- package/dist/_virtual/react-is.production.js +0 -3
- package/dist/_virtual/remove-base-path.cjs +0 -7
- package/dist/_virtual/remove-base-path.js +0 -3
- package/dist/_virtual/remove-locale.cjs +0 -7
- package/dist/_virtual/remove-locale.js +0 -3
- package/dist/_virtual/remove-path-prefix.cjs +0 -7
- package/dist/_virtual/remove-path-prefix.js +0 -3
- package/dist/_virtual/remove-trailing-slash.cjs +0 -7
- package/dist/_virtual/remove-trailing-slash.js +0 -3
- package/dist/_virtual/request-idle-callback.cjs +0 -7
- package/dist/_virtual/request-idle-callback.js +0 -3
- package/dist/_virtual/resolve-href.cjs +0 -7
- package/dist/_virtual/resolve-href.js +0 -3
- package/dist/_virtual/resolve-rewrites.cjs +0 -7
- package/dist/_virtual/resolve-rewrites.js +0 -3
- package/dist/_virtual/route-loader.cjs +0 -7
- package/dist/_virtual/route-loader.js +0 -3
- package/dist/_virtual/route-match-utils.cjs +0 -7
- package/dist/_virtual/route-match-utils.js +0 -3
- package/dist/_virtual/route-matcher.cjs +0 -7
- package/dist/_virtual/route-matcher.js +0 -3
- package/dist/_virtual/route-pattern-normalizer.cjs +0 -7
- package/dist/_virtual/route-pattern-normalizer.js +0 -3
- package/dist/_virtual/route-regex.cjs +0 -7
- package/dist/_virtual/route-regex.js +0 -3
- package/dist/_virtual/router-context.shared-runtime.cjs +0 -7
- package/dist/_virtual/router-context.shared-runtime.js +0 -3
- package/dist/_virtual/router.cjs +0 -9
- package/dist/_virtual/router.js +0 -5
- package/dist/_virtual/router2.cjs +0 -7
- package/dist/_virtual/router2.js +0 -3
- package/dist/_virtual/router3.cjs +0 -7
- package/dist/_virtual/router3.js +0 -3
- package/dist/_virtual/script.cjs +0 -7
- package/dist/_virtual/script.js +0 -3
- package/dist/_virtual/segment.cjs +0 -7
- package/dist/_virtual/segment.js +0 -3
- package/dist/_virtual/set-attributes-from-props.cjs +0 -7
- package/dist/_virtual/set-attributes-from-props.js +0 -3
- package/dist/_virtual/sorted-routes.cjs +0 -7
- package/dist/_virtual/sorted-routes.js +0 -3
- package/dist/_virtual/trusted-types.cjs +0 -7
- package/dist/_virtual/trusted-types.js +0 -3
- package/dist/_virtual/utils.cjs +0 -7
- package/dist/_virtual/utils.js +0 -3
- package/dist/_virtual/warn-once.cjs +0 -7
- package/dist/_virtual/warn-once.js +0 -3
- package/dist/_virtual/with-router.cjs +0 -7
- package/dist/_virtual/with-router.js +0 -3
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_default.cjs +0 -20
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_default.js +0 -16
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs +0 -52
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_wildcard.js +0 -48
- package/dist/node_modules/next/dist/build/deployment-id.cjs +0 -34
- package/dist/node_modules/next/dist/build/deployment-id.js +0 -30
- package/dist/node_modules/next/dist/client/add-base-path.cjs +0 -42
- package/dist/node_modules/next/dist/client/add-base-path.js +0 -38
- package/dist/node_modules/next/dist/client/add-locale.cjs +0 -43
- package/dist/node_modules/next/dist/client/add-locale.js +0 -39
- package/dist/node_modules/next/dist/client/detect-domain-locale.cjs +0 -40
- package/dist/node_modules/next/dist/client/detect-domain-locale.js +0 -36
- package/dist/node_modules/next/dist/client/has-base-path.cjs +0 -40
- package/dist/node_modules/next/dist/client/has-base-path.js +0 -36
- package/dist/node_modules/next/dist/client/normalize-trailing-slash.cjs +0 -54
- package/dist/node_modules/next/dist/client/normalize-trailing-slash.js +0 -50
- package/dist/node_modules/next/dist/client/remove-base-path.cjs +0 -49
- package/dist/node_modules/next/dist/client/remove-base-path.js +0 -45
- package/dist/node_modules/next/dist/client/remove-locale.cjs +0 -45
- package/dist/node_modules/next/dist/client/remove-locale.js +0 -41
- package/dist/node_modules/next/dist/client/request-idle-callback.cjs +0 -56
- package/dist/node_modules/next/dist/client/request-idle-callback.js +0 -52
- package/dist/node_modules/next/dist/client/resolve-href.cjs +0 -132
- package/dist/node_modules/next/dist/client/resolve-href.js +0 -128
- package/dist/node_modules/next/dist/client/route-loader.cjs +0 -363
- package/dist/node_modules/next/dist/client/route-loader.js +0 -359
- package/dist/node_modules/next/dist/client/router.cjs +0 -201
- package/dist/node_modules/next/dist/client/router.js +0 -197
- package/dist/node_modules/next/dist/client/script.cjs +0 -366
- package/dist/node_modules/next/dist/client/script.js +0 -362
- package/dist/node_modules/next/dist/client/set-attributes-from-props.cjs +0 -81
- package/dist/node_modules/next/dist/client/set-attributes-from-props.js +0 -77
- package/dist/node_modules/next/dist/client/trusted-types.cjs +0 -56
- package/dist/node_modules/next/dist/client/trusted-types.js +0 -52
- package/dist/node_modules/next/dist/client/with-router.cjs +0 -54
- package/dist/node_modules/next/dist/client/with-router.js +0 -50
- package/dist/node_modules/next/dist/compiled/cookie/index.cjs +0 -22
- package/dist/node_modules/next/dist/compiled/cookie/index.js +0 -18
- package/dist/node_modules/next/dist/compiled/gzip-size/index.cjs +0 -17
- package/dist/node_modules/next/dist/compiled/gzip-size/index.js +0 -13
- package/dist/node_modules/next/dist/compiled/path-to-regexp/index.cjs +0 -16
- package/dist/node_modules/next/dist/compiled/path-to-regexp/index.js +0 -12
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.development.cjs +0 -147
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.development.js +0 -143
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.production.cjs +0 -144
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.production.js +0 -140
- package/dist/node_modules/next/dist/compiled/react-is/index.cjs +0 -23
- package/dist/node_modules/next/dist/compiled/react-is/index.js +0 -19
- package/dist/node_modules/next/dist/lib/constants.cjs +0 -365
- package/dist/node_modules/next/dist/lib/constants.js +0 -361
- package/dist/node_modules/next/dist/lib/is-api-route.cjs +0 -31
- package/dist/node_modules/next/dist/lib/is-api-route.js +0 -27
- package/dist/node_modules/next/dist/lib/is-error.cjs +0 -91
- package/dist/node_modules/next/dist/lib/is-error.js +0 -87
- package/dist/node_modules/next/dist/lib/route-pattern-normalizer.cjs +0 -115
- package/dist/node_modules/next/dist/lib/route-pattern-normalizer.js +0 -111
- package/dist/node_modules/next/dist/server/api-utils/get-cookie-parser.cjs +0 -39
- package/dist/node_modules/next/dist/server/api-utils/get-cookie-parser.js +0 -35
- package/dist/node_modules/next/dist/shared/lib/bloom-filter.cjs +0 -101
- package/dist/node_modules/next/dist/shared/lib/bloom-filter.js +0 -97
- package/dist/node_modules/next/dist/shared/lib/encode-uri-path.cjs +0 -31
- package/dist/node_modules/next/dist/shared/lib/encode-uri-path.js +0 -27
- package/dist/node_modules/next/dist/shared/lib/escape-regexp.cjs +0 -37
- package/dist/node_modules/next/dist/shared/lib/escape-regexp.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.cjs +0 -36
- package/dist/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js +0 -32
- package/dist/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.cjs +0 -41
- package/dist/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js +0 -37
- package/dist/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.cjs +0 -70
- package/dist/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js +0 -66
- package/dist/node_modules/next/dist/shared/lib/invariant-error.cjs +0 -34
- package/dist/node_modules/next/dist/shared/lib/invariant-error.js +0 -30
- package/dist/node_modules/next/dist/shared/lib/is-plain-object.cjs +0 -54
- package/dist/node_modules/next/dist/shared/lib/is-plain-object.js +0 -50
- package/dist/node_modules/next/dist/shared/lib/mitt.cjs +0 -58
- package/dist/node_modules/next/dist/shared/lib/mitt.js +0 -54
- package/dist/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.cjs +0 -36
- package/dist/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js +0 -32
- package/dist/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.cjs +0 -36
- package/dist/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js +0 -32
- package/dist/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.cjs +0 -37
- package/dist/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/router/router.cjs +0 -1814
- package/dist/node_modules/next/dist/shared/lib/router/router.js +0 -1810
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-locale.cjs +0 -46
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-locale.js +0 -42
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.cjs +0 -37
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.cjs +0 -37
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/router/utils/app-paths.cjs +0 -65
- package/dist/node_modules/next/dist/shared/lib/router/utils/app-paths.js +0 -61
- package/dist/node_modules/next/dist/shared/lib/router/utils/compare-states.cjs +0 -50
- package/dist/node_modules/next/dist/shared/lib/router/utils/compare-states.js +0 -46
- package/dist/node_modules/next/dist/shared/lib/router/utils/disable-smooth-scroll.cjs +0 -60
- package/dist/node_modules/next/dist/shared/lib/router/utils/disable-smooth-scroll.js +0 -56
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.cjs +0 -47
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js +0 -43
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-url.cjs +0 -103
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-url.js +0 -99
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.cjs +0 -32
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.js +0 -28
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.cjs +0 -208
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +0 -204
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.cjs +0 -71
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js +0 -67
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-segment-param.cjs +0 -94
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +0 -90
- package/dist/node_modules/next/dist/shared/lib/router/utils/html-bots.cjs +0 -29
- package/dist/node_modules/next/dist/shared/lib/router/utils/html-bots.js +0 -25
- package/dist/node_modules/next/dist/shared/lib/router/utils/index.cjs +0 -43
- package/dist/node_modules/next/dist/shared/lib/router/utils/index.js +0 -39
- package/dist/node_modules/next/dist/shared/lib/router/utils/interception-routes.cjs +0 -119
- package/dist/node_modules/next/dist/shared/lib/router/utils/interception-routes.js +0 -115
- package/dist/node_modules/next/dist/shared/lib/router/utils/interpolate-as.cjs +0 -71
- package/dist/node_modules/next/dist/shared/lib/router/utils/interpolate-as.js +0 -67
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-bot.cjs +0 -68
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-bot.js +0 -64
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-dynamic.cjs +0 -43
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js +0 -39
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-local-url.cjs +0 -44
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-local-url.js +0 -40
- package/dist/node_modules/next/dist/shared/lib/router/utils/omit.cjs +0 -37
- package/dist/node_modules/next/dist/shared/lib/router/utils/omit.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.cjs +0 -46
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js +0 -42
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-path.cjs +0 -51
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-path.js +0 -47
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.cjs +0 -54
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js +0 -50
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-url.cjs +0 -50
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-url.js +0 -46
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.cjs +0 -37
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-match.cjs +0 -66
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-match.js +0 -62
- package/dist/node_modules/next/dist/shared/lib/router/utils/prepare-destination.cjs +0 -303
- package/dist/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +0 -299
- package/dist/node_modules/next/dist/shared/lib/router/utils/querystring.cjs +0 -90
- package/dist/node_modules/next/dist/shared/lib/router/utils/querystring.js +0 -86
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.cjs +0 -56
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js +0 -52
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.cjs +0 -39
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +0 -35
- package/dist/node_modules/next/dist/shared/lib/router/utils/resolve-rewrites.cjs +0 -140
- package/dist/node_modules/next/dist/shared/lib/router/utils/resolve-rewrites.js +0 -136
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-match-utils.cjs +0 -127
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-match-utils.js +0 -123
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-matcher.cjs +0 -63
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-matcher.js +0 -59
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-regex.cjs +0 -272
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-regex.js +0 -268
- package/dist/node_modules/next/dist/shared/lib/router/utils/sorted-routes.cjs +0 -256
- package/dist/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +0 -252
- package/dist/node_modules/next/dist/shared/lib/router-context.shared-runtime.cjs +0 -36
- package/dist/node_modules/next/dist/shared/lib/router-context.shared-runtime.js +0 -32
- package/dist/node_modules/next/dist/shared/lib/segment.cjs +0 -103
- package/dist/node_modules/next/dist/shared/lib/segment.js +0 -99
- package/dist/node_modules/next/dist/shared/lib/utils/warn-once.cjs +0 -38
- package/dist/node_modules/next/dist/shared/lib/utils/warn-once.js +0 -34
- package/dist/node_modules/next/dist/shared/lib/utils.cjs +0 -204
- package/dist/node_modules/next/dist/shared/lib/utils.js +0 -200
- package/dist/node_modules/next/router.cjs +0 -17
- package/dist/node_modules/next/router.js +0 -13
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { __module as router } from '../../../../_virtual/router2.js';
|
|
2
|
-
import { __require as require_interop_require_default } from '../../../@swc/helpers/cjs/_interop_require_default.js';
|
|
3
|
-
import React__default from 'react';
|
|
4
|
-
import { __require as requireRouter$1 } from '../shared/lib/router/router.js';
|
|
5
|
-
import { __require as requireRouterContext_sharedRuntime } from '../shared/lib/router-context.shared-runtime.js';
|
|
6
|
-
import { __require as requireIsError } from '../lib/is-error.js';
|
|
7
|
-
import { __require as requireWithRouter } from './with-router.js';
|
|
8
|
-
|
|
9
|
-
/* global window */
|
|
10
|
-
|
|
11
|
-
var hasRequiredRouter;
|
|
12
|
-
|
|
13
|
-
function requireRouter () {
|
|
14
|
-
if (hasRequiredRouter) return router.exports;
|
|
15
|
-
hasRequiredRouter = 1;
|
|
16
|
-
(function (module, exports) {
|
|
17
|
-
Object.defineProperty(exports, "__esModule", {
|
|
18
|
-
value: true
|
|
19
|
-
});
|
|
20
|
-
function _export(target, all) {
|
|
21
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: all[name]
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
_export(exports, {
|
|
27
|
-
Router: function() {
|
|
28
|
-
return _router.default;
|
|
29
|
-
},
|
|
30
|
-
createRouter: function() {
|
|
31
|
-
return createRouter;
|
|
32
|
-
},
|
|
33
|
-
// Export the singletonRouter and this is the public API.
|
|
34
|
-
default: function() {
|
|
35
|
-
return _default;
|
|
36
|
-
},
|
|
37
|
-
makePublicRouterInstance: function() {
|
|
38
|
-
return makePublicRouterInstance;
|
|
39
|
-
},
|
|
40
|
-
useRouter: function() {
|
|
41
|
-
return useRouter;
|
|
42
|
-
},
|
|
43
|
-
withRouter: function() {
|
|
44
|
-
return _withrouter.default;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
|
|
48
|
-
const _react = /*#__PURE__*/ _interop_require_default._(React__default);
|
|
49
|
-
const _router = /*#__PURE__*/ _interop_require_default._(requireRouter$1());
|
|
50
|
-
const _routercontextsharedruntime = requireRouterContext_sharedRuntime();
|
|
51
|
-
const _iserror = /*#__PURE__*/ _interop_require_default._(requireIsError());
|
|
52
|
-
const _withrouter = /*#__PURE__*/ _interop_require_default._(requireWithRouter());
|
|
53
|
-
const singletonRouter = {
|
|
54
|
-
router: null,
|
|
55
|
-
readyCallbacks: [],
|
|
56
|
-
ready (callback) {
|
|
57
|
-
if (this.router) return callback();
|
|
58
|
-
if (typeof window !== 'undefined') {
|
|
59
|
-
this.readyCallbacks.push(callback);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
// Create public properties and methods of the router in the singletonRouter
|
|
64
|
-
const urlPropertyFields = [
|
|
65
|
-
'pathname',
|
|
66
|
-
'route',
|
|
67
|
-
'query',
|
|
68
|
-
'asPath',
|
|
69
|
-
'components',
|
|
70
|
-
'isFallback',
|
|
71
|
-
'basePath',
|
|
72
|
-
'locale',
|
|
73
|
-
'locales',
|
|
74
|
-
'defaultLocale',
|
|
75
|
-
'isReady',
|
|
76
|
-
'isPreview',
|
|
77
|
-
'isLocaleDomain',
|
|
78
|
-
'domainLocales'
|
|
79
|
-
];
|
|
80
|
-
const routerEvents = [
|
|
81
|
-
'routeChangeStart',
|
|
82
|
-
'beforeHistoryChange',
|
|
83
|
-
'routeChangeComplete',
|
|
84
|
-
'routeChangeError',
|
|
85
|
-
'hashChangeStart',
|
|
86
|
-
'hashChangeComplete'
|
|
87
|
-
];
|
|
88
|
-
const coreMethodFields = [
|
|
89
|
-
'push',
|
|
90
|
-
'replace',
|
|
91
|
-
'reload',
|
|
92
|
-
'back',
|
|
93
|
-
'prefetch',
|
|
94
|
-
'beforePopState'
|
|
95
|
-
];
|
|
96
|
-
// Events is a static property on the router, the router doesn't have to be initialized to use it
|
|
97
|
-
Object.defineProperty(singletonRouter, 'events', {
|
|
98
|
-
get () {
|
|
99
|
-
return _router.default.events;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
function getRouter() {
|
|
103
|
-
if (!singletonRouter.router) {
|
|
104
|
-
const message = 'No router instance found.\n' + 'You should only use "next/router" on the client side of your app.\n';
|
|
105
|
-
throw Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
106
|
-
value: "E394",
|
|
107
|
-
enumerable: false,
|
|
108
|
-
configurable: true
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return singletonRouter.router;
|
|
112
|
-
}
|
|
113
|
-
urlPropertyFields.forEach((field)=>{
|
|
114
|
-
// Here we need to use Object.defineProperty because we need to return
|
|
115
|
-
// the property assigned to the actual router
|
|
116
|
-
// The value might get changed as we change routes and this is the
|
|
117
|
-
// proper way to access it
|
|
118
|
-
Object.defineProperty(singletonRouter, field, {
|
|
119
|
-
get () {
|
|
120
|
-
const router = getRouter();
|
|
121
|
-
return router[field];
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
coreMethodFields.forEach((field)=>{
|
|
126
|
-
singletonRouter[field] = (...args)=>{
|
|
127
|
-
const router = getRouter();
|
|
128
|
-
return router[field](...args);
|
|
129
|
-
};
|
|
130
|
-
});
|
|
131
|
-
routerEvents.forEach((event)=>{
|
|
132
|
-
singletonRouter.ready(()=>{
|
|
133
|
-
_router.default.events.on(event, (...args)=>{
|
|
134
|
-
const eventField = `on${event.charAt(0).toUpperCase()}${event.substring(1)}`;
|
|
135
|
-
const _singletonRouter = singletonRouter;
|
|
136
|
-
if (_singletonRouter[eventField]) {
|
|
137
|
-
try {
|
|
138
|
-
_singletonRouter[eventField](...args);
|
|
139
|
-
} catch (err) {
|
|
140
|
-
console.error(`Error when running the Router event: ${eventField}`);
|
|
141
|
-
console.error((0, _iserror.default)(err) ? `${err.message}\n${err.stack}` : err + '');
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
const _default = singletonRouter;
|
|
148
|
-
function useRouter() {
|
|
149
|
-
const router = _react.default.useContext(_routercontextsharedruntime.RouterContext);
|
|
150
|
-
if (!router) {
|
|
151
|
-
throw Object.defineProperty(new Error('NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted'), "__NEXT_ERROR_CODE", {
|
|
152
|
-
value: "E509",
|
|
153
|
-
enumerable: false,
|
|
154
|
-
configurable: true
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
return router;
|
|
158
|
-
}
|
|
159
|
-
function createRouter(...args) {
|
|
160
|
-
singletonRouter.router = new _router.default(...args);
|
|
161
|
-
singletonRouter.readyCallbacks.forEach((cb)=>cb());
|
|
162
|
-
singletonRouter.readyCallbacks = [];
|
|
163
|
-
return singletonRouter.router;
|
|
164
|
-
}
|
|
165
|
-
function makePublicRouterInstance(router) {
|
|
166
|
-
const scopedRouter = router;
|
|
167
|
-
const instance = {};
|
|
168
|
-
for (const property of urlPropertyFields){
|
|
169
|
-
if (typeof scopedRouter[property] === 'object') {
|
|
170
|
-
instance[property] = Object.assign(Array.isArray(scopedRouter[property]) ? [] : {}, scopedRouter[property]) // makes sure query is not stateful
|
|
171
|
-
;
|
|
172
|
-
continue;
|
|
173
|
-
}
|
|
174
|
-
instance[property] = scopedRouter[property];
|
|
175
|
-
}
|
|
176
|
-
// Events is a static property on the router, the router doesn't have to be initialized to use it
|
|
177
|
-
instance.events = _router.default.events;
|
|
178
|
-
coreMethodFields.forEach((field)=>{
|
|
179
|
-
instance[field] = (...args)=>{
|
|
180
|
-
return scopedRouter[field](...args);
|
|
181
|
-
};
|
|
182
|
-
});
|
|
183
|
-
return instance;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
187
|
-
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
188
|
-
Object.assign(exports.default, exports);
|
|
189
|
-
module.exports = exports.default;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
} (router, router.exports));
|
|
194
|
-
return router.exports;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export { requireRouter as __require };
|
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
|
|
5
|
-
const script = require('../../../../_virtual/script.cjs');
|
|
6
|
-
const _interop_require_default = require('../../../@swc/helpers/cjs/_interop_require_default.cjs');
|
|
7
|
-
const _interop_require_wildcard = require('../../../@swc/helpers/cjs/_interop_require_wildcard.cjs');
|
|
8
|
-
const require$$2 = require('react/jsx-runtime');
|
|
9
|
-
const require$$3 = require('react-dom');
|
|
10
|
-
const React = require('react');
|
|
11
|
-
const headManagerContext_sharedRuntime = require('../shared/lib/head-manager-context.shared-runtime.cjs');
|
|
12
|
-
const setAttributesFromProps = require('./set-attributes-from-props.cjs');
|
|
13
|
-
const requestIdleCallback = require('./request-idle-callback.cjs');
|
|
14
|
-
|
|
15
|
-
var hasRequiredScript;
|
|
16
|
-
|
|
17
|
-
function requireScript () {
|
|
18
|
-
if (hasRequiredScript) return script.__module.exports;
|
|
19
|
-
hasRequiredScript = 1;
|
|
20
|
-
(function (module, exports) {
|
|
21
|
-
'use client';
|
|
22
|
-
Object.defineProperty(exports, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
});
|
|
25
|
-
function _export(target, all) {
|
|
26
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: all[name]
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
_export(exports, {
|
|
32
|
-
default: function() {
|
|
33
|
-
return _default;
|
|
34
|
-
},
|
|
35
|
-
handleClientScriptLoad: function() {
|
|
36
|
-
return handleClientScriptLoad;
|
|
37
|
-
},
|
|
38
|
-
initScriptLoader: function() {
|
|
39
|
-
return initScriptLoader;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const _interop_require_default$1 = /*@__PURE__*/ _interop_require_default.__require();
|
|
43
|
-
const _interop_require_wildcard$1 = /*@__PURE__*/ _interop_require_wildcard.__require();
|
|
44
|
-
const _jsxruntime = require$$2;
|
|
45
|
-
const _reactdom = /*#__PURE__*/ _interop_require_default$1._(require$$3);
|
|
46
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard$1._(React);
|
|
47
|
-
const _headmanagercontextsharedruntime = headManagerContext_sharedRuntime.__require();
|
|
48
|
-
const _setattributesfromprops = setAttributesFromProps.__require();
|
|
49
|
-
const _requestidlecallback = requestIdleCallback.__require();
|
|
50
|
-
const ScriptCache = new Map();
|
|
51
|
-
const LoadCache = new Set();
|
|
52
|
-
const insertStylesheets = (stylesheets)=>{
|
|
53
|
-
// Case 1: Styles for afterInteractive/lazyOnload with appDir injected via handleClientScriptLoad
|
|
54
|
-
//
|
|
55
|
-
// Using ReactDOM.preinit to feature detect appDir and inject styles
|
|
56
|
-
// Stylesheets might have already been loaded if initialized with Script component
|
|
57
|
-
// Re-inject styles here to handle scripts loaded via handleClientScriptLoad
|
|
58
|
-
// ReactDOM.preinit handles dedup and ensures the styles are loaded only once
|
|
59
|
-
if (_reactdom.default.preinit) {
|
|
60
|
-
stylesheets.forEach((stylesheet)=>{
|
|
61
|
-
_reactdom.default.preinit(stylesheet, {
|
|
62
|
-
as: 'style'
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
// Case 2: Styles for afterInteractive/lazyOnload with pages injected via handleClientScriptLoad
|
|
68
|
-
//
|
|
69
|
-
// We use this function to load styles when appdir is not detected
|
|
70
|
-
// TODO: Use React float APIs to load styles once available for pages dir
|
|
71
|
-
if (typeof window !== 'undefined') {
|
|
72
|
-
let head = document.head;
|
|
73
|
-
stylesheets.forEach((stylesheet)=>{
|
|
74
|
-
let link = document.createElement('link');
|
|
75
|
-
link.type = 'text/css';
|
|
76
|
-
link.rel = 'stylesheet';
|
|
77
|
-
link.href = stylesheet;
|
|
78
|
-
head.appendChild(link);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const loadScript = (props)=>{
|
|
83
|
-
const { src, id, onLoad = ()=>{}, onReady = null, dangerouslySetInnerHTML, children = '', strategy = 'afterInteractive', onError, stylesheets } = props;
|
|
84
|
-
const cacheKey = id || src;
|
|
85
|
-
// Script has already loaded
|
|
86
|
-
if (cacheKey && LoadCache.has(cacheKey)) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
// Contents of this script are already loading/loaded
|
|
90
|
-
if (ScriptCache.has(src)) {
|
|
91
|
-
LoadCache.add(cacheKey);
|
|
92
|
-
// It is possible that multiple `next/script` components all have same "src", but has different "onLoad"
|
|
93
|
-
// This is to make sure the same remote script will only load once, but "onLoad" are executed in order
|
|
94
|
-
ScriptCache.get(src).then(onLoad, onError);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
/** Execute after the script first loaded */ const afterLoad = ()=>{
|
|
98
|
-
// Run onReady for the first time after load event
|
|
99
|
-
if (onReady) {
|
|
100
|
-
onReady();
|
|
101
|
-
}
|
|
102
|
-
// add cacheKey to LoadCache when load successfully
|
|
103
|
-
LoadCache.add(cacheKey);
|
|
104
|
-
};
|
|
105
|
-
const el = document.createElement('script');
|
|
106
|
-
const loadPromise = new Promise((resolve, reject)=>{
|
|
107
|
-
el.addEventListener('load', function(e) {
|
|
108
|
-
resolve();
|
|
109
|
-
if (onLoad) {
|
|
110
|
-
onLoad.call(this, e);
|
|
111
|
-
}
|
|
112
|
-
afterLoad();
|
|
113
|
-
});
|
|
114
|
-
el.addEventListener('error', function(e) {
|
|
115
|
-
reject(e);
|
|
116
|
-
});
|
|
117
|
-
}).catch(function(e) {
|
|
118
|
-
if (onError) {
|
|
119
|
-
onError(e);
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
if (dangerouslySetInnerHTML) {
|
|
123
|
-
// Casting since lib.dom.d.ts doesn't have TrustedHTML yet.
|
|
124
|
-
el.innerHTML = dangerouslySetInnerHTML.__html || '';
|
|
125
|
-
afterLoad();
|
|
126
|
-
} else if (children) {
|
|
127
|
-
el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : '';
|
|
128
|
-
afterLoad();
|
|
129
|
-
} else if (src) {
|
|
130
|
-
el.src = src;
|
|
131
|
-
// do not add cacheKey into LoadCache for remote script here
|
|
132
|
-
// cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)
|
|
133
|
-
ScriptCache.set(src, loadPromise);
|
|
134
|
-
}
|
|
135
|
-
(0, _setattributesfromprops.setAttributesFromProps)(el, props);
|
|
136
|
-
if (strategy === 'worker') {
|
|
137
|
-
el.setAttribute('type', 'text/partytown');
|
|
138
|
-
}
|
|
139
|
-
el.setAttribute('data-nscript', strategy);
|
|
140
|
-
// Load styles associated with this script
|
|
141
|
-
if (stylesheets) {
|
|
142
|
-
insertStylesheets(stylesheets);
|
|
143
|
-
}
|
|
144
|
-
document.body.appendChild(el);
|
|
145
|
-
};
|
|
146
|
-
function handleClientScriptLoad(props) {
|
|
147
|
-
const { strategy = 'afterInteractive' } = props;
|
|
148
|
-
if (strategy === 'lazyOnload') {
|
|
149
|
-
window.addEventListener('load', ()=>{
|
|
150
|
-
(0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));
|
|
151
|
-
});
|
|
152
|
-
} else {
|
|
153
|
-
loadScript(props);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function loadLazyScript(props) {
|
|
157
|
-
if (document.readyState === 'complete') {
|
|
158
|
-
(0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));
|
|
159
|
-
} else {
|
|
160
|
-
window.addEventListener('load', ()=>{
|
|
161
|
-
(0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props));
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
function addBeforeInteractiveToCache() {
|
|
166
|
-
const scripts = [
|
|
167
|
-
...document.querySelectorAll('[data-nscript="beforeInteractive"]'),
|
|
168
|
-
...document.querySelectorAll('[data-nscript="beforePageRender"]')
|
|
169
|
-
];
|
|
170
|
-
scripts.forEach((script)=>{
|
|
171
|
-
const cacheKey = script.id || script.getAttribute('src');
|
|
172
|
-
LoadCache.add(cacheKey);
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
function initScriptLoader(scriptLoaderItems) {
|
|
176
|
-
scriptLoaderItems.forEach(handleClientScriptLoad);
|
|
177
|
-
addBeforeInteractiveToCache();
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Load a third-party scripts in an optimized way.
|
|
181
|
-
*
|
|
182
|
-
* Read more: [Next.js Docs: `next/script`](https://nextjs.org/docs/app/api-reference/components/script)
|
|
183
|
-
*/ function Script(props) {
|
|
184
|
-
const { id, src = '', onLoad = ()=>{}, onReady = null, strategy = 'afterInteractive', onError, stylesheets, ...restProps } = props;
|
|
185
|
-
// Context is available only during SSR
|
|
186
|
-
let { updateScripts, scripts, getIsSsr, appDir, nonce } = (0, _react.useContext)(_headmanagercontextsharedruntime.HeadManagerContext);
|
|
187
|
-
// if a nonce is explicitly passed to the script tag, favor that over the automatic handling
|
|
188
|
-
nonce = restProps.nonce || nonce;
|
|
189
|
-
/**
|
|
190
|
-
* - First mount:
|
|
191
|
-
* 1. The useEffect for onReady executes
|
|
192
|
-
* 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)
|
|
193
|
-
* onReady is skipped, set hasOnReadyEffectCalled.current to true
|
|
194
|
-
* 3. The useEffect for loadScript executes
|
|
195
|
-
* 4. hasLoadScriptEffectCalled.current is false, loadScript executes
|
|
196
|
-
* Once the script is loaded, the onLoad and onReady will be called by then
|
|
197
|
-
* [If strict mode is enabled / is wrapped in <OffScreen /> component]
|
|
198
|
-
* 5. The useEffect for onReady executes again
|
|
199
|
-
* 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
|
|
200
|
-
* 7. The useEffect for loadScript executes again
|
|
201
|
-
* 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
|
|
202
|
-
*
|
|
203
|
-
* - Second mount:
|
|
204
|
-
* 1. The useEffect for onReady executes
|
|
205
|
-
* 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)
|
|
206
|
-
* onReady is called, set hasOnReadyEffectCalled.current to true
|
|
207
|
-
* 3. The useEffect for loadScript executes
|
|
208
|
-
* 4. The script is already loaded, loadScript bails out
|
|
209
|
-
* [If strict mode is enabled / is wrapped in <OffScreen /> component]
|
|
210
|
-
* 5. The useEffect for onReady executes again
|
|
211
|
-
* 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
|
|
212
|
-
* 7. The useEffect for loadScript executes again
|
|
213
|
-
* 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
|
|
214
|
-
*/ const hasOnReadyEffectCalled = (0, _react.useRef)(false);
|
|
215
|
-
(0, _react.useEffect)(()=>{
|
|
216
|
-
const cacheKey = id || src;
|
|
217
|
-
if (!hasOnReadyEffectCalled.current) {
|
|
218
|
-
// Run onReady if script has loaded before but component is re-mounted
|
|
219
|
-
if (onReady && cacheKey && LoadCache.has(cacheKey)) {
|
|
220
|
-
onReady();
|
|
221
|
-
}
|
|
222
|
-
hasOnReadyEffectCalled.current = true;
|
|
223
|
-
}
|
|
224
|
-
}, [
|
|
225
|
-
onReady,
|
|
226
|
-
id,
|
|
227
|
-
src
|
|
228
|
-
]);
|
|
229
|
-
const hasLoadScriptEffectCalled = (0, _react.useRef)(false);
|
|
230
|
-
(0, _react.useEffect)(()=>{
|
|
231
|
-
if (!hasLoadScriptEffectCalled.current) {
|
|
232
|
-
if (strategy === 'afterInteractive') {
|
|
233
|
-
loadScript(props);
|
|
234
|
-
} else if (strategy === 'lazyOnload') {
|
|
235
|
-
loadLazyScript(props);
|
|
236
|
-
}
|
|
237
|
-
hasLoadScriptEffectCalled.current = true;
|
|
238
|
-
}
|
|
239
|
-
}, [
|
|
240
|
-
props,
|
|
241
|
-
strategy
|
|
242
|
-
]);
|
|
243
|
-
if (strategy === 'beforeInteractive' || strategy === 'worker') {
|
|
244
|
-
if (updateScripts) {
|
|
245
|
-
scripts[strategy] = (scripts[strategy] || []).concat([
|
|
246
|
-
{
|
|
247
|
-
id,
|
|
248
|
-
src,
|
|
249
|
-
onLoad,
|
|
250
|
-
onReady,
|
|
251
|
-
onError,
|
|
252
|
-
...restProps,
|
|
253
|
-
nonce
|
|
254
|
-
}
|
|
255
|
-
]);
|
|
256
|
-
updateScripts(scripts);
|
|
257
|
-
} else if (getIsSsr && getIsSsr()) {
|
|
258
|
-
// Script has already loaded during SSR
|
|
259
|
-
LoadCache.add(id || src);
|
|
260
|
-
} else if (getIsSsr && !getIsSsr()) {
|
|
261
|
-
loadScript({
|
|
262
|
-
...props,
|
|
263
|
-
nonce
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
// For the app directory, we need React Float to preload these scripts.
|
|
268
|
-
if (appDir) {
|
|
269
|
-
// Injecting stylesheets here handles beforeInteractive and worker scripts correctly
|
|
270
|
-
// For other strategies injecting here ensures correct stylesheet order
|
|
271
|
-
// ReactDOM.preinit handles loading the styles in the correct order,
|
|
272
|
-
// also ensures the stylesheet is loaded only once and in a consistent manner
|
|
273
|
-
//
|
|
274
|
-
// Case 1: Styles for beforeInteractive/worker with appDir - handled here
|
|
275
|
-
// Case 2: Styles for beforeInteractive/worker with pages dir - Not handled yet
|
|
276
|
-
// Case 3: Styles for afterInteractive/lazyOnload with appDir - handled here
|
|
277
|
-
// Case 4: Styles for afterInteractive/lazyOnload with pages dir - handled in insertStylesheets function
|
|
278
|
-
if (stylesheets) {
|
|
279
|
-
stylesheets.forEach((styleSrc)=>{
|
|
280
|
-
_reactdom.default.preinit(styleSrc, {
|
|
281
|
-
as: 'style'
|
|
282
|
-
});
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
// Before interactive scripts need to be loaded by Next.js' runtime instead
|
|
286
|
-
// of native <script> tags, because they no longer have `defer`.
|
|
287
|
-
if (strategy === 'beforeInteractive') {
|
|
288
|
-
if (!src) {
|
|
289
|
-
// For inlined scripts, we put the content in `children`.
|
|
290
|
-
if (restProps.dangerouslySetInnerHTML) {
|
|
291
|
-
// Casting since lib.dom.d.ts doesn't have TrustedHTML yet.
|
|
292
|
-
restProps.children = restProps.dangerouslySetInnerHTML.__html;
|
|
293
|
-
delete restProps.dangerouslySetInnerHTML;
|
|
294
|
-
}
|
|
295
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
296
|
-
nonce: nonce,
|
|
297
|
-
dangerouslySetInnerHTML: {
|
|
298
|
-
__html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([
|
|
299
|
-
0,
|
|
300
|
-
{
|
|
301
|
-
...restProps,
|
|
302
|
-
id
|
|
303
|
-
}
|
|
304
|
-
])})`
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
} else {
|
|
308
|
-
// @ts-ignore
|
|
309
|
-
_reactdom.default.preload(src, restProps.integrity ? {
|
|
310
|
-
as: 'script',
|
|
311
|
-
integrity: restProps.integrity,
|
|
312
|
-
nonce,
|
|
313
|
-
crossOrigin: restProps.crossOrigin
|
|
314
|
-
} : {
|
|
315
|
-
as: 'script',
|
|
316
|
-
nonce,
|
|
317
|
-
crossOrigin: restProps.crossOrigin
|
|
318
|
-
});
|
|
319
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
320
|
-
nonce: nonce,
|
|
321
|
-
dangerouslySetInnerHTML: {
|
|
322
|
-
__html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([
|
|
323
|
-
src,
|
|
324
|
-
{
|
|
325
|
-
...restProps,
|
|
326
|
-
id
|
|
327
|
-
}
|
|
328
|
-
])})`
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
} else if (strategy === 'afterInteractive') {
|
|
333
|
-
if (src) {
|
|
334
|
-
// @ts-ignore
|
|
335
|
-
_reactdom.default.preload(src, restProps.integrity ? {
|
|
336
|
-
as: 'script',
|
|
337
|
-
integrity: restProps.integrity,
|
|
338
|
-
nonce,
|
|
339
|
-
crossOrigin: restProps.crossOrigin
|
|
340
|
-
} : {
|
|
341
|
-
as: 'script',
|
|
342
|
-
nonce,
|
|
343
|
-
crossOrigin: restProps.crossOrigin
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
return null;
|
|
349
|
-
}
|
|
350
|
-
Object.defineProperty(Script, '__nextScript', {
|
|
351
|
-
value: true
|
|
352
|
-
});
|
|
353
|
-
const _default = Script;
|
|
354
|
-
|
|
355
|
-
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
356
|
-
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
357
|
-
Object.assign(exports.default, exports);
|
|
358
|
-
module.exports = exports.default;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
} (script.__module, script.__module.exports));
|
|
363
|
-
return script.__module.exports;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
exports.__require = requireScript;
|