@equinor/amplify-component-lib 9.13.0 → 9.14.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atoms/hooks/index.d.ts +0 -1
- package/dist/atoms/hooks/useAmplifyKit.js +1 -1
- package/dist/atoms/hooks/useDebounce.js +1 -1
- package/dist/atoms/hooks/useFakeProgress.js +1 -1
- package/dist/atoms/hooks/useFaqsInApplication.js +1 -1
- package/dist/atoms/hooks/useLocalStorage.js +1 -1
- package/dist/atoms/hooks/useOnScreenMultiple.js +1 -1
- package/dist/atoms/hooks/usePrefetchRichTextImages.js +1 -1
- package/dist/atoms/hooks/usePrevious.js +1 -1
- package/dist/atoms/hooks/useSelect.js +1 -1
- package/dist/atoms/index.js +1 -1
- package/dist/atoms/style/colors.d.ts +6 -0
- package/dist/atoms/style/colors.js +1 -1
- package/dist/atoms/style/darkTokens.js +3 -0
- package/dist/atoms/style/lightTokens.js +2 -0
- package/dist/atoms/style/spacingTokens.js +10 -0
- package/dist/atoms/utils/auth_environment.js +1 -1
- package/dist/atoms/utils/export.js +1 -1
- package/dist/atoms/utils/richtext.js +1 -1
- package/dist/atoms/utils/skeleton.d.ts +9 -0
- package/dist/atoms/utils/skeleton.js +1 -0
- package/dist/atoms/utils/string.js +1 -1
- package/dist/atoms/utils/tutorials.js +1 -1
- package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.js +1 -1
- package/dist/deprecated/IconToggleButton.js +1 -1
- package/dist/deprecated/OldStepper/OldStep.js +1 -1
- package/dist/deprecated/OldStepper/OldStepLine.js +1 -1
- package/dist/deprecated/OldStepper/OldStepper.js +1 -1
- package/dist/index.js +1 -1
- package/dist/molecules/ApplicationIcon/ApplicationIcon.d.ts +1 -1
- package/dist/molecules/ApplicationIcon/ApplicationIcon.js +1 -1
- package/dist/molecules/ApplicationIcon/ApplicationIconBase.js +1 -1
- package/dist/molecules/ApplicationIcon/ApplicationIconCollection.d.ts +1 -0
- package/dist/molecules/ApplicationIcon/ApplicationIconCollection.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/Acquire.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/Adca.d.ts +2 -0
- package/dist/molecules/ApplicationIcon/Icons/Adca.js +1 -0
- package/dist/molecules/ApplicationIcon/Icons/Bravos.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/Dasha.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/Fallback.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/FourDInsight.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/InPress.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/JsEmbark.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/LoggingQualification.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/Orca.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/Premo.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/Pwex.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/Recap.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/Sam.js +1 -1
- package/dist/molecules/ApplicationIcon/Icons/SubsurfacePortal.js +1 -1
- package/dist/molecules/Badge/Badge.js +1 -1
- package/dist/molecules/Button/Button.js +3 -3
- package/dist/molecules/Chip/Chip.js +1 -1
- package/dist/molecules/Chip/InteractiveChip.js +1 -1
- package/dist/molecules/Chip/ReadOnlyChip.js +1 -1
- package/dist/molecules/ContentMenu/ContentMenu.js +1 -1
- package/dist/molecules/DatePicker/DatePicker.d.ts +10 -3
- package/dist/molecules/DatePicker/DatePicker.js +1 -1
- package/dist/molecules/DatePicker/DatePicker.styles.d.ts +7 -1
- package/dist/molecules/DatePicker/DatePicker.styles.js +50 -7
- package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +12 -0
- package/dist/molecules/DateRangePicker/DateRangePicker.js +1 -0
- package/dist/molecules/Dialog/Dialog.js +1 -1
- package/dist/molecules/Dialog/DialogAction.js +1 -1
- package/dist/molecules/EquinorLogo/EquinorLogo.js +1 -1
- package/dist/molecules/FeedBackIcon/FeedBackIcon.js +1 -1
- package/dist/molecules/FileProgress/CompactFileProgress.js +1 -1
- package/dist/molecules/FileProgress/CompactFileProgress.styles.d.ts +2 -2
- package/dist/molecules/FileProgress/FileProgress.js +1 -1
- package/dist/molecules/FileProgress/FileProgress.utils.js +1 -1
- package/dist/molecules/FileProgress/RegularFileProgress.js +1 -1
- package/dist/molecules/FileUploadArea/FileUploadArea.constants.d.ts +1 -0
- package/dist/molecules/FileUploadArea/FileUploadArea.constants.js +1 -0
- package/dist/molecules/FileUploadArea/FileUploadArea.d.ts +1 -1
- package/dist/molecules/FileUploadArea/FileUploadArea.js +1 -67
- package/dist/molecules/FileUploadArea/FileUploadArea.styles.d.ts +4 -0
- package/dist/molecules/FileUploadArea/FileUploadArea.styles.js +88 -0
- package/dist/molecules/FullPageSpinner/FullPageSpinner.js +1 -1
- package/dist/molecules/InfoElement/CopyText.js +1 -1
- package/dist/molecules/InfoElement/InfoElement.js +1 -1
- package/dist/molecules/ListItem/ListItem.js +3 -3
- package/dist/molecules/ListItem/ListItem.utils.js +1 -1
- package/dist/molecules/OptionDrawer/OptionDrawer.js +1 -1
- package/dist/molecules/OptionDrawer/OptionDrawer.utils.js +1 -1
- package/dist/molecules/OptionalTooltip/OptionalTooltip.js +1 -1
- package/dist/molecules/ProfileAvatar/ProfileAvatar.js +1 -1
- package/dist/molecules/RichTextDisplay/RichTextDisplay.js +1 -1
- package/dist/molecules/RichTextEditor/EditorProvider.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/AddImageButton.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/MenuBar.d.ts +2 -2
- package/dist/molecules/RichTextEditor/MenuBar/MenuBar.js +5 -5
- package/dist/molecules/RichTextEditor/MenuBar/MenuBar.styles.js +14 -8
- package/dist/molecules/RichTextEditor/MenuBar/MenuButton.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/Table/Table.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextAlignment.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextClearFormatting.js +2 -2
- package/dist/molecules/RichTextEditor/MenuBar/TextCode.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextColor.js +14 -14
- package/dist/molecules/RichTextEditor/MenuBar/TextFormatting.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextHeaders.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextHighlight.d.ts +3 -0
- package/dist/molecules/RichTextEditor/MenuBar/TextHighlight.js +1 -0
- package/dist/molecules/RichTextEditor/MenuBar/TextHistory.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextLinks.js +2 -2
- package/dist/molecules/RichTextEditor/MenuBar/TextLists.js +1 -1
- package/dist/molecules/RichTextEditor/RichTextEditor.styles.d.ts +1 -1
- package/dist/molecules/RichTextEditor/RichTextEditor.types.d.ts +2 -1
- package/dist/molecules/RichTextEditor/RichTextEditor.types.js +1 -1
- package/dist/molecules/RichTextEditor/custom-extensions/AmplifyKit.js +1 -1
- package/dist/molecules/RichTextEditor/custom-extensions/ExtendedHeaders.js +1 -1
- package/dist/molecules/RichTextEditor/custom-extensions/ExtendedImage.js +1 -1
- package/dist/molecules/RichTextEditor/index.d.ts +1 -1
- package/dist/molecules/Search/Search.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.styles.d.ts +6 -5
- package/dist/molecules/Select/Select.styles.js +19 -22
- package/dist/molecules/Select/Select.utils.js +1 -1
- package/dist/molecules/Select/SelectMenuItem.js +1 -1
- package/dist/molecules/Select/SelectMenuItem.utils.js +1 -1
- package/dist/molecules/SelectionControls/Checkbox/Checkbox.js +1 -1
- package/dist/molecules/SelectionControls/Radio/Radio.js +1 -1
- package/dist/molecules/SelectionControls/Switch/Switch.js +1 -1
- package/dist/molecules/Sieve/Filter.js +1 -1
- package/dist/molecules/Sieve/Sieve.js +1 -1
- package/dist/molecules/Sieve/Sieve.types.d.ts +0 -2
- package/dist/molecules/Sieve/Sort.js +1 -1
- package/dist/molecules/SingleFilterMenu/SingleFilterMenu.js +1 -1
- package/dist/molecules/Skeleton/SkeletonField.d.ts +1 -0
- package/dist/molecules/Skeleton/SkeletonField.js +8 -0
- package/dist/molecules/Stepper/Step/Step.js +1 -1
- package/dist/molecules/Stepper/StepLine.js +1 -1
- package/dist/molecules/Stepper/Stepper.js +1 -1
- package/dist/molecules/Stepper/SubTitle/SubStepIndicator.js +1 -1
- package/dist/molecules/Stepper/SubTitle/SubTitle.js +3 -3
- package/dist/molecules/Tabs/Tabs.js +1 -1
- package/dist/molecules/TextField/TextField.d.ts +1 -0
- package/dist/molecules/TextField/TextField.js +23 -17
- package/dist/molecules/Waves/Waves.js +1 -1
- package/dist/molecules/index.d.ts +4 -2
- package/dist/node_modules/@equinor/eds-utils/dist/esm/hooks/useOutsideClick.js +1 -1
- package/dist/node_modules/lodash/lodash.js +1 -1
- package/dist/node_modules/prosemirror-model/dist/index.js +1 -1
- package/dist/node_modules/prosemirror-state/dist/index.js +1 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +1 -1
- package/dist/organisms/Faq/Category/Category.js +3 -3
- package/dist/organisms/Faq/Category/Question.js +2 -2
- package/dist/organisms/Faq/CategorySkeleton.js +1 -1
- package/dist/organisms/Faq/Faq.js +1 -1
- package/dist/organisms/Faq/Header.js +2 -2
- package/dist/organisms/FieldSelector/ChangingField.js +7 -7
- package/dist/organisms/FieldSelector/SelectorCard/SelectorCard.js +2 -2
- package/dist/organisms/Filter/AutoCompleteMenu.d.ts +11 -0
- package/dist/organisms/Filter/AutoCompleteMenu.js +10 -0
- package/dist/organisms/Filter/AutoCompleteText.d.ts +10 -0
- package/dist/organisms/Filter/AutoCompleteText.js +11 -0
- package/dist/organisms/Filter/Filter.d.ts +1 -1
- package/dist/organisms/Filter/Filter.js +1 -1
- package/dist/organisms/Filter/Filter.styles.d.ts +1 -0
- package/dist/organisms/Filter/Filter.styles.js +9 -5
- package/dist/organisms/Filter/Filter.types.d.ts +5 -1
- package/dist/organisms/Filter/Filter.utils.d.ts +11 -0
- package/dist/organisms/Filter/Filter.utils.js +1 -0
- package/dist/organisms/Filter/QuickFilter.js +1 -1
- package/dist/organisms/Filter/SortMenu.js +2 -2
- package/dist/organisms/PageTitle/PageTitle.js +1 -1
- package/dist/organisms/ReleaseNote/MetaTags.js +1 -1
- package/dist/organisms/ReleaseNote/ReleaseNote.js +9 -9
- package/dist/organisms/ReleaseNote/ToggleExpanded.js +6 -6
- package/dist/organisms/SideBar/CreateItem.styles.js +1 -1
- package/dist/organisms/SideBar/MenuItem/BasicMenuItem.js +1 -1
- package/dist/organisms/SideBar/MenuItem/CollapsableMenuItem.js +6 -6
- package/dist/organisms/SideBar/MenuItem/MenuItem.styles.d.ts +295 -2
- package/dist/organisms/SideBar/MenuItem/MenuItem.styles.js +2 -2
- package/dist/organisms/SideBar/SideBar.js +1 -1
- package/dist/organisms/Status/Action.js +1 -1
- package/dist/organisms/Status/Description.js +1 -1
- package/dist/organisms/Status/Illustration.constants.js +1 -1
- package/dist/organisms/Status/Illustration.js +1 -1
- package/dist/organisms/Status/MissingAccesses.js +1 -1
- package/dist/organisms/Status/Title.js +1 -1
- package/dist/organisms/Status/collections/BadRequest.js +1 -1
- package/dist/organisms/Status/collections/GenericError.js +1 -1
- package/dist/organisms/Status/collections/MissingAccessToApp.js +1 -1
- package/dist/organisms/Status/collections/MissingPermissions.js +1 -1
- package/dist/organisms/Status/collections/PageNotFound.js +1 -1
- package/dist/organisms/Status/collections/ServerError.js +1 -1
- package/dist/organisms/TableOfContents/TableOfContents.js +1 -1
- package/dist/organisms/TableOfContents/TableOfContents.styles.d.ts +294 -1
- package/dist/organisms/TableOfContents/TableOfContents.styles.js +2 -2
- package/dist/organisms/TableOfContents/TableOfContentsItem.js +1 -1
- package/dist/organisms/ToggleGroup/ToggleGroup.js +2 -2
- package/dist/organisms/ToggleGroup/ToggleGroupOption.js +1 -1
- package/dist/organisms/TopBar/Account/Account.js +1 -1
- package/dist/organisms/TopBar/Account/AccountAvatar.js +1 -1
- package/dist/organisms/TopBar/Account/AccountButton.js +3 -3
- package/dist/organisms/TopBar/Account/ActiveUserImpersonationButton.js +2 -2
- package/dist/organisms/TopBar/Account/ImpersonateAvatar.js +2 -2
- package/dist/organisms/TopBar/Account/ImpersonateButton.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/CreateOrEditUser/CreateOrEditUser.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.constants.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/Impersonate.styles.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/ImpersonateMenu.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/ImpersonateMenu.styles.d.ts +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/ImpersonateMenu.styles.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/UserImpersonation.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/UserImpersonation.styles.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/hooks/useCreateImpersonation.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/hooks/useDeleteImpersonation.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/hooks/useEditImpersonation.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/hooks/useMappedRoles.js +1 -1
- package/dist/organisms/TopBar/Actions.js +1 -1
- package/dist/organisms/TopBar/ApplicationDrawer/ApplicationDrawer.js +1 -1
- package/dist/organisms/TopBar/FieldMenu/FieldMenu.js +1 -1
- package/dist/organisms/TopBar/FieldMenu/FieldMenu.styles.d.ts +1 -1
- package/dist/organisms/TopBar/FieldMenu/FieldMenu.styles.js +1 -1
- package/dist/organisms/TopBar/Guidelines/Guidelines.js +1 -1
- package/dist/organisms/TopBar/Guidelines/Item.js +2 -2
- package/dist/organisms/TopBar/Guidelines/Section.js +1 -1
- package/dist/organisms/TopBar/Notifications/FilterOptions.js +1 -1
- package/dist/organisms/TopBar/Notifications/NotificationsInner.js +1 -1
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/DefaultNotification.js +1 -1
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/NoNotifications.js +1 -1
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationTemplate.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/Feedback.styles.d.ts +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/Feedback.styles.js +4 -4
- package/dist/organisms/TopBar/Resources/Feedback/Feedback.utils.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/Description.js +2 -2
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/FeedbackForm.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/LockedInputTooltip.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/Severity.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/UploadFile/ImageFile.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/UploadFile/UploadFile.js +2 -2
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/UploadFile/UploadFile.styles.d.ts +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/AnimateChangeInHeight.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/FullSlackResponse.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/RequestStatus.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/ResponsePage.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/ResponsePage.styles.d.ts +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/ResponsePage.styles.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/Success.js +3 -3
- package/dist/organisms/TopBar/Resources/Feedback/providers/FeedbackContextProvider.js +1 -1
- package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesDialog.js +1 -1
- package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesDialog.utils.js +1 -1
- package/dist/organisms/TopBar/Resources/ResourceMenuItem.js +1 -1
- package/dist/organisms/TopBar/Resources/Resources.js +1 -1
- package/dist/organisms/TopBar/Settings.js +1 -1
- package/dist/organisms/TopBar/TopBar.js +1 -1
- package/dist/organisms/TopBar/TopBar.styles.d.ts +295 -2
- package/dist/organisms/TopBar/TopBar.styles.js +6 -6
- package/dist/organisms/TopBar/TopBarMenu.js +1 -1
- package/dist/organisms/TopBar/TransferToAppDialog.js +1 -1
- package/dist/organisms/TopBar/Tutorials/Tutorials.js +1 -1
- package/dist/providers/AuthProvider/AuthProvider.js +1 -1
- package/dist/providers/AuthProvider/AuthProviderInner.js +1 -1
- package/dist/providers/LoadingProvider.js +1 -1
- package/dist/providers/ReleaseNotesProvider.js +1 -1
- package/dist/providers/ReleaseNotesProvider.utils.js +1 -1
- package/dist/providers/SnackbarProvider/SnackbarProvider.js +1 -1
- 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/TutorialHighlightingProviderInner.js +1 -1
- package/dist/providers/TutorialHighlightingProvider/TutorialPopover/StepIndicator.js +8 -8
- package/dist/providers/TutorialHighlightingProvider/TutorialPopover/TutorialPopover.js +3 -3
- package/dist/providers/TutorialHighlightingProvider/TutorialPopover/hooks/useTutorialPopoverPosition.js +1 -1
- package/dist/providers/TutorialHighlightingProvider/hooks/useReversedScrollY.js +1 -1
- package/package.json +5 -9
- package/dist/atoms/hooks/useSearchParameter.d.ts +0 -5
- package/dist/atoms/hooks/useSearchParameter.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Slice as e,Fragment as t}from"../../prosemirror-model/dist/index.js";import{ReplaceStep as n,ReplaceAroundStep as r}from"../../prosemirror-transform/dist/index.js";const o=Object.create(null);class s{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new i(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=e.empty){let r=n.content.lastChild,o=null;for(let e=0;e<n.openEnd;e++)o=r,r=r.lastChild;let s=t.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:l,$to:c}=i[a],h=t.mapping.slice(s);t.replaceRange(h.map(l.pos),h.map(c.pos),a?e.empty:n),0==a&&g(t,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:s,$to:i}=r[o],a=e.mapping.slice(n),l=a.map(s.pos),c=a.map(i.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),g(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new c(e):m(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?m(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):m(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new d(e.node(0))}static atStart(e){return m(e,e,0,0,1)||new d(e)}static atEnd(e){return m(e,e,e.content.size,e.childCount,-1)||new d(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=o[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in o)throw new RangeError("Duplicate use of selection JSON ID "+e);return o[e]=t,t.prototype.jsonID=e,t}getBookmark(){return c.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class i{constructor(e,t){this.$from=e,this.$to=t}}let a=!1;function l(e){a||e.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class c extends s{constructor(e,t=e){l(e),l(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=e.resolve(t.map(this.anchor));return new c(r.parent.inlineContent?r:n,n)}replace(t,n=e.empty){if(super.replace(t,n),n==e.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(e){return e instanceof c&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new h(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new c(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=s.findFrom(t,n,!0)||s.findFrom(t,-n,!0);if(!e)return s.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(s.findFrom(e,-n,!0)||s.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new c(e,t)}}s.jsonID("text",c);class h{constructor(e,t){this.anchor=e,this.head=t}map(e){return new h(e.map(this.anchor),e.map(this.head))}resolve(e){return c.between(e.resolve(this.anchor),e.resolve(this.head))}}class p extends s{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?s.near(o):new p(o)}content(){return new e(t.from(this.node),0,0)}eq(e){return e instanceof p&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new u(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new p(e.resolve(t.anchor))}static create(e,t){return new p(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}p.prototype.visible=!1,s.jsonID("node",p);class u{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new h(n,n):new u(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&p.isSelectable(n)?new p(t):s.near(t)}}class d extends s{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(t,n=e.empty){if(n==e.empty){t.delete(0,t.doc.content.size);let e=s.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new d(e)}map(e){return new d(e)}eq(e){return e instanceof d}getBookmark(){return f}}s.jsonID("all",d);const f={map(){return this},resolve:e=>new d(e)};function m(e,t,n,r,o,s=!1){if(t.inlineContent)return c.create(e,n);for(let i=r-(o>0?0:1);o>0?i<t.childCount:i>=0;i+=o){let r=t.child(i);if(r.isAtom){if(!s&&p.isSelectable(r))return p.create(e,n-(o<0?r.nodeSize:0))}else{let t=m(e,r,n+o,o<0?r.childCount:0,o,s);if(t)return t}n+=r.nodeSize*o}return null}function g(e,t,o){let i=e.steps.length-1;if(i<t)return;let a,l=e.steps[i];(l instanceof n||l instanceof r)&&(e.mapping.maps[i].forEach((
|
|
1
|
+
import{Slice as e,Fragment as t}from"../../prosemirror-model/dist/index.js";import{ReplaceStep as n,ReplaceAroundStep as r}from"../../prosemirror-transform/dist/index.js";const o=Object.create(null);class s{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new i(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=e.empty){let r=n.content.lastChild,o=null;for(let e=0;e<n.openEnd;e++)o=r,r=r.lastChild;let s=t.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:l,$to:c}=i[a],h=t.mapping.slice(s);t.replaceRange(h.map(l.pos),h.map(c.pos),a?e.empty:n),0==a&&g(t,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:s,$to:i}=r[o],a=e.mapping.slice(n),l=a.map(s.pos),c=a.map(i.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),g(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new c(e):m(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?m(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):m(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new d(e.node(0))}static atStart(e){return m(e,e,0,0,1)||new d(e)}static atEnd(e){return m(e,e,e.content.size,e.childCount,-1)||new d(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=o[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in o)throw new RangeError("Duplicate use of selection JSON ID "+e);return o[e]=t,t.prototype.jsonID=e,t}getBookmark(){return c.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class i{constructor(e,t){this.$from=e,this.$to=t}}let a=!1;function l(e){a||e.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class c extends s{constructor(e,t=e){l(e),l(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=e.resolve(t.map(this.anchor));return new c(r.parent.inlineContent?r:n,n)}replace(t,n=e.empty){if(super.replace(t,n),n==e.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(e){return e instanceof c&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new h(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new c(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=s.findFrom(t,n,!0)||s.findFrom(t,-n,!0);if(!e)return s.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(s.findFrom(e,-n,!0)||s.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new c(e,t)}}s.jsonID("text",c);class h{constructor(e,t){this.anchor=e,this.head=t}map(e){return new h(e.map(this.anchor),e.map(this.head))}resolve(e){return c.between(e.resolve(this.anchor),e.resolve(this.head))}}class p extends s{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?s.near(o):new p(o)}content(){return new e(t.from(this.node),0,0)}eq(e){return e instanceof p&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new u(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new p(e.resolve(t.anchor))}static create(e,t){return new p(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}p.prototype.visible=!1,s.jsonID("node",p);class u{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new h(n,n):new u(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&p.isSelectable(n)?new p(t):s.near(t)}}class d extends s{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(t,n=e.empty){if(n==e.empty){t.delete(0,t.doc.content.size);let e=s.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new d(e)}map(e){return new d(e)}eq(e){return e instanceof d}getBookmark(){return f}}s.jsonID("all",d);const f={map(){return this},resolve:e=>new d(e)};function m(e,t,n,r,o,s=!1){if(t.inlineContent)return c.create(e,n);for(let i=r-(o>0?0:1);o>0?i<t.childCount:i>=0;i+=o){let r=t.child(i);if(r.isAtom){if(!s&&p.isSelectable(r))return p.create(e,n-(o<0?r.nodeSize:0))}else{let t=m(e,r,n+o,o<0?r.childCount:0,o,s);if(t)return t}n+=r.nodeSize*o}return null}function g(e,t,o){let i=e.steps.length-1;if(i<t)return;let a,l=e.steps[i];(l instanceof n||l instanceof r)&&(e.mapping.maps[i].forEach((e,t,n,r)=>{null==a&&(a=r)}),e.setSelection(s.near(e.doc.resolve(a),o)))}function w(e,t){return t&&e?e.bind(t):e}class y{constructor(e,t,n){this.name=e,this.init=w(t.init,n),this.apply=w(t.apply,n)}}function $(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=$(o,t,{})),n[r]=o}return n}new y("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new y("selection",{init:(e,t)=>e.selection||s.atStart(t.doc),apply:e=>e.selection}),new y("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new y("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t});class S{constructor(e){this.spec=e,this.props={},e.props&&$(e.props,this,this.props),this.key=e.key?e.key.key:v("plugin")}getState(e){return e[this.key]}}const k=Object.create(null);function v(e){return e in k?e+"$"+ ++k[e]:(k[e]=0,e+"$")}class b{constructor(e="key"){this.key=v(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}export{d as AllSelection,p as NodeSelection,S as Plugin,b as PluginKey,s as Selection,i as SelectionRange,c as TextSelection};
|
|
@@ -1 +1 @@
|
|
|
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};
|
|
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,e){return t+e*s}function i(t){return 65535&t}class n{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 a{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&a.empty)return a.empty}recover(t){let e=0,r=i(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 s=0,i=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?s:0);if(p>t)break;let l=this.ranges[h+i],m=this.ranges[h+a],u=p+l;if(t<=u){let i=p+s+((l?t==p?-1:t==u?1:e:e)<0?0:m);if(r)return i;let a=t==(e<0?p:u)?null:o(h/3,t-p),f=t==p?2:t==u?1:4;return(e<0?t!=p:t!=u)&&(f|=8),new n(i,f,a)}s+=m-l}return r?t+s:new n(t+s,0,null)}touches(t,e){let r=0,s=i(e),o=this.inverted?2:1,n=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let i=this.ranges[e]-(this.inverted?r:0);if(i>t)break;let a=this.ranges[e+o];if(t<=i+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 a(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?a.empty:new a(t<0?[0,-t,0]:[0,0,t])}}a.empty=new a([]);const h=Object.create(null);class p{getMap(){return a.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=h[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 h)throw new RangeError("Duplicate use of step JSON ID "+t);return h[t]=e,e.prototype.jsonID=t,e}}class l{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new l(t,null)}static fail(t){return new l(null,t)}static fromReplace(t,r,s,o){try{return l.ok(t.replace(r,s,o))}catch(t){if(t instanceof e)return l.fail(t.message);throw t}}}function m(t,e,s){let o=[];for(let r=0;r<t.childCount;r++){let i=t.child(r);i.content.size&&(i=i.copy(m(i.content,e,i))),i.isInline&&(i=e(i,s,r)),o.push(i)}return r.fromArray(o)}class u extends p{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(m(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 l.fromReplace(e,this.from,this.to,i)}invert(){return new f(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:"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 u(e.from,e.to,t.markFromJSON(e.mark))}}p.jsonID("addMark",u);class f extends p{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(m(r.content,t=>t.mark(this.mark.removeFromSet(t.marks)),e),r.openStart,r.openEnd);return l.fromReplace(e,this.from,this.to,s)}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 f(e.pos,r.pos,this.mark)}merge(t){return t instanceof f&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new f(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 f(e.from,e.to,t.markFromJSON(e.mark))}}p.jsonID("removeMark",f);class c extends p{constructor(t,e){super(),this.pos=t,this.mark=e}apply(e){let s=e.nodeAt(this.pos);if(!s)return l.fail("No node at mark step's position");let o=s.type.create(s.attrs,null,this.mark.addToSet(s.marks));return l.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 c(this.pos,e.marks[r]);return new c(this.pos,this.mark)}}return new d(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new c(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 c(e.pos,t.markFromJSON(e.mark))}}p.jsonID("addNodeMark",c);class d extends p{constructor(t,e){super(),this.pos=t,this.mark=e}apply(e){let s=e.nodeAt(this.pos);if(!s)return l.fail("No node at mark step's position");let o=s.type.create(s.attrs,null,this.mark.removeFromSet(s.marks));return l.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 c(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new d(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 d(e.pos,t.markFromJSON(e.mark))}}p.jsonID("removeNodeMark",d);class g extends p{constructor(t,e,r,s=!1){super(),this.from=t,this.to=e,this.slice=r,this.structure=s}apply(t){return this.structure&&w(t,this.from,this.to)?l.fail("Structure replace would overwrite content"):l.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new a([this.from,this.to-this.from,this.slice.size])}invert(t){return new g(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 g(e.pos,Math.max(e.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof g)||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 g(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 g(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 g(r.from,r.to,t.fromJSON(e,r.slice),!!r.structure)}}p.jsonID("replace",g);class k extends p{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&&(w(t,this.from,this.gapFrom)||w(t,this.gapTo,this.to)))return l.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return l.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,e.content);return r?l.fromReplace(t,this.from,this.to,r):l.fail("Content does not fit in gap")}getMap(){return new a([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 k(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 k(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 k(r.from,r.to,r.gapFrom,r.gapTo,t.fromJSON(e,r.slice),r.insert,!!r.structure)}}function w(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}p.jsonID("replaceAround",k);class S extends p{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 l.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 l.fromReplace(e,this.pos,this.pos+1,new t(r.from(i),0,s.isLeaf?0:1))}getMap(){return a.empty}invert(t){return new S(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 S(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 S(e.pos,e.attr,e.value)}}p.jsonID("attr",S);class y extends p{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 l.ok(r)}getMap(){return a.empty}invert(t){return new y(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 y(e.attr,e.value)}}p.jsonID("docAttr",y);let v=class extends Error{};v=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r},(v.prototype=Object.create(Error.prototype)).constructor=v,v.prototype.name="TransformError";export{u as AddMarkStep,c as AddNodeMarkStep,S as AttrStep,y as DocAttrStep,n as MapResult,f as RemoveMarkStep,d as RemoveNodeMarkStep,k as ReplaceAroundStep,g as ReplaceStep,p as Step,a as StepMap,l as StepResult,v as TransformError};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useState as t,useMemo as r}from"react";import{Typography as s}from"@equinor/eds-core-react";import{Question as i}from"./Question.js";import"../../../atoms/style/colors.js";import{spacings as n}from"../../../atoms/style/spacings.js";import{Status as a}from"../../Status/index.js";import m from"styled-components";const d=m.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
|
-
gap: ${
|
|
4
|
+
gap: ${n.medium};
|
|
5
5
|
width: 100%;
|
|
6
6
|
&:has(> div > div > svg) {
|
|
7
7
|
transform: translateY(50%);
|
|
8
8
|
}
|
|
9
|
-
`,
|
|
9
|
+
`,c=({categoryName:n,faqs:m})=>{const[c]=t(void 0),[l]=t(void 0),u=r(()=>m.toSorted((e,o)=>(e.orderBy??0)-(o.orderBy??0)),[m]),p=r(()=>c?u.filter(e=>e.question.toLowerCase().includes(c.toLowerCase())||e.answer.toLowerCase().includes(c.toLowerCase())||n.toLowerCase().includes(c.toLowerCase())):u,[n,c,u]);return void 0!==l&&0===p.length?e(d,{children:o(a,{center:!1,children:[e(a.Title,{title:"No Questions Found"}),e(a.Description,{text:"No questions or answers matches your search in this category"})]})}):0===p.length?null:o(d,{children:[e(s,{variant:"h4",children:n}),p.map(o=>e(i,{...o},o.id))]})};export{c as Category};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t}from"react";import{Typography as r,Icon as i}from"@equinor/eds-core-react";import{chevron_up as s,chevron_down as l}from"@equinor/eds-icons";import{FaqService as m}from"@equinor/subsurface-app-management";import{shape as a}from"../../../atoms/style/index.js";import{formatDate as n}from"../../../atoms/utils/date.js";import"../../../molecules/AnimatedCheckmark/AnimatedCheckmark.styles.js";import"../../../molecules/ApplicationIcon/ApplicationIcon.js";import"../../../molecules/Badge/Badge.styles.js";import"../../../molecules/Banner/Banner.styles.js";import{Button as c}from"../../../molecules/Button/Button.js";import"../../../molecules/Chip/Chip.js";import"../../../molecules/ContentMenu/ContentMenu.styles.js";import"../../../molecules/DatePicker/DatePicker.js";import"../../../molecules/Dialog/Dialog.js";import"../../../molecules/EquinorLogo/EquinorLogo.js";import"../../../molecules/FileProgress/CompactFileProgress.styles.js";import"../../../atoms/utils/auth_environment.js";import"html2canvas";import"proj4";import"../../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../../molecules/FileProgress/RegularFileProgress.styles.js";import"../../../molecules/FileUploadArea/FileUploadArea.js";import"../../../molecules/FullPageSpinner/FullPageSpinner.js";import"../../../molecules/InfoElement/InfoElement.js";import"../../../molecules/OptionalTooltip/OptionalTooltip.js";import"../../../molecules/ProfileAvatar/ProfileAvatar.js";import{RichTextDisplay as p}from"../../../molecules/RichTextDisplay/RichTextDisplay.js";import"../../../molecules/RichTextEditor/MenuBar/MenuBar.js";import"@tanstack/react-query";import"@tiptap/react";import"../../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../../molecules/RichTextEditor/RichTextEditor.styles.js";import{colors as u}from"../../../atoms/style/colors.js";import"../../../molecules/Tabs/Tabs.js";import"../../../molecules/RichTextEditor/MenuBar/MenuBar.styles.js";import"../../../molecules/RichTextEditor/MenuBar/MenuButton.js";import"../../../molecules/Search/Search.js";import"
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t}from"react";import{Typography as r,Icon as i}from"@equinor/eds-core-react";import{chevron_up as s,chevron_down as l}from"@equinor/eds-icons";import{FaqService as m}from"@equinor/subsurface-app-management";import{shape as a}from"../../../atoms/style/index.js";import{formatDate as n}from"../../../atoms/utils/date.js";import"../../../molecules/AnimatedCheckmark/AnimatedCheckmark.styles.js";import"../../../molecules/ApplicationIcon/ApplicationIcon.js";import"../../../molecules/Badge/Badge.styles.js";import"../../../molecules/Banner/Banner.styles.js";import{Button as c}from"../../../molecules/Button/Button.js";import"../../../molecules/Chip/Chip.js";import"../../../molecules/ContentMenu/ContentMenu.styles.js";import"../../../molecules/DatePicker/DatePicker.js";import"../../../molecules/DateRangePicker/DateRangePicker.js";import"../../../molecules/Dialog/Dialog.js";import"../../../molecules/EquinorLogo/EquinorLogo.js";import"../../../molecules/FileProgress/CompactFileProgress.styles.js";import"../../../atoms/utils/auth_environment.js";import"html2canvas";import"proj4";import"../../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../../molecules/FileProgress/RegularFileProgress.styles.js";import"react-dropzone";import"../../../molecules/FileUploadArea/FileUploadArea.styles.js";import"../../../molecules/FullPageSpinner/FullPageSpinner.js";import"../../../molecules/InfoElement/InfoElement.js";import"../../../molecules/OptionalTooltip/OptionalTooltip.js";import"../../../molecules/ProfileAvatar/ProfileAvatar.js";import{RichTextDisplay as p}from"../../../molecules/RichTextDisplay/RichTextDisplay.js";import"../../../molecules/RichTextEditor/MenuBar/MenuBar.js";import"@tanstack/react-query";import"@tiptap/react";import"../../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../../molecules/RichTextEditor/RichTextEditor.styles.js";import{colors as u}from"../../../atoms/style/colors.js";import"../../../molecules/Tabs/Tabs.js";import"../../../molecules/RichTextEditor/MenuBar/MenuBar.styles.js";import"../../../molecules/RichTextEditor/MenuBar/MenuButton.js";import"../../../molecules/Search/Search.js";import"../../../molecules/Sieve/Sieve.styles.js";import"../../../_virtual/lodash.js";import"../../../molecules/SingleFilterMenu/SingleFilterMenu.js";import"../../../molecules/Skeleton/SkeletonBase/SkeletonBase.js";import"../../../molecules/Skeleton/Skeleton.styles.js";import"../../../molecules/Stepper/Stepper.js";import"../../../molecules/OptionDrawer/OptionDrawer.js";import"../../../molecules/Select/Select.styles.js";import{spacings as d}from"../../../atoms/style/spacings.js";import"../../../molecules/Skeleton/SkeletonField.js";import"../../../molecules/ListItem/ListItem.js";import"../../../molecules/SelectionControls/Checkbox/Checkbox.js";import"../../../molecules/SelectionControls/Radio/Radio.js";import"../../../molecules/SelectionControls/Switch/Switch.js";import"../../../molecules/Waves/Waves.styles.js";import{AnimatePresence as j,motion as h}from"framer-motion";import g from"styled-components";import{animation as y}from"../../../atoms/style/animation.js";const S=g.div`
|
|
2
2
|
background: ${u.ui.background__default.rgba};
|
|
3
3
|
width: 100%;
|
|
4
4
|
display: grid;
|
|
@@ -19,4 +19,4 @@ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t}from"reac
|
|
|
19
19
|
background: ${u.interactive.primary__hover_alt.rgba};
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,f=({question:a,answer:u,createdDate:d})=>{const[g,y]=t(!1);return e(S,{onClick:()=>y(e=>!e),children:[o(r,{variant:"h4",children:a}),o(r,{variant:"caption",children:n(d)}),o(c,{variant:"ghost_icon",children:o(i,{data:g?s:l})}),o(j,{children:g&&o(h.div,{style:{overflow:"hidden"},initial:{height:0},animate:{height:"auto"},exit:{height:0},children:o(p,{value:u,onImageRead:m.getFaqImage})})})]})};export{f as Question};
|
|
@@ -26,4 +26,4 @@ import{jsxs as r,jsx as e}from"react/jsx-runtime";import{Icon as o}from"@equinor
|
|
|
26
26
|
height: 16px;
|
|
27
27
|
width: 5rem;
|
|
28
28
|
border-radius: ${t.corners.borderRadius};
|
|
29
|
-
`,g=()=>r(u,{children:[e(l,{}),new Array(3).fill(0).map((
|
|
29
|
+
`,g=()=>r(u,{children:[e(l,{}),new Array(3).fill(0).map((t,s)=>r(c,{children:[e(p,{$offset:100*s}),e(f,{$offset:100*s}),e(d,{variant:"ghost_icon",children:e(o,{data:i})})]},`card-${s}`))]});export{g as CategorySkeleton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as
|
|
1
|
+
import{jsxs as r,jsx as t,Fragment as o}from"react/jsx-runtime";import{useState as e,useMemo as i}from"react";import{Typography as m}from"@equinor/eds-core-react";import{Container as a}from"./Faq.styles.js";import{Header as n}from"./Header.js";import{useFaqsInApplication as s}from"../../atoms/hooks/useFaqsInApplication.js";import{Category as d}from"./Category/Category.js";import{CategorySkeleton as l}from"./CategorySkeleton.js";import{Status as p}from"../Status/index.js";const c=()=>{const{data:c,isLoading:f}=s(),[u]=e(void 0),h=i(()=>{if(!c)return;if(!u)return c;return[c.find(r=>r.id==Number(u))]},[c,u]);return r(a,{children:[t(m,{variant:"h1",bold:!0,children:"FAQ"}),t(n,{}),h&&h.length>0?h.map(r=>t(d,{...r},r.id)):f?r(o,{children:[t(l,{}),t(l,{}),t(l,{})]}):t(p,{center:!1,children:t(p.Title,{title:"No FAQs available yet"})})]})};export{c as Faq};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as r,jsx as o}from"react/jsx-runtime";import{useMemo as
|
|
1
|
+
import{jsxs as r,jsx as o}from"react/jsx-runtime";import{useState as e,useMemo as i}from"react";import{Search as t}from"@equinor/eds-core-react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"@tanstack/react-query";import{useFaqsInApplication as s}from"../../atoms/hooks/useFaqsInApplication.js";import{colors as a}from"../../atoms/style/colors.js";import{spacings as m}from"../../atoms/style/spacings.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Environment.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"../../atoms/utils/auth_environment.js";import"html2canvas";import"proj4";import"@equinor/eds-icons";import{Tabs as l}from"../../molecules/Tabs/Tabs.js";import p from"styled-components";const n=p.div`
|
|
2
2
|
position: sticky;
|
|
3
3
|
top: 0;
|
|
4
4
|
display: flex;
|
|
@@ -11,4 +11,4 @@ import{jsxs as r,jsx as o}from"react/jsx-runtime";import{useMemo as e}from"react
|
|
|
11
11
|
> div[role='search'] > div {
|
|
12
12
|
background: ${a.ui.background__default.rgba};
|
|
13
13
|
}
|
|
14
|
-
`,d=()=>{const{data:a}=s(),[m,p]=
|
|
14
|
+
`,d=()=>{const{data:a}=s(),[m,p]=e(void 0),[d,c]=e(""),u=i(()=>a?[{value:"all",label:"All categories"},...a.map(r=>({value:r.id.toString(),label:r.categoryName}))]:[{value:"all",label:"All categories"}],[a]);return r(n,{children:[o(l,{style:{maxWidth:"100%",width:"fit-content"},selected:m??"all",onChange:r=>{p("all"===r?void 0:r)},options:u}),o(t,{value:d,onChange:r=>{c(r.target.value)},placeholder:"Search for answer by keyword"})]})};export{d as Header};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{jsx as r,jsxs as e,Fragment as
|
|
2
|
-
gap: ${
|
|
1
|
+
import{jsx as r,jsxs as e,Fragment as i}from"react/jsx-runtime";import{LinearProgress as o,Typography as t}from"@equinor/eds-core-react";import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import{useFakeProgress as s}from"../../atoms/hooks/useFakeProgress.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"@tanstack/react-query";import{colors as a}from"../../atoms/style/colors.js";import{spacings as m}from"../../atoms/style/spacings.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Environment.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"../../atoms/utils/auth_environment.js";import"html2canvas";import"proj4";import{capitalize as n}from"../../atoms/utils/string.js";import"@equinor/eds-icons";import"@equinor/subsurface-app-management";import{AnimatedCheckmark as p}from"../../molecules/AnimatedCheckmark/AnimatedCheckmark.js";import d from"styled-components";const c=d.div`
|
|
2
|
+
gap: ${m.medium};
|
|
3
3
|
position: absolute;
|
|
4
4
|
top: 50%;
|
|
5
5
|
left: 50%;
|
|
@@ -8,17 +8,17 @@ import{jsx as r,jsxs as e,Fragment as o}from"react/jsx-runtime";import{LinearPro
|
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
justify-content: center;
|
|
10
10
|
align-items: center;
|
|
11
|
-
min-height: calc(100vh - (${
|
|
11
|
+
min-height: calc(100vh - (${m.xxx_large} * 4));
|
|
12
12
|
width: 100%;
|
|
13
13
|
max-width: 370px;
|
|
14
|
-
`,l=d(
|
|
15
|
-
background-color: ${
|
|
14
|
+
`,l=d(o)`
|
|
15
|
+
background-color: ${a.interactive.primary__hover_alt.rgba};
|
|
16
16
|
|
|
17
17
|
div {
|
|
18
|
-
background-color: ${
|
|
18
|
+
background-color: ${a.interactive.primary__resting.rgba};
|
|
19
19
|
}
|
|
20
20
|
`,h=d(t)`
|
|
21
21
|
span {
|
|
22
22
|
text-transform: capitalize;
|
|
23
23
|
}
|
|
24
|
-
`,v=({fieldName:
|
|
24
|
+
`,v=({fieldName:o,onChangedField:a,finishedText:m})=>{const{finished:d,progress:v}=s({onDone:a});return r(c,{children:e(i,d?{children:[e(h,{variant:"h3",children:["Changed to ",r("span",{children:n(o)})]}),r(p,{}),r(t,{variant:"h6",children:m})]}:{children:[e(t,{variant:"h3",children:["Changing field.",".".repeat(v/35)]}),r(l,{variant:"determinate",value:v})]})})};export{v as ChangingField,l as LinearProgress};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t,useMemo as i}from"react";import{Card as r,Typography as l,Button as s,Icon as a}from"@equinor/eds-core-react";import{arrow_forward as n}from"@equinor/eds-icons";import{tokens as m}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import"../../../atoms/style/colors.js";import{spacings as c}from"../../../atoms/style/spacings.js";import"../../../molecules/AnimatedCheckmark/AnimatedCheckmark.styles.js";import"../../../molecules/ApplicationIcon/ApplicationIcon.js";import"../../../molecules/Badge/Badge.styles.js";import"../../../molecules/Banner/Banner.styles.js";import"../../../molecules/Button/Button.js";import"../../../molecules/Chip/Chip.js";import"../../../molecules/ContentMenu/ContentMenu.styles.js";import"../../../molecules/DatePicker/DatePicker.js";import"../../../molecules/Dialog/Dialog.js";import"../../../molecules/EquinorLogo/EquinorLogo.js";import"../../../molecules/FileProgress/CompactFileProgress.styles.js";import"../../../atoms/utils/auth_environment.js";import"html2canvas";import"proj4";import"../../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../../molecules/FileProgress/RegularFileProgress.styles.js";import"../../../molecules/FileUploadArea/FileUploadArea.js";import"../../../molecules/FullPageSpinner/FullPageSpinner.js";import"../../../molecules/InfoElement/InfoElement.js";import"../../../molecules/OptionalTooltip/OptionalTooltip.js";import"../../../molecules/ProfileAvatar/ProfileAvatar.js";import"@tiptap/react";import"../../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../../molecules/RichTextEditor/RichTextEditor.styles.js";import"../../../molecules/RichTextEditor/MenuBar/MenuBar.js";import"@tanstack/react-query";import"../../../molecules/Tabs/Tabs.js";import"../../../molecules/RichTextEditor/MenuBar/MenuBar.styles.js";import"../../../molecules/RichTextEditor/MenuBar/MenuButton.js";import"../../../molecules/Search/Search.js";import"
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t,useMemo as i}from"react";import{Card as r,Typography as l,Button as s,Icon as a}from"@equinor/eds-core-react";import{arrow_forward as n}from"@equinor/eds-icons";import{tokens as m}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import"../../../atoms/style/colors.js";import{spacings as c}from"../../../atoms/style/spacings.js";import"../../../molecules/AnimatedCheckmark/AnimatedCheckmark.styles.js";import"../../../molecules/ApplicationIcon/ApplicationIcon.js";import"../../../molecules/Badge/Badge.styles.js";import"../../../molecules/Banner/Banner.styles.js";import"../../../molecules/Button/Button.js";import"../../../molecules/Chip/Chip.js";import"../../../molecules/ContentMenu/ContentMenu.styles.js";import"../../../molecules/DatePicker/DatePicker.js";import"../../../molecules/DateRangePicker/DateRangePicker.js";import"../../../molecules/Dialog/Dialog.js";import"../../../molecules/EquinorLogo/EquinorLogo.js";import"../../../molecules/FileProgress/CompactFileProgress.styles.js";import"../../../atoms/utils/auth_environment.js";import"html2canvas";import"proj4";import"../../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../../molecules/FileProgress/RegularFileProgress.styles.js";import"react-dropzone";import"../../../molecules/FileUploadArea/FileUploadArea.styles.js";import"../../../molecules/FullPageSpinner/FullPageSpinner.js";import"../../../molecules/InfoElement/InfoElement.js";import"../../../molecules/OptionalTooltip/OptionalTooltip.js";import"../../../molecules/ProfileAvatar/ProfileAvatar.js";import"@tiptap/react";import"../../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../../molecules/RichTextEditor/RichTextEditor.styles.js";import"../../../molecules/RichTextEditor/MenuBar/MenuBar.js";import"@tanstack/react-query";import"../../../molecules/Tabs/Tabs.js";import"../../../molecules/RichTextEditor/MenuBar/MenuBar.styles.js";import"../../../molecules/RichTextEditor/MenuBar/MenuButton.js";import"../../../molecules/Search/Search.js";import"../../../molecules/Sieve/Sieve.styles.js";import"../../../_virtual/lodash.js";import"../../../molecules/SingleFilterMenu/SingleFilterMenu.js";import"../../../molecules/Skeleton/SkeletonBase/SkeletonBase.js";import"../../../molecules/Skeleton/Skeleton.styles.js";import"../../../molecules/Stepper/Stepper.js";import"../../../molecules/OptionDrawer/OptionDrawer.js";import"../../../molecules/Select/Select.styles.js";import"../../../molecules/Skeleton/SkeletonField.js";import{SingleSelect as p}from"../../../molecules/Select/SingleSelect/SingleSelect.js";import"../../../molecules/ListItem/ListItem.js";import"../../../molecules/SelectionControls/Checkbox/Checkbox.js";import"../../../molecules/SelectionControls/Radio/Radio.js";import"../../../molecules/SelectionControls/Switch/Switch.js";import"../../../molecules/Waves/Waves.styles.js";import"framer-motion";import u from"styled-components";const{elevation:d,colors:h,shape:g}=m,j=u(r)`
|
|
2
2
|
position: absolute;
|
|
3
3
|
left: 50%;
|
|
4
4
|
top: 50%;
|
|
@@ -54,4 +54,4 @@ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t,useMemo a
|
|
|
54
54
|
background-color: ${h.interactive.primary__hover_alt.rgba};
|
|
55
55
|
cursor: pointer;
|
|
56
56
|
}
|
|
57
|
-
`,S=({availableFields:r,onSelect:m,itemNameSingular:c,showAccessITLink:u=!0})=>{const[d,h]=t(),g=i((
|
|
57
|
+
`,S=({availableFields:r,onSelect:m,itemNameSingular:c,showAccessITLink:u=!0})=>{const[d,h]=t(),g=i(()=>{const e=[];for(const o of r)o.name?e.push({label:o.name,value:o.name,...o}):console.error("Field with no name found!:",o);return e},[r]);return e(j,{children:[e(l,{variant:"h3",children:["Please select a ",c]}),e("div",{children:[e("section",{children:[o(p,{lightBackground:!0,value:d,items:g,placeholder:`Select a ${c}...`,onSelect:e=>{h(e)}}),o(s,{"data-testid":"nextButton",variant:"contained_icon",disabled:void 0===d,onClick:()=>{void 0!==d&&m({name:d.name,uuid:d.uuid,country:d.country})},children:o(a,{data:n})})]}),u&&e(f,{children:[e(l,{variant:"overline",children:["Missing a ",c,"?"]}),o(x,{tabIndex:0,"data-testid":"missing-access",href:"https://accessit.equinor.com/#",target:"_blank",children:"Go to AccessIT"})]})]})]})};export{S as SelectorCard};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FilterWithAutoCompleteOptions } from './Filter.types';
|
|
2
|
+
interface AutoCompleteMenuProps<T extends string> {
|
|
3
|
+
anchorElement: HTMLElement | null;
|
|
4
|
+
searchElement: HTMLElement | null;
|
|
5
|
+
search: string;
|
|
6
|
+
isFilterOpen: boolean;
|
|
7
|
+
autoCompleteOptions: FilterWithAutoCompleteOptions<T>['autoCompleteOptions'];
|
|
8
|
+
onAutoComplete: FilterWithAutoCompleteOptions<T>['onAutoComplete'];
|
|
9
|
+
}
|
|
10
|
+
export declare function AutoCompleteMenu<T extends string>({ anchorElement, searchElement, search, isFilterOpen, autoCompleteOptions, onAutoComplete, }: AutoCompleteMenuProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{useState as e,useRef as o,useEffect as t}from"react";import{Menu as i,Typography as s}from"@equinor/eds-core-react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"@tanstack/react-query";import"@equinor/subsurface-app-management";import"../../atoms/utils/auth_environment.js";import{colors as n}from"../../atoms/style/colors.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Environment.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"html2canvas";import"proj4";import"@equinor/eds-icons";import{getFilteredAutoCompleteOptions as m,findStartAndEndIndexOfSearch as a}from"./Filter.utils.js";import{styled as p}from"styled-components";const c=p(i)`
|
|
2
|
+
overflow-y: auto;
|
|
3
|
+
max-height: 250px;
|
|
4
|
+
`,l=p(s)`
|
|
5
|
+
color: ${n.text.static_icons__tertiary.rgba};
|
|
6
|
+
> strong {
|
|
7
|
+
color: ${n.text.static_icons__default.rgba};
|
|
8
|
+
font-weight: unset;
|
|
9
|
+
}
|
|
10
|
+
`;function u({anchorElement:s,searchElement:n,search:p,isFilterOpen:u,autoCompleteOptions:d,onAutoComplete:v}){const[h,j]=e(!1),f=o("");t(()=>{h||p===f.current?p!==f.current&&(f.current=p):(f.current=p,j(!0))},[h,p]);const b=m({searchValue:p,autoCompleteOptions:d});return u&&h&&p&&0!==b.length?r(c,{open:!0,anchorEl:s,matchAnchorWidth:!0,onClose:()=>{j(!1)},children:b.map((e,o)=>{const[t,s]=a({searchValue:p,label:e.label}),m=[e.label.slice(0,t),r("strong",{children:e.label.slice(t,s+1)},`${e.value}-start`),e.label.slice(s+1)];return r(i.Item,{onKeyDown:r=>((r,e)=>"ArrowUp"===r.key&&0===e?(r.preventDefault(),void n?.focus()):"Enter"===r.key&&b[e]?(v(b[e].key,b[e]),void j(!1)):void 0)(r,o),children:r(l,{children:m})},e.value)})}):null}export{u as AutoCompleteMenu};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FilterWithAutoCompleteOptions } from './Filter.types';
|
|
2
|
+
export declare const StyledTypography: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<({
|
|
3
|
+
as?: import("react").ElementType | undefined;
|
|
4
|
+
} & (import("@equinor/eds-core-react").TypographyProps & Omit<any, "nonce" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "italic" | "bold" | "variant" | "link" | "group" | "token" | "lines">)) & import("styled-components/dist/types").BaseObject, import("styled-components/dist/types").BaseObject>> & string & Omit<import("@equinor/eds-utils").OverridableComponent<import("@equinor/eds-core-react").TypographyProps, HTMLElement>, keyof import("react").Component<any, {}, any>>;
|
|
5
|
+
interface AutoCompleteTextProps<T extends string> {
|
|
6
|
+
search: string;
|
|
7
|
+
autoCompleteOptions: FilterWithAutoCompleteOptions<T>['autoCompleteOptions'];
|
|
8
|
+
}
|
|
9
|
+
export declare function AutoCompleteText<T extends string>({ search, autoCompleteOptions, }: AutoCompleteTextProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{jsxs as r,jsx as o}from"react/jsx-runtime";import{Typography as t}from"@equinor/eds-core-react";import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"@tanstack/react-query";import"@equinor/subsurface-app-management";import"../../atoms/utils/auth_environment.js";import{colors as e}from"../../atoms/style/colors.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Environment.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"html2canvas";import"proj4";import"@equinor/eds-icons";import{getFilteredAutoCompleteOptions as i,findStartAndEndIndexOfSearch as s}from"./Filter.utils.js";import{styled as m}from"styled-components";const n=m(t)`
|
|
2
|
+
position: absolute;
|
|
3
|
+
left: 0;
|
|
4
|
+
color: ${e.text.static_icons__tertiary.rgba};
|
|
5
|
+
height: fit-content;
|
|
6
|
+
text-wrap: nowrap;
|
|
7
|
+
line-height: normal;
|
|
8
|
+
> span {
|
|
9
|
+
color: transparent;
|
|
10
|
+
}
|
|
11
|
+
`;function p({search:t,autoCompleteOptions:e}){const m=i({autoCompleteOptions:e,searchValue:t});if(0===m.length)return null;const p=m[0],[a,l]=s({searchValue:t,label:p.label});return 0!==a?null:r(n,{children:[o("span",{children:t.slice(0,t.length)}),p.label.slice(l+1)]})}export{p as AutoCompleteText,n as StyledTypography};
|
|
@@ -12,4 +12,4 @@ import { FilterProps } from './Filter.types';
|
|
|
12
12
|
* @param placeholder - Placeholder text for the search input, defaults to 'Search...'
|
|
13
13
|
* @param id - ID for the search field
|
|
14
14
|
*/
|
|
15
|
-
export declare function Filter<T extends string>({ values, search, onSearchChange, onSearchEnter, onClearFilter, onClearAllFilters, children, topContent, inlineContent, initialOpen, placeholder, id, }: FilterProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function Filter<T extends string>({ values, search, onSearchChange, onSearchEnter, onClearFilter, onClearAllFilters, children, topContent, inlineContent, initialOpen, placeholder, id, ...rest }: FilterProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as o,useState as r}from"react";import{Icon as n,Button as i,Typography as a}from"@equinor/eds-core-react";import{search as l,clear as c,arrow_drop_up as s,arrow_drop_down as p,info_circle as u}from"@equinor/eds-icons";import{Wrapper as m,Container as h,Section as d,StyledChip as C,SearchFieldWrapper as f,SearchField as g,Content as y}from"./Filter.styles.js";import{colors as O}from"../../atoms/style/colors.js";import{AutoCompleteMenu as v}from"./AutoCompleteMenu.js";import{AutoCompleteText as _}from"./AutoCompleteText.js";import{getFilteredAutoCompleteOptions as b}from"./Filter.utils.js";import{AnimatePresence as k,motion as j}from"framer-motion";function x({values:x,search:F,onSearchChange:A,onSearchEnter:$,onClearFilter:E,onClearAllFilters:D,children:S,topContent:T,inlineContent:q,initialOpen:w=!1,placeholder:z="Search...",id:M,...R}){const B=o(null),I=o(null),[K,V]=r(w),[G,H]=r(void 0),J=o(w?"auto":0),L=Object.values(x).some(e=>e.length>0);return e(m,{id:M,children:[T,e(h,{children:[e(d,{ref:I,onClick:()=>{B.current?.focus()},children:[t(n,{data:l,color:O.text.static_icons__tertiary.rgba}),Object.keys(x).flatMap(e=>x[e].map(({label:o,icon:r},n,i)=>t(C,{onDelete:()=>E(e,n),leadingIconData:r,$tryingToRemove:G===e&&n===i.length-1,children:o},`${o}-${n}-${e}`))),e(f,{children:["autoCompleteOptions"in R&&R.autoCompleteOptions&&t(_,{search:F,autoCompleteOptions:R.autoCompleteOptions}),t(g,{ref:B,id:`filter-search-${M}`,type:"search",autoComplete:"off",value:F,placeholder:L?void 0:z,onChange:A,onKeyDownCapture:e=>{if("Enter"===e.key&&""!==F)(e=>{if(!("autoCompleteOptions"in R))return void $(e);const t=b({searchValue:e,autoCompleteOptions:R.autoCompleteOptions});1!==t.length?$(e):R.onAutoComplete(t[0].key,t[0])})(F);else if("Backspace"===e.key&&""===F){if(void 0===G){for(const e of Object.keys(x).toReversed())if(x[e].length>0){H(e);break}return}E(G,x[G].length-1),H(void 0)}},onFocus:()=>{K||V(!0)}})]}),Object.values(x).some(e=>e.length>0)&&t(i,{variant:"ghost_icon",onClick:D,"data-testid":"clear-all-x",children:t(n,{data:c,size:18,color:O.text.static_icons__tertiary.rgba})})]}),q,e("button",{onClick:()=>{V(e=>!e),"auto"===J.current&&(J.current=0)},"data-testid":"toggle-open-button",children:[t(a,{variant:"button",group:"navigation",as:"span",children:"Filters"}),t(n,{data:K?s:p,color:O.text.static_icons__tertiary.rgba})]})]}),t(k,{children:K&&t(j.div,{animate:{height:"auto"},initial:{height:J.current},exit:{height:0},children:e(y,{children:[e("span",{children:[t(n,{data:u,size:16,color:O.text.static_icons__tertiary.rgba}),t(a,{variant:"label",group:"input",color:O.text.static_icons__tertiary.rgba,children:"Type a keyword and press enter"})]}),S]})})}),"autoCompleteOptions"in R&&R.autoCompleteOptions&&t(v,{isFilterOpen:K,search:F,anchorElement:I.current,autoCompleteOptions:R.autoCompleteOptions,onAutoComplete:R.onAutoComplete,searchElement:B.current})]})}export{x as Filter};
|
|
@@ -13,4 +13,5 @@ export declare const StyledChip: import("styled-components/dist/types").IStyledC
|
|
|
13
13
|
onClick?: undefined;
|
|
14
14
|
onDelete?: undefined;
|
|
15
15
|
}))) & import("react").RefAttributes<HTMLDivElement | HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
16
|
+
export declare const SearchFieldWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
16
17
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"
|
|
1
|
+
import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"@tanstack/react-query";import"@equinor/subsurface-app-management";import"../../atoms/utils/auth_environment.js";import{shape as r,typography as i}from"../../atoms/style/index.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Environment.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"html2canvas";import"proj4";import"@equinor/eds-icons";import{Chip as e}from"../../molecules/Chip/Chip.js";import{motion as t}from"framer-motion";import o,{css as a}from"styled-components";import{colors as s}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";const d=o.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
border: 1px solid ${s.ui.background__heavy.rgba};
|
|
4
4
|
background: ${s.ui.background__default.rgba};
|
|
@@ -72,8 +72,8 @@ import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit
|
|
|
72
72
|
flex-grow: 1;
|
|
73
73
|
padding: 0;
|
|
74
74
|
font-family: 'Equinor', sans-serif;
|
|
75
|
-
font-size: ${
|
|
76
|
-
font-weight: ${
|
|
75
|
+
font-size: ${i.input.text.fontSize};
|
|
76
|
+
font-weight: ${i.input.text.fontWeight};
|
|
77
77
|
color: ${s.text.static_icons__default.rgba};
|
|
78
78
|
outline: none;
|
|
79
79
|
border: none;
|
|
@@ -99,8 +99,12 @@ import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit
|
|
|
99
99
|
display: flex;
|
|
100
100
|
gap: ${n.x_small};
|
|
101
101
|
}
|
|
102
|
-
`,u=o(
|
|
102
|
+
`,u=o(e)`
|
|
103
103
|
${({$tryingToRemove:r})=>{if(r)return a`
|
|
104
104
|
background: ${s.interactive.primary__hover_alt.rgba};
|
|
105
105
|
`}}
|
|
106
|
-
|
|
106
|
+
`,g=o.section`
|
|
107
|
+
position: relative;
|
|
108
|
+
flex-grow: 1;
|
|
109
|
+
display: flex;
|
|
110
|
+
`;export{m as Container,c as Content,p as SearchField,g as SearchFieldWrapper,l as Section,u as StyledChip,d as Wrapper};
|
|
@@ -17,5 +17,9 @@ interface CommonFilterProps<T extends string> {
|
|
|
17
17
|
placeholder?: string;
|
|
18
18
|
id?: string;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export interface FilterWithAutoCompleteOptions<T extends string> extends CommonFilterProps<T> {
|
|
21
|
+
autoCompleteOptions: Record<T, SelectOptionRequired[]>;
|
|
22
|
+
onAutoComplete: (key: T, value: SelectOptionRequired) => void;
|
|
23
|
+
}
|
|
24
|
+
export type FilterProps<T extends string> = CommonFilterProps<T> | FilterWithAutoCompleteOptions<T>;
|
|
21
25
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SelectOptionRequired } from '../../molecules';
|
|
2
|
+
export declare function getFilteredAutoCompleteOptions<T extends string>({ searchValue, autoCompleteOptions, }: {
|
|
3
|
+
searchValue: string;
|
|
4
|
+
autoCompleteOptions: Record<T, SelectOptionRequired[]>;
|
|
5
|
+
}): Array<SelectOptionRequired & {
|
|
6
|
+
key: T;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function findStartAndEndIndexOfSearch({ searchValue, label, }: {
|
|
9
|
+
searchValue: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}): [number, number];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e({searchValue:e,autoCompleteOptions:o}){return function(e){const o=[];for(const a in e)o.push(...e[a].map(e=>({...e,key:a})));return o}(o).filter(o=>function({searchValue:e,option:o}){return""!==e&&o.label.toLowerCase().includes(e.toLowerCase())}({searchValue:e,option:o})).sort((o,a)=>function({a:e,b:o,searchValue:a}){const t=a.toLowerCase(),r=e.toLowerCase().replace(t,""),l=o.toLowerCase().replace(t,"");return r.length-l.length}({a:o.label,b:a.label,searchValue:e})).sort((e,o)=>e.label.localeCompare(o.label))}function o({searchValue:e,label:o}){const a=o.toLowerCase().indexOf(e.toLowerCase());return[a,a+e.length-1]}export{o as findStartAndEndIndexOfSearch,e as getFilteredAutoCompleteOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as r}from"react";import{Typography as o,Icon as i,Menu as n}from"@equinor/eds-core-react";import{arrow_drop_up as a,arrow_drop_down as m}from"@equinor/eds-icons";import{ButtonWithMenu as l}from"./ButtonWithMenu.js";function c({values:c,items:u,onQuickFilter:s,label:p="Quick filter"}){const[f,d]=r(!1);return e(l,{onOpenChange:d,menuItems:Object.keys(u).flatMap(
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as r}from"react";import{Typography as o,Icon as i,Menu as n}from"@equinor/eds-core-react";import{arrow_drop_up as a,arrow_drop_down as m}from"@equinor/eds-icons";import{ButtonWithMenu as l}from"./ButtonWithMenu.js";function c({values:c,items:u,onQuickFilter:s,label:p="Quick filter"}){const[f,d]=r(!1);return e(l,{onOpenChange:d,menuItems:Object.keys(u).flatMap(e=>u[e].map(r=>t(n.Item,{active:c[e]?.some(e=>e.value===r.value),onClick:()=>s(e,r),children:r.label},r.label))),children:[t(o,{as:"span",variant:"button",group:"navigation",children:p}),t(i,{data:f?a:m})]})}export{c as QuickFilter};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{jsxs as r,jsx as o}from"react/jsx-runtime";import{Menu as t,Typography as e,Icon as i}from"@equinor/eds-core-react";import{sort as s,radio_button_selected as m,radio_button_unselected as a}from"@equinor/eds-icons";import{ButtonWithMenu as n}from"./ButtonWithMenu.js";import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"
|
|
1
|
+
import{jsxs as r,jsx as o}from"react/jsx-runtime";import{Menu as t,Typography as e,Icon as i}from"@equinor/eds-core-react";import{sort as s,radio_button_selected as m,radio_button_unselected as a}from"@equinor/eds-icons";import{ButtonWithMenu as n}from"./ButtonWithMenu.js";import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"@tanstack/react-query";import"@equinor/subsurface-app-management";import"../../atoms/utils/auth_environment.js";import{colors as p}from"../../atoms/style/colors.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Environment.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"html2canvas";import"proj4";import d from"styled-components";const c=d(t.Item)`
|
|
2
2
|
> div {
|
|
3
3
|
grid-template-columns: 1fr auto;
|
|
4
4
|
}
|
|
5
|
-
`;function u({value:t,onChange:d,items:u}){const l=u.find(
|
|
5
|
+
`;function u({value:t,onChange:d,items:u}){const l=u.find(r=>r.value===t);return r(n,{menuItems:u.map(e=>r(c,{onClick:()=>{(r=>{d(r)})(e.value)},children:[e.label,o(i,{color:e.value===t?p.interactive.primary__resting.rgba:p.text.static_icons__tertiary.rgba,data:e.value===t?m:a})]},e.label)),children:[r(e,{as:"span",variant:"button",group:"navigation",children:["Sort by ",l?.label]}),o(i,{data:s})]})}export{u as SortMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as r}from"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"
|
|
1
|
+
import{useEffect as r}from"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"@tanstack/react-query";import"@equinor/subsurface-app-management";import{environment as o}from"../../atoms/utils/auth_environment.js";import"../../atoms/style/colors.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Environment.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"html2canvas";import"proj4";import"@equinor/eds-icons";const t=o.getAppName(import.meta.env.VITE_NAME),e=({title:o,children:e})=>(r(()=>{document.title!==o&&(document.title=`${t} - ${o}`)},[o]),e);export{e as PageTitle};
|
|
@@ -7,4 +7,4 @@ import{jsxs as r,jsx as e}from"react/jsx-runtime";import{Icon as t}from"@equinor
|
|
|
7
7
|
width: 10px !important;
|
|
8
8
|
height: 10px !important;
|
|
9
9
|
border-radius: 50%;
|
|
10
|
-
`,d=({children:i,tags:a})=>r(l,{children:[r(n,{children:[e(t,{data:o}),"Release Note"]}),a?.map(
|
|
10
|
+
`,d=({children:i,tags:a})=>r(l,{children:[r(n,{children:[e(t,{data:o}),"Release Note"]}),a?.map(t=>r(n,{children:[e(c,{style:{background:p[t]}}),t]},t)),i]});export{d as MetaTags};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{forwardRef as t,useRef as r,useState as i}from"react";import{Typography as s}from"@equinor/eds-core-react";import{ReleaseNotesService as l}from"@equinor/subsurface-app-management";import{RELEASE_NOTE_RICH_TEXT_COLLAPSED_HEIGHT as m}from"./ReleaseNote.constants.js";import{timeToRead as a,usingReleaseNoteDate as n}from"./ReleaseNote.utils.js";import{ToggleExpanded as p}from"./ToggleExpanded.js";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{forwardRef as t,useRef as r,useState as i}from"react";import{Typography as s}from"@equinor/eds-core-react";import{ReleaseNotesService as l}from"@equinor/subsurface-app-management";import{RELEASE_NOTE_RICH_TEXT_COLLAPSED_HEIGHT as m}from"./ReleaseNote.constants.js";import{timeToRead as a,usingReleaseNoteDate as n}from"./ReleaseNote.utils.js";import{ToggleExpanded as p}from"./ToggleExpanded.js";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"@tanstack/react-query";import"../../atoms/utils/auth_environment.js";import{shape as c}from"../../atoms/style/index.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Environment.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import{formatDate as d}from"../../atoms/utils/date.js";import"html2canvas";import"proj4";import{getImagesFromRichText as u}from"../../atoms/utils/richtext.js";import"@equinor/eds-icons";import"../../molecules/AnimatedCheckmark/AnimatedCheckmark.styles.js";import"../../molecules/ApplicationIcon/ApplicationIcon.js";import"../../molecules/Badge/Badge.styles.js";import"../../molecules/Banner/Banner.styles.js";import"../../molecules/Button/Button.js";import"../../molecules/Chip/Chip.js";import"../../molecules/ContentMenu/ContentMenu.styles.js";import"../../molecules/DatePicker/DatePicker.js";import"../../molecules/DateRangePicker/DateRangePicker.js";import"../../molecules/Dialog/Dialog.js";import"../../molecules/EquinorLogo/EquinorLogo.js";import"../../molecules/FileProgress/CompactFileProgress.styles.js";import"../../molecules/FileProgress/RegularFileProgress.styles.js";import"react-dropzone";import"../../molecules/FileUploadArea/FileUploadArea.styles.js";import"../../molecules/FullPageSpinner/FullPageSpinner.js";import"../../molecules/InfoElement/InfoElement.js";import"../../molecules/OptionalTooltip/OptionalTooltip.js";import"../../molecules/ProfileAvatar/ProfileAvatar.js";import{RichTextDisplay as j}from"../../molecules/RichTextDisplay/RichTextDisplay.js";import"../../molecules/RichTextEditor/MenuBar/MenuBar.js";import"@tiptap/react";import"../../molecules/RichTextEditor/RichTextEditor.styles.js";import{colors as g}from"../../atoms/style/colors.js";import"../../molecules/Tabs/Tabs.js";import"../../molecules/RichTextEditor/MenuBar/MenuBar.styles.js";import"../../molecules/RichTextEditor/MenuBar/MenuButton.js";import"../../molecules/Search/Search.js";import"../../molecules/Sieve/Sieve.styles.js";import"../../molecules/SingleFilterMenu/SingleFilterMenu.js";import"../../molecules/Skeleton/SkeletonBase/SkeletonBase.js";import"../../molecules/Skeleton/Skeleton.styles.js";import"../../molecules/Stepper/Stepper.js";import"../../molecules/OptionDrawer/OptionDrawer.js";import"../../molecules/Select/Select.styles.js";import{spacings as h}from"../../atoms/style/spacings.js";import"../../molecules/Skeleton/SkeletonField.js";import"../../molecules/ListItem/ListItem.js";import"../../molecules/SelectionControls/Checkbox/Checkbox.js";import"../../molecules/SelectionControls/Radio/Radio.js";import"../../molecules/SelectionControls/Switch/Switch.js";import"../../molecules/Waves/Waves.styles.js";import{motion as v}from"framer-motion";import{MetaTags as f}from"./MetaTags.js";import y from"styled-components";const x=y.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
|
-
padding: ${
|
|
4
|
+
padding: ${h.medium};
|
|
5
5
|
position: relative;
|
|
6
|
-
background: ${
|
|
7
|
-
border: 1px solid ${
|
|
6
|
+
background: ${g.ui.background__default.rgba};
|
|
7
|
+
border: 1px solid ${g.ui.background__heavy.rgba};
|
|
8
8
|
border-radius: ${c.corners.borderRadius};
|
|
9
9
|
min-width: 800px;
|
|
10
10
|
width: 100%;
|
|
11
11
|
overflow: hidden;
|
|
12
12
|
> h4 {
|
|
13
|
-
margin-top: ${
|
|
14
|
-
margin-bottom: ${
|
|
13
|
+
margin-top: ${h.large};
|
|
14
|
+
margin-bottom: ${h.medium};
|
|
15
15
|
}
|
|
16
16
|
padding-bottom: calc(
|
|
17
|
-
68px + ${
|
|
17
|
+
68px + ${h.medium}
|
|
18
18
|
); // Space for the expand button
|
|
19
19
|
`,S=y.header`
|
|
20
20
|
display: flex;
|
|
@@ -22,6 +22,6 @@ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{forwardRef as t,useRef
|
|
|
22
22
|
align-items: center;
|
|
23
23
|
`,b=y.section`
|
|
24
24
|
display: flex;
|
|
25
|
-
gap: ${
|
|
25
|
+
gap: ${h.medium};
|
|
26
26
|
align-items: center;
|
|
27
|
-
`,
|
|
27
|
+
`,k=t(({applicationName:t,releaseDate:c,createdDate:y,tags:k,version:P,title:R,body:T,actionMenu:B,expanded:E=!1},D)=>{const C=n({releaseDate:c,createdDate:y}),M=r(E?"auto":m),[_,A]=i(E),[F,w]=i(u(T).length>0),N=r(new ResizeObserver(e=>{e.at(0)&&e[0].target.scrollHeight>m&&w(!0)}));return e(x,{ref:D,style:{paddingBottom:_?h.medium:void 0},children:[e(S,{children:[e(b,{children:[o(s,{variant:"caption",color:g.text.static_icons__secondary.rgba,children:t}),e(s,{variant:"overline",color:g.text.static_icons__tertiary.rgba,children:[d(C),P?` ・ ${P}`:""," ・ ",a(T)]})]}),o(f,{tags:k,children:B})]}),o(s,{variant:"h4",children:R}),o(v.div,{ref:e=>{e&&N.current.observe(e)},initial:{height:M.current},animate:{height:_?"auto":m},style:{overflow:_?"auto":void 0},children:o(j,{value:T,onImageRead:l.getReleaseNoteImage,padding:"none"})}),F&&!E&&o(p,{expanded:_,onToggleExpanded:()=>{A(e=>!e)}})]})});k.displayName="ReleaseNote";export{k as ReleaseNote};
|