@blocklet/discuss-kit-ux 1.5.213 → 1.6.0

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 { lazy } from "react";
7
- import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-13980925.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-f257cd82.mjs";
8
8
  import "@blocklet/labels";
9
9
  import "@mui/material/styles";
10
10
  import "@mui/material/Box";
@@ -304,13 +304,13 @@ function CmdEnterShortcutPlugin({ callback, shortcut = "CMD_ENTER" }) {
304
304
  const UPLOADS_PREFIX$1 = "/uploads";
305
305
  const IMAGE_URL_PREFIX = joinUrl(inferDiscussKitApiPrefix(), UPLOADS_PREFIX$1);
306
306
  const originalExportJSON$1 = ImageNode.prototype.exportJSON;
307
- const ensureLeadingSlash = (str) => str.startsWith("/") ? str : `/${str}`;
307
+ const ensureLeadingSlash$1 = (str) => str.startsWith("/") ? str : `/${str}`;
308
308
  const stripResizeQuery = (str) => str.split("?").shift();
309
309
  ImageNode.prototype.exportJSON = function exportJSON() {
310
310
  const json = originalExportJSON$1.call(this);
311
311
  if (json.src && json.src.startsWith(IMAGE_URL_PREFIX)) {
312
312
  json.src = json.src.replace(IMAGE_URL_PREFIX, "");
313
- json.src = ensureLeadingSlash(json.src);
313
+ json.src = ensureLeadingSlash$1(json.src);
314
314
  json.src = stripResizeQuery(json.src);
315
315
  }
316
316
  return json;
@@ -341,19 +341,20 @@ function ImagePathFixerPlugin() {
341
341
  }
342
342
  const UPLOADS_PREFIX = joinUrl(inferDiscussKitApiPrefix(), "/uploads");
343
343
  const originalExportJSON = VideoNode.prototype.exportJSON;
344
+ const ensureLeadingSlash = (str) => str.startsWith("/") ? str : `/${str}`;
344
345
  VideoNode.prototype.exportJSON = function exportJSON2() {
345
346
  const json = originalExportJSON.call(this);
346
- if (this.__originalSrc__ !== void 0) {
347
- json.src = this.__originalSrc__;
347
+ if (json.src && json.src.startsWith(UPLOADS_PREFIX)) {
348
+ json.src = json.src.replace(UPLOADS_PREFIX, "");
349
+ json.src = ensureLeadingSlash(json.src);
348
350
  }
349
351
  return json;
350
352
  };
351
353
  function VideoNodeTransform(node) {
352
354
  const targetNode = node;
353
355
  const src = targetNode.getSrc();
354
- if ((src == null ? void 0 : src.startsWith("/")) && targetNode.__originalSrc__ === void 0) {
356
+ if ((src == null ? void 0 : src.startsWith("/")) && !src.startsWith(UPLOADS_PREFIX)) {
355
357
  targetNode.setSrc(joinUrl(UPLOADS_PREFIX, src));
356
- targetNode.__originalSrc__ = src;
357
358
  }
358
359
  }
359
360
  function VideoPathFixerPlugin() {
@@ -4394,7 +4395,7 @@ function Pagination({ page, size = 20, total, onChange, routerMode = true, ...re
4394
4395
  }
4395
4396
  );
4396
4397
  }
4397
- const Editor = lazy(() => import("./editor-20e8ce1d.mjs"));
4398
+ const Editor = lazy(() => import("./editor-6acff851.mjs"));
4398
4399
  function LazyEditor(props) {
4399
4400
  const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
4400
4401
  /* @__PURE__ */ jsx(Skeleton, {}),
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { K, j, N, A, h, a6, B, z, y, E, Q, O, T, W, o, C, q, v, x, _, $, aa, a1, H, J, D, a9, a8, G, c, b, a7, M, P, ah, n, m, a5, R, S, a2, k, X, Z, ab, ae, ad, af, ai, F, aj, l, p, r, t, d, a3, L, e, U, w, a0, a4, u, ag, ak, Y, ac, f } from "./index-13980925.mjs";
2
+ import { K, j, N, A, h, a6, B, z, y, E, Q, O, T, W, o, C, q, v, x, _, $, aa, a1, H, J, D, a9, a8, G, c, b, a7, M, P, ah, n, m, a5, R, S, a2, k, X, Z, ab, ae, ad, af, ai, F, aj, l, p, r, t, d, a3, L, e, U, w, a0, a4, u, ag, ak, Y, ac, f } from "./index-f257cd82.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -246,13 +246,13 @@ var __publicField = (obj, key, value) => {
246
246
  const UPLOADS_PREFIX$1 = "/uploads";
247
247
  const IMAGE_URL_PREFIX = joinUrl(inferDiscussKitApiPrefix(), UPLOADS_PREFIX$1);
248
248
  const originalExportJSON$1 = ImageNode.ImageNode.prototype.exportJSON;
249
- const ensureLeadingSlash = (str) => str.startsWith("/") ? str : `/${str}`;
249
+ const ensureLeadingSlash$1 = (str) => str.startsWith("/") ? str : `/${str}`;
250
250
  const stripResizeQuery = (str) => str.split("?").shift();
251
251
  ImageNode.ImageNode.prototype.exportJSON = function exportJSON() {
252
252
  const json = originalExportJSON$1.call(this);
253
253
  if (json.src && json.src.startsWith(IMAGE_URL_PREFIX)) {
254
254
  json.src = json.src.replace(IMAGE_URL_PREFIX, "");
255
- json.src = ensureLeadingSlash(json.src);
255
+ json.src = ensureLeadingSlash$1(json.src);
256
256
  json.src = stripResizeQuery(json.src);
257
257
  }
258
258
  return json;
@@ -283,19 +283,20 @@ var __publicField = (obj, key, value) => {
283
283
  }
284
284
  const UPLOADS_PREFIX = joinUrl(inferDiscussKitApiPrefix(), "/uploads");
285
285
  const originalExportJSON = VideoNode.VideoNode.prototype.exportJSON;
286
+ const ensureLeadingSlash = (str) => str.startsWith("/") ? str : `/${str}`;
286
287
  VideoNode.VideoNode.prototype.exportJSON = function exportJSON() {
287
288
  const json = originalExportJSON.call(this);
288
- if (this.__originalSrc__ !== void 0) {
289
- json.src = this.__originalSrc__;
289
+ if (json.src && json.src.startsWith(UPLOADS_PREFIX)) {
290
+ json.src = json.src.replace(UPLOADS_PREFIX, "");
291
+ json.src = ensureLeadingSlash(json.src);
290
292
  }
291
293
  return json;
292
294
  };
293
295
  function VideoNodeTransform(node) {
294
296
  const targetNode = node;
295
297
  const src = targetNode.getSrc();
296
- if ((src == null ? void 0 : src.startsWith("/")) && targetNode.__originalSrc__ === void 0) {
298
+ if ((src == null ? void 0 : src.startsWith("/")) && !src.startsWith(UPLOADS_PREFIX)) {
297
299
  targetNode.setSrc(joinUrl(UPLOADS_PREFIX, src));
298
- targetNode.__originalSrc__ = src;
299
300
  }
300
301
  }
301
302
  function VideoPathFixerPlugin() {
@@ -1,6 +1,4 @@
1
- import type { Label } from '@blocklet/labels';
2
1
  import type { User } from '../../types';
3
2
  export declare const editorContent = "{\"root\":{\"children\":[{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"h1\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"heading\",\"version\":1,\"tag\":\"h1\"},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"h2\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"heading\",\"version\":1,\"tag\":\"h2\"},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"h3\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"heading\",\"version\":1,\"tag\":\"h3\"},{\"children\":[{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 1\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":1},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 2\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":2}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"Labore in aliqua laboris aute velit. Ea adipisicing velit ut deserunt veniam nulla cupidatat anim excepteur mollit nostrud quis. Amet laboris proident proident consectetur amet occaecat est adipisicing. Proident anim sit est fugiat pariatur excepteur cillum labore nostrud id cillum eu officia.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"paragraph\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}";
4
3
  export declare const longEditorContent = "{\"root\":{\"children\":[{\"children\":[{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 1\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":1},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 2\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":2},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 3\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":3},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 4\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":4},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 5\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":5},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 6\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":6},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 7\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":7},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 8\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":8},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 9\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":9},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 10\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":10},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 11\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":11},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 12\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":12}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}";
5
4
  export declare const mockUsers: User[];
6
- export declare const labels: Label[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.5.213",
3
+ "version": "1.6.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@arcblock/ws": "^1.18.103",
32
- "@blocklet/editor": "1.5.213",
33
- "@blocklet/labels": "1.5.213",
32
+ "@blocklet/editor": "1.6.0",
33
+ "@blocklet/labels": "1.6.0",
34
34
  "@blocklet/uploader": "^0.0.53",
35
35
  "@emotion/css": "^11.10.5",
36
36
  "@emotion/react": "^11.10.5",
@@ -92,5 +92,5 @@
92
92
  "resolutions": {
93
93
  "react": "^18.2.0"
94
94
  },
95
- "gitHead": "b0aa694b1676289ebbb9a756e1cbecdd2e647e4d"
95
+ "gitHead": "35acd7ea5b0a170b74ab8f69b744f6833445fdec"
96
96
  }
@@ -1,12 +0,0 @@
1
- import { ComponentStory } from '@storybook/react';
2
- import BlogList from './blog-list';
3
- declare const _default: {
4
- title: string;
5
- parameters: {
6
- layout: string;
7
- };
8
- decorators: ((StoryFn: any) => import("react/jsx-runtime").JSX.Element)[];
9
- };
10
- export default _default;
11
- export declare const BlogListStory: ComponentStory<typeof BlogList>;
12
- export declare const BlogCards: ComponentStory<typeof BlogList>;