@blocklet/discuss-kit-ux 2.3.100 → 2.3.102
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.
|
@@ -4,7 +4,7 @@ import { OnContentChangePlugin } from "@blocklet/editor/lib/ext/OnContentChangeP
|
|
|
4
4
|
import { CtrlsShortcutPlugin } from "@blocklet/editor/lib/ext/ShortcutPlugin";
|
|
5
5
|
import { SafeAreaPlugin } from "@blocklet/editor/lib/ext/SafeAreaPlugin";
|
|
6
6
|
import { lazyRetry } from "@arcblock/ux/lib/Util";
|
|
7
|
-
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-
|
|
7
|
+
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-BgawtXSC.mjs";
|
|
8
8
|
const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
|
|
9
9
|
const Root = styled(Box)`
|
|
10
10
|
.be-editable,
|
|
@@ -5101,7 +5101,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
|
|
|
5101
5101
|
}
|
|
5102
5102
|
const tablerSend = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 14L21 3m0 0l-6.5 18a.55.55 0 0 1-1 0L10 14l-7-3.5a.55.55 0 0 1 0-1z" }) });
|
|
5103
5103
|
const tablerLetterCase = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M14 15.5a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0-7 0M3 19V8.5a3.5 3.5 0 0 1 7 0V19m-7-6h7m11-1v7" }) });
|
|
5104
|
-
const Editor = lazyRetry(() => import("./editor-
|
|
5104
|
+
const Editor = lazyRetry(() => import("./editor-CzWrCuJ6.mjs"));
|
|
5105
5105
|
function LazyEditor(props) {
|
|
5106
5106
|
const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
|
|
5107
5107
|
/* @__PURE__ */ jsx(Skeleton, {}),
|
|
@@ -5326,27 +5326,39 @@ function ChatInput({ initialContent, send, onContentChange, onFocusChange }) {
|
|
|
5326
5326
|
children: /* @__PURE__ */ jsx(Box, { component: tablerSend, sx: { fontSize: 13, color: "text.secondary" } })
|
|
5327
5327
|
}
|
|
5328
5328
|
),
|
|
5329
|
-
/* @__PURE__ */ jsx(
|
|
5330
|
-
|
|
5329
|
+
/* @__PURE__ */ jsx(
|
|
5330
|
+
EditorConfigProvider$1,
|
|
5331
5331
|
{
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5332
|
+
value: {
|
|
5333
|
+
minimalMode: true,
|
|
5334
|
+
characterLimitConfig: {
|
|
5335
|
+
maxLength: window.blocklet.preferences.maxCommentLength,
|
|
5336
|
+
indicatorStyle: { display: "none" }
|
|
5337
|
+
}
|
|
5338
5338
|
},
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5339
|
+
children: /* @__PURE__ */ jsxs(
|
|
5340
|
+
LazyEditor,
|
|
5341
|
+
{
|
|
5342
|
+
enableSaveAreaPlugin: false,
|
|
5343
|
+
initialContent: initialContent || "",
|
|
5344
|
+
onChange: ({ content: contentStr, isEmpty }) => {
|
|
5345
|
+
const value = isEmpty ? "" : contentStr;
|
|
5346
|
+
setContent(value);
|
|
5347
|
+
onContentChange == null ? void 0 : onContentChange(value);
|
|
5348
|
+
},
|
|
5349
|
+
autoFocus: false,
|
|
5350
|
+
placeholder: "Jot something down",
|
|
5351
|
+
children: [
|
|
5352
|
+
/* @__PURE__ */ jsx(AutoClearPlugin, { clearKey: lastSent }),
|
|
5353
|
+
/* @__PURE__ */ jsx(ShortcutPlugin, { callback: handleSend }),
|
|
5354
|
+
/* @__PURE__ */ jsx(DraggerPlugin, {}),
|
|
5355
|
+
/* @__PURE__ */ jsx(FocusPlugin, { callback: FocusCallback }),
|
|
5356
|
+
/* @__PURE__ */ jsx(BusyPlugin, { onChange: (busy) => setEditorBusy(busy) })
|
|
5357
|
+
]
|
|
5358
|
+
}
|
|
5359
|
+
)
|
|
5348
5360
|
}
|
|
5349
|
-
)
|
|
5361
|
+
)
|
|
5350
5362
|
]
|
|
5351
5363
|
}
|
|
5352
5364
|
),
|
|
@@ -12756,11 +12768,11 @@ const useTranslate = ({ text, enabled }) => {
|
|
|
12756
12768
|
}
|
|
12757
12769
|
);
|
|
12758
12770
|
useEffect(() => {
|
|
12759
|
-
if (enabled && !isTranslatedRef.current[targetLanguage]) {
|
|
12760
|
-
isTranslatedRef.current[targetLanguage] = true;
|
|
12771
|
+
if (enabled && !isTranslatedRef.current[`${targetLanguage}-${key}`]) {
|
|
12772
|
+
isTranslatedRef.current[`${targetLanguage}-${key}`] = true;
|
|
12761
12773
|
run();
|
|
12762
12774
|
}
|
|
12763
|
-
}, [enabled, run, targetLanguage]);
|
|
12775
|
+
}, [enabled, run, targetLanguage, key]);
|
|
12764
12776
|
return {
|
|
12765
12777
|
translation: data,
|
|
12766
12778
|
key,
|
|
@@ -12771,6 +12783,7 @@ function Translate({ text, children, sx, ...rest }) {
|
|
|
12771
12783
|
if (typeof children === "string" && !text) {
|
|
12772
12784
|
text = children;
|
|
12773
12785
|
}
|
|
12786
|
+
text = text || "";
|
|
12774
12787
|
const ref = useRef(null);
|
|
12775
12788
|
const [inViewport] = useInViewport(ref);
|
|
12776
12789
|
const autoTranslate = useAutoTranslateStore((s) => s.autoTranslate);
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "@blocklet/labels";
|
|
2
|
-
import { W, o, Y, aQ, A, n, af, B, G, N, L, O, ar, _, Z, a1, $, a0, a3, x, C, y, z, F, a7, a8, aj, aa, T, U, ae, D, ai, ah, K, H, J, aG, aH, b, m, ag, M, P, aC, aq, w, aR, aS, v, aE, aF, R, S, ab, as, aD, q, aP, a4, a6, ak, an, am, aM, aI, aA, at, Q, ao, aK, au, aJ, ax, ay, aN, aL, l, az, h, p, r, k, aw, t, j, ac, aB, X, aT, c, a2, E, a9, ad, aV, e, u, ap, d, av, aU, aO, a5, al, f } from "./index-
|
|
2
|
+
import { W, o, Y, aQ, A, n, af, B, G, N, L, O, ar, _, Z, a1, $, a0, a3, x, C, y, z, F, a7, a8, aj, aa, T, U, ae, D, ai, ah, K, H, J, aG, aH, b, m, ag, M, P, aC, aq, w, aR, aS, v, aE, aF, R, S, ab, as, aD, q, aP, a4, a6, ak, an, am, aM, aI, aA, at, Q, ao, aK, au, aJ, ax, ay, aN, aL, l, az, h, p, r, k, aw, t, j, ac, aB, X, aT, c, a2, E, a9, ad, aV, e, u, ap, d, av, aU, aO, a5, al, f } from "./index-BgawtXSC.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
package/dist/index.umd.js
CHANGED
|
@@ -5243,27 +5243,39 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5243
5243
|
children: /* @__PURE__ */ jsxRuntime.jsx(material.Box, { component: tablerSend, sx: { fontSize: 13, color: "text.secondary" } })
|
|
5244
5244
|
}
|
|
5245
5245
|
),
|
|
5246
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5247
|
-
|
|
5246
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5247
|
+
editor$1.EditorConfigProvider,
|
|
5248
5248
|
{
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5249
|
+
value: {
|
|
5250
|
+
minimalMode: true,
|
|
5251
|
+
characterLimitConfig: {
|
|
5252
|
+
maxLength: window.blocklet.preferences.maxCommentLength,
|
|
5253
|
+
indicatorStyle: { display: "none" }
|
|
5254
|
+
}
|
|
5255
5255
|
},
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5256
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5257
|
+
LazyEditor,
|
|
5258
|
+
{
|
|
5259
|
+
enableSaveAreaPlugin: false,
|
|
5260
|
+
initialContent: initialContent || "",
|
|
5261
|
+
onChange: ({ content: contentStr, isEmpty }) => {
|
|
5262
|
+
const value = isEmpty ? "" : contentStr;
|
|
5263
|
+
setContent(value);
|
|
5264
|
+
onContentChange == null ? void 0 : onContentChange(value);
|
|
5265
|
+
},
|
|
5266
|
+
autoFocus: false,
|
|
5267
|
+
placeholder: "Jot something down",
|
|
5268
|
+
children: [
|
|
5269
|
+
/* @__PURE__ */ jsxRuntime.jsx(AutoClearPlugin, { clearKey: lastSent }),
|
|
5270
|
+
/* @__PURE__ */ jsxRuntime.jsx(ShortcutPlugin, { callback: handleSend }),
|
|
5271
|
+
/* @__PURE__ */ jsxRuntime.jsx(DraggerPlugin, {}),
|
|
5272
|
+
/* @__PURE__ */ jsxRuntime.jsx(FocusPlugin, { callback: FocusCallback }),
|
|
5273
|
+
/* @__PURE__ */ jsxRuntime.jsx(BusyPlugin.BusyPlugin, { onChange: (busy) => setEditorBusy(busy) })
|
|
5274
|
+
]
|
|
5275
|
+
}
|
|
5276
|
+
)
|
|
5265
5277
|
}
|
|
5266
|
-
)
|
|
5278
|
+
)
|
|
5267
5279
|
]
|
|
5268
5280
|
}
|
|
5269
5281
|
),
|
|
@@ -12673,11 +12685,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
12673
12685
|
}
|
|
12674
12686
|
);
|
|
12675
12687
|
react.useEffect(() => {
|
|
12676
|
-
if (enabled && !isTranslatedRef.current[targetLanguage]) {
|
|
12677
|
-
isTranslatedRef.current[targetLanguage] = true;
|
|
12688
|
+
if (enabled && !isTranslatedRef.current[`${targetLanguage}-${key}`]) {
|
|
12689
|
+
isTranslatedRef.current[`${targetLanguage}-${key}`] = true;
|
|
12678
12690
|
run();
|
|
12679
12691
|
}
|
|
12680
|
-
}, [enabled, run, targetLanguage]);
|
|
12692
|
+
}, [enabled, run, targetLanguage, key]);
|
|
12681
12693
|
return {
|
|
12682
12694
|
translation: data,
|
|
12683
12695
|
key,
|
|
@@ -12688,6 +12700,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
12688
12700
|
if (typeof children === "string" && !text2) {
|
|
12689
12701
|
text2 = children;
|
|
12690
12702
|
}
|
|
12703
|
+
text2 = text2 || "";
|
|
12691
12704
|
const ref = react.useRef(null);
|
|
12692
12705
|
const [inViewport] = ahooks.useInViewport(ref);
|
|
12693
12706
|
const autoTranslate = useAutoTranslateStore((s) => s.autoTranslate);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.102",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"unstated-next": "^1.1.0",
|
|
49
49
|
"url-join": "^4.0.1",
|
|
50
50
|
"zustand": "^4.5.5",
|
|
51
|
-
"@blocklet/editor": "^2.3.
|
|
52
|
-
"@blocklet/labels": "^2.3.
|
|
51
|
+
"@blocklet/editor": "^2.3.102",
|
|
52
|
+
"@blocklet/labels": "^2.3.102"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@arcblock/did-connect": "^2.10.36",
|