@blocklet/discuss-kit-ux 2.3.22 → 2.3.24

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-JEUQhbmY.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-OmY69aLb.mjs";
8
8
  const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -273,12 +273,13 @@ const protectLogin = (session, action) => {
273
273
  session.login(() => resolve(action()));
274
274
  });
275
275
  };
276
- const copy = (text) => {
277
- if (navigator == null ? void 0 : navigator.clipboard) {
278
- navigator.clipboard.writeText(text);
279
- }
276
+ const copyWithExecCommand = (text) => {
280
277
  const tmp = document.createElement("TEXTAREA");
281
278
  const active = document.activeElement;
279
+ tmp.style.position = "fixed";
280
+ tmp.style.opacity = "0";
281
+ tmp.style.left = "-9999px";
282
+ tmp.style.top = "0";
282
283
  tmp.value = text;
283
284
  document.body.appendChild(tmp);
284
285
  tmp.select();
@@ -286,6 +287,18 @@ const copy = (text) => {
286
287
  document.body.removeChild(tmp);
287
288
  active == null ? void 0 : active.focus();
288
289
  };
290
+ const copy = (text) => {
291
+ if (navigator == null ? void 0 : navigator.clipboard) {
292
+ try {
293
+ navigator.clipboard.writeText(text).catch(() => {
294
+ copyWithExecCommand(text);
295
+ });
296
+ return;
297
+ } catch (e) {
298
+ }
299
+ }
300
+ copyWithExecCommand(text);
301
+ };
289
302
  const getLastItem = (arr) => (arr == null ? void 0 : arr.length) ? arr[arr.length - 1] : null;
290
303
  function tryParseJSONObject(str) {
291
304
  try {
@@ -4938,7 +4951,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
4938
4951
  }
4939
4952
  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" }) });
4940
4953
  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" }) });
4941
- const Editor = lazyRetry(() => import("./editor-94xkCNNh.mjs"));
4954
+ const Editor = lazyRetry(() => import("./editor-LcIsRLJi.mjs"));
4942
4955
  function LazyEditor(props) {
4943
4956
  const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
4944
4957
  /* @__PURE__ */ jsx(Skeleton, {}),
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { X, o, Z, A, n, ag, B, J, O, N, Q, as, $, _, a2, a0, a1, a4, x, G, H, C, y, z, F, a8, a9, ak, ab, U, W, af, D, aj, ai, L, K, b, m, ah, M, P, aD, ar, w, v, aF, aG, R, S, ac, at, aE, q, a5, a7, al, ao, an, aB, au, T, ap, av, ay, az, l, aA, h, p, r, k, ax, t, j, ad, aC, Y, c, a3, E, aa, ae, e, u, aq, d, aw, a6, am, f } from "./index-JEUQhbmY.mjs";
2
+ import { X, o, Z, A, n, ag, B, J, O, N, Q, as, $, _, a2, a0, a1, a4, x, G, H, C, y, z, F, a8, a9, ak, ab, U, W, af, D, aj, ai, L, K, b, m, ah, M, P, aD, ar, w, v, aF, aG, R, S, ac, at, aE, q, a5, a7, al, ao, an, aB, au, T, ap, av, ay, az, l, aA, h, p, r, k, ax, t, j, ad, aC, Y, c, a3, E, aa, ae, e, u, aq, d, aw, a6, am, f } from "./index-OmY69aLb.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -195,12 +195,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
195
195
  session.login(() => resolve(action()));
196
196
  });
197
197
  };
198
- const copy = (text2) => {
199
- if (navigator == null ? void 0 : navigator.clipboard) {
200
- navigator.clipboard.writeText(text2);
201
- }
198
+ const copyWithExecCommand = (text2) => {
202
199
  const tmp = document.createElement("TEXTAREA");
203
200
  const active = document.activeElement;
201
+ tmp.style.position = "fixed";
202
+ tmp.style.opacity = "0";
203
+ tmp.style.left = "-9999px";
204
+ tmp.style.top = "0";
204
205
  tmp.value = text2;
205
206
  document.body.appendChild(tmp);
206
207
  tmp.select();
@@ -208,6 +209,18 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
208
209
  document.body.removeChild(tmp);
209
210
  active == null ? void 0 : active.focus();
210
211
  };
212
+ const copy = (text2) => {
213
+ if (navigator == null ? void 0 : navigator.clipboard) {
214
+ try {
215
+ navigator.clipboard.writeText(text2).catch(() => {
216
+ copyWithExecCommand(text2);
217
+ });
218
+ return;
219
+ } catch (e) {
220
+ }
221
+ }
222
+ copyWithExecCommand(text2);
223
+ };
211
224
  const getLastItem = (arr) => (arr == null ? void 0 : arr.length) ? arr[arr.length - 1] : null;
212
225
  function tryParseJSONObject(str) {
213
226
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.3.22",
3
+ "version": "2.3.24",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -18,9 +18,9 @@
18
18
  "access": "public"
19
19
  },
20
20
  "dependencies": {
21
- "@arcblock/bridge": "^2.13.24",
22
- "@arcblock/react-hooks": "^2.13.24",
23
- "@arcblock/ws": "^1.20.7",
21
+ "@arcblock/bridge": "^2.13.26",
22
+ "@arcblock/react-hooks": "^2.13.26",
23
+ "@arcblock/ws": "^1.20.8",
24
24
  "@blocklet/uploader": "^0.1.89",
25
25
  "@emotion/css": "^11.13.0",
26
26
  "@emotion/react": "^11.13.3",
@@ -45,8 +45,8 @@
45
45
  "ufo": "^1.5.4",
46
46
  "unstated-next": "^1.1.0",
47
47
  "url-join": "^4.0.1",
48
- "@blocklet/editor": "^2.3.22",
49
- "@blocklet/labels": "^2.3.22"
48
+ "@blocklet/editor": "^2.3.24",
49
+ "@blocklet/labels": "^2.3.24"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@arcblock/did-connect": "^2.10.36",
@@ -63,7 +63,7 @@
63
63
  "devDependencies": {
64
64
  "@arcblock/eslint-config-ts": "^0.3.3",
65
65
  "@babel/core": "^7.25.2",
66
- "@blocklet/sdk": "^1.16.42",
66
+ "@blocklet/sdk": "^1.16.43",
67
67
  "@iconify-json/iconoir": "^1.2.1",
68
68
  "@iconify-json/material-symbols": "^1.2.1",
69
69
  "@iconify-json/mdi": "^1.2.0",