@microsoft/omnichannel-chat-components 1.1.13 → 1.1.14
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/lib/cjs/common/Constants.js +1 -0
- package/lib/cjs/components/citationpane/CitationPane.js +132 -0
- package/lib/cjs/components/citationpane/ScalingTest.js +77 -0
- package/lib/cjs/components/citationpane/common/defaultProps/defaultCitationPaneControlProps.js +22 -0
- package/lib/cjs/components/citationpane/common/defaultProps/defaultCitationPaneProps.js +16 -0
- package/lib/cjs/components/citationpane/common/defaultProps/defaultCitationPaneStyleProps.js +25 -0
- package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonStyles.js +40 -0
- package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneContentStyles.js +21 -0
- package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneGeneralStyles.js +29 -0
- package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneTitleStyles.js +8 -0
- package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonStyles.js +43 -0
- package/lib/cjs/components/citationpane/interfaces/ICitationPaneClassNames.js +1 -0
- package/lib/cjs/components/citationpane/interfaces/ICitationPaneComponentOverrides.js +1 -0
- package/lib/cjs/components/citationpane/interfaces/ICitationPaneControlProps.js +1 -0
- package/lib/cjs/components/citationpane/interfaces/ICitationPaneProps.js +1 -0
- package/lib/cjs/components/citationpane/interfaces/ICitationPaneStyleProps.js +1 -0
- package/lib/cjs/index.js +8 -0
- package/lib/esm/common/Constants.js +1 -0
- package/lib/esm/components/citationpane/CitationPane.js +106 -0
- package/lib/esm/components/citationpane/ScalingTest.js +64 -0
- package/lib/esm/components/citationpane/common/defaultProps/defaultCitationPaneControlProps.js +15 -0
- package/lib/esm/components/citationpane/common/defaultProps/defaultCitationPaneProps.js +6 -0
- package/lib/esm/components/citationpane/common/defaultProps/defaultCitationPaneStyleProps.js +12 -0
- package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonStyles.js +33 -0
- package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneContentStyles.js +14 -0
- package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneGeneralStyles.js +22 -0
- package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneTitleStyles.js +1 -0
- package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonStyles.js +36 -0
- package/lib/esm/components/citationpane/interfaces/ICitationPaneClassNames.js +1 -0
- package/lib/esm/components/citationpane/interfaces/ICitationPaneComponentOverrides.js +1 -0
- package/lib/esm/components/citationpane/interfaces/ICitationPaneControlProps.js +1 -0
- package/lib/esm/components/citationpane/interfaces/ICitationPaneProps.js +1 -0
- package/lib/esm/components/citationpane/interfaces/ICitationPaneStyleProps.js +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/types/common/Constants.d.ts +1 -0
- package/lib/types/components/citationpane/CitationPane.d.ts +4 -0
- package/lib/types/components/citationpane/ScalingTest.d.ts +7 -0
- package/lib/types/components/citationpane/common/defaultProps/defaultCitationPaneControlProps.d.ts +2 -0
- package/lib/types/components/citationpane/common/defaultProps/defaultCitationPaneProps.d.ts +2 -0
- package/lib/types/components/citationpane/common/defaultProps/defaultCitationPaneStyleProps.d.ts +2 -0
- package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonStyles.d.ts +2 -0
- package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneContentStyles.d.ts +2 -0
- package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneGeneralStyles.d.ts +2 -0
- package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneTitleStyles.d.ts +2 -0
- package/lib/types/components/citationpane/common/defaultStyles/defaultCitationPaneTopCloseButtonStyles.d.ts +2 -0
- package/lib/types/components/citationpane/interfaces/ICitationPaneClassNames.d.ts +7 -0
- package/lib/types/components/citationpane/interfaces/ICitationPaneComponentOverrides.d.ts +7 -0
- package/lib/types/components/citationpane/interfaces/ICitationPaneControlProps.d.ts +16 -0
- package/lib/types/components/citationpane/interfaces/ICitationPaneProps.d.ts +8 -0
- package/lib/types/components/citationpane/interfaces/ICitationPaneStyleProps.d.ts +10 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -42,6 +42,7 @@ exports.ElementType = ElementType;
|
|
|
42
42
|
ElementType["ReconnectChatPane"] = "ReconnectChatPane";
|
|
43
43
|
ElementType["ConfirmationPaneConfirmButton"] = "ConfirmationPaneConfirmButton";
|
|
44
44
|
ElementType["ConfirmationPaneCancelButton"] = "ConfirmationPaneCancelButton";
|
|
45
|
+
ElementType["CitationPaneCloseButton"] = "CitationPaneCloseButton";
|
|
45
46
|
ElementType["PreChatSurveySubmitButton"] = "PreChatSurveySubmitButton";
|
|
46
47
|
ElementType["PreChatSurveyError"] = "PreChatSurveyError";
|
|
47
48
|
ElementType["IncomingCallDeclineCallButton"] = "IncomingCallDeclineCallButton";
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@fluentui/react");
|
|
9
|
+
|
|
10
|
+
var _Constants = require("../../common/Constants");
|
|
11
|
+
|
|
12
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _BroadcastService = require("../../services/BroadcastService");
|
|
15
|
+
|
|
16
|
+
var _decodeComponentString = require("../../common/decodeComponentString");
|
|
17
|
+
|
|
18
|
+
var _defaultCitationPaneCloseButtonStyles = require("./common/defaultStyles/defaultCitationPaneCloseButtonStyles");
|
|
19
|
+
|
|
20
|
+
var _defaultCitationPaneContentStyles = require("./common/defaultStyles/defaultCitationPaneContentStyles");
|
|
21
|
+
|
|
22
|
+
var _defaultCitationPaneControlProps = require("./common/defaultProps/defaultCitationPaneControlProps");
|
|
23
|
+
|
|
24
|
+
var _defaultCitationPaneGeneralStyles = require("./common/defaultStyles/defaultCitationPaneGeneralStyles");
|
|
25
|
+
|
|
26
|
+
var _defaultCitationPaneTitleStyles = require("./common/defaultStyles/defaultCitationPaneTitleStyles");
|
|
27
|
+
|
|
28
|
+
var _defaultCitationPaneTopCloseButtonStyles = require("./common/defaultStyles/defaultCitationPaneTopCloseButtonStyles");
|
|
29
|
+
|
|
30
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
|
+
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
+
|
|
34
|
+
function CitationPane(props) {
|
|
35
|
+
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$controlProps4, _props$styleProps5, _props$controlProps5, _props$styleProps6, _props$styleProps6$cl, _props$controlProps6, _props$componentOverr, _props$controlProps7, _props$styleProps7, _props$styleProps7$cl, _props$controlProps8, _props$componentOverr2, _props$styleProps8, _props$styleProps8$cl, _props$controlProps9, _props$styleProps9, _props$styleProps9$cl, _props$controlProps10, _props$controlProps11, _props$componentOverr3, _props$controlProps12, _props$controlProps13, _props$styleProps10, _props$styleProps10$c;
|
|
36
|
+
|
|
37
|
+
const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultCitationPaneControlProps.defaultCitationPaneControlProps.id;
|
|
38
|
+
const handleClose = (0, _react2.useCallback)(() => {
|
|
39
|
+
var _props$controlProps2;
|
|
40
|
+
|
|
41
|
+
if ((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.onClose) {
|
|
42
|
+
var _props$controlProps3;
|
|
43
|
+
|
|
44
|
+
const customEvent = {
|
|
45
|
+
elementType: _Constants.ElementType.CitationPaneCloseButton,
|
|
46
|
+
elementId: elementId + "-close",
|
|
47
|
+
eventName: _Constants.EventNames.OnClick
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
_BroadcastService.BroadcastService.postMessage(customEvent);
|
|
51
|
+
|
|
52
|
+
(_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.onClose();
|
|
53
|
+
}
|
|
54
|
+
}, [props.controlProps, elementId]);
|
|
55
|
+
const handleTopClose = (0, _react2.useCallback)(() => {
|
|
56
|
+
if (handleClose) {
|
|
57
|
+
const customEvent = {
|
|
58
|
+
elementType: _Constants.ElementType.CitationPaneCloseButton,
|
|
59
|
+
elementId: elementId + "-top-close",
|
|
60
|
+
eventName: _Constants.EventNames.OnClick
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
_BroadcastService.BroadcastService.postMessage(customEvent);
|
|
64
|
+
|
|
65
|
+
handleClose();
|
|
66
|
+
}
|
|
67
|
+
}, [props.controlProps, elementId]);
|
|
68
|
+
const containerStyles = {
|
|
69
|
+
root: Object.assign({}, _defaultCitationPaneGeneralStyles.defaultCitationPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps, {
|
|
70
|
+
position: "relative" // Ensure container is positioned for absolute positioning of top close button
|
|
71
|
+
|
|
72
|
+
})
|
|
73
|
+
};
|
|
74
|
+
const titleStyles = {
|
|
75
|
+
root: Object.assign({}, _defaultCitationPaneTitleStyles.defaultCitationPaneTitleStyles, (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : _props$styleProps2.titleStyleProps)
|
|
76
|
+
};
|
|
77
|
+
const contentStyles = { ..._defaultCitationPaneContentStyles.defaultCitationPaneContentStyles,
|
|
78
|
+
...((_props$styleProps3 = props.styleProps) === null || _props$styleProps3 === void 0 ? void 0 : _props$styleProps3.contentStyleProps)
|
|
79
|
+
};
|
|
80
|
+
const closeButtonStyles = {
|
|
81
|
+
root: Object.assign({}, _defaultCitationPaneCloseButtonStyles.defaultCitationPaneCloseButtonStyles, (_props$styleProps4 = props.styleProps) === null || _props$styleProps4 === void 0 ? void 0 : _props$styleProps4.closeButtonStyleProps)
|
|
82
|
+
};
|
|
83
|
+
const topCloseButtonPosition = ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.topCloseButtonPosition) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.topCloseButtonPosition;
|
|
84
|
+
const topCloseButtonStyles = {
|
|
85
|
+
root: Object.assign({}, _defaultCitationPaneTopCloseButtonStyles.defaultCitationPaneTopCloseButtonStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.topCloseButtonStyleProps, topCloseButtonPosition === "topLeft" ? {
|
|
86
|
+
left: "0.5em",
|
|
87
|
+
right: "auto"
|
|
88
|
+
} : {
|
|
89
|
+
right: "0.5em",
|
|
90
|
+
left: "auto"
|
|
91
|
+
})
|
|
92
|
+
};
|
|
93
|
+
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
94
|
+
id: elementId,
|
|
95
|
+
role: "dialog",
|
|
96
|
+
"aria-labelledby": elementId + "-title",
|
|
97
|
+
"aria-describedby": elementId + "-content",
|
|
98
|
+
dir: ((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.dir) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.dir,
|
|
99
|
+
styles: containerStyles,
|
|
100
|
+
className: (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : (_props$styleProps6$cl = _props$styleProps6.classNames) === null || _props$styleProps6$cl === void 0 ? void 0 : _props$styleProps6$cl.containerClassName
|
|
101
|
+
}, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideTopCloseButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.topCloseButton) || /*#__PURE__*/_react2.default.createElement(_react.IconButton, {
|
|
102
|
+
onClick: handleTopClose,
|
|
103
|
+
id: elementId + "-top-close",
|
|
104
|
+
iconProps: {
|
|
105
|
+
iconName: "ChromeClose"
|
|
106
|
+
},
|
|
107
|
+
ariaLabel: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.topCloseButtonAriaLabel) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.topCloseButtonAriaLabel,
|
|
108
|
+
styles: topCloseButtonStyles,
|
|
109
|
+
className: (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : (_props$styleProps7$cl = _props$styleProps7.classNames) === null || _props$styleProps7$cl === void 0 ? void 0 : _props$styleProps7$cl.topCloseButtonClassName
|
|
110
|
+
})), !((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.hideTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.title) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
111
|
+
id: elementId + "-title",
|
|
112
|
+
styles: titleStyles,
|
|
113
|
+
className: (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : (_props$styleProps8$cl = _props$styleProps8.classNames) === null || _props$styleProps8$cl === void 0 ? void 0 : _props$styleProps8$cl.titleClassName
|
|
114
|
+
}, ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.titleText) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.titleText)), /*#__PURE__*/_react2.default.createElement("div", {
|
|
115
|
+
id: elementId + "-content",
|
|
116
|
+
style: contentStyles,
|
|
117
|
+
className: (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : (_props$styleProps9$cl = _props$styleProps9.classNames) === null || _props$styleProps9$cl === void 0 ? void 0 : _props$styleProps9$cl.contentClassName,
|
|
118
|
+
dangerouslySetInnerHTML: {
|
|
119
|
+
__html: ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.contentHtml) ?? ""
|
|
120
|
+
}
|
|
121
|
+
}), !((_props$controlProps11 = props.controlProps) !== null && _props$controlProps11 !== void 0 && _props$controlProps11.hideCloseButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.closeButton) || /*#__PURE__*/_react2.default.createElement(_react.DefaultButton, {
|
|
122
|
+
onClick: handleClose,
|
|
123
|
+
id: elementId + "-close",
|
|
124
|
+
text: ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.closeButtonText) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.closeButtonText,
|
|
125
|
+
ariaLabel: ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.closeButtonAriaLabel) || _defaultCitationPaneControlProps.defaultCitationPaneControlProps.closeButtonAriaLabel,
|
|
126
|
+
styles: closeButtonStyles,
|
|
127
|
+
className: (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : (_props$styleProps10$c = _props$styleProps10.classNames) === null || _props$styleProps10$c === void 0 ? void 0 : _props$styleProps10$c.closeButtonClassName
|
|
128
|
+
}))));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
var _default = CitationPane;
|
|
132
|
+
exports.default = _default;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.CitationPaneScalingTest = void 0;
|
|
7
|
+
|
|
8
|
+
var _CitationPane = _interopRequireDefault(require("./CitationPane"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Test component to verify CitationPane scaling behavior at different zoom levels
|
|
16
|
+
* This demonstrates how the component responds to 50% to 400% view sizes
|
|
17
|
+
*/
|
|
18
|
+
const CitationPaneScalingTest = () => {
|
|
19
|
+
const baseProps = {
|
|
20
|
+
controlProps: {
|
|
21
|
+
id: "scaling-test-citation",
|
|
22
|
+
titleText: "Scaling Test Citation",
|
|
23
|
+
contentHtml: `
|
|
24
|
+
<div>
|
|
25
|
+
<p>This citation pane is designed to scale properly from 50% to 400% zoom levels.</p>
|
|
26
|
+
<p><strong>Key improvements for scaling:</strong></p>
|
|
27
|
+
<ul>
|
|
28
|
+
<li>Uses <code>em</code> units instead of <code>px</code> for dimensions</li>
|
|
29
|
+
<li>Scalable padding, margins, and positioning</li>
|
|
30
|
+
<li>Relative font sizes throughout</li>
|
|
31
|
+
<li>Container-relative maximum height instead of viewport-based</li>
|
|
32
|
+
</ul>
|
|
33
|
+
<p><strong>Test Instructions:</strong></p>
|
|
34
|
+
<ol>
|
|
35
|
+
<li>Use your browser's zoom controls (Ctrl/Cmd + or -)</li>
|
|
36
|
+
<li>Test zoom levels: 50%, 75%, 100%, 150%, 200%, 300%, 400%</li>
|
|
37
|
+
<li>Verify all elements remain proportional and usable</li>
|
|
38
|
+
<li>Check that buttons remain clickable and text remains readable</li>
|
|
39
|
+
</ol>
|
|
40
|
+
</div>
|
|
41
|
+
`,
|
|
42
|
+
closeButtonText: "Close Test",
|
|
43
|
+
onClose: () => {
|
|
44
|
+
console.log("Scaling test close button clicked at current zoom level");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
+
style: {
|
|
50
|
+
padding: "2em",
|
|
51
|
+
backgroundColor: "#f5f5f5",
|
|
52
|
+
minHeight: "100vh",
|
|
53
|
+
display: "flex",
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
justifyContent: "center"
|
|
56
|
+
}
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
style: {
|
|
59
|
+
maxWidth: "600px"
|
|
60
|
+
}
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement("h2", {
|
|
62
|
+
style: {
|
|
63
|
+
marginBottom: "1em",
|
|
64
|
+
textAlign: "center"
|
|
65
|
+
}
|
|
66
|
+
}, "CitationPane Scaling Test"), /*#__PURE__*/_react.default.createElement("p", {
|
|
67
|
+
style: {
|
|
68
|
+
marginBottom: "2em",
|
|
69
|
+
textAlign: "center",
|
|
70
|
+
fontSize: "0.9em"
|
|
71
|
+
}
|
|
72
|
+
}, "Test this component at browser zoom levels from 50% to 400%"), /*#__PURE__*/_react.default.createElement(_CitationPane.default, baseProps)));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
exports.CitationPaneScalingTest = CitationPaneScalingTest;
|
|
76
|
+
var _default = CitationPaneScalingTest;
|
|
77
|
+
exports.default = _default;
|
package/lib/cjs/components/citationpane/common/defaultProps/defaultCitationPaneControlProps.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultCitationPaneControlProps = void 0;
|
|
7
|
+
const defaultCitationPaneControlProps = {
|
|
8
|
+
id: "ocw-citation-pane",
|
|
9
|
+
dir: "ltr",
|
|
10
|
+
hideTitle: false,
|
|
11
|
+
titleText: "Citation",
|
|
12
|
+
hideCloseButton: false,
|
|
13
|
+
closeButtonText: "Close",
|
|
14
|
+
closeButtonAriaLabel: "Close citation",
|
|
15
|
+
hideTopCloseButton: false,
|
|
16
|
+
topCloseButtonAriaLabel: "Close",
|
|
17
|
+
topCloseButtonPosition: "topRight",
|
|
18
|
+
onClose: () => {
|
|
19
|
+
console.log("Citation pane close");
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.defaultCitationPaneControlProps = defaultCitationPaneControlProps;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultCitationPaneProps = void 0;
|
|
7
|
+
|
|
8
|
+
var _defaultCitationPaneControlProps = require("./defaultCitationPaneControlProps");
|
|
9
|
+
|
|
10
|
+
var _defaultCitationPaneStyleProps = require("./defaultCitationPaneStyleProps");
|
|
11
|
+
|
|
12
|
+
const defaultCitationPaneProps = {
|
|
13
|
+
controlProps: _defaultCitationPaneControlProps.defaultCitationPaneControlProps,
|
|
14
|
+
styleProps: _defaultCitationPaneStyleProps.defaultCitationPaneStyleProps
|
|
15
|
+
};
|
|
16
|
+
exports.defaultCitationPaneProps = defaultCitationPaneProps;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultCitationPaneStyleProps = void 0;
|
|
7
|
+
|
|
8
|
+
var _defaultCitationPaneCloseButtonStyles = require("../defaultStyles/defaultCitationPaneCloseButtonStyles");
|
|
9
|
+
|
|
10
|
+
var _defaultCitationPaneContentStyles = require("../defaultStyles/defaultCitationPaneContentStyles");
|
|
11
|
+
|
|
12
|
+
var _defaultCitationPaneGeneralStyles = require("../defaultStyles/defaultCitationPaneGeneralStyles");
|
|
13
|
+
|
|
14
|
+
var _defaultCitationPaneTitleStyles = require("../defaultStyles/defaultCitationPaneTitleStyles");
|
|
15
|
+
|
|
16
|
+
var _defaultCitationPaneTopCloseButtonStyles = require("../defaultStyles/defaultCitationPaneTopCloseButtonStyles");
|
|
17
|
+
|
|
18
|
+
const defaultCitationPaneStyleProps = {
|
|
19
|
+
generalStyleProps: _defaultCitationPaneGeneralStyles.defaultCitationPaneGeneralStyles,
|
|
20
|
+
titleStyleProps: _defaultCitationPaneTitleStyles.defaultCitationPaneTitleStyles,
|
|
21
|
+
contentStyleProps: _defaultCitationPaneContentStyles.defaultCitationPaneContentStyles,
|
|
22
|
+
closeButtonStyleProps: _defaultCitationPaneCloseButtonStyles.defaultCitationPaneCloseButtonStyles,
|
|
23
|
+
topCloseButtonStyleProps: _defaultCitationPaneTopCloseButtonStyles.defaultCitationPaneTopCloseButtonStyles
|
|
24
|
+
};
|
|
25
|
+
exports.defaultCitationPaneStyleProps = defaultCitationPaneStyleProps;
|
package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonStyles.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultCitationPaneCloseButtonStyles = void 0;
|
|
7
|
+
const defaultCitationPaneCloseButtonStyles = {
|
|
8
|
+
marginTop: "1em",
|
|
9
|
+
// Space between content and close button (scalable)
|
|
10
|
+
alignSelf: "center",
|
|
11
|
+
// Center the button horizontally
|
|
12
|
+
backgroundColor: "#f3f2f1",
|
|
13
|
+
border: "1px solid #d2d0ce",
|
|
14
|
+
borderRadius: "0.25em",
|
|
15
|
+
// Scalable border radius
|
|
16
|
+
color: "#323130",
|
|
17
|
+
cursor: "pointer",
|
|
18
|
+
fontSize: "1em",
|
|
19
|
+
// Use relative font size for better scaling
|
|
20
|
+
fontWeight: "500",
|
|
21
|
+
minHeight: "2em",
|
|
22
|
+
// Scalable minimum height
|
|
23
|
+
minWidth: "5em",
|
|
24
|
+
// Scalable minimum width
|
|
25
|
+
padding: "0.5em 1em",
|
|
26
|
+
// Scalable padding
|
|
27
|
+
selectors: {
|
|
28
|
+
":hover": {
|
|
29
|
+
backgroundColor: "#e1dfdd",
|
|
30
|
+
borderColor: "#c8c6c4"
|
|
31
|
+
},
|
|
32
|
+
":focus": {
|
|
33
|
+
outline: "0.125em solid #0078d4",
|
|
34
|
+
// Scalable outline
|
|
35
|
+
outlineOffset: "0.125em" // Scalable offset
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.defaultCitationPaneCloseButtonStyles = defaultCitationPaneCloseButtonStyles;
|
package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneContentStyles.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultCitationPaneContentStyles = void 0;
|
|
7
|
+
const defaultCitationPaneContentStyles = {
|
|
8
|
+
fontSize: "1em",
|
|
9
|
+
// Use relative units for better scaling
|
|
10
|
+
lineHeight: "1.5",
|
|
11
|
+
// Already relative, good for scaling
|
|
12
|
+
marginBottom: "0",
|
|
13
|
+
// No bottom margin since close button has top margin
|
|
14
|
+
flex: "1",
|
|
15
|
+
// Allow content to grow and push close button to bottom
|
|
16
|
+
overflow: "auto",
|
|
17
|
+
// Enable scrolling for long content
|
|
18
|
+
paddingRight: "0.25em" // Small padding to prevent scrollbar from touching border (scalable)
|
|
19
|
+
|
|
20
|
+
};
|
|
21
|
+
exports.defaultCitationPaneContentStyles = defaultCitationPaneContentStyles;
|
package/lib/cjs/components/citationpane/common/defaultStyles/defaultCitationPaneGeneralStyles.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultCitationPaneGeneralStyles = void 0;
|
|
7
|
+
const defaultCitationPaneGeneralStyles = {
|
|
8
|
+
position: "relative",
|
|
9
|
+
// Required for absolute positioning of top close button
|
|
10
|
+
paddingTop: "2.5em",
|
|
11
|
+
// Space for top close button to prevent overlap (scalable)
|
|
12
|
+
padding: "1em",
|
|
13
|
+
// Scalable padding using em units
|
|
14
|
+
backgroundColor: "#ffffff",
|
|
15
|
+
border: "1px solid #d2d0ce",
|
|
16
|
+
borderRadius: "0.5em",
|
|
17
|
+
// Scalable border radius
|
|
18
|
+
boxShadow: "0px 0.125em 0.25em rgba(0, 0, 0, 0.1)",
|
|
19
|
+
// Scalable shadow
|
|
20
|
+
display: "flex",
|
|
21
|
+
flexDirection: "column",
|
|
22
|
+
minHeight: "7.5em",
|
|
23
|
+
// Minimum height to ensure proper layout (scalable)
|
|
24
|
+
maxHeight: "30em",
|
|
25
|
+
// Container-relative height instead of viewport-based
|
|
26
|
+
overflow: "hidden" // Hide overflow on container, let content area handle scrolling
|
|
27
|
+
|
|
28
|
+
};
|
|
29
|
+
exports.defaultCitationPaneGeneralStyles = defaultCitationPaneGeneralStyles;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultCitationPaneTopCloseButtonStyles = void 0;
|
|
7
|
+
const defaultCitationPaneTopCloseButtonStyles = {
|
|
8
|
+
position: "absolute",
|
|
9
|
+
top: "0.5em",
|
|
10
|
+
// Scalable positioning
|
|
11
|
+
right: "0.5em",
|
|
12
|
+
// Scalable positioning
|
|
13
|
+
minWidth: "2em",
|
|
14
|
+
// Scalable minimum width
|
|
15
|
+
height: "2em",
|
|
16
|
+
// Scalable height
|
|
17
|
+
padding: "0",
|
|
18
|
+
fontSize: "1em",
|
|
19
|
+
// Scalable font size
|
|
20
|
+
fontWeight: "bold",
|
|
21
|
+
color: "#605e5c",
|
|
22
|
+
backgroundColor: "transparent",
|
|
23
|
+
border: "none",
|
|
24
|
+
borderRadius: "0.25em",
|
|
25
|
+
// Scalable border radius
|
|
26
|
+
cursor: "pointer",
|
|
27
|
+
zIndex: 1000,
|
|
28
|
+
":hover": {
|
|
29
|
+
backgroundColor: "#f3f2f1",
|
|
30
|
+
color: "#323130"
|
|
31
|
+
},
|
|
32
|
+
":active": {
|
|
33
|
+
backgroundColor: "#edebe9",
|
|
34
|
+
color: "#201f1e"
|
|
35
|
+
},
|
|
36
|
+
":focus": {
|
|
37
|
+
outline: "0.125em solid #605e5c",
|
|
38
|
+
// Scalable outline
|
|
39
|
+
outlineOffset: "0.125em" // Scalable offset
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.defaultCitationPaneTopCloseButtonStyles = defaultCitationPaneTopCloseButtonStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/lib/cjs/index.js
CHANGED
|
@@ -63,6 +63,12 @@ Object.defineProperty(exports, "ChatReconnectIconBase64", {
|
|
|
63
63
|
return _Icons.ChatReconnectIconBase64;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
+
Object.defineProperty(exports, "CitationPane", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _CitationPane.default;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
66
72
|
Object.defineProperty(exports, "CloseChatButtonIconBase64", {
|
|
67
73
|
enumerable: true,
|
|
68
74
|
get: function () {
|
|
@@ -262,6 +268,8 @@ var _Footer = _interopRequireDefault(require("./components/footer/Footer"));
|
|
|
262
268
|
|
|
263
269
|
var _ConfirmationPane = _interopRequireDefault(require("./components/confirmationpane/ConfirmationPane"));
|
|
264
270
|
|
|
271
|
+
var _CitationPane = _interopRequireDefault(require("./components/citationpane/CitationPane"));
|
|
272
|
+
|
|
265
273
|
var _ChatButton = _interopRequireDefault(require("./components/chatbutton/ChatButton"));
|
|
266
274
|
|
|
267
275
|
var _InputValidationPane = _interopRequireDefault(require("./components/inputvalidationpane/InputValidationPane"));
|
|
@@ -30,6 +30,7 @@ export let ElementType;
|
|
|
30
30
|
ElementType["ReconnectChatPane"] = "ReconnectChatPane";
|
|
31
31
|
ElementType["ConfirmationPaneConfirmButton"] = "ConfirmationPaneConfirmButton";
|
|
32
32
|
ElementType["ConfirmationPaneCancelButton"] = "ConfirmationPaneCancelButton";
|
|
33
|
+
ElementType["CitationPaneCloseButton"] = "CitationPaneCloseButton";
|
|
33
34
|
ElementType["PreChatSurveySubmitButton"] = "PreChatSurveySubmitButton";
|
|
34
35
|
ElementType["PreChatSurveyError"] = "PreChatSurveyError";
|
|
35
36
|
ElementType["IncomingCallDeclineCallButton"] = "IncomingCallDeclineCallButton";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { DefaultButton, IconButton, Label, Stack } from "@fluentui/react";
|
|
2
|
+
import { ElementType, EventNames } from "../../common/Constants";
|
|
3
|
+
import React, { useCallback } from "react";
|
|
4
|
+
import { BroadcastService } from "../../services/BroadcastService";
|
|
5
|
+
import { decodeComponentString } from "../../common/decodeComponentString";
|
|
6
|
+
import { defaultCitationPaneCloseButtonStyles } from "./common/defaultStyles/defaultCitationPaneCloseButtonStyles";
|
|
7
|
+
import { defaultCitationPaneContentStyles } from "./common/defaultStyles/defaultCitationPaneContentStyles";
|
|
8
|
+
import { defaultCitationPaneControlProps } from "./common/defaultProps/defaultCitationPaneControlProps";
|
|
9
|
+
import { defaultCitationPaneGeneralStyles } from "./common/defaultStyles/defaultCitationPaneGeneralStyles";
|
|
10
|
+
import { defaultCitationPaneTitleStyles } from "./common/defaultStyles/defaultCitationPaneTitleStyles";
|
|
11
|
+
import { defaultCitationPaneTopCloseButtonStyles } from "./common/defaultStyles/defaultCitationPaneTopCloseButtonStyles";
|
|
12
|
+
|
|
13
|
+
function CitationPane(props) {
|
|
14
|
+
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$controlProps4, _props$styleProps5, _props$controlProps5, _props$styleProps6, _props$styleProps6$cl, _props$controlProps6, _props$componentOverr, _props$controlProps7, _props$styleProps7, _props$styleProps7$cl, _props$controlProps8, _props$componentOverr2, _props$styleProps8, _props$styleProps8$cl, _props$controlProps9, _props$styleProps9, _props$styleProps9$cl, _props$controlProps10, _props$controlProps11, _props$componentOverr3, _props$controlProps12, _props$controlProps13, _props$styleProps10, _props$styleProps10$c;
|
|
15
|
+
|
|
16
|
+
const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? defaultCitationPaneControlProps.id;
|
|
17
|
+
const handleClose = useCallback(() => {
|
|
18
|
+
var _props$controlProps2;
|
|
19
|
+
|
|
20
|
+
if ((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.onClose) {
|
|
21
|
+
var _props$controlProps3;
|
|
22
|
+
|
|
23
|
+
const customEvent = {
|
|
24
|
+
elementType: ElementType.CitationPaneCloseButton,
|
|
25
|
+
elementId: elementId + "-close",
|
|
26
|
+
eventName: EventNames.OnClick
|
|
27
|
+
};
|
|
28
|
+
BroadcastService.postMessage(customEvent);
|
|
29
|
+
(_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.onClose();
|
|
30
|
+
}
|
|
31
|
+
}, [props.controlProps, elementId]);
|
|
32
|
+
const handleTopClose = useCallback(() => {
|
|
33
|
+
if (handleClose) {
|
|
34
|
+
const customEvent = {
|
|
35
|
+
elementType: ElementType.CitationPaneCloseButton,
|
|
36
|
+
elementId: elementId + "-top-close",
|
|
37
|
+
eventName: EventNames.OnClick
|
|
38
|
+
};
|
|
39
|
+
BroadcastService.postMessage(customEvent);
|
|
40
|
+
handleClose();
|
|
41
|
+
}
|
|
42
|
+
}, [props.controlProps, elementId]);
|
|
43
|
+
const containerStyles = {
|
|
44
|
+
root: Object.assign({}, defaultCitationPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps, {
|
|
45
|
+
position: "relative" // Ensure container is positioned for absolute positioning of top close button
|
|
46
|
+
|
|
47
|
+
})
|
|
48
|
+
};
|
|
49
|
+
const titleStyles = {
|
|
50
|
+
root: Object.assign({}, defaultCitationPaneTitleStyles, (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : _props$styleProps2.titleStyleProps)
|
|
51
|
+
};
|
|
52
|
+
const contentStyles = { ...defaultCitationPaneContentStyles,
|
|
53
|
+
...((_props$styleProps3 = props.styleProps) === null || _props$styleProps3 === void 0 ? void 0 : _props$styleProps3.contentStyleProps)
|
|
54
|
+
};
|
|
55
|
+
const closeButtonStyles = {
|
|
56
|
+
root: Object.assign({}, defaultCitationPaneCloseButtonStyles, (_props$styleProps4 = props.styleProps) === null || _props$styleProps4 === void 0 ? void 0 : _props$styleProps4.closeButtonStyleProps)
|
|
57
|
+
};
|
|
58
|
+
const topCloseButtonPosition = ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.topCloseButtonPosition) || defaultCitationPaneControlProps.topCloseButtonPosition;
|
|
59
|
+
const topCloseButtonStyles = {
|
|
60
|
+
root: Object.assign({}, defaultCitationPaneTopCloseButtonStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.topCloseButtonStyleProps, topCloseButtonPosition === "topLeft" ? {
|
|
61
|
+
left: "0.5em",
|
|
62
|
+
right: "auto"
|
|
63
|
+
} : {
|
|
64
|
+
right: "0.5em",
|
|
65
|
+
left: "auto"
|
|
66
|
+
})
|
|
67
|
+
};
|
|
68
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Stack, {
|
|
69
|
+
id: elementId,
|
|
70
|
+
role: "dialog",
|
|
71
|
+
"aria-labelledby": elementId + "-title",
|
|
72
|
+
"aria-describedby": elementId + "-content",
|
|
73
|
+
dir: ((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.dir) || defaultCitationPaneControlProps.dir,
|
|
74
|
+
styles: containerStyles,
|
|
75
|
+
className: (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : (_props$styleProps6$cl = _props$styleProps6.classNames) === null || _props$styleProps6$cl === void 0 ? void 0 : _props$styleProps6$cl.containerClassName
|
|
76
|
+
}, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideTopCloseButton) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.topCloseButton) || /*#__PURE__*/React.createElement(IconButton, {
|
|
77
|
+
onClick: handleTopClose,
|
|
78
|
+
id: elementId + "-top-close",
|
|
79
|
+
iconProps: {
|
|
80
|
+
iconName: "ChromeClose"
|
|
81
|
+
},
|
|
82
|
+
ariaLabel: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.topCloseButtonAriaLabel) || defaultCitationPaneControlProps.topCloseButtonAriaLabel,
|
|
83
|
+
styles: topCloseButtonStyles,
|
|
84
|
+
className: (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : (_props$styleProps7$cl = _props$styleProps7.classNames) === null || _props$styleProps7$cl === void 0 ? void 0 : _props$styleProps7$cl.topCloseButtonClassName
|
|
85
|
+
})), !((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.hideTitle) && (decodeComponentString((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.title) || /*#__PURE__*/React.createElement(Label, {
|
|
86
|
+
id: elementId + "-title",
|
|
87
|
+
styles: titleStyles,
|
|
88
|
+
className: (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : (_props$styleProps8$cl = _props$styleProps8.classNames) === null || _props$styleProps8$cl === void 0 ? void 0 : _props$styleProps8$cl.titleClassName
|
|
89
|
+
}, ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.titleText) || defaultCitationPaneControlProps.titleText)), /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
id: elementId + "-content",
|
|
91
|
+
style: contentStyles,
|
|
92
|
+
className: (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : (_props$styleProps9$cl = _props$styleProps9.classNames) === null || _props$styleProps9$cl === void 0 ? void 0 : _props$styleProps9$cl.contentClassName,
|
|
93
|
+
dangerouslySetInnerHTML: {
|
|
94
|
+
__html: ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.contentHtml) ?? ""
|
|
95
|
+
}
|
|
96
|
+
}), !((_props$controlProps11 = props.controlProps) !== null && _props$controlProps11 !== void 0 && _props$controlProps11.hideCloseButton) && (decodeComponentString((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.closeButton) || /*#__PURE__*/React.createElement(DefaultButton, {
|
|
97
|
+
onClick: handleClose,
|
|
98
|
+
id: elementId + "-close",
|
|
99
|
+
text: ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.closeButtonText) || defaultCitationPaneControlProps.closeButtonText,
|
|
100
|
+
ariaLabel: ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.closeButtonAriaLabel) || defaultCitationPaneControlProps.closeButtonAriaLabel,
|
|
101
|
+
styles: closeButtonStyles,
|
|
102
|
+
className: (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : (_props$styleProps10$c = _props$styleProps10.classNames) === null || _props$styleProps10$c === void 0 ? void 0 : _props$styleProps10$c.closeButtonClassName
|
|
103
|
+
}))));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export default CitationPane;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import CitationPane from "./CitationPane";
|
|
2
|
+
import React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Test component to verify CitationPane scaling behavior at different zoom levels
|
|
5
|
+
* This demonstrates how the component responds to 50% to 400% view sizes
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const CitationPaneScalingTest = () => {
|
|
9
|
+
const baseProps = {
|
|
10
|
+
controlProps: {
|
|
11
|
+
id: "scaling-test-citation",
|
|
12
|
+
titleText: "Scaling Test Citation",
|
|
13
|
+
contentHtml: `
|
|
14
|
+
<div>
|
|
15
|
+
<p>This citation pane is designed to scale properly from 50% to 400% zoom levels.</p>
|
|
16
|
+
<p><strong>Key improvements for scaling:</strong></p>
|
|
17
|
+
<ul>
|
|
18
|
+
<li>Uses <code>em</code> units instead of <code>px</code> for dimensions</li>
|
|
19
|
+
<li>Scalable padding, margins, and positioning</li>
|
|
20
|
+
<li>Relative font sizes throughout</li>
|
|
21
|
+
<li>Container-relative maximum height instead of viewport-based</li>
|
|
22
|
+
</ul>
|
|
23
|
+
<p><strong>Test Instructions:</strong></p>
|
|
24
|
+
<ol>
|
|
25
|
+
<li>Use your browser's zoom controls (Ctrl/Cmd + or -)</li>
|
|
26
|
+
<li>Test zoom levels: 50%, 75%, 100%, 150%, 200%, 300%, 400%</li>
|
|
27
|
+
<li>Verify all elements remain proportional and usable</li>
|
|
28
|
+
<li>Check that buttons remain clickable and text remains readable</li>
|
|
29
|
+
</ol>
|
|
30
|
+
</div>
|
|
31
|
+
`,
|
|
32
|
+
closeButtonText: "Close Test",
|
|
33
|
+
onClose: () => {
|
|
34
|
+
console.log("Scaling test close button clicked at current zoom level");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
style: {
|
|
40
|
+
padding: "2em",
|
|
41
|
+
backgroundColor: "#f5f5f5",
|
|
42
|
+
minHeight: "100vh",
|
|
43
|
+
display: "flex",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
justifyContent: "center"
|
|
46
|
+
}
|
|
47
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
style: {
|
|
49
|
+
maxWidth: "600px"
|
|
50
|
+
}
|
|
51
|
+
}, /*#__PURE__*/React.createElement("h2", {
|
|
52
|
+
style: {
|
|
53
|
+
marginBottom: "1em",
|
|
54
|
+
textAlign: "center"
|
|
55
|
+
}
|
|
56
|
+
}, "CitationPane Scaling Test"), /*#__PURE__*/React.createElement("p", {
|
|
57
|
+
style: {
|
|
58
|
+
marginBottom: "2em",
|
|
59
|
+
textAlign: "center",
|
|
60
|
+
fontSize: "0.9em"
|
|
61
|
+
}
|
|
62
|
+
}, "Test this component at browser zoom levels from 50% to 400%"), /*#__PURE__*/React.createElement(CitationPane, baseProps)));
|
|
63
|
+
};
|
|
64
|
+
export default CitationPaneScalingTest;
|
package/lib/esm/components/citationpane/common/defaultProps/defaultCitationPaneControlProps.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const defaultCitationPaneControlProps = {
|
|
2
|
+
id: "ocw-citation-pane",
|
|
3
|
+
dir: "ltr",
|
|
4
|
+
hideTitle: false,
|
|
5
|
+
titleText: "Citation",
|
|
6
|
+
hideCloseButton: false,
|
|
7
|
+
closeButtonText: "Close",
|
|
8
|
+
closeButtonAriaLabel: "Close citation",
|
|
9
|
+
hideTopCloseButton: false,
|
|
10
|
+
topCloseButtonAriaLabel: "Close",
|
|
11
|
+
topCloseButtonPosition: "topRight",
|
|
12
|
+
onClose: () => {
|
|
13
|
+
console.log("Citation pane close");
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { defaultCitationPaneControlProps } from "./defaultCitationPaneControlProps";
|
|
2
|
+
import { defaultCitationPaneStyleProps } from "./defaultCitationPaneStyleProps";
|
|
3
|
+
export const defaultCitationPaneProps = {
|
|
4
|
+
controlProps: defaultCitationPaneControlProps,
|
|
5
|
+
styleProps: defaultCitationPaneStyleProps
|
|
6
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defaultCitationPaneCloseButtonStyles } from "../defaultStyles/defaultCitationPaneCloseButtonStyles";
|
|
2
|
+
import { defaultCitationPaneContentStyles } from "../defaultStyles/defaultCitationPaneContentStyles";
|
|
3
|
+
import { defaultCitationPaneGeneralStyles } from "../defaultStyles/defaultCitationPaneGeneralStyles";
|
|
4
|
+
import { defaultCitationPaneTitleStyles } from "../defaultStyles/defaultCitationPaneTitleStyles";
|
|
5
|
+
import { defaultCitationPaneTopCloseButtonStyles } from "../defaultStyles/defaultCitationPaneTopCloseButtonStyles";
|
|
6
|
+
export const defaultCitationPaneStyleProps = {
|
|
7
|
+
generalStyleProps: defaultCitationPaneGeneralStyles,
|
|
8
|
+
titleStyleProps: defaultCitationPaneTitleStyles,
|
|
9
|
+
contentStyleProps: defaultCitationPaneContentStyles,
|
|
10
|
+
closeButtonStyleProps: defaultCitationPaneCloseButtonStyles,
|
|
11
|
+
topCloseButtonStyleProps: defaultCitationPaneTopCloseButtonStyles
|
|
12
|
+
};
|
package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneCloseButtonStyles.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const defaultCitationPaneCloseButtonStyles = {
|
|
2
|
+
marginTop: "1em",
|
|
3
|
+
// Space between content and close button (scalable)
|
|
4
|
+
alignSelf: "center",
|
|
5
|
+
// Center the button horizontally
|
|
6
|
+
backgroundColor: "#f3f2f1",
|
|
7
|
+
border: "1px solid #d2d0ce",
|
|
8
|
+
borderRadius: "0.25em",
|
|
9
|
+
// Scalable border radius
|
|
10
|
+
color: "#323130",
|
|
11
|
+
cursor: "pointer",
|
|
12
|
+
fontSize: "1em",
|
|
13
|
+
// Use relative font size for better scaling
|
|
14
|
+
fontWeight: "500",
|
|
15
|
+
minHeight: "2em",
|
|
16
|
+
// Scalable minimum height
|
|
17
|
+
minWidth: "5em",
|
|
18
|
+
// Scalable minimum width
|
|
19
|
+
padding: "0.5em 1em",
|
|
20
|
+
// Scalable padding
|
|
21
|
+
selectors: {
|
|
22
|
+
":hover": {
|
|
23
|
+
backgroundColor: "#e1dfdd",
|
|
24
|
+
borderColor: "#c8c6c4"
|
|
25
|
+
},
|
|
26
|
+
":focus": {
|
|
27
|
+
outline: "0.125em solid #0078d4",
|
|
28
|
+
// Scalable outline
|
|
29
|
+
outlineOffset: "0.125em" // Scalable offset
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneContentStyles.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const defaultCitationPaneContentStyles = {
|
|
2
|
+
fontSize: "1em",
|
|
3
|
+
// Use relative units for better scaling
|
|
4
|
+
lineHeight: "1.5",
|
|
5
|
+
// Already relative, good for scaling
|
|
6
|
+
marginBottom: "0",
|
|
7
|
+
// No bottom margin since close button has top margin
|
|
8
|
+
flex: "1",
|
|
9
|
+
// Allow content to grow and push close button to bottom
|
|
10
|
+
overflow: "auto",
|
|
11
|
+
// Enable scrolling for long content
|
|
12
|
+
paddingRight: "0.25em" // Small padding to prevent scrollbar from touching border (scalable)
|
|
13
|
+
|
|
14
|
+
};
|
package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneGeneralStyles.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const defaultCitationPaneGeneralStyles = {
|
|
2
|
+
position: "relative",
|
|
3
|
+
// Required for absolute positioning of top close button
|
|
4
|
+
paddingTop: "2.5em",
|
|
5
|
+
// Space for top close button to prevent overlap (scalable)
|
|
6
|
+
padding: "1em",
|
|
7
|
+
// Scalable padding using em units
|
|
8
|
+
backgroundColor: "#ffffff",
|
|
9
|
+
border: "1px solid #d2d0ce",
|
|
10
|
+
borderRadius: "0.5em",
|
|
11
|
+
// Scalable border radius
|
|
12
|
+
boxShadow: "0px 0.125em 0.25em rgba(0, 0, 0, 0.1)",
|
|
13
|
+
// Scalable shadow
|
|
14
|
+
display: "flex",
|
|
15
|
+
flexDirection: "column",
|
|
16
|
+
minHeight: "7.5em",
|
|
17
|
+
// Minimum height to ensure proper layout (scalable)
|
|
18
|
+
maxHeight: "30em",
|
|
19
|
+
// Container-relative height instead of viewport-based
|
|
20
|
+
overflow: "hidden" // Hide overflow on container, let content area handle scrolling
|
|
21
|
+
|
|
22
|
+
};
|
package/lib/esm/components/citationpane/common/defaultStyles/defaultCitationPaneTitleStyles.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const defaultCitationPaneTitleStyles = {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const defaultCitationPaneTopCloseButtonStyles = {
|
|
2
|
+
position: "absolute",
|
|
3
|
+
top: "0.5em",
|
|
4
|
+
// Scalable positioning
|
|
5
|
+
right: "0.5em",
|
|
6
|
+
// Scalable positioning
|
|
7
|
+
minWidth: "2em",
|
|
8
|
+
// Scalable minimum width
|
|
9
|
+
height: "2em",
|
|
10
|
+
// Scalable height
|
|
11
|
+
padding: "0",
|
|
12
|
+
fontSize: "1em",
|
|
13
|
+
// Scalable font size
|
|
14
|
+
fontWeight: "bold",
|
|
15
|
+
color: "#605e5c",
|
|
16
|
+
backgroundColor: "transparent",
|
|
17
|
+
border: "none",
|
|
18
|
+
borderRadius: "0.25em",
|
|
19
|
+
// Scalable border radius
|
|
20
|
+
cursor: "pointer",
|
|
21
|
+
zIndex: 1000,
|
|
22
|
+
":hover": {
|
|
23
|
+
backgroundColor: "#f3f2f1",
|
|
24
|
+
color: "#323130"
|
|
25
|
+
},
|
|
26
|
+
":active": {
|
|
27
|
+
backgroundColor: "#edebe9",
|
|
28
|
+
color: "#201f1e"
|
|
29
|
+
},
|
|
30
|
+
":focus": {
|
|
31
|
+
outline: "0.125em solid #605e5c",
|
|
32
|
+
// Scalable outline
|
|
33
|
+
outlineOffset: "0.125em" // Scalable offset
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/esm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as Header } from "./components/header/Header";
|
|
2
2
|
export { default as Footer } from "./components/footer/Footer";
|
|
3
3
|
export { default as ConfirmationPane } from "./components/confirmationpane/ConfirmationPane";
|
|
4
|
+
export { default as CitationPane } from "./components/citationpane/CitationPane";
|
|
4
5
|
export { default as ChatButton } from "./components/chatbutton/ChatButton";
|
|
5
6
|
export { default as InputValidationPane } from "./components/inputvalidationpane/InputValidationPane";
|
|
6
7
|
export { default as ProactiveChatPane } from "./components/proactivechatpane/ProactiveChatPane";
|
|
@@ -31,6 +31,7 @@ export declare enum ElementType {
|
|
|
31
31
|
ReconnectChatPane = "ReconnectChatPane",
|
|
32
32
|
ConfirmationPaneConfirmButton = "ConfirmationPaneConfirmButton",
|
|
33
33
|
ConfirmationPaneCancelButton = "ConfirmationPaneCancelButton",
|
|
34
|
+
CitationPaneCloseButton = "CitationPaneCloseButton",
|
|
34
35
|
PreChatSurveySubmitButton = "PreChatSurveySubmitButton",
|
|
35
36
|
PreChatSurveyError = "PreChatSurveyError",
|
|
36
37
|
IncomingCallDeclineCallButton = "IncomingCallDeclineCallButton",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Test component to verify CitationPane scaling behavior at different zoom levels
|
|
4
|
+
* This demonstrates how the component responds to 50% to 400% view sizes
|
|
5
|
+
*/
|
|
6
|
+
export declare const CitationPaneScalingTest: React.FC;
|
|
7
|
+
export default CitationPaneScalingTest;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ICitationPaneControlProps {
|
|
2
|
+
id?: string;
|
|
3
|
+
dir?: "ltr" | "rtl" | "auto";
|
|
4
|
+
hideCitationPane?: boolean;
|
|
5
|
+
hideTitle?: boolean;
|
|
6
|
+
titleText?: string;
|
|
7
|
+
contentHtml?: string;
|
|
8
|
+
hideCloseButton?: boolean;
|
|
9
|
+
closeButtonText?: string;
|
|
10
|
+
closeButtonAriaLabel?: string;
|
|
11
|
+
hideTopCloseButton?: boolean;
|
|
12
|
+
topCloseButtonAriaLabel?: string;
|
|
13
|
+
topCloseButtonPosition?: "topLeft" | "topRight";
|
|
14
|
+
brightnessValueOnDim?: string;
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ICitationPaneComponentOverrides } from "./ICitationPaneComponentOverrides";
|
|
2
|
+
import { ICitationPaneControlProps } from "./ICitationPaneControlProps";
|
|
3
|
+
import { ICitationPaneStyleProps } from "./ICitationPaneStyleProps";
|
|
4
|
+
export interface ICitationPaneProps {
|
|
5
|
+
controlProps?: ICitationPaneControlProps;
|
|
6
|
+
styleProps?: ICitationPaneStyleProps;
|
|
7
|
+
componentOverrides?: ICitationPaneComponentOverrides;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ICitationPaneClassNames } from "./ICitationPaneClassNames";
|
|
2
|
+
import { IStyle } from "@fluentui/react";
|
|
3
|
+
export interface ICitationPaneStyleProps {
|
|
4
|
+
generalStyleProps?: IStyle;
|
|
5
|
+
titleStyleProps?: IStyle;
|
|
6
|
+
contentStyleProps?: IStyle;
|
|
7
|
+
closeButtonStyleProps?: IStyle;
|
|
8
|
+
topCloseButtonStyleProps?: IStyle;
|
|
9
|
+
classNames?: ICitationPaneClassNames;
|
|
10
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as Header } from "./components/header/Header";
|
|
2
2
|
export { default as Footer } from "./components/footer/Footer";
|
|
3
3
|
export { default as ConfirmationPane } from "./components/confirmationpane/ConfirmationPane";
|
|
4
|
+
export { default as CitationPane } from "./components/citationpane/CitationPane";
|
|
4
5
|
export { default as ChatButton } from "./components/chatbutton/ChatButton";
|
|
5
6
|
export { default as InputValidationPane } from "./components/inputvalidationpane/InputValidationPane";
|
|
6
7
|
export { default as ProactiveChatPane } from "./components/proactivechatpane/ProactiveChatPane";
|