fictoan-react 1.11.10 → 1.11.11
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/{Heading-CzZKPMtj.js → Heading-hUAww3Qc.js} +30 -22
- package/dist/components/CodeBlock/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/hooks/UseClickOutside.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -603,7 +603,7 @@ var Card = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
603
603
|
tabIndex: 0
|
|
604
604
|
}, props), children);
|
|
605
605
|
});
|
|
606
|
-
var _excluded$H = ["children", "source", "language", "showCopyButton", "showLineNumbers", "description", "withSyntaxHighlighting", "
|
|
606
|
+
var _excluded$H = ["children", "source", "language", "showCopyButton", "showLineNumbers", "description", "withSyntaxHighlighting", "makeEditable", "onChange"];
|
|
607
607
|
function _extends$I() {
|
|
608
608
|
return _extends$I = Object.assign ? Object.assign.bind() : function(n) {
|
|
609
609
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -943,7 +943,7 @@ function _objectWithoutPropertiesLoose$H(r, e) {
|
|
|
943
943
|
return t;
|
|
944
944
|
}
|
|
945
945
|
var CodeBlock = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
946
|
-
var children = _ref.children, source = _ref.source, _ref$language = _ref.language, language = _ref$language === void 0 ? "json" : _ref$language, showCopyButton = _ref.showCopyButton, showLineNumbers = _ref.showLineNumbers, description = _ref.description, _ref$withSyntaxHighli = _ref.withSyntaxHighlighting, withSyntaxHighlighting = _ref$withSyntaxHighli === void 0 ? false : _ref$withSyntaxHighli, _ref$
|
|
946
|
+
var children = _ref.children, source = _ref.source, _ref$language = _ref.language, language = _ref$language === void 0 ? "json" : _ref$language, showCopyButton = _ref.showCopyButton, showLineNumbers = _ref.showLineNumbers, description = _ref.description, _ref$withSyntaxHighli = _ref.withSyntaxHighlighting, withSyntaxHighlighting = _ref$withSyntaxHighli === void 0 ? false : _ref$withSyntaxHighli, _ref$makeEditable = _ref.makeEditable, makeEditable = _ref$makeEditable === void 0 ? false : _ref$makeEditable, onChange = _ref.onChange, props = _objectWithoutProperties$H(_ref, _excluded$H);
|
|
947
947
|
var _useState = useState(false), _useState2 = _slicedToArray$d(_useState, 2), isCodeCopied = _useState2[0], setIsCodeCopied = _useState2[1];
|
|
948
948
|
var _useState3 = useState(null), _useState4 = _slicedToArray$d(_useState3, 2), prismModule = _useState4[0], setPrismModule = _useState4[1];
|
|
949
949
|
var _useState5 = useState(withSyntaxHighlighting), _useState6 = _slicedToArray$d(_useState5, 2), isLoading = _useState6[0], setIsLoading = _useState6[1];
|
|
@@ -1013,10 +1013,10 @@ var CodeBlock = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
1013
1013
|
var highlightCode = useCallback(function(content) {
|
|
1014
1014
|
if (!codeElement || !withSyntaxHighlighting || !prismModule) return;
|
|
1015
1015
|
try {
|
|
1016
|
-
var cursorPosition =
|
|
1016
|
+
var cursorPosition = makeEditable ? getCursorPosition() : null;
|
|
1017
1017
|
var highlighted = prismModule.highlight(content, prismModule.languages[language] || prismModule.languages.plain, language);
|
|
1018
1018
|
codeElement.innerHTML = highlighted;
|
|
1019
|
-
if (
|
|
1019
|
+
if (makeEditable && cursorPosition !== null) {
|
|
1020
1020
|
var selection = window.getSelection();
|
|
1021
1021
|
var newRange = document.createRange();
|
|
1022
1022
|
var treeWalker = document.createTreeWalker(codeElement, NodeFilter.SHOW_TEXT, null);
|
|
@@ -1041,7 +1041,7 @@ var CodeBlock = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
1041
1041
|
codeElement.textContent = content;
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
-
}, [language, withSyntaxHighlighting,
|
|
1044
|
+
}, [language, withSyntaxHighlighting, makeEditable, prismModule, getCursorPosition, codeElement]);
|
|
1045
1045
|
var handleInput = useCallback(function(event) {
|
|
1046
1046
|
if (!codeElement) return;
|
|
1047
1047
|
var content = codeElement.textContent || "";
|
|
@@ -1052,12 +1052,12 @@ var CodeBlock = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
1052
1052
|
}, [highlightCode, onChange, codeElement]);
|
|
1053
1053
|
useEffect(function() {
|
|
1054
1054
|
var element = codeElement;
|
|
1055
|
-
if (!element || !
|
|
1055
|
+
if (!element || !makeEditable) return;
|
|
1056
1056
|
element.addEventListener("input", handleInput);
|
|
1057
1057
|
return function() {
|
|
1058
1058
|
element.removeEventListener("input", handleInput);
|
|
1059
1059
|
};
|
|
1060
|
-
}, [
|
|
1060
|
+
}, [makeEditable, handleInput, codeElement]);
|
|
1061
1061
|
useEffect(function() {
|
|
1062
1062
|
if (!codeElement || !prismModule) return;
|
|
1063
1063
|
highlightCode(initialCode);
|
|
@@ -1152,7 +1152,7 @@ var CodeBlock = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
1152
1152
|
}, index + 1);
|
|
1153
1153
|
}), /* @__PURE__ */ React.createElement("code", {
|
|
1154
1154
|
ref: setCodeElement,
|
|
1155
|
-
contentEditable,
|
|
1155
|
+
contentEditable: makeEditable,
|
|
1156
1156
|
suppressContentEditableWarning: true,
|
|
1157
1157
|
spellCheck: "false",
|
|
1158
1158
|
className: "language-".concat(language, " ").concat(isLoading ? "is-loading" : "")
|
|
@@ -1207,13 +1207,15 @@ var Divider = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
1207
1207
|
}));
|
|
1208
1208
|
});
|
|
1209
1209
|
var useClickOutside = function useClickOutside2(ref, handler) {
|
|
1210
|
-
var memoizedHandler = useCallback(handler, []);
|
|
1210
|
+
var memoizedHandler = useCallback(handler, [handler]);
|
|
1211
1211
|
useEffect(function() {
|
|
1212
1212
|
var listener = function listener2(event) {
|
|
1213
|
-
if (!ref.current ||
|
|
1213
|
+
if (!ref.current || typeof memoizedHandler !== "function") {
|
|
1214
1214
|
return;
|
|
1215
1215
|
}
|
|
1216
|
-
|
|
1216
|
+
if (!ref.current.contains(event.target)) {
|
|
1217
|
+
memoizedHandler(event);
|
|
1218
|
+
}
|
|
1217
1219
|
};
|
|
1218
1220
|
document.addEventListener("mousedown", listener);
|
|
1219
1221
|
document.addEventListener("touchstart", listener);
|
|
@@ -1292,7 +1294,7 @@ function _objectWithoutPropertiesLoose$F(r, e) {
|
|
|
1292
1294
|
return t;
|
|
1293
1295
|
}
|
|
1294
1296
|
var Drawer = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
1295
|
-
var children = _ref.children, openWhen = _ref.openWhen, closeWhen = _ref.closeWhen, closeOnClickOutside = _ref.closeOnClickOutside, padding = _ref.padding, position = _ref.position, size = _ref.size, bgColor = _ref.bgColor, bgColour = _ref.bgColour, _ref$isDismissible = _ref.isDismissible, isDismissible = _ref$isDismissible === void 0 ? true : _ref$isDismissible, _ref$showOverlay = _ref.showOverlay, showOverlay = _ref$showOverlay === void 0 ? false : _ref$showOverlay, label = _ref.label, props = _objectWithoutProperties$F(_ref, _excluded$F);
|
|
1297
|
+
var children = _ref.children, openWhen = _ref.openWhen, closeWhen = _ref.closeWhen, closeOnClickOutside = _ref.closeOnClickOutside, padding = _ref.padding, position = _ref.position, _ref$size = _ref.size, size = _ref$size === void 0 ? "medium" : _ref$size, bgColor = _ref.bgColor, bgColour = _ref.bgColour, _ref$isDismissible = _ref.isDismissible, isDismissible = _ref$isDismissible === void 0 ? true : _ref$isDismissible, _ref$showOverlay = _ref.showOverlay, showOverlay = _ref$showOverlay === void 0 ? false : _ref$showOverlay, label = _ref.label, props = _objectWithoutProperties$F(_ref, _excluded$F);
|
|
1296
1298
|
var _useState = useState(openWhen), _useState2 = _slicedToArray$c(_useState, 2), shouldRender = _useState2[0], setShouldRender = _useState2[1];
|
|
1297
1299
|
var drawerRef = useRef(null);
|
|
1298
1300
|
var effectiveRef = ref || drawerRef;
|
|
@@ -1328,7 +1330,10 @@ var Drawer = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
1328
1330
|
closeDrawer();
|
|
1329
1331
|
}
|
|
1330
1332
|
};
|
|
1331
|
-
|
|
1333
|
+
var handleContentClick = function handleContentClick2(e) {
|
|
1334
|
+
e.stopPropagation();
|
|
1335
|
+
};
|
|
1336
|
+
return shouldRender ? /* @__PURE__ */ React.createElement(Element, _extends$G({
|
|
1332
1337
|
as: "div",
|
|
1333
1338
|
"data-drawer": true,
|
|
1334
1339
|
ref: effectiveRef,
|
|
@@ -1339,24 +1344,27 @@ var Drawer = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
1339
1344
|
"aria-modal": "true",
|
|
1340
1345
|
"aria-label": label || "Drawer",
|
|
1341
1346
|
tabIndex: -1
|
|
1342
|
-
},
|
|
1343
|
-
onClick: closeDrawer
|
|
1344
|
-
} : {}, props), openWhen && showOverlay && /* @__PURE__ */ React.createElement(Div, {
|
|
1347
|
+
}, props), openWhen && showOverlay && /* @__PURE__ */ React.createElement(Div, {
|
|
1345
1348
|
className: "rest-of-page-overlay ".concat(openWhen ? "visible" : ""),
|
|
1346
|
-
"aria-hidden": "true"
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
+
"aria-hidden": "true",
|
|
1350
|
+
onClick: closeOnClickOutside ? closeDrawer : void 0
|
|
1351
|
+
}), /* @__PURE__ */ React.createElement(Div, {
|
|
1352
|
+
className: "drawer-wrapper"
|
|
1353
|
+
}, /* @__PURE__ */ React.createElement(Div, {
|
|
1349
1354
|
className: "drawer-content-wrapper",
|
|
1350
1355
|
padding,
|
|
1351
1356
|
bgColor,
|
|
1352
1357
|
bgColour,
|
|
1353
|
-
role: "document"
|
|
1354
|
-
|
|
1358
|
+
role: "document",
|
|
1359
|
+
onClick: handleContentClick
|
|
1360
|
+
}, /* @__PURE__ */ React.createElement(Div, {
|
|
1361
|
+
className: "drawer-inner-content"
|
|
1362
|
+
}, children)), isDismissible && /* @__PURE__ */ React.createElement("button", {
|
|
1355
1363
|
className: "drawer-dismiss-button",
|
|
1356
1364
|
onClick: closeDrawer,
|
|
1357
1365
|
"aria-label": "Close drawer",
|
|
1358
1366
|
tabIndex: 0
|
|
1359
|
-
})
|
|
1367
|
+
}))) : null;
|
|
1360
1368
|
});
|
|
1361
1369
|
var _excluded$E = ["label", "hideLabel", "htmlFor"];
|
|
1362
1370
|
function _extends$F() {
|
|
@@ -8,7 +8,7 @@ export interface CodeBlockCustomProps {
|
|
|
8
8
|
showLineNumbers?: boolean;
|
|
9
9
|
description?: string;
|
|
10
10
|
withSyntaxHighlighting?: boolean;
|
|
11
|
-
|
|
11
|
+
makeEditable?: boolean;
|
|
12
12
|
onChange?: (content: string) => void;
|
|
13
13
|
}
|
|
14
14
|
export type CodeBlockElementType = HTMLPreElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../src/components/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../src/components/CodeBlock/CodeBlock.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,OAAO,iBAAiB,CAAC;AAKzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAa1D,MAAM,WAAW,oBAAoB;IACjC,MAAuB,CAAC,EAAG,MAAM,GAAG,MAAM,CAAC;IAC3C,QAAuB,CAAC,EAAG,MAAM,CAAC;IAClC,cAAuB,CAAC,EAAG,OAAO,CAAC;IACnC,eAAuB,CAAC,EAAG,OAAO,CAAC;IACnC,WAAuB,CAAC,EAAG,MAAM,CAAC;IAClC,sBAAuB,CAAC,EAAG,OAAO,CAAC;IACnC,YAAuB,CAAC,EAAG,OAAO,CAAC;IACnC,QAAuB,CAAC,EAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxD;AAED,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAClD,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,EAAE,MAAM,oBAAoB,CAAC,GACnG,oBAAoB,CAAC;AAGzB,eAAO,MAAM,SAAS,oKAyQpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAGtE,OAAO,cAAc,CAAC;AAGtB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKxE,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,IAAI,CAAC,EAAG,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAG,OAAO,CAAC;IACpB,SAAS,CAAC,EAAG,MAAM,IAAI,CAAC;IACxB,mBAAmB,CAAC,EAAG,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAG,OAAO,CAAC;IACzB,WAAW,CAAC,EAAG,OAAO,CAAC;IACvB,KAAK,CAAC,EAAG,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAC/C,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,EAAE,MAAM,iBAAiB,CAAC,GAAG,iBAAiB,CAAC;AAGnH,eAAO,MAAM,MAAM,8JAyHlB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client;";
|
|
3
|
-
import { A, g, h, B, i, b, a, C, c, s, t, d, _, f, e, D, E, q, F, l, m, n, H, ac, ad, ae, af, ag, ah, k, I, o, L, M, y, z, N, J, G, V, W, K, P, O, Q, r, R, x, w, U, S, p, a1, $, a0, Z, a2, a3, j, a4, u, v, a5, a6, ai, T, a7, aa, a9, ab, X, Y, a8 } from "../Heading-
|
|
3
|
+
import { A, g, h, B, i, b, a, C, c, s, t, d, _, f, e, D, E, q, F, l, m, n, H, ac, ad, ae, af, ag, ah, k, I, o, L, M, y, z, N, J, G, V, W, K, P, O, Q, r, R, x, w, U, S, p, a1, $, a0, Z, a2, a3, j, a4, u, v, a5, a6, ai, T, a7, aa, a9, ab, X, Y, a8 } from "../Heading-hUAww3Qc.js";
|
|
4
4
|
export {
|
|
5
5
|
A as Accordion,
|
|
6
6
|
g as Article,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseClickOutside.d.ts","sourceRoot":"","sources":["../../src/hooks/UseClickOutside.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAC;AAE1D,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"UseClickOutside.d.ts","sourceRoot":"","sources":["../../src/hooks/UseClickOutside.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAC;AAE1D,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,WAAW,GAAG,WAAW,EAC/D,KAAM,SAAS,CAAC,CAAC,CAAC,EAAE,SAAU,CAAC,CAAC,EAAG,KAAK,KAAK,IAAI,SAwBpD,CAAC"}
|