@zealicsolutions/web-ui 1.0.140-beta.120 → 1.0.140-beta.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/containers/types/moleculeTypes.d.ts +3 -0
- package/dist/cjs/helpers/utils.d.ts +35 -0
- package/dist/cjs/index.js +32 -32
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/molecules/Button/types.d.ts +5 -1
- package/dist/esm/containers/Container.js.map +1 -1
- package/dist/esm/containers/ReplicatorContainer/ReplicatorContainer.js +1 -1
- package/dist/esm/containers/ReplicatorContainer/ReplicatorContainer.js.map +1 -1
- package/dist/esm/containers/types/moleculeTypes.d.ts +3 -0
- package/dist/esm/helpers/utils.d.ts +35 -0
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/molecules/BaseMolecule.js.map +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.js +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.js.map +1 -1
- package/dist/esm/molecules/Button/types.d.ts +5 -1
- package/dist/esm/molecules/Link/Link.js +1 -1
- package/dist/esm/molecules/Link/Link.js.map +1 -1
- package/package.json +1 -1
|
@@ -97,11 +97,15 @@ export type LinkProperties = {
|
|
|
97
97
|
id?: string;
|
|
98
98
|
attributeType?: 'link';
|
|
99
99
|
propertyType?: 'link';
|
|
100
|
-
type: 'internalLink' | 'externalLink' | 'external_link' | 'internal_link';
|
|
100
|
+
type: 'internalLink' | 'externalLink' | 'external_link' | 'internal_link' | 'dataDrivenLink' | 'data_driven_link';
|
|
101
101
|
internalLink?: string | null;
|
|
102
102
|
externalLink?: string | null;
|
|
103
103
|
name?: string;
|
|
104
104
|
required?: boolean;
|
|
105
|
+
/** For dataDrivenLink: DMF ID containing URL or page ID */
|
|
106
|
+
sourceDataModelFieldId?: string;
|
|
107
|
+
/** For dataDrivenLink: Optional DMF ID containing record ID to pass to destination */
|
|
108
|
+
recordIdFieldId?: string;
|
|
105
109
|
};
|
|
106
110
|
export type PopupDrawerAction = {
|
|
107
111
|
type: 'open' | 'close';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.js","sources":["../../../../src/containers/Container.tsx"],"sourcesContent":[null],"names":["sliderSettings","dots","infinite","autoplay","autoplaySpeed","arrows","slidesToShow","slidesToScroll","adaptiveHeight","swipeToSlide","Container","memo","id","type","name","config","children","metadata","isMobile","properties","nestedPathSegments","replicatorFieldId","theme","useTheme","props","wide","compact","containerReplicatorFieldId","isConfigurationMode","onConfigurationItemClicked","selectedConfigurationItemId","currentStyleProperties","currentContentProperties","formId","useOrganismContext","activeVariant","useContainerRuntime","formContext","useFormContext","isFormMode","Boolean","selected","mergedProperties","backgroundImage","imageFile","url","containerProps","wideContainerProps","containerStyle","savedWideContainerStyles","wideContainerStyles","compactContainerProps","savedCompactContainerStyles","compactContainerStyles","isXs","useMediaQuery","isMobileProp","styles","mergedContainerProps","enableBackgroundImage","configurationItemData","useMemo","entityId","entityType","entityName","entity","libraryEntityId","containerLibraryId","undefined","activeStyleVariant","configurationsItemInfo","onClick","e","stopPropagation","onDoubleClick","key","containerCss","css","getBackgroundImageStyles","getConfigurationWrapperStyle","_jsx","className","style","width","height","display","position","Slider","fade","slickStyles","replicatorContent","ReplicatorContainer","renderWrapper","iterationIndex","innerChildren","variantStyles","getVariantContainerStyles","mergedStyles","Object","keys","length","variantContainerCss","containersMap","form","FormContainer","formProps","form_step","FormStepContainer","formStepProps","replicator","ReplicatorFormSetup","minInstances","maxInstances","_Fragment"],"mappings":"s1DAoBA,MAAMA,EAA2B,CAC/BC,MAAM,EACNC,UAAU,EACVC,UAAU,EACVC,cAAe,IACfC,QAAQ,EACRC,aAAc,EACdC,eAAgB,EAChBC,gBAAgB,EAChBC,cAAc,GAGHC,EAQTC,EACF,EACEC,KACAC,OACAC,OACAC,SACAC,WACAC,WACAC,WACAC,aACAC,qBAAqB,GACrBC,wBAEA,MAAMC,EAAQC,KAERC,MAAEA,EAAKC,KAAEA,EAAIC,QAAEA,GAAYX,GAAU,CAAA,EAGrCY,EAA6BN,GAAqBG,GAAOH,mBAEzDO,oBACJA,EAAmBC,2BACnBA,EAA0BC,4BAC1BA,EAA2BC,uBAC3BA,EAAsBC,yBACtBA,EAAwBC,OACxBA,GACEC,KAGEC,cAAEA,GAAkBC,IAGpBC,EAAcC,IACdC,EAAaC,QAAQP,GAAUI,GAE/BI,EAAWX,IAAgClB,EAE3C8B,EAAmBD,EACpB,
|
|
1
|
+
{"version":3,"file":"Container.js","sources":["../../../../src/containers/Container.tsx"],"sourcesContent":[null],"names":["sliderSettings","dots","infinite","autoplay","autoplaySpeed","arrows","slidesToShow","slidesToScroll","adaptiveHeight","swipeToSlide","Container","memo","id","type","name","config","children","metadata","isMobile","properties","nestedPathSegments","replicatorFieldId","theme","useTheme","props","wide","compact","containerReplicatorFieldId","isConfigurationMode","onConfigurationItemClicked","selectedConfigurationItemId","currentStyleProperties","currentContentProperties","formId","useOrganismContext","activeVariant","useContainerRuntime","formContext","useFormContext","isFormMode","Boolean","selected","mergedProperties","backgroundImage","imageFile","url","containerProps","wideContainerProps","containerStyle","savedWideContainerStyles","wideContainerStyles","compactContainerProps","savedCompactContainerStyles","compactContainerStyles","isXs","useMediaQuery","isMobileProp","styles","mergedContainerProps","enableBackgroundImage","configurationItemData","useMemo","entityId","entityType","entityName","entity","libraryEntityId","containerLibraryId","undefined","activeStyleVariant","configurationsItemInfo","onClick","e","stopPropagation","onDoubleClick","key","containerCss","css","getBackgroundImageStyles","getConfigurationWrapperStyle","_jsx","className","style","width","height","display","position","Slider","fade","slickStyles","replicatorContent","ReplicatorContainer","renderWrapper","iterationIndex","innerChildren","renderActiveVariant","variantStyles","getVariantContainerStyles","mergedStyles","Object","keys","length","variantContainerCss","containersMap","form","FormContainer","formProps","form_step","FormStepContainer","formStepProps","replicator","ReplicatorFormSetup","minInstances","maxInstances","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E,EAAsB,CAAE,wBAAyBhB,GAAO,CAAA,KACzD0D,YAEHwB,KAKN9E,SAAAA,IAICuF,GAAwE,CAC5EC,KAAMxB,EAACyB,EAAa,IAAKjF,GAAOkF,UAAY1F,SAAAA,IAC5C2F,UACE3B,EAAC4B,GACChG,GAAIA,KACAY,GAAOqF,cACX5F,SAAUA,EACV6B,eAAgBY,GAAoB1C,SAEnCA,IAGL8F,WACEvE,GAAcZ,EACZqD,EAAC+B,GACC1F,kBAAmBM,EACnBP,mBAAoBA,EACpB4F,aAAcxF,GAAOwF,aACrBC,aAAczF,GAAOyF,aAEpBjG,SAAA0E,KACmB,IAO5B,GAAa,eAAT7E,EACF,OAAOmE,EAAGkC,EAAA,CAAAlG,SAAAuF,GAAcO,aAO1B,OACE9B,EACE,MAAA,CAAApE,GAAIA,EAEJqE,UANO,gBAATpE,EAAyB,kCAAoC,iBAO3DgE,IAAKD,MACAhD,EAAsB,CAAE,wBAAyBhB,GAAO,CAAA,KACzD0D,GAAsBtD,SAEzBuF,GAAc1F,IAAgDG,GAN1D2D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,Fragment as e}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{memo as n}from"react";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import"../../contexts/ApiContext/ApiContext.js";import{useContainerRuntime as
|
|
1
|
+
import{jsx as t,Fragment as e}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{memo as n,useRef as o}from"react";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import"../../contexts/ApiContext/ApiContext.js";import{useContainerRuntime as i}from"../../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import{ContainerRuntimeContextProvider as r}from"../../contexts/ContainerRuntimeContext/ContainerRuntimeContextProvider.js";import"../../contexts/FormStepContext/FormStepContext.js";import"../../contexts/LayoutContext/LayoutContext.js";import"../../theme/theme.js";import"../../theme/provider.js";import"../../theme/toastStyles.js";import"../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../contexts/OrganismContext/OrganismContext.js";import{useOrganismContext as a}from"../../contexts/OrganismContext/useOrganismContext.js";import"../../contexts/PopupContext/PopupContext.js";import{useReplicatorForm as s}from"../../contexts/ReplicatorFormContext/ReplicatorFormContext.js";import"../../contexts/ReplicatorRegistryContext/ReplicatorRegistryContext.js";import"../../contexts/StateContext/StateContext.js";import"../../contexts/WebpageContext/WebpageContext.js";import{getDataByPath as c}from"../utils/dataPathUtils.js";const l=t=>{if(t&&"object"==typeof t&&!Array.isArray(t)){if("id"in t&&"string"==typeof t.id)return t.id;if("value"in t)return t.value}return t},d=t=>{const e={};for(const[n,o]of Object.entries(t))e[n]=l(o);return e},m=(t,e)=>{if(!t?.enabled||!t.sourceDataModelFieldId)return null;if(!e)return null;const n=e[t.sourceDataModelFieldId];if(null==n)return null;let o=null;if("string"==typeof n)o=n;else if("object"==typeof n)if("id"in n&&"string"==typeof n.id)o=n.id;else if("value"in n){const t=n.value;"string"==typeof t?o=t:"object"==typeof t&&t&&"id"in t&&(o=t.id)}return o&&console.log("[StyleVariant] resolveActiveVariant result:",o),o},f=(t,e,n)=>{if(!t)return{};if(e&&console.log("[StyleVariant] getVariantContainerStyles:",{activeVariant:e,presentation:n,configKeys:Object.keys(t),hasVariantKey:e in t}),e){const o=t[e];if(o&&"object"==typeof o&&n in o){const t=o[n];if(t&&"object"==typeof t){const{containerStyle:o}=t;return o&&"object"==typeof o?(console.log("[StyleVariant] Using variant-specific styles:",{activeVariant:e,presentation:n}),o):(console.log("[StyleVariant] Using variant-specific config (no containerStyle):",{activeVariant:e,presentation:n}),t)}}console.log("[StyleVariant] Variant config not found, falling back to default:",{activeVariant:e,presentation:n})}const o=t[n];if(o&&"object"==typeof o){const{containerStyle:t}=o;return t&&"object"==typeof t?t:o}return{}},p=n(({replicatorFieldId:n,nestedPathSegments:l=[],children:f,properties:p,config:u,renderWrapper:y})=>{const{localStateObject:x,formId:g}=a(),C=i(),j=s(),I=o(!1),h=p?.styleVariantConfig||u?.styleVariantConfig;!I.current&&h&&(console.log("[StyleVariant] ReplicatorContainer init:",{replicatorFieldId:n,hasLocalState:!!x&&Object.keys(x).length>0,hasStyleVariantConfig:!0}),I.current=!0);if(Boolean(g&&j)&&j){const{fieldArrayMethods:{fields:o}}=j;return t(e,{children:o.map((e,o)=>{const i=[...l,{dmfId:n||"default",index:o}],a=e,s=m(h,a),c={containerId:`replicator-${n||"default"}-${o}`,nestedPathSegments:i,itemIndex:o,itemDataByDmfId:a,rawItemDataByDmfId:a,activeVariant:s},d=y?y(o,f,s):f;return t("div",{"data-replicator-instance":`${n||"default"}-${o}`,children:t(r,{value:c,children:d})},e.id)})})}const v=x||{},V=C?.itemDataByDmfId?C.itemDataByDmfId:c(v,l),S=n?V?.[n]:V;if(!S||"object"!=typeof S){const e=n?[...l,{dmfId:n}]:l;return t(r,{value:{containerId:`replicator-${n||"default"}`,nestedPathSegments:e,itemDataByDmfId:{},activeVariant:null},children:y?y(void 0,f,null):f})}if(Array.isArray(S)){if(h?.enabled&&S.length>0){const t=d(S[0]),e=m(h,t);console.log("[StyleVariant] ReplicatorContainer iterating array:",{replicatorFieldId:n,arrayLength:S.length,firstItemKeys:Object.keys(t),firstResolvedVariant:e,sourceDataModelFieldId:h.sourceDataModelFieldId})}return t(e,{children:S.map((e,o)=>{const i=[...l,{dmfId:n||"default",index:o}],a=d(e),s=m(h,a);return t(r,{value:{containerId:`replicator-${n||"default"}-${o}`,nestedPathSegments:i,itemIndex:o,itemDataByDmfId:a,rawItemDataByDmfId:e,activeVariant:s},children:y?y(o,f,s):f},`${n||"default"}-${o}`)})})}const D=n?[...l,{dmfId:n}]:l,b=d(S),R=m(h,b);return t(r,{value:{containerId:`replicator-${n||"default"}`,nestedPathSegments:D,itemDataByDmfId:b,rawItemDataByDmfId:S,activeVariant:R},children:y?y(void 0,f,R):f})});export{p as ReplicatorContainer,f as getVariantContainerStyles,m as resolveActiveVariant};
|
|
2
2
|
//# sourceMappingURL=ReplicatorContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReplicatorContainer.js","sources":["../../../../../src/containers/ReplicatorContainer/ReplicatorContainer.tsx"],"sourcesContent":[null],"names":["unwrapScalarValue","value","Array","isArray","unwrapDmfData","data","unwrapped","key","Object","entries","resolveActiveVariant","styleVariantConfig","scopedData","enabled","sourceDataModelFieldId","fieldValue","normalizedValue","
|
|
1
|
+
{"version":3,"file":"ReplicatorContainer.js","sources":["../../../../../src/containers/ReplicatorContainer/ReplicatorContainer.tsx"],"sourcesContent":[null],"names":["unwrapScalarValue","value","Array","isArray","id","unwrapDmfData","data","unwrapped","key","Object","entries","resolveActiveVariant","styleVariantConfig","scopedData","enabled","sourceDataModelFieldId","fieldValue","normalizedValue","innerValue","console","log","getVariantContainerStyles","config","activeVariant","presentation","configKeys","keys","hasVariantKey","variantConfig","presentationConfig","containerStyle","defaultConfig","ReplicatorContainer","memo","replicatorFieldId","nestedPathSegments","children","properties","renderWrapper","localStateObject","formId","useOrganismContext","parentContext","useContainerRuntime","replicatorFormContext","useReplicatorForm","loggedInitRef","useRef","current","hasLocalState","length","hasStyleVariantConfig","Boolean","fieldArrayMethods","fields","_jsx","_Fragment","map","field","index","newPathSegments","dmfId","fieldData","contextValue","containerId","itemIndex","itemDataByDmfId","rawItemDataByDmfId","instanceContent","ContainerRuntimeContextProvider","dataRoot","currentScope","getDataByPath","undefined","firstItem","firstVariant","arrayLength","firstItemKeys","firstResolvedVariant","item","unwrappedItem","unwrappedValue"],"mappings":"mzCAaA,MAAMA,EAAqBC,IACzB,GAAIA,GAA0B,iBAAVA,IAAuBC,MAAMC,QAAQF,GAAQ,CAE/D,GAAI,OAAQA,GAAkD,iBAAjCA,EAA0BG,GACrD,OAAQH,EAAyBG,GAGnC,GAAI,UAAWH,EACb,OAAQA,EAA6BA,KAExC,CAED,OAAOA,GAMHI,EAAiBC,IAC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nB+D,YAAa,cAAc9B,GAAqB,YAChDC,mBAAoByB,EACpBM,gBAAiBe,EACjBd,mBAAoBlE,EACpBsB,iBAKGa,SAAAE,EAAgBA,OAAcmC,EAAWrC,EAAUb,GAAiBa"}
|
|
@@ -114,7 +114,10 @@ export interface LinkProperties {
|
|
|
114
114
|
externalLink?: Nullable<string>;
|
|
115
115
|
name?: string;
|
|
116
116
|
required?: boolean;
|
|
117
|
+
/** For dataDrivenLink: DMF ID containing URL or page ID */
|
|
117
118
|
sourceDataModelFieldId?: string;
|
|
119
|
+
/** For dataDrivenLink: Optional DMF ID containing record ID to pass to destination */
|
|
120
|
+
recordIdFieldId?: string;
|
|
118
121
|
}
|
|
119
122
|
export interface BooleanProperties {
|
|
120
123
|
attributeType: 'boolean';
|
|
@@ -36,6 +36,41 @@ export declare const navigateToLink: (link?: Nullable<string | LinkProperties>,
|
|
|
36
36
|
}) => void) | undefined) => void;
|
|
37
37
|
export declare const checkIsInternalLink: (link?: LinkProperties) => boolean;
|
|
38
38
|
export declare const checkIsDataDrivenLink: (link?: LinkProperties) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Determines if a URL is external (http/https) or internal (page ID)
|
|
41
|
+
* @param url - The URL to check
|
|
42
|
+
* @returns true if URL starts with http:// or https://
|
|
43
|
+
*/
|
|
44
|
+
export declare const isExternalUrl: (url: string) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Result of resolving a data-driven link
|
|
47
|
+
*/
|
|
48
|
+
export interface ResolvedDataDrivenLink {
|
|
49
|
+
/** The destination URL or internal link */
|
|
50
|
+
destination: string;
|
|
51
|
+
/** Whether this is an external URL */
|
|
52
|
+
isExternal: boolean;
|
|
53
|
+
/** Optional record ID to pass to destination (internal only) */
|
|
54
|
+
recordId?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Resolves a data-driven link to its destination and determines navigation type
|
|
58
|
+
*
|
|
59
|
+
* @param link - The LinkProperties object
|
|
60
|
+
* @param rawItemDataByDmfId - DMF data from container runtime context
|
|
61
|
+
* @returns Resolved link details or null if link cannot be resolved (disabled state)
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* // External URL
|
|
65
|
+
* const result = resolveDataDrivenLink(link, { urlField: 'https://example.com' });
|
|
66
|
+
* // Returns: { destination: 'https://example.com', isExternal: true }
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* // Internal page with record ID
|
|
70
|
+
* const result = resolveDataDrivenLink(link, { pageField: 'study-details', idField: 'S-001' });
|
|
71
|
+
* // Returns: { destination: '?webpageId=study-details', isExternal: false, recordId: 'S-001' }
|
|
72
|
+
*/
|
|
73
|
+
export declare const resolveDataDrivenLink: (link: LinkProperties, rawItemDataByDmfId: Record<string, unknown> | undefined) => ResolvedDataDrivenLink | null;
|
|
39
74
|
export declare const addInternalParamsToCurrentLink: (internalLink?: Nullable<string>, isPreview?: boolean) => string | undefined;
|
|
40
75
|
export declare const getHref: (link?: LinkProperties, isPreview?: boolean) => Nullable<string> | undefined;
|
|
41
76
|
export declare const parseDescendantContent: (string: string) => CustomDescendant[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../contexts/AccountButtonContext/AccountButtonContext.js";import"react/jsx-runtime";import"../node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js";import"react";import"../node_modules/stylis/dist/umd/stylis.js";import"../node_modules/@babel/runtime/helpers/extends.js";import"../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";import"../contexts/ApiContext/ApiContext.js";import"../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import"../contexts/FormStepContext/FormStepContext.js";import"../contexts/LayoutContext/LayoutContext.js";import"../theme/theme.js";import"../theme/provider.js";import"../theme/toastStyles.js";import"../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../contexts/OrganismContext/OrganismContext.js";import"../contexts/PopupContext/PopupContext.js";import"../contexts/ReplicatorFormContext/ReplicatorFormContext.js";import"../contexts/ReplicatorRegistryContext/ReplicatorRegistryContext.js";import"../contexts/StateContext/StateContext.js";import"../contexts/WebpageContext/WebpageContext.js";import"../molecules/Button/Button.js";import"@tanstack/react-query";import{decodeBase64UrlToObject as t}from"./rwoContext.js";export{encodeObjectToBase64Url,getByPath}from"./rwoContext.js";import{paramKeys as e}from"../constants/params.js";import{urlPattern as o}from"./validations.js";import"../node_modules/@emotion/react/dist/emotion-react.esm.js";import"../components/Buttons/TextButton.js";import"../components/Buttons/TouchableOpacity.js";import"../components/Circle/Circle.js";import"../components/CircularIndicator/CircularIndicator.js";import"../components/ContentWrapper/ContentWrapper.js";import"../components/CustomValidation/CustomValidation.js";import"../components/HorizontalButtons/HorizontalButtons.js";import"../components/Input/Input.js";import"../components/Paddings/Paddings.js";import"../components/PdfDocument/PdfDocument.js";import"../components/RadioButtons/RadioButtons.js";import"../components/RegularImage/RegularImage.js";import{richTextDefaultValue as n}from"../components/RichTextViewer/RichTextViewer.js";import"../node_modules/slate/dist/index.es.js";import"../components/TextWrapper/TextWrapper.js";import"../components/Select/styles.js";import"../components/Spacer/Spacer.js";import"../components/Spinner/Spinner.js";import{toast as r}from"../components/Toast/toast.js";import"../components/Tooltip/Tooltip.js";import"../components/ValidationTag/ValidationTag.js";import"../components/ZealUIModal/ZealUIModal.js";const i=t=>{if(o.test(t)){window.open(t,"_blank","noopener,noreferrer")&&setTimeout(()=>{window.blur()},100)}},s=(t,e)=>{if(!e||"string"!=typeof e)return"";const o=e.match(new RegExp(`[?&]${t}=([^&]*)`));return o?decodeURIComponent(o[1]):""},
|
|
1
|
+
import"../contexts/AccountButtonContext/AccountButtonContext.js";import"react/jsx-runtime";import"../node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js";import"react";import"../node_modules/stylis/dist/umd/stylis.js";import"../node_modules/@babel/runtime/helpers/extends.js";import"../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";import"../contexts/ApiContext/ApiContext.js";import"../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import"../contexts/FormStepContext/FormStepContext.js";import"../contexts/LayoutContext/LayoutContext.js";import"../theme/theme.js";import"../theme/provider.js";import"../theme/toastStyles.js";import"../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../contexts/OrganismContext/OrganismContext.js";import"../contexts/PopupContext/PopupContext.js";import"../contexts/ReplicatorFormContext/ReplicatorFormContext.js";import"../contexts/ReplicatorRegistryContext/ReplicatorRegistryContext.js";import"../contexts/StateContext/StateContext.js";import"../contexts/WebpageContext/WebpageContext.js";import"../molecules/Button/Button.js";import"@tanstack/react-query";import{decodeBase64UrlToObject as t}from"./rwoContext.js";export{encodeObjectToBase64Url,getByPath}from"./rwoContext.js";import{paramKeys as e}from"../constants/params.js";import{urlPattern as o}from"./validations.js";import"../node_modules/@emotion/react/dist/emotion-react.esm.js";import"../components/Buttons/TextButton.js";import"../components/Buttons/TouchableOpacity.js";import"../components/Circle/Circle.js";import"../components/CircularIndicator/CircularIndicator.js";import"../components/ContentWrapper/ContentWrapper.js";import"../components/CustomValidation/CustomValidation.js";import"../components/HorizontalButtons/HorizontalButtons.js";import"../components/Input/Input.js";import"../components/Paddings/Paddings.js";import"../components/PdfDocument/PdfDocument.js";import"../components/RadioButtons/RadioButtons.js";import"../components/RegularImage/RegularImage.js";import{richTextDefaultValue as n}from"../components/RichTextViewer/RichTextViewer.js";import"../node_modules/slate/dist/index.es.js";import"../components/TextWrapper/TextWrapper.js";import"../components/Select/styles.js";import"../components/Spacer/Spacer.js";import"../components/Spinner/Spinner.js";import{toast as r}from"../components/Toast/toast.js";import"../components/Tooltip/Tooltip.js";import"../components/ValidationTag/ValidationTag.js";import"../components/ZealUIModal/ZealUIModal.js";const i=t=>{if(o.test(t)){window.open(t,"_blank","noopener,noreferrer")&&setTimeout(()=>{window.blur()},100)}},s=(t,e)=>{if(!e||"string"!=typeof e)return"";const o=e.match(new RegExp(`[?&]${t}=([^&]*)`));return o?decodeURIComponent(o[1]):""},a=e=>{const o=e||window.location.href,n=s("rwoContext",o);if(n)try{const e=t(n);if(e){const t=[];return Object.entries(e).forEach(([e,o])=>{o&&"object"==typeof o&&"rwoRecordId"in o&&o.rwoRecordId&&t.push({organismId:e,recordId:o.rwoRecordId})}),t}}catch(i){}const r=s("rwoTargets",o);if(!r)return[];try{return r.split(",").map(t=>{const[e,o]=t.split(":");return{organismId:e,recordId:o}}).filter(t=>t.organismId&&t.recordId)}catch(i){return[]}},c=(e,o)=>{const n=o||window.location.href,r=s("rwoContext",n);if(r)try{const o=t(r),n=o?.[e];if(n&&"object"==typeof n&&"rwoRecordId"in n)return n.rwoRecordId}catch(i){}return s("rwoRecordId",n)||void 0},p=(t,o,n=!1)=>{if(!o)return t;const r=s(e.internalLinkWebpageId,o),i=s(e.internalLinkApplicationId,o);if(!r||!i)return t;const a=new URLSearchParams(t.toString());return n?(t.has(e.previewApplicationId)&&a.set(e.previewApplicationId,i),t.has(e.previewSelectedWebpageId)&&a.set(e.previewSelectedWebpageId,r)):(t.has(e.runtimeSelectedWebpageId)&&a.set(e.runtimeSelectedWebpageId,r),a.set(e.runtimeSelectedWebpageId,r)),a},d=async(t="",e="Downloaded file")=>{try{const o=await fetch(t),n=await o.blob(),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}catch(o){r({message:`Failed to download the file: ${o}`,type:"error"})}},m=t=>{if(!t)return;if("object"==typeof t&&"type"in t){const e=t;if(f(e))return;return u(e.externalLink)}return u(t)},l=(t,e)=>{if(t){if("object"==typeof t&&"type"in t){const o=t;if(g(o))return;return f(o)?void(e&&o.internalLink?e({link:o.internalLink}):o.internalLink&&(window.location.href=o.internalLink)):m(o.externalLink)}return m(t)}},u=t=>{if(!t||"string"!=typeof t)return;if(o.test(t))try{const e=window.open(t,"_blank","noopener,noreferrer");if(e){[20,120,300,600].forEach(t=>{setTimeout(()=>{try{e.blur()}catch(t){}try{window.focus()}catch(t){}},t)})}}catch(e){}else try{console.error("navigateToExternalLink: invalid external URL",{url:t})}catch(e){}},f=t=>{if(!t)return!1;const e=t?.type||t?.linkType;return"internal_link"===e||"internalLink"===e},g=t=>!!t&&("data_driven_link"===t.type||"dataDrivenLink"===t.type),x=t=>/^https?:\/\//i.test(t),j=t=>{if(null!=t){if("object"==typeof t&&null!==t){const e=t;if("id"in e&&("string"==typeof e.id||"number"==typeof e.id))return String(e.id);if("value"in e&&("string"==typeof e.value||"number"==typeof e.value))return String(e.value)}return"string"==typeof t?t:"number"==typeof t?String(t):void 0}},w=(t,e)=>{if(!g(t))return null;if(!t.sourceDataModelFieldId)return null;const o=j(e?.[t.sourceDataModelFieldId]);if(!o)return null;const n=t.recordIdFieldId?j(e?.[t.recordIdFieldId]):void 0,r=x(o);return{destination:r?o:`?webpageId=${encodeURIComponent(o)}`,isExternal:r,recordId:n}},h=(t,e)=>{if(!t)return;const o=new URL(window.location.href),n=p(o.searchParams,t,e);return o.search=n.toString(),o.toString()},I=(t,e)=>{if(t)return f(t)?h(t?.internalLink,e):t?.externalLink},y=t=>{const e=t?.replace(/\\/g,"");try{return JSON.parse(t)}catch(o){try{return JSON.parse(e)}catch(r){return n}}},C=t=>{if(!t)return null;try{const e=t.startsWith("http")?t:new URL(t,window.location.origin).toString();return new URL(e)}catch(e){return null}},b=(t,e)=>{const o=C(t);if(!o)return;return o.searchParams.get(e)??void 0},R=t=>{if(!t)return;const o=C(t);if(o){const t=o.searchParams,n=t.get(e.internalLinkWebpageId)||t.get(e.runtimeSelectedWebpageId)||t.get(e.previewSelectedWebpageId);if(n)return n;const r=(o.pathname||"").split("/").map(t=>t.trim()).filter(t=>t.length>0);for(const o of r){const[t,n]=o.split("=");if(t&&null!=n&&(t===e.internalLinkWebpageId||t===e.runtimeSelectedWebpageId||t===e.previewSelectedWebpageId))return decodeURIComponent(n)}}const n=t.split("/").map(t=>t.trim()).filter(t=>t.length>0);for(const r of n){const[t,o]=r.split("=");if(t&&null!=o&&(t===e.internalLinkWebpageId||t===e.runtimeSelectedWebpageId||t===e.previewSelectedWebpageId))return decodeURIComponent(o)}},S=()=>{try{const t=new URLSearchParams(window.location.search||"");return t.get(e.runtimeSelectedWebpageId)||t.get(e.previewSelectedWebpageId)||void 0}catch(t){return}};export{h as addInternalParamsToCurrentLink,g as checkIsDataDrivenLink,f as checkIsInternalLink,d as downloadFile,I as getHref,b as getParamFromInternalLink,s as getParameterByName,c as getRwoRecordIdForOrganism,a as getRwoTargets,R as getSelectedWebpageIdFromInternalLink,S as getSelectedWebpageIdFromLocation,x as isExternalUrl,m as navigateToExternalLink,l as navigateToLink,y as parseDescendantContent,C as parseInternalLink,w as resolveDataDrivenLink,p as updateSearchParams,i as validateAndOpenUrl};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../src/helpers/utils.ts"],"sourcesContent":[null],"names":["validateAndOpenUrl","url","urlPattern","test","window","open","setTimeout","blur","getParameterByName","name","match","RegExp","decodeURIComponent","getRwoTargets","urlToParse","location","href","rwoContextParam","rwoContext","decodeBase64UrlToObject","targets","Object","entries","forEach","organismId","context","rwoRecordId","push","recordId","_err","rwoTargetsParam","split","map","target","filter","getRwoRecordIdForOrganism","organismContext","undefined","updateSearchParams","currentParams","internalLink","isPreview","webpageId","paramKeys","internalLinkWebpageId","applicationId","internalLinkApplicationId","newSearchParams","URLSearchParams","toString","has","previewApplicationId","set","previewSelectedWebpageId","runtimeSelectedWebpageId","downloadFile","async","response","fetch","blob","blobUrl","URL","createObjectURL","a","document","createElement","download","click","revokeObjectURL","error","toast","message","type","navigateToExternalLink","link","linkProps","checkIsInternalLink","openExternalUrl","externalLink","navigateToLink","onInternalNavigation","checkIsDataDrivenLink","newWindow","delay","focus","console","linkType","addInternalParamsToCurrentLink","searchParams","search","getHref","parseDescendantContent","string","parsedValue","replace","JSON","parse","e","richTextDefaultValue","parseInternalLink","startsWith","origin","_e","getParamFromInternalLink","param","get","getSelectedWebpageIdFromInternalLink","qp","fromQuery","segments","pathname","s","trim","length","seg","k","v","getSelectedWebpageIdFromLocation","params"],"mappings":"u/EAQA,MAEaA,EAAsBC,IACjC,GAAKC,EAAWC,KAAKF,GAGrB,CACoBG,OAAOC,KAAKJ,EAAK,SAAU,wBAG3CK,WAAW,KACTF,OAAOG,QACN,IAEN,GAGUC,EAAqB,CAACC,EAAcR,KAC/C,IAAKA,GAAsB,iBAARA,EAAkB,MAAO,GAG5C,MAAMS,EAAQT,EAAIS,MAAM,IAAIC,OAAO,OAAOF,cAE1C,OAAOC,EAAQE,mBAAmBF,EAAM,IAAM,IAQnCG,EAAiBZ,IAC5B,MAAMa,EAAab,GAAOG,OAAOW,SAASC,KAGpCC,EAAkBT,EAAmB,aAAcM,GACzD,GAAIG,EACF,IACE,MAAMC,EAAaC,EAAwBF,GAK3C,GAAIC,EAAY,CACd,MAAME,EAA2D,GAcjE,OAXAC,OAAOC,QAAQJ,GAAYK,QAAQ,EAAEC,EAAYC,MAE7CA,GACmB,iBAAZA,GACP,gBAAiBA,GACjBA,EAAQC,aAERN,EAAQO,KAAK,CAAEH,aAAYI,SAAUH,EAAQC,gBAI1CN,CACR,CACF,CAAC,MAAOS,GAER,CAIH,MAAMC,EAAkBtB,EAAmB,aAAcM,GACzD,IAAKgB,EAAiB,MAAO,GAE7B,IAEE,OAAOA,EACJC,MAAM,KACNC,IAAKC,IACJ,MAAOT,EAAYI,GAAYK,EAAOF,MAAM,KAC5C,MAAO,CAAEP,aAAYI,cAEtBM,OAAQD,GAAWA,EAAOT,YAAcS,EAAOL,SACnD,CAAC,MAAOC,GAEP,MAAO,EACR,GASUM,EAA4B,CAACX,EAAoBvB,KAC5D,MAAMa,EAAab,GAAOG,OAAOW,SAASC,KAGpCC,EAAkBT,EAAmB,aAAcM,GACzD,GAAIG,EACF,IACE,MAAMC,EAAaC,EAAwBF,GAKrCmB,EAAkBlB,IAAaM,GACrC,GACEY,GAC2B,iBAApBA,GACP,gBAAiBA,EAEjB,O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GAAY,OACtC,OAAIC,EAAoBD,QAElBK,GAAwBL,EAAUnC,aACpCwC,EAAqB,CAAEN,KAAMC,EAAUnC,eAC9BmC,EAAUnC,eACnBpC,OAAOW,SAASC,KAAO2D,EAAUnC,eAK9BiC,EAAuBE,EAAUG,aACzC,CAGD,OAAOL,EAAuBC,EArBZ,GA4BdG,EAAmB5E,IACvB,IAAKA,GAAsB,iBAARA,EAAkB,OAIrC,GADmBC,EAAWC,KAAKF,GAWnC,IAEE,MAAMiF,EAAY9E,OAAOC,KAAKJ,EAAK,SAAU,uBAC7C,GAAIiF,EAAW,CAEI,CAAC,GAAI,IAAK,IAAK,KACvB3D,QAAS4D,IAChB7E,WAAW,KACT,IACE4E,EAAU3E,MACX,CAAC,MAAOsB,GAER,CACD,IACEzB,OAAOgF,OACR,CAAC,MAAOvD,GAER,GACAsD,IAEN,CACF,CAAC,MAAOtD,GAER,MAhCC,IAEEwD,QAAQhB,MAAM,+CAAgD,CAAEpE,OACjE,CAAC,MAAO4B,GAER,GA8BQ+C,EAAuBF,IAClC,IAAKA,EAAM,OAAO,EAElB,MAAMY,EAAWZ,GAAMF,MAASE,GAAcY,SAC9C,MAAoB,kBAAbA,GAA6C,iBAAbA,GAG5BL,EAAyBP,KAClCA,IAAuB,qBAAdA,EAAKF,MAA6C,mBAAdE,EAAKF,
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../src/helpers/utils.ts"],"sourcesContent":[null],"names":["validateAndOpenUrl","url","urlPattern","test","window","open","setTimeout","blur","getParameterByName","name","match","RegExp","decodeURIComponent","getRwoTargets","urlToParse","location","href","rwoContextParam","rwoContext","decodeBase64UrlToObject","targets","Object","entries","forEach","organismId","context","rwoRecordId","push","recordId","_err","rwoTargetsParam","split","map","target","filter","getRwoRecordIdForOrganism","organismContext","undefined","updateSearchParams","currentParams","internalLink","isPreview","webpageId","paramKeys","internalLinkWebpageId","applicationId","internalLinkApplicationId","newSearchParams","URLSearchParams","toString","has","previewApplicationId","set","previewSelectedWebpageId","runtimeSelectedWebpageId","downloadFile","async","response","fetch","blob","blobUrl","URL","createObjectURL","a","document","createElement","download","click","revokeObjectURL","error","toast","message","type","navigateToExternalLink","link","linkProps","checkIsInternalLink","openExternalUrl","externalLink","navigateToLink","onInternalNavigation","checkIsDataDrivenLink","newWindow","delay","focus","console","linkType","isExternalUrl","extractDmfStringValue","data","obj","id","String","value","resolveDataDrivenLink","rawItemDataByDmfId","sourceDataModelFieldId","linkValue","recordIdFieldId","isExternal","destination","encodeURIComponent","addInternalParamsToCurrentLink","searchParams","search","getHref","parseDescendantContent","string","parsedValue","replace","JSON","parse","e","richTextDefaultValue","parseInternalLink","startsWith","origin","_e","getParamFromInternalLink","param","get","getSelectedWebpageIdFromInternalLink","qp","fromQuery","segments","pathname","s","trim","length","seg","k","v","getSelectedWebpageIdFromLocation","params"],"mappings":"u/EAQA,MAEaA,EAAsBC,IACjC,GAAKC,EAAWC,KAAKF,GAGrB,CACoBG,OAAOC,KAAKJ,EAAK,SAAU,wBAG3CK,WAAW,KACTF,OAAOG,QACN,IAEN,GAGUC,EAAqB,CAACC,EAAcR,KAC/C,IAAKA,GAAsB,iBAARA,EAAkB,MAAO,GAG5C,MAAMS,EAAQT,EAAIS,MAAM,IAAIC,OAAO,OAAOF,cAE1C,OAAOC,EAAQE,mBAAmBF,EAAM,IAAM,IAQnCG,EAAiBZ,IAC5B,MAAMa,EAAab,GAAOG,OAAOW,SAASC,KAGpCC,EAAkBT,EAAmB,aAAcM,GACzD,GAAIG,EACF,IACE,MAAMC,EAAaC,EAAwBF,GAK3C,GAAIC,EAAY,CACd,MAAME,EAA2D,GAcjE,OAXAC,OAAOC,QAAQJ,GAAYK,QAAQ,EAAEC,EAAYC,MAE7CA,GACmB,iBAAZA,GACP,gBAAiBA,GACjBA,EAAQC,aAERN,EAAQO,KAAK,CAAEH,aAAYI,SAAUH,EAAQC,gBAI1CN,CACR,CACF,CAAC,MAAOS,GAER,CAIH,MAAMC,EAAkBtB,EAAm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