@baishuyun/ui-mobile 0.10.0 → 0.11.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.
@@ -1,4 +1,4 @@
1
- import "../vendors/version-C0got4sp.js";
1
+ import "../vendors/version-CMSvw03J.js";
2
2
  import "../ConfigProvider/useLocale-DiKogqPs.js";
3
3
  import "../Icon/Icon-BKlmJSoE.js";
4
4
  import { n as e, t } from "./AMap-BkfhkrnK.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-C0got4sp.js";
1
+ import "../vendors/version-CMSvw03J.js";
2
2
  import "../Overlay/Overlay-DFiZYsBs.js";
3
3
  import "../ConfigProvider/useLocale-DiKogqPs.js";
4
4
  import "../Popup/Popup-Cg3t422z.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-C0got4sp.js";
1
+ import "../vendors/version-CMSvw03J.js";
2
2
  import "../ConfigProvider/useLocale-DiKogqPs.js";
3
3
  import "./timeUtils-t4A3-Hr6.js";
4
4
  import { t as e } from "./Calendar-Cf81JVOC.js";
@@ -1,4 +1,4 @@
1
- import "../vendors/version-C0got4sp.js";
1
+ import "../vendors/version-CMSvw03J.js";
2
2
  import "../Overlay/Overlay-DFiZYsBs.js";
3
3
  import { r as e, t } from "./useLocale-DiKogqPs.js";
4
4
  import { t as n } from "./ConfigProvider-CNWefxiV.js";
@@ -284,6 +284,7 @@ var st = [
284
284
  "rowspan",
285
285
  "data-language",
286
286
  "data-id",
287
+ "data-src",
287
288
  "class",
288
289
  "style",
289
290
  "width",
@@ -314,7 +315,11 @@ var st = [
314
315
  ALLOWED_TAGS: Ct,
315
316
  ALLOWED_ATTR: wt,
316
317
  ALLOW_DATA_ATTR: !1,
317
- ADD_ATTR: ["data-language", "data-id"],
318
+ ADD_ATTR: [
319
+ "data-language",
320
+ "data-id",
321
+ "data-src"
322
+ ],
318
323
  ALLOWED_URI_REGEXP: Et
319
324
  })) : "", W = {
320
325
  margin: "0.6em 0 0.4em",
@@ -652,23 +657,24 @@ var st = [
652
657
  p();
653
658
  }
654
659
  };
655
- }, jn = i({}), K = 36, Mn = 14, Nn = 2 * Math.PI * Mn, Pn = ({ nodeKey: e, src: t, altText: n, dataId: r }) => {
656
- let i = o(jn), a = e in i, s = i[e];
660
+ }, jn = i({}), K = 36, Mn = 14, Nn = 2 * Math.PI * Mn, Pn = ({ nodeKey: e, src: t, altText: n, dataId: r, dataSrc: i }) => {
661
+ let a = o(jn), s = e in a, c = a[e];
657
662
  return /* @__PURE__ */ m("span", {
658
663
  className: V["bsy-mobile-editor__image"],
659
664
  children: [/* @__PURE__ */ p("img", {
660
665
  src: t,
661
666
  alt: n,
662
- "data-id": r
663
- }), a ? /* @__PURE__ */ p("span", {
667
+ "data-id": r,
668
+ "data-src": i
669
+ }), s ? /* @__PURE__ */ p("span", {
664
670
  className: V["bsy-mobile-editor__image-mask"],
665
671
  role: "progressbar",
666
672
  "aria-label": n,
667
673
  "aria-valuemin": 0,
668
674
  "aria-valuemax": 100,
669
- "aria-valuenow": s === void 0 ? void 0 : Math.round(s),
675
+ "aria-valuenow": c === void 0 ? void 0 : Math.round(c),
670
676
  children: /* @__PURE__ */ m("svg", {
671
- className: s === void 0 ? `${V["bsy-mobile-editor__image-progress"]} ${V["bsy-mobile-editor__image-progress--spin"]}` : V["bsy-mobile-editor__image-progress"],
677
+ className: c === void 0 ? `${V["bsy-mobile-editor__image-progress"]} ${V["bsy-mobile-editor__image-progress--spin"]}` : V["bsy-mobile-editor__image-progress"],
672
678
  width: K,
673
679
  height: K,
674
680
  viewBox: `0 0 ${K} ${K}`,
@@ -688,8 +694,8 @@ var st = [
688
694
  stroke: "#fff",
689
695
  strokeWidth: "3",
690
696
  strokeLinecap: "round",
691
- strokeDasharray: s === void 0 ? `${Nn * .25} ${Nn}` : Nn,
692
- strokeDashoffset: s === void 0 ? 0 : Nn * (1 - s / 100),
697
+ strokeDasharray: c === void 0 ? `${Nn * .25} ${Nn}` : Nn,
698
+ strokeDashoffset: c === void 0 ? 0 : Nn * (1 - c / 100),
693
699
  transform: `rotate(-90 ${K / 2} ${K / 2})`
694
700
  })]
695
701
  })
@@ -701,14 +707,15 @@ var st = [
701
707
  __width;
702
708
  __height;
703
709
  __dataId;
710
+ __dataSrc;
704
711
  static getType() {
705
712
  return "image";
706
713
  }
707
714
  static clone(t) {
708
- return new e(t.__src, t.__altText, t.__width, t.__height, t.__key, t.__dataId);
715
+ return new e(t.__src, t.__altText, t.__width, t.__height, t.__key, t.__dataId, t.__dataSrc);
709
716
  }
710
- constructor(e, t, n, r, i, a) {
711
- super(i), this.__src = e, this.__altText = t || "", this.__width = n, this.__height = r, this.__dataId = a;
717
+ constructor(e, t, n, r, i, a, o) {
718
+ super(i), this.__src = e, this.__altText = t || "", this.__width = n, this.__height = r, this.__dataId = a, this.__dataSrc = o;
712
719
  }
713
720
  createDOM() {
714
721
  let e = document.createElement("span");
@@ -719,7 +726,7 @@ var st = [
719
726
  }
720
727
  exportDOM() {
721
728
  let e = document.createElement("img");
722
- return e.setAttribute("src", this.__src), e.setAttribute("alt", this.__altText), e.style.maxWidth = "100%", e.style.display = "inline", e.style.verticalAlign = "baseline", this.__width && e.setAttribute("width", this.__width.toString()), this.__height && e.setAttribute("height", this.__height.toString()), this.__dataId && e.setAttribute("data-id", this.__dataId), { element: e };
729
+ return e.setAttribute("src", this.__src), e.setAttribute("alt", this.__altText), e.style.maxWidth = "100%", e.style.display = "inline", e.style.verticalAlign = "baseline", this.__width && e.setAttribute("width", this.__width.toString()), this.__height && e.setAttribute("height", this.__height.toString()), this.__dataId && e.setAttribute("data-id", this.__dataId), this.__dataSrc && e.setAttribute("data-src", this.__dataSrc), { element: e };
723
730
  }
724
731
  getSrc() {
725
732
  return this.__src;
@@ -739,13 +746,14 @@ var st = [
739
746
  }) };
740
747
  }
741
748
  static importJSON(e) {
742
- let { src: t, altText: n, width: r, height: i, dataId: a } = e;
749
+ let { src: t, altText: n, width: r, height: i, dataId: a, dataSrc: o } = e;
743
750
  return Ln({
744
751
  src: t,
745
752
  altText: n,
746
753
  width: r,
747
754
  height: i,
748
- dataId: a
755
+ dataId: a,
756
+ dataSrc: o
749
757
  });
750
758
  }
751
759
  exportJSON() {
@@ -755,6 +763,7 @@ var st = [
755
763
  width: this.__width,
756
764
  height: this.__height,
757
765
  dataId: this.__dataId,
766
+ dataSrc: this.__dataSrc,
758
767
  type: "image",
759
768
  version: 1
760
769
  };
@@ -767,10 +776,11 @@ var st = [
767
776
  nodeKey: this.getKey(),
768
777
  src: this.__src,
769
778
  altText: this.__altText,
770
- dataId: this.__dataId
779
+ dataId: this.__dataId,
780
+ dataSrc: this.__dataSrc
771
781
  });
772
782
  }
773
- }, In = (e) => e instanceof Fn, Ln = ({ src: e, altText: t, width: n, height: r, dataId: i, key: a }) => new Fn(e, t, n, r, a, i), Rn = (e) => {
783
+ }, In = (e) => e instanceof Fn, Ln = ({ src: e, altText: t, width: n, height: r, dataId: i, dataSrc: a, key: o }) => new Fn(e, t, n, r, o, i, a), Rn = (e) => {
774
784
  if (!(e instanceof HTMLImageElement)) return null;
775
785
  let { src: t, alt: n, style: r } = e, i, a;
776
786
  if (r.width) {
@@ -786,7 +796,8 @@ var st = [
786
796
  altText: n,
787
797
  width: i,
788
798
  height: a,
789
- dataId: e.getAttribute("data-id") || void 0
799
+ dataId: e.getAttribute("data-id") || void 0,
800
+ dataSrc: e.getAttribute("data-src") || void 0
790
801
  }) };
791
802
  }, zn = (e) => mt.includes(e.name.split(".").pop()?.toLowerCase() ?? ""), Bn = (e) => zn(e) ? e.size > 5242880 ? "size" : null : "type", Vn = ({ editor: e, upload: t, savedSelectionRef: n, attachmentsBySrc: r }) => {
792
803
  let i = u(null), o = u(null), c = u(!0), [l, f] = d({}), p = a(() => {
@@ -803,7 +814,7 @@ var st = [
803
814
  let o = Ln({
804
815
  src: t,
805
816
  altText: r,
806
- dataId: i
817
+ dataSrc: i
807
818
  });
808
819
  a = o.getKey(), xe([o]);
809
820
  for (let e of o.getParent()?.getChildren() ?? []) Ee(e) && e.getTextContentSize() === 0 && e.remove();
@@ -2663,7 +2674,7 @@ var st = [
2663
2674
  open: E,
2664
2675
  onClose: () => D(!1),
2665
2676
  onConfirm: (e) => {
2666
- ie(e, e), D(!1);
2677
+ ie(e, "", e), D(!1);
2667
2678
  }
2668
2679
  }),
2669
2680
  /* @__PURE__ */ p(kr, {
@@ -1,8 +1,8 @@
1
- import "../vendors/version-C0got4sp.js";
1
+ import "../vendors/version-CMSvw03J.js";
2
2
  import "../Overlay/Overlay-DFiZYsBs.js";
3
3
  import "../ConfigProvider/useLocale-DiKogqPs.js";
4
4
  import "../Popup/Popup-Cg3t422z.js";
5
5
  import "../Icon/Icon-BKlmJSoE.js";
6
6
  import "../ActionSheet/ActionSheet-DJyeduZq.js";
7
- import { n as e, t } from "./Editor-CfA-ye-u.js";
7
+ import { n as e, t } from "./Editor-CZ4Tz-N2.js";
8
8
  export { e as EditorHtmlPreview, t as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-C0got4sp.js";
1
+ import "../vendors/version-CMSvw03J.js";
2
2
  import "../Overlay/Overlay-DFiZYsBs.js";
3
3
  import "../ConfigProvider/useLocale-DiKogqPs.js";
4
4
  import "../Popup/Popup-Cg3t422z.js";
@@ -1,3 +1,3 @@
1
- import "../vendors/version-C0got4sp.js";
1
+ import "../vendors/version-CMSvw03J.js";
2
2
  import { t as e } from "./Icon-BKlmJSoE.js";
3
3
  export { e as default };
@@ -1,3 +1,3 @@
1
- import "../vendors/version-C0got4sp.js";
1
+ import "../vendors/version-CMSvw03J.js";
2
2
  import { a as e, i as t, n, o as r, r as i, t as a } from "./Overlay-DFiZYsBs.js";
3
3
  export { a as OVERLAY_Z_BASE, n as OVERLAY_Z_STEP, i as OverlayProvider, t as getNextImperativeOverlayZIndex, e as imperativeOverlayStyle, r as useOverlayZIndex };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-C0got4sp.js";
1
+ import "../vendors/version-CMSvw03J.js";
2
2
  import "../Overlay/Overlay-DFiZYsBs.js";
3
3
  import "../ConfigProvider/useLocale-DiKogqPs.js";
4
4
  import { t as e } from "./Popup-Cg3t422z.js";
@@ -1,3 +1,3 @@
1
- import "../vendors/version-C0got4sp.js";
1
+ import "../vendors/version-CMSvw03J.js";
2
2
  import { t as e } from "./Segmented-CxQ3Pd05.js";
3
3
  export { e as default };
@@ -10,7 +10,7 @@ type UseEditorImageUploadOptions = {
10
10
  export declare const useEditorImageUpload: ({ editor, upload, savedSelectionRef, attachmentsBySrc, }: UseEditorImageUploadOptions) => {
11
11
  fileInputRef: RefObject<HTMLInputElement>;
12
12
  uploadProgress: Record<string, number | undefined>;
13
- insertImage: (src: string, altText: string, dataId?: string) => string;
13
+ insertImage: (src: string, altText: string, dataSrc?: string) => string;
14
14
  onFileChange: (event: ChangeEvent<HTMLInputElement>) => Promise<void>;
15
15
  abortUpload: () => void;
16
16
  };
@@ -7,6 +7,7 @@ export interface ImagePayload {
7
7
  width?: number;
8
8
  height?: number;
9
9
  dataId?: string;
10
+ dataSrc?: string;
10
11
  key?: NodeKey;
11
12
  }
12
13
  export type SerializedImageNode = Spread<{
@@ -15,6 +16,7 @@ export type SerializedImageNode = Spread<{
15
16
  width?: number;
16
17
  height?: number;
17
18
  dataId?: string;
19
+ dataSrc?: string;
18
20
  }, SerializedLexicalNode>;
19
21
  export declare class ImageNode extends DecoratorNode<ReactNode> {
20
22
  __src: string;
@@ -22,9 +24,10 @@ export declare class ImageNode extends DecoratorNode<ReactNode> {
22
24
  __width?: number;
23
25
  __height?: number;
24
26
  __dataId?: string;
27
+ __dataSrc?: string;
25
28
  static getType(): string;
26
29
  static clone(node: ImageNode): ImageNode;
27
- constructor(src: string, altText?: string, width?: number, height?: number, key?: NodeKey, dataId?: string);
30
+ constructor(src: string, altText?: string, width?: number, height?: number, key?: NodeKey, dataId?: string, dataSrc?: string);
28
31
  createDOM(): HTMLElement;
29
32
  updateDOM(): false;
30
33
  exportDOM(): {
@@ -45,4 +48,4 @@ export declare class ImageNode extends DecoratorNode<ReactNode> {
45
48
  decorate(): ReactNode;
46
49
  }
47
50
  export declare const $isImageNode: (node: LexicalNode | null | undefined) => node is ImageNode;
48
- export declare const $createImageNode: ({ src, altText, width, height, dataId, key, }: ImagePayload) => ImageNode;
51
+ export declare const $createImageNode: ({ src, altText, width, height, dataId, dataSrc, key, }: ImagePayload) => ImageNode;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./vendors/version-C0got4sp.js";
1
+ import "./vendors/version-CMSvw03J.js";
2
2
  import { a as e, i as t, n, o as r, r as i, t as a } from "./Overlay/Overlay-DFiZYsBs.js";
3
3
  import { t as o } from "./ConfigProvider/useLocale-DiKogqPs.js";
4
4
  import { t as s } from "./Popup/Popup-Cg3t422z.js";
@@ -10,5 +10,5 @@ import { t as f } from "./Calendar/Calendar-Cf81JVOC.js";
10
10
  import { t as p } from "./Segmented/Segmented-CxQ3Pd05.js";
11
11
  import { n as m, t as h } from "./AMap/AMap-BkfhkrnK.js";
12
12
  import { t as g } from "./ConfigProvider/ConfigProvider-CNWefxiV.js";
13
- import { n as _, t as v } from "./Editor/Editor-CfA-ye-u.js";
13
+ import { n as _, t as v } from "./Editor/Editor-CZ4Tz-N2.js";
14
14
  export { u as ALL_ZOOM_LEVELS, h as AMap, l as ActionSheet, f as Calendar, g as ConfigProvider, v as Editor, _ as EditorHtmlPreview, d as Gantt, c as Icon, a as OVERLAY_Z_BASE, n as OVERLAY_Z_STEP, i as OverlayProvider, s as Popup, p as Segmented, t as getNextImperativeOverlayZIndex, e as imperativeOverlayStyle, m as useAMap, o as useLocale, r as useOverlayZIndex };
@@ -1,6 +1,6 @@
1
1
  //#region src/version.ts
2
2
  if (typeof window < "u") {
3
3
  let e = window.__BSY_UI__ ??= {};
4
- e["@baishuyun/ui-mobile"] = "0.10.0";
4
+ e["@baishuyun/ui-mobile"] = "0.11.0";
5
5
  }
6
6
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baishuyun/ui-mobile",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "description": "百数云 H5 / Mobile UI 组件库",
6
6
  "author": "bsy-fe team",