@stack-spot/portal-layout 2.25.0 → 2.25.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/CHANGELOG.md +7 -0
- package/dist/components/TypeForm/index.d.ts +2 -5
- package/dist/components/TypeForm/index.d.ts.map +1 -1
- package/dist/components/TypeForm/index.js +5 -2
- package/dist/components/TypeForm/index.js.map +1 -1
- package/dist/components/TypeForm/show-typeform-modal.d.ts.map +1 -1
- package/dist/components/TypeForm/show-typeform-modal.js +1 -2
- package/dist/components/TypeForm/show-typeform-modal.js.map +1 -1
- package/package.json +1 -1
- package/src/components/TypeForm/index.tsx +10 -15
- package/src/components/TypeForm/show-typeform-modal.tsx +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.25.1](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.25.0...portal-layout@v2.25.1) (2025-02-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* typeform to be agnostic ([#707](https://github.com/stack-spot/portal-commons/issues/707)) ([25d438b](https://github.com/stack-spot/portal-commons/commit/25d438b51de83d9b656abf8d6125addeaa63de99))
|
|
9
|
+
|
|
3
10
|
## [2.25.0](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.24.1...portal-layout@v2.25.0) (2025-02-07)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
export interface TypeFormProps {
|
|
2
2
|
dataTfLive: string;
|
|
3
|
-
|
|
4
|
-
userId: string;
|
|
5
|
-
appId?: string;
|
|
6
|
-
infraId?: string;
|
|
3
|
+
hiddenProps: Record<string, string | number>;
|
|
7
4
|
}
|
|
8
|
-
export declare const TypeForm: ({ dataTfLive,
|
|
5
|
+
export declare const TypeForm: ({ dataTfLive, hiddenProps, }: TypeFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TypeForm/index.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TypeForm/index.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CAC9C;AAED,eAAO,MAAM,QAAQ,iCAGlB,aAAa,4CAiCf,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Flex } from '@citric/core';
|
|
3
3
|
import { LoadingCircular } from '@citric/ui';
|
|
4
4
|
import { useEffect, useMemo, useState } from 'react';
|
|
5
|
-
export const TypeForm = ({ dataTfLive,
|
|
5
|
+
export const TypeForm = ({ dataTfLive, hiddenProps, }) => {
|
|
6
6
|
const [isLoading, setIsLoading] = useState(true);
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
window.tf?.load();
|
|
@@ -10,7 +10,10 @@ export const TypeForm = ({ dataTfLive, orgId, userId, appId, infraId, }) => {
|
|
|
10
10
|
setIsLoading(false);
|
|
11
11
|
}, 2000);
|
|
12
12
|
}, []);
|
|
13
|
-
const
|
|
13
|
+
const hiddenPropsString = useMemo(() => Object.entries(hiddenProps)
|
|
14
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
15
|
+
.join(','), [hiddenProps]);
|
|
16
|
+
const typeform = useMemo(() => _jsx(Box, { children: _jsx("div", { "data-tf-live": dataTfLive, "data-tf-hidden": hiddenPropsString }) }), [dataTfLive, hiddenPropsString]);
|
|
14
17
|
return (_jsxs(Box, { sx: { minWidth: '650px', minHeight: '500px' }, children: [isLoading && _jsx(Flex, { alignItems: "center", justifyContent: "center", w: "12", sx: { height: '100%' }, children: _jsx(LoadingCircular, {}) }), _jsx(Box, { sx: { opacity: isLoading ? '0' : 1 }, children: typeform })] }));
|
|
15
18
|
};
|
|
16
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TypeForm/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TypeForm/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAOpD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EACvB,UAAU,EACV,WAAW,GACG,EAAE,EAAE;IAGlB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAEhD,SAAS,CAAC,GAAG,EAAE;QACZ,MAAc,CAAC,EAAE,EAAE,IAAI,EAAE,CAAA;QAC1B,UAAU,CAAC,GAAG,EAAE;YACd,YAAY,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC,EAAE,IAAI,CAAC,CAAA;IACV,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;SAChE,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;SACxC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;IAE5B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,KAAC,GAAG,cACjC,8BACgB,UAAU,oBACR,iBAAiB,GACjC,GACE,EAAE,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAA;IAExC,OAAO,CACL,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,aAC/C,SAAS,IAAI,KAAC,IAAI,IAAC,UAAU,EAAC,QAAQ,EAAC,cAAc,EAAC,QAAQ,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAC3F,KAAC,eAAe,KAAG,GACd,EACP,KAAC,GAAG,IAAC,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,YACtC,QAAQ,GACL,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show-typeform-modal.d.ts","sourceRoot":"","sources":["../../../src/components/TypeForm/show-typeform-modal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,aAAa,EAAE,MAAM,GAAG,CAAA;AAE3C,eAAO,MAAM,iBAAiB,wBAAyB,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"show-typeform-modal.d.ts","sourceRoot":"","sources":["../../../src/components/TypeForm/show-typeform-modal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,aAAa,EAAE,MAAM,GAAG,CAAA;AAE3C,eAAO,MAAM,iBAAiB,wBAAyB,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,SAMvF,CAAA"}
|
|
@@ -2,10 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { overlay } from '../../LayoutOverlayManager.js';
|
|
3
3
|
import { TypeForm } from './index.js';
|
|
4
4
|
export const showTypeFormModal = ({ title, ...props }) => {
|
|
5
|
-
const { dataTfLive, orgId, userId, appId, infraId } = props;
|
|
6
5
|
overlay.showModal({
|
|
7
6
|
title: title,
|
|
8
|
-
children: _jsx(TypeForm, {
|
|
7
|
+
children: _jsx(TypeForm, { ...props }),
|
|
9
8
|
size: 'large',
|
|
10
9
|
});
|
|
11
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show-typeform-modal.js","sourceRoot":"","sources":["../../../src/components/TypeForm/show-typeform-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAiB,MAAM,GAAG,CAAA;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAqC,EAAE,EAAE;IAC1F,
|
|
1
|
+
{"version":3,"file":"show-typeform-modal.js","sourceRoot":"","sources":["../../../src/components/TypeForm/show-typeform-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAiB,MAAM,GAAG,CAAA;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAqC,EAAE,EAAE;IAC1F,OAAO,CAAC,SAAS,CAAC;QAChB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAC,QAAQ,OAAK,KAAK,GAAI;QACjC,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -4,18 +4,12 @@ import { useEffect, useMemo, useState } from 'react'
|
|
|
4
4
|
|
|
5
5
|
export interface TypeFormProps {
|
|
6
6
|
dataTfLive: string,
|
|
7
|
-
|
|
8
|
-
userId: string,
|
|
9
|
-
appId?: string,
|
|
10
|
-
infraId?: string,
|
|
7
|
+
hiddenProps: Record<string, string | number>,
|
|
11
8
|
}
|
|
12
9
|
|
|
13
10
|
export const TypeForm = ({
|
|
14
11
|
dataTfLive,
|
|
15
|
-
|
|
16
|
-
userId,
|
|
17
|
-
appId,
|
|
18
|
-
infraId,
|
|
12
|
+
hiddenProps,
|
|
19
13
|
}: TypeFormProps) => {
|
|
20
14
|
|
|
21
15
|
|
|
@@ -28,15 +22,16 @@ export const TypeForm = ({
|
|
|
28
22
|
}, 2000)
|
|
29
23
|
}, [])
|
|
30
24
|
|
|
25
|
+
const hiddenPropsString = useMemo(() => Object.entries(hiddenProps)
|
|
26
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
27
|
+
.join(','), [hiddenProps])
|
|
28
|
+
|
|
31
29
|
const typeform = useMemo(() => <Box>
|
|
32
|
-
|
|
33
|
-
data-tf-live={dataTfLive}
|
|
34
|
-
data-tf-hidden={`org_id=${orgId},user_id=${userId},app_id=${appId}`}
|
|
35
|
-
/> : <div
|
|
30
|
+
<div
|
|
36
31
|
data-tf-live={dataTfLive}
|
|
37
|
-
data-tf-hidden={
|
|
38
|
-
/>
|
|
39
|
-
</Box>, [])
|
|
32
|
+
data-tf-hidden={hiddenPropsString}
|
|
33
|
+
/>
|
|
34
|
+
</Box>, [dataTfLive, hiddenPropsString])
|
|
40
35
|
|
|
41
36
|
return (
|
|
42
37
|
<Box sx={{ minWidth: '650px', minHeight: '500px' }}>
|
|
@@ -2,10 +2,9 @@ import { overlay } from '../../LayoutOverlayManager'
|
|
|
2
2
|
import { TypeForm, TypeFormProps } from '.'
|
|
3
3
|
|
|
4
4
|
export const showTypeFormModal = ({ title, ...props }: TypeFormProps & { title: string }) => {
|
|
5
|
-
const { dataTfLive, orgId, userId, appId, infraId } = props
|
|
6
5
|
overlay.showModal({
|
|
7
6
|
title: title,
|
|
8
|
-
children: <TypeForm
|
|
7
|
+
children: <TypeForm {...props} />,
|
|
9
8
|
size: 'large',
|
|
10
9
|
})
|
|
11
10
|
}
|