@equinor/amplify-component-lib 9.1.2 → 9.3.0
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/atoms/hooks/index.d.ts +1 -2
- package/dist/atoms/icons/drilling.d.ts +1 -0
- package/dist/atoms/icons/drilling.js +1 -1
- package/dist/atoms/index.js +1 -1
- package/dist/atoms/utils/date.d.ts +12 -3
- package/dist/atoms/utils/date.js +1 -1
- package/dist/atoms/utils/index.d.ts +1 -0
- package/dist/atoms/utils/richtext.js +1 -1
- package/dist/atoms/utils/tutorials.d.ts +10 -0
- package/dist/atoms/utils/tutorials.js +1 -0
- package/dist/index.js +1 -1
- package/dist/molecules/DatePicker/DatePicker.js +1 -1
- package/dist/molecules/FileProgress/CompactFileProgress.d.ts +2 -4
- package/dist/molecules/FileProgress/CompactFileProgress.js +1 -1
- package/dist/molecules/FileProgress/CompactFileProgress.styles.d.ts +2 -0
- package/dist/molecules/FileProgress/FileProgress.d.ts +15 -25
- package/dist/molecules/FileProgress/FileProgress.types.d.ts +41 -0
- package/dist/molecules/FileProgress/RegularFileProgress.d.ts +2 -4
- package/dist/molecules/FileProgress/RegularFileProgress.js +1 -1
- package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +1 -0
- package/dist/molecules/RichTextEditor/index.js +1 -1
- package/dist/molecules/Select/GroupedSelectMenu.js +1 -1
- package/dist/molecules/Select/ListSelectMenu.js +1 -1
- package/dist/molecules/Select/Select.js +1 -1
- package/dist/molecules/Select/Select.types.d.ts +5 -8
- package/dist/molecules/Select/SelectMenuItem.js +1 -1
- package/dist/molecules/Select/SingleSelect/SingleSelect.js +1 -1
- package/dist/molecules/index.d.ts +2 -1
- package/dist/node_modules/@equinor/eds-tokens/dist/esm/base/index.js +1 -1
- package/dist/node_modules/@equinor/eds-tokens/dist/esm/base/spacings.js +1 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +1 -1
- package/dist/organisms/FieldSelector/ChangingField.js +4 -4
- package/dist/organisms/Filter/Filter.styles.js +1 -1
- package/dist/organisms/Filter/QuickFilter.js +1 -1
- package/dist/organisms/Filter/Sorting.js +2 -2
- package/dist/organisms/PageTitle/PageTitle.d.ts +7 -0
- package/dist/organisms/PageTitle/PageTitle.js +1 -0
- package/dist/organisms/SideBar/CreateItem.styles.js +1 -0
- package/dist/organisms/SideBar/MenuItem.styles.js +1 -0
- package/dist/organisms/SideBar/SideBar.styles.js +2 -0
- package/dist/organisms/Status/Illustration.js +2 -2
- package/dist/organisms/Status/collections/MissingAccessToApp.js +1 -1
- package/dist/organisms/TableOfContents/TableOfContents.constants.js +1 -1
- package/dist/organisms/TopBar/Account/Account.js +1 -1
- package/dist/organisms/TopBar/Account/AccountAvatar.js +3 -3
- package/dist/organisms/TopBar/Account/AccountButton.js +3 -3
- package/dist/organisms/TopBar/Account/ActiveUserImpersonationButton.js +4 -4
- package/dist/organisms/TopBar/Account/ImpersonateAvatar.js +2 -2
- package/dist/organisms/TopBar/Account/ImpersonateButton.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/DeleteUser/DeleteUser.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/DeleteUser/DeleteUser.styles.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/Impersonate.styles.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/Impersonate.utils.d.ts +2 -0
- package/dist/organisms/TopBar/Account/ImpersonateMenu/Impersonate.utils.js +1 -0
- package/dist/organisms/TopBar/Account/ImpersonateMenu/ImpersonateMenu.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/UserImpersonation.js +6 -6
- package/dist/organisms/TopBar/Account/ImpersonateMenu/hooks/useStartImpersonation.js +1 -1
- package/dist/organisms/TopBar/Notifications/NotificationProvider.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/UploadFile/UploadFile.styles.d.ts +2 -0
- package/dist/organisms/TopBar/Resources/Feedback/providers/FeedbackContextProvider.js +1 -1
- package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotes.js +1 -1
- package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleasePosts/ReleasePost/ReleasePost.js +1 -1
- package/dist/organisms/TopBar/Resources/Resources.d.ts +0 -3
- package/dist/organisms/TopBar/Resources/Resources.js +5 -5
- package/dist/organisms/TopBar/TransferToAppDialog.js +3 -3
- package/dist/organisms/TopBar/Tutorials/TutorialItem.d.ts +8 -0
- package/dist/organisms/TopBar/Tutorials/TutorialItem.js +21 -0
- package/dist/organisms/TopBar/Tutorials/Tutorials.d.ts +6 -0
- package/dist/organisms/TopBar/Tutorials/Tutorials.js +1 -0
- package/dist/organisms/TopBar/Tutorials/Tutorials.styles.d.ts +2 -0
- package/dist/organisms/TopBar/Tutorials/Tutorials.styles.js +18 -0
- package/dist/organisms/TopBar/index.d.ts +2 -0
- package/dist/organisms/TopBar/index.js +1 -1
- package/dist/organisms/index.d.ts +1 -0
- package/dist/providers/AuthProvider/AuthProvider.js +1 -1
- package/dist/providers/ReleaseNotesProvider.utils.js +1 -1
- package/dist/providers/SnackbarProvider/APIErrorSnackbar.d.ts +6 -0
- package/dist/providers/SnackbarProvider/APIErrorSnackbar.js +1 -0
- package/dist/providers/SnackbarProvider/SnackbarProvider.d.ts +5 -0
- package/dist/providers/SnackbarProvider/SnackbarProvider.js +1 -1
- package/dist/providers/StepperProvider.d.ts +13 -2
- package/dist/providers/StepperProvider.js +1 -1
- package/dist/providers/TableOfContentsProvider.js +1 -1
- package/dist/providers/ThemeProvider/ThemeProvider.js +1 -1
- package/dist/providers/TutorialHighlightingProvider/TutorialHighlightingProvider.constants.d.ts +2 -0
- package/dist/providers/TutorialHighlightingProvider/TutorialHighlightingProvider.constants.js +1 -0
- package/dist/providers/TutorialHighlightingProvider/TutorialHighlightingProvider.d.ts +11 -0
- package/dist/providers/TutorialHighlightingProvider/TutorialHighlightingProvider.js +1 -0
- package/dist/providers/TutorialHighlightingProvider/TutorialHighlightingProviderInner.d.ts +6 -0
- package/dist/providers/TutorialHighlightingProvider/TutorialHighlightingProviderInner.js +24 -0
- package/dist/providers/TutorialHighlightingProvider/TutorialPopover/StepIndicator.d.ts +6 -0
- package/dist/providers/TutorialHighlightingProvider/TutorialPopover/StepIndicator.js +20 -0
- package/dist/providers/TutorialHighlightingProvider/TutorialPopover/TutorialPopover.d.ts +11 -0
- package/dist/providers/TutorialHighlightingProvider/TutorialPopover/TutorialPopover.js +45 -0
- package/dist/providers/TutorialHighlightingProvider/hooks/useReversedScrollY.d.ts +1 -0
- package/dist/providers/TutorialHighlightingProvider/hooks/useReversedScrollY.js +1 -0
- package/dist/providers/index.d.ts +1 -1
- package/dist/tests/mockHandlers.d.ts +5 -1
- package/package.json +69 -69
- package/dist/node_modules/@equinor/eds-tokens/dist/esm/base/clickbounds.js +0 -1
- package/dist/node_modules/@equinor/eds-tokens/dist/esm/base/interactions.js +0 -1
- package/dist/organisms/TopBar/Resources/Tutorials/TutorialInfoDialog.d.ts +0 -15
- package/dist/organisms/TopBar/Resources/Tutorials/TutorialInfoDialog.js +0 -15
- package/dist/organisms/TopBar/Resources/Tutorials/TutorialItem.d.ts +0 -3
- package/dist/organisms/TopBar/Resources/Tutorials/TutorialItem.js +0 -12
- package/dist/providers/TutorialStepsProvider.d.ts +0 -23
- package/dist/providers/TutorialStepsProvider.js +0 -1
|
@@ -14,5 +14,4 @@ import { useSnackbar } from '../../providers/SnackbarProvider/SnackbarProvider';
|
|
|
14
14
|
import { useStepper } from '../../providers/StepperProvider';
|
|
15
15
|
import { useTableOfContents } from '../../providers/TableOfContentsProvider';
|
|
16
16
|
import { useThemeProvider } from '../../providers/ThemeProvider/ThemeProvider';
|
|
17
|
-
|
|
18
|
-
export { useAuth, useStepper, useSelect, useDebounce, useFakeProgress, useLocalStorage, useNotification, useOnScreenMultiple, useTableOfContents, usePrevious, useReleaseNotes, useSideBar, useSignalRMessages, useSnackbar, useTutorialSteps, useThemeProvider, useAmplifyKit, };
|
|
17
|
+
export { useAuth, useStepper, useSelect, useDebounce, useFakeProgress, useLocalStorage, useNotification, useOnScreenMultiple, useTableOfContents, usePrevious, useReleaseNotes, useSideBar, useSignalRMessages, useSnackbar, useThemeProvider, useAmplifyKit, };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IconData } from '@equinor/eds-icons';
|
|
2
2
|
export declare const amplify_wellbore: IconData;
|
|
3
|
+
export declare const amplify_wireline: IconData;
|
|
3
4
|
export declare const amplify_wireline_open_hole: IconData;
|
|
4
5
|
export declare const amplify_wireline_cased_hole: IconData;
|
|
5
6
|
export declare const amplify_lwd: IconData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const L={name:"wellbore",prefix:"amplify",height:"42",width:"42",svgPathData:"M5.43945 4.03906H36.5719V19.9348C36.5719 20.8749 35.8098 21.637 34.8697 21.637C33.9296 21.637 33.1675 20.8749 33.1675 19.9348V7.44345H29.6153L29.6153 25.1655H26.2786V36.716C26.2786 37.6561 25.5165 38.4182 24.5764 38.4182C23.6363 38.4182 22.8742 37.6561 22.8742 36.716V21.7611H26.2109V7.44345H15.7908L15.7908 21.7611H19.1274V36.716C19.1274 37.6561 18.3653 38.4182 17.4252 38.4182C16.4852 38.4182 15.7231 37.6561 15.7231 36.716V25.1655H12.3864L12.3864 7.44345H8.84384V19.9348C8.84384 20.8749 8.08174 21.637 7.14165 21.637C6.20155 21.637 5.43945 20.8749 5.43945 19.9348V4.03906Z"},V={name:"wireline_open_hole",prefix:"amplify",height:"24",width:"24",svgPathData:"M5.51325 4.13135V6.51157L7.02186 8.91188L7.34357 9.42376L7.03979 9.94648L5.82346 12.0394L7.03239 14.0516L7.41798 14.6934L6.91072 15.2441L5.51325 16.7613V18.8685V19.8685H3.51325V18.8685V16.3709V15.9805L3.77773 15.6934L4.93241 14.4398L3.80474 12.5629L3.50041 12.0563L3.79734 11.5454L5.00681 9.46427L3.66659 7.33186L3.51325 7.08788V6.79973V4.13135H5.51325ZM12.7393 4.13135H11.2598V8.24681L11.1224 8.37123L10.3456 9.04913C10.2766 9.10935 10.2371 9.19655 10.2374 9.28814L10.2452 11.9135L10.2373 15.1397C10.2371 15.2312 10.2766 15.3184 10.3455 15.3785L11.1224 16.0565L11.7875 16.6589C11.9079 16.768 12.0914 16.768 12.2118 16.6589L12.8769 16.0565L13.6538 15.3785C13.7227 15.3184 13.7622 15.2312 13.762 15.1397L13.7542 11.9135L13.7619 9.28814C13.7622 9.19655 13.7227 9.10935 13.6537 9.04913L12.8769 8.37123L12.7393 8.24656V4.13135ZM18.4868 6.51157V4.13135H20.4868V6.79973V7.08788L20.3334 7.33186L18.9932 9.46427L20.2027 11.5454L20.4996 12.0563L20.1953 12.5629L19.0676 14.4398L20.2223 15.6934L20.4868 15.9805V16.3709V18.8685V19.8685H18.4868V18.8685V16.7613L17.0893 15.2441L16.582 14.6934L16.9676 14.0516L18.1766 12.0394L16.9602 9.94648L16.6564 9.42376L16.9782 8.91188L18.4868 6.51157Z"},C={name:"wireline_cased_hole",prefix:"amplify",height:"24",width:"24",svgPathData:"M6.97852 4.51562V18.8799C6.97852 19.7083 7.65009 20.3799 8.47852 20.3799H15.5234C16.3519 20.3799 17.0234 19.7083 17.0234 18.8799V4.51562H15.0234V18.3799H8.97852V4.51562H6.97852Z M5.5 4.51562V19.1718C5.5 19.7241 5.05228 20.1718 4.5 20.1718C3.94772 20.1718 3.5 19.7241 3.5 19.1718V4.51562H5.5Z M20.5 4.51562V19.3789C20.5 19.9311 20.0523 20.3789 19.5 20.3789L19.5 20.3789C18.9477 20.3789 18.5 19.9311 18.5 19.3789V4.51562H20.5Z M12.7406 4.51562H11.2611V8.63109L11.1237 8.75551L10.3469 9.4334C10.2779 9.49363 10.2384 9.58083 10.2387 9.67242L10.2465 12.2978L10.2386 15.524C10.2384 15.6155 10.2779 15.7026 10.3469 15.7628L11.1237 16.4408L11.7889 17.0432C11.9092 17.1523 12.0927 17.1523 12.2131 17.0432L12.8782 16.4408L13.6551 15.7628C13.7241 15.7026 13.7635 15.6155 13.7633 15.524L13.7555 12.2978L13.7632 9.67242C13.7635 9.58083 13.724 9.49363 13.655 9.4334L12.8782 8.75551L12.7406 8.63084V4.51562Z"},
|
|
1
|
+
const L={name:"wellbore",prefix:"amplify",height:"42",width:"42",svgPathData:"M5.43945 4.03906H36.5719V19.9348C36.5719 20.8749 35.8098 21.637 34.8697 21.637C33.9296 21.637 33.1675 20.8749 33.1675 19.9348V7.44345H29.6153L29.6153 25.1655H26.2786V36.716C26.2786 37.6561 25.5165 38.4182 24.5764 38.4182C23.6363 38.4182 22.8742 37.6561 22.8742 36.716V21.7611H26.2109V7.44345H15.7908L15.7908 21.7611H19.1274V36.716C19.1274 37.6561 18.3653 38.4182 17.4252 38.4182C16.4852 38.4182 15.7231 37.6561 15.7231 36.716V25.1655H12.3864L12.3864 7.44345H8.84384V19.9348C8.84384 20.8749 8.08174 21.637 7.14165 21.637C6.20155 21.637 5.43945 20.8749 5.43945 19.9348V4.03906Z"},V={name:"wireline",prefix:"amplify",height:"24",width:"24",svgPathData:'M15.9253 2H10.0753V2.9H8.12531V4.7L9.10031 4.7V6.4174L6.50033 17H5.41699V19H10.8566V17L8.66699 17L9.2719 14.5022L12.4587 11.5606V22H13.542V11.5606L16.7287 14.5022L17.3337 17H15.144V19H20.5837V17H19.5003L16.9003 6.41741V4.7L17.8753 4.7V2.9H15.9253V2ZM13.7664 10.3535L16.2876 12.6808L15.6913 10.2186L15.415 8.83173L13.7664 10.3535ZM15.1769 7.63724L13.542 9.14641V4.7H14.9503V6.5L15.1769 7.63724ZM12.2343 10.3535L9.713 12.6809L10.2948 10.2784L10.5468 9.0269L10.5857 8.83171L12.2343 10.3535ZM12.4587 9.14641L10.8237 7.63721L10.8566 7.47219L11.0503 6.5V4.7H12.4587V9.14641Z" fill="#007079'},H={name:"wireline_open_hole",prefix:"amplify",height:"24",width:"24",svgPathData:"M5.51325 4.13135V6.51157L7.02186 8.91188L7.34357 9.42376L7.03979 9.94648L5.82346 12.0394L7.03239 14.0516L7.41798 14.6934L6.91072 15.2441L5.51325 16.7613V18.8685V19.8685H3.51325V18.8685V16.3709V15.9805L3.77773 15.6934L4.93241 14.4398L3.80474 12.5629L3.50041 12.0563L3.79734 11.5454L5.00681 9.46427L3.66659 7.33186L3.51325 7.08788V6.79973V4.13135H5.51325ZM12.7393 4.13135H11.2598V8.24681L11.1224 8.37123L10.3456 9.04913C10.2766 9.10935 10.2371 9.19655 10.2374 9.28814L10.2452 11.9135L10.2373 15.1397C10.2371 15.2312 10.2766 15.3184 10.3455 15.3785L11.1224 16.0565L11.7875 16.6589C11.9079 16.768 12.0914 16.768 12.2118 16.6589L12.8769 16.0565L13.6538 15.3785C13.7227 15.3184 13.7622 15.2312 13.762 15.1397L13.7542 11.9135L13.7619 9.28814C13.7622 9.19655 13.7227 9.10935 13.6537 9.04913L12.8769 8.37123L12.7393 8.24656V4.13135ZM18.4868 6.51157V4.13135H20.4868V6.79973V7.08788L20.3334 7.33186L18.9932 9.46427L20.2027 11.5454L20.4996 12.0563L20.1953 12.5629L19.0676 14.4398L20.2223 15.6934L20.4868 15.9805V16.3709V18.8685V19.8685H18.4868V18.8685V16.7613L17.0893 15.2441L16.582 14.6934L16.9676 14.0516L18.1766 12.0394L16.9602 9.94648L16.6564 9.42376L16.9782 8.91188L18.4868 6.51157Z"},C={name:"wireline_cased_hole",prefix:"amplify",height:"24",width:"24",svgPathData:"M6.97852 4.51562V18.8799C6.97852 19.7083 7.65009 20.3799 8.47852 20.3799H15.5234C16.3519 20.3799 17.0234 19.7083 17.0234 18.8799V4.51562H15.0234V18.3799H8.97852V4.51562H6.97852Z M5.5 4.51562V19.1718C5.5 19.7241 5.05228 20.1718 4.5 20.1718C3.94772 20.1718 3.5 19.7241 3.5 19.1718V4.51562H5.5Z M20.5 4.51562V19.3789C20.5 19.9311 20.0523 20.3789 19.5 20.3789L19.5 20.3789C18.9477 20.3789 18.5 19.9311 18.5 19.3789V4.51562H20.5Z M12.7406 4.51562H11.2611V8.63109L11.1237 8.75551L10.3469 9.4334C10.2779 9.49363 10.2384 9.58083 10.2387 9.67242L10.2465 12.2978L10.2386 15.524C10.2384 15.6155 10.2779 15.7026 10.3469 15.7628L11.1237 16.4408L11.7889 17.0432C11.9092 17.1523 12.0927 17.1523 12.2131 17.0432L12.8782 16.4408L13.6551 15.7628C13.7241 15.7026 13.7635 15.6155 13.7633 15.524L13.7555 12.2978L13.7632 9.67242C13.7635 9.58083 13.724 9.49363 13.655 9.4334L12.8782 8.75551L12.7406 8.63084V4.51562Z"},a={name:"lwd",prefix:"amplify",height:"24",width:"24",svgPathData:"M11.1543 6.53806V4.14014H9.70985V14.0316L11.5709 15.8199C11.8504 16.0884 12.2908 16.0926 12.5754 15.8295L14.5039 14.0459V13.7301H13.7817L14.5039 13.729V4.14014H13.0595V7.93155L11.1543 6.53806ZM11.1543 7.44841V9.18162L13.0595 10.5751V8.8419L11.1543 7.44841ZM13.0595 11.4855L11.1543 10.092V13.4163L12.0875 14.3131L13.0595 13.4143V11.4855ZM8.42558 4.15088H3.50717V6.15088H6.42548L6.42504 15.5138L10.8021 19.4223C11.4379 19.99 12.3932 20.0073 13.0491 19.463L17.7738 15.542L17.7739 6.15119H20.4928V4.15119H15.774L15.7738 14.6027L11.9559 17.7712L8.42508 14.6184L8.42558 4.15088Z"},e={name:"success",prefix:"amplify",height:"24",width:"24",svgPathData:"M13 2H11V6.08296C10.0884 6.2359 9.24647 6.59441 8.52355 7.10919L5.41421 3.99985L4 5.41406L7.10931 8.52338C6.59447 9.24633 6.23591 10.0883 6.08296 11H2V13H6.08296C6.23382 13.8992 6.58469 14.7306 7.08827 15.4469L3.99962 18.5355L5.41384 19.9497L8.49397 16.8696C9.22346 17.3958 10.0759 17.762 11 17.917V22H13V17.917C13.9117 17.7641 14.7537 17.4055 15.4766 16.8907L18.5355 19.9496L19.9497 18.5354L16.8908 15.4764C17.4056 14.7535 17.7641 13.9116 17.917 13H22V11H17.917C17.762 10.0759 17.3958 9.22346 16.8696 8.49397L19.9494 5.41421L18.5352 4L15.4469 7.08827C14.7306 6.58469 13.8992 6.23382 13 6.08296V2Z"},i={name:"failure",prefix:"amplify",height:"24",width:"24",svgPathData:"M11 2H13V6.08296C15.5125 6.50448 17.4955 8.4875 17.917 11H22V13H17.917C17.4955 15.5125 15.5125 17.4955 13 17.917V22H11V17.917C8.4875 17.4955 6.50448 15.5125 6.08296 13H2V11H6.08296C6.50448 8.4875 8.4875 6.50448 11 6.08296V2ZM16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z"};export{i as amplify_failure,a as amplify_lwd,e as amplify_success,L as amplify_wellbore,V as amplify_wireline,C as amplify_wireline_cased_hole,H as amplify_wireline_open_hole};
|
package/dist/atoms/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"react";import"../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../molecules/RichTextEditor/RichTextEditor.types.js";import"../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";export{EnvironmentType}from"./enums/Environment.js";export{auth,environment}from"./utils/auth_environment.js";export{useNotification}from"../organisms/TopBar/Notifications/NotificationProvider.js";export{useAuth}from"../providers/AuthProvider/AuthProvider.js";export{useReleaseNotes}from"../providers/ReleaseNotesProvider.js";export{useSideBar}from"../providers/SideBarProvider.js";export{useSnackbar}from"../providers/SnackbarProvider/SnackbarProvider.js";export{useStepper}from"../providers/StepperProvider.js";export{useTableOfContents}from"../providers/TableOfContentsProvider.js";export{useThemeProvider}from"../providers/ThemeProvider/ThemeProvider.js";
|
|
1
|
+
import"react";import"../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../molecules/RichTextEditor/RichTextEditor.types.js";import"../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";export{EnvironmentType}from"./enums/Environment.js";export{auth,environment}from"./utils/auth_environment.js";export{useNotification}from"../organisms/TopBar/Notifications/NotificationProvider.js";export{useAuth}from"../providers/AuthProvider/AuthProvider.js";export{useReleaseNotes}from"../providers/ReleaseNotesProvider.js";export{useSideBar}from"../providers/SideBarProvider.js";export{useSnackbar}from"../providers/SnackbarProvider/SnackbarProvider.js";export{useStepper}from"../providers/StepperProvider.js";export{useTableOfContents}from"../providers/TableOfContentsProvider.js";export{useThemeProvider}from"../providers/ThemeProvider/ThemeProvider.js";import*as r from"./style/index.js";export{elevation,shape,typography}from"./style/index.js";export{ErrorType}from"./enums/Errors.js";export{Theme}from"./enums/Theme.js";export{SpacingsMode}from"./enums/SpacingsMode.js";import"html2canvas";import"proj4";const e=r;export{e as style};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
format:
|
|
3
|
-
month?:
|
|
1
|
+
type FormatDateOptions = {
|
|
2
|
+
format: 'DD. month YYYY' | 'DD. month';
|
|
3
|
+
month?: 'short' | 'long';
|
|
4
|
+
} | {
|
|
5
|
+
format: 'DD.MM.YYYY' | 'YYYY-MM-DD' | 'DD.MM.YY';
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* @param date - The date obj / date string to format
|
|
9
|
+
* @param options - Default is { format: 'DD. month YYYY', month: 'long' }
|
|
10
|
+
*/
|
|
11
|
+
export declare const formatDate: (date: Date | string | null | undefined, options?: FormatDateOptions & {
|
|
4
12
|
useUTC?: boolean;
|
|
5
13
|
}) => string;
|
|
6
14
|
export declare const formatDateTime: (date: Date | string | null | undefined, options?: {
|
|
@@ -10,3 +18,4 @@ export declare const formatDateTime: (date: Date | string | null | undefined, op
|
|
|
10
18
|
}) => string;
|
|
11
19
|
export declare const formatRelativeDateTime: (date: Date | string | null | undefined, isGMT?: boolean) => string;
|
|
12
20
|
export declare const isBetweenDates: (date: Date | string | null | undefined, dates: [Date, Date]) => boolean;
|
|
21
|
+
export {};
|
package/dist/atoms/utils/date.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=(t,e)=>{if(t){const n=new Date(t);if(n.getTime()){if("DD. month YYYY"===e?.format){return`${n.toLocaleDateString("en-GB",{day:"numeric",timeZone:e.useUTC?"UTC":void 0})}. ${n.toLocaleString("en-GB",{month:e?.month??"long",year:"numeric",timeZone:e.useUTC?"UTC":void 0})}`}const t=e?.useUTC?n.getUTCDate():n.getDate(),
|
|
1
|
+
const t=(t,e={format:"DD. month YYYY",month:"long"})=>{if(t){const n=new Date(t);if(n.getTime()){if("DD. month YYYY"===e?.format){return`${n.toLocaleDateString("en-GB",{day:"numeric",timeZone:e.useUTC?"UTC":void 0})}. ${n.toLocaleString("en-GB",{month:e?.month??"long",year:"numeric",timeZone:e.useUTC?"UTC":void 0})}`}const t=e?.useUTC?n.getUTCDate():n.getDate(),o=e?.useUTC?n.getUTCMonth()+1:n.getMonth()+1,i=e?.useUTC?n.getUTCFullYear():n.getFullYear();if("DD. month"===e?.format){return`${n.toLocaleDateString("en-GB",{day:"numeric",timeZone:e.useUTC?"UTC":void 0})}. ${n.toLocaleString("en-GB",{month:e.month??"long",timeZone:e.useUTC?"UTC":void 0})}`}return"YYYY-MM-DD"===e?.format?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`:"DD.MM.YY"===e?.format?`${t.toString().padStart(2,"0")}.${o.toString().padStart(2,"0")}.${i.toString().padStart(4,"0").slice(-2)}`:`${t.toString().padStart(2,"0")}.${o.toString().padStart(2,"0")}.${i.toString().padStart(4,"0")}`}}return""},e=(t,e={month:"long",hideYear:!1,isGMT:!1})=>{if(t){const n=new Date(t);if(n.getTime()){e.isGMT&&n.setTime(n.getTime()+6e4*n.getTimezoneOffset());return`${n.toLocaleDateString("en-GB",{day:"numeric"})}. ${n.toLocaleString("en-GB",{month:e.month??"long",year:e.hideYear?void 0:"numeric",hour:"2-digit",minute:"2-digit"})}`}}return""},n=(t,n=!1)=>{if(t){const o=new Date(t),i=new Date;if(o.getTime()){n&&o.setTime(o.getTime()+6e4*o.getTimezoneOffset());const r=(o<i?i.getTime()-o.getTime():o.getTime()-i.getTime())/864e5,a=o.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"});return r<1&&o.getDate()===i.getDate()?`Today at ${a}`:r<2&&o<i?`Yesterday at ${a}`:r<2&&r>=0?`Tomorrow at ${a}`:r>2&&r<7&&o>i?`${o.toLocaleString("en-GB",{weekday:"long"})} at ${a}`:e(t,{hideYear:o.getFullYear()===i.getFullYear()})}}return""},o=(t,e)=>{if(t){if(new Date(t).getTime())return t>=e[0]&&t<=e[1]}return!1};export{t as formatDate,e as formatDateTime,n as formatRelativeDateTime,o as isBetweenDates};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DEFAULT_FEATURES as e,RichTextEditorFeatures as r}from"../../molecules/RichTextEditor/RichTextEditor.types.js";function t({features:t,extendFeatures:n,removeFeatures:o,onImageUpload:i}){const a=[...t??e,...n??[]].filter((e=>!o?.includes(e))).filter(((e,r,t)=>r===t.indexOf(e)));if(a.includes(r.IMAGES)&&void 0===i)throw new Error("onImageUpload cannot be undefined when features include images!\n Either add the onImageUpload function or remove RichTextEditorFeatures.IMAGES from the features array");return a}const n=/(<img src=".*?" alt="(.*?)">)/g,o=/(<img alt="(.*?)" \/>)/g;function i(e){if(!e)return[];const r=[],t=e.matchAll(o);for(const e of t)r.push(e[2]);return r}function a(e){return new Promise(((r,t)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{"string"==typeof n.result&&r(n.result)},n.onerror=t}))}function s(e){return e.replaceAll(n,'<img alt="$2" />')}export{o as IMG_WITH_ALT,n as IMG_WITH_SRC_AND_ALT,s as cleanRichTextValue,i as extractImageUrls,t as getFeatures,a as imageToB64};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param tutorialId - ID of the relevant tutorial in SAM
|
|
4
|
+
* @param stepNum - Which step in the tutorial, starts at 0
|
|
5
|
+
*/
|
|
6
|
+
export declare function highlightTutorialElementID(tutorialId: string, stepNum: number): string;
|
|
7
|
+
export interface TutorialHighlight extends Pick<DOMRect, 'top' | 'left' | 'height' | 'width'> {
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function getHighlightElementBoundingBox(tutorialId: string, stepNum: number): TutorialHighlight | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,e){if(e<0)throw new Error(`[TutorialHighlightingProvider]: stepNum must be greater than or equal to 0, received ${e}`);return`sam-tutorial-${t}-${e}`}function e(e,o){const n=t(e,o),i=document.getElementById(n);if(!i)return void console.warn(`[TutorialHighlightingProvider]: Element with ID ${n} not found`);const r=i.getBoundingClientRect(),l=document.getElementById("content").scrollTop;return(r.top<=0||r.left<=0||r.bottom>=window.innerHeight||r.right>=window.innerWidth)&&i.scrollIntoView({behavior:"smooth",block:"center"}),{id:e,top:r.top-5+l,left:r.left-5,width:r.width+10,height:r.height+10}}export{e as getHighlightElementBoundingBox,t as highlightTutorialElementID};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AuthProvider,useAuth}from"./providers/AuthProvider/AuthProvider.js";export{SideBarProvider,useSideBar}from"./providers/SideBarProvider.js";export{SnackbarProvider,useSnackbar}from"./providers/SnackbarProvider/SnackbarProvider.js";export{TableOfContentsProvider,useTableOfContents}from"./providers/TableOfContentsProvider.js";export{ReleaseNotesProvider,useReleaseNotes}from"./providers/ReleaseNotesProvider.js";export{
|
|
1
|
+
export{AuthProvider,useAuth}from"./providers/AuthProvider/AuthProvider.js";export{SideBarProvider,useSideBar}from"./providers/SideBarProvider.js";export{SnackbarProvider,useSnackbar}from"./providers/SnackbarProvider/SnackbarProvider.js";export{TableOfContentsProvider,useTableOfContents}from"./providers/TableOfContentsProvider.js";export{ReleaseNotesProvider,useReleaseNotes}from"./providers/ReleaseNotesProvider.js";export{TutorialHighlightingProvider}from"./providers/TutorialHighlightingProvider/TutorialHighlightingProvider.js";export{LoadingProvider}from"./providers/LoadingProvider.js";export{ThemeProvider,useThemeProvider}from"./providers/ThemeProvider/ThemeProvider.js";export{StepperProvider,useStepper}from"./providers/StepperProvider.js";export{style}from"./atoms/index.js";export{AnimatedCheckmark}from"./molecules/AnimatedCheckmark/AnimatedCheckmark.js";export{ApplicationIcon}from"./molecules/ApplicationIcon/ApplicationIcon.js";export{Badge}from"./molecules/Badge/Badge.js";export{Banner}from"./molecules/Banner/Banner.js";export{Chip}from"./molecules/Chip/Chip.js";export{ContentMenu}from"./molecules/ContentMenu/ContentMenu.js";export{DatePicker}from"./molecules/DatePicker/DatePicker.js";export{Dialog}from"./molecules/Dialog/Dialog.js";export{EquinorLogo}from"./molecules/EquinorLogo/EquinorLogo.js";export{FileProgress}from"./molecules/FileProgress/FileProgress.js";export{FileUploadArea}from"./molecules/FileUploadArea/FileUploadArea.js";export{FullPageSpinner}from"./molecules/FullPageSpinner/FullPageSpinner.js";export{InfoElement}from"./molecules/InfoElement/InfoElement.js";export{OptionalTooltip}from"./molecules/OptionalTooltip/OptionalTooltip.js";export{ProfileAvatar}from"./molecules/ProfileAvatar/ProfileAvatar.js";export{RichTextDisplay}from"./molecules/RichTextDisplay/RichTextDisplay.js";export{RichText}from"./molecules/RichTextEditor/index.js";export{AmplifyBar,EditorMenu,EditorText}from"./molecules/RichTextEditor/MenuBar/MenuBar.js";export{AmplifyKit}from"./molecules/RichTextEditor/custom-extensions/AmplifyKit.js";export{TableMenuBar,TextTable}from"./molecules/RichTextEditor/MenuBar/Table/TableBar.js";export{DEFAULT_FEATURES,RichTextEditorFeatures}from"./molecules/RichTextEditor/RichTextEditor.types.js";export{Search}from"./molecules/Search/Search.js";export{Sieve}from"./molecules/Sieve/Sieve.js";export{SingleFilterMenu}from"./molecules/SingleFilterMenu/SingleFilterMenu.js";export{SkeletonBase,skeletonBaseloading}from"./molecules/Skeleton/SkeletonBase/SkeletonBase.js";export{SkeletonGradient}from"./molecules/Skeleton/SkeletonGradient/SkeletonGradient.js";export{Stepper}from"./molecules/Stepper/Stepper.js";export{OptionDrawer}from"./molecules/OptionDrawer/OptionDrawer.js";export{ComboBox}from"./molecules/Select/ComboBox/ComboBox.js";export{ComboBoxChip}from"./molecules/Select/Select.styles.js";export{SingleSelect}from"./molecules/Select/SingleSelect/SingleSelect.js";export{PageWithTitle}from"./molecules/PageWithTitle/PageWithTitle.js";export{FeedBackIcon}from"./molecules/FeedBackIcon/FeedBackIcon.js";export{ListItem}from"./molecules/ListItem/ListItem.js";export{Checkbox}from"./molecules/SelectionControls/Checkbox/Checkbox.js";export{Radio}from"./molecules/SelectionControls/Radio/Radio.js";export{Switch}from"./molecules/SelectionControls/Switch/Switch.js";export{Accordion,Breadcrumbs,Button,Card,CircularProgress,DateRangePicker,Divider,DotProgress,Dialog as EDSDialog,Icon,LinearProgress,Menu,Tabs,TextField,Typography}from"@equinor/eds-core-react";export{DataGrid}from"./organisms/DataGrid/DataGrid.js";export{FieldSelector}from"./organisms/FieldSelector/FieldSelector.js";export{Filter}from"./organisms/Filter/Filter.js";export{SideBar}from"./organisms/SideBar/index.js";export{TopBar}from"./organisms/TopBar/index.js";export{Status}from"./organisms/Status/index.js";export{BadRequest}from"./organisms/Status/collections/BadRequest.js";export{GenericError}from"./organisms/Status/collections/GenericError.js";export{MissingAccessToApp}from"./organisms/Status/collections/MissingAccessToApp.js";export{MissingPermissions}from"./organisms/Status/collections/MissingPermissions.js";export{PageNotFound}from"./organisms/Status/collections/PageNotFound.js";export{ServerError}from"./organisms/Status/collections/ServerError.js";export{ApiResponseError}from"./organisms/Status/collections/ApiResponseError.js";export{TableOfContents}from"./organisms/TableOfContents/TableOfContents.js";export{Template}from"./organisms/Template/Template.js";export{PageTitle}from"./organisms/PageTitle/PageTitle.js";export{ExpandingIconButton}from"./deprecated/ExpandingIconButton/ExpandingIconButton.js";export{default as IconToggleButton}from"./deprecated/IconToggleButton.js";export{OldStepper}from"./deprecated/OldStepper/OldStepper.js";export{useSelect}from"./atoms/hooks/useSelect.js";export{useDebounce}from"./atoms/hooks/useDebounce.js";export{useFakeProgress}from"./atoms/hooks/useFakeProgress.js";export{useLocalStorage}from"./atoms/hooks/useLocalStorage.js";export{useNotification}from"./organisms/TopBar/Notifications/NotificationProvider.js";export{useOnScreenMultiple}from"./atoms/hooks/useOnScreenMultiple.js";export{usePrevious}from"./atoms/hooks/usePrevious.js";export{useSignalRMessages}from"./atoms/hooks/useSignalRMessages.js";export{useAmplifyKit}from"./atoms/hooks/useAmplifyKit.js";export{spacings}from"./atoms/style/spacings.js";export{colors}from"./atoms/style/colors.js";export{animation}from"./atoms/style/animation.js";export{elevation,shape,typography}from"./atoms/style/index.js";export{ErrorType}from"./atoms/enums/Errors.js";export{EnvironmentType}from"./atoms/enums/Environment.js";export{Theme}from"./atoms/enums/Theme.js";export{SpacingsMode}from"./atoms/enums/SpacingsMode.js";export{amplify_failure,amplify_lwd,amplify_success,amplify_wellbore,amplify_wireline,amplify_wireline_cased_hole,amplify_wireline_open_hole}from"./atoms/icons/drilling.js";export{amplify_calculator,amplify_overlay,amplify_sidebyside}from"./atoms/icons/map.js";export{amplify_aml,amplify_arrow_up_down,amplify_branch,amplify_info_small,amplify_merged,amplify_overview,amplify_resources,amplify_sharepoint,amplify_shield_person,amplify_small_portal,amplify_snail,amplify_sort_small,amplify_tutorials}from"./atoms/icons/other.js";export{amplify_h1,amplify_h2,amplify_h3,amplify_h4,amplify_table_add_column_left,amplify_table_add_column_right,amplify_table_add_row_above,amplify_table_add_row_below,amplify_table_column_heading,amplify_table_merge_cells,amplify_table_remove_column,amplify_table_remove_row,amplify_table_row_heading,amplify_table_split_cell}from"./atoms/icons/wysiwyg.js";export{auth,environment}from"./atoms/utils/auth_environment.js";export{formatLatLng,formatUtm}from"./atoms/utils/coordinate.js";export{formatDate,formatDateTime,formatRelativeDateTime,isBetweenDates}from"./atoms/utils/date.js";export{exportComponent}from"./atoms/utils/export.js";export{setupIcons}from"./atoms/utils/favicon.js";export{convertLatLngToUtm,convertUtmToLatLng,degrees2radians,distanceLatLng,utmProjection}from"./atoms/utils/map.js";export{defaultQueryOptions}from"./atoms/utils/reactquery.js";export{IMG_WITH_ALT,IMG_WITH_SRC_AND_ALT,cleanRichTextValue,extractImageUrls,getFeatures,imageToB64}from"./atoms/utils/richtext.js";export{formatBytes,formatDataSize,formatKiloBytes}from"./atoms/utils/size.js";export{sortByDate,sortByWellboreName}from"./atoms/utils/sort.js";export{Empty,capitalize}from"./atoms/utils/string.js";export{isValidUrl}from"./atoms/utils/url.js";export{getHighlightElementBoundingBox,highlightTutorialElementID}from"./atoms/utils/tutorials.js";export{RichTextEditor}from"./molecules/RichTextEditor/RichTextEditor.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{DatePicker as o,Typography as i}from"@equinor/eds-core-react";import{DatePickerWrapper as a}from"./DatePicker.styles.js";const m=t(((t,m)=>{const n=t.locale??"en-GB",c=void 0!==t.formatOptions?t.formatOptions:{
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{DatePicker as o,Typography as i}from"@equinor/eds-core-react";import{DatePickerWrapper as a}from"./DatePicker.styles.js";const m=t(((t,m)=>{const n=t.locale??"en-GB",c=void 0!==t.formatOptions?t.formatOptions:{day:"2-digit",month:"2-digit",year:"numeric"};return r(a,{children:[e(o,{...t,ref:m,locale:n,formatOptions:c}),t.meta&&e(i,{variant:"helper",group:"input",children:t.meta})]})}));m.displayName="DatePicker";export{m as DatePicker};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { CompactFileProgressBaseProps, FileProgressPropsExtension } from './FileProgress';
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
declare const CompactFileProgress: FC<CompactFileProgressProps>;
|
|
2
|
+
import { CompactFileProgressBaseProps, FileProgressPropsExtension } from './FileProgress.types';
|
|
3
|
+
declare const CompactFileProgress: FC<CompactFileProgressBaseProps & FileProgressPropsExtension>;
|
|
6
4
|
export default CompactFileProgress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useState as r,useEffect as i,useMemo as o}from"react";import{Icon as
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useState as r,useEffect as i,useMemo as o}from"react";import{Icon as n,Typography as s}from"@equinor/eds-core-react";import{error_outlined as a,clear as l}from"@equinor/eds-icons";import{Rejection as m,DoneWrapper as p,LoadingWrapper as c,CircularProgress as h,CompactFileProgressContainer as d,FileTooltip as j,AdditionalText as g,CloseButton as u}from"./CompactFileProgress.styles.js";import{isFileImage as x,getFileIcon as k,readUploadedFileAsText as w}from"./FileProgress.utils.js";import{colors as S}from"../../atoms/style/colors.js";import"../AnimatedCheckmark/AnimatedCheckmark.styles.js";import"../ApplicationIcon/ApplicationIcon.js";import"../Badge/Badge.styles.js";import"../Banner/Banner.styles.js";import"../Chip/Chip.js";import"../ContentMenu/ContentMenu.styles.js";import"../DatePicker/DatePicker.js";import"../Dialog/Dialog.js";import"../EquinorLogo/EquinorLogo.js";import"../../atoms/utils/auth_environment.js";import"html2canvas";import"proj4";import"../RichTextEditor/RichTextEditor.types.js";import"./RegularFileProgress.styles.js";import"../FileUploadArea/FileUploadArea.js";import"../FullPageSpinner/FullPageSpinner.js";import"../InfoElement/InfoElement.js";import{OptionalTooltip as v}from"../OptionalTooltip/OptionalTooltip.js";import"../ProfileAvatar/ProfileAvatar.js";import"@tiptap/react";import"../RichTextEditor/custom-extensions/AmplifyKit.js";import"../RichTextEditor/RichTextEditor.styles.js";import"../RichTextEditor/MenuBar/MenuBar.js";import"@tanstack/react-query";import"../RichTextEditor/MenuBar/MenuBar.styles.js";import"../RichTextEditor/MenuBar/MenuButton.js";import"../Search/Search.js";import"react-router-dom";import"../Sieve/Sieve.styles.js";import"../../_virtual/lodash.js";import"../SingleFilterMenu/SingleFilterMenu.js";import"../Skeleton/SkeletonBase/SkeletonBase.js";import"../Skeleton/Skeleton.styles.js";import"../Stepper/Stepper.js";import"../OptionDrawer/OptionDrawer.js";import"../Select/Select.styles.js";import"../ListItem/ListItem.js";import"../SelectionControls/Checkbox/Checkbox.js";import"../SelectionControls/Radio/Radio.js";import"../SelectionControls/Switch/Switch.js";const y=({file:y,isError:f,shortErrorText:E,showCompleteState:C,fullErrorText:B,handleOnClick:T,isDeleting:R,..._})=>{const[A,M]=r("");i((()=>{f||(async t=>{const e=await w(t);M(e)})(y)}),[f,y]);const P=o((()=>f?B&&B.length>0?B:"An error has occurred with the file":""),[B,f]),D=o((()=>f?t(m,{children:[e(n,{data:a,color:S.interactive.warning__text.rgba}),e("div",{children:E&&E.length>0?E:"Invalid file type"}),e("svg",{width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("rect",{x:"1",y:"1",width:"86",height:"86",rx:"7",stroke:S.interactive.warning__text.rgba,strokeWidth:"2",strokeDasharray:"4 4"})})]}):C&&!R&&x(y.name)?e(p,{children:e("img",{src:A,alt:` ${y.name}`})}):C&&!R?e(p,{children:e(n,{data:k(y.name)})}):t(c,{children:[e(h,{variant:_.indeterminate||R?"indeterminate":"determinate",value:_.indeterminate?_.progressPercent:void 0,size:24}),e(s,{variant:"meta",children:"Uploading..."}),e("svg",{width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("rect",{x:"1",y:"1",width:"86",height:"86",rx:"7",stroke:S.ui.background__medium.rgba,strokeWidth:"2",strokeDasharray:"4 4"})})]})),[f,C,R,E,A,y.name,_]);return t(d,{$isError:f,children:[e(j,{title:P,children:D}),e(v,{title:y.name,children:e(g,{group:"paragraph",variant:"meta",children:y.name})}),!R&&e(u,{"data-testid":"attachment-delete-button",onClick:T,children:e(n,{color:S.text.static_icons__tertiary.rgba,data:l})})]})};export{y as default};
|
|
@@ -18,11 +18,13 @@ export declare const FileTooltip: import("styled-components/dist/types").IStyled
|
|
|
18
18
|
title?: string;
|
|
19
19
|
children: React.ReactElement & React.RefAttributes<HTMLElement>;
|
|
20
20
|
enterDelay?: number;
|
|
21
|
+
portalContainer?: HTMLElement;
|
|
21
22
|
} & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<{
|
|
22
23
|
placement?: import("@floating-ui/utils").Placement;
|
|
23
24
|
title?: string;
|
|
24
25
|
children: React.ReactElement & React.RefAttributes<HTMLElement>;
|
|
25
26
|
enterDelay?: number;
|
|
27
|
+
portalContainer?: HTMLElement;
|
|
26
28
|
} & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>, keyof import("react").Component<any, {}, any>>;
|
|
27
29
|
export declare const CircularProgress: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("@equinor/eds-core-react").CircularProgressProps, "ref"> & import("react").RefAttributes<SVGSVGElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("@equinor/eds-core-react").CircularProgressProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>, keyof import("react").Component<any, {}, any>>;
|
|
28
30
|
export {};
|
|
@@ -1,33 +1,23 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
interface FileProgressBaseProps {
|
|
4
|
-
onDelete: () => Promise<void> | void;
|
|
5
|
-
file: FileWithPath | File;
|
|
6
|
-
isDone?: boolean;
|
|
7
|
-
progressPercent?: number;
|
|
8
|
-
indeterminate?: boolean;
|
|
9
|
-
onCancel?: () => void;
|
|
10
|
-
isError?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface RegularFileProgressBaseProps extends FileProgressBaseProps {
|
|
13
|
-
compact?: false;
|
|
14
|
-
fullErrorText?: string;
|
|
15
|
-
customLoadingText?: string;
|
|
16
|
-
customCompleteText?: string;
|
|
17
|
-
onRetry?: () => void;
|
|
18
|
-
}
|
|
19
|
-
export interface CompactFileProgressBaseProps extends FileProgressBaseProps {
|
|
20
|
-
compact: true;
|
|
21
|
-
shortErrorText?: string;
|
|
22
|
-
fullErrorText?: string;
|
|
23
|
-
}
|
|
2
|
+
import { FileProgressProps } from './FileProgress.types';
|
|
24
3
|
export interface FileProgressPropsExtension {
|
|
25
4
|
showCompleteState: boolean;
|
|
26
5
|
handleOnClick: () => void;
|
|
27
6
|
isDeleting: boolean;
|
|
28
7
|
}
|
|
29
8
|
/**
|
|
30
|
-
* @
|
|
9
|
+
* @param onDelete - call back when clicking delete
|
|
10
|
+
* @param file - file to show progress for (FileWithPath or File)
|
|
11
|
+
* @param onCancel - call back when clicking cancel
|
|
12
|
+
* @param isError - if the file upload has an error
|
|
13
|
+
* @param isDone - if the file upload is done
|
|
14
|
+
* @param progressPercent - the percentage of the file that has been uploaded, if undefined its considered indeterminate
|
|
15
|
+
* @param indeterminate - if the file upload progress is indeterminate
|
|
16
|
+
* @param compact - if the file progress should use compact mode
|
|
17
|
+
* @param fullErrorText - the full error text to show when hovering over the error icon
|
|
18
|
+
* @param customLoadingText - custom loading text to show
|
|
19
|
+
* @param customCompleteText - custom complete text to show
|
|
20
|
+
* @param onRetry - call back when clicking retry on a failed upload
|
|
21
|
+
* @param shortErrorText - short error text to show (in compact mode)
|
|
31
22
|
*/
|
|
32
|
-
export declare const FileProgress: FC<
|
|
33
|
-
export {};
|
|
23
|
+
export declare const FileProgress: FC<FileProgressProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { FileWithPath } from 'react-dropzone';
|
|
2
|
+
interface FileProgressBaseProps {
|
|
3
|
+
onDelete: () => Promise<void> | void;
|
|
4
|
+
file: FileWithPath | File;
|
|
5
|
+
onCancel?: () => void;
|
|
6
|
+
isError?: boolean;
|
|
7
|
+
}
|
|
8
|
+
type DoneFileProgress = FileProgressBaseProps & {
|
|
9
|
+
isDone: true;
|
|
10
|
+
indeterminate?: undefined;
|
|
11
|
+
};
|
|
12
|
+
type ProgressPercentFileProgress = FileProgressBaseProps & {
|
|
13
|
+
progressPercent: number;
|
|
14
|
+
isDone?: false;
|
|
15
|
+
indeterminate?: false;
|
|
16
|
+
};
|
|
17
|
+
type IndeterminateFileProgress = FileProgressBaseProps & {
|
|
18
|
+
progressPercent?: undefined;
|
|
19
|
+
isDone?: false;
|
|
20
|
+
indeterminate: true;
|
|
21
|
+
};
|
|
22
|
+
type FileProgressBase = DoneFileProgress | ProgressPercentFileProgress | IndeterminateFileProgress;
|
|
23
|
+
export type RegularFileProgressBaseProps = FileProgressBase & {
|
|
24
|
+
compact?: false;
|
|
25
|
+
fullErrorText?: string;
|
|
26
|
+
customLoadingText?: string;
|
|
27
|
+
customCompleteText?: string;
|
|
28
|
+
onRetry?: () => void;
|
|
29
|
+
};
|
|
30
|
+
export type CompactFileProgressBaseProps = FileProgressBase & {
|
|
31
|
+
compact: true;
|
|
32
|
+
shortErrorText?: string;
|
|
33
|
+
fullErrorText?: string;
|
|
34
|
+
};
|
|
35
|
+
export interface FileProgressPropsExtension {
|
|
36
|
+
showCompleteState: boolean;
|
|
37
|
+
handleOnClick: () => void;
|
|
38
|
+
isDeleting: boolean;
|
|
39
|
+
}
|
|
40
|
+
export type FileProgressProps = RegularFileProgressBaseProps | CompactFileProgressBaseProps;
|
|
41
|
+
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { FileProgressPropsExtension, RegularFileProgressBaseProps } from './FileProgress';
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
declare const RegularFileProgress: FC<RegularFileProgressProps>;
|
|
2
|
+
import { FileProgressPropsExtension, RegularFileProgressBaseProps } from './FileProgress.types';
|
|
3
|
+
declare const RegularFileProgress: FC<RegularFileProgressBaseProps & FileProgressPropsExtension>;
|
|
6
4
|
export default RegularFileProgress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{useMemo as i}from"react";import{Icon as t,Typography as o,Button as n,CircularProgress as
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{useMemo as i}from"react";import{Icon as t,Typography as o,Button as n,CircularProgress as s}from"@equinor/eds-core-react";import{file as a,delete_to_trash as c,close_circle_outlined as l,refresh as m}from"@equinor/eds-icons";import{colors as d}from"../../atoms/style/colors.js";import"../../atoms/utils/auth_environment.js";import"html2canvas";import"proj4";import"../RichTextEditor/RichTextEditor.types.js";import{formatDataSize as p}from"../../atoms/utils/size.js";import{Container as h,RegularFileProgressWrapper as u,FileName as v,ProgressWrapper as g,LinearProgress as z,RegularFileProgressDetails as _}from"./RegularFileProgress.styles.js";const f=({onRetry:f,file:x,customLoadingText:j,customCompleteText:y,isError:C,fullErrorText:E,showCompleteState:F,handleOnClick:T,isDeleting:b,...P})=>{const R=i((()=>{if(!x?.size||P.isDone||P.indeterminate||void 0===P.progressPercent)return 1;const r=x.size/100*P.progressPercent;return p({inputFormat:"B",size:r,decimals:1})}),[x?.size,P]),k=i((()=>{if(C)return E??"An error has occurred";return F?y??"File uploaded!":j??"loading..."}),[y,j,E,F,C]);return r(h,{$isError:C,children:[e(t,{data:a,color:C?d.interactive.danger__hover.rgba:d.interactive.primary__resting.rgba,size:32}),r(u,{children:[r(v,{children:[e(o,{variant:"caption",children:x.name}),r("div",{children:[e(n,b?{variant:"ghost_icon",children:e(s,{size:24})}:{variant:"ghost_icon",onClick:T,children:e(t,{data:F?c:l,color:d.text.static_icons__tertiary.rgba,size:24})}),C&&f&&e(n,{variant:"ghost_icon",onClick:f,children:e(t,{data:m,color:d.text.static_icons__tertiary.rgba,size:24})})]})]}),e(g,{children:!F&&e(z,{variant:P.indeterminate?"indeterminate":"determinate",value:P.indeterminate?P.progressPercent:void 0})}),r(_,{children:[e(o,{variant:"overline",children:k}),x?.size&&e(o,{variant:"overline",children:F?p({size:x.size,decimals:1,inputFormat:"B"}):`${R} of ${p({size:x.size,decimals:1,inputFormat:"B"})}`})]})]})]})};export{f as default};
|
|
@@ -9,4 +9,5 @@ export declare const OptionalTooltip: import("react").ForwardRefExoticComponent<
|
|
|
9
9
|
title?: string;
|
|
10
10
|
children: React.ReactElement & React.RefAttributes<HTMLElement>;
|
|
11
11
|
enterDelay?: number;
|
|
12
|
+
portalContainer?: HTMLElement;
|
|
12
13
|
} & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AmplifyBar as r}from"./MenuBar/MenuBar.js";import{EditorProvider as t}from"./EditorProvider.js";import{
|
|
1
|
+
import{AmplifyBar as r}from"./MenuBar/MenuBar.js";import{EditorProvider as t}from"./EditorProvider.js";import{EditorContent as o,EditorStyling as i}from"./RichTextEditor.styles.js";import{RichTextDisplay as e}from"../RichTextDisplay/RichTextDisplay.js";import"react/jsx-runtime";import"@equinor/eds-core-react";import"../../atoms/style/colors.js";import"./RichTextEditor.types.js";const s={Styling:i,Provider:t,Content:o,Display:e,Bar:r};export{s as RichText};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useMemo as t}from"react";import{Menu as i}from"@equinor/eds-core-react";import{NoItemsFoundText as m}from"./Select.styles.js";import{getCumulativeArrayFromNumberedArray as l}from"./Select.utils.js";import{SelectMenuItem as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useMemo as t}from"react";import{Menu as i}from"@equinor/eds-core-react";import{NoItemsFoundText as m}from"./Select.styles.js";import{getCumulativeArrayFromNumberedArray as l}from"./Select.utils.js";import{SelectMenuItem as r}from"./SelectMenuItem.js";const n=n=>{const{onItemSelect:o,onItemKeyDown:s,itemRefs:c,groups:a,search:f,onSearchFilter:u}=n,p=t((()=>{if(""===f)return a;const e=new RegExp(f.trim(),"i");return a.map((t=>({title:t.title,items:t.items.filter((t=>void 0!==u?u(f,t):t.label.match(e)))}))).filter((e=>e.items.length>0))}),[a,u,f]),d=t((()=>{const e=p.map((e=>e.items.length));return l(e)}),[p]);return 0===p.length?e(m,{children:"No items found"}):"values"in n?p.map(((t,m)=>e(i.Section,{index:m,title:t.title,children:t.items.map(((i,l)=>e(r,{index:l+d[m],childOffset:0,item:i,itemRefs:c,onItemKeyDown:s,onItemSelect:o,values:n.values},`${t.title}-${m}-item-${i.value}`)))},`${t.title}-${m}`))):p.map(((t,m)=>e(i.Section,{index:m,title:t.title,children:t.items.map(((i,l)=>e(r,{index:l+d[m],childOffset:0,item:i,itemRefs:c,onItemKeyDown:s,onItemSelect:o,value:n.value},`${t.title}-${m}-item-${i.value}`)))},`${t.title}-${m}`)))};export{n as GroupedSelectMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useMemo as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useMemo as r}from"react";import{Menu as i}from"@equinor/eds-core-react";import{AddTagItem as m}from"./AddTagItem.js";import{NoItemsFoundText as o,NoTagFoundText as d}from"./Select.styles.js";import{flattenOptions as l,getChildOffset as s}from"./Select.utils.js";import{SelectMenuItem as c}from"./SelectMenuItem.js";const a=a=>{const{search:h,items:f,itemRefs:u,onItemKeyDown:p,onSearchFilter:g}=a,I=r((()=>{if(""===h)return f;const e=new RegExp(h.trim(),"i");return l(f).filter((t=>void 0!==g?g(h,t):t.label.match(e)))}),[f,g,h]);if(0===I.length&&!a.onAddItem)return e(o,{children:"No items found"});const x=I.some((e=>e.children&&e.children.length>0)),A=I.map(((e,t)=>({childOffset:s(I,t),index:t,item:e,itemValue:e.value,parentHasNestedItems:x,...a})));return"onAddItem"in a&&a.onAddItem&&""!==h&&(1===I.length&&I.at(0)?.label.toLowerCase()!==h.trim().toLowerCase()||1!==I.length)?t(n,{children:[e(i.Section,{title:"Add tag",index:0,children:e(m,{index:0,itemRefs:u,onItemKeyDown:p,onAddItem:a.onAddItem,children:h})}),e(i.Section,{title:"Tag search results",index:1,children:A.length>0?A.map(((t,n)=>e(c,{...t,index:n+1},`menu-item-${n}-${t.item.value}`))):t(d,{children:['No tag for "',h,'" found.']})})]}):A.map(((t,n)=>e(c,{...t,index:n},`menu-item-${n}-${t.item.value}`)))};export{a as ListSelectMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useRef as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useRef as o,useMemo as n}from"react";import{Label as r,CircularProgress as l,Icon as a}from"@equinor/eds-core-react";import{thumbs_up as i,warning_filled as c,error_filled as s,arrow_drop_up as d,arrow_drop_down as m,clear as u}from"@equinor/eds-icons";import{tokens as h}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{useSelect as p}from"../../atoms/hooks/useSelect.js";import{GroupedSelectMenu as g}from"./GroupedSelectMenu.js";import{ListSelectMenu as b}from"./ListSelectMenu.js";import{ValueText as f,ComboBoxChip as v,Wrapper as y,Container as x,Section as C,PlaceholderText as S,ClearButton as I,HelperWrapper as O,StyledMenu as k}from"./Select.styles.js";import{useOutsideClick as w}from"../../node_modules/@equinor/eds-utils/dist/esm/hooks/useOutsideClick.js";const{colors:D}=h,R=h=>{const{clearable:R=!0,loading:$=!1,disabled:j=!1,lightBackground:V=!1,underlineHighlight:B=!1,sortValues:F=!0,placeholder:K="Select...",label:T,helperText:_,showHelperIcon:q=!0,meta:z,id:A=`amplify-combobox-${T}`,variant:H,inDialog:W=!1,onSearchFilter:M,"data-testid":E}=h,{handleOnAddItem:G,handleOnClear:L,handleOnItemKeyDown:N,handleOnItemSelect:J,handleOnSearchChange:P,handleOnSearchKeyDown:Q,handleToggleOpen:U,itemRefs:X,search:Y,selectedValues:Z,handleOnClose:ee,handleOnOpen:te,handleOnRemoveItem:oe,open:ne,searchRef:re,tryingToRemoveItem:le}=p({...h,clearable:R,loading:$,disabled:j,lightBackground:V,underlineHighlight:B,sortValues:F,placeholder:K}),ae=o(null),ie=o(null),ce=n((()=>!!T||!!z),[T,z]),se=n((()=>!!_),[_]),de=n((()=>{if(q)switch(H){case"error":return s;case"warning":return c;case"success":return i}}),[q,H]);w(ie.current,(e=>{W&&ne&&e.target&&ae.current&&ie.current&&!ae.current.contains(e.target)&&!ie.current?.contains(e.target)&&ee()}));const me=n((()=>"value"in h&&h.value?e(f,{children:h.value.label}):Z.map((t=>"customValueComponent"in h&&h.customValueComponent?e(h.customValueComponent,{item:t,onDelete:()=>oe(t),tryingToRemove:void 0!==le&&le.value===t.value},t.value):e(v,{"data-testid":"amplify-combobox-chip",className:"amplify-combo-box-chip",onDelete:()=>oe(t),$tryingToRemove:le?.value===t.value,$lightBackground:V,children:t.label},t.value)))),[Z,le,V,h,oe]);return t("div",{children:[ce&&e(r,{label:T,meta:z,htmlFor:A}),t(y,{children:[t(x,{"data-testid":E||"combobox-container",ref:ae,onClick:te,"aria-expanded":ne,$variant:H,$lightBackground:V,children:[t(C,{children:[""===Y&&0===Z.length&&e(S,{children:K}),(""===Y||"values"in h&&Z.length>0)&&me,e("input",{id:A,disabled:j||$,ref:re,type:"search",role:"combobox",value:Y,autoComplete:"off",onChange:P,onKeyDownCapture:Q})]}),$?e(l,{size:16}):e(a,{onClick:U,data:ne?d:m,color:D.interactive.primary__resting.rgba}),R&&Z.length>0&&!$&&e(I,{id:"clear",variant:"ghost_icon",onClick:L,"data-testid":"clearBtn",children:e(a,{data:u,size:18})})]}),se&&t(O,{$variant:H,children:[de&&e(a,{data:de,size:16}),e(r,{label:_,htmlFor:A})]})]}),ne&&e(k,{ref:ie,open:!0,id:"combobox-menu",anchorEl:ae.current,onClose:ee,placement:"bottom",style:{width:`${ae.current?.clientWidth}px`,maxWidth:`${ae.current?.clientWidth}px`},children:"groups"in h&&h.groups?e(g,{...h,search:Y,itemRefs:X,onItemSelect:J,onItemKeyDown:N,onSearchFilter:M}):e(b,{...h,search:Y,itemRefs:X,onAddItem:h.onAddItem?G:void 0,onItemSelect:J,onItemKeyDown:N,onSearchFilter:M})})]})};export{R as Select};
|
|
@@ -15,7 +15,6 @@ export interface MultiSelectCommon<T extends SelectOptionRequired> {
|
|
|
15
15
|
values: SelectOption<T>[];
|
|
16
16
|
onSelect: (values: SelectOption<T>[], selectedValue?: SelectOption<T>) => void;
|
|
17
17
|
syncParentChildSelection?: boolean;
|
|
18
|
-
onAddItem?: (item: string) => void;
|
|
19
18
|
customValueComponent?: FC<{
|
|
20
19
|
item: SelectOption<T>;
|
|
21
20
|
onDelete: () => void;
|
|
@@ -49,16 +48,13 @@ interface SelectMenuItemProps<T extends SelectOptionRequired> {
|
|
|
49
48
|
index: number;
|
|
50
49
|
childOffset: number;
|
|
51
50
|
depth?: number;
|
|
52
|
-
}
|
|
53
|
-
export type SingleSelectMenuItemProps<T extends SelectOptionRequired> = {
|
|
54
|
-
multiselect?: undefined;
|
|
55
51
|
isParentSelected?: boolean;
|
|
56
52
|
parentHasNestedItems?: boolean;
|
|
57
|
-
}
|
|
53
|
+
}
|
|
54
|
+
export type SingleSelectMenuItemProps<T extends SelectOptionRequired> = {
|
|
55
|
+
value: SelectOption<T> | undefined;
|
|
56
|
+
} & Omit<SelectMenuProps<T>, 'search'> & SelectMenuItemProps<T>;
|
|
58
57
|
export type MultiSelectMenuItemProps<T extends SelectOptionRequired> = {
|
|
59
|
-
isParentSelected?: boolean;
|
|
60
|
-
parentHasNestedItems?: boolean;
|
|
61
|
-
multiselect: true;
|
|
62
58
|
values: SelectOption<T>[];
|
|
63
59
|
} & Omit<SelectMenuProps<T>, 'search'> & SelectMenuItemProps<T>;
|
|
64
60
|
export declare const VARIANT_OPTIONS: Variants[];
|
|
@@ -80,6 +76,7 @@ export interface CommonSelectProps<T extends SelectOptionRequired> {
|
|
|
80
76
|
inDialog?: boolean;
|
|
81
77
|
onOpenCallback?: (value: boolean) => void;
|
|
82
78
|
onSearchFilter?: (searchValue: string, item: T) => void;
|
|
79
|
+
onAddItem?: (item: string) => void;
|
|
83
80
|
'data-testid'?: string;
|
|
84
81
|
}
|
|
85
82
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState as n,useRef as
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState as n,useRef as i,useMemo as o}from"react";import{Icon as l}from"@equinor/eds-core-react";import{checkbox_outline as c,chevron_down as a,chevron_right as s,checkbox as u}from"@equinor/eds-icons";import{tokens as d}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{getChildOffset as m}from"./Select.utils.js";import{getParentIcon as p}from"./SelectMenuItem.utils.js";import{spacings as h}from"../../atoms/style/spacings.js";import{MenuItemSpacer as f,MenuItemWrapper as v,SmallButton as y,StyledMenuItem as g}from"./Select.styles.js";const{colors:w}=d,k=d=>{const{index:b,childOffset:x,depth:C=0,item:D,itemRefs:$,onItemKeyDown:A,onItemSelect:I,parentHasNestedItems:_=!1}=d,[j,K]=n(!1),S=i(-1),O=i([]),q=("values"in d?d.values.map((({value:e})=>e)):[]).includes(D.value),L=o((()=>"value"in d?c:p(D,d.values)),[D,d]),M=o((()=>new Array(C).fill(0).map(((r,t)=>e(f,{},`spacer-${r+t}`)))),[C]),R=e=>{e.preventDefault(),I(D)},H=e=>{e.stopPropagation(),K((e=>!e))},N=e=>{"ArrowDown"===e.key?S.current+=1:"ArrowUp"===e.key&&(S.current-=1),S.current<=-1?($.current[b]?.focus(),S.current=-1):S.current+x===O.current.length?(S.current=-1,A(e),K(!1)):S.current>=0&&S.current<O.current.length-x&&O.current[S.current+x]?.focus()},U=e=>{!j&&"ArrowDown"===e.key||"ArrowUp"===e.key?A(e):"ArrowRight"===e.key||"ArrowLeft"===e.key?K((e=>!e)):j&&"ArrowDown"===e.key&&-1===S.current&&(S.current=0,O.current[S.current+x]?.focus())};return D.children&&D.children.length>0&&"values"in d?r(t,{children:[r(v,{style:{paddingLeft:0===C?h.small:0},children:[M,e(y,{variant:"ghost_icon",onClick:H,"data-testid":"toggle-button",children:e(l,{color:w.interactive.primary__resting.rgba,data:j?a:s})}),r(g,{$depth:C,ref:e=>{$.current[b]=e},index:b,closeMenuOnClick:!1,onKeyDownCapture:U,onClick:R,children:[e(l,{color:w.interactive.primary__resting.rgba,data:L}),e("span",{children:D.label})]})]}),j&&D.children.map(((r,t)=>e(k,{index:x+t,childOffset:x+m(D.children,t),depth:C+1,item:r,itemRefs:O,values:d.values,onItemKeyDown:N,onItemSelect:I,parentHasNestedItems:!0},`child-${t}-${r.value}-${D.value}`)))]}):"values"in d?r(v,{children:[M,r(g,{$depth:C,$paddedLeft:_,ref:e=>{$.current[b]=e},index:b,tabIndex:C,closeMenuOnClick:!1,onKeyDownCapture:A,onClick:R,children:[e(l,{color:w.interactive.primary__resting.rgba,data:q?u:c}),e("span",{children:D.label})]})]}):e(v,{children:e(g,{$depth:C,$selected:d.value&&D.value===d.value.value,ref:e=>{$.current[b]=e},index:b,onKeyDownCapture:A,onClick:R,children:e("span",{children:D.label})})})};export{k as SelectMenuItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{Select as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Select as o}from"../Select.js";function t(t){if("groups"in t&&t.groups&&t.onAddItem)throw new Error("[ACL - SingleSelect] Using 'onAddItem' is only supported in lists and not groups");return r(o,{...t})}export{t as SingleSelect};
|
|
@@ -16,7 +16,8 @@ export type { DialogProps, DialogAction } from './Dialog/Dialog';
|
|
|
16
16
|
export { EquinorLogo } from './EquinorLogo/EquinorLogo';
|
|
17
17
|
export type { EquinorLogoProps } from './EquinorLogo/EquinorLogo';
|
|
18
18
|
export { FileProgress } from './FileProgress/FileProgress';
|
|
19
|
-
export type {
|
|
19
|
+
export type { FileProgressPropsExtension } from './FileProgress/FileProgress';
|
|
20
|
+
export type { FileProgressProps } from './FileProgress/FileProgress.types';
|
|
20
21
|
export { FileUploadArea } from './FileUploadArea/FileUploadArea';
|
|
21
22
|
export type { FileUploadAreaProps } from './FileUploadArea/FileUploadArea';
|
|
22
23
|
export { FullPageSpinner } from './FullPageSpinner/FullPageSpinner';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{colors as o}from"./colors.js";import{elevation as r}from"./elevation.js";import{shape as p}from"./shape.js";import{typography as s}from"./typography.js";import{spacings as m}from"./spacings.js";var t={colors:o,elevation:r,shape:p,typography:s,spacings:m};export{t as tokens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var l={comfortable:{large:"24px",medium:"16px",medium_small:"12px",small:"8px",x_small:"4px"}};export{l as spacings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Slice as t,Fragment as e,ReplaceError as r}from"../../prosemirror-model/dist/index.js";const s=Math.pow(2,16);function o(t){return 65535&t}class i{constructor(t,e,r){this.pos=t,this.delInfo=e,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class n{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&n.empty)return n.empty}recover(t){let e=0,r=o(t);if(!this.inverted)for(let t=0;t<r;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*r]+e+function(t){return(t-(65535&t))/s}(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,r){let o=0,n=this.inverted?2:1,a=this.inverted?1:2;for(let h=0;h<this.ranges.length;h+=3){let p=this.ranges[h]-(this.inverted?o:0);if(p>t)break;let l=this.ranges[h+n],m=this.ranges[h+a],u=p+l;if(t<=u){let n=p+o+((l?t==p?-1:t==u?1:e:e)<0?0:m);if(r)return n;let a=t==(e<0?p:u)?null:h/3+(t-p)*s,f=t==p?2:t==u?1:4;return(e<0?t!=p:t!=u)&&(f|=8),new i(n,f,a)}o+=m-l}return r?t+o:new i(t+o,0,null)}touches(t,e){let r=0,s=o(e),i=this.inverted?2:1,n=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let o=this.ranges[e]-(this.inverted?r:0);if(o>t)break;let a=this.ranges[e+i];if(t<=o+a&&e==3*s)return!0;r+=this.ranges[e+n]-a}return!1}forEach(t){let e=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,o=0;s<this.ranges.length;s+=3){let i=this.ranges[s],n=i-(this.inverted?o:0),a=i+(this.inverted?0:o),h=this.ranges[s+e],p=this.ranges[s+r];t(n,n+h,a,a+p),o+=p-h}}invert(){return new n(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?n.empty:new n(t<0?[0,-t,0]:[0,0,t])}}n.empty=new n([]);const a=Object.create(null);class h{getMap(){return n.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=a[e.stepType];if(!r)throw new RangeError(`No step type ${e.stepType} defined`);return r.fromJSON(t,e)}static jsonID(t,e){if(t in a)throw new RangeError("Duplicate use of step JSON ID "+t);return a[t]=e,e.prototype.jsonID=t,e}}class p{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new p(t,null)}static fail(t){return new p(null,t)}static fromReplace(t,e,s,o){try{return p.ok(t.replace(e,s,o))}catch(t){if(t instanceof r)return p.fail(t.message);throw t}}}function l(t,r,s){let o=[];for(let e=0;e<t.childCount;e++){let i=t.child(e);i.content.size&&(i=i.copy(l(i.content,r,i))),i.isInline&&(i=r(i,s,e)),o.push(i)}return e.fromArray(o)}class m extends h{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(e){let r=e.slice(this.from,this.to),s=e.resolve(this.from),o=s.node(s.sharedDepth(this.to)),i=new t(l(r.content,((t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),o),r.openStart,r.openEnd);return p.fromReplace(e,this.from,this.to,i)}invert(){return new u(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new m(e.pos,r.pos,this.mark)}merge(t){return t instanceof m&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new m(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new m(e.from,e.to,t.markFromJSON(e.mark))}}h.jsonID("addMark",m);class u extends h{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(e){let r=e.slice(this.from,this.to),s=new t(l(r.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),e),r.openStart,r.openEnd);return p.fromReplace(e,this.from,this.to,s)}invert(){return new m(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new u(e.pos,r.pos,this.mark)}merge(t){return t instanceof u&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new u(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new u(e.from,e.to,t.markFromJSON(e.mark))}}h.jsonID("removeMark",u);class f extends h{constructor(t,e){super(),this.pos=t,this.mark=e}apply(r){let s=r.nodeAt(this.pos);if(!s)return p.fail("No node at mark step's position");let o=s.type.create(s.attrs,null,this.mark.addToSet(s.marks));return p.fromReplace(r,this.pos,this.pos+1,new t(e.from(o),0,s.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let r=0;r<e.marks.length;r++)if(!e.marks[r].isInSet(t))return new f(this.pos,e.marks[r]);return new f(this.pos,this.mark)}}return new c(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new f(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new f(e.pos,t.markFromJSON(e.mark))}}h.jsonID("addNodeMark",f);class c extends h{constructor(t,e){super(),this.pos=t,this.mark=e}apply(r){let s=r.nodeAt(this.pos);if(!s)return p.fail("No node at mark step's position");let o=s.type.create(s.attrs,null,this.mark.removeFromSet(s.marks));return p.fromReplace(r,this.pos,this.pos+1,new t(e.from(o),0,s.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new f(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new c(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new c(e.pos,t.markFromJSON(e.mark))}}h.jsonID("removeNodeMark",c);class d extends h{constructor(t,e,r,s=!1){super(),this.from=t,this.to=e,this.slice=r,this.structure=s}apply(t){return this.structure&&k(t,this.from,this.to)?p.fail("Structure replace would overwrite content"):p.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new n([this.from,this.to-this.from,this.slice.size])}invert(t){return new d(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deletedAcross&&r.deletedAcross?null:new d(e.pos,Math.max(e.pos,r.pos),this.slice)}merge(e){if(!(e instanceof d)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let r=this.slice.size+e.slice.size==0?t.empty:new t(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new d(e.from,this.to,r,this.structure)}}{let r=this.slice.size+e.slice.size==0?t.empty:new t(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new d(this.from,this.to+(e.to-e.from),r,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(e,r){if("number"!=typeof r.from||"number"!=typeof r.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new d(r.from,r.to,t.fromJSON(e,r.slice),!!r.structure)}}h.jsonID("replace",d);class g extends h{constructor(t,e,r,s,o,i,n=!1){super(),this.from=t,this.to=e,this.gapFrom=r,this.gapTo=s,this.slice=o,this.insert=i,this.structure=n}apply(t){if(this.structure&&(k(t,this.from,this.gapFrom)||k(t,this.gapTo,this.to)))return p.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return p.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,e.content);return r?p.fromReplace(t,this.from,this.to,r):p.fail("Content does not fit in gap")}getMap(){return new n([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new g(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),s=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||s<e.pos||o>r.pos?null:new g(e.pos,r.pos,s,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(e,r){if("number"!=typeof r.from||"number"!=typeof r.to||"number"!=typeof r.gapFrom||"number"!=typeof r.gapTo||"number"!=typeof r.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new g(r.from,r.to,r.gapFrom,r.gapTo,t.fromJSON(e,r.slice),r.insert,!!r.structure)}}function k(t,e,r){let s=t.resolve(e),o=r-e,i=s.depth;for(;o>0&&i>0&&s.indexAfter(i)==s.node(i).childCount;)i--,o--;if(o>0){let t=s.node(i).maybeChild(s.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}h.jsonID("replaceAround",g);class w extends h{constructor(t,e,r){super(),this.pos=t,this.attr=e,this.value=r}apply(r){let s=r.nodeAt(this.pos);if(!s)return p.fail("No node at attribute step's position");let o=Object.create(null);for(let t in s.attrs)o[t]=s.attrs[t];o[this.attr]=this.value;let i=s.type.create(o,null,s.marks);return p.fromReplace(r,this.pos,this.pos+1,new t(e.from(i),0,s.isLeaf?0:1))}getMap(){return n.empty}invert(t){return new w(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new w(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new w(e.pos,e.attr,e.value)}}h.jsonID("attr",w);class S extends h{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let r in t.attrs)e[r]=t.attrs[r];e[this.attr]=this.value;let r=t.type.create(e,t.content,t.marks);return p.ok(r)}getMap(){return n.empty}invert(t){return new S(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new S(e.attr,e.value)}}h.jsonID("docAttr",S);let y=class extends Error{};y=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r},(y.prototype=Object.create(Error.prototype)).constructor=y,y.prototype.name="TransformError";export{m as AddMarkStep,f as AddNodeMarkStep,w as AttrStep,S as DocAttrStep,i as MapResult,u as RemoveMarkStep,c as RemoveNodeMarkStep,g as ReplaceAroundStep,d as ReplaceStep,h as Step,n as StepMap,p as StepResult,y as TransformError};
|
|
1
|
+
import{Slice as t,ReplaceError as e,Fragment as r}from"../../prosemirror-model/dist/index.js";const s=Math.pow(2,16);function o(t){return 65535&t}class i{constructor(t,e,r){this.pos=t,this.delInfo=e,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class n{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&n.empty)return n.empty}recover(t){let e=0,r=o(t);if(!this.inverted)for(let t=0;t<r;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*r]+e+function(t){return(t-(65535&t))/s}(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,r){let o=0,n=this.inverted?2:1,a=this.inverted?1:2;for(let h=0;h<this.ranges.length;h+=3){let p=this.ranges[h]-(this.inverted?o:0);if(p>t)break;let l=this.ranges[h+n],m=this.ranges[h+a],u=p+l;if(t<=u){let n=p+o+((l?t==p?-1:t==u?1:e:e)<0?0:m);if(r)return n;let a=t==(e<0?p:u)?null:h/3+(t-p)*s,f=t==p?2:t==u?1:4;return(e<0?t!=p:t!=u)&&(f|=8),new i(n,f,a)}o+=m-l}return r?t+o:new i(t+o,0,null)}touches(t,e){let r=0,s=o(e),i=this.inverted?2:1,n=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let o=this.ranges[e]-(this.inverted?r:0);if(o>t)break;let a=this.ranges[e+i];if(t<=o+a&&e==3*s)return!0;r+=this.ranges[e+n]-a}return!1}forEach(t){let e=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,o=0;s<this.ranges.length;s+=3){let i=this.ranges[s],n=i-(this.inverted?o:0),a=i+(this.inverted?0:o),h=this.ranges[s+e],p=this.ranges[s+r];t(n,n+h,a,a+p),o+=p-h}}invert(){return new n(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?n.empty:new n(t<0?[0,-t,0]:[0,0,t])}}n.empty=new n([]);const a=Object.create(null);class h{getMap(){return n.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=a[e.stepType];if(!r)throw new RangeError(`No step type ${e.stepType} defined`);return r.fromJSON(t,e)}static jsonID(t,e){if(t in a)throw new RangeError("Duplicate use of step JSON ID "+t);return a[t]=e,e.prototype.jsonID=t,e}}class p{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new p(t,null)}static fail(t){return new p(null,t)}static fromReplace(t,r,s,o){try{return p.ok(t.replace(r,s,o))}catch(t){if(t instanceof e)return p.fail(t.message);throw t}}}function l(t,e,s){let o=[];for(let r=0;r<t.childCount;r++){let i=t.child(r);i.content.size&&(i=i.copy(l(i.content,e,i))),i.isInline&&(i=e(i,s,r)),o.push(i)}return r.fromArray(o)}class m extends h{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(e){let r=e.slice(this.from,this.to),s=e.resolve(this.from),o=s.node(s.sharedDepth(this.to)),i=new t(l(r.content,((t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),o),r.openStart,r.openEnd);return p.fromReplace(e,this.from,this.to,i)}invert(){return new u(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new m(e.pos,r.pos,this.mark)}merge(t){return t instanceof m&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new m(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new m(e.from,e.to,t.markFromJSON(e.mark))}}h.jsonID("addMark",m);class u extends h{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(e){let r=e.slice(this.from,this.to),s=new t(l(r.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),e),r.openStart,r.openEnd);return p.fromReplace(e,this.from,this.to,s)}invert(){return new m(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new u(e.pos,r.pos,this.mark)}merge(t){return t instanceof u&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new u(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new u(e.from,e.to,t.markFromJSON(e.mark))}}h.jsonID("removeMark",u);class f extends h{constructor(t,e){super(),this.pos=t,this.mark=e}apply(e){let s=e.nodeAt(this.pos);if(!s)return p.fail("No node at mark step's position");let o=s.type.create(s.attrs,null,this.mark.addToSet(s.marks));return p.fromReplace(e,this.pos,this.pos+1,new t(r.from(o),0,s.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let r=0;r<e.marks.length;r++)if(!e.marks[r].isInSet(t))return new f(this.pos,e.marks[r]);return new f(this.pos,this.mark)}}return new c(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new f(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new f(e.pos,t.markFromJSON(e.mark))}}h.jsonID("addNodeMark",f);class c extends h{constructor(t,e){super(),this.pos=t,this.mark=e}apply(e){let s=e.nodeAt(this.pos);if(!s)return p.fail("No node at mark step's position");let o=s.type.create(s.attrs,null,this.mark.removeFromSet(s.marks));return p.fromReplace(e,this.pos,this.pos+1,new t(r.from(o),0,s.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new f(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new c(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new c(e.pos,t.markFromJSON(e.mark))}}h.jsonID("removeNodeMark",c);class d extends h{constructor(t,e,r,s=!1){super(),this.from=t,this.to=e,this.slice=r,this.structure=s}apply(t){return this.structure&&k(t,this.from,this.to)?p.fail("Structure replace would overwrite content"):p.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new n([this.from,this.to-this.from,this.slice.size])}invert(t){return new d(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deletedAcross&&r.deletedAcross?null:new d(e.pos,Math.max(e.pos,r.pos),this.slice)}merge(e){if(!(e instanceof d)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let r=this.slice.size+e.slice.size==0?t.empty:new t(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new d(e.from,this.to,r,this.structure)}}{let r=this.slice.size+e.slice.size==0?t.empty:new t(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new d(this.from,this.to+(e.to-e.from),r,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(e,r){if("number"!=typeof r.from||"number"!=typeof r.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new d(r.from,r.to,t.fromJSON(e,r.slice),!!r.structure)}}h.jsonID("replace",d);class g extends h{constructor(t,e,r,s,o,i,n=!1){super(),this.from=t,this.to=e,this.gapFrom=r,this.gapTo=s,this.slice=o,this.insert=i,this.structure=n}apply(t){if(this.structure&&(k(t,this.from,this.gapFrom)||k(t,this.gapTo,this.to)))return p.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return p.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,e.content);return r?p.fromReplace(t,this.from,this.to,r):p.fail("Content does not fit in gap")}getMap(){return new n([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new g(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),s=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||s<e.pos||o>r.pos?null:new g(e.pos,r.pos,s,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(e,r){if("number"!=typeof r.from||"number"!=typeof r.to||"number"!=typeof r.gapFrom||"number"!=typeof r.gapTo||"number"!=typeof r.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new g(r.from,r.to,r.gapFrom,r.gapTo,t.fromJSON(e,r.slice),r.insert,!!r.structure)}}function k(t,e,r){let s=t.resolve(e),o=r-e,i=s.depth;for(;o>0&&i>0&&s.indexAfter(i)==s.node(i).childCount;)i--,o--;if(o>0){let t=s.node(i).maybeChild(s.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}h.jsonID("replaceAround",g);class w extends h{constructor(t,e,r){super(),this.pos=t,this.attr=e,this.value=r}apply(e){let s=e.nodeAt(this.pos);if(!s)return p.fail("No node at attribute step's position");let o=Object.create(null);for(let t in s.attrs)o[t]=s.attrs[t];o[this.attr]=this.value;let i=s.type.create(o,null,s.marks);return p.fromReplace(e,this.pos,this.pos+1,new t(r.from(i),0,s.isLeaf?0:1))}getMap(){return n.empty}invert(t){return new w(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new w(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new w(e.pos,e.attr,e.value)}}h.jsonID("attr",w);class S extends h{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let r in t.attrs)e[r]=t.attrs[r];e[this.attr]=this.value;let r=t.type.create(e,t.content,t.marks);return p.ok(r)}getMap(){return n.empty}invert(t){return new S(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new S(e.attr,e.value)}}h.jsonID("docAttr",S);let y=class extends Error{};y=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r},(y.prototype=Object.create(Error.prototype)).constructor=y,y.prototype.name="TransformError";export{m as AddMarkStep,f as AddNodeMarkStep,w as AttrStep,S as DocAttrStep,i as MapResult,u as RemoveMarkStep,c as RemoveNodeMarkStep,g as ReplaceAroundStep,d as ReplaceStep,h as Step,n as StepMap,p as StepResult,y as TransformError};
|