web3dlink 2.1.3 → 2.1.5

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/web3dlink.js CHANGED
@@ -1259,13 +1259,22 @@ function validateLodConfig(e, t) {
1259
1259
  });
1260
1260
  }
1261
1261
  function validateHtmlMarkerConfig(e, t) {
1262
- t.push(...validateOptionalNumber({
1262
+ if (t.push(...validateOptionalNumber({
1263
1263
  normalized: e,
1264
1264
  field: "scale",
1265
1265
  value: e.scale,
1266
1266
  defaultValue: 1,
1267
1267
  min: 0
1268
- })), t.push(...validateOptionalString({
1268
+ })), t.push(...validateOptionalArray({
1269
+ normalized: e,
1270
+ field: "size",
1271
+ value: normalizeEmptyArray(e.size),
1272
+ length: 2
1273
+ })), Array.isArray(e.size) && e.size.length === 2) {
1274
+ let [n, r] = e.size;
1275
+ (typeof n != "number" || Number.isNaN(n) || n <= 0) && t.push("[size[0]]必须是>0的数字"), (typeof r != "number" || Number.isNaN(r) || r <= 0) && t.push("[size[1]]必须是>0的数字");
1276
+ }
1277
+ t.push(...validateOptionalString({
1269
1278
  normalized: e,
1270
1279
  field: "content",
1271
1280
  value: e.content,
@@ -1640,6 +1649,27 @@ function validatePopupCustom1Config(e, t) {
1640
1649
  }
1641
1650
  //#endregion
1642
1651
  //#region ../api/marker/validate.js
1652
+ var MARKER_TYPE_LIST = [
1653
+ "default",
1654
+ "default1",
1655
+ "default2",
1656
+ "default3",
1657
+ "flashIcon",
1658
+ "component",
1659
+ "customCom",
1660
+ "menuIcon",
1661
+ "flood",
1662
+ "capture",
1663
+ "anchor1",
1664
+ "anchor2",
1665
+ "anchor3",
1666
+ "anchor4",
1667
+ "anchor5",
1668
+ "anchor6",
1669
+ "html",
1670
+ "url",
1671
+ "lod"
1672
+ ];
1643
1673
  function iconMarker(e) {
1644
1674
  let t = [], n = { ...e };
1645
1675
  if (e.id === void 0 || e.id === null || e.id === "" ? n.id = generateUniqueId$1() : n.id = e.id, t.push(...validateCoordinatesRequired(e.coordinates)), t.push(...validateOptionalString({
@@ -1665,27 +1695,7 @@ function iconMarker(e) {
1665
1695
  value: e.markerType,
1666
1696
  defaultValue: "default",
1667
1697
  type: "string",
1668
- list: [
1669
- "default",
1670
- "default1",
1671
- "default2",
1672
- "default3",
1673
- "lod",
1674
- "flashIcon",
1675
- "component",
1676
- "customCom",
1677
- "menuIcon",
1678
- "flood",
1679
- "capture",
1680
- "anchor1",
1681
- "anchor2",
1682
- "anchor3",
1683
- "anchor4",
1684
- "anchor5",
1685
- "anchor6",
1686
- "html",
1687
- "url"
1688
- ]
1698
+ list: MARKER_TYPE_LIST
1689
1699
  })), e.recordData !== void 0) {
1690
1700
  let r = e.recordData;
1691
1701
  if (typeof r != "object" || !r || Array.isArray(r)) t.push({
@@ -1735,27 +1745,7 @@ function followMarker(e) {
1735
1745
  value: e.markerType,
1736
1746
  defaultValue: "default",
1737
1747
  type: "string",
1738
- list: [
1739
- "default",
1740
- "default1",
1741
- "default2",
1742
- "default3",
1743
- "lod",
1744
- "flashIcon",
1745
- "component",
1746
- "customCom",
1747
- "menuIcon",
1748
- "flood",
1749
- "capture",
1750
- "anchor1",
1751
- "anchor2",
1752
- "anchor3",
1753
- "anchor4",
1754
- "anchor5",
1755
- "anchor6",
1756
- "html",
1757
- "url"
1758
- ]
1748
+ list: MARKER_TYPE_LIST
1759
1749
  })), e.recordData !== void 0) {
1760
1750
  let r = e.recordData;
1761
1751
  if (typeof r != "object" || !r || Array.isArray(r)) t.push({
@@ -2730,7 +2720,7 @@ function outline(e) {
2730
2720
  min: 0
2731
2721
  })), t.push(...validateOptionalNumber({
2732
2722
  normalized: n.config,
2733
- field: "meshBrightness",
2723
+ field: "meshOpacity",
2734
2724
  value: n.config.meshOpacity,
2735
2725
  defaultValue: .02,
2736
2726
  min: 0,
@@ -2753,6 +2743,102 @@ function removeAllOutline(e) {
2753
2743
  normalized: { ...e }
2754
2744
  };
2755
2745
  }
2746
+ var SLICE_MODE_LIST = [
2747
+ "None",
2748
+ "Color",
2749
+ "Texture",
2750
+ "Material"
2751
+ ];
2752
+ function validateBooleanField(e, t, n, r, i) {
2753
+ if (r == null) {
2754
+ t[n] = i;
2755
+ return;
2756
+ }
2757
+ if (typeof r != "boolean") {
2758
+ e.push(`[${n}]必须是布尔类型`);
2759
+ return;
2760
+ }
2761
+ t[n] = r;
2762
+ }
2763
+ function openSlice(e = {}) {
2764
+ let t = [], n = { ...e };
2765
+ return t.push(...validateRequiredString({
2766
+ normalized: n,
2767
+ field: "id",
2768
+ value: e.id
2769
+ })), t.push(...verifyEnumerationValue({
2770
+ normalized: n,
2771
+ field: "mode",
2772
+ value: e.mode,
2773
+ defaultValue: "None",
2774
+ type: "string",
2775
+ list: SLICE_MODE_LIST
2776
+ })), t.push(...validateOptionalColor({
2777
+ normalized: n,
2778
+ field: "color",
2779
+ value: e.color,
2780
+ defaultValue: "#FFFFFF00"
2781
+ })), t.push(...validateOptionalString({
2782
+ normalized: n,
2783
+ field: "texturePath",
2784
+ value: e.texturePath,
2785
+ defaultValue: ""
2786
+ })), t.push(...validateOptionalString({
2787
+ normalized: n,
2788
+ field: "materialName",
2789
+ value: e.materialName,
2790
+ defaultValue: ""
2791
+ })), t.push(...validateOptionalArray({
2792
+ normalized: n,
2793
+ field: "uvOffset",
2794
+ value: e.uvOffset,
2795
+ length: 2,
2796
+ defaultValue: [0, 0]
2797
+ })), t.push(...validateOptionalArray({
2798
+ normalized: n,
2799
+ field: "uvScale",
2800
+ value: e.uvScale,
2801
+ length: 2,
2802
+ defaultValue: [1, 1]
2803
+ })), validateBooleanField(t, n, "isWorldUV", e.isWorldUV, !1), t.push(...validateOptionalArray({
2804
+ normalized: n,
2805
+ field: "direction",
2806
+ value: e.direction,
2807
+ length: 3,
2808
+ defaultValue: [
2809
+ 0,
2810
+ 0,
2811
+ -1
2812
+ ]
2813
+ })), validateBooleanField(t, n, "isWorldDirection", e.isWorldDirection, !1), t.push(...validateOptionalNumber({
2814
+ normalized: n,
2815
+ field: "ratio",
2816
+ value: e.ratio,
2817
+ defaultValue: .5,
2818
+ min: 0,
2819
+ max: 1
2820
+ })), {
2821
+ errors: t,
2822
+ normalized: n
2823
+ };
2824
+ }
2825
+ function closeSlice(e = {}) {
2826
+ let t = [], n = { ...e };
2827
+ return t.push(...validateRequiredString({
2828
+ normalized: n,
2829
+ field: "id",
2830
+ value: e.id
2831
+ })), {
2832
+ errors: t,
2833
+ normalized: n
2834
+ };
2835
+ }
2836
+ function closeAllSlice(e = {}) {
2837
+ return {
2838
+ errors: [],
2839
+ normalized: { ...e }
2840
+ };
2841
+ }
2756
2842
  //#endregion
2757
2843
  //#region ../api/sceneModel/sceneModelApi.js
2758
2844
  var validator$5 = {
@@ -2770,7 +2856,10 @@ var validator$5 = {
2770
2856
  setOpacity,
2771
2857
  outline,
2772
2858
  removeOutline,
2773
- removeAllOutline
2859
+ removeAllOutline,
2860
+ openSlice,
2861
+ closeSlice,
2862
+ closeAllSlice
2774
2863
  }, SceneModelAPI = class {
2775
2864
  constructor(e) {
2776
2865
  this.commandManager = e;